Every map in all 118 stored regions matches the save to the pixel, so the port is checked against ground truth rather than eyeballed. Getting there meant reproducing .NET quirks the output depends on: LCGRandom reseeding from its previous seed, Dictionary slot order in NaturalShape, and C#'s left-to-right evaluation of RNG draws. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
25 lines
868 B
Scheme
25 lines
868 B
Scheme
;;; The map types both sides of the comparison produce: what the save
|
|
;;; stored and what the generator makes for one map region.
|
|
|
|
(include stdlib.h)
|
|
|
|
(pub define MAX-STRATA 32)
|
|
|
|
;;; IntDataMap2D: a square map whose border pixels only feed lerps
|
|
;;; and blurs. The region's own pixels are the inner
|
|
;;; (size - pad-tl - pad-br) square.
|
|
(pub record int-map ((data (* i32)) (size i32) (pad-tl i32) (pad-br i32)))
|
|
|
|
(pub record region-maps
|
|
((landform int-map) (climate int-map) (geoprov int-map) (upheaval int-map)
|
|
(ocean int-map) (strata [int-map MAX_STRATA]) (strata-count int)))
|
|
|
|
(pub fn region-maps/free ((m (* region-maps))) void
|
|
(free (. m landform data))
|
|
(free (. m climate data))
|
|
(free (. m geoprov data))
|
|
(free (. m upheaval data))
|
|
(free (. m ocean data))
|
|
(for (var i int 0) (< i (. m strata-count)) (++ i)
|
|
(free (. [(. m strata) i] data))))
|