#include <C4FoWLight.h>
Public Member Functions | |
C4FoWLight (C4Object *pObj) | |
~C4FoWLight () | |
int32_t | getX () const |
int32_t | getY () const |
int32_t | getReach () const |
int32_t | getFadeout () const |
int32_t | getTotalReach () const |
int32_t | getSize () const |
int32_t | getNormalSize () const |
float | getBrightness () const |
float | getR () const |
float | getG () const |
float | getB () const |
float | getValue () const |
float | getLightness () const |
C4FoWLight * | getNext () const |
C4Object * | getObj () const |
void | SetReach (int32_t iReach, int32_t iFadeout) |
void | SetColor (uint32_t iValue) |
void | Invalidate (C4Rect r) |
void | Update (C4Rect r) |
void | Render (class C4FoWRegion *pRegion, const C4TargetFacet *pOnScreen, C4ShaderCall &call) |
bool | IsVisibleForPlayer (C4Player *player) const |
Friends | |
class | C4FoW |
This class represents one light source. A light source has an associated object with which the light source moves and one light section that handles the light beams for each direction (up, down, left, right).
Furthermore, each light source has a size. This is usually the object's lightRange. See SetReach.
Definition at line 34 of file C4FoWLight.h.
C4FoWLight::C4FoWLight | ( | C4Object * | pObj | ) |
Definition at line 29 of file C4FoWLight.cpp.
C4FoWLight::~C4FoWLight | ( | ) |
Definition at line 46 of file C4FoWLight.cpp.
|
inline |
Definition at line 68 of file C4FoWLight.h.
|
inline |
Definition at line 65 of file C4FoWLight.h.
|
inline |
Definition at line 61 of file C4FoWLight.h.
|
inline |
Definition at line 67 of file C4FoWLight.h.
|
inline |
Definition at line 70 of file C4FoWLight.h.
|
inline |
Definition at line 71 of file C4FoWLight.h.
Referenced by C4FoW::Add(), C4FoW::ClearDeletedLights(), C4FoW::Invalidate(), C4FoW::Remove(), C4FoW::Render(), and C4FoW::Update().
|
inline |
|
inline |
Definition at line 72 of file C4FoWLight.h.
Referenced by C4FoW::Add().
|
inline |
Definition at line 66 of file C4FoWLight.h.
|
inline |
Definition at line 60 of file C4FoWLight.h.
Referenced by C4FoWLightSection::Update().
|
inline |
Definition at line 63 of file C4FoWLight.h.
References iSize.
Referenced by C4FoWLightSection::Update().
|
inline |
Definition at line 62 of file C4FoWLight.h.
Referenced by C4FoWLightSection::Update().
|
inline |
Definition at line 69 of file C4FoWLight.h.
|
inline |
Definition at line 58 of file C4FoWLight.h.
|
inline |
Definition at line 59 of file C4FoWLight.h.
void C4FoWLight::Invalidate | ( | C4Rect | r | ) |
Triggers the recalculation of all light beams within the given rectangle for this light because the landscape changed.
Definition at line 52 of file C4FoWLight.cpp.
bool C4FoWLight::IsVisibleForPlayer | ( | C4Player * | player | ) | const |
Definition at line 364 of file C4FoWLight.cpp.
References Hostile(), C4Object::Owner, and C4ScriptGuiWindowPropertyName::player.
void C4FoWLight::Render | ( | class C4FoWRegion * | pRegion, |
const C4TargetFacet * | pOnScreen, | ||
C4ShaderCall & | call | ||
) |
void C4FoWLight::SetColor | ( | uint32_t | iValue | ) |
Sets the light's color in rgba format.
Definition at line 81 of file C4FoWLight.cpp.
References GetBlueValue, GetGreenValue, and GetRedValue.
Referenced by C4FoW::Add().
void C4FoWLight::SetReach | ( | int32_t | iReach, |
int32_t | iFadeout | ||
) |
Sets the light's size in pixels. The reach is the total radius of the light while the fadeout is the number of pixels after which the light should dim down
Definition at line 58 of file C4FoWLight.cpp.
Referenced by C4FoW::Add().
void C4FoWLight::Update | ( | C4Rect | r | ) |
Update all light beams within the given rectangle for this light
Definition at line 97 of file C4FoWLight.cpp.
References C4Object::fix_x, C4Object::fix_y, fixtoi(), C4Value::getInt(), C4ValueArray::GetItem(), C4PropList::GetPropertyArray(), and P_LightOffset.
|
friend |
Definition at line 36 of file C4FoWLight.h.