Fix messed up view angle after taking screenshots

Pretty much like https://github.com/dhewm/dhewm3/issues/18
but here it took some more changes
This commit is contained in:
Daniel Gibson 2012-12-23 06:21:01 +01:00
parent 7cfe7dd69a
commit 876aa96637
4 changed files with 12 additions and 5 deletions

View file

@ -214,9 +214,11 @@ public:
// Called repeatedly as the foreground thread for rendering and game logic.
virtual void Frame() = 0;
// DG: added possibility to *not* release mouse in UpdateScreen(), it fucks up the view angle for screenshots
// Redraws the screen, handling games, guis, console, etc
// in a modal manner outside the normal frame loop
virtual void UpdateScreen( bool captureToImage ) = 0;
virtual void UpdateScreen( bool captureToImage, bool releaseMouse = true ) = 0;
// DG end
virtual void UpdateLevelLoadPacifier() = 0;

View file

@ -148,7 +148,9 @@ public:
virtual void Quit();
virtual bool IsInitialized() const;
virtual void Frame();
virtual void UpdateScreen( bool captureToImage );
// DG: added possibility to *not* release mouse in UpdateScreen(), it fucks up the view angle for screenshots
virtual void UpdateScreen( bool captureToImage, bool releaseMouse = true );
// DG end
virtual void UpdateLevelLoadPacifier();
virtual void StartupVariable( const char* match );
virtual void WriteConfigToFile( const char* filename );

View file

@ -349,7 +349,8 @@ idCommonLocal::UpdateScreen
This is an out-of-sequence screen update, not the normal game rendering
===============
*/
void idCommonLocal::UpdateScreen( bool captureToImage )
// DG: added possibility to *not* release mouse in UpdateScreen(), it fucks up the view angle for screenshots
void idCommonLocal::UpdateScreen( bool captureToImage, bool releaseMouse )
{
if( insideUpdateScreen )
{
@ -361,7 +362,9 @@ void idCommonLocal::UpdateScreen( bool captureToImage )
gameThread.WaitForThread();
// release the mouse capture back to the desktop
Sys_GrabMouseCursor( false );
if( releaseMouse )
Sys_GrabMouseCursor( false );
// DG end
// build all the draw commands without running a new game tic
Draw();

View file

@ -1298,7 +1298,7 @@ void R_ReadTiledPixels( int width, int height, byte* buffer, renderView_t* ref =
else
{
const bool captureToImage = false;
common->UpdateScreen( captureToImage );
common->UpdateScreen( captureToImage, false );
}
int w = sysWidth;