#include <sdlfilesurfaces.h>
Inheritance diagram for SdlFileSurfaces:
Public Member Functions | |
DECLSPEC | SdlFileSurfaces (const char *fn, const char *name=0, Uint32 flags=SDL_HWSURFACE) |
DECLSPEC | SdlFileSurfaces (const char *fn, SDL_Rect rBegin, Uint32 num, Uint32 NumPerLine, bool byrow=true, const char *name=0, Uint32 colorkey=CLR_INVALID, char *type=0, Uint32 flags=SDL_HWSURFACE) |
Protected Member Functions | |
virtual DECLSPEC void | onRefresh () |
This class is used to handle surfaces that contain data, loaded from one file. The surfaces' sizes and the contents' position in the image file have to be defined in another, text based file; or if all surfaces have an equal size and the rects in the image-file are arranged one after the other, loading can be done without an initialisation file.
SdlFileSurfaces::SdlFileSurfaces | ( | const char * | fn, | |
const char * | name = 0 , |
|||
Uint32 | flags = SDL_HWSURFACE | |||
) |
Constructor. Registers itself in SdlManager with the given name and initializes the containing surfaces by using a text based file.
fn | the filename of the text based file | |
name | the container's name; if NULL, fn will be used as name | |
flags | the flags of the surfaces, for details, have a look at the SDL documentation; usually SDL_HWSURFACE is the best value. |
SdlFileSurfaces::SdlFileSurfaces | ( | const char * | fn, | |
SDL_Rect | rBegin, | |||
Uint32 | num, | |||
Uint32 | NumPerLine, | |||
bool | byrow = true , |
|||
const char * | name = 0 , |
|||
Uint32 | colorkey = CLR_INVALID , |
|||
char * | type = 0 , |
|||
Uint32 | flags = SDL_HWSURFACE | |||
) |
Constructor. Registers itself in SdlManager with the given name and initializes the containing surfaces by using the given params.
fn | the filename of the image file, containing the data for the surfaces | |
rBegin | the top-left most rect in the image file, which is the source for the first surface | |
num | the number of surfaces/rects to create/use | |
NumPerLine | the number of rects to take from every line | |
byrow | if true, the rects are taken line by line, if false column by column (1st row: top to bottom; 2nd row top to bottom; 3rd row...) | |
name | the container's name; if NULL, fn will be used as name | |
colorkey | the color, that is fully transparent when blitting | |
type | the type of the image file as string with 3 letters (BMP, JPG, PNG, TIF, PCX, TGA, PNM, XPM, XCF or LBM); if NULL, the ending of the filename is used to detect the type | |
flags | the flags of the surfaces, for details, have a look at the SDL documentation; usually SDL_HWSURFACE is the best value. |
void SdlFileSurfaces::onRefresh | ( | ) | [protected, virtual] |
Refreshes all surfaces, by loading the buffer from the computer's RAM to the graphical RAM, if SDL_HWSURFACE used. This is neccessary, when restoring an application in MS Windows
Reimplemented from SdlSurfaceContainer.