diff --git a/src/wx/CMakeLists.txt b/src/wx/CMakeLists.txt index bcc43f0b..89dd3b71 100644 --- a/src/wx/CMakeLists.txt +++ b/src/wx/CMakeLists.txt @@ -33,7 +33,7 @@ endif(ENABLE_OPENAL) # adv is for wxAboutBox # xml, html is for xrc SET( wxWidgets_USE_LIBS xrc xml html adv gl net core base ) -list(APPEND wxWidgets_CONFIG_OPTIONS --version=2.8) +#list(APPEND wxWidgets_CONFIG_OPTIONS --version=2.8) FIND_PACKAGE ( wxWidgets REQUIRED ) #EXECUTE_PROCESS(COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}" --cxxflags) INCLUDE( ${wxWidgets_USE_FILE} ) diff --git a/src/wx/dsound.cpp b/src/wx/dsound.cpp index b6d2e93a..2f6f83c6 100644 --- a/src/wx/dsound.cpp +++ b/src/wx/dsound.cpp @@ -98,7 +98,7 @@ bool DirectSound::init(long sampleRate) if(gopts.audio_dev.empty()) dev = DSDEVID_DefaultPlayback; else - CLSIDFromString(const_cast(gopts.audio_dev.c_str()), &dev); + CLSIDFromString(const_cast(gopts.audio_dev.wx_str()), &dev); pDirectSound->Initialize( &dev ); if( hr != DS_OK ) { wxLogError(_("Cannot create DirectSound %08x"), hr); diff --git a/src/wx/guiinit.cpp b/src/wx/guiinit.cpp index e660b140..9548ebe3 100644 --- a/src/wx/guiinit.cpp +++ b/src/wx/guiinit.cpp @@ -450,77 +450,88 @@ public: // It might be safest to only support desc edits, and force the // user to re-enter codes to change them int ncodes = isgb ? gbCheatNumber : cheatsNumber; - if(ncodes > id + 1) { - wxString codes[ncodes - id - 1]; - wxString descs[ncodes - id - 1]; - bool checked[ncodes - id - 1]; - bool v3[ncodes - id - 1]; - for(int i = id + 1; i < ncodes; i++) { - codes[i - id - 1] = wxString(isgb ? - gbCheatList[i].cheatCode : - cheatsList[i].codestring, - wxConvLibc); - descs[i - id - 1] = wxString(isgb ? - gbCheatList[i].cheatDesc : - cheatsList[i].desc, - wxConvUTF8); - checked[i - id - 1] = isgb ? gbCheatList[i].enabled : - cheatsList[i].enabled; - v3[i - id - 1] = isgb ? false : cheatsList[i].code == 257; - } - for(int i = ncodes - 1; i >= id; i--) { - list->DeleteItem(i); - if(isgb) - gbCheatRemove(i); - else - cheatsDelete(i, cheatsList[i].enabled); - } - AddCheat(); - if(!ochecked) { - if(isgb) - gbCheatDisable(id); - else - cheatsDisable(id); - } - for(int i = id + 1; i < ncodes; i++) { - ce_codes = codes[i - id - 1]; - ce_desc = descs[i - id - 1]; - if(isgb) { - if(ce_codes.find(wxT('-')) == wxString::npos) - ce_type = 0; - else - ce_type = 1; - } else { - if(ce_codes.find(wxT(':')) != wxString::npos) - ce_type = 0; - else if(ce_codes.find(wxT(' ')) == wxString::npos) { - ce_type = 1; - if(v3[i - id - 1]) - ce_codes.insert(8, 1, wxT(' ')); - } else - ce_type = 2; - } - AddCheat(); - if(!checked[i - id - 1]) { - if(isgb) - gbCheatDisable(i); - else - cheatsDisable(i); - } - } - } else { - list->DeleteItem(id); - if(isgb) - gbCheatRemove(id); - else - cheatsDelete(id, cheatsList[id].enabled); - AddCheat(); - if(!ochecked) { - if(isgb) - gbCheatDisable(id); - else - cheatsDisable(id); - } + if(ncodes > id + 1) + { + std::vector codes; + std::vector descs; + bool checked[ncodes - id - 1]; + bool v3[ncodes - id - 1]; + for(int i = id + 1; i < ncodes; i++) { + codes[i - id - 1] = wxString(isgb ? + gbCheatList[i].cheatCode : + cheatsList[i].codestring, + wxConvLibc); + descs[i - id - 1] = wxString(isgb ? + gbCheatList[i].cheatDesc : + cheatsList[i].desc, + wxConvUTF8); + checked[i - id - 1] = isgb ? gbCheatList[i].enabled : + cheatsList[i].enabled; + v3[i - id - 1] = isgb ? false : cheatsList[i].code == 257; + } + for(int i = ncodes - 1; i >= id; i--) { + list->DeleteItem(i); + if(isgb) + gbCheatRemove(i); + else + cheatsDelete(i, cheatsList[i].enabled); + } + AddCheat(); + if(!ochecked) { + if(isgb) + gbCheatDisable(id); + else + cheatsDisable(id); + } + for(int i = id + 1; i < ncodes; i++) { + ce_codes = codes[i - id - 1]; + ce_desc = descs[i - id - 1]; + if(isgb) + { + if(ce_codes.find(wxT('-')) == wxString::npos) + ce_type = 0; + else + ce_type = 1; + } + else + { + if(ce_codes.find(wxT(':')) != wxString::npos) + ce_type = 0; + else if(ce_codes.find(wxT(' ')) == wxString::npos) + { + ce_type = 1; + if(v3[i - id - 1]) + ce_codes.insert(8, 1, wxT(' ')); + } + else + { + ce_type = 2; + } + } + AddCheat(); + if(!checked[i - id - 1]) + { + if(isgb) + gbCheatDisable(i); + else + cheatsDisable(i); + } + } + } + else + { + list->DeleteItem(id); + if(isgb) + gbCheatRemove(id); + else + cheatsDelete(id, cheatsList[id].enabled); + AddCheat(); + if(!ochecked) { + if(isgb) + gbCheatDisable(id); + else + cheatsDisable(id); + } } Reload(id); } else if(ce_desc != odesc) { @@ -3229,16 +3240,22 @@ void MainFrame::set_global_accels() if(!accels[i].GetMenuItem()) len++; if(len) { - wxAcceleratorEntry tab[len]; - for(int i = 0, j = 0; i < accels.size(); i++) - if(!accels[i].GetMenuItem()) - tab[j++] = accels[i]; - wxAcceleratorTable atab(len, tab); - // set the table on the panel, where focus usually is - // otherwise accelerators are lost sometimes - panel->SetAcceleratorTable(atab); - } else - panel->SetAcceleratorTable(wxNullAcceleratorTable); + wxAcceleratorEntry * tab = new wxAcceleratorEntry[len]; + for(int i = 0, j = 0; i < accels.size(); i++) + { + if(!accels[i].GetMenuItem()) + tab[j++] = accels[i]; + } + wxAcceleratorTable atab(len, tab); + // set the table on the panel, where focus usually is + // otherwise accelerators are lost sometimes + panel->SetAcceleratorTable(atab); + delete tab; + } + else + { + panel->SetAcceleratorTable(wxNullAcceleratorTable); + } // save recent accels for(int i = 0; i < 10; i++) diff --git a/src/wx/panel.cpp b/src/wx/panel.cpp index af864bee..4fc66f35 100644 --- a/src/wx/panel.cpp +++ b/src/wx/panel.cpp @@ -303,20 +303,20 @@ void GameArea::LoadGame(const wxString &name) cheats_dirty = (did_autoload && !skipSaveGameCheats) || (loaded == IMAGE_GB ? gbCheatNumber > 0 : cheatsNumber > 0); if(gopts.autoload_cheats && (!did_autoload || skipSaveGameCheats)) { - wxFileName cfn = loaded_game; - // SetExt may strip something off by accident, so append to text instead - cfn.SetFullName(cfn.GetFullName() + wxT(".clt")); - if(cfn.IsFileReadable()) { - bool cld; - if(loaded == IMAGE_GB) - cld = gbCheatsLoadCheatList(cfn.GetFullPath().mb_fn_str()); - else - cld = cheatsLoadCheatList(cfn.GetFullPath().mb_fn_str()); - if(cld) { - systemScreenMessage(_("Loaded cheats")); - cheats_dirty = false; - } - } + wxFileName cfn = loaded_game; + // SetExt may strip something off by accident, so append to text instead + cfn.SetFullName(cfn.GetFullName() + wxT(".clt")); + if(cfn.IsFileReadable()) { + bool cld; + if(loaded == IMAGE_GB) + cld = gbCheatsLoadCheatList(cfn.GetFullPath().mb_fn_str()); + else + cld = cheatsLoadCheatList(cfn.GetFullPath().mb_fn_str()); + if(cld) { + systemScreenMessage(_("Loaded cheats")); + cheats_dirty = false; + } + } } } diff --git a/src/wx/widgets/sdljoy.cpp b/src/wx/widgets/sdljoy.cpp index f792e47f..09cd47a0 100644 --- a/src/wx/widgets/sdljoy.cpp +++ b/src/wx/widgets/sdljoy.cpp @@ -1,6 +1,6 @@ #include "wx/sdljoy.h" -#include -#include +#include +#include #include DEFINE_EVENT_TYPE(wxEVT_SDLJOY) diff --git a/src/wx/wxvbam.xrc b/src/wx/wxvbam.xrc index f8276a4e..858bff90 100644 --- a/src/wx/wxvbam.xrc +++ b/src/wx/wxvbam.xrc @@ -2656,17 +2656,17 @@ Bilinear Plus Scanlines TV Mode - HQ2x - LQ2x + HQ 2x + LQ 2x Simple 2X Simple 3x HQ 3x Simple 4x HQ 4x - XBR 2x (note: Not available yet) - XBR 3x (note: Not available yet) - XBR 4x (note: Not available yet) - XBR 5x (note: Not available yet) + XBRz 2x (note: Not available yet) + XBRz 3x (note: Not available yet) + XBRz 4x (note: Not available yet) + XBRz 5x (note: Not available yet) Plugin