RageSurface_Load_GIF
This commit is contained in:
@@ -1,13 +1,21 @@
|
||||
#include "global.h"
|
||||
#include "RageSurface_Load.h"
|
||||
#include "RageSurface_Load_PNG.h"
|
||||
#include "RageSurface_Load_GIF.h"
|
||||
#include "RageUtil.h"
|
||||
#include "SDL_image.h"
|
||||
|
||||
SDL_Surface *RageSurface::LoadFile( const CString &sPath )
|
||||
{
|
||||
const CString ext = GetExtension( sPath );
|
||||
if( ext.CompareNoCase( "png" ) )
|
||||
|
||||
CString error;
|
||||
SDL_Surface *ret = NULL;
|
||||
if( !ext.CompareNoCase("png") )
|
||||
ret = RageSurface_Load_PNG( sPath, error );
|
||||
else if( !ext.CompareNoCase("gif") )
|
||||
ret = RageSurface_Load_GIF( sPath, error );
|
||||
else
|
||||
{
|
||||
SDL_RWops *rw = OpenRWops( sPath );
|
||||
if( rw == NULL )
|
||||
@@ -22,8 +30,6 @@ SDL_Surface *RageSurface::LoadFile( const CString &sPath )
|
||||
return ret;
|
||||
}
|
||||
|
||||
CString error;
|
||||
SDL_Surface *ret = RageSurface_Load_PNG( sPath, error );
|
||||
if( ret == NULL )
|
||||
SDL_SetError( "%s", error.c_str() );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user