Gamepad (minor) > Disabled LiveUpdates, it's not stable in the current form

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4552 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
John Peterson 2009-11-13 01:52:15 +00:00
parent 00f2a30b71
commit ee88afce58
8 changed files with 24 additions and 31 deletions

View File

@ -114,13 +114,6 @@ WiimotePadConfigDialog::WiimotePadConfigDialog(wxWindow *parent, wxWindowID id,
// Reset values
GetButtonWaitingID = 0;
GetButtonWaitingTimer = 0;
// Settings
// Only tested in Windows
#ifdef _WIN32
LiveUpdates = true;
#else
LiveUpdates = false;
#endif
// Start the slow timer
int TimesPerSecond = 2;

View File

@ -61,6 +61,7 @@ class WiimotePadConfigDialog : public wxDialog
void OnButtonTimer(wxTimerEvent& WXUNUSED(event)) { DoGetButtons(GetButtonWaitingID); }
void Update(wxTimerEvent& WXUNUSED(event));
void UpdatePad(wxTimerEvent& WXUNUSED(event));
void UpdateDeviceList();
wxTimer *m_Update,
*m_UpdatePad,
@ -253,7 +254,6 @@ class WiimotePadConfigDialog : public wxDialog
};
void OnClose(wxCloseEvent& event);
void UpdateDeviceList();
void CreatePadGUIControls();
void GeneralSettingsChanged(wxCommandEvent& event);

View File

@ -59,6 +59,12 @@ bool g_Encryption; // Encryption on or off
// Gamepad input
int NumPads = 0, NumDIDevices = -1; // Number of pads
bool SDLPolling = true;
#ifdef _WIN32
bool LiveUpdates = false;
#else
bool LiveUpdates = false;
#endif
std::vector<InputCommon::CONTROLLER_INFO> joyinfo;
InputCommon::CONTROLLER_STATE_NEW PadState[4];
InputCommon::CONTROLLER_MAPPING_NEW PadMapping[4];

View File

@ -184,6 +184,7 @@ static const u8 partially_id[] =
// Gamepad input
extern int NumPads, NumDIDevices; // Number of pads
extern bool SDLPolling; // Turn off polling
extern bool LiveUpdates;
extern std::vector<InputCommon::CONTROLLER_INFO> joyinfo;
extern InputCommon::CONTROLLER_STATE_NEW PadState[4];
extern InputCommon::CONTROLLER_MAPPING_NEW PadMapping[4];

View File

@ -57,29 +57,24 @@ bool LocalSearchDevices(std::vector<InputCommon::CONTROLLER_INFO> &_joyinfo, int
return bSuccess;
}
bool LocalSearchDevicesReset(std::vector<InputCommon::CONTROLLER_INFO> &_joyinfo, int &_NumPads)
{
DEBUG_LOG(CONSOLE, "LocalSearchDevicesReset");
// Turn off device polling while resetting
EnablePolling(false);
bool bSuccess = InputCommon::SearchDevicesReset(_joyinfo, _NumPads);
bool bSuccess = InputCommon::SearchDevicesReset(_joyinfo, _NumPads);
DoLocalSearchDevices(_joyinfo, _NumPads);
EnablePolling(true);
DoLocalSearchDevices(_joyinfo, _NumPads);
return bSuccess;
return true;
}
// Fill joyinfo with the current connected devices
bool DoLocalSearchDevices(std::vector<InputCommon::CONTROLLER_INFO> &_joyinfo, int &_NumPads)
{
//DEBUG_LOG(WIIMOTE, "LocalSearchDevices");
// Turn off device polling while searching
WiiMoteEmu::EnablePolling(false);
bool bReturn = InputCommon::SearchDevices(_joyinfo, _NumPads);
// Warn the user if no gamepads are detected
if (_NumPads == 0 && g_EmulatorRunning)
@ -108,9 +103,7 @@ bool DoLocalSearchDevices(std::vector<InputCommon::CONTROLLER_INFO> &_joyinfo, i
if (!Match) PadState[i].joy = NULL;
}
WiiMoteEmu::EnablePolling(true);
return bReturn;
return true;
}
// Is the device connected?
@ -147,6 +140,7 @@ void EnablePolling(bool Enable)
}
}
// ID to Name
// ----------------
std::string IDToName(int ID)
@ -219,10 +213,10 @@ void GetJoyState(InputCommon::CONTROLLER_STATE_NEW &_PadState, InputCommon::CONT
//DEBUG_LOG(WIIMOTE, "GetJoyState: Polling:%i NumPads:%i", SDLPolling, NumPads);
// Return if polling is off
if (!IsPolling) return;
if (!IsPolling()) return;
// Update joyinfo handles. This is in case the Wiimote plugin has restarted SDL after a pad was conencted/disconnected
// so that the handles are updated. We don't need to run this this often. Once a second would be enough.
LocalSearchDevices(joyinfo, NumPads);
if (LiveUpdates) LocalSearchDevices(joyinfo, NumPads);
// Return if we have no pads
if (NumPads == 0) return;
// Read info

View File

@ -121,12 +121,6 @@ PADConfigDialognJoy::PADConfigDialognJoy(wxWindow *parent, wxWindowID id, const
// Settings
Debugging = false;
// Only tested in Windows
#ifdef _WIN32
LiveUpdates = true;
#else
LiveUpdates = false;
#endif
// Create controls
CreateGUIControls();

View File

@ -49,6 +49,11 @@ InputCommon::CONTROLLER_STATE PadState[4];
InputCommon::CONTROLLER_MAPPING PadMapping[4];
bool g_EmulatorRunning = false;
bool SDLPolling = true;
#ifdef _WIN32
bool LiveUpdates = false;
#else
bool LiveUpdates = false;
#endif
int NumPads = 0, NumDIDevices = -1, LastPad = 0;
#ifdef _WIN32
HWND m_hWnd = NULL, m_hConsole = NULL; // Handle to window
@ -284,7 +289,7 @@ void PAD_GetStatus(u8 _numPAD, SPADStatus* _pPADStatus)
// Update joyinfo handles. This is in case the Wiimote plugin has restarted SDL after a pad was conencted/disconnected
// so that the handles are updated.
LocalSearchDevices(joyinfo, NumPads);
if (LiveUpdates) LocalSearchDevices(joyinfo, NumPads);
// Check if the pad is avaliable, currently we don't disable pads just because they are
// disconnected
@ -459,9 +464,8 @@ bool LocalSearchDevicesReset(std::vector<InputCommon::CONTROLLER_INFO> &_joyinfo
// Turn off device polling while resetting
EnablePolling(false);
bool Success = InputCommon::SearchDevicesReset(_joyinfo, _NumPads);
EnablePolling(true);
DoLocalSearchDevices(_joyinfo, _NumPads);
EnablePolling(true);
return Success;
}

View File

@ -97,6 +97,7 @@
#endif
extern int NumPads, NumDIDevices, LastPad; // Number of pads
extern bool SDLPolling;
extern bool LiveUpdates;
#endif