From 8dcaed3aaf07ef6fca8d1644f70b02d2d7c14090 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Wed, 11 Apr 2018 00:30:50 +0200 Subject: [PATCH] gp:: acknowledged in save game, save map, scorelist, modecode --- mapeditor.cpp | 17 +++++++++++++++-- scores.cpp | 6 ++++-- system.cpp | 10 +++++++++- yendor.cpp | 6 ++++++ 4 files changed, 34 insertions(+), 5 deletions(-) diff --git a/mapeditor.cpp b/mapeditor.cpp index d440b00e..9ca7f9e1 100644 --- a/mapeditor.cpp +++ b/mapeditor.cpp @@ -120,7 +120,13 @@ namespace mapstream { int32_t i = VERNUM; save(i); save(patterns::whichPattern); save(geometry); - save(nonbitrunc); + char nbtype = nonbitrunc; + if(gp::on) nbtype = 2; + save(nbtype); + if(gp::on) { + save(gp::param.first); + save(gp::param.second); + } if(geometry == gTorus) { save(torusconfig::qty); save(torusconfig::dx); @@ -205,7 +211,14 @@ namespace mapstream { if(vernum >= 10203) { load(geometry); - load(nonbitrunc); + char nbtype; + load(nbtype); + nonbitrunc = !!nbtype; + gp::on = nbtype == 2; + if(gp::on) { + load(gp::param.first); + load(gp::param.second); + } if(geometry == gTorus) { load(torusconfig::qty); load(torusconfig::dx); diff --git a/scores.cpp b/scores.cpp index f43b6e7f..f4c172f8 100644 --- a/scores.cpp +++ b/scores.cpp @@ -36,7 +36,8 @@ int modediff(score *S) { if(S->box[238]) g = gSphere; if(S->box[239]) g = gElliptic; if(max(S->box[197], 1) != multi::players) diff += 8; - if(S->box[186] != nonbitrunc) diff += 16; + if(S->box[186] != nonbitrunc || S->box[341] != gp::on || S->box[342] != gp::param.first || S->box[343] != gp::param.second) + diff += 16; if(S->box[196] != chaosmode) diff += 32; if(S->box[119] != shmup::on) diff += 64; if(pureHardcore() && !isHardcore(S)) diff += 128; @@ -54,7 +55,8 @@ string modedesc(score *S) { if(S->box[239]) g = gElliptic; string s = ginf[g].shortname; if(g != gNormal) s += " " + csub(XLATT1((eLand) S->box[120]), 3); - if(S->box[186]) s += "/7"; + if(S->box[341]) s += "/GP(" + its(S->box[342])+","+its(S->box[343])+")"; + else if(S->box[186]) s += "/7"; if(S->box[196]) s += "/C"; if(S->box[119]) s += "/s"; if(S->box[197] > 1) s += "/P" + its(S->box[197]); diff --git a/system.cpp b/system.cpp index f4ba3fe0..27c5b274 100644 --- a/system.cpp +++ b/system.cpp @@ -276,7 +276,7 @@ bool havesave = true; #if CAP_SAVE #define MAXBOX 500 -#define POSSCORE 341 // update this when new boxes are added! +#define POSSCORE 344 // update this when new boxes are added! struct score { string ver; @@ -665,6 +665,10 @@ void applyBoxes() { applyBoxM(moPair); applyBoxM(moCrusher); applyBoxM(moMonk); + + applyBoxBool(gp::on); + applyBox(gp::param.first); + applyBox(gp::param.second); if(POSSCORE != boxid) printf("ERROR: %d boxes\n", boxid); } @@ -685,6 +689,10 @@ void loadBoxHigh() { dynamicval sp3(shmup::on, savebox[119]); dynamicval sp4(chaosmode, savebox[196]); dynamicval sp5(nonbitrunc, savebox[186]); + dynamicval sp6(gp::on, savebox[341]); + dynamicval sp7(gp::param.first, savebox[342]); + dynamicval sp8(gp::param.second, savebox[343]); + if(savebox[238]) geometry = gSphere; if(savebox[239]) geometry = gElliptic; diff --git a/yendor.cpp b/yendor.cpp index bcd20cf8..458fb4a3 100644 --- a/yendor.cpp +++ b/yendor.cpp @@ -864,6 +864,12 @@ int modecode() { #endif if(numplayers() == 7) mct += 16384; + if(gp::on) { + mct += 32768; + mct += gp::param.first << 16; + mct += gp::param.second << 21; + } + mct += ginf[geometry].xcode; return mct;