From b7dd69f99effa12cfa5fa04e8f9578aafedbbe11 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sat, 15 Dec 2018 14:16:57 +0100 Subject: [PATCH] fix to geometry specifics saving --- mapeditor.cpp | 4 ++-- yendor.cpp | 13 ++++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/mapeditor.cpp b/mapeditor.cpp index a71e95a6..a57ed587 100644 --- a/mapeditor.cpp +++ b/mapeditor.cpp @@ -120,7 +120,7 @@ namespace mapstream { if(geometry == gCrystal) { f.write(ginf[gCrystal].sides); if(ginf[gCrystal].sides == 8) - f.write(ginf[gCrystal].vertices); + f.write(ginf[gCrystal].vertex); } if(geometry == gArchimedean) f.write(arcm::current.symbol); addToQueue((bounded || euclid) ? currentmap->gamestart() : cwt.at->master->c7); @@ -219,7 +219,7 @@ namespace mapstream { if(geometry == gCrystal && vernum >= 10504) { int sides; f.read(sides); - set_crystal(sides); + crystal::set_crystal(sides); if(sides == 8) { int vertices; eVariation v = variation; diff --git a/yendor.cpp b/yendor.cpp index b159786b..2904d6bb 100644 --- a/yendor.cpp +++ b/yendor.cpp @@ -960,10 +960,12 @@ int modecode() { mct += (1 << 20); } + typedef long long ll; + // 32 bits [29..61) for geometry specifics - if(torus) { - mct += ll(torusconfig::torusmode) << 29; - auto& mode = torusconfig::tmodes[torusconfig::torusmode]; + if(euwrap) { + mct += ll(torusconfig::torus_mode) << 29; + auto& mode = torusconfig::tmodes[torusconfig::torus_mode]; bool single = (mode.flags & torusconfig::TF_SINGLE); if(single) { mct += ll(torusconfig::qty) << 37; @@ -975,14 +977,15 @@ int modecode() { } } - if(geometry == gQuotient) { + if(geometry == gFieldQuotient) { + using namespace fieldpattern; mct += ll(current_extra) << 29; mct += ll(fgeomextras[current_extra].current_prime_id) << 37; } if(geometry == gCrystal) { mct += ll(ginf[geometry].sides) << 29; - mct += ll(ginf[geometry].vertices) << 37; + mct += ll(ginf[geometry].vertex) << 37; } if(geometry == gArchimedean) {