diff options
author | Simon Howard | 2008-10-09 19:23:50 +0000 |
---|---|---|
committer | Simon Howard | 2008-10-09 19:23:50 +0000 |
commit | 88dd6235bcf78c545796795ac6a1f0732e4fab9e (patch) | |
tree | 409b2088e6b7bccb978ca81d1a977a1a1b44150d | |
parent | bb9ceef0a9b9af7ef83a72bf8a69293227d2db53 (diff) | |
download | chocolate-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
-rw-r--r-- | src/hexen/h2_main.c | 20 |
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 |