summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Howard2013-10-12 03:22:10 +0000
committerSimon Howard2013-10-12 03:22:10 +0000
commit6cf2d4cc8cfec2037ac55535ef69fe5b7bb39cb8 (patch)
tree3bb0d8bbd54e2ae3b6d0a3e2d2118e270eb9ce85
parent6e09cdf285c5f7526138c905130d17c7248eef63 (diff)
downloadchocolate-doom-6cf2d4cc8cfec2037ac55535ef69fe5b7bb39cb8.tar.gz
chocolate-doom-6cf2d4cc8cfec2037ac55535ef69fe5b7bb39cb8.tar.bz2
chocolate-doom-6cf2d4cc8cfec2037ac55535ef69fe5b7bb39cb8.zip
Tweak mouse grab behavior: don't arbitrarily warp the mouse at game
startup. Subversion-branch: /branches/v2-branch Subversion-revision: 2699
-rw-r--r--src/doom/d_main.c4
-rw-r--r--src/heretic/d_main.c8
-rw-r--r--src/hexen/h2_main.c8
-rw-r--r--src/i_video.c5
4 files changed, 10 insertions, 15 deletions
diff --git a/src/doom/d_main.c b/src/doom/d_main.c
index eb36f4bb..931c50a8 100644
--- a/src/doom/d_main.c
+++ b/src/doom/d_main.c
@@ -409,7 +409,7 @@ boolean D_GrabMouseCallback(void)
// only grab mouse when playing levels (but not demos)
- return (gamestate == GS_LEVEL) && !demoplayback;
+ return (gamestate == GS_LEVEL) && !demoplayback && !advancedemo;
}
//
@@ -426,9 +426,9 @@ void D_DoomLoop (void)
I_SetWindowTitle(gamedescription);
I_GraphicsCheckCommandLine();
+ I_SetGrabMouseCallback(D_GrabMouseCallback);
I_InitGraphics();
I_EnableLoadingDisk();
- I_SetGrabMouseCallback(D_GrabMouseCallback);
V_RestoreBuffer();
R_ExecuteSetViewSize();
diff --git a/src/heretic/d_main.c b/src/heretic/d_main.c
index 5d9def79..d43c4994 100644
--- a/src/heretic/d_main.c
+++ b/src/heretic/d_main.c
@@ -226,14 +226,14 @@ void D_Display(void)
boolean D_GrabMouseCallback(void)
{
- // when menu is active or game is paused, release the mouse
-
+ // when menu is active or game is paused, release the mouse
+
if (MenuActive || paused)
return false;
// only grab mouse when playing levels (but not demos)
- return (gamestate == GS_LEVEL) && !demoplayback;
+ return (gamestate == GS_LEVEL) && !demoplayback && !advancedemo;
}
//---------------------------------------------------------------------------
@@ -251,8 +251,8 @@ void D_DoomLoop(void)
debugfile = fopen(filename, "w");
}
I_GraphicsCheckCommandLine();
- I_InitGraphics();
I_SetGrabMouseCallback(D_GrabMouseCallback);
+ I_InitGraphics();
main_loop_started = true;
diff --git a/src/hexen/h2_main.c b/src/hexen/h2_main.c
index 33d345e8..f1a22cd7 100644
--- a/src/hexen/h2_main.c
+++ b/src/hexen/h2_main.c
@@ -202,14 +202,14 @@ static void D_SetDefaultSavePath(void)
static boolean D_GrabMouseCallback(void)
{
- // when menu is active or game is paused, release the mouse
-
+ // when menu is active or game is paused, release the mouse
+
if (MenuActive || paused)
return false;
// only grab mouse when playing levels (but not demos)
- return (gamestate == GS_LEVEL) && !demoplayback;
+ return (gamestate == GS_LEVEL) && !advancedemo && !demoplayback;
}
// Message displayed when quitting Hexen
@@ -620,8 +620,8 @@ void H2_GameLoop(void)
}
I_SetWindowTitle("Hexen");
I_GraphicsCheckCommandLine();
- I_InitGraphics();
I_SetGrabMouseCallback(D_GrabMouseCallback);
+ I_InitGraphics();
while (1)
{
diff --git a/src/i_video.c b/src/i_video.c
index 46264fdf..07c5b3b7 100644
--- a/src/i_video.c
+++ b/src/i_video.c
@@ -2203,11 +2203,6 @@ void I_InitGraphics(void)
while (SDL_PollEvent(&dummy));
- if (usemouse && !nomouse && (fullscreen || grabmouse))
- {
- CenterMouse();
- }
-
initialized = true;
// Call I_ShutdownGraphics on quit