Main Page | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

CSBitmapDirectLoader Class Reference

#include <CSBitmap.h>

Inheritance diagram for CSBitmapDirectLoader:

CSBitmapLoader Loadable< CSBitmap >

Static Public Attributes

CSBitmapDirectLoader INSTANCE

Protected Member Functions

virtual CSBitmapcreate (const std::string &filename)

Member Function Documentation

CSBitmap * CSBitmapDirectLoader::create const std::string &  filename  )  [protected, virtual]
 

Reimplemented from CSBitmapLoader.

Definition at line 86 of file CSBitmap.cpp.

References CSBitmap::b, CSBitmap::g, LOG_EXIT, CSBitmap::picture, CSBitmap::r, and SDLMain::shutdown().

00087 {
00088     SDL_Surface *image = 0;
00089 
00090     /* Load the BMP file into a surface */
00091     image = SDL_LoadBMP(filename.c_str());
00092 
00093     if (image == 0) 
00094     {
00095         LOG_EXIT
00096         SDLMain::shutdown((std::string)"Couldn't load \"" + filename + "\": " + SDL_GetError(), 1);
00097     }
00098 
00099     // free loaded parse entities!
00100     CSBitmap *bitmap = new CSBitmap();
00101     bitmap->r = 255;
00102     bitmap->g = 0;
00103     bitmap->b = 255;
00104     bitmap->picture = image;
00105     return bitmap;
00106 }

Here is the call graph for this function:


Field Documentation

CSBitmapDirectLoader CSBitmapDirectLoader::INSTANCE [static]
 

Reimplemented from CSBitmapLoader.

Definition at line 11 of file CSBitmap.cpp.


Generated on Wed Jul 14 00:43:48 2004 for CSLib by doxygen 1.3.6