From df50dcd897135421a903b72467813ad78a629f6b Mon Sep 17 00:00:00 2001 From: terminx Date: Mon, 23 Apr 2018 06:35:52 +0000 Subject: [PATCH] Change mouseGrabInput()'s parameter to a bool git-svn-id: https://svn.eduke32.com/eduke32@6851 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/build/include/baselayer.h | 2 +- source/build/src/rawinput.cpp | 6 +++--- source/build/src/sdlayer.cpp | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/source/build/include/baselayer.h b/source/build/include/baselayer.h index 295e78c56..a551d977c 100644 --- a/source/build/include/baselayer.h +++ b/source/build/include/baselayer.h @@ -225,7 +225,7 @@ void keyFlushChars(void); int32_t mouseInit(void); void mouseUninit(void); int32_t mouseReadAbs(vec2_t *const destination, vec2_t const *const source); -void mouseGrabInput(char a); +void mouseGrabInput(bool grab); void mouseLockToWindow(char a); void mouseReadButtons(int32_t *b); void mouseReadPos(int32_t *x, int32_t *y); diff --git a/source/build/src/rawinput.cpp b/source/build/src/rawinput.cpp index dc45760de..bd829a71d 100644 --- a/source/build/src/rawinput.cpp +++ b/source/build/src/rawinput.cpp @@ -292,7 +292,7 @@ void mouseUninit(void) mouseGrabInput(g_mouseEnabled = 0); } -void mouseGrabInput(char a) +void mouseGrabInput(bool grab) { static POINT pos; static int32_t d = 0; @@ -305,8 +305,8 @@ void mouseGrabInput(char a) d++; } - ShowCursor(a == 0); - RI_CaptureInput(a, (HWND)win_gethwnd()); + ShowCursor(grab == 0); + RI_CaptureInput(grab, (HWND)win_gethwnd()); SetCursorPos(pos.x, pos.y); } diff --git a/source/build/src/sdlayer.cpp b/source/build/src/sdlayer.cpp index 3eb023bc3..7843692e5 100644 --- a/source/build/src/sdlayer.cpp +++ b/source/build/src/sdlayer.cpp @@ -940,17 +940,17 @@ static inline char grabmouse_low(char a) // // grabmouse() -- show/hide mouse cursor // -void mouseGrabInput(char a) +void mouseGrabInput(bool grab) { if (appactive && g_mouseEnabled) { #if !defined EDUKE32_TOUCH_DEVICES - if ((a != g_mouseGrabbed) && !grabmouse_low(a)) + if ((grab != g_mouseGrabbed) && !grabmouse_low(grab)) #endif - g_mouseGrabbed = a; + g_mouseGrabbed = grab; } else - g_mouseGrabbed = a; + g_mouseGrabbed = grab; g_mousePos.x = g_mousePos.y = 0; }