benilla-re systems structs docs

CGxDevice::SetLightEnabled

function · gx · orchestration

Address
0x593570 · 41 bytes, up to 0x593598
Signature
void __thiscall (CGxDevice *this, uint32_t index, uint32_t enabled)
Meaning
Sets a light record's enable word and its enable dirty bit when it differs
Confidence
verified, proof one
Finding
gx/draw#fixed-lights

Finding: Fixed lights in gx: drawing

The device holds four light records (+0x24fc, 0x54 bytes each). 0x593330(index, light, offset) copies a light into a record through 0x593040, which sets one dirty bit per changed group (bit 1 enable, 2 position or direction, 4 ambient, 8 diffuse, 0x10 specular, 0x20, 0x40, 0x80 the three attenuation terms) and stores each colour as three floats byte * (scale / 255), the product of the light's scalar and 1/255 formed at 53 bits before it multiplies the byte. When the light is positional (flags & 2) the offset is subtracted from the position. 0x593570 sets the enable word. 0x589d80 does both and fails for an index of 4 or more.

The derivation is in the doc.

Callers 2

Callees 0

None by a direct call or jump.

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