From b6b6d1e370f6bb2046f2656a133ac9afc0c90533 Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Sat, 29 Oct 2016 16:59:34 +0000 Subject: [PATCH] sdlayer: Remove disabling certain mouse features under debug builds. It makes mouse aiming unusable. If you need to release the mouse for some reason when you can't pull down the console (such as hitting a breakpoint), execute "grabmouse_low(0)" from your debugger. Alt+Tab is your friend. DONT_BUILD. git-svn-id: https://svn.eduke32.com/eduke32@5921 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/sdlayer.c | 6 ++---- polymer/eduke32/build/src/sdlayer12.c | 4 +--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/polymer/eduke32/build/src/sdlayer.c b/polymer/eduke32/build/src/sdlayer.c index b9c486d04..a1258bd39 100644 --- a/polymer/eduke32/build/src/sdlayer.c +++ b/polymer/eduke32/build/src/sdlayer.c @@ -905,7 +905,7 @@ void uninitmouse(void) static inline char grabmouse_low(char a) { -#if !defined EDUKE32_TOUCH_DEVICES && (!defined DEBUGGINGAIDS || defined _WIN32 || defined __APPLE__) +#if !defined EDUKE32_TOUCH_DEVICES /* FIXME: Maybe it's better to make sure that grabmouse_low is called only when a window is ready? */ if (sdl_window) @@ -925,7 +925,7 @@ void grabmouse(char a) { if (appactive && moustat) { -#if !defined EDUKE32_TOUCH_DEVICES && (!defined DEBUGGINGAIDS || defined _WIN32 || defined __APPLE__) +#if !defined EDUKE32_TOUCH_DEVICES if ((a != mousegrab) && !grabmouse_low(a)) #endif mousegrab = a; @@ -1980,13 +1980,11 @@ int32_t handleevents_sdlcommon(SDL_Event *ev) { mousex += ev->motion.xrel; mousey += ev->motion.yrel; -#if !defined DEBUGGINGAIDS || MY_DEVELOPER_ID == 805120924 # if SDL_MAJOR_VERSION==1 SDL_WarpMouse(xdim>>1, ydim>>1); # else SDL_WarpMouseInWindow(sdl_window, xdim>>1, ydim>>1); # endif -#endif } } break; diff --git a/polymer/eduke32/build/src/sdlayer12.c b/polymer/eduke32/build/src/sdlayer12.c index e9a1b3686..7d5849889 100644 --- a/polymer/eduke32/build/src/sdlayer12.c +++ b/polymer/eduke32/build/src/sdlayer12.c @@ -192,7 +192,7 @@ const char *getjoyname(int32_t what, int32_t num) static inline char grabmouse_low(char a) { -#if (!defined DEBUGGINGAIDS || defined _WIN32 || defined __APPLE__) && !defined GEKKO +#if !defined GEKKO SDL_ShowCursor(a ? SDL_DISABLE : SDL_ENABLE); return (SDL_WM_GrabInput(a ? SDL_GRAB_ON : SDL_GRAB_OFF) != (a ? SDL_GRAB_ON : SDL_GRAB_OFF)); #else @@ -565,10 +565,8 @@ int32_t handleevents_pollsdl(void) if (ev.active.state & SDL_APPINPUTFOCUS) { appactive = ev.active.gain; -#if !defined DEBUGGINGAIDS if (mousegrab && moustat) grabmouse_low(!!appactive); -#endif # ifdef _WIN32 if (backgroundidle) SetPriorityClass(GetCurrentProcess(),