Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: Source/Plugins/Plugin_Wiimote/Src/ConfigBasicDlg.cpp
- ===================================================================
- --- Source/Plugins/Plugin_Wiimote/Src/ConfigBasicDlg.cpp (revision 4788)
- +++ Source/Plugins/Plugin_Wiimote/Src/ConfigBasicDlg.cpp (working copy)
- @@ -251,7 +251,13 @@
- m_ButtonPairUp = new wxButton(this, ID_BUTTONPAIRUP, wxT("Pair Up Wiimote(s)"));
- #ifdef WIN32
- - m_ButtonPairUp->SetToolTip(wxT("Pair up your Wiimote(s) with your system.\nPress the Buttons 1 and 2 on your Wiimote before pairing up.\nThis might take a few seconds.\nIt only works if you're using Microsoft's Bluetooth stack.")); // Only working with MS BT Stack.
- + if (WiiMoteReal::isMSBTStack()) { // returns 1 on non MS BT Stack windows systems.
- + m_ButtonPairUp->SetToolTip(wxT("Pair up your Wiimote(s) with your system.\nPress the Buttons 1 and 2 on your Wiimote before pairing up.\nThis might take a few seconds.\n* Couldn't find Microsoft Bluetooth Stack, feature was disabled *"));
- + m_ButtonPairUp->Enable(false);
- + }
- + else {
- + m_ButtonPairUp->SetToolTip(wxT("Pair up your Wiimote(s) with your system.\nPress the Buttons 1 and 2 on your Wiimote before pairing up.\nThis might take a few seconds.\n* Found Microsoft's Bluetooth stack, feature is enabled.")); // Only working with MS BT Stack.
- + }
- #else
- m_ButtonPairUp->Enable(false);
- #endif
- @@ -522,3 +528,4 @@
- m_CheckAR169[m_Page]->SetValue(g_Config.bKeepAR169);
- m_Crop[m_Page]->SetValue(g_Config.bCrop);
- }
- +
- Index: Source/Plugins/Plugin_Wiimote/Src/ConfigBasicDlg.h
- ===================================================================
- --- Source/Plugins/Plugin_Wiimote/Src/ConfigBasicDlg.h (revision 4788)
- +++ Source/Plugins/Plugin_Wiimote/Src/ConfigBasicDlg.h (working copy)
- @@ -48,7 +48,7 @@
- void ButtonClick(wxCommandEvent& event);
- void ShutDown(wxTimerEvent& WXUNUSED(event));
- void UpdateOnce(wxTimerEvent& event);
- -
- +
- // Timers
- wxTimer *m_TimeoutOnce,
- *m_ShutDownTimer;
- Index: Source/Plugins/Plugin_Wiimote/Src/wiimote_real.cpp
- ===================================================================
- --- Source/Plugins/Plugin_Wiimote/Src/wiimote_real.cpp (revision 4788)
- +++ Source/Plugins/Plugin_Wiimote/Src/wiimote_real.cpp (working copy)
- @@ -35,10 +35,12 @@
- #define EXCLUDE_H // Avoid certain declarations in wiimote_real.h
- #include "wiimote_real.h"
- #ifdef WIN32
- +#include <ws2bth.h>
- #include <bthdef.h>
- #include <BluetoothAPIs.h>
- #pragma comment(lib, "Bthprops.lib")
- +#pragma comment(lib, "ws2_32.lib" )
- #endif
- extern SWiimoteInitialize g_WiimoteInitialize;
- @@ -677,6 +679,30 @@
- return nPaired;
- }
- +
- +int isMSBTStack()
- +{
- +::WSACleanup();
- +
- +WORD wVersionRequested = 0x202;
- +WSADATA m_data;
- +
- +if (0 == ::WSAStartup(wVersionRequested, &m_data))
- +{
- + SOCKET s = ::socket(AF_BTH, SOCK_STREAM, BTHPROTO_RFCOMM);
- + const DWORD lastError = ::GetLastError();
- + if (s == INVALID_SOCKET)
- + {
- + return 1;
- + //NO MS BT Stack
- + }
- + closesocket(s);
- +
- + return 0;
- +}
- +return 1;
- +}
- +
- #endif
- }; // end of namespace
- Index: Source/Plugins/Plugin_Wiimote/Src/wiimote_real.h
- ===================================================================
- --- Source/Plugins/Plugin_Wiimote/Src/wiimote_real.h (revision 4788)
- +++ Source/Plugins/Plugin_Wiimote/Src/wiimote_real.h (working copy)
- @@ -29,6 +29,7 @@
- int Initialize();
- int WiimotePairUp();
- +int isMSBTStack();
- void Allocate();
- void DoState(PointerWrap &p);
Add Comment
Please, Sign In to add comment