benilla-re systems structs docs

CGxDeviceD3d::FlushLights

function · gx · orchestration

Address
0x5a1b60 · 615 bytes, up to 0x5a1dc6
Signature
void __thiscall (CGxDeviceD3d *this)
Meaning
Sets LIGHTING and AMBIENT from the lighting state and sets and enables each dirty light
Confidence
verified, proof one
Finding
gx/draw#lighting-at-draw-time

Finding: Lighting at draw time in gx: drawing

Before each draw Direct3D runs 0x5a1b20: it flushes render state (0x594210), then 0x5a1b60, which decides lighting from id 14. Lighting on: LIGHTING is capability bit 0, AMBIENT id 6, and each dirty light is set and enabled. Lighting off with a vertex colour or id 1 equal to 0xffffffff: LIGHTING 0 and AMBIENT id 6. Lighting off with no vertex colour and id 1 not white: all four lights disabled, LIGHTING 1, AMBIENT 0xffffffff. Then 0x5a1dd0 sets FILLMODE to solid (3) or wireframe (2) from capability bit 9, 0x5a1e30 the diffuse and ambient material source to the vertex colour when the format has one and to the material otherwise, and 0x5a1ee0 the changed clip planes.

The derivation is in the doc.

Callers 1

Callees 1

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