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:
@@ -766,6 +766,13 @@ bool RageDisplay::SaveScreenshot( RString sPath, GraphicsFileFormat format )
|
|||||||
RageTimer timer;
|
RageTimer timer;
|
||||||
RageSurface *surface = this->CreateScreenshot();
|
RageSurface *surface = this->CreateScreenshot();
|
||||||
// LOG->Trace( "CreateScreenshot took %f seconds", timer.GetDeltaTime() );
|
// 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,
|
/* 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
|
* there's no sense in saving 1280x960 screenshots, and we don't want to output
|
||||||
* screenshots in a strange (non-1) sample aspect ratio. */
|
* screenshots in a strange (non-1) sample aspect ratio. */
|
||||||
|
|||||||
Reference in New Issue
Block a user