SaveScreenshot: return the status boolean directly

Remake of PR #790 due to merge conflicts
This commit is contained in:
sukibaby
2025-05-01 13:09:55 -07:00
committed by teejusb
parent 64a1e3a49c
commit 16b3ba488d
+5 -3
View File
@@ -820,7 +820,10 @@ bool RageDisplay::SaveScreenshot( RString sPath, GraphicsFileFormat format )
case SAVE_LOSSY_HIGH_QUAL: case SAVE_LOSSY_HIGH_QUAL:
bSuccess = RageSurfaceUtils::SaveJPEG( surface, out, true ); bSuccess = RageSurfaceUtils::SaveJPEG( surface, out, true );
break; break;
DEFAULT_FAIL( format ); default:
LOG->Warn("SaveScreenshot: Invalid graphics file format requested %d", format);
bSuccess = false;
break;
} }
// LOG->Trace( "Saving Screenshot file took %f seconds.", timer.GetDeltaTime() ); // LOG->Trace( "Saving Screenshot file took %f seconds.", timer.GetDeltaTime() );
@@ -829,10 +832,9 @@ bool RageDisplay::SaveScreenshot( RString sPath, GraphicsFileFormat format )
if( !bSuccess ) if( !bSuccess )
{ {
LOG->Warn("SaveScreenshot: Failed to save screenshot to %s: %s", sPath.c_str(), out.GetError().c_str() ); LOG->Warn("SaveScreenshot: Failed to save screenshot to %s: %s", sPath.c_str(), out.GetError().c_str() );
return false;
} }
return true; return bSuccess;
} }
void RageDisplay::DrawQuads( const RageSpriteVertex v[], int iNumVerts ) void RageDisplay::DrawQuads( const RageSpriteVertex v[], int iNumVerts )