In file include/csengine/lghtmap.h:

## class csLightMap

> The static and all dynamic lightmaps for one or more mipmap-levels of a polygon

### Public Methods

  void | Alloc (int w, int h, int lms, int r, int g, int b) Allocate the lightmap
  void | AllocStaticLM (int w, int h, int lms) Allocate the static RGBLightMap
  void | Cache (csPolygonSet* owner, csPolygon3D* poly, int index, csWorld* world) Cache the lightmaps in the precalculation area
  void | ConvertFor3dDriver (bool requirePO2, int maxAspect = 32767) Convert the lightmaps to a 3D driver dependent size
  void | ConvertToMixingMode () Convert the lightmaps to the correct mixing mode
  void | CopyLightMap (csLightMap* source) Copy a lightmap.
  | csLightMap ()
  void | DelShadowMap (csShadowMap* plm) Delete a ShadowMap
  csShadowMap* | FindShadowMap (csLight* light) Find a ShadowMap for a specific pseudo-dynamic light
  int | GetHeight ()
  HighColorCache_Data* | GetHighColorCacheData ()
  void | GetMeanLighting (int& r, int& g, int& b)
  int | GetRealHeight ()
  csRGBLightMap& | GetRealMap ()
  int | GetRealWidth ()
  long | GetSize ()
  csRGBLightMap& | GetStaticMap ()
  int | GetWidth ()
  void | MipmapLightMap (int w, int h, int lms, csLightMap* source, int w2, int h2, int lms2) Allocate this lightmap by mipmapping the given source lightmap
  csShadowMap* | NewShadowMap (csLight* light, int w, int h, int lms) Create a ShadowMap for this LightMap
  bool | ReadFromCache (int w, int h, int lms, csPolygonSet* owner, csPolygon3D* poly, int index, csWorld* world) Read from the cache
  void | SetHighColorCacheData (HighColorCache_Data *d)
  virtual | ~csLightMap ()

### Private Fields

  friend class | csPolyTexture
  friend class | Dumper
  csShadowMap* | first_smap Linked list of shadow-maps (for the pseudo-dynamic lights)
  HighColorCache_Data* | hicolorcache The hicolor cache ptr.
  long | lm_size Size of the lightmap.
  int | lwidth LightMap dims (possibly po2 depending on used 3D driver).
  int | mean_r Mean lighting value of this lightmap
  csRGBLightMap | real_lm The final lightmap that is going to be used for rendering
  int | rwidth Original lightmap dims (non-po2 possibly).
  long | size Size of the lighted texture.
  csRGBLightMap | static_lm A color lightmap containing all static lighting information for the static lights (no pseudo-dynamic lights are here)

### Private Methods

  void | ConvertToMixingMode (unsigned char* mr, unsigned char* mg, unsigned char* mb, int sz) Convert three lightmap tables to the right mixing mode
  void | SetSize (int w, int h, int lms) Calculate the sizes of this lightmap

## Documentation

> The static and all dynamic lightmaps for one or more mipmap-levels of a polygon

`friend class csPolyTexture`

`friend class Dumper`

`csRGBLightMap static_lm`
  A color lightmap containing all static lighting information for the static lights (no pseudo-dynamic lights are here)

`csRGBLightMap real_lm`
  The final lightmap that is going to be used for rendering. In many cases this is just a copy of static_lm. But it may contain extra lighting information obtained from all the pseudo-dynamic shadowmaps and also the true dynamic lights.

`csShadowMap* first_smap`
  Linked list of shadow-maps (for the pseudo-dynamic lights). These shadowmaps are applied to static_lm to get real_lm.

`long size`
  Size of the lighted texture.

`long lm_size`
  Size of the lightmap.

`int lwidth`
  LightMap dims (possibly po2 depending on used 3D driver).

`int rwidth`
  Original lightmap dims (non-po2 possibly).

`HighColorCache_Data* hicolorcache`
  The hicolor cache ptr.

`int mean_r`
  Mean lighting value of this lightmap. (only for static lighting currently).

`void ConvertToMixingMode(unsigned char* mr, unsigned char* mg, unsigned char* mb, int sz)`
  Convert three lightmap tables to the right mixing mode. This function assumes that mixing mode is one of FAST_Wxx and will not function correctly if called with NOCOLOR, TRUE_RGB or FAST_RGB.
  This function correctly recognizes a dynamic lightmap which only contains shadow information and does not do the conversion in that case.

`void SetSize(int w, int h, int lms)`
  Calculate the sizes of this lightmap

`csLightMap()`

`virtual ~csLightMap()`

`csRGBLightMap& GetStaticMap()`

`csRGBLightMap& GetRealMap()`

`void GetMeanLighting(int& r, int& g, int& b)`

`int GetWidth()`

`int GetHeight()`

`int GetRealWidth()`

`int GetRealHeight()`

`long GetSize()`

`HighColorCache_Data* GetHighColorCacheData()`

`void SetHighColorCacheData(HighColorCache_Data *d)`

`void Alloc(int w, int h, int lms, int r, int g, int b)`
  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.

`void MipmapLightMap(int w, int h, int lms, csLightMap* source, int w2, int h2, int lms2)`
  Allocate this lightmap by mipmapping the given source lightmap

`void CopyLightMap(csLightMap* source)`
  Copy a lightmap.

`csShadowMap* NewShadowMap(csLight* light, int w, int h, int lms)`
  Create a ShadowMap for this LightMap

`void AllocStaticLM(int w, int h, int lms)`
  Allocate the static RGBLightMap

`csShadowMap* FindShadowMap(csLight* light)`
  Find a ShadowMap for a specific pseudo-dynamic light

`void DelShadowMap(csShadowMap* plm)`
  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.

`bool ReadFromCache(int w, int h, int lms, csPolygonSet* owner, csPolygon3D* poly, int index, csWorld* world)`
  Read from the cache. Return true if succesful. Index is the index of the polygon in the containing object. It is used for identifying the lightmap on disk.

`void Cache(csPolygonSet* owner, csPolygon3D* poly, int index, csWorld* world)`
  Cache the lightmaps in the precalculation area

`void ConvertToMixingMode()`
  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.

`void ConvertFor3dDriver(bool requirePO2, int maxAspect = 32767)`
  Convert the lightmaps to a 3D driver dependent size

This class has no child classes.

alphabetic index hierarchy of classes

this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de