From 976fe24ba1358821b4aeb419ecffa6429e735c02 Mon Sep 17 00:00:00 2001 From: OBattler Date: Sun, 13 Aug 2023 18:25:56 +0200 Subject: [PATCH] VNC and Win32 mouse clean-ups. --- src/device/mouse.c | 2 +- src/include/86box/mouse.h | 1 + src/vnc.c | 10 ---------- src/win/win_mouse.c | 11 ----------- 4 files changed, 2 insertions(+), 22 deletions(-) diff --git a/src/device/mouse.c b/src/device/mouse.c index b5a1af371..2e6caec47 100644 --- a/src/device/mouse.c +++ b/src/device/mouse.c @@ -156,7 +156,7 @@ mouse_clear_coords(void) mouse_z = 0; } -static void +void mouse_clear_buttons(void) { mouse_buttons = 0x00; diff --git a/src/include/86box/mouse.h b/src/include/86box/mouse.h index e24494d74..90000c0e2 100644 --- a/src/include/86box/mouse.h +++ b/src/include/86box/mouse.h @@ -78,6 +78,7 @@ extern const device_t mouse_wacom_artpad_device; extern void mouse_clear_x(void); extern void mouse_clear_y(void); extern void mouse_clear_coords(void); +extern void mouse_clear_buttons(void); extern void mouse_subtract_x(int *delta_x, int *o_x, int min, int max, int abs); extern void mouse_subtract_y(int *delta_y, int *o_y, int min, int max, int invert, int abs); extern void mouse_subtract_coords(int *delta_x, int *delta_y, int *o_x, int *o_y, diff --git a/src/vnc.c b/src/vnc.c index 161d55681..f8ef1ef38 100644 --- a/src/vnc.c +++ b/src/vnc.c @@ -46,15 +46,6 @@ static int ptr_x; static int ptr_y; static int ptr_but; -typedef struct { - int buttons; - int dx; - int dy; - int dwheel; -} MOUSESTATE; - -static MOUSESTATE ms; - #ifdef ENABLE_VNC_LOG int vnc_do_log = ENABLE_VNC_LOG; @@ -153,7 +144,6 @@ vnc_newclient(rfbClientPtr cl) ptr_y = allowedY / 2; mouse_clear_coords(); mouse_clear_buttons(); - memset(&ms, 0, sizeof(MOUSESTATE)); /* We now have clients, un-pause the emulator if needed. */ vnc_log("VNC: unpausing..\n"); diff --git a/src/win/win_mouse.c b/src/win/win_mouse.c index c8f7f90fd..e30749145 100644 --- a/src/win/win_mouse.c +++ b/src/win/win_mouse.c @@ -32,15 +32,6 @@ int mouse_capture; -typedef struct { - int buttons; - int dx; - int dy; - int dwheel; -} MOUSESTATE; - -MOUSESTATE mousestate; - void win_mouse_init(void) { @@ -56,8 +47,6 @@ win_mouse_init(void) ridev.usUsage = 0x02; if (!RegisterRawInputDevices(&ridev, 1, sizeof(ridev))) fatal("plat_mouse_init: RegisterRawInputDevices failed\n"); - - memset(&mousestate, 0, sizeof(MOUSESTATE)); } void