Grab mouse again when closing menu, unpausing, etc
This commit is contained in:
parent
62397a36ec
commit
5bde4df439
|
@ -245,6 +245,8 @@ void I_GetJoystick2Events(void){}
|
||||||
|
|
||||||
void I_GetMouseEvents(void){}
|
void I_GetMouseEvents(void){}
|
||||||
|
|
||||||
|
void I_UpdateMouseGrab(void){}
|
||||||
|
|
||||||
char *I_GetEnv(const char *name)
|
char *I_GetEnv(const char *name)
|
||||||
{
|
{
|
||||||
LOGW("I_GetEnv() called?!");
|
LOGW("I_GetEnv() called?!");
|
||||||
|
|
|
@ -592,6 +592,8 @@ void CON_ToggleOff(void)
|
||||||
CON_ClearHUD();
|
CON_ClearHUD();
|
||||||
con_forcepic = 0;
|
con_forcepic = 0;
|
||||||
con_clipviewtop = -1; // remove console clipping of view
|
con_clipviewtop = -1; // remove console clipping of view
|
||||||
|
|
||||||
|
I_UpdateMouseGrab();
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean CON_Ready(void)
|
boolean CON_Ready(void)
|
||||||
|
@ -616,6 +618,7 @@ void CON_Ticker(void)
|
||||||
consoletoggle = false;
|
consoletoggle = false;
|
||||||
con_destlines = 0;
|
con_destlines = 0;
|
||||||
CON_ClearHUD();
|
CON_ClearHUD();
|
||||||
|
I_UpdateMouseGrab();
|
||||||
}
|
}
|
||||||
|
|
||||||
// console key was pushed
|
// console key was pushed
|
||||||
|
@ -628,6 +631,7 @@ void CON_Ticker(void)
|
||||||
{
|
{
|
||||||
con_destlines = 0;
|
con_destlines = 0;
|
||||||
CON_ClearHUD();
|
CON_ClearHUD();
|
||||||
|
I_UpdateMouseGrab();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
CON_ChangeHeight();
|
CON_ChangeHeight();
|
||||||
|
|
|
@ -2203,6 +2203,8 @@ static void Got_Pause(UINT8 **cp, INT32 playernum)
|
||||||
else
|
else
|
||||||
S_ResumeAudio();
|
S_ResumeAudio();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
I_UpdateMouseGrab();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Command for stuck characters in netgames, griefing, etc.
|
// Command for stuck characters in netgames, griefing, etc.
|
||||||
|
|
|
@ -4539,11 +4539,13 @@ static void DEH_LoadDehackedFile(MYFILE *f, boolean mainfile)
|
||||||
if (introchanged)
|
if (introchanged)
|
||||||
{
|
{
|
||||||
menuactive = false;
|
menuactive = false;
|
||||||
|
I_UpdateMouseGrab();
|
||||||
COM_BufAddText("playintro");
|
COM_BufAddText("playintro");
|
||||||
}
|
}
|
||||||
else if (titlechanged)
|
else if (titlechanged)
|
||||||
{
|
{
|
||||||
menuactive = false;
|
menuactive = false;
|
||||||
|
I_UpdateMouseGrab();
|
||||||
COM_BufAddText("exitgame"); // Command_ExitGame_f() but delayed
|
COM_BufAddText("exitgame"); // Command_ExitGame_f() but delayed
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -150,6 +150,8 @@ void I_GetJoystick2Events(void){}
|
||||||
|
|
||||||
void I_GetMouseEvents(void){}
|
void I_GetMouseEvents(void){}
|
||||||
|
|
||||||
|
void I_UpdateMouseGrab(void){}
|
||||||
|
|
||||||
char *I_GetEnv(const char *name)
|
char *I_GetEnv(const char *name)
|
||||||
{
|
{
|
||||||
(void)name;
|
(void)name;
|
||||||
|
|
|
@ -1832,6 +1832,7 @@ void G_DoLoadLevel(boolean resetplayer)
|
||||||
titlemapinaction = TITLEMAP_OFF;
|
titlemapinaction = TITLEMAP_OFF;
|
||||||
|
|
||||||
G_SetGamestate(GS_LEVEL);
|
G_SetGamestate(GS_LEVEL);
|
||||||
|
I_UpdateMouseGrab();
|
||||||
|
|
||||||
for (i = 0; i < MAXPLAYERS; i++)
|
for (i = 0; i < MAXPLAYERS; i++)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1173,6 +1173,8 @@ void HU_clearChatChars(void)
|
||||||
w_chat[i] = 0; // reset this.
|
w_chat[i] = 0; // reset this.
|
||||||
chat_on = false;
|
chat_on = false;
|
||||||
c_input = 0;
|
c_input = 0;
|
||||||
|
|
||||||
|
I_UpdateMouseGrab();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef NONET
|
#ifndef NONET
|
||||||
|
@ -1323,6 +1325,7 @@ boolean HU_Responder(event_t *ev)
|
||||||
chat_on = false;
|
chat_on = false;
|
||||||
c_input = 0; // reset input cursor
|
c_input = 0; // reset input cursor
|
||||||
chat_scrollmedown = true; // you hit enter, so you might wanna autoscroll to see what you just sent. :)
|
chat_scrollmedown = true; // you hit enter, so you might wanna autoscroll to see what you just sent. :)
|
||||||
|
I_UpdateMouseGrab();
|
||||||
}
|
}
|
||||||
else if (c == KEY_ESCAPE
|
else if (c == KEY_ESCAPE
|
||||||
|| ((c == gamecontrol[gc_talkkey][0] || c == gamecontrol[gc_talkkey][1]
|
|| ((c == gamecontrol[gc_talkkey][0] || c == gamecontrol[gc_talkkey][1]
|
||||||
|
@ -1331,6 +1334,7 @@ boolean HU_Responder(event_t *ev)
|
||||||
{
|
{
|
||||||
chat_on = false;
|
chat_on = false;
|
||||||
c_input = 0; // reset input cursor
|
c_input = 0; // reset input cursor
|
||||||
|
I_UpdateMouseGrab();
|
||||||
}
|
}
|
||||||
else if ((c == KEY_UPARROW || c == KEY_MOUSEWHEELUP) && chat_scroll > 0 && !OLDCHAT) // CHAT SCROLLING YAYS!
|
else if ((c == KEY_UPARROW || c == KEY_MOUSEWHEELUP) && chat_scroll > 0 && !OLDCHAT) // CHAT SCROLLING YAYS!
|
||||||
{
|
{
|
||||||
|
|
|
@ -288,6 +288,10 @@ void I_GetJoystick2Events(void);
|
||||||
*/
|
*/
|
||||||
void I_GetMouseEvents(void);
|
void I_GetMouseEvents(void);
|
||||||
|
|
||||||
|
/** \brief Checks if the mouse needs to be grabbed
|
||||||
|
*/
|
||||||
|
void I_UpdateMouseGrab(void);
|
||||||
|
|
||||||
char *I_GetEnv(const char *name);
|
char *I_GetEnv(const char *name);
|
||||||
|
|
||||||
INT32 I_PutEnv(char *variable);
|
INT32 I_PutEnv(char *variable);
|
||||||
|
|
|
@ -2867,6 +2867,7 @@ static void M_GoBack(INT32 choice)
|
||||||
|
|
||||||
menuactive = false;
|
menuactive = false;
|
||||||
wipetypepre = menupres[M_GetYoungestChildMenu()].exitwipe;
|
wipetypepre = menupres[M_GetYoungestChildMenu()].exitwipe;
|
||||||
|
I_UpdateMouseGrab();
|
||||||
D_StartTitle();
|
D_StartTitle();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -3592,6 +3593,8 @@ void M_ClearMenus(boolean callexitmenufunc)
|
||||||
currentMenu = &MainDef; // Not like it matters
|
currentMenu = &MainDef; // Not like it matters
|
||||||
menuactive = false;
|
menuactive = false;
|
||||||
hidetitlemap = false;
|
hidetitlemap = false;
|
||||||
|
|
||||||
|
I_UpdateMouseGrab();
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
@ -388,6 +388,14 @@ void SDLforceUngrabMouse(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void I_UpdateMouseGrab(void)
|
||||||
|
{
|
||||||
|
if (SDL_WasInit(SDL_INIT_VIDEO) == SDL_INIT_VIDEO && window != NULL
|
||||||
|
&& SDL_GetMouseFocus() == window && SDL_GetKeyboardFocus() == window
|
||||||
|
&& !IGNORE_MOUSE)
|
||||||
|
SDLdoGrabMouse();
|
||||||
|
}
|
||||||
|
|
||||||
static void VID_Command_NumModes_f (void)
|
static void VID_Command_NumModes_f (void)
|
||||||
{
|
{
|
||||||
CONS_Printf(M_GetText("%d video mode(s) available(s)\n"), VID_NumModes());
|
CONS_Printf(M_GetText("%d video mode(s) available(s)\n"), VID_NumModes());
|
||||||
|
|
|
@ -1354,6 +1354,8 @@ getBufferedData:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void I_UpdateMouseGrab(void) {}
|
||||||
|
|
||||||
// ===========================================================================================
|
// ===========================================================================================
|
||||||
// DIRECT INPUT JOYSTICK
|
// DIRECT INPUT JOYSTICK
|
||||||
// ===========================================================================================
|
// ===========================================================================================
|
||||||
|
|
Loading…
Reference in New Issue