diff --git a/stepmania/src/RageBitmapTexture.cpp b/stepmania/src/RageBitmapTexture.cpp index 7b487c1d8e..557e9466c7 100644 --- a/stepmania/src/RageBitmapTexture.cpp +++ b/stepmania/src/RageBitmapTexture.cpp @@ -67,7 +67,7 @@ void RageBitmapTexture::Create() /* Create (and return) a surface ready to be loaded to OpenGL */ /* Load the image into an SDL surface. */ - SDL_Surface *img = RageSurface::LoadFile( actualID.filename ); + SDL_Surface *img = RageSurfaceUtils::LoadFile( actualID.filename ); /* Tolerate corrupt/unknown images. */ if( img == NULL ) diff --git a/stepmania/src/RageSurface_Load.cpp b/stepmania/src/RageSurface_Load.cpp index 262e13916e..e5ddef293b 100644 --- a/stepmania/src/RageSurface_Load.cpp +++ b/stepmania/src/RageSurface_Load.cpp @@ -9,13 +9,13 @@ #include "SDL_utils.h" #include -static RageSurface::OpenResult RageSurface_Load_BMP( const CString &sPath, SDL_Surface *&ret, bool bHeaderOnly, CString &error ) +static RageSurfaceUtils::OpenResult RageSurface_Load_BMP( const CString &sPath, SDL_Surface *&ret, bool bHeaderOnly, CString &error ) { RageFile f; if( !f.Open(sPath) ) { error = f.GetError(); - return RageSurface::OPEN_FATAL_ERROR; + return RageSurfaceUtils::OPEN_FATAL_ERROR; } SDL_RWops rw; @@ -26,18 +26,18 @@ static RageSurface::OpenResult RageSurface_Load_BMP( const CString &sPath, SDL_S if( ret == NULL ) { error = SDL_GetError(); - return RageSurface::OPEN_UNKNOWN_FILE_FORMAT; + return RageSurfaceUtils::OPEN_UNKNOWN_FILE_FORMAT; } mySDL_FixupPalettedAlpha( ret ); - return RageSurface::OPEN_OK; + return RageSurfaceUtils::OPEN_OK; } static SDL_Surface *TryOpenFile( CString sPath, bool bHeaderOnly, CString &error, CString format, bool &bKeepTrying ) { SDL_Surface *ret = NULL; - RageSurface::OpenResult result; + RageSurfaceUtils::OpenResult result; if( !format.CompareNoCase("png") ) result = RageSurface_Load_PNG( sPath, ret, bHeaderOnly, error ); else if( !format.CompareNoCase("gif") ) @@ -53,7 +53,7 @@ static SDL_Surface *TryOpenFile( CString sPath, bool bHeaderOnly, CString &error return NULL; } - if( result == RageSurface::OPEN_OK ) + if( result == RageSurfaceUtils::OPEN_OK ) { ASSERT( ret ); return ret; @@ -78,15 +78,15 @@ static SDL_Surface *TryOpenFile( CString sPath, bool bHeaderOnly, CString &error * error", "permission denied"), in which case all other readers will probably fail, * too. The returned error is used, and no other formats will be tried. */ - bKeepTrying = (result != RageSurface::OPEN_FATAL_ERROR); + bKeepTrying = (result != RageSurfaceUtils::OPEN_FATAL_ERROR); switch( result ) { - case RageSurface::OPEN_UNKNOWN_FILE_FORMAT: + case RageSurfaceUtils::OPEN_UNKNOWN_FILE_FORMAT: bKeepTrying = true; error = "Unknown file format"; break; - case RageSurface::OPEN_FATAL_ERROR: + case RageSurfaceUtils::OPEN_FATAL_ERROR: /* The file matched, but failed to load. We know it's this type of data; * don't bother trying the other file types. */ bKeepTrying = false; @@ -96,7 +96,7 @@ static SDL_Surface *TryOpenFile( CString sPath, bool bHeaderOnly, CString &error return NULL; } -SDL_Surface *RageSurface::LoadFile( const CString &sPath, bool bHeaderOnly ) +SDL_Surface *RageSurfaceUtils::LoadFile( const CString &sPath, bool bHeaderOnly ) { { RageFile TestOpen; diff --git a/stepmania/src/RageSurface_Load.h b/stepmania/src/RageSurface_Load.h index 7954030ffc..38e0c95b8f 100644 --- a/stepmania/src/RageSurface_Load.h +++ b/stepmania/src/RageSurface_Load.h @@ -2,7 +2,7 @@ #define RAGE_SURFACE_LOAD_H struct SDL_Surface; -namespace RageSurface +namespace RageSurfaceUtils { enum OpenResult { diff --git a/stepmania/src/RageSurface_Load_GIF.cpp b/stepmania/src/RageSurface_Load_GIF.cpp index fd1062be8f..43a2b99db4 100644 --- a/stepmania/src/RageSurface_Load_GIF.cpp +++ b/stepmania/src/RageSurface_Load_GIF.cpp @@ -58,7 +58,7 @@ static int GetDataBlock( RageFile &f, unsigned char *buf ) } -RageSurface::OpenResult RageSurface_Load_GIF( const CString &sPath, SDL_Surface *&ret, bool bHeaderOnly, CString &error ) +RageSurfaceUtils::OpenResult RageSurface_Load_GIF( const CString &sPath, SDL_Surface *&ret, bool bHeaderOnly, CString &error ) { unsigned char buf[256]; int imageCount = 0; @@ -68,18 +68,18 @@ RageSurface::OpenResult RageSurface_Load_GIF( const CString &sPath, SDL_Surface if( !f.Open( sPath ) ) { error = f.GetError(); - return RageSurface::OPEN_FATAL_ERROR; + return RageSurfaceUtils::OPEN_FATAL_ERROR; } if( !ReadOK(f, buf, 6) ) { error = "error reading magic number"; - return RageSurface::OPEN_FATAL_ERROR; + return RageSurfaceUtils::OPEN_FATAL_ERROR; } if( strncmp((char *) buf, "GIF", 3) != 0 ) { error = "not a GIF file"; - return RageSurface::OPEN_UNKNOWN_FILE_FORMAT; + return RageSurfaceUtils::OPEN_UNKNOWN_FILE_FORMAT; } { @@ -90,14 +90,14 @@ RageSurface::OpenResult RageSurface_Load_GIF( const CString &sPath, SDL_Surface if( (strcmp(version, "87a") != 0) && (strcmp(version, "89a") != 0) ) { error = "bad version number, not '87a' or '89a'"; - return RageSurface::OPEN_FATAL_ERROR; + return RageSurfaceUtils::OPEN_FATAL_ERROR; } } if( !ReadOK(f, buf, 7) ) { error = "failed to read screen descriptor"; - return RageSurface::OPEN_FATAL_ERROR; + return RageSurfaceUtils::OPEN_FATAL_ERROR; } SDL_Color GlobalColorMap[MAXCOLORMAPSIZE]; @@ -111,7 +111,7 @@ RageSurface::OpenResult RageSurface_Load_GIF( const CString &sPath, SDL_Surface if( !ReadPalette(f, GlobalBitPixel, GlobalColorMap ) ) { error = "error reading global colormap"; - return RageSurface::OPEN_FATAL_ERROR; + return RageSurfaceUtils::OPEN_FATAL_ERROR; } } @@ -123,7 +123,7 @@ RageSurface::OpenResult RageSurface_Load_GIF( const CString &sPath, SDL_Surface if( !ReadOK(f, &type, 1) ) { error = "EOF / read error on image data"; - return RageSurface::OPEN_FATAL_ERROR; + return RageSurfaceUtils::OPEN_FATAL_ERROR; } switch( type ) { @@ -134,7 +134,7 @@ RageSurface::OpenResult RageSurface_Load_GIF( const CString &sPath, SDL_Surface { error = ssprintf( "only %d image%s found in file", imageCount, imageCount > 1 ? "s" : ""); - return RageSurface::OPEN_FATAL_ERROR; + return RageSurfaceUtils::OPEN_FATAL_ERROR; } } @@ -145,7 +145,7 @@ RageSurface::OpenResult RageSurface_Load_GIF( const CString &sPath, SDL_Surface if( !ReadOK(f, &label, 1) ) { error = "EOF / read error on extention function code"; - return RageSurface::OPEN_FATAL_ERROR; + return RageSurfaceUtils::OPEN_FATAL_ERROR; } switch( label ) @@ -168,7 +168,7 @@ RageSurface::OpenResult RageSurface_Load_GIF( const CString &sPath, SDL_Surface if( !ReadOK(f, buf, 9) ) { error = "couldn't read left/top/width/height"; - return RageSurface::OPEN_FATAL_ERROR; + return RageSurfaceUtils::OPEN_FATAL_ERROR; } int bitPixel = 1 << ((buf[8] & 0x07) + 1); @@ -179,7 +179,7 @@ RageSurface::OpenResult RageSurface_Load_GIF( const CString &sPath, SDL_Surface if( !ReadPalette(f, bitPixel, LocalColorMap) ) { error = "error reading local colormap"; - return RageSurface::OPEN_FATAL_ERROR; + return RageSurfaceUtils::OPEN_FATAL_ERROR; } } else { bitPixel = GlobalBitPixel; @@ -196,13 +196,13 @@ RageSurface::OpenResult RageSurface_Load_GIF( const CString &sPath, SDL_Surface if( transparency != -1 ) mySDL_AddColorKey( ret, transparency ); - return RageSurface::OPEN_OK; + return RageSurfaceUtils::OPEN_OK; } default: continue; /* Not a valid start character */ } } - return RageSurface::OPEN_FATAL_ERROR; + return RageSurfaceUtils::OPEN_FATAL_ERROR; } struct LWZState diff --git a/stepmania/src/RageSurface_Load_GIF.h b/stepmania/src/RageSurface_Load_GIF.h index 16db6ed2b2..f4c12a8bab 100644 --- a/stepmania/src/RageSurface_Load_GIF.h +++ b/stepmania/src/RageSurface_Load_GIF.h @@ -2,7 +2,7 @@ #define RAGE_SURFACE_LOAD_GIF_H #include "RageSurface_Load.h" -RageSurface::OpenResult RageSurface_Load_GIF( const CString &sPath, SDL_Surface *&ret, bool bHeaderOnly, CString &error ); +RageSurfaceUtils::OpenResult RageSurface_Load_GIF( const CString &sPath, SDL_Surface *&ret, bool bHeaderOnly, CString &error ); #endif diff --git a/stepmania/src/RageSurface_Load_JPEG.cpp b/stepmania/src/RageSurface_Load_JPEG.cpp index 080a9a004e..6473920447 100644 --- a/stepmania/src/RageSurface_Load_JPEG.cpp +++ b/stepmania/src/RageSurface_Load_JPEG.cpp @@ -195,13 +195,13 @@ static SDL_Surface *RageSurface_Load_JPEG( RageFile *f, const char *fn, char err } -RageSurface::OpenResult RageSurface_Load_JPEG( const CString &sPath, SDL_Surface *&ret, bool bHeaderOnly, CString &error ) +RageSurfaceUtils::OpenResult RageSurface_Load_JPEG( const CString &sPath, SDL_Surface *&ret, bool bHeaderOnly, CString &error ) { RageFile f; if( !f.Open( sPath ) ) { error = f.GetError(); - return RageSurface::OPEN_FATAL_ERROR; + return RageSurfaceUtils::OPEN_FATAL_ERROR; } char errorbuf[1024]; @@ -209,10 +209,10 @@ RageSurface::OpenResult RageSurface_Load_JPEG( const CString &sPath, SDL_Surface if( ret == NULL ) { error = errorbuf; - return RageSurface::OPEN_UNKNOWN_FILE_FORMAT; // XXX + return RageSurfaceUtils::OPEN_UNKNOWN_FILE_FORMAT; // XXX } - return RageSurface::OPEN_OK; + return RageSurfaceUtils::OPEN_OK; } /* diff --git a/stepmania/src/RageSurface_Load_JPEG.h b/stepmania/src/RageSurface_Load_JPEG.h index 2606bb18d3..12aad0b323 100644 --- a/stepmania/src/RageSurface_Load_JPEG.h +++ b/stepmania/src/RageSurface_Load_JPEG.h @@ -2,7 +2,7 @@ #define RAGE_SURFACE_LOAD_JPEG_H #include "RageSurface_Load.h" -RageSurface::OpenResult RageSurface_Load_JPEG( const CString &sPath, SDL_Surface *&ret, bool bHeaderOnly, CString &error ); +RageSurfaceUtils::OpenResult RageSurface_Load_JPEG( const CString &sPath, SDL_Surface *&ret, bool bHeaderOnly, CString &error ); #endif diff --git a/stepmania/src/RageSurface_Load_PNG.cpp b/stepmania/src/RageSurface_Load_PNG.cpp index 33cc1f7d21..b111897086 100644 --- a/stepmania/src/RageSurface_Load_PNG.cpp +++ b/stepmania/src/RageSurface_Load_PNG.cpp @@ -236,13 +236,13 @@ static SDL_Surface *RageSurface_Load_PNG( RageFile *f, const char *fn, char erro } -RageSurface::OpenResult RageSurface_Load_PNG( const CString &sPath, SDL_Surface *&ret, bool bHeaderOnly, CString &error ) +RageSurfaceUtils::OpenResult RageSurface_Load_PNG( const CString &sPath, SDL_Surface *&ret, bool bHeaderOnly, CString &error ) { RageFile f; if( !f.Open( sPath ) ) { error = f.GetError(); - return RageSurface::OPEN_FATAL_ERROR; + return RageSurfaceUtils::OPEN_FATAL_ERROR; } char errorbuf[1024]; @@ -250,10 +250,10 @@ RageSurface::OpenResult RageSurface_Load_PNG( const CString &sPath, SDL_Surface if( ret == NULL ) { error = errorbuf; - return RageSurface::OPEN_UNKNOWN_FILE_FORMAT; // XXX + return RageSurfaceUtils::OPEN_UNKNOWN_FILE_FORMAT; // XXX } - return RageSurface::OPEN_OK; + return RageSurfaceUtils::OPEN_OK; } /* diff --git a/stepmania/src/RageSurface_Load_PNG.h b/stepmania/src/RageSurface_Load_PNG.h index 8c18ee0ddc..0eed00e739 100644 --- a/stepmania/src/RageSurface_Load_PNG.h +++ b/stepmania/src/RageSurface_Load_PNG.h @@ -2,7 +2,7 @@ #define RAGE_SURFACE_LOAD_PNG_H #include "RageSurface_Load.h" -RageSurface::OpenResult RageSurface_Load_PNG( const CString &sPath, SDL_Surface *&ret, bool bHeaderOnly, CString &error ); +RageSurfaceUtils::OpenResult RageSurface_Load_PNG( const CString &sPath, SDL_Surface *&ret, bool bHeaderOnly, CString &error ); #endif diff --git a/stepmania/src/SDL_utils.cpp b/stepmania/src/SDL_utils.cpp index 288035f3f4..9c10bc12b7 100644 --- a/stepmania/src/SDL_utils.cpp +++ b/stepmania/src/SDL_utils.cpp @@ -497,7 +497,7 @@ void mySDL_WM_SetIcon( CString sIconFile ) return; } - SDL_Surface *srf = RageSurface::LoadFile(sIconFile); + SDL_Surface *srf = RageSurfaceUtils::LoadFile(sIconFile); if( srf == NULL ) return; diff --git a/stepmania/src/Song.cpp b/stepmania/src/Song.cpp index 1b66f3cf53..350b888c6e 100644 --- a/stepmania/src/Song.cpp +++ b/stepmania/src/Song.cpp @@ -697,7 +697,7 @@ void Song::TidyUpData() CString sPath = m_sSongDir + arrayImages[i]; /* We only care about the dimensions. */ - SDL_Surface *img = RageSurface::LoadFile( sPath, true ); + SDL_Surface *img = RageSurfaceUtils::LoadFile( sPath, true ); if( !img ) { LOG->Trace("Couldn't load '%s': %s", sPath.c_str(), SDL_GetError()); diff --git a/stepmania/src/arch/LoadingWindow/LoadingWindow_Win32.cpp b/stepmania/src/arch/LoadingWindow/LoadingWindow_Win32.cpp index 8e60a4438c..871db92b3f 100644 --- a/stepmania/src/arch/LoadingWindow/LoadingWindow_Win32.cpp +++ b/stepmania/src/arch/LoadingWindow/LoadingWindow_Win32.cpp @@ -13,7 +13,7 @@ static HBITMAP g_hBitmap = NULL; /* Load a file into a GDI surface. */ HBITMAP LoadWin32Surface( CString fn ) { - SDL_Surface *s = RageSurface::LoadFile( fn ); + SDL_Surface *s = RageSurfaceUtils::LoadFile( fn ); if( s == NULL ) return NULL;