Allow CreateScreenshot to return nullptr

RageDisplay_D3D::CreateScreenshot will be returning nullptr until I get
around to re-implementing it without using d3dx, which is another thing that
did not make the move into the Windows SDK.

(backport from master)
This commit is contained in:
Tracy Ward
2019-10-04 09:00:24 -04:00
parent dce0d0f91c
commit e9ca966af7
+7
View File
@@ -766,6 +766,13 @@ bool RageDisplay::SaveScreenshot( RString sPath, GraphicsFileFormat format )
RageTimer timer;
RageSurface *surface = this->CreateScreenshot();
// LOG->Trace( "CreateScreenshot took %f seconds", timer.GetDeltaTime() );
if (nullptr == surface)
{
LOG->Trace("CreateScreenshot failed to return a surface");
return false;
}
/* Unless we're in lossless, resize the image to 640x480. If we're saving lossy,
* there's no sense in saving 1280x960 screenshots, and we don't want to output
* screenshots in a strange (non-1) sample aspect ratio. */