#include <C4FoWLightSection.h>
Public Member Functions | |
C4FoWLightSection (C4FoWLight *pLight, int r) | |
~C4FoWLightSection () | |
void | Invalidate (C4Rect r) |
void | Update (C4Rect r) |
std::list< C4FoWBeamTriangle > | CalculateTriangles (C4FoWRegion *region) const |
void | Prune (int32_t reach) |
void | Dirty (int32_t reach) |
void | CompileFunc (StdCompiler *pComp) |
The light section manages the beams for one light for one direction of 90°.
For understanding the internal calculations made in this class, note that this class assumes all of its beams to go into a positive y-direction (="down" in display coordinates). Only after the calculation, it transforms its result into the global coordinate system again by applying a transformation matrix.
Definition at line 36 of file C4FoWLightSection.h.
C4FoWLightSection::C4FoWLightSection | ( | C4FoWLight * | pLight, |
int | r | ||
) |
Definition at line 32 of file C4FoWLightSection.cpp.
C4FoWLightSection::~C4FoWLightSection | ( | ) |
Definition at line 61 of file C4FoWLightSection.cpp.
std::list< C4FoWBeamTriangle > C4FoWLightSection::CalculateTriangles | ( | C4FoWRegion * | region | ) | const |
Definition at line 442 of file C4FoWLightSection.cpp.
References b, C4FoWBeamTriangle::clipLeft, C4FoWBeamTriangle::clipRight, C4FoWBeamTriangle::fanLX, C4FoWBeamTriangle::fanLY, C4FoWBeamTriangle::fanRX, C4FoWBeamTriangle::fanRY, C4FoWBeam::getLeftEndXf(), C4FoWBeam::getLeftEndY(), C4FoWBeam::getNext(), C4FoWRegion::getRegion(), C4FoWBeam::getRightEndXf(), C4FoWBeam::getRightEndY(), and LogSilentF().
void C4FoWLightSection::CompileFunc | ( | StdCompiler * | pComp | ) |
Definition at line 820 of file C4FoWLightSection.cpp.
References b, C4FoWBeam::getNext(), StdCompiler::isSerializer(), mkNamingAdapt(), C4FoWBeam::setNext(), and StdCompiler::Value().
void C4FoWLightSection::Dirty | ( | int32_t | reach | ) |
Extend all light beams to the given reach. Called when the size of the light has increased to the given value
Definition at line 112 of file C4FoWLightSection.cpp.
References C4FoWBeam::getNext().
void C4FoWLightSection::Invalidate | ( | C4Rect | r | ) |
Recalculate of all light beams within the given rectangle because the landscape changed.
Definition at line 352 of file C4FoWLightSection.cpp.
References C4FoWBeam::Dirty(), C4FoWBeam::getLeftEndY(), C4FoWBeam::getNext(), C4FoWBeam::getRightEndY(), C4Rect::Hgt, C4FoWBeam::isDirty(), C4FoWBeam::isLeft(), C4FoWBeam::MergeDirty(), C4Rect::Wdt, and C4Rect::y.
void C4FoWLightSection::Prune | ( | int32_t | reach | ) |
Shorten all light beams to the given reach. Called when the size of the light has decreased to the given value
Definition at line 99 of file C4FoWLightSection.cpp.
References C4FoWBeam::getNext().
void C4FoWLightSection::Update | ( | C4Rect | r | ) |
Update all light beams within the given rectangle
Definition at line 134 of file C4FoWLightSection.cpp.
References C4Landscape::_FastSolidCheck(), C4FoWBeam::Clean(), C4FoWBeam::Dirty(), C4FoWBeam::EliminateRight(), C4Landscape::FastSolidCheckNextX(), Game, GBackSolid(), C4Rect::GetBottom(), StdStrBuf::getData(), C4FoWBeam::getDesc(), C4Landscape::GetHeight(), C4FoWBeam::getLeftEndY(), C4FoWBeam::getLeftX(), C4FoWBeam::getNext(), C4FoWLight::getReach(), C4FoWBeam::getRightEndX(), C4FoWBeam::getRightEndY(), C4FoWBeam::getRightX(), C4FoWLight::getSize(), C4FoWLight::getTotalReach(), C4Landscape::GetWidth(), C4Rect::Hgt, C4FoWBeam::isDirty(), C4FoWBeam::isLeft(), C4FoWBeam::isRight(), C4Game::iTick255, Landscape, LogSilent(), LogSilentF(), C4FoWBeam::MergeLeft(), C4FoWBeam::MergeRight(), C4FoWBeam::SetLeft(), C4FoWBeam::SetRight(), C4FoWBeam::Split(), C4Rect::Wdt, C4Rect::x, and C4Rect::y.