diff --git a/CMakeLists.txt b/CMakeLists.txt index 55d04342..0dcbe718 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,6 +5,14 @@ project(Sunshine) set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}) add_subdirectory(Simple-Web-Server) + +if(WIN32) + # Ugly hack to compile with #include + add_compile_definitions( + QOS_FLOWID=UINT32 + PQOS_FLOWID=UINT32* + QOS_NON_ADAPTIVE_FLOW=2) +endif() add_subdirectory(moonlight-common-c/enet) find_package(Threads REQUIRED) @@ -70,6 +78,7 @@ if(WIN32) libstdc++.a libwinpthread.a libssp.a + Qwave winmm ksuser wsock32 diff --git a/moonlight-common-c b/moonlight-common-c index cfeb0ffd..5d09d43b 160000 --- a/moonlight-common-c +++ b/moonlight-common-c @@ -1 +1 @@ -Subproject commit cfeb0ffd90992ee0fa4b6b4a179652e3e2786873 +Subproject commit 5d09d43b0866d9fa30cc1741f9e10de5420deaad diff --git a/sunshine/input.cpp b/sunshine/input.cpp index 9a41dd03..a9aee2c4 100644 --- a/sunshine/input.cpp +++ b/sunshine/input.cpp @@ -2,6 +2,8 @@ // Created by loki on 6/20/19. // +// define uint32_t for +#include extern "C" { #include } @@ -86,12 +88,22 @@ struct input_t { using namespace std::literals; -void print(PNV_MOUSE_MOVE_PACKET packet) { +void print(PNV_REL_MOUSE_MOVE_PACKET packet) { BOOST_LOG(debug) - << "--begin mouse move packet--"sv << std::endl + << "--begin relative mouse move packet--"sv << std::endl << "deltaX ["sv << util::endian::big(packet->deltaX) << ']' << std::endl << "deltaY ["sv << util::endian::big(packet->deltaY) << ']' << std::endl - << "--end mouse move packet--"sv; + << "--end relative mouse move packet--"sv; +} + +void print(PNV_ABS_MOUSE_MOVE_PACKET packet) { + BOOST_LOG(debug) + << "--begin absolute mouse move packet--"sv << std::endl + << "x ["sv << util::endian::big(packet->x) << ']' << std::endl + << "y ["sv << util::endian::big(packet->y) << ']' << std::endl + << "width ["sv << util::endian::big(packet->width) << ']' << std::endl + << "height ["sv << util::endian::big(packet->height) << ']' << std::endl + << "--end absolute mouse move packet--"sv; } void print(PNV_MOUSE_BUTTON_PACKET packet) { @@ -138,8 +150,11 @@ void print(void *input) { int input_type = util::endian::big(*(int*)input); switch(input_type) { - case PACKET_TYPE_MOUSE_MOVE: - print((PNV_MOUSE_MOVE_PACKET)input); + case PACKET_TYPE_REL_MOUSE_MOVE: + print((PNV_REL_MOUSE_MOVE_PACKET)input); + break; + case PACKET_TYPE_ABS_MOUSE_MOVE: + print((PNV_ABS_MOUSE_MOVE_PACKET)input); break; case PACKET_TYPE_MOUSE_BUTTON: print((PNV_MOUSE_BUTTON_PACKET)input); @@ -162,7 +177,7 @@ void print(void *input) { } } -void passthrough(platf::input_t &input, PNV_MOUSE_MOVE_PACKET packet) { +void passthrough(platf::input_t &input, PNV_REL_MOUSE_MOVE_PACKET packet) { display_cursor = true; platf::move_mouse(input, util::endian::big(packet->deltaX), util::endian::big(packet->deltaY)); @@ -374,8 +389,8 @@ void passthrough_helper(std::shared_ptr input, std::vector