polserver/.github
Fernando Rozenblit cc64a44d36
Improve uoconvert correctness and speed (#897)
* fix old Tokuno map issue

* quick fixes

* restructure mapwriter to store files in memory until a write is needed

* add dirty flag to only flush files which changed

* change uoconvert use of mapwriter to a stack variable

* added detailed timers to uoconvert map

* precalculate lowest adjacent z so we dont need to calculate again for each tile

* syntax formatting

* read landtiles directly instead of using safe_getmapinfo

* encapsulate the solid block processing result for a single block

* make processing parallel - 5 sec to 2,7 sec for britannia

* add changelog entry

* reduce redundant per-tile work in the solid-block loop

* bucket each static block once instead of rescanning it per tile

readstatics_block() presorts a block's statics by cell in a single pass
(storage order preserved); each tile's bucket then serves directly as the
per-tile scratch, dropping the 64x whole-block rescan and the per-tile copy.
Outputs byte-identical (SHA256 gate, map+maptile, both realms).

* extract merge_shapes and flatten the water-type lookup

- the shape-consolidation loop moves verbatim into merge_shapes(), with
  its invariants and comments; ComputeSolidBlock now reads as
  collect -> filter -> sort -> merge -> emit
- DiscardedWaterTypes is snapshotted into a flat per-graphic table after
  config load; the hot per-static probe drops the tree lookup
Outputs byte-identical (SHA256 gate, map+maptile, both realms).

* name the conversion's magic numbers

MAX_LANDTILE_ID joins LANDTILE_COUNT in plib; wall height, water-discard
window and sand-over-water gap become named constexprs. Landtile classifiers become constexpr in
terrainplane.h with their id lists sourced. Outputs byte-identical.

* unify the block-index math into one helper per layout

realm_block_index (8x8 row-major: base.dat/solidx1/statics.dat),
maptile_index (64x64, rounded-up stride), and staticblock_from_coords
(client mul column-major, reused in RawMap::rawinfo) replace eight
hand-rolled copies of the stride dance. SOLIDX_* macros become constexpr;
dead mapblob.h (wrong 16x16 sizes, never included) is deleted.
Outputs byte-identical; unittest_pol+escript suites pass.

* refactor file writing

* add file RAII

* fix macos

* document uofiles and MORE_SOLIDS flag

* modernize: span for extract_planes, set contains, const/constexpr fixes

* update changelog

* probe landtile classes through a compile-time table and change push_back to emplace_back

* fix corechanges.xml mismatch

* add erorr handling to ReadEntireFile
2026-07-20 07:59:08 +02:00
..
problem-matchers Fix warnings introduced in binding PR (#766) 2025-02-20 06:50:30 +01:00
workflows Improve uoconvert correctness and speed (#897) 2026-07-20 07:59:08 +02:00