Add a "alwaysgrabmouse" console variable
This commit is contained in:
parent
e0e5e83869
commit
49934007d7
|
@ -100,6 +100,7 @@ boolean highcolor = false;
|
||||||
// synchronize page flipping with screen refresh
|
// synchronize page flipping with screen refresh
|
||||||
consvar_t cv_vidwait = {"vid_wait", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
consvar_t cv_vidwait = {"vid_wait", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
static consvar_t cv_stretch = {"stretch", "Off", CV_SAVE|CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
static consvar_t cv_stretch = {"stretch", "Off", CV_SAVE|CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
|
static consvar_t cv_alwaysgrabmouse = {"alwaysgrabmouse", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
|
|
||||||
UINT8 graphics_started = 0; // Is used in console.c and screen.c
|
UINT8 graphics_started = 0; // Is used in console.c and screen.c
|
||||||
|
|
||||||
|
@ -109,7 +110,7 @@ static SDL_bool disable_fullscreen = SDL_FALSE;
|
||||||
#define USE_FULLSCREEN (disable_fullscreen||!allow_fullscreen)?0:cv_fullscreen.value
|
#define USE_FULLSCREEN (disable_fullscreen||!allow_fullscreen)?0:cv_fullscreen.value
|
||||||
static SDL_bool disable_mouse = SDL_FALSE;
|
static SDL_bool disable_mouse = SDL_FALSE;
|
||||||
#define USE_MOUSEINPUT (!disable_mouse && cv_usemouse.value && havefocus)
|
#define USE_MOUSEINPUT (!disable_mouse && cv_usemouse.value && havefocus)
|
||||||
#define IGNORE_MOUSE (menuactive || paused || con_destlines || chat_on || gamestate != GS_LEVEL)
|
#define IGNORE_MOUSE (!cv_alwaysgrabmouse.value && (menuactive || paused || con_destlines || chat_on || gamestate != GS_LEVEL))
|
||||||
#define MOUSE_MENU false //(!disable_mouse && cv_usemouse.value && menuactive && !USE_FULLSCREEN)
|
#define MOUSE_MENU false //(!disable_mouse && cv_usemouse.value && menuactive && !USE_FULLSCREEN)
|
||||||
#define MOUSEBUTTONS_MAX MOUSEBUTTONS
|
#define MOUSEBUTTONS_MAX MOUSEBUTTONS
|
||||||
|
|
||||||
|
@ -1626,6 +1627,7 @@ void I_StartupGraphics(void)
|
||||||
COM_AddCommand ("vid_mode", VID_Command_Mode_f);
|
COM_AddCommand ("vid_mode", VID_Command_Mode_f);
|
||||||
CV_RegisterVar (&cv_vidwait);
|
CV_RegisterVar (&cv_vidwait);
|
||||||
CV_RegisterVar (&cv_stretch);
|
CV_RegisterVar (&cv_stretch);
|
||||||
|
CV_RegisterVar (&cv_alwaysgrabmouse);
|
||||||
disable_mouse = M_CheckParm("-nomouse");
|
disable_mouse = M_CheckParm("-nomouse");
|
||||||
disable_fullscreen = M_CheckParm("-win") ? 1 : 0;
|
disable_fullscreen = M_CheckParm("-win") ? 1 : 0;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue