18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-12-03 08:55:22 +01:00
Files
maszyna/rendering
maj00r 602b0bdcf7 refactor(scene): the region keeps its sections in a map by row and column, not in a grid of 500 x 500
Step 3a of docs/world-format-eu07.md (#516, section 13): the dense std::array of 250 000 section pointers
gives way to a std::map keyed by section_key (row and column, counted as before with the middle of the region
at 250, 250), holding only the sections that hold something. The map runs row by row, the order of the index
of the classic square, so the .sbt and .btf files keep their indices and come out byte for byte the same.

basic_region gains find_section(key or row and column) and all_sections(); get_section(index) stays for the
classic index. The renderer's walk, its prefetch and memory count, the local lights, the map, the terrain
files, the editor and its self-test use them instead of indexing the grid; the loops over all 250 000 slots
(the map every frame, the editor's terrain drop) go over the sections there are.

Nothing changes in what the game does: the region still ends at +-250 km, a point beyond it still goes to the
section at the edge, and the centre of a new section is computed from the row and column before that clamp,
as it was. Lifting the limit is a later step, behind a switch.

Checked in the game (td.scn, Glinojeck.scn, --test 120 s, seed 1): the physics logs are the same bit for bit
as before the change, with the .sbt written and with it read back, and the .sbt files written are byte for
byte the same as those of the build before.
2026-12-02 23:20:42 +01:00
..