Cafu Engine
cf::SceneGraph::LightMapManT Class Reference

This class manages lightmaps, e.g. by "allocating" rectangular areas in larger bitmaps. More...

#include "LightMapMan.hpp"

Public Member Functions

 LightMapManT ()
 The constructor. More...
 
 ~LightMapManT ()
 The destructor. More...
 
bool Allocate (unsigned int SizeS, unsigned int SizeT, unsigned long &BitmapNr, unsigned int &PosS, unsigned int &PosT)
 Finds a position for a rectangular lightmap within LightMaps[LightMaps.Size()-1].Data. More...
 
void InitTextures (const float Gamma, const int AmbientR, const int AmbientG, const int AmbientB)
 Initializes the MatSys textures in the Textures and Textures2 arrays. More...
 

Public Attributes

ArrayT< BitmapT * > Bitmaps
 
ArrayT< BitmapT * > Bitmaps2
 
ArrayT< MatSys::TextureMapI * > Textures
 
ArrayT< MatSys::TextureMapI * > Textures2
 

Static Public Attributes

static const unsigned int SIZE_S =256
 
static const unsigned int SIZE_T =256
 
static const unsigned int INIT_COLOR1 =0xFF000000
 
static const unsigned int INIT_COLOR2 =0xFF808080
 

Detailed Description

This class manages lightmaps, e.g. by "allocating" rectangular areas in larger bitmaps.

Constructor & Destructor Documentation

LightMapManT::LightMapManT ( )

The constructor.

LightMapManT::~LightMapManT ( )

The destructor.

Member Function Documentation

bool LightMapManT::Allocate ( unsigned int  SizeS,
unsigned int  SizeT,
unsigned long &  BitmapNr,
unsigned int &  PosS,
unsigned int &  PosT 
)

Finds a position for a rectangular lightmap within LightMaps[LightMaps.Size()-1].Data.

If no such position exists, a new, empty LightMapT is created and appended to the LightMaps. Returns true on success, false on failure (i.e. if SizeS>MAX_SIZE_S || SizeT>MAX_SIZE_T).

void LightMapManT::InitTextures ( const float  Gamma,
const int  AmbientR,
const int  AmbientG,
const int  AmbientB 
)

Initializes the MatSys textures in the Textures and Textures2 arrays.

Gamma correction by value Gamma is applied to the textures in Textures, but not in Textures2.


The documentation for this class was generated from the following files: