LoadFile( bHeaderOnly ): only load image dimensions

caching TM4: 37 secs -> 28 secs
only implemented for PNG; 90% of song images are PNG anyway
This commit is contained in:
Glenn Maynard
2004-05-19 05:10:23 +00:00
parent 792cecd972
commit 703ebfca58
5 changed files with 29 additions and 10 deletions
+2 -2
View File
@@ -6,14 +6,14 @@
#include "RageUtil.h"
#include "RageFile.h"
SDL_Surface *RageSurface::LoadFile( const CString &sPath )
SDL_Surface *RageSurface::LoadFile( const CString &sPath, bool bHeaderOnly )
{
const CString ext = GetExtension( sPath );
CString error;
SDL_Surface *ret = NULL;
if( !ext.CompareNoCase("png") )
ret = RageSurface_Load_PNG( sPath, error );
ret = RageSurface_Load_PNG( sPath, bHeaderOnly, error );
else if( !ext.CompareNoCase("gif") )
ret = RageSurface_Load_GIF( sPath, error );
else if( !ext.CompareNoCase("jpg") )