From d2cee0a869489414c46b4349deff7487d9b5d56f Mon Sep 17 00:00:00 2001 From: Sonicadvance1 Date: Thu, 1 Apr 2010 02:59:40 +0000 Subject: Clean up of new Plugin, get it compiling in Linux/OSX, Linux side, you need to add the Xlib portion to SConscript git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5258 8ced0084-cf51-0410-be5f-012b33b47a6e --- .../Src/ControllerInterface/ControllerInterface.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'Source/Plugins/Plugin_GCPadNew/Src/ControllerInterface/ControllerInterface.cpp') diff --git a/Source/Plugins/Plugin_GCPadNew/Src/ControllerInterface/ControllerInterface.cpp b/Source/Plugins/Plugin_GCPadNew/Src/ControllerInterface/ControllerInterface.cpp index 4b0dc358ee..9649fd6bfe 100644 --- a/Source/Plugins/Plugin_GCPadNew/Src/ControllerInterface/ControllerInterface.cpp +++ b/Source/Plugins/Plugin_GCPadNew/Src/ControllerInterface/ControllerInterface.cpp @@ -12,6 +12,7 @@ #ifdef CIFACE_USE_SDL #include "SDL/SDL.h" #endif +#include "Thread.h" //#define MAX_DOUBLE_TAP_TIME 400 //#define MAX_HOLD_DOWN_TIME 400 @@ -488,8 +489,9 @@ bool ControllerInterface::InputReference::Detect( const unsigned int ms, const u while ( (time < ms) && (detected.size() < count) ) { device->UpdateInput(); - std::vector::const_iterator i = device->Inputs().begin(), - e = device->Inputs().end(); + i = device->Inputs().begin(); + e = device->Inputs().end(); + for ( unsigned int n=0;i != e; ++i,++n ) { if ( device->GetInputState( *i ) > INPUT_DETECT_THRESHOLD ) @@ -501,7 +503,7 @@ bool ControllerInterface::InputReference::Detect( const unsigned int ms, const u else states[n] = false; } - wxMilliSleep( 10 ); time += 10; + Common::SleepCurrentThread( 10 ); time += 10; } delete states; @@ -513,10 +515,10 @@ bool ControllerInterface::InputReference::Detect( const unsigned int ms, const u if ( controls.size() > 1 ) { control_qualifier.name = '|'; - std::vector::const_iterator i = controls.begin(), - e = controls.end(); - for ( ; i!=e; ++i ) - control_qualifier.name += (*i)->GetName() + '|'; + std::vector::const_iterator c_i = controls.begin(), + c_e = controls.end(); + for ( ; c_i != c_e; ++c_i ) + control_qualifier.name += (*c_i)->GetName() + '|'; } else control_qualifier.FromControl( controls[0] ); @@ -546,7 +548,7 @@ bool ControllerInterface::OutputReference::Detect( const unsigned int ms, const while ( ms > ( slept += 10 ) ) { device->UpdateOutput(); - wxMilliSleep( 10 ); + Common::SleepCurrentThread( 10 ); } State( 0 ); -- cgit v1.2.3