| 1 |
#ifndef _CIMGLOADER_ |
| 2 |
#define _CIMGLOADER_ |
| 3 |
|
| 4 |
#include <string> |
| 5 |
#include <list> |
| 6 |
#include "SDL_image.h" |
| 7 |
#include "SDL.h" |
| 8 |
|
| 9 |
using namespace std; |
| 10 |
|
| 11 |
//! Class with static methods that load images into SDL surfaces |
| 12 |
class CImgLoader |
| 13 |
{ |
| 14 |
public: |
| 15 |
static CSurface* loadImage(const string& fileName, bool alpha = false, bool nopath = false); |
| 16 |
//! load in either a BIGASS bitmap |
| 17 |
/*! Loads a list of surfaces with frames from a bigass bitmap with the specified properties |
| 18 |
\param fileName Name of the file to load frames from |
| 19 |
\param width Width of each frame in the file |
| 20 |
\param height Height of each frame in the file |
| 21 |
\param padding Number of pixels surrounding each frame |
| 22 |
|
| 23 |
\exception ex_sdlImageLoadFailed { Call to IMG_Load failed to return a pointer to a surface } |
| 24 |
\exception ex_illegalArguments { width, height, or padding incorrect for given file } |
| 25 |
*/ |
| 26 |
static list<CSurface*> loadBigassBitmap(const string& fileName, int width, int height, int padding = 0, bool alpha = false, bool nopath = false); |
| 27 |
|
| 28 |
enum GraphicFileType |
| 29 |
{ |
| 30 |
STATIC, // single file |
| 31 |
BIGASS, // multiple images in single file |
| 32 |
NUMBERED // multiple files in a numbered sequence |
| 33 |
}; |
| 34 |
|
| 35 |
static string getPath(); |
| 36 |
|
| 37 |
private: |
| 38 |
}; |
| 39 |
|
| 40 |
#endif |