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
# 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} )

View File

@ -98,7 +98,7 @@ bool DirectSound::init(long sampleRate)
if(gopts.audio_dev.empty())
dev = DSDEVID_DefaultPlayback;
else
CLSIDFromString(const_cast<wxChar *>(gopts.audio_dev.c_str()), &dev);
CLSIDFromString(const_cast<wxChar *>(gopts.audio_dev.wx_str()), &dev);
pDirectSound->Initialize( &dev );
if( hr != DS_OK ) {
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
// 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<wxString> codes;
std::vector<wxString> 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++)

View File

@ -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;
}
}
}
}

View File

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

View File

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