CMapChunk::AddLayer
function · terrain · orchestration
- Address
0x6aff80· 170 bytes, up to0x6b0029- Signature
void __thiscall (CMapChunk *this, void *area, const void *entry, const void *alphaBase)- Meaning
- Makes a texture layer from an MCLY entry and, on the fixed-function path, its alpha texture
- Confidence
- verified, proof one
- Finding
- terrain/chunk#texture-layers
Finding: Texture layers in terrain: chunk
CMapChunk::AddLayer (0x6aff80) makes one CChunkLayer (28 bytes) per 16-byte MCLY entry, up to
four at +0x128 with the count at +0x138. A layer holds the area's texture for the entry's index
(+0x0c), the entry's flags word (+0x08) and effect id word (+0x0a), and the address of its alpha
map, the entry's offset added to the MCAL data (+0x10). On the fixed-function path, when flags
bit 8 is set, the layer gets an alpha texture of 32 texels square when shadowLevel is exactly 1
and 64 otherwise. The decoders choose 32×32 for any nonzero value, and the option's check accepts
any integer up to 1, so a negative shadowLevel gives a 64×64 texture filled with 32×32 data.
The derivation is in the doc.
Callers 1
- CMapChunk::Load terrain
Callees 3
- GxTexUpdateRect gx
- AllocChunkLayer terrain
- AcquireLayerTexture terrain
Calls and jumps by a bare address, from tables/calls.tsv.