s/RageSurface/RageSurfaceUtils/
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user