From bac3eac6298ff192daafc18a68910bc59dbde065 Mon Sep 17 00:00:00 2001 From: Jordan Woyak Date: Fri, 17 Sep 2010 00:27:37 +0000 Subject: [PATCH] New Wiimote Plugin: buildfix and minor tweak. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6214 8ced0084-cf51-0410-be5f-012b33b47a6e --- .../Plugin_WiimoteNew/Src/WiimoteReal/WiimoteReal.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Source/Plugins/Plugin_WiimoteNew/Src/WiimoteReal/WiimoteReal.cpp b/Source/Plugins/Plugin_WiimoteNew/Src/WiimoteReal/WiimoteReal.cpp index 867d40f1f8..5046f6f54e 100644 --- a/Source/Plugins/Plugin_WiimoteNew/Src/WiimoteReal/WiimoteReal.cpp +++ b/Source/Plugins/Plugin_WiimoteNew/Src/WiimoteReal/WiimoteReal.cpp @@ -30,6 +30,7 @@ // used for pair up #ifdef _WIN32 +#include #include #pragma comment(lib, "Bthprops.lib") #endif @@ -482,9 +483,12 @@ THREAD_RETURN WiimoteThreadFunc(void* arg) // main loop while (g_run_wiimote_thread) { - wiimote->Write(); + // hopefully this is alright + while (wiimote->Write()) {} + + // sleep if there was nothing to read if (false == wiimote->Read()) - Common::SleepCurrentThread(1); // sleep if there was nothing to read + Common::SleepCurrentThread(1); } return 0;