summaryrefslogtreecommitdiff
path: root/src/hexen/h2_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/hexen/h2_main.c')
-rw-r--r--src/hexen/h2_main.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/hexen/h2_main.c b/src/hexen/h2_main.c
index 6c7e4aa4..aadf647c 100644
--- a/src/hexen/h2_main.c
+++ b/src/hexen/h2_main.c
@@ -180,6 +180,24 @@ void D_BindVariables(void)
}
}
+//
+// D_GrabMouseCallback
+//
+// Called to determine whether to grab the mouse pointer
+//
+
+static boolean D_GrabMouseCallback(void)
+{
+ // 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;
+}
+
//==========================================================================
//
// H2_Main
@@ -518,6 +536,8 @@ void H2_GameLoop(void)
debugfile = fopen(filename, "w");
}
I_InitGraphics();
+ I_SetGrabMouseCallback(D_GrabMouseCallback);
+
while (1)
{
// Frame syncronous IO operations