create mySDL_MakeDummySurface

This commit is contained in:
Glenn Maynard
2004-02-20 05:10:39 +00:00
parent 2a542c6ebf
commit 3e8ff0b7ad
2 changed files with 15 additions and 0 deletions
+14
View File
@@ -1229,3 +1229,17 @@ SDL_RWops *OpenRWops( CString &sBuf )
rw->close = RWString_Close;
return rw;
}
SDL_Surface *mySDL_MakeDummySurface( int height, int width )
{
SDL_Surface *ret_image = SDL_CreateRGBSurfaceSane(
SDL_SWSURFACE, width, height, 8, 0,0,0,0);
ASSERT( ret_image != NULL );
SDL_Color pink = { 0xFF, 0x10, 0xFF, 0xFF };
SDL_SetPalette( ret_image, SDL_LOGPAL, &pink, 0, 1 );
memset( ret_image->pixels, 0, ret_image->h*ret_image->pitch );
return ret_image;
}
+1
View File
@@ -75,6 +75,7 @@ SDL_Surface *SDL_LoadImage( const CString &sPath );
SDL_RWops *OpenRWops( const CString &sPath, bool Write=false );
SDL_RWops *OpenRWops( CString &sBuf );
SDL_Surface *mySDL_MakeDummySurface( int height, int width );
#endif