RageSurface_Load_GIF

This commit is contained in:
Glenn Maynard
2004-05-18 03:14:35 +00:00
parent e9b5ce0e88
commit ae8f98a9de
5 changed files with 575 additions and 29 deletions
+9 -3
View File
@@ -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() );