| 1 |
#ifndef HEADER_RESIMAGEPACK_H |
| 2 |
#define HEADER_RESIMAGEPACK_H |
| 3 |
|
| 4 |
class Path; |
| 5 |
|
| 6 |
#include "ResourcePack.h" |
| 7 |
#include "ResCache.h" |
| 8 |
|
| 9 |
#include "SDL.h" |
| 10 |
|
| 11 |
/** |
| 12 |
* Image resources and image loading. |
| 13 |
*/ |
| 14 |
class ResImagePack : public ResourcePack<SDL_Surface*> { |
| 15 |
private: |
| 16 |
static ResCache<SDL_Surface*> *CACHE; |
| 17 |
bool m_caching_enabled; |
| 18 |
public: |
| 19 |
explicit ResImagePack(bool caching_enabled=true); |
| 20 |
virtual const char *getName() const { return "image_pack"; } |
| 21 |
|
| 22 |
static SDL_Surface *loadImage(const Path &file); |
| 23 |
void addImage(const std::string &name, const Path &file); |
| 24 |
virtual void unloadRes(SDL_Surface *res); |
| 25 |
}; |
| 26 |
|
| 27 |
#endif |
| 28 |
|