mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-26 03:30:46 +00:00
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
This commit is contained in:
parent
6798cb05ee
commit
b6b6d1e370
2 changed files with 3 additions and 7 deletions
|
@ -905,7 +905,7 @@ void uninitmouse(void)
|
||||||
|
|
||||||
static inline char grabmouse_low(char a)
|
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
|
/* FIXME: Maybe it's better to make sure that grabmouse_low
|
||||||
is called only when a window is ready? */
|
is called only when a window is ready? */
|
||||||
if (sdl_window)
|
if (sdl_window)
|
||||||
|
@ -925,7 +925,7 @@ void grabmouse(char a)
|
||||||
{
|
{
|
||||||
if (appactive && moustat)
|
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))
|
if ((a != mousegrab) && !grabmouse_low(a))
|
||||||
#endif
|
#endif
|
||||||
mousegrab = a;
|
mousegrab = a;
|
||||||
|
@ -1980,13 +1980,11 @@ int32_t handleevents_sdlcommon(SDL_Event *ev)
|
||||||
{
|
{
|
||||||
mousex += ev->motion.xrel;
|
mousex += ev->motion.xrel;
|
||||||
mousey += ev->motion.yrel;
|
mousey += ev->motion.yrel;
|
||||||
#if !defined DEBUGGINGAIDS || MY_DEVELOPER_ID == 805120924
|
|
||||||
# if SDL_MAJOR_VERSION==1
|
# if SDL_MAJOR_VERSION==1
|
||||||
SDL_WarpMouse(xdim>>1, ydim>>1);
|
SDL_WarpMouse(xdim>>1, ydim>>1);
|
||||||
# else
|
# else
|
||||||
SDL_WarpMouseInWindow(sdl_window, xdim>>1, ydim>>1);
|
SDL_WarpMouseInWindow(sdl_window, xdim>>1, ydim>>1);
|
||||||
# endif
|
# endif
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -192,7 +192,7 @@ const char *getjoyname(int32_t what, int32_t num)
|
||||||
|
|
||||||
static inline char grabmouse_low(char a)
|
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);
|
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));
|
return (SDL_WM_GrabInput(a ? SDL_GRAB_ON : SDL_GRAB_OFF) != (a ? SDL_GRAB_ON : SDL_GRAB_OFF));
|
||||||
#else
|
#else
|
||||||
|
@ -565,10 +565,8 @@ int32_t handleevents_pollsdl(void)
|
||||||
if (ev.active.state & SDL_APPINPUTFOCUS)
|
if (ev.active.state & SDL_APPINPUTFOCUS)
|
||||||
{
|
{
|
||||||
appactive = ev.active.gain;
|
appactive = ev.active.gain;
|
||||||
#if !defined DEBUGGINGAIDS
|
|
||||||
if (mousegrab && moustat)
|
if (mousegrab && moustat)
|
||||||
grabmouse_low(!!appactive);
|
grabmouse_low(!!appactive);
|
||||||
#endif
|
|
||||||
# ifdef _WIN32
|
# ifdef _WIN32
|
||||||
if (backgroundidle)
|
if (backgroundidle)
|
||||||
SetPriorityClass(GetCurrentProcess(),
|
SetPriorityClass(GetCurrentProcess(),
|
||||||
|
|
Loading…
Reference in a new issue