save lower quality jpeg to memcards
This commit is contained in:
@@ -649,11 +649,13 @@ bool RageDisplay::SaveScreenshot( CString sPath, GraphicsFileFormat format )
|
|||||||
|
|
||||||
switch( format )
|
switch( format )
|
||||||
{
|
{
|
||||||
case bmp:
|
case SAVE_LOSSLESS:
|
||||||
SDL_SaveBMP_RW( surface, rw, false );
|
SDL_SaveBMP_RW( surface, rw, false );
|
||||||
break;
|
break;
|
||||||
case jpg:
|
case SAVE_LOSSY_LOW_QUAL:
|
||||||
IMG_SaveJPG_RW( surface, rw );
|
IMG_SaveJPG_RW( surface, rw, false );
|
||||||
|
case SAVE_LOSSY_HIGH_QUAL:
|
||||||
|
IMG_SaveJPG_RW( surface, rw, true );
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ASSERT(0);
|
ASSERT(0);
|
||||||
|
|||||||
@@ -210,7 +210,12 @@ public:
|
|||||||
|
|
||||||
void DrawCircle( const RageSpriteVertex &v, float radius );
|
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 );
|
bool SaveScreenshot( CString sPath, GraphicsFileFormat format );
|
||||||
|
|
||||||
virtual CString GetTextureDiagnostics( unsigned id ) const { return ""; }
|
virtual CString GetTextureDiagnostics( unsigned id ) const { return ""; }
|
||||||
|
|||||||
@@ -1131,9 +1131,19 @@ CString SaveScreenshot( CString sDir, bool bSaveCompressed, bool bMakeSignature,
|
|||||||
//
|
//
|
||||||
// Save the screenshot
|
// 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 sFileName = ssprintf( "screen%05d.%s",iIndex,bSaveCompressed ? "jpg" : "bmp" );
|
||||||
CString sPath = sDir+sFileName;
|
CString sPath = sDir+sFileName;
|
||||||
bool bResult = DISPLAY->SaveScreenshot( sPath, bSaveCompressed ? RageDisplay::jpg : RageDisplay::bmp );
|
bool bResult = DISPLAY->SaveScreenshot( sPath, fmt );
|
||||||
if( !bResult )
|
if( !bResult )
|
||||||
{
|
{
|
||||||
SOUND->PlayOnce( THEME->GetPathToS("Common invalid") );
|
SOUND->PlayOnce( THEME->GetPathToS("Common invalid") );
|
||||||
|
|||||||
Reference in New Issue
Block a user