From ffadce5a4f74f18741c2207f269922b20b27a209 Mon Sep 17 00:00:00 2001 From: localcc Date: Sun, 31 Oct 2021 00:13:33 +0300 Subject: [PATCH] Fix compilation issues --- .../WindowsDriver/WindowsDriver.vcxproj | 2 ++ WindowsDriver/WindowsDriver/feeder.cpp | 23 ++++++++----------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/WindowsDriver/WindowsDriver/WindowsDriver.vcxproj b/WindowsDriver/WindowsDriver/WindowsDriver.vcxproj index 60af0da..207589a 100644 --- a/WindowsDriver/WindowsDriver/WindowsDriver.vcxproj +++ b/WindowsDriver/WindowsDriver/WindowsDriver.vcxproj @@ -119,11 +119,13 @@ true true true + $(SolutionDir)Libs\ViGEm\include;%(AdditionalIncludeDirectories) Console true true + $(SolutionDir)Libs\ViGEm\bin\release\x64\ViGEmClient.lib;Ws2_32.lib;%(AdditionalDependencies) diff --git a/WindowsDriver/WindowsDriver/feeder.cpp b/WindowsDriver/WindowsDriver/feeder.cpp index e6c55c3..2b56503 100644 --- a/WindowsDriver/WindowsDriver/feeder.cpp +++ b/WindowsDriver/WindowsDriver/feeder.cpp @@ -1,6 +1,16 @@ #include "feeder.h" #include "controller_conversion.h" + +/* + Commands: + 1 - get, read 14 bytes after + 2 - poweroff + 3 - cb, write 2 bytes after, 1st byte - left rumble, 2nd - right rumble +*/ +static uint8_t get[1] = { 1 }; +static uint8_t poweroff[1] = { 2 }; +static uint8_t cb = 3; feeder::feeder(const char* hostname, int port) : udp_client(hostname, port) { this->driver_client = vigem_alloc(); if (this->driver_client == nullptr) { @@ -61,19 +71,6 @@ void feeder::controller_callback(PVIGEM_CLIENT Client, f->udp_client.client_write(data, 3); } - - - -/* - Commands: - 1 - get, read 14 bytes after - 2 - poweroff - 3 - cb, write 2 bytes after, 1st byte - left rumble, 2nd - right rumble -*/ -static uint8_t get[1] = { 1 }; -static uint8_t poweroff[1] = { 2 }; -static uint8_t cb = 3; - void feeder::feed() { uint8_t* buf = new uint8_t[14]; uint8_t data[2]{ 0 };