Fixed issue 5973. (probably)

This commit is contained in:
Jordan Woyak 2013-02-04 21:25:14 -06:00
parent a455abe00b
commit bc35764ec2
2 changed files with 4 additions and 4 deletions

View File

@ -184,7 +184,7 @@ int FindWiimotes(Wiimote** wm, int max_wiimotes)
bool found = false; bool found = false;
for(int i = 0; i < MAX_WIIMOTES; i++) for(int i = 0; i < MAX_WIIMOTES; i++)
{ {
if(wm[i] && strcmp(wm[i]->devicepath, detail_data->DevicePath) == 0) if(wm[i] && (wm[i]->devicepath == detail_data->DevicePath))
{ {
found = true; found = true;
break; break;
@ -210,7 +210,7 @@ int FindWiimotes(Wiimote** wm, int max_wiimotes)
for (; k < MAX_WIIMOTES && !(WIIMOTE_SRC_REAL & g_wiimote_sources[k] && !wm[k]); ++k); for (; k < MAX_WIIMOTES && !(WIIMOTE_SRC_REAL & g_wiimote_sources[k] && !wm[k]); ++k);
wm[k] = new Wiimote(k); wm[k] = new Wiimote(k);
wm[k]->dev_handle = dev; wm[k]->dev_handle = dev;
memcpy(wm[k]->devicepath, detail_data->DevicePath, 197); wm[k]->devicepath = detail_data->DevicePath;
if (!wm[k]->Connect()) if (!wm[k]->Connect())
{ {
@ -240,7 +240,7 @@ bool Wiimote::Connect()
if (!dev_handle) if (!dev_handle)
{ {
dev_handle = CreateFile(devicepath, dev_handle = CreateFile(devicepath.c_str(),
(GENERIC_READ | GENERIC_WRITE), (GENERIC_READ | GENERIC_WRITE),
(FILE_SHARE_READ | FILE_SHARE_WRITE), (FILE_SHARE_READ | FILE_SHARE_WRITE),
NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL); NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL);

View File

@ -78,7 +78,7 @@ public:
void Close(); void Close();
#elif defined(_WIN32) #elif defined(_WIN32)
char devicepath[255]; // Unique wiimote reference std::string devicepath; // Unique wiimote reference
//ULONGLONG btaddr; // Bluetooth address //ULONGLONG btaddr; // Bluetooth address
HANDLE dev_handle; // HID handle HANDLE dev_handle; // HID handle
OVERLAPPED hid_overlap; // Overlap handle OVERLAPPED hid_overlap; // Overlap handle