Guest User

Untitled

a guest
Jul 21st, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.44 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 1 on non MS BT Stack windows systems.
  11. + 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 *"));
  12. + m_ButtonPairUp->Enable(false);
  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,30 @@
  56.  
  57. return nPaired;
  58. }
  59. +
  60. +int isMSBTStack()
  61. +{
  62. +::WSACleanup();
  63. +
  64. +WORD wVersionRequested = 0x202;
  65. +WSADATA m_data;
  66. +
  67. +if (0 == ::WSAStartup(wVersionRequested, &m_data))
  68. +{
  69. + SOCKET s = ::socket(AF_BTH, SOCK_STREAM, BTHPROTO_RFCOMM);
  70. + const DWORD lastError = ::GetLastError();
  71. + if (s == INVALID_SOCKET)
  72. + {
  73. + return 1;
  74. + //NO MS BT Stack
  75. + }
  76. + closesocket(s);
  77. +
  78. + return 0;
  79. +}
  80. +return 1;
  81. +}
  82. +
  83. #endif
  84.  
  85. }; // end of namespace
  86. Index: Source/Plugins/Plugin_Wiimote/Src/wiimote_real.h
  87. ===================================================================
  88. --- Source/Plugins/Plugin_Wiimote/Src/wiimote_real.h (revision 4788)
  89. +++ Source/Plugins/Plugin_Wiimote/Src/wiimote_real.h (working copy)
  90. @@ -29,6 +29,7 @@
  91.  
  92. int Initialize();
  93. int WiimotePairUp();
  94. +int isMSBTStack();
  95.  
  96. void Allocate();
  97. void DoState(PointerWrap &p);
Add Comment
Please, Sign In to add comment