1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-20 15:40:26 +00:00

fix to geometry specifics saving

This commit is contained in:
Zeno Rogue 2018-12-15 14:16:57 +01:00
parent 4b89d1dfd7
commit b7dd69f99e
2 changed files with 10 additions and 7 deletions

View File

@ -120,7 +120,7 @@ namespace mapstream {
if(geometry == gCrystal) { if(geometry == gCrystal) {
f.write(ginf[gCrystal].sides); f.write(ginf[gCrystal].sides);
if(ginf[gCrystal].sides == 8) if(ginf[gCrystal].sides == 8)
f.write(ginf[gCrystal].vertices); f.write(ginf[gCrystal].vertex);
} }
if(geometry == gArchimedean) f.write(arcm::current.symbol); if(geometry == gArchimedean) f.write(arcm::current.symbol);
addToQueue((bounded || euclid) ? currentmap->gamestart() : cwt.at->master->c7); addToQueue((bounded || euclid) ? currentmap->gamestart() : cwt.at->master->c7);
@ -219,7 +219,7 @@ namespace mapstream {
if(geometry == gCrystal && vernum >= 10504) { if(geometry == gCrystal && vernum >= 10504) {
int sides; int sides;
f.read(sides); f.read(sides);
set_crystal(sides); crystal::set_crystal(sides);
if(sides == 8) { if(sides == 8) {
int vertices; int vertices;
eVariation v = variation; eVariation v = variation;

View File

@ -960,10 +960,12 @@ int modecode() {
mct += (1 << 20); mct += (1 << 20);
} }
typedef long long ll;
// 32 bits [29..61) for geometry specifics // 32 bits [29..61) for geometry specifics
if(torus) { if(euwrap) {
mct += ll(torusconfig::torusmode) << 29; mct += ll(torusconfig::torus_mode) << 29;
auto& mode = torusconfig::tmodes[torusconfig::torusmode]; auto& mode = torusconfig::tmodes[torusconfig::torus_mode];
bool single = (mode.flags & torusconfig::TF_SINGLE); bool single = (mode.flags & torusconfig::TF_SINGLE);
if(single) { if(single) {
mct += ll(torusconfig::qty) << 37; 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(current_extra) << 29;
mct += ll(fgeomextras[current_extra].current_prime_id) << 37; mct += ll(fgeomextras[current_extra].current_prime_id) << 37;
} }
if(geometry == gCrystal) { if(geometry == gCrystal) {
mct += ll(ginf[geometry].sides) << 29; mct += ll(ginf[geometry].sides) << 29;
mct += ll(ginf[geometry].vertices) << 37; mct += ll(ginf[geometry].vertex) << 37;
} }
if(geometry == gArchimedean) { if(geometry == gArchimedean) {