benilla-re systems structs docs

WalkPortals

function · terrain · primitive

Address
0x6b41c0 · 1212 bytes, up to 0x6b467b
Signature
void __thiscall (void *this, void *def, void *group, const float *rect, uint32_t depth, void *planes)
Meaning
Visits a group and recurses through its portals the window reaches, narrowing the window
Confidence
verified, proof one
Finding
terrain/portals#portal-walk
Test
terrain::portal_plane_dot_difftest, terrain::portal_rect_extent_difftest, terrain::portal_ndc_to_screen_difftest

Finding: Portal walk in terrain: map object visibility

0x6b41c0(group, from, rectangle, depth, interior group) visits a group and recurses through its portals. It stops at depth above the cap 0xcb004c (10), for an unloaded group and for flag 0x10000. A flag 0x1000 group, when none was seen, stores the depth parity. It sets the weather byte for flags 0x148 and the sky box for 0x40000 with a set byte at +0x12c, calls the callback, and for each portal reference not leading back to from projects the portal once a pass; a portal the eye is behind or whose screen rectangle misses the rectangle or is narrower than 0.001 is skipped, the rest recurse with the rectangle clipped to the window.

The derivation is in the doc.

Callers 2

Callees 7

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