Guest User

Untitled

a guest
Jul 21st, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.34 KB | None | 0 0
  1. Index: Source/Plugins/Plugin_Wiimote/Src/ConfigBasicDlg.cpp
  2. ===================================================================
  3. --- Source/Plugins/Plugin_Wiimote/Src/ConfigBasicDlg.cpp (revision 4788)
  4. +++ Source/Plugins/Plugin_Wiimote/Src/ConfigBasicDlg.cpp (working copy)
  5. @@ -251,7 +251,13 @@
  6. m_ButtonPairUp = new wxButton(this, ID_BUTTONPAIRUP, wxT("Pair Up Wiimote(s)"));
  7.  
  8. #ifdef WIN32
  9. - 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.
  10. + if (!WiiMoteReal::isMSBTStack()) { // returns zero on non MS BT Stack windows systems.
  11. + m_ButtonPairUp->Enable(false);
  12. + 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 *")); // Only working with MS BT Stack.
  13. + }
  14. + else {
  15. + 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.
  16. + }
  17. #else
  18. m_ButtonPairUp->Enable(false);
  19. #endif
  20. @@ -522,3 +528,4 @@
  21. m_CheckAR169[m_Page]->SetValue(g_Config.bKeepAR169);
  22. m_Crop[m_Page]->SetValue(g_Config.bCrop);
  23. }
  24. +
  25. Index: Source/Plugins/Plugin_Wiimote/Src/ConfigBasicDlg.h
  26. ===================================================================
  27. --- Source/Plugins/Plugin_Wiimote/Src/ConfigBasicDlg.h (revision 4788)
  28. +++ Source/Plugins/Plugin_Wiimote/Src/ConfigBasicDlg.h (working copy)
  29. @@ -48,7 +48,7 @@
  30. void ButtonClick(wxCommandEvent& event);
  31. void ShutDown(wxTimerEvent& WXUNUSED(event));
  32. void UpdateOnce(wxTimerEvent& event);
  33. -
  34. +
  35. // Timers
  36. wxTimer *m_TimeoutOnce,
  37. *m_ShutDownTimer;
  38. Index: Source/Plugins/Plugin_Wiimote/Src/wiimote_real.cpp
  39. ===================================================================
  40. --- Source/Plugins/Plugin_Wiimote/Src/wiimote_real.cpp (revision 4788)
  41. +++ Source/Plugins/Plugin_Wiimote/Src/wiimote_real.cpp (working copy)
  42. @@ -35,10 +35,12 @@
  43. #define EXCLUDE_H // Avoid certain declarations in wiimote_real.h
  44. #include "wiimote_real.h"
  45. #ifdef WIN32
  46. +#include <ws2bth.h>
  47. #include <bthdef.h>
  48. #include <BluetoothAPIs.h>
  49.  
  50. #pragma comment(lib, "Bthprops.lib")
  51. +#pragma comment(lib, "ws2_32.lib" )
  52. #endif
  53. extern SWiimoteInitialize g_WiimoteInitialize;
  54.  
  55. @@ -677,6 +679,24 @@
  56.  
  57. return nPaired;
  58. }
  59. +
  60. +int isMSBTStack()
  61. +{
  62. +
  63. + SOCKET s = ::socket(AF_BTH, SOCK_STREAM, BTHPROTO_RFCOMM);
  64. + const DWORD lastError = ::GetLastError();
  65. + if (s == INVALID_SOCKET)
  66. + {
  67. + return 1;
  68. + //NO MS BT Stack
  69. + }
  70. + closesocket(s);
  71. +
  72. + return 0;
  73. +}
  74. +
  75. #endif
  76.  
  77. }; // end of namespace
  78. Index: Source/Plugins/Plugin_Wiimote/Src/wiimote_real.h
  79. ===================================================================
  80. --- Source/Plugins/Plugin_Wiimote/Src/wiimote_real.h (revision 4788)
  81. +++ Source/Plugins/Plugin_Wiimote/Src/wiimote_real.h (working copy)
  82. @@ -29,6 +29,7 @@
  83.  
  84. int Initialize();
  85. int WiimotePairUp();
  86. +int isMSBTStack();
  87.  
  88. void Allocate();
  89. void DoState(PointerWrap &p);
Add Comment
Please, Sign In to add comment