nJoy: Added #ifdef INPUTCOMMON

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1994 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
John Peterson 2009-01-23 13:31:00 +00:00
parent 46da45a529
commit 361aed6811
2 changed files with 29 additions and 45 deletions

View File

@ -197,31 +197,10 @@ void DllConfig(HWND _hParent)
emulator_running = false; // Set it back to false emulator_running = false; // Set it back to false
} }
g_Config.Load(); // Load settings
// We don't need a parent for this wxDialog
//wxWindow win;
//win.SetHWND(_hParent);
//ConfigBox frame(&win);
//win.SetHWND(0);
m_frame = new ConfigBox(NULL);
m_frame->ShowModal();
#else
if (SDL_Init(SDL_INIT_JOYSTICK ) < 0)
{
printf("Could not initialize SDL! (%s)\n", SDL_GetError());
return;
}
g_Config.Load(); // load settings
#if defined(HAVE_WX) && HAVE_WX #if defined(HAVE_WX) && HAVE_WX
ConfigBox frame(NULL); g_Config.Load(); // Load settings
frame.ShowModal(); m_frame = new ConfigBox(NULL);
#endif m_frame->ShowModal();
#endif #endif
} }
@ -241,29 +220,34 @@ void Initialize(void *init)
// Debugging // Debugging
//Console::Open(); //Console::Open();
SPADInitialize *_PADInitialize = (SPADInitialize*)init; SPADInitialize *_PADInitialize = (SPADInitialize*)init;
Console::Print("Initialize: %i, %i\n", _PADInitialize->padNumber, SDL_WasInit(0)); #ifndef INPUTCOMMON
Console::Print("Initialize: %i, %i\n", _PADInitialize->padNumber, SDL_WasInit(0));
#endif
emulator_running = true; emulator_running = true;
#ifdef _DEBUG #ifdef _DEBUG
DEBUG_INIT(); DEBUG_INIT();
#endif #endif
/* SDL 1.3 use DirectInput instead of the old Microsoft Multimeda API, and with this we need
the SDL_INIT_VIDEO flag to */
if (!SDL_WasInit(0))
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK) < 0)
{
#ifdef _WIN32
MessageBox(NULL, SDL_GetError(), "Could not initialize SDL!", MB_ICONERROR);
#else
printf("Could not initialize SDL! (%s)\n", SDL_GetError());
#endif
return;
}
#ifdef _WIN32 #ifdef _WIN32
m_hWnd = (HWND)_PADInitialize->hWnd; m_hWnd = (HWND)_PADInitialize->hWnd;
#endif #endif
#ifndef INPUTCOMMON
/* SDL 1.3 use DirectInput instead of the old Microsoft Multimeda API, and with this we need
the SDL_INIT_VIDEO flag to */
if (!SDL_WasInit(0))
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK) < 0)
{
#ifdef _WIN32
MessageBox(NULL, SDL_GetError(), "Could not initialize SDL!", MB_ICONERROR);
#else
printf("Could not initialize SDL! (%s)\n", SDL_GetError());
#endif
return;
}
#endif
Search_Devices(); // Populate joyinfo for all attached devices Search_Devices(); // Populate joyinfo for all attached devices
g_Config.Load(); // Load joystick mapping, PadMapping[].ID etc g_Config.Load(); // Load joystick mapping, PadMapping[].ID etc
if (PadMapping[0].enabled) if (PadMapping[0].enabled)
@ -313,11 +297,7 @@ int Search_Devices()
// Warn the user if no PadMapping are detected // Warn the user if no PadMapping are detected
if (numjoy == 0) if (numjoy == 0)
{ {
#ifdef _WIN32 PanicAlert("No Joystick detected");
//MessageBox(NULL, "No Joystick detected!", NULL, MB_ICONWARNING);
#else
printf("No Joystick detected!\n");
#endif
return 0; return 0;
} }
@ -372,7 +352,9 @@ void Shutdown()
if (PadMapping[3].enabled && SDL_JoystickOpened(PadMapping[3].ID)) if (PadMapping[3].enabled && SDL_JoystickOpened(PadMapping[3].ID))
SDL_JoystickClose(joystate[3].joy); SDL_JoystickClose(joystate[3].joy);
SDL_Quit(); #ifndef INPUTCOMMON
SDL_Quit();
#endif
#ifdef _DEBUG #ifdef _DEBUG
DEBUG_QUIT(); DEBUG_QUIT();

View File

@ -95,6 +95,8 @@
// Define // Define
// ¯¯¯¯¯¯¯¯¯¯ // ¯¯¯¯¯¯¯¯¯¯
//#define INPUTCOMMON
#define INPUT_VERSION "0.3" #define INPUT_VERSION "0.3"
#define INPUT_STATE "PUBLIC RELEASE" #define INPUT_STATE "PUBLIC RELEASE"
#define RELDAY "21" #define RELDAY "21"