SetDeviceLightEnabled
function · gx · orchestration
- Address
0x589de0· 27 bytes, up to0x589dfa- Signature
void __fastcall (uint32_t index, uint32_t enabled)- Meaning
- Enables or disables one of the device's four fixed lights, rejecting an index of 4 or more
- Confidence
- verified, proof one
- Finding
- models/lights#fixed-function-lights
Finding: Fixed-function lights in models: lights
Without vertex shaders a record reaches the device as four lights. Slot 0 is the dominant light: a
directional light along +0x78 with ambient +0x54, diffuse +0x60 and third colour +0x6c.
Slots 1 to 3 take the nearest point lights from the end of the heap backward, so with four the
heap root, the farthest, is left out: diffuse from the light's +0x3c, no ambient or third
colour, attenuation +0x54 to +0x5c, at +0x18 (view space) or at +0xc minus the caller's
origin. Unused slots are disabled. A colour reaches the device as an ARGB word divided by its
largest component, alpha included, with that largest value as the light's scale.
The derivation is in the doc.
Callers 5
- 0x5bfa40 unassigned
- DrawInteriorGroupBatches terrain
- WorldTextDrawIcons playername
- M2DrawSetLighting models
- M2LightingSetDeviceLights models
Callees 2
Calls and jumps by a bare address, from tables/calls.tsv.