1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-27 14:37:16 +00:00

saving viewcenter in texture config

This commit is contained in:
Zeno Rogue 2018-01-03 01:21:38 +01:00
parent 3f44641502
commit 6745867dd2

View File

@ -682,6 +682,7 @@ void init_textureconfig() {
addsaver(si_save.id, "center type", 1);
addsaver(si_save.dir, "center direction", 0);
addsaver(si_save.reflect, "center reflection", false);
addsaver(viewctr.spin, "center spin", 0);
addsaver(twidth, "texture resolution", 2048);
addsaver(gsplits, "precision", 1);
@ -737,6 +738,23 @@ bool load_textureconfig() {
}
}
if(true) {
celllister cl(currentmap->gamestart(), 20, 10000, NULL);
bool found = false;
for(cell *c: cl.lst) if(euclid || ctof(c)) {
cell *ctr = euclid ? centerover.c : viewctr.h->c7;
auto si_here = patterns::getpatterninfo0(c);
if(si_here.id == si_save.id && si_here.reflect == si_save.reflect && si_here.dir == si_save.dir) {
if(euclid) centerover.c = ctr;
else viewctr.h = ctr->master;
found = true;
break;
}
}
if(!found)
addMessage(XLAT("warning: unable to find the center"));
}
if(!readtexture()) return false;
if(!loadTextureGL()) return false;
calcparam();