- Added an option to consider intermission screens gameplay for purposes of

capturing the mouse.
- Changed: Telefragging should not thrust the victim if it isn't in precisely the
  same position as the killer.
- fixed: A_SpawnItemEx must call P_TeleportMove before checking the spawned
  object's position.


SVN r1014 (trunk)
This commit is contained in:
Christoph Oelckers 2008-06-02 16:56:53 +00:00
commit 29380f70b3
9 changed files with 92 additions and 29 deletions

View file

@ -280,13 +280,33 @@ static void MouseRead ()
}
}
CUSTOM_CVAR(Int, mouse_capturemode, 1, CVAR_GLOBALCONFIG|CVAR_ARCHIVE)
{
if (self < 0) self = 0;
else if (self > 2) self = 2;
}
static bool inGame()
{
switch (mouse_capturemode)
{
default:
case 0:
return gamestate == GS_LEVEL;
case 1:
return gamestate == GS_LEVEL || gamestate == GS_INTERMISSION || gamestate == GS_FINALE;
case 2:
return true;
}
}
static void I_CheckNativeMouse ()
{
bool focus = (SDL_GetAppState() & (SDL_APPINPUTFOCUS|SDL_APPACTIVE))
== (SDL_APPINPUTFOCUS|SDL_APPACTIVE);
bool fs = (SDL_GetVideoSurface ()->flags & SDL_FULLSCREEN) != 0;
bool wantNative = !focus || !use_mouse || (!fs && (GUICapture || paused || demoplayback || gamestate != GS_LEVEL));
bool wantNative = !focus || !use_mouse || (!fs && (GUICapture || paused || demoplayback || !inGame()));
if (wantNative != NativeMouse)
{