benilla-re systems structs docs

CMapChunk::AddLights

function · terrain · orchestration

Address
0x6af9f0 · 101 bytes, up to 0x6afa54
Signature
void __thiscall (CMapChunk *this, void *lights)
Meaning
Clears the chunk's bit 0, adds the global exterior light and the chunk's map lights to the light query
Confidence
verified, proof one
Finding
terrain/render#chunk-light-slots

Finding: Chunk light slots in terrain: render

0x6c0cc0 runs two slots of the chunk's class. Slot 1 (0x6c31e0) always sets the fog. Slot 2 (0x6af9f0) adds lights, only when the chunk's view depth less twice its radius is under the fog end 0xc62964 (0x6c0cce, 0x6c0cd4). It clears bit 0 of the chunk's word +0xc, adds the global exterior light block 0xc89ef0 + 0x7c, then each map light on the chunk's list (+0x100 stride, +0x108 head) whose object +0xdc is not zero, adding the light embedded at +0x7c. So placed map lights and model lights compete for the four nearest.

The derivation is in the doc.

Callers 0

None by a direct call or jump.

Callees 1

Calls and jumps by a bare address, from tables/calls.tsv.