save/load arb geometry

This commit is contained in:
Zeno Rogue 2020-08-02 12:53:19 +02:00
parent f7adc64101
commit a66136625d
2 changed files with 15 additions and 5 deletions

View File

@ -461,6 +461,7 @@ EX namespace mapstream {
#if CAP_ARCM
if(geometry == gArchimedean) f.write(arcm::current.symbol);
#endif
if(geometry == gArbitrary) f.write(arb::current.filename);
if(geometry == gNil) {
f.write(S7);
f.write(nilv::nilperiod);
@ -543,6 +544,12 @@ EX namespace mapstream {
}
}
#endif
if(geometry == gArbitrary) {
string s;
f.read(s);
arb::run(s);
stop_game();
}
#if CAP_ARCM
if(geometry == gArchimedean) {
string& symbol = arcm::current.symbol;

View File

@ -1209,6 +1209,14 @@ EX void loadsave() {
for(int i=0; i<boxid; i++) save.box[i] = sc.box[i];
for(int i=boxid; i<MAXBOX; i++) save.box[i] = 0;
// for(int i=160; i<200; i++) printf("%d: %d ", i, save.box[i]);
if(1) {
shstream ss;
ss.s = meaning[sc.box[MODECODE_BOX]];
ss.read(ss.vernum);
mapstream::load_geometry(ss);
}
loadBox();
// printf("boxid = %d\n", boxid);
if(items[itHolyGrail]) {
@ -1226,11 +1234,6 @@ EX void loadsave() {
randomPatternsMode = false;
yendor::on = false;
tour::on = false;
shstream ss;
ss.s = meaning[sc.box[MODECODE_BOX]];
ss.read(ss.vernum);
mapstream::load_geometry(ss);
}
}
#endif