save lower quality jpeg to memcards

This commit is contained in:
Glenn Maynard
2004-03-23 22:35:30 +00:00
parent 1057cf4237
commit d9f0e5819b
3 changed files with 22 additions and 5 deletions
+5 -3
View File
@@ -649,11 +649,13 @@ bool RageDisplay::SaveScreenshot( CString sPath, GraphicsFileFormat format )
switch( format )
{
case bmp:
case SAVE_LOSSLESS:
SDL_SaveBMP_RW( surface, rw, false );
break;
case jpg:
IMG_SaveJPG_RW( surface, rw );
case SAVE_LOSSY_LOW_QUAL:
IMG_SaveJPG_RW( surface, rw, false );
case SAVE_LOSSY_HIGH_QUAL:
IMG_SaveJPG_RW( surface, rw, true );
break;
default:
ASSERT(0);
+6 -1
View File
@@ -210,7 +210,12 @@ public:
void DrawCircle( const RageSpriteVertex &v, float radius );
enum GraphicsFileFormat{ bmp, jpg };
enum GraphicsFileFormat
{
SAVE_LOSSLESS, // bmp
SAVE_LOSSY_LOW_QUAL, // jpg
SAVE_LOSSY_HIGH_QUAL // jpg
};
bool SaveScreenshot( CString sPath, GraphicsFileFormat format );
virtual CString GetTextureDiagnostics( unsigned id ) const { return ""; }
+11 -1
View File
@@ -1131,9 +1131,19 @@ CString SaveScreenshot( CString sDir, bool bSaveCompressed, bool bMakeSignature,
//
// Save the screenshot
//
/* If writing lossy to a memcard, use SAVE_LOSSY_LOW_QUAL, so we don't eat up
* lots of space with screenshots. */
RageDisplay::GraphicsFileFormat fmt;
if( bSaveCompressed && MEMCARDMAN->PathIsMemCard(sDir) )
fmt = RageDisplay::SAVE_LOSSY_LOW_QUAL;
else if( bSaveCompressed )
fmt = RageDisplay::SAVE_LOSSY_HIGH_QUAL;
else
fmt = RageDisplay::SAVE_LOSSLESS;
CString sFileName = ssprintf( "screen%05d.%s",iIndex,bSaveCompressed ? "jpg" : "bmp" );
CString sPath = sDir+sFileName;
bool bResult = DISPLAY->SaveScreenshot( sPath, bSaveCompressed ? RageDisplay::jpg : RageDisplay::bmp );
bool bResult = DISPLAY->SaveScreenshot( sPath, fmt );
if( !bResult )
{
SOUND->PlayOnce( THEME->GetPathToS("Common invalid") );