SdlFileSurfaces Class Reference
[SDL based classes]

Manages some graphical resources, loaded from one file. More...

#include <sdlfilesurfaces.h>

Inheritance diagram for SdlFileSurfaces:

Inheritance graph
[legend]
Collaboration diagram for SdlFileSurfaces:

Collaboration graph
[legend]
List of all members.

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 ()

Detailed Description

Manages some graphical resources, loaded from one file.

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.

See also:
SdlFileSurfacesInfo


Constructor & Destructor Documentation

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.

Parameters:
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.
See also:
SdlManager::getSurfacesByName()

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.

Parameters:
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.
See also:
SdlManager::getSurfacesByName()


Member Function Documentation

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

Todo:
test this (I think it does not function yet) and make it working.

Reimplemented from SdlSurfaceContainer.


The documentation for this class was generated from the following files:
Generated on Wed May 9 17:36:33 2007 for netrinjo by  doxygen 1.5.1