diff --git a/src/single_window/control_bar.cpp b/src/single_window/control_bar.cpp index 6ed5354..95bb8fc 100644 --- a/src/single_window/control_bar.cpp +++ b/src/single_window/control_bar.cpp @@ -88,7 +88,8 @@ int Render::ControlBar() { RemoteAction remote_action; remote_action.type = ControlType::audio_capture; remote_action.a = audio_capture_button_pressed_; - SendData(peer_, (const char*)&remote_action, sizeof(remote_action)); + SendDataFrame(peer_, (const char*)&remote_action, + sizeof(remote_action)); } } if (!audio_capture_button_pressed_) { diff --git a/src/single_window/render_callback_func.cpp b/src/single_window/render_callback_func.cpp index dc20c2b..dabd951 100644 --- a/src/single_window/render_callback_func.cpp +++ b/src/single_window/render_callback_func.cpp @@ -62,7 +62,7 @@ int Render::ProcessMouseEvent(SDL_Event &event) { if (control_bar_hovered_) { remote_action.m.flag = MouseFlag::move; } - SendData(peer_, (const char *)&remote_action, sizeof(remote_action)); + SendDataFrame(peer_, (const char *)&remote_action, sizeof(remote_action)); } else if (SDL_MOUSEBUTTONUP == event.type) { remote_action.type = ControlType::mouse; if (SDL_BUTTON_LEFT == event.button.button) { @@ -73,11 +73,11 @@ int Render::ProcessMouseEvent(SDL_Event &event) { if (control_bar_hovered_) { remote_action.m.flag = MouseFlag::move; } - SendData(peer_, (const char *)&remote_action, sizeof(remote_action)); + SendDataFrame(peer_, (const char *)&remote_action, sizeof(remote_action)); } else if (SDL_MOUSEMOTION == event.type) { remote_action.type = ControlType::mouse; remote_action.m.flag = MouseFlag::move; - SendData(peer_, (const char *)&remote_action, sizeof(remote_action)); + SendDataFrame(peer_, (const char *)&remote_action, sizeof(remote_action)); } return 0; @@ -93,7 +93,7 @@ int Render::SendKeyEvent(int key_code, bool is_down) { } remote_action.k.key_value = key_code; - SendData(peer_, (const char *)&remote_action, sizeof(remote_action)); + SendDataFrame(peer_, (const char *)&remote_action, sizeof(remote_action)); return 0; } @@ -282,8 +282,8 @@ void Render::OnConnectionStatusCb(ConnectionStatus status, const char *user_id, remote_action.type = ControlType::host_infomation; memcpy(&remote_action.i.host_name, host_name.data(), host_name.size()); remote_action.i.host_name_size = host_name.size(); - int ret = SendData(render->peer_, (const char *)&remote_action, - sizeof(remote_action)); + int ret = SendDataFrame(render->peer_, (const char *)&remote_action, + sizeof(remote_action)); if (0 == ret) { render->hostname_sent_ = true; } diff --git a/thirdparty/projectx b/thirdparty/projectx index 8d56a76..7e3856a 160000 --- a/thirdparty/projectx +++ b/thirdparty/projectx @@ -1 +1 @@ -Subproject commit 8d56a768448f7e8b6a8e04d70cc015bc254caa07 +Subproject commit 7e3856a68d20807fbdcf75960b9a817933986a46 diff --git a/xmake.lua b/xmake.lua index 0f7290b..ef9f153 100644 --- a/xmake.lua +++ b/xmake.lua @@ -26,6 +26,8 @@ if is_os("windows") then add_links("Shell32", "windowsapp", "dwmapi", "User32", "kernel32", "SDL2-static", "SDL2main", "gdi32", "winmm", "setupapi", "version", "Imm32", "iphlpapi") + -- add_cxflags("/W4", "/WX") + add_cxflags("/W4") elseif is_os("linux") then add_requires("ffmpeg 5.1.2", {system = false}) add_syslinks("pthread", "dl") @@ -36,12 +38,14 @@ elseif is_os("linux") then "-lasound", "-lxcb-shape", "-lxcb-xfixes", "-lsndio", "-lxcb", "-lxcb-shm", "-lXext", "-lX11", "-lXv", "-ldl", "-lpthread", {force = true}) + add_cxflags("-Wno-unused-variable") elseif is_os("macosx") then add_requires("ffmpeg 5.1.2", {system = false}) add_requires("libxcb", {system = false}) add_packages("libxcb") add_links("SDL2", "SDL2main") add_ldflags("-Wl,-ld_classic") + add_cxflags("-Wno-unused-variable") add_frameworks("OpenGL", "IOSurface", "ScreenCaptureKit") end