diff --git a/src/Internal.h b/src/Internal.h index 07ff4db..3659f04 100644 --- a/src/Internal.h +++ b/src/Internal.h @@ -1,6 +1,10 @@ #pragma once -#include "XusbNotificationRequest.h" -#include "NotificationRequestPool.h" + +// +// TODO: this is... not optimal. Improve in the future. +// +#define VIGEM_TARGETS_MAX USHRT_MAX + // // Represents a driver connection object. diff --git a/src/ViGEmClient.cpp b/src/ViGEmClient.cpp index fbd955a..8e42093 100644 --- a/src/ViGEmClient.cpp +++ b/src/ViGEmClient.cpp @@ -47,24 +47,14 @@ SOFTWARE. #include #include #include -#include #include -#include -#include -#include #include #include "Internal.h" #include "NotificationRequestPool.h" -// -// TODO: this is... not optimal. Improve in the future. -// -#define VIGEM_TARGETS_MAX USHRT_MAX - - typedef BOOL(WINAPI *MINIDUMPWRITEDUMP)( HANDLE hProcess, @@ -79,7 +69,6 @@ typedef BOOL(WINAPI *MINIDUMPWRITEDUMP)( LONG WINAPI vigem_internal_exception_handler(struct _EXCEPTION_POINTERS* apExceptionInfo); - // // Initializes a virtual gamepad object. // @@ -504,18 +493,9 @@ VIGEM_ERROR vigem_target_x360_register_notification( if (target->Notification == reinterpret_cast(notification)) return VIGEM_ERROR_CALLBACK_ALREADY_REGISTERED; - target->Notification = reinterpret_cast(notification); + // TODO: tidy up this mess - //for (auto i = 0; i < /* VIGEM_INVERTED_CALL_THREAD_COUNT */ 1; i++) - //{ - // auto req = new XusbNotificationRequest( - // vigem->hBusDevice, - // target->SerialNo, - // target->WaitHandles[i] - // ); - // target->notify_req.emplace_back(req); - // //target->worker_threads->create_thread(*req); - //} + target->Notification = reinterpret_cast(notification); target->pool = std::make_shared( vigem, @@ -523,10 +503,6 @@ VIGEM_ERROR vigem_target_x360_register_notification( PFN_VIGEM_X360_NOTIFICATION(target->Notification) ); - - //for (int i = 1; i <= VIGEM_INVERTED_CALL_THREAD_COUNT; i++) - // target->worker_threads->create_thread(boost::bind(&vigem_internal_x360_notification_worker, target, vigem)); - return VIGEM_ERROR_NONE; }