benilla-re systems structs docs

ApplyEntityLighting

function · terrain · primitive

Address
0x672a20 · 264 bytes, up to 0x672b27
Signature
void __fastcall (uint32_t unused, void *model, void *context)
Meaning
Sets a model's ambient and directional light from its context or the day light
Confidence
verified, proof one
Finding
terrain/world#model-lighting-callback
Test
terrain::apply_cb_null_color_difftest, terrain::apply_cb_fog_gate_difftest

Finding: Model lighting callback in terrain: world

A model on the map takes its light from 0x672a20, which 0x6716f0 installs as the model's lighting callback when the model is set (and removes from the old model). With a node it calls the node's virtual slots 1 (fog) and 3 (water plane), and slot 2 (the map lights) only when the node's +0x78 − +0x68 is below the fog end; if the node's +0x8 has bit 0x20 it sets +0x1b0 of the model's lighting record to 1. Without a node it adds the day-night ambient +0x178 and the directional +0x174 with direction +0x168 of the light state.

The derivation is in the doc.

Callers 0

None by a direct call or jump.

Callees 3

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