1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-11-14 20:57:10 +00:00

refactored some global and stereo:: variables into display_data structure

This commit is contained in:
Zeno Rogue
2018-11-17 19:24:02 +01:00
parent 680dca90c8
commit d935febf09
28 changed files with 445 additions and 389 deletions

View File

@@ -1034,9 +1034,7 @@ namespace gamestack {
struct gamedata {
hrmap *hmap;
cellwalker cwt;
cellwalker ctover;
heptspin viewctr;
transmatrix View;
display_data d;
eGeometry geometry;
eVariation variation;
bool shmup;
@@ -1054,12 +1052,10 @@ namespace gamestack {
gamedata gdn;
gdn.hmap = currentmap;
gdn.cwt = cwt;
gdn.viewctr = viewctr;
gdn.View = View;
gdn.geometry = geometry;
gdn.shmup = shmup::on;
gdn.variation = variation;
gdn.ctover = centerover;
gdn.d = *current_display;
gd.push_back(gdn);
}
@@ -1067,15 +1063,13 @@ namespace gamestack {
gamedata& gdn = gd[isize(gd)-1];
currentmap = gdn.hmap;
cwt = gdn.cwt;
viewctr = gdn.viewctr;
View = gdn.View;
geometry = gdn.geometry;
variation = gdn.variation;
if(shmup::on) shmup::clearMonsters();
shmup::on = gdn.shmup;
resetGeometry();
gd.pop_back();
centerover = gdn.ctover;
*current_display = gdn.d;
bfs();
}