Fix screenshot crash.

This commit is contained in:
Steve Checkoway
2005-12-23 13:10:21 +00:00
parent 417461540b
commit bfd39f66ac
+8 -3
View File
@@ -635,9 +635,14 @@ bool RageDisplay::SaveScreenshot( CString sPath, GraphicsFileFormat format )
if( format != SAVE_LOSSLESS )
{
/* Maintain the DAR. */
int iWidth = lrintf( 640 / GetActualVideoModeParams().fDisplayAspectRatio );
LOG->Trace( "%ix%i -> %ix%i (%.3f)", surface->w, surface->h, 640, iWidth, GetActualVideoModeParams().fDisplayAspectRatio );
RageSurfaceUtils::Zoom( surface, 640, iWidth );
float fDAR = GetActualVideoModeParams().fDisplayAspectRatio;
// -1 seems to be a sentinel
if( fDAR < 0.0f )
fDAR = 4.0f/3.0f;
int iHeight = lrintf( 640 / fDAR );
LOG->Trace( "%ix%i -> %ix%i (%.3f)", surface->w, surface->h, 640, iHeight, fDAR );
RageSurfaceUtils::Zoom( surface, 640, iHeight );
}
RageFile out;