So, this fixes compiling using clang, fixed some tabulation issues, and allow the sdljoy pad compile against SDL2. Also fixed a small compiling issue when compiled against wx3 with the dsound driver. Seems we need the Wx c string to work, it's still not exactly wx3 primetime but it's a small start.

This commit is contained in:
wowzaman12 2015-04-06 17:31:18 +00:00
parent c0e263592c
commit dc22721bac
6 changed files with 122 additions and 105 deletions

View File

@ -33,7 +33,7 @@ endif(ENABLE_OPENAL)
# adv is for wxAboutBox # adv is for wxAboutBox
# xml, html is for xrc # xml, html is for xrc
SET( wxWidgets_USE_LIBS xrc xml html adv gl net core base ) 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 ) FIND_PACKAGE ( wxWidgets REQUIRED )
#EXECUTE_PROCESS(COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}" --cxxflags) #EXECUTE_PROCESS(COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}" --cxxflags)
INCLUDE( ${wxWidgets_USE_FILE} ) INCLUDE( ${wxWidgets_USE_FILE} )

View File

@ -98,7 +98,7 @@ bool DirectSound::init(long sampleRate)
if(gopts.audio_dev.empty()) if(gopts.audio_dev.empty())
dev = DSDEVID_DefaultPlayback; dev = DSDEVID_DefaultPlayback;
else else
CLSIDFromString(const_cast<wxChar *>(gopts.audio_dev.c_str()), &dev); CLSIDFromString(const_cast<wxChar *>(gopts.audio_dev.wx_str()), &dev);
pDirectSound->Initialize( &dev ); pDirectSound->Initialize( &dev );
if( hr != DS_OK ) { if( hr != DS_OK ) {
wxLogError(_("Cannot create DirectSound %08x"), hr); wxLogError(_("Cannot create DirectSound %08x"), hr);

View File

@ -450,77 +450,88 @@ public:
// It might be safest to only support desc edits, and force the // It might be safest to only support desc edits, and force the
// user to re-enter codes to change them // user to re-enter codes to change them
int ncodes = isgb ? gbCheatNumber : cheatsNumber; int ncodes = isgb ? gbCheatNumber : cheatsNumber;
if(ncodes > id + 1) { if(ncodes > id + 1)
wxString codes[ncodes - id - 1]; {
wxString descs[ncodes - id - 1]; std::vector<wxString> codes;
bool checked[ncodes - id - 1]; std::vector<wxString> descs;
bool v3[ncodes - id - 1]; bool checked[ncodes - id - 1];
for(int i = id + 1; i < ncodes; i++) { bool v3[ncodes - id - 1];
codes[i - id - 1] = wxString(isgb ? for(int i = id + 1; i < ncodes; i++) {
gbCheatList[i].cheatCode : codes[i - id - 1] = wxString(isgb ?
cheatsList[i].codestring, gbCheatList[i].cheatCode :
wxConvLibc); cheatsList[i].codestring,
descs[i - id - 1] = wxString(isgb ? wxConvLibc);
gbCheatList[i].cheatDesc : descs[i - id - 1] = wxString(isgb ?
cheatsList[i].desc, gbCheatList[i].cheatDesc :
wxConvUTF8); cheatsList[i].desc,
checked[i - id - 1] = isgb ? gbCheatList[i].enabled : wxConvUTF8);
cheatsList[i].enabled; checked[i - id - 1] = isgb ? gbCheatList[i].enabled :
v3[i - id - 1] = isgb ? false : cheatsList[i].code == 257; cheatsList[i].enabled;
} v3[i - id - 1] = isgb ? false : cheatsList[i].code == 257;
for(int i = ncodes - 1; i >= id; i--) { }
list->DeleteItem(i); for(int i = ncodes - 1; i >= id; i--) {
if(isgb) list->DeleteItem(i);
gbCheatRemove(i); if(isgb)
else gbCheatRemove(i);
cheatsDelete(i, cheatsList[i].enabled); else
} cheatsDelete(i, cheatsList[i].enabled);
AddCheat(); }
if(!ochecked) { AddCheat();
if(isgb) if(!ochecked) {
gbCheatDisable(id); if(isgb)
else gbCheatDisable(id);
cheatsDisable(id); else
} cheatsDisable(id);
for(int i = id + 1; i < ncodes; i++) { }
ce_codes = codes[i - id - 1]; for(int i = id + 1; i < ncodes; i++) {
ce_desc = descs[i - id - 1]; ce_codes = codes[i - id - 1];
if(isgb) { ce_desc = descs[i - id - 1];
if(ce_codes.find(wxT('-')) == wxString::npos) if(isgb)
ce_type = 0; {
else if(ce_codes.find(wxT('-')) == wxString::npos)
ce_type = 1; ce_type = 0;
} else { else
if(ce_codes.find(wxT(':')) != wxString::npos) ce_type = 1;
ce_type = 0; }
else if(ce_codes.find(wxT(' ')) == wxString::npos) { else
ce_type = 1; {
if(v3[i - id - 1]) if(ce_codes.find(wxT(':')) != wxString::npos)
ce_codes.insert(8, 1, wxT(' ')); ce_type = 0;
} else else if(ce_codes.find(wxT(' ')) == wxString::npos)
ce_type = 2; {
} ce_type = 1;
AddCheat(); if(v3[i - id - 1])
if(!checked[i - id - 1]) { ce_codes.insert(8, 1, wxT(' '));
if(isgb) }
gbCheatDisable(i); else
else {
cheatsDisable(i); ce_type = 2;
} }
} }
} else { AddCheat();
list->DeleteItem(id); if(!checked[i - id - 1])
if(isgb) {
gbCheatRemove(id); if(isgb)
else gbCheatDisable(i);
cheatsDelete(id, cheatsList[id].enabled); else
AddCheat(); cheatsDisable(i);
if(!ochecked) { }
if(isgb) }
gbCheatDisable(id); }
else else
cheatsDisable(id); {
} 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); Reload(id);
} else if(ce_desc != odesc) { } else if(ce_desc != odesc) {
@ -3229,16 +3240,22 @@ void MainFrame::set_global_accels()
if(!accels[i].GetMenuItem()) if(!accels[i].GetMenuItem())
len++; len++;
if(len) { if(len) {
wxAcceleratorEntry tab[len]; wxAcceleratorEntry * tab = new wxAcceleratorEntry[len];
for(int i = 0, j = 0; i < accels.size(); i++) for(int i = 0, j = 0; i < accels.size(); i++)
if(!accels[i].GetMenuItem()) {
tab[j++] = accels[i]; if(!accels[i].GetMenuItem())
wxAcceleratorTable atab(len, tab); tab[j++] = accels[i];
// set the table on the panel, where focus usually is }
// otherwise accelerators are lost sometimes wxAcceleratorTable atab(len, tab);
panel->SetAcceleratorTable(atab); // set the table on the panel, where focus usually is
} else // otherwise accelerators are lost sometimes
panel->SetAcceleratorTable(wxNullAcceleratorTable); panel->SetAcceleratorTable(atab);
delete tab;
}
else
{
panel->SetAcceleratorTable(wxNullAcceleratorTable);
}
// save recent accels // save recent accels
for(int i = 0; i < 10; i++) for(int i = 0; i < 10; i++)

View File

@ -303,20 +303,20 @@ void GameArea::LoadGame(const wxString &name)
cheats_dirty = (did_autoload && !skipSaveGameCheats) || cheats_dirty = (did_autoload && !skipSaveGameCheats) ||
(loaded == IMAGE_GB ? gbCheatNumber > 0 : cheatsNumber > 0); (loaded == IMAGE_GB ? gbCheatNumber > 0 : cheatsNumber > 0);
if(gopts.autoload_cheats && (!did_autoload || skipSaveGameCheats)) { if(gopts.autoload_cheats && (!did_autoload || skipSaveGameCheats)) {
wxFileName cfn = loaded_game; wxFileName cfn = loaded_game;
// SetExt may strip something off by accident, so append to text instead // SetExt may strip something off by accident, so append to text instead
cfn.SetFullName(cfn.GetFullName() + wxT(".clt")); cfn.SetFullName(cfn.GetFullName() + wxT(".clt"));
if(cfn.IsFileReadable()) { if(cfn.IsFileReadable()) {
bool cld; bool cld;
if(loaded == IMAGE_GB) if(loaded == IMAGE_GB)
cld = gbCheatsLoadCheatList(cfn.GetFullPath().mb_fn_str()); cld = gbCheatsLoadCheatList(cfn.GetFullPath().mb_fn_str());
else else
cld = cheatsLoadCheatList(cfn.GetFullPath().mb_fn_str()); cld = cheatsLoadCheatList(cfn.GetFullPath().mb_fn_str());
if(cld) { if(cld) {
systemScreenMessage(_("Loaded cheats")); systemScreenMessage(_("Loaded cheats"));
cheats_dirty = false; cheats_dirty = false;
} }
} }
} }
} }

View File

@ -1,6 +1,6 @@
#include "wx/sdljoy.h" #include "wx/sdljoy.h"
#include <SDL/SDL.h> #include <SDL2/SDL.h>
#include <SDL/SDL_joystick.h> #include <SDL2/SDL_joystick.h>
#include <wx/window.h> #include <wx/window.h>
DEFINE_EVENT_TYPE(wxEVT_SDLJOY) DEFINE_EVENT_TYPE(wxEVT_SDLJOY)

View File

@ -2656,17 +2656,17 @@
<item>Bilinear Plus</item> <item>Bilinear Plus</item>
<item>Scanlines</item> <item>Scanlines</item>
<item>TV Mode</item> <item>TV Mode</item>
<item>HQ2x</item> <item>HQ 2x</item>
<item>LQ2x</item> <item>LQ 2x</item>
<item>Simple 2X</item> <item>Simple 2X</item>
<item>Simple 3x</item> <item>Simple 3x</item>
<item>HQ 3x</item> <item>HQ 3x</item>
<item>Simple 4x</item> <item>Simple 4x</item>
<item>HQ 4x</item> <item>HQ 4x</item>
<item>XBR 2x (note: Not available yet)</item> <item>XBRz 2x (note: Not available yet)</item>
<item>XBR 3x (note: Not available yet)</item> <item>XBRz 3x (note: Not available yet)</item>
<item>XBR 4x (note: Not available yet)</item> <item>XBRz 4x (note: Not available yet)</item>
<item>XBR 5x (note: Not available yet)</item> <item>XBRz 5x (note: Not available yet)</item>
<item>Plugin</item> <item>Plugin</item>
</content> </content>
</object> </object>