This commit is contained in:
Glenn Maynard
2004-05-17 02:38:01 +00:00
parent ec1b8430bc
commit a33e65a552
8 changed files with 14 additions and 18 deletions
+2 -1
View File
@@ -10,6 +10,7 @@
#include "RageDisplay.h" #include "RageDisplay.h"
#include "RageUtil.h" #include "RageUtil.h"
#include "RageLog.h" #include "RageLog.h"
#include "RageSurface_Load.h"
#include "BannerCache.h" #include "BannerCache.h"
#include "Sprite.h" #include "Sprite.h"
#include "PrefsManager.h" #include "PrefsManager.h"
@@ -303,7 +304,7 @@ void BannerCache::CacheBanner( CString BannerPath )
void BannerCache::CacheBannerInternal( CString BannerPath ) void BannerCache::CacheBannerInternal( CString BannerPath )
{ {
SDL_Surface *img = SDL_LoadImage( BannerPath ); SDL_Surface *img = RageSurface::LoadFile( BannerPath );
if( img == NULL ) if( img == NULL )
{ {
LOG->Warn( "BannerCache::CacheBanner: Couldn't load %s: %s", BannerPath.c_str(), SDL_GetError() ); LOG->Warn( "BannerCache::CacheBanner: Couldn't load %s: %s", BannerPath.c_str(), SDL_GetError() );
+2 -1
View File
@@ -14,6 +14,7 @@
#include "SDL_rotozoom.h" #include "SDL_rotozoom.h"
#include "SDL_utils.h" #include "SDL_utils.h"
#include "SDL_dither.h" #include "SDL_dither.h"
#include "RageSurface_Load.h"
static void GetResolutionFromFileName( CString sPath, int &Width, int &Height ) static void GetResolutionFromFileName( CString sPath, int &Width, int &Height )
{ {
@@ -70,7 +71,7 @@ void RageBitmapTexture::Create()
/* Create (and return) a surface ready to be loaded to OpenGL */ /* Create (and return) a surface ready to be loaded to OpenGL */
/* Load the image into an SDL surface. */ /* Load the image into an SDL surface. */
SDL_Surface *img = SDL_LoadImage( actualID.filename ); SDL_Surface *img = RageSurface::LoadFile( actualID.filename );
/* Tolerate corrupt/unknown images. */ /* Tolerate corrupt/unknown images. */
if( img == NULL ) if( img == NULL )
+1 -1
View File
@@ -4,7 +4,7 @@
#include "RageUtil.h" #include "RageUtil.h"
#include "SDL_image.h" #include "SDL_image.h"
SDL_Surface *LoadSurface( const CString &sPath ) SDL_Surface *RageSurface::LoadFile( const CString &sPath )
{ {
const CString ext = GetExtension( sPath ); const CString ext = GetExtension( sPath );
if( ext.CompareNoCase( "png" ) ) if( ext.CompareNoCase( "png" ) )
+5 -3
View File
@@ -1,9 +1,11 @@
#ifndef RAGE_SURFACE_LOAD_H #ifndef RAGE_SURFACE_LOAD_H
#define RAGE_SURFACE_LOAD_H #define RAGE_SURFACE_LOAD_H
#include "SDL_utils.h" struct SDL_Surface;
namespace RageSurface
SDL_Surface *LoadSurface( const CString &sPath ); {
SDL_Surface *LoadFile( const CString &sPath );
}
#endif #endif
-1
View File
@@ -162,7 +162,6 @@ static SDL_Surface *RageSurface_Load_PNG( RageFile *f, const char *fn, char erro
int num_palette; int num_palette;
png_color *palette; png_color *palette;
int ret = png_get_PLTE( png, info_ptr, &palette, &num_palette ); int ret = png_get_PLTE( png, info_ptr, &palette, &num_palette );
/* XXX: test with a paletted image that has had its palette deleted */
ASSERT( ret == PNG_INFO_PLTE ); ASSERT( ret == PNG_INFO_PLTE );
png_byte *trans = NULL; png_byte *trans = NULL;
+2 -8
View File
@@ -11,6 +11,7 @@
#include "SDL_utils.h" #include "SDL_utils.h"
#include "SDL_endian.h" #include "SDL_endian.h"
#include "SDL_image.h" #include "SDL_image.h"
#include "SDL_rotozoom.h" // for setting icon
#include "RageSurface_Load.h" #include "RageSurface_Load.h"
#include "RageFile.h" #include "RageFile.h"
#include "RageLog.h" #include "RageLog.h"
@@ -491,8 +492,6 @@ Uint8 mySDL_EventState( Uint8 type, int state )
return ret; return ret;
} }
#include "SDL_rotozoom.h" // for setting icon
void mySDL_WM_SetIcon( CString sIconFile ) void mySDL_WM_SetIcon( CString sIconFile )
{ {
#if !defined(DARWIN) #if !defined(DARWIN)
@@ -502,7 +501,7 @@ void mySDL_WM_SetIcon( CString sIconFile )
return; return;
} }
SDL_Surface *srf = SDL_LoadImage(sIconFile); SDL_Surface *srf = RageSurface::LoadFile(sIconFile);
if( srf == NULL ) if( srf == NULL )
return; return;
@@ -1093,11 +1092,6 @@ SDL_RWops *OpenRWops( const CString &sPath, bool Write )
return rw; return rw;
} }
SDL_Surface *SDL_LoadImage( const CString &sPath )
{
return LoadSurface( sPath );
}
struct RWString struct RWString
{ {
CString *buf; CString *buf;
-2
View File
@@ -82,8 +82,6 @@ void mySDL_FixupPalettedAlpha( SDL_Surface *img );
void mySDL_AddColorKey( SDL_Surface *img, Uint32 color ); void mySDL_AddColorKey( SDL_Surface *img, Uint32 color );
void ApplyHotPinkColorKey( SDL_Surface *&img ); void ApplyHotPinkColorKey( SDL_Surface *&img );
SDL_Surface *SDL_LoadImage( const CString &sPath );
SDL_RWops *OpenRWops( const CString &sPath, bool Write=false ); SDL_RWops *OpenRWops( const CString &sPath, bool Write=false );
SDL_RWops *OpenRWops( CString &sBuf ); SDL_RWops *OpenRWops( CString &sBuf );
SDL_Surface *mySDL_MakeDummySurface( int height, int width ); SDL_Surface *mySDL_MakeDummySurface( int height, int width );
+2 -1
View File
@@ -18,6 +18,7 @@
#include "IniFile.h" #include "IniFile.h"
#include "NoteData.h" #include "NoteData.h"
#include "RageSoundReader_FileReader.h" #include "RageSoundReader_FileReader.h"
#include "RageSurface_Load.h"
#include "RageException.h" #include "RageException.h"
#include "SongManager.h" #include "SongManager.h"
#include "SongCacheIndex.h" #include "SongCacheIndex.h"
@@ -683,7 +684,7 @@ void Song::TidyUpData()
continue; // skip continue; // skip
CString sPath = m_sSongDir + arrayImages[i]; CString sPath = m_sSongDir + arrayImages[i];
SDL_Surface *img = SDL_LoadImage( sPath ); SDL_Surface *img = RageSurface::LoadFile( sPath );
if( !img ) if( !img )
{ {
LOG->Trace("Couldn't load '%s': %s", sPath.c_str(), SDL_GetError()); LOG->Trace("Couldn't load '%s': %s", sPath.c_str(), SDL_GetError());