From a8e1c601bc4807f64e716d5813c7f2c26fa92e71 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Thu, 25 Sep 2008 18:17:29 +0000 Subject: Add mouse grab callback for Heretic. Subversion-branch: /branches/raven-branch Subversion-revision: 1282 --- src/heretic/d_main.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/heretic/d_main.c') diff --git a/src/heretic/d_main.c b/src/heretic/d_main.c index cf844e70..94d51851 100644 --- a/src/heretic/d_main.c +++ b/src/heretic/d_main.c @@ -188,6 +188,24 @@ void D_Display(void) I_FinishUpdate(); } +// +// D_GrabMouseCallback +// +// Called to determine whether to grab the mouse pointer +// + +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; +} + //--------------------------------------------------------------------------- // // PROC D_DoomLoop @@ -203,6 +221,8 @@ void D_DoomLoop(void) debugfile = fopen(filename, "w"); } I_InitGraphics(); + I_SetGrabMouseCallback(D_GrabMouseCallback); + while (1) { // Frame syncronous IO operations -- cgit v1.2.3