Definition at line 13 of file ResImagePack.h.
Public Member Functions | |
virtual const char * | getName () const |
void | addImage (const std::string &name, const Path &file) |
Store image from file. | |
Static Public Member Functions | |
static SDL_Surface * | loadImage (const Path &file) |
Load unshared image from file and convert image to diplayformat. | |
Protected Member Functions | |
virtual void | unloadRes (SDL_Surface *res) |
|
Store image from file.
Definition at line 52 of file ResImagePack.cpp.
|
|
Implements INamed. Definition at line 17 of file ResImagePack.h. 00017 { return "image_pack"; }
|
|
Load unshared image from file and convert image to diplayformat.
Definition at line 27 of file ResImagePack.cpp. 00028 { 00029 SDL_Surface *raw_image = IMG_Load(file.getNative().c_str()); 00030 if (NULL == raw_image) { 00031 throw ImgException(ExInfo("Load") 00032 .addInfo("file", file.getNative())); 00033 } 00034 00035 SDL_Surface *surface = SDL_DisplayFormatAlpha(raw_image); 00036 if (NULL == surface) { 00037 throw SDLException(ExInfo("DisplayFormat") 00038 .addInfo("file", file.getNative())); 00039 } 00040 SDL_FreeSurface(raw_image); 00041 00042 return surface; 00043 }
|
|
Implements ResourcePack< SDL_Surface * >. Definition at line 59 of file ResImagePack.cpp. 00060 { 00061 SDL_FreeSurface(res); 00062 }
|