From 7a03ffe210e2847deadd1fd666f1533f23610e1f Mon Sep 17 00:00:00 2001 From: tmator Date: Tue, 17 Feb 2009 22:06:40 +0000 Subject: [PATCH] try to fix nowx wiimote git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2293 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Plugins/Plugin_Wiimote/Src/ReadWiimote.cpp | 7 ++++++- Source/Plugins/Plugin_Wiimote/Src/SConscript | 1 + Source/Plugins/Plugin_Wiimote/Src/main.cpp | 10 ++++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/Source/Plugins/Plugin_Wiimote/Src/ReadWiimote.cpp b/Source/Plugins/Plugin_Wiimote/Src/ReadWiimote.cpp index c09d3ec2ed..a4c75a04e3 100644 --- a/Source/Plugins/Plugin_Wiimote/Src/ReadWiimote.cpp +++ b/Source/Plugins/Plugin_Wiimote/Src/ReadWiimote.cpp @@ -112,9 +112,10 @@ void handle_event(struct wiimote_t* wm) wiiuse_set_ir(wm, 1); // Print battery status +#if defined(HAVE_WX) && HAVE_WX if(frame && g_Config.bUpdateRealWiimote) frame->m_GaugeBattery->SetValue((int)floor((wm->battery_level * 100) + 0.5)); - +#endif // Create shortcut to the nunchuck struct nunchuk_t* nc = NULL; if (wm->exp.type == EXP_NUNCHUK) @@ -167,6 +168,7 @@ void handle_event(struct wiimote_t* wm) //Console::ClearScreen(); //Console::Print("%s\n\n", Tmp.c_str()); +#if defined(HAVE_WX) && HAVE_WX if(frame) { // Produce adjusted accelerometer values @@ -236,10 +238,12 @@ void handle_event(struct wiimote_t* wm) frame->m_bmpDotRightOut[0]->SetPosition(wxPoint(Roll, Pitch));*/ // --------------------- } +#endif } // Otherwise remove the values else { +#if defined(HAVE_WX) && HAVE_WX if (frame) { @@ -258,6 +262,7 @@ void handle_event(struct wiimote_t* wm) frame->m_TextIR->SetLabel(wxT("Cursor:\nDistance:")); } +#endif } } diff --git a/Source/Plugins/Plugin_Wiimote/Src/SConscript b/Source/Plugins/Plugin_Wiimote/Src/SConscript index 6f8b8d2546..0a7203950c 100644 --- a/Source/Plugins/Plugin_Wiimote/Src/SConscript +++ b/Source/Plugins/Plugin_Wiimote/Src/SConscript @@ -28,6 +28,7 @@ if wmenv['HAVE_WX']: libs = [ 'common', 'inputcommon' ] + cxxflags = [ '-fPIC' ] if wmenv['HAVE_WIIUSE']: diff --git a/Source/Plugins/Plugin_Wiimote/Src/main.cpp b/Source/Plugins/Plugin_Wiimote/Src/main.cpp index b262a43913..dd7a155171 100644 --- a/Source/Plugins/Plugin_Wiimote/Src/main.cpp +++ b/Source/Plugins/Plugin_Wiimote/Src/main.cpp @@ -302,7 +302,9 @@ extern "C" void Wiimote_ControlChannel(u16 _channelID, const void* _pData, u32 _ Console::Print("\n\nWiimote Disconnected\n\n"); g_EmulatorRunning = false; g_WiimoteUnexpectedDisconnect = true; +#if defined(HAVE_WX) && HAVE_WX if (frame) frame->UpdateGUI(); +#endif return; } @@ -333,6 +335,7 @@ extern "C" void Wiimote_ControlChannel(u16 _channelID, const void* _pData, u32 _ extern "C" void Wiimote_Update() { // Tell us about the update rate, but only about once every second to avoid a major slowdown +#if defined(HAVE_WX) && HAVE_WX if (frame) { GetUpdateRate(); @@ -344,6 +347,7 @@ extern "C" void Wiimote_Update() g_UpdateWriteScreen++; } +#endif // This functions will send: // Emulated Wiimote: Only data reports 0x30-0x37 // Real Wiimote: Both data reports 0x30-0x37 and all other read reports @@ -498,7 +502,9 @@ void ReadDebugging(bool Emu, const void* _pData, int Size) if(!Emu && !pStatus->extension) { DisableExtensions(); +#if defined(HAVE_WX) && HAVE_WX if (frame) frame->UpdateGUI(); +#endif } } break; @@ -533,7 +539,9 @@ void ReadDebugging(bool Emu, const void* _pData, int Size) if (!Emu && data[7] == 0x01 && data[8] == 0x01) g_Config.bClassicControllerConnected = true; g_Config.Save(); WiiMoteEmu::UpdateEeprom(); +#if defined(HAVE_WX) && HAVE_WX if (frame) frame->UpdateGUI(); +#endif Console::Print("%s", TmpData.c_str()); Console::Print("Game got the decrypted extension ID: %02x%02x\n\n", data[7], data[8]); } @@ -544,7 +552,9 @@ void ReadDebugging(bool Emu, const void* _pData, int Size) if (!Emu && data[11] == 0x01 && data[12] == 0x01) g_Config.bClassicControllerConnected = true; g_Config.Save(); WiiMoteEmu::UpdateEeprom(); +#if defined(HAVE_WX) && HAVE_WX if (frame) frame->UpdateGUI(); +#endif Console::Print("%s", TmpData.c_str()); Console::Print("Game got the decrypted extension ID: %02x%02x%02x%02x%02x%02x\n\n", data[7], data[8], data[9], data[10], data[11], data[12]); }