From 03ec9a2e088b0818bf02a5bc2ffda4a512cba2b7 Mon Sep 17 00:00:00 2001 From: Jordan Woyak Date: Thu, 28 Feb 2013 02:39:06 -0600 Subject: [PATCH] Kill some unnecessary c_str and use StrToWxStr in a few places that I missed. --- Source/Core/DolphinWX/Src/AboutDolphin.cpp | 2 +- Source/Core/DolphinWX/Src/CheatsWindow.cpp | 2 +- Source/Core/DolphinWX/Src/ConfigMain.cpp | 9 +++++---- Source/Core/DolphinWX/Src/Debugger/CodeView.cpp | 4 ++-- .../Core/DolphinWX/Src/Debugger/CodeWindow.cpp | 2 +- .../Src/Debugger/CodeWindowFunctions.cpp | 4 ++-- .../DolphinWX/Src/Debugger/DSPDebugWindow.cpp | 2 +- Source/Core/DolphinWX/Src/Debugger/JitWindow.cpp | 16 ++++++++-------- Source/Core/DolphinWX/Src/FrameAui.cpp | 4 ++-- Source/Core/DolphinWX/Src/FrameTools.cpp | 2 +- Source/Core/DolphinWX/Src/GameListCtrl.cpp | 10 +++++----- Source/Core/DolphinWX/Src/ISOProperties.cpp | 8 ++++---- Source/Core/DolphinWX/Src/InputConfigDiag.cpp | 8 ++++---- .../DolphinWX/Src/InputConfigDiagBitmaps.cpp | 4 ++-- Source/Core/DolphinWX/Src/NetWindow.cpp | 6 +++--- Source/Core/DolphinWX/Src/PatchAddEdit.cpp | 2 +- Source/Core/DolphinWX/Src/VideoConfigDiag.cpp | 14 +++++++------- Source/Core/DolphinWX/Src/VideoConfigDiag.h | 2 +- Source/Plugins/Plugin_VideoOGL/Src/Render.cpp | 2 +- .../Src/VideoConfigDialog.cpp | 2 +- 20 files changed, 53 insertions(+), 52 deletions(-) diff --git a/Source/Core/DolphinWX/Src/AboutDolphin.cpp b/Source/Core/DolphinWX/Src/AboutDolphin.cpp index eeecf18d48..5126274601 100644 --- a/Source/Core/DolphinWX/Src/AboutDolphin.cpp +++ b/Source/Core/DolphinWX/Src/AboutDolphin.cpp @@ -63,7 +63,7 @@ AboutDolphin::AboutDolphin(wxWindow *parent, wxWindowID id, "and should not be used to play games you do\n" "not legally own."; wxStaticText* const Message = new wxStaticText(this, wxID_ANY, - StrToWxStr(Text.c_str())); + StrToWxStr(Text)); Message->Wrap(GetSize().GetWidth()); wxBoxSizer* const sInfo = new wxBoxSizer(wxVERTICAL); diff --git a/Source/Core/DolphinWX/Src/CheatsWindow.cpp b/Source/Core/DolphinWX/Src/CheatsWindow.cpp index 1e0f714467..fb3c3cbb23 100644 --- a/Source/Core/DolphinWX/Src/CheatsWindow.cpp +++ b/Source/Core/DolphinWX/Src/CheatsWindow.cpp @@ -348,7 +348,7 @@ void wxCheatsWindow::OnEvent_ButtonUpdateLog_Press(wxCommandEvent& WXUNUSED (eve const std::vector &arLog = ActionReplay::GetSelfLog(); for (u32 i = 0; i < arLog.size(); i++) { - m_TextCtrl_Log->AppendText(StrToWxStr(arLog[i].c_str())); + m_TextCtrl_Log->AppendText(StrToWxStr(arLog[i])); } } diff --git a/Source/Core/DolphinWX/Src/ConfigMain.cpp b/Source/Core/DolphinWX/Src/ConfigMain.cpp index bdb4cdc7fe..068501c432 100644 --- a/Source/Core/DolphinWX/Src/ConfigMain.cpp +++ b/Source/Core/DolphinWX/Src/ConfigMain.cpp @@ -982,9 +982,9 @@ void CConfigMain::AddAudioBackends() for (std::vector::const_iterator iter = backends.begin(); iter != backends.end(); ++iter) { - BackendSelection->Append(StrToWxStr((*iter).c_str())); + BackendSelection->Append(StrToWxStr(*iter)); int num = BackendSelection->\ - FindString(StrToWxStr(SConfig::GetInstance().sBackend.c_str())); + FindString(StrToWxStr(SConfig::GetInstance().sBackend)); BackendSelection->SetSelection(num); } } @@ -1269,8 +1269,9 @@ void CConfigMain::ApploaderPathChanged(wxFileDirPickerEvent& WXUNUSED (event)) void CConfigMain::NANDRootChanged(wxFileDirPickerEvent& WXUNUSED (event)) { std::string NANDPath = - SConfig::GetInstance().m_NANDPath = File::GetUserPath(D_WIIROOT_IDX, WxStrToStr(NANDRoot->GetPath())); - NANDRoot->SetPath(wxString(NANDPath)); + SConfig::GetInstance().m_NANDPath = + File::GetUserPath(D_WIIROOT_IDX, WxStrToStr(NANDRoot->GetPath())); + NANDRoot->SetPath(StrToWxStr(NANDPath)); SConfig::GetInstance().m_SYSCONF->UpdateLocation(); DiscIO::cUIDsys::AccessInstance().UpdateLocation(); DiscIO::CSharedContent::AccessInstance().UpdateLocation(); diff --git a/Source/Core/DolphinWX/Src/Debugger/CodeView.cpp b/Source/Core/DolphinWX/Src/Debugger/CodeView.cpp index 3b22ca339d..31ad19d6da 100644 --- a/Source/Core/DolphinWX/Src/Debugger/CodeView.cpp +++ b/Source/Core/DolphinWX/Src/Debugger/CodeView.cpp @@ -253,7 +253,7 @@ void CCodeView::OnPopupMenu(wxCommandEvent& event) debugger->disasm(addr, disasm, 256); text = text + StringFromFormat("%08x: ", addr) + disasm + "\r\n"; } - wxTheClipboard->SetData(new wxTextDataObject(StrToWxStr(text.c_str()))); + wxTheClipboard->SetData(new wxTextDataObject(StrToWxStr(text))); } } break; @@ -300,7 +300,7 @@ void CCodeView::OnPopupMenu(wxCommandEvent& event) { wxTextEntryDialog input_symbol(this, StrToWxStr("Rename symbol:"), wxGetTextFromUserPromptStr, - StrToWxStr(symbol->name.c_str())); + StrToWxStr(symbol->name)); if (input_symbol.ShowModal() == wxID_OK) { symbol->name = WxStrToStr(input_symbol.GetValue()); diff --git a/Source/Core/DolphinWX/Src/Debugger/CodeWindow.cpp b/Source/Core/DolphinWX/Src/Debugger/CodeWindow.cpp index 1cff07c0f4..9172a3af9a 100644 --- a/Source/Core/DolphinWX/Src/Debugger/CodeWindow.cpp +++ b/Source/Core/DolphinWX/Src/Debugger/CodeWindow.cpp @@ -345,7 +345,7 @@ void CCodeWindow::UpdateCallstack() for (size_t i = 0; i < stack.size(); i++) { - int idx = callstack->Append(StrToWxStr(stack[i].Name.c_str())); + int idx = callstack->Append(StrToWxStr(stack[i].Name)); callstack->SetClientData(idx, (void*)(u64)stack[i].vAddress); } diff --git a/Source/Core/DolphinWX/Src/Debugger/CodeWindowFunctions.cpp b/Source/Core/DolphinWX/Src/Debugger/CodeWindowFunctions.cpp index a11783c010..7ec36131ff 100644 --- a/Source/Core/DolphinWX/Src/Debugger/CodeWindowFunctions.cpp +++ b/Source/Core/DolphinWX/Src/Debugger/CodeWindowFunctions.cpp @@ -66,7 +66,7 @@ void CCodeWindow::Load() std::string fontDesc; ini.Get("General", "DebuggerFont", &fontDesc); if (!fontDesc.empty()) - DebuggerFont.SetNativeFontInfoUserDesc(StrToWxStr(fontDesc.c_str())); + DebuggerFont.SetNativeFontInfoUserDesc(StrToWxStr(fontDesc)); // Boot to pause or not ini.Get("General", "AutomaticStart", &bAutomaticStart, false); @@ -366,7 +366,7 @@ void CCodeWindow::NotifyMapLoaded() symbols->Clear(); for (PPCSymbolDB::XFuncMap::iterator iter = g_symbolDB.GetIterator(); iter != g_symbolDB.End(); ++iter) { - int idx = symbols->Append(StrToWxStr(iter->second.name.c_str())); + int idx = symbols->Append(StrToWxStr(iter->second.name)); symbols->SetClientData(idx, (void*)&iter->second); } symbols->Thaw(); diff --git a/Source/Core/DolphinWX/Src/Debugger/DSPDebugWindow.cpp b/Source/Core/DolphinWX/Src/Debugger/DSPDebugWindow.cpp index 27da055990..e77b57399e 100644 --- a/Source/Core/DolphinWX/Src/Debugger/DSPDebugWindow.cpp +++ b/Source/Core/DolphinWX/Src/Debugger/DSPDebugWindow.cpp @@ -221,7 +221,7 @@ void DSPDebuggerLLE::UpdateSymbolMap() for (SymbolDB::XFuncMap::iterator iter = DSPSymbols::g_dsp_symbol_db.GetIterator(); iter != DSPSymbols::g_dsp_symbol_db.End(); ++iter) { - int idx = m_SymbolList->Append(StrToWxStr(iter->second.name.c_str())); + int idx = m_SymbolList->Append(StrToWxStr(iter->second.name)); m_SymbolList->SetClientData(idx, (void*)&iter->second); } m_SymbolList->Thaw(); diff --git a/Source/Core/DolphinWX/Src/Debugger/JitWindow.cpp b/Source/Core/DolphinWX/Src/Debugger/JitWindow.cpp index e80d206112..7f98af6c57 100644 --- a/Source/Core/DolphinWX/Src/Debugger/JitWindow.cpp +++ b/Source/Core/DolphinWX/Src/Debugger/JitWindow.cpp @@ -120,9 +120,9 @@ void CJitWindow::Compare(u32 em_address) } // Do not merge this "if" with the above - block_num changes inside it. if (block_num < 0) { - ppc_box->SetValue(wxString::FromAscii(StringFromFormat("(non-code address: %08x)", - em_address).c_str())); - x86_box->SetValue(wxString::FromAscii(StringFromFormat("(no translation)").c_str())); + ppc_box->SetValue(StrToWxStr(StringFromFormat("(non-code address: %08x)", + em_address))); + x86_box->SetValue(StrToWxStr(StringFromFormat("(no translation)"))); delete[] xDis; return; } @@ -151,7 +151,7 @@ void CJitWindow::Compare(u32 em_address) *sptr++ = 10; num_x86_instructions++; } - x86_box->SetValue(wxString::FromAscii((char*)xDis)); + x86_box->SetValue(StrToWxStr((char*)xDis)); // == Fill in ppc box u32 ppc_addr = block->originalAddress; @@ -190,11 +190,11 @@ void CJitWindow::Compare(u32 em_address) sptr += sprintf(sptr, "Num bytes: PPC: %i x86: %i (blowup: %i%%)\n", size * 4, block->codeSize, 100 * (block->codeSize / (4 * size) - 1)); - ppc_box->SetValue(wxString::FromAscii((char*)xDis)); + ppc_box->SetValue(StrToWxStr((char*)xDis)); } else { - ppc_box->SetValue(wxString::FromAscii(StringFromFormat( - "(non-code address: %08x)", em_address).c_str())); - x86_box->SetValue(wxString::FromAscii("---")); + ppc_box->SetValue(StrToWxStr(StringFromFormat( + "(non-code address: %08x)", em_address))); + x86_box->SetValue("---"); } delete[] xDis; diff --git a/Source/Core/DolphinWX/Src/FrameAui.cpp b/Source/Core/DolphinWX/Src/FrameAui.cpp index fd3cbb662b..6f10d46722 100644 --- a/Source/Core/DolphinWX/Src/FrameAui.cpp +++ b/Source/Core/DolphinWX/Src/FrameAui.cpp @@ -549,7 +549,7 @@ void CFrame::OnDropDownToolbarItem(wxAuiToolBarEvent& event) for (u32 i = 0; i < Perspectives.size(); i++) { wxMenuItem* mItem = new wxMenuItem(menuPopup, IDM_PERSPECTIVES_0 + i, - StrToWxStr(Perspectives[i].Name.c_str()), + StrToWxStr(Perspectives[i].Name), wxT(""), wxITEM_CHECK); menuPopup->Append(mItem); if (i == ActivePerspective) mItem->Check(true); @@ -871,7 +871,7 @@ void CFrame::LoadIniPerspectives() ini.Get(_Section.c_str(), "Width", &_Width, "70,25"); ini.Get(_Section.c_str(), "Height", &_Height, "80,80"); - Tmp.Perspective = StrToWxStr(_Perspective.c_str()); + Tmp.Perspective = StrToWxStr(_Perspective); SplitString(_Width, ',', _SWidth); SplitString(_Height, ',', _SHeight); diff --git a/Source/Core/DolphinWX/Src/FrameTools.cpp b/Source/Core/DolphinWX/Src/FrameTools.cpp index a1dcd959fe..4b1fc820a9 100644 --- a/Source/Core/DolphinWX/Src/FrameTools.cpp +++ b/Source/Core/DolphinWX/Src/FrameTools.cpp @@ -101,7 +101,7 @@ void CFrame::CreateMenu() drives = cdio_get_devices(); // Windows Limitation of 24 character drives for (unsigned int i = 0; i < drives.size() && i < 24; i++) { - externalDrive->Append(IDM_DRIVE1 + i, StrToWxStr(drives[i].c_str())); + externalDrive->Append(IDM_DRIVE1 + i, StrToWxStr(drives[i])); } fileMenu->AppendSeparator(); diff --git a/Source/Core/DolphinWX/Src/GameListCtrl.cpp b/Source/Core/DolphinWX/Src/GameListCtrl.cpp index d385b947e5..cab4c8125b 100644 --- a/Source/Core/DolphinWX/Src/GameListCtrl.cpp +++ b/Source/Core/DolphinWX/Src/GameListCtrl.cpp @@ -614,7 +614,7 @@ void CGameListCtrl::ScanForISOs() // Update with the progress (i) and the message dialog.Update(i, wxString::Format(_("Scanning %s"), - StrToWxStr(FileName).c_str())); + StrToWxStr(FileName))); if (dialog.WasCancelled()) break; @@ -1173,10 +1173,10 @@ void CGameListCtrl::CompressSelection(bool _compress) WxStrToStr(browseDialog.GetPath()), FileName); - if (wxFileExists(StrToWxStr(OutputFileName.c_str())) && + if (wxFileExists(StrToWxStr(OutputFileName)) && wxMessageBox( wxString::Format(_("The file %s already exists.\nDo you wish to replace it?"), - StrToWxStr(OutputFileName).c_str()), + StrToWxStr(OutputFileName)), _("Confirm File Overwrite"), wxYES_NO) == wxNO) continue; @@ -1201,10 +1201,10 @@ void CGameListCtrl::CompressSelection(bool _compress) WxStrToStr(browseDialog.GetPath()), FileName); - if (wxFileExists(StrToWxStr(OutputFileName.c_str())) && + if (wxFileExists(StrToWxStr(OutputFileName)) && wxMessageBox( wxString::Format(_("The file %s already exists.\nDo you wish to replace it?"), - StrToWxStr(OutputFileName).c_str()), + StrToWxStr(OutputFileName)), _("Confirm File Overwrite"), wxYES_NO) == wxNO) continue; diff --git a/Source/Core/DolphinWX/Src/ISOProperties.cpp b/Source/Core/DolphinWX/Src/ISOProperties.cpp index e739ff043b..6434c8cd54 100644 --- a/Source/Core/DolphinWX/Src/ISOProperties.cpp +++ b/Source/Core/DolphinWX/Src/ISOProperties.cpp @@ -728,7 +728,7 @@ void CISOProperties::ExportDir(const char* _rFullPath, const char* _rExportFolde (u32)(((float)(i - index[0]) / (float)(index[1] - index[0])) * 100))); dialog.Update(i, wxString::Format(_("Extracting %s"), - StrToWxStr(fst[i]->m_FullPath).c_str())); + StrToWxStr(fst[i]->m_FullPath))); if (dialog.WasCancelled()) break; @@ -990,7 +990,7 @@ void CISOProperties::LoadGameConfig() GameIni.Get("EmuState", "EmulationIssues", &sTemp); if (!sTemp.empty()) { - EmuIssues->SetValue(StrToWxStr(sTemp.c_str())); + EmuIssues->SetValue(StrToWxStr(sTemp)); } EmuIssues->Enable(EmuState->GetSelection() != 0); @@ -1157,7 +1157,7 @@ void CISOProperties::PatchList_Load() for (std::vector::const_iterator it = onFrame.begin(); it != onFrame.end(); ++it) { PatchEngine::Patch p = *it; - Patches->Append(StrToWxStr(p.name.c_str())); + Patches->Append(StrToWxStr(p.name)); Patches->Check(index, p.active); ++index; } @@ -1366,5 +1366,5 @@ void CISOProperties::ChangeBannerDetails(int lang) SplitPath(OpenGameListItem->GetFileName(), 0, &filename, &extension); // Also sets the window's title SetTitle(StrToWxStr(StringFromFormat("%s%s: %s - ", filename.c_str(), - extension.c_str(), OpenGameListItem->GetUniqueID().c_str()).c_str()) + shortName); + extension.c_str(), OpenGameListItem->GetUniqueID().c_str())) + shortName); } diff --git a/Source/Core/DolphinWX/Src/InputConfigDiag.cpp b/Source/Core/DolphinWX/Src/InputConfigDiag.cpp index d8a755aca6..1df215fb1e 100644 --- a/Source/Core/DolphinWX/Src/InputConfigDiag.cpp +++ b/Source/Core/DolphinWX/Src/InputConfigDiag.cpp @@ -34,7 +34,7 @@ void GamepadPage::ConfigExtension(wxCommandEvent& event) if (ex->switch_extension) { wxDialog dlg(this, -1, - StrToWxStr(ex->attachments[ex->switch_extension]->GetName().c_str()), + StrToWxStr(ex->attachments[ex->switch_extension]->GetName()), wxDefaultPosition, wxDefaultSize); wxBoxSizer* const main_szr = new wxBoxSizer(wxVERTICAL); @@ -64,7 +64,7 @@ PadSettingExtension::PadSettingExtension(wxWindow* const parent, ControllerEmu:: e = extension->attachments.end(); for (; i!=e; ++i) - ((wxChoice*)wxcontrol)->Append(StrToWxStr((*i)->GetName().c_str())); + ((wxChoice*)wxcontrol)->Append(StrToWxStr((*i)->GetName())); UpdateGUI(); } @@ -612,7 +612,7 @@ void GamepadPage::DeleteProfile(wxCommandEvent&) if (File::Exists(fnamecstr) && AskYesNoT("Are you sure you want to delete \"%s\"?", - WxStrToStr(profile_cbox->GetValue()).c_str())) + WxStrToStr(profile_cbox->GetValue()))) { File::Delete(fnamecstr); @@ -952,7 +952,7 @@ GamepadPage::GamepadPage(wxWindow* parent, InputPlugin& plugin, const unsigned i InputConfigDialog::InputConfigDialog(wxWindow* const parent, InputPlugin& plugin, const std::string& name, const int tab_num) - : wxDialog(parent, wxID_ANY, StrToWxStr(name.c_str()), wxPoint(128,-1), wxDefaultSize) + : wxDialog(parent, wxID_ANY, StrToWxStr(name), wxPoint(128,-1), wxDefaultSize) , m_plugin(plugin) { m_pad_notebook = new wxNotebook(this, -1, wxDefaultPosition, wxDefaultSize, wxNB_DEFAULT); diff --git a/Source/Core/DolphinWX/Src/InputConfigDiagBitmaps.cpp b/Source/Core/DolphinWX/Src/InputConfigDiagBitmaps.cpp index 4e07ed990d..efb7db59af 100644 --- a/Source/Core/DolphinWX/Src/InputConfigDiagBitmaps.cpp +++ b/Source/Core/DolphinWX/Src/InputConfigDiagBitmaps.cpp @@ -228,7 +228,7 @@ void InputConfigDialog::UpdateBitmaps(wxTimerEvent& WXUNUSED(event)) // text const char* const name = (*g)->control_group->controls[n]->name; // bit of hax so ZL, ZR show up as L, R - dc.DrawText(StrToWxStr((name[1] && name[1] < 'a') ? name[1] : name[0]), n*12 + 2, 1); + dc.DrawText(StrToWxStr(std::string(1, (name[1] && name[1] < 'a') ? name[1] : name[0])), n*12 + 2, 1); } delete[] bitmasks; @@ -300,7 +300,7 @@ void InputConfigDialog::UpdateBitmaps(wxTimerEvent& WXUNUSED(event)) // text dc.DrawText(StrToWxStr((*g)->control_group->controls[n+trigger_count]->name), 3, n*12 + 1); - dc.DrawText(StrToWxStr((*g)->control_group->controls[n]->name[0]), 64 + 3, n*12 + 1); + dc.DrawText(StrToWxStr(std::string(1, (*g)->control_group->controls[n]->name[0])), 64 + 3, n*12 + 1); } // threshold box diff --git a/Source/Core/DolphinWX/Src/NetWindow.cpp b/Source/Core/DolphinWX/Src/NetWindow.cpp index d9fd5e6ca0..988ccae83e 100644 --- a/Source/Core/DolphinWX/Src/NetWindow.cpp +++ b/Source/Core/DolphinWX/Src/NetWindow.cpp @@ -73,7 +73,7 @@ NetPlaySetupDiag::NetPlaySetupDiag(wxWindow* const parent, const CGameListCtrl* std::string address; netplay_section.Get("Address", &address, "localhost"); - m_connect_ip_text = new wxTextCtrl(connect_tab, wxID_ANY, StrToWxStr(address.c_str())); + m_connect_ip_text = new wxTextCtrl(connect_tab, wxID_ANY, StrToWxStr(address)); wxStaticText* const port_lbl = new wxStaticText(connect_tab, wxID_ANY, _("Port :"), wxDefaultPosition, wxDefaultSize); @@ -81,7 +81,7 @@ NetPlaySetupDiag::NetPlaySetupDiag(wxWindow* const parent, const CGameListCtrl* // string? w/e std::string port; netplay_section.Get("ConnectPort", &port, "2626"); - m_connect_port_text = new wxTextCtrl(connect_tab, wxID_ANY, StrToWxStr(port.c_str())); + m_connect_port_text = new wxTextCtrl(connect_tab, wxID_ANY, StrToWxStr(port)); wxButton* const connect_btn = new wxButton(connect_tab, wxID_ANY, _("Connect")); connect_btn->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &NetPlaySetupDiag::OnJoin, this); @@ -114,7 +114,7 @@ NetPlaySetupDiag::NetPlaySetupDiag(wxWindow* const parent, const CGameListCtrl* // string? w/e std::string port; netplay_section.Get("HostPort", &port, "2626"); - m_host_port_text = new wxTextCtrl(host_tab, wxID_ANY, StrToWxStr(port.c_str())); + m_host_port_text = new wxTextCtrl(host_tab, wxID_ANY, StrToWxStr(port)); wxButton* const host_btn = new wxButton(host_tab, wxID_ANY, _("Host")); host_btn->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &NetPlaySetupDiag::OnHost, this); diff --git a/Source/Core/DolphinWX/Src/PatchAddEdit.cpp b/Source/Core/DolphinWX/Src/PatchAddEdit.cpp index 3199240d74..ead7918d34 100644 --- a/Source/Core/DolphinWX/Src/PatchAddEdit.cpp +++ b/Source/Core/DolphinWX/Src/PatchAddEdit.cpp @@ -49,7 +49,7 @@ void CPatchAddEdit::CreateGUIControls(int _selection) } else { - currentName = StrToWxStr(onFrame.at(_selection).name.c_str()); + currentName = StrToWxStr(onFrame.at(_selection).name); tempEntries = onFrame.at(_selection).entries; } diff --git a/Source/Core/DolphinWX/Src/VideoConfigDiag.cpp b/Source/Core/DolphinWX/Src/VideoConfigDiag.cpp index 7c8a3b7e04..154a5bc602 100644 --- a/Source/Core/DolphinWX/Src/VideoConfigDiag.cpp +++ b/Source/Core/DolphinWX/Src/VideoConfigDiag.cpp @@ -212,9 +212,9 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con it = g_available_video_backends.begin(), itend = g_available_video_backends.end(); for (; it != itend; ++it) - choice_backend->AppendString(wxGetTranslation(StrToWxStr((*it)->GetName().c_str()))); + choice_backend->AppendString(wxGetTranslation(StrToWxStr((*it)->GetName()))); - choice_backend->SetStringSelection(wxGetTranslation(StrToWxStr(g_video_backend->GetName().c_str()))); + choice_backend->SetStringSelection(wxGetTranslation(StrToWxStr(g_video_backend->GetName()))); choice_backend->Bind(wxEVT_COMMAND_CHOICE_SELECTED, &VideoConfigDiag::Event_Backend, this); szr_basic->Add(label_backend, 1, wxALIGN_CENTER_VERTICAL, 5); @@ -236,7 +236,7 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con it = vconfig.backend_info.Adapters.begin(), itend = vconfig.backend_info.Adapters.end(); for (; it != itend; ++it) - choice_adapter->AppendString(StrToWxStr(it->c_str())); + choice_adapter->AppendString(StrToWxStr(*it)); choice_adapter->Select(vconfig.iAdapter); @@ -259,7 +259,7 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con RegisterControl(choice_display_resolution, wxGetTranslation(display_res_desc)); choice_display_resolution->Bind(wxEVT_COMMAND_CHOICE_SELECTED, &VideoConfigDiag::Event_DisplayResolution, this); - choice_display_resolution->SetStringSelection(StrToWxStr(SConfig::GetInstance().m_LocalCoreStartupParameter.strFullscreenResolution.c_str())); + choice_display_resolution->SetStringSelection(StrToWxStr(SConfig::GetInstance().m_LocalCoreStartupParameter.strFullscreenResolution)); szr_display->Add(label_display_resolution, 1, wxALIGN_CENTER_VERTICAL, 0); szr_display->Add(choice_display_resolution); @@ -355,7 +355,7 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con it = vconfig.backend_info.AAModes.begin(), itend = vconfig.backend_info.AAModes.end(); for (; it != itend; ++it) - choice_aamode->AppendString(wxGetTranslation(StrToWxStr(it->c_str()))); + choice_aamode->AppendString(wxGetTranslation(StrToWxStr(*it))); choice_aamode->Select(vconfig.iMultisampleMode); szr_enh->Add(text_aamode, 1, wxALIGN_CENTER_VERTICAL, 0); @@ -380,12 +380,12 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con it = vconfig.backend_info.PPShaders.begin(), itend = vconfig.backend_info.PPShaders.end(); for (; it != itend; ++it) - choice_ppshader->AppendString(StrToWxStr(it->c_str())); + choice_ppshader->AppendString(StrToWxStr(*it)); if (vconfig.sPostProcessingShader.empty()) choice_ppshader->Select(0); else - choice_ppshader->SetStringSelection(StrToWxStr(vconfig.sPostProcessingShader.c_str())); + choice_ppshader->SetStringSelection(StrToWxStr(vconfig.sPostProcessingShader)); choice_ppshader->Bind(wxEVT_COMMAND_CHOICE_SELECTED, &VideoConfigDiag::Event_PPShader, this); diff --git a/Source/Core/DolphinWX/Src/VideoConfigDiag.h b/Source/Core/DolphinWX/Src/VideoConfigDiag.h index 8507fffdc1..90a42c34a1 100644 --- a/Source/Core/DolphinWX/Src/VideoConfigDiag.h +++ b/Source/Core/DolphinWX/Src/VideoConfigDiag.h @@ -100,7 +100,7 @@ protected: else { // Select current backend again - choice_backend->SetStringSelection(StrToWxStr(g_video_backend->GetName().c_str())); + choice_backend->SetStringSelection(StrToWxStr(g_video_backend->GetName())); } } diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp index d0bb94a39a..f0213578c5 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp @@ -1539,7 +1539,7 @@ void TakeScreenshot(ScrStrct* threadStruct) // Save the screenshot and finally kill the wxImage object // This is really expensive when saving to PNG, but not at all when using BMP - threadStruct->img->SaveFile(StrToWxStr(threadStruct->filename.c_str()), + threadStruct->img->SaveFile(StrToWxStr(threadStruct->filename), wxBITMAP_TYPE_PNG); threadStruct->img->Destroy(); diff --git a/Source/Plugins/Plugin_VideoSoftware/Src/VideoConfigDialog.cpp b/Source/Plugins/Plugin_VideoSoftware/Src/VideoConfigDialog.cpp index 670c3f9c6d..e7122d2f71 100644 --- a/Source/Plugins/Plugin_VideoSoftware/Src/VideoConfigDialog.cpp +++ b/Source/Plugins/Plugin_VideoSoftware/Src/VideoConfigDialog.cpp @@ -34,7 +34,7 @@ IntegerSetting::IntegerSetting(wxWindow* parent, const wxString& label, T& se VideoConfigDialog::VideoConfigDialog(wxWindow* parent, const std::string& title, const std::string& _ininame) : wxDialog(parent, -1, - wxString(wxT("Dolphin ")).append(StrToWxStr(title.c_str())).append(wxT(" Graphics Configuration")), + wxString(wxT("Dolphin ")).append(StrToWxStr(title)).append(wxT(" Graphics Configuration")), wxDefaultPosition, wxDefaultSize), vconfig(g_SWVideoConfig), ininame(_ininame)