FillLiquidSwatch
function · terrain · primitive
- Address
0x68a830· 629 bytes, up to0x68aaa4- Signature
void __fastcall (uint32_t arg1, uint32_t arg2, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, float *out)- Meaning
- Fills a river or ocean swatch with a 64-row lerp of the light state's shallow and deep colour and alpha
- Confidence
- verified, proof one
- Finding
- terrain/liquidpass#liquid-swatch-textures
Finding: Liquid swatch textures in terrain: liquid passes
0x68c4c0 makes two 8×64 textures that 0x68a830 fills: the river swatch (0xc89d68) and the ocean
swatch (0xc81b90). The callback runs for level 1 only. Row k is the shallow colour plus
floor(k × (deep − shallow)/64) on each of the colour and alpha bytes; the colours are the light
state's words at +0xe8, +0xec (river, colour bands 16 and 17 of the light record) and +0xe0, +0xe4 (ocean, bands 14 and 15) and the alphas the
LightParams floats at +0x114, +0x118 (river) and +0x11c, +0x120 (ocean), each as the byte
of f32(v × 255 + 512) >> 14. On the last row the ocean swatch alone has its brightness
multiplied by 0.9 in HSV and its alpha forced to 255.
The derivation is in the doc.
Callers 0
None by a direct call or jump.
Callees 6
- _atexit crt
- GetLightState lighting
- RgbToHsv unassigned
- HsvToRgb unassigned
- PackColorBytes unassigned
- UnpackColorBytes unassigned
Calls and jumps by a bare address, from tables/calls.tsv.