summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon Howard2008-10-09 19:23:50 +0000
committerSimon Howard2008-10-09 19:23:50 +0000
commit88dd6235bcf78c545796795ac6a1f0732e4fab9e (patch)
tree409b2088e6b7bccb978ca81d1a977a1a1b44150d /src
parentbb9ceef0a9b9af7ef83a72bf8a69293227d2db53 (diff)
downloadchocolate-doom-88dd6235bcf78c545796795ac6a1f0732e4fab9e.tar.gz
chocolate-doom-88dd6235bcf78c545796795ac6a1f0732e4fab9e.tar.bz2
chocolate-doom-88dd6235bcf78c545796795ac6a1f0732e4fab9e.zip
Add mouse grab callback for Hexen.
Subversion-branch: /branches/raven-branch Subversion-revision: 1347
Diffstat (limited to 'src')
-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