#include <tile_light_influence.h>
Nevrax France
Definition at line 45 of file tile_light_influence.h.
Public Types | |
| enum | { NumLightPerCorner = 2 } |
| We support only 2 light per corner. Should never be changed. More... | |
Public Member Functions | |
| CTileLightInfluence () | |
| Constructor. | |
| uint8 | getDiffuseLightFactor (uint i) const |
| see setDiffuseLightFactor(). return uint8 E [0, 255] | |
| void | serial (NLMISC::IStream &f) |
| void | setDiffuseLightFactor (uint i, uint8 factor) |
| i: 0 or 1. factor E [0..255] is the factor of influence (gouraud) of the ith light. NB: stored on 4 bits. | |
Data Fields | |
| uint8 | Light [NumLightPerCorner] |
Private Attributes | |
| uint8 | PackedLightFactor |
| Packed. | |
|
|
We support only 2 light per corner. Should never be changed.
Definition at line 50 of file tile_light_influence.h.
00050 {NumLightPerCorner= 2};
|
|
|
Constructor.
Definition at line 54 of file tile_light_influence.h.
00054 {}
|
|
|
see setDiffuseLightFactor(). return uint8 E [0, 255]
Definition at line 53 of file tile_light_influence.cpp. References nlassert, PackedLightFactor, uint, and uint8.
00054 {
00055 nlassert(CTileLightInfluence::NumLightPerCorner == 2);
00056 nlassert(i == 0 || i == 1);
00057
00058 // Choose what factor
00059 uint8 ret= PackedLightFactor >> (4*i);
00060 ret&= 0x0F;
00061
00062 // expand to 0..255
00063 return ret + (ret<<4);
00064 }
|
|
|
Definition at line 67 of file tile_light_influence.cpp. References nlassert, PackedLightFactor, and NLMISC::IStream::serial().
|
|
||||||||||||
|
i: 0 or 1. factor E [0..255] is the factor of influence (gouraud) of the ith light. NB: stored on 4 bits.
Definition at line 36 of file tile_light_influence.cpp. References nlassert, PackedLightFactor, uint, and uint8. Referenced by NL3D::CZoneLighter::processZonePointLightRT().
00037 {
00038 nlassert(CTileLightInfluence::NumLightPerCorner == 2);
00039 nlassert(i == 0 || i == 1);
00040
00041 // Divide by 16.
00042 factor>>=4;
00043
00044 // set to the ith light.
00045 uint8 mask= 0x0F << (4*i);
00046 // clear.
00047 PackedLightFactor&= ~mask;
00048 // set.
00049 PackedLightFactor|= factor << (4*i);
00050 }
|
|
|
List of lights. Id==0xFF => no light. if Light[i]==0xFF, then Light[j] with j>i is supposed disalbed too. Definition at line 60 of file tile_light_influence.h. Referenced by NL3D::CPatch::appendTileLightInfluences(), NL3D::CZone::build(), and NL3D::CZoneLighter::processZonePointLightRT(). |
|
|
Packed.
Definition at line 74 of file tile_light_influence.h. Referenced by getDiffuseLightFactor(), serial(), and setDiffuseLightFactor(). |
1.3.6