diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp index cce9d2fe33..06895fc1d2 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp @@ -18,6 +18,7 @@ #include "Globals.h" #include #include +#include #include "GLUtil.h" diff --git a/Source/Plugins/Plugin_VideoOGL/Src/main.cpp b/Source/Plugins/Plugin_VideoOGL/Src/main.cpp index 19634a1790..6bca6693d0 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/main.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/main.cpp @@ -84,7 +84,7 @@ void DoDllDebugger() //m_frame->Show(); } #else -void DllDebugger(HWND _hParent) { } +void DllDebugger(HWND _hParent, bool Show) { } void DoDllDebugger() { } #endif diff --git a/Source/Plugins/Plugin_nJoy_SDL/Src/Config.cpp b/Source/Plugins/Plugin_nJoy_SDL/Src/Config.cpp index 2de52e66d8..3676b44e2d 100644 --- a/Source/Plugins/Plugin_nJoy_SDL/Src/Config.cpp +++ b/Source/Plugins/Plugin_nJoy_SDL/Src/Config.cpp @@ -34,6 +34,7 @@ // Include // ŻŻŻŻŻŻŻŻŻ #include "nJoy.h" +#include "Common.h" Config g_Config; @@ -117,48 +118,39 @@ int Config::CheckForDuplicateJoypads(bool OK) ///////////////////////////////////////////////////////////////////////// // Notify the user about the multiple devices // ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ - int ReturnMessage; if(NumDuplicates > 0) { - wxString ExtendedText; - wxString MainText = wxString::Format(wxT( + std::string ExtendedText; + std::string MainText = "You have selected SaveByID for several identical joypads with the name '%s', because nJoy" " has no way of separating between them the settings for the last one will now be saved." " This may not be the settings you have intended to save. It is therefore recommended" " that you either unselect SaveByID for all but one of the identical joypads" " or disable them entirely." " If you are aware of this issue and want to keep the same settings for the identical" - " pads you can ignore this message.") - , joyinfo[joysticks[Duplicate].ID].Name); + " pads you can ignore this message."; + if (OK) // We got here from the OK button { - ExtendedText = wxString::Format(wxT( + ExtendedText = "\n\n[Select 'OK' to return to the configuration window. Select 'Cancel' to ignore this" - " message and close the configuration window and don't show this message again.]")); - - ReturnMessage = wxMessageBox(wxString::Format - (MainText + ExtendedText), wxT("Notice"), - (wxOK | wxCANCEL) | wxICON_INFORMATION, 0, 100); - if (ReturnMessage == wxCANCEL) g_Config.bSaveByIDNotice = false; + " message and close the configuration window and don't show this message again.]"; } else { - ExtendedText = wxString::Format(wxT( - "\n\n[Select 'Cancel' if you don't want to see this information again.]")); - - ReturnMessage = wxMessageBox(wxString::Format - (MainText + ExtendedText), wxT("Notice"), - (wxOK | wxCANCEL) | wxICON_INFORMATION, 0, 100); - if (ReturnMessage == wxCANCEL) g_Config.bSaveByIDNotice = false; + ExtendedText = + "\n\n[Select 'Cancel' if you don't want to see this information again.]"; } - } - else - { - ReturnMessage = -1; - } - return ReturnMessage; - ////////////////////////////////////// + bool ret = PanicYesNo((MainText + ExtendedText).c_str(), joyinfo[joysticks[Duplicate].ID].Name); + + if (ret) + g_Config.bSaveByIDNotice = false; + + return ret ? 4 : 16; + } + + return -1; } diff --git a/Source/Plugins/Plugin_nJoy_SDL/Src/nJoy.h b/Source/Plugins/Plugin_nJoy_SDL/Src/nJoy.h index 97dc764b8c..29713b580b 100644 --- a/Source/Plugins/Plugin_nJoy_SDL/Src/nJoy.h +++ b/Source/Plugins/Plugin_nJoy_SDL/Src/nJoy.h @@ -33,8 +33,9 @@ //#define USE_RUMBLE_DINPUT_HACK #include // System -#include -#include +#include +#include +#include #include #include "Common.h" // Common @@ -53,7 +54,6 @@ #pragma comment(lib, "SDL.lib") #pragma comment(lib, "comctl32.lib") #include - #include #define _CRT_SECURE_NO_WARNINGS #define DIRECTINPUT_VERSION 0x0800 #define WIN32_LEAN_AND_MEAN diff --git a/Source/Plugins/Plugin_nJoy_Testing/Src/SConscript b/Source/Plugins/Plugin_nJoy_Testing/Src/SConscript index 01076b85c6..1cfc4b426e 100644 --- a/Source/Plugins/Plugin_nJoy_Testing/Src/SConscript +++ b/Source/Plugins/Plugin_nJoy_Testing/Src/SConscript @@ -11,9 +11,12 @@ if not env['HAVE_SDL']: files = [ 'nJoy.cpp', - 'GUI/AboutBox.cpp', - 'GUI/ConfigBox.cpp', ] + +if not env['HAVE_WX'] + files.Append('GUI/AboutBox.cpp', + 'GUI/ConfigBox.cpp', + ) padenv = env.Clone() padenv.Append( diff --git a/Source/Plugins/Plugin_nJoy_Testing/Src/nJoy.cpp b/Source/Plugins/Plugin_nJoy_Testing/Src/nJoy.cpp index b05f3af394..6f3aea3a09 100644 --- a/Source/Plugins/Plugin_nJoy_Testing/Src/nJoy.cpp +++ b/Source/Plugins/Plugin_nJoy_Testing/Src/nJoy.cpp @@ -80,6 +80,7 @@ HRESULT SetDeviceForcesXY(); bool CanRumble = false; #endif #ifdef _WIN32 +#if defined(HAVE_WX) && HAVE_WX ////////////////////////////////////////////////////////////////////////////////////////// // wxWidgets // ŻŻŻŻŻŻŻŻŻ @@ -93,6 +94,7 @@ class wxDLLApp : public wxApp IMPLEMENT_APP_NO_MAIN(wxDLLApp) WXDLLIMPEXP_BASE void wxSetInstance(HINSTANCE hInst); +#endif ////////////////////////////////////////////////////////////////////////////////////////// // DllMain @@ -106,6 +108,7 @@ BOOL APIENTRY DllMain( HINSTANCE hinstDLL, // DLL module handle { case DLL_PROCESS_ATTACH: { +#if defined(HAVE_WX) && HAVE_WX //use wxInitialize() if you don't want GUI instead of the following 12 lines wxSetInstance((HINSTANCE)hinstDLL); int argc = 0; @@ -114,11 +117,14 @@ BOOL APIENTRY DllMain( HINSTANCE hinstDLL, // DLL module handle if ( !wxTheApp || !wxTheApp->CallOnInit() ) return FALSE; +#endif } break; case DLL_PROCESS_DETACH: +#if defined(HAVE_WX) && HAVE_WX wxEntryCleanup(); //use wxUninitialize() if you don't want GUI +#endif break; default: @@ -165,12 +171,13 @@ void DllConfig(HWND _hParent) LoadConfig(); // load settings +#if defined(HAVE_WX) && HAVE_WX wxWindow win; win.SetHWND(_hParent); ConfigBox frame(&win); frame.ShowModal(); win.SetHWND(0); - +#endif #else if(SDL_Init(SDL_INIT_JOYSTICK ) < 0) { @@ -180,8 +187,10 @@ void DllConfig(HWND _hParent) LoadConfig(); // load settings +#if defined(HAVE_WX) && HAVE_WX ConfigBox frame(NULL); frame.ShowModal(); +#endif #endif } diff --git a/Source/Plugins/Plugin_nJoy_Testing/Src/nJoy.h b/Source/Plugins/Plugin_nJoy_Testing/Src/nJoy.h index 4d5d7d9e35..b1b5e559cf 100644 --- a/Source/Plugins/Plugin_nJoy_Testing/Src/nJoy.h +++ b/Source/Plugins/Plugin_nJoy_Testing/Src/nJoy.h @@ -67,6 +67,7 @@ #define SLEEP(x) Sleep(x) #else #include +#include #include #define SLEEP(x) usleep(x*1000) #endif