UpdateMapEntityEnvironment
function · terrain · primitive
- Address
0x69e280· 574 bytes, up to0x69e4bd- Signature
void __thiscall (void *this)- Meaning
- Recomputes an entity's indoors, liquid and shadow state and its light targets
- Confidence
- verified, proof one
- Finding
- terrain/mapentities#entity-environment
- Test
terrain::env_update_color_difftest
Finding: Entity environment in terrain: map entities
0x69e280 recomputes what an entity stands in and where its light is going. It clears the
indoors, shadow, liquid and kind bits and the light bits 2 and 4, sets light bit 0, and re-places the
entity. Indoors it takes the group's interior light (0x69dc30); outdoors a liquid hit
(0x69b6d0) sets bit 0x20 (0x100 for fishable), the height +0x98, the type +0xf0 and bits
0x40 and 0x80 from the (area, type) record. An interior-lit entity's target intensity is 1.0.
Otherwise the target colour +0xf4 is the global map light's +0xac, the target intensity
+0xf8 2.5, or 0.5 in the chunk's shadow (bit 0x10); an attached entity takes 2.5 unsampled.
The derivation is in the doc.
Callers 2
- SyncLightNode terrain
- AnimateMapEntityLight terrain
Callees 7
- __ftol crt
- CWorld::GetEntityAreaId terrain
- IsInChunkShadow terrain
- GetLiquidStatus terrain
- GetEntityInteriorLight terrain
- ReattachEntity terrain
- 0x7ccf40 unassigned
Calls and jumps by a bare address, from tables/calls.tsv.