benilla-re systems structs docs

WorldToScreenScale

function · minimap · primitive

Address
0x6da380 · 445 bytes, up to 0x6da53c
Signature
uint32_t __fastcall (uint32_t map, const float *pos, float *offset, float *scale, void *records)
Meaning
Prepares the outdoor tile block and outputs the offset and scale that place it
Confidence
verified, proof one
Finding
minimap/coordinates#screen-scale
Test
minimap::world_to_screen_scale_difftest

Finding: Screen scale in minimap: coordinates

WorldToScreenScale(map, player, offset, scale, records) prepares the outdoor tile block and the scale that places it. It stores the player position and the map, runs the blip pass, and finds the tiles of the player moved half a tile each way; an axis where both land in one tile takes the next tile (the previous at the grid edge), so the block is 2 by 2. It reloads the tiles when mask 0x1 of the dirty word is set or a cached block index differs, and returns 1. offset[0] is the first tile's world y less the player's, over 1066.667; offset[1] the world x less the player's, over 1066.667; scale is half the outdoor chunk count times 33.3333, over 1066.667.

The derivation is in the doc.

Callers 1

Callees 4

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