From 8f2d1136a779494b0f341f05ea568952915558a5 Mon Sep 17 00:00:00 2001 From: tmator Date: Tue, 20 Jan 2009 20:21:05 +0000 Subject: [PATCH] fix njoy build for non win32 os, and small osx64 build fix git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1965 8ced0084-cf51-0410-be5f-012b33b47a6e --- SConstruct | 1 + Source/Plugins/Plugin_DSP_HLE/Src/Debugger/File.cpp | 2 +- Source/Plugins/Plugin_PadSimple/Src/PadSimple.cpp | 7 ++----- Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigAdvanced.cpp | 2 ++ Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigBox.cpp | 6 ++++++ Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigJoypad.cpp | 4 +++- Source/Plugins/Plugin_nJoy_SDL/Src/nJoy.cpp | 4 ++++ 7 files changed, 19 insertions(+), 7 deletions(-) diff --git a/SConstruct b/SConstruct index 1ad0fab7b7..d8163c4a5f 100644 --- a/SConstruct +++ b/SConstruct @@ -211,6 +211,7 @@ env['HAVE_AO'] = conf.CheckPKG('ao') #osx 64 specifics if sys.platform == 'darwin': if env['osx'] == '64cocoa': + env['nowx'] = True compileFlags += ['-arch' , 'x86_64' ] conf.Define('MAP_32BIT', 0) diff --git a/Source/Plugins/Plugin_DSP_HLE/Src/Debugger/File.cpp b/Source/Plugins/Plugin_DSP_HLE/Src/Debugger/File.cpp index eb3dca0c37..ff19c54685 100644 --- a/Source/Plugins/Plugin_DSP_HLE/Src/Debugger/File.cpp +++ b/Source/Plugins/Plugin_DSP_HLE/Src/Debugger/File.cpp @@ -27,9 +27,9 @@ #if defined(HAVE_WX) && HAVE_WX #include "../Debugger/Debugger.h" -#include "../Debugger/File.h" extern CDebugger* m_frame; #endif +#include "../Debugger/File.h" // -------------------- // On and off diff --git a/Source/Plugins/Plugin_PadSimple/Src/PadSimple.cpp b/Source/Plugins/Plugin_PadSimple/Src/PadSimple.cpp index 2af537e56f..3b4b0cd9d1 100644 --- a/Source/Plugins/Plugin_PadSimple/Src/PadSimple.cpp +++ b/Source/Plugins/Plugin_PadSimple/Src/PadSimple.cpp @@ -179,9 +179,6 @@ void DllConfig(HWND _hParent) #elif defined(HAVE_WX) && HAVE_WX ConfigDialog frame(NULL); frame.ShowModal(); -#elif defined(HAVE_COCOA) && HAVE_COCOA - ConfigDialog frame(NULL); - frame.ShowModal(); #endif SaveConfig(); } @@ -511,10 +508,10 @@ void cocoa_Read(int _numPAD, SPADStatus* _pPADStatus) //printf("error prox client\n"); } - int cocoaKey = (int)[proxy keyCode]; + long cocoaKey = (long)[proxy keyCode]; int i; - if ((int)[proxy type] == 10) + if ((long)[proxy type] == 10) { for (i = 0; i < NUMCONTROLS; i++) { if (cocoaKey == pad[_numPAD].keyForControl[i]) { diff --git a/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigAdvanced.cpp b/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigAdvanced.cpp index 0095c7e8f4..09407de94b 100644 --- a/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigAdvanced.cpp +++ b/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigAdvanced.cpp @@ -229,7 +229,9 @@ std::string ShowStatus(int VirtualController) joysticks[0].ID, joysticks[1].ID, joysticks[2].ID, joysticks[3].ID, controllertype, triggertype, joy0, joy1, joy2, joy3, +#ifdef _WIN32 XInput::IsConnected(0), XInput::GetXI(0, XI_TRIGGER_L), XInput::GetXI(0, XI_TRIGGER_R), +#endif StrAxes.c_str(), StrHats.c_str(), StrBut.c_str(), Axes, Balls, Hats, Buttons ); diff --git a/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigBox.cpp b/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigBox.cpp index 0e3f4880ec..6674e4e8e8 100644 --- a/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigBox.cpp +++ b/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigBox.cpp @@ -366,7 +366,9 @@ void ConfigBox::UpdateGUI(int _notebookpage) m_JoyShoulderL[_notebookpage]->GetValue().ToLong(&Left); m_JoyShoulderR[_notebookpage]->GetValue().ToLong(&Right); bool AnalogTrigger = (Left >= 1000 || Right >= 1000); +#ifdef _WIN32 bool XInput = XInput::IsConnected(0); +#endif m_JoyDpadUp[_notebookpage]->Show(!Hat); m_JoyDpadLeft[_notebookpage]->Show(!Hat); @@ -390,7 +392,11 @@ void ConfigBox::UpdateGUI(int _notebookpage) m_CBShowAdvanced[_notebookpage]->SetValue(g_Config.bShowAdvanced); // Controller type values +#ifdef _WIN32 if (!XInput) m_TriggerType[_notebookpage]->SetSelection(CTL_TRIGGER_SDL); +#else + m_TriggerType[_notebookpage]->SetSelection(CTL_TRIGGER_SDL); +#endif // Advanced settings m_CoBDiagonal[_notebookpage]->SetValue(wxString::FromAscii(g_Config.SDiagonal.at(_notebookpage).c_str())); diff --git a/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigJoypad.cpp b/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigJoypad.cpp index 7452bc472d..9e4d6c0e1e 100644 --- a/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigJoypad.cpp +++ b/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigJoypad.cpp @@ -394,6 +394,7 @@ void ConfigBox::DoGetButtons(int GetId) } // Check for a XInput trigger +#ifdef _WIN32 if(XInput) { for(int i = 0; i <= XI_TRIGGER_R; i++) @@ -406,6 +407,7 @@ void ConfigBox::DoGetButtons(int GetId) } } } +#endif // Check for keyboard action if (g_Pressed && Button) @@ -495,4 +497,4 @@ void ConfigBox::DoGetButtons(int GetId) //Console::Print("IsRunning: %i\n", m_ButtonMappingTimer->IsRunning()); } -/////////////////////////////////////////////////////////// Configure button mapping \ No newline at end of file +/////////////////////////////////////////////////////////// Configure button mapping diff --git a/Source/Plugins/Plugin_nJoy_SDL/Src/nJoy.cpp b/Source/Plugins/Plugin_nJoy_SDL/Src/nJoy.cpp index 0e64eba9e6..b3218466db 100644 --- a/Source/Plugins/Plugin_nJoy_SDL/Src/nJoy.cpp +++ b/Source/Plugins/Plugin_nJoy_SDL/Src/nJoy.cpp @@ -731,16 +731,20 @@ void GetJoyState(int controller) joystate[controller].axis[CTL_SUB_Y] = SDL_JoystickGetAxis(joystate[controller].joy, joysticks[controller].axis[CTL_SUB_Y]); // Update trigger axises +#ifdef _WIN32 if (joysticks[controller].triggertype == CTL_TRIGGER_SDL) { +#endif joystate[controller].axis[CTL_L_SHOULDER] = SDL_JoystickGetAxis(joystate[controller].joy, joysticks[controller].buttons[CTL_L_SHOULDER] - 1000); joystate[controller].axis[CTL_R_SHOULDER] = SDL_JoystickGetAxis(joystate[controller].joy, joysticks[controller].buttons[CTL_R_SHOULDER] - 1000); +#ifdef _WIN32 } else { joystate[controller].axis[CTL_L_SHOULDER] = XInput::GetXI(0, joysticks[controller].buttons[CTL_L_SHOULDER] - 1000); joystate[controller].axis[CTL_R_SHOULDER] = XInput::GetXI(0, joysticks[controller].buttons[CTL_R_SHOULDER] - 1000); } +#endif /* Debugging Console::ClearScreen();