This should fix Issue 1798

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4760 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
ayuanx
2009-12-31 17:42:55 +00:00
parent 40f4dd30c2
commit ba25f038af
5 changed files with 38 additions and 23 deletions

View File

@ -129,10 +129,12 @@ PADConfigDialognJoy::PADConfigDialognJoy(wxWindow *parent, wxWindowID id, const
// Reset values
GetButtonWaitingID = 0; GetButtonWaitingTimer = 0;
// Start the constant timer
int TimesPerSecond = 10;
m_ConstantTimer->Start(1000 / TimesPerSecond);
if (NumGoodPads)
{
// Start the constant timer
int TimesPerSecond = 10;
m_ConstantTimer->Start(1000 / TimesPerSecond);
}
#endif
// wxEVT_KEY_DOWN is blocked for enter, tab and the directional keys
@ -166,6 +168,7 @@ void PADConfigDialognJoy::OnClose(wxCloseEvent& event)
// Close pads, unless we are running a game
//if (!g_EmulatorRunning) Shutdown();
g_FrameOpen = false;
EndModal(wxID_CLOSE);
}

View File

@ -48,6 +48,7 @@ std::vector<InputCommon::CONTROLLER_INFO> joyinfo;
InputCommon::CONTROLLER_STATE PadState[4];
InputCommon::CONTROLLER_MAPPING PadMapping[4];
bool g_EmulatorRunning = false;
bool g_FrameOpen = false;
int NumPads = 0, NumGoodPads = 0, LastPad = 0;
#ifdef _WIN32
HWND m_hWnd = NULL, m_hConsole = NULL; // Handle to window
@ -154,11 +155,13 @@ void SetDllGlobals(PLUGIN_GLOBALS* _pPluginGlobals)
// ------------------
void DllConfig(HWND _hParent)
{
// Init Joystick + Haptic (force feedback) subsystem on SDL 1.3
// Populate joyinfo for all attached devices
Search_Devices(joyinfo, NumPads, NumGoodPads);
g_Config.Load(); // load settings
if (!g_EmulatorRunning)
{
g_Config.Load(); // load settings
// Init Joystick + Haptic (force feedback) subsystem on SDL 1.3
// Populate joyinfo for all attached devices
Search_Devices(joyinfo, NumPads, NumGoodPads);
}
#if defined(HAVE_WX) && HAVE_WX
if (!m_ConfigFrame)
@ -168,9 +171,15 @@ void DllConfig(HWND _hParent)
// Only allow one open at a time
if (!m_ConfigFrame->IsShown())
{
g_FrameOpen = true;
m_ConfigFrame->ShowModal();
}
else
{
g_FrameOpen = false;
m_ConfigFrame->Hide();
}
#endif
}
@ -185,18 +194,20 @@ void Initialize(void *init)
g_PADInitialize = (SPADInitialize*)init;
g_EmulatorRunning = true;
#ifdef _WIN32
m_hWnd = (HWND)g_PADInitialize->hWnd;
#endif
#ifdef _WIN32
m_hWnd = (HWND)g_PADInitialize->hWnd;
#endif
#ifdef _DEBUG
DEBUG_INIT();
#endif
#ifdef _DEBUG
DEBUG_INIT();
#endif
// Populate joyinfo for all attached devices
Search_Devices(joyinfo, NumPads, NumGoodPads);
g_Config.Load(); // load settings
if (!g_FrameOpen)
{
g_Config.Load(); // load settings
// Populate joyinfo for all attached devices
Search_Devices(joyinfo, NumPads, NumGoodPads);
}
}
void Close_Devices()

View File

@ -95,6 +95,7 @@
#ifdef _WIN32
extern HWND m_hWnd, m_hConsole; // Handle to window
#endif
extern bool g_FrameOpen;
extern int NumPads, NumGoodPads, LastPad; // Number of goods pads
#endif