Fixed the joystick mapping getting converted to unicode in the conf file when they should not have been.

This commit is contained in:
skidau 2015-05-30 06:02:23 +00:00
parent 56a42ec50f
commit 18d429c2c0
4 changed files with 14 additions and 14 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=3.0) #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} )
@ -179,5 +179,5 @@ if(APPLE)
SET(MACOSX_BUNDLE_ICON_FILE vbam.icns) SET(MACOSX_BUNDLE_ICON_FILE vbam.icns)
SET_SOURCE_FILES_PROPERTIES(${VBAM_ICON} PROPERTIES MACOSX_PACKAGE_LOCATION Resources) SET_SOURCE_FILES_PROPERTIES(${VBAM_ICON} PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
endif(APPLE) endif(APPLE)
SET(WX_EXE_NAME wxvbam${CMAKE_EXECUTABLE_SUFFIX}) SET(WX_EXE_NAME wxvbam${CMAKE_EXECUTABLE_SUFFIX})

View File

@ -1743,7 +1743,7 @@ public:
for (int i = 0; i < NUM_KEYS; i++) for (int i = 0; i < NUM_KEYS; i++)
{ {
wxJoyKeyTextCtrl* tc = XRCCTRL_D(*p, wxString::FromUTF8(joynames[i]), wxJoyKeyTextCtrl); wxJoyKeyTextCtrl* tc = XRCCTRL_D(*p, joynames[i], wxJoyKeyTextCtrl);
if (clear) if (clear)
tc->SetValue(wxEmptyString); tc->SetValue(wxEmptyString);
@ -3632,7 +3632,7 @@ bool MainFrame::BindControls()
for (int j = 0; j < NUM_KEYS; j++) for (int j = 0; j < NUM_KEYS; j++)
{ {
wxJoyKeyTextCtrl* tc = XRCCTRL_D(*w, wxString::FromUTF8(joynames[j]), wxJoyKeyTextCtrl); wxJoyKeyTextCtrl* tc = XRCCTRL_D(*w, joynames[j], wxJoyKeyTextCtrl);
CheckThrowXRCError(tc, ToString(joynames[j])); CheckThrowXRCError(tc, ToString(joynames[j]));
wxWindow* p = tc->GetParent(); wxWindow* p = tc->GetParent();

View File

@ -102,14 +102,14 @@ const int num_def_accels = sizeof(default_accels) / sizeof(default_accels[0]);
// Note: this must match GUI widget names or GUI won't work // Note: this must match GUI widget names or GUI won't work
// This table's order determines tab order as well // This table's order determines tab order as well
const char* const joynames[NUM_KEYS] = const wxChar* const joynames[NUM_KEYS] =
{ {
("Up"), ("Down"), ("Left"), ("Right"), wxT("Up"), wxT("Down"), wxT("Left"), wxT("Right"),
("A"), ("B"), ("L"), ("R"), wxT("A"), wxT("B"), wxT("L"), wxT("R"),
("Select"), ("Start"), wxT("Select"), wxT("Start"),
("MotionUp"), ("MotionDown"), ("MotionLeft"), ("MotionRight"), wxT("MotionUp"), wxT("MotionDown"), wxT("MotionLeft"), wxT("MotionRight"),
("MotionIn"), ("MotionOut"), ("AutoA"), ("AutoB"), wxT("MotionIn"), wxT("MotionOut"), wxT("AutoA"), wxT("AutoB"),
("Speed"), ("Capture"), ("GS") wxT("Speed"), wxT("Capture"), wxT("GS")
}; };
wxJoyKeyBinding defkeys[NUM_KEYS * 2] = wxJoyKeyBinding defkeys[NUM_KEYS * 2] =
@ -388,7 +388,7 @@ void load_opts()
int i; int i;
for (i = 0; i < NUM_KEYS; i++) for (i = 0; i < NUM_KEYS; i++)
if (e == wxString::FromUTF8(joynames[i])) if (e == joynames[i])
break; break;
if (i == NUM_KEYS) if (i == NUM_KEYS)
@ -949,7 +949,7 @@ bool opt_set(const wxChar* name, const wxChar* val)
int kno; int kno;
for (kno = 0; kno < NUM_KEYS; kno++) for (kno = 0; kno < NUM_KEYS; kno++)
if (!wxStrcmp(wxString::FromUTF8(joynames[kno]), slat + 3)) if (!wxStrcmp(joynames[kno], slat + 3))
break; break;
if (kno == NUM_KEYS) if (kno == NUM_KEYS)

View File

@ -2,7 +2,7 @@
#define WX_OPTS_H #define WX_OPTS_H
#define NUM_KEYS 21 #define NUM_KEYS 21
extern const char* const joynames[NUM_KEYS]; extern const wxChar* const joynames[NUM_KEYS];
extern wxJoyKeyBinding defkeys[NUM_KEYS * 2]; // keyboard + joystick defaults extern wxJoyKeyBinding defkeys[NUM_KEYS * 2]; // keyboard + joystick defaults
extern struct opts_t extern struct opts_t