#include <lghtmap.h>
Inheritance diagram for csLightMap:
Public Methods | |
csLightMap () | |
virtual | ~csLightMap () |
void | MakeDirtyDynamicLights () |
set the dirty flag for this lightmap. | |
bool | UpdateRealLightMap () |
csRGBMap& | GetStaticMap () |
csRGBMap& | GetRealMap () |
void | Alloc (int w, int h, int r, int g, int b) |
Allocate the lightmap. More... | |
void | CopyLightMap (csLightMap *source) |
Copy a lightmap. | |
csShadowMap* | NewShadowMap (csLight *light, int w, int h) |
Create a ShadowMap for this LightMap. | |
void | AllocStaticLM (int w, int h) |
Allocate the static csRGBMap. | |
csShadowMap* | FindShadowMap (csLight *light) |
Find a ShadowMap for a specific pseudo-dynamic light. | |
void | DelShadowMap (csShadowMap *plm) |
Delete a ShadowMap. More... | |
bool | ReadFromCache (int id, int w, int h, csObject *obj, bool isPolygon, csEngine *) |
Read from the cache. More... | |
void | Cache (int id, csPolygon3D *poly, csCurve *curve, csEngine *) |
Cache the lightmaps in the precalculation area. More... | |
void | ConvertToMixingMode () |
Convert the lightmaps to the correct mixing mode. More... | |
void | ConvertFor3dDriver (bool requirePO2, int maxAspect=32767) |
Convert the lightmaps to a 3D driver dependent size. | |
virtual csRGBpixel* | GetMapData () |
Get light map data. | |
virtual int | GetWidth () |
Get lightmap width (could be adjusted to power of two). | |
virtual int | GetHeight () |
Get lightmap height (could be adjusted to power of two). | |
virtual int | GetRealWidth () |
Get real lightmap width (could be less than returned by GetWidth()). | |
virtual int | GetRealHeight () |
Get real lightmap height (could be less than returned by GetHeight()). | |
virtual void* | GetCacheData () |
Get data used internally by texture cache. | |
virtual void | SetCacheData (void *d) |
Set data used internally by texture cache. | |
virtual void | GetMeanLighting (int &r, int &g, int &b) |
Get mean color for the lightmaps. | |
virtual long | GetSize () |
Get size of one lightmap. | |
Public Attributes | |
SCF_DECLARE_IBASE | |
Static Public Methods | |
int | CalcLightMapWidth (int w) |
Return the width of a lightmap given a texture size. | |
int | CalcLightMapHeight (int h) |
Return the height of a lightmap given a texture size. | |
void | SetLightCellSize (int size) |
Set the size of one lightmap cell (default = 16). More... | |
Static Public Attributes | |
int | lightcell_size |
Option variable: shadow cell size. | |
int | lightcell_shift |
Log base 2 of lightcell_size. | |
Friends | |
class | csPolyTexture |
|
Allocate the lightmap. 'w' and 'h' are the size of the bounding box in lightmap space. r,g,b is the ambient light color used to initialize the lightmap. |
|
Cache the lightmaps in the precalculation area. 'id' is a global id that is used to identify objects. |
|
Convert the lightmaps to the correct mixing mode. This function does nothing unless the mixing mode is nocolor.
This function also calculates the mean color of the lightmap. |
|
Delete a ShadowMap. NOTE!!! This function only works if the ShadowMap was the LAST CREATED for this LightMap!!! It is ment for dynamic lights that do not reach the polygon but this can only be seen after trying. |
|
Read from the cache. Return true if succesful. 'id' is a global id that is used to identify objects. |
|
Set the size of one lightmap cell (default = 16). Do not directly assign to the lightcell_size variable, as lightmap_shift also has to be updated. |