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.

git-svn-id: https://svn.code.sf.net/p/vbam/code/trunk@1309 a31d4220-a93d-0410-bf67-fe4944624d44
This commit is contained in:
wowzaman12 2015-04-06 17:31:18 +00:00
parent 8e55e43f06
commit 1ab4b86c94
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,9 +450,10 @@ 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;
std::vector<wxString> descs;
bool checked[ncodes - id - 1]; bool checked[ncodes - id - 1];
bool v3[ncodes - id - 1]; bool v3[ncodes - id - 1];
for(int i = id + 1; i < ncodes; i++) { for(int i = id + 1; i < ncodes; i++) {
@ -485,30 +486,40 @@ public:
for(int i = id + 1; i < ncodes; i++) { for(int i = id + 1; i < ncodes; i++) {
ce_codes = codes[i - id - 1]; ce_codes = codes[i - id - 1];
ce_desc = descs[i - id - 1]; ce_desc = descs[i - id - 1];
if(isgb) { if(isgb)
{
if(ce_codes.find(wxT('-')) == wxString::npos) if(ce_codes.find(wxT('-')) == wxString::npos)
ce_type = 0; ce_type = 0;
else else
ce_type = 1; ce_type = 1;
} else { }
else
{
if(ce_codes.find(wxT(':')) != wxString::npos) if(ce_codes.find(wxT(':')) != wxString::npos)
ce_type = 0; ce_type = 0;
else if(ce_codes.find(wxT(' ')) == wxString::npos) { else if(ce_codes.find(wxT(' ')) == wxString::npos)
{
ce_type = 1; ce_type = 1;
if(v3[i - id - 1]) if(v3[i - id - 1])
ce_codes.insert(8, 1, wxT(' ')); ce_codes.insert(8, 1, wxT(' '));
} else }
else
{
ce_type = 2; ce_type = 2;
} }
}
AddCheat(); AddCheat();
if(!checked[i - id - 1]) { if(!checked[i - id - 1])
{
if(isgb) if(isgb)
gbCheatDisable(i); gbCheatDisable(i);
else else
cheatsDisable(i); cheatsDisable(i);
} }
} }
} else { }
else
{
list->DeleteItem(id); list->DeleteItem(id);
if(isgb) if(isgb)
gbCheatRemove(id); gbCheatRemove(id);
@ -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()) if(!accels[i].GetMenuItem())
tab[j++] = accels[i]; tab[j++] = accels[i];
}
wxAcceleratorTable atab(len, tab); wxAcceleratorTable atab(len, tab);
// set the table on the panel, where focus usually is // set the table on the panel, where focus usually is
// otherwise accelerators are lost sometimes // otherwise accelerators are lost sometimes
panel->SetAcceleratorTable(atab); panel->SetAcceleratorTable(atab);
} else delete tab;
}
else
{
panel->SetAcceleratorTable(wxNullAcceleratorTable); 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

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