From a49de4530f3f7e2cf0753fbfb836e6a1893e1625 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Thu, 30 May 2019 16:12:38 +0200 Subject: [PATCH] dual:: added some missing gd->store's --- archimedean.cpp | 4 +++- bigstuff.cpp | 10 +++++++++- blizzard.cpp | 8 +++++++- complex2.cpp | 3 ++- graph.cpp | 3 ++- shmup.cpp | 5 ++++- system.cpp | 4 ++++ 7 files changed, 31 insertions(+), 6 deletions(-) diff --git a/archimedean.cpp b/archimedean.cpp index b4af3d14..b4bb98c6 100644 --- a/archimedean.cpp +++ b/archimedean.cpp @@ -798,7 +798,9 @@ int readArgs() { #if CAP_COMMANDLINE auto hook = - addHook(hooks_args, 100, readArgs); + addHook(hooks_args, 100, readArgs) ++ addHook(hooks_gamedata, 0, [] (gamedata* gd) { gd->store(altmap); gd->store(archimedean_gmatrix); gd->store(current_altmap); }); + #endif #if MAXMDIM >= 4 diff --git a/bigstuff.cpp b/bigstuff.cpp index fa01b882..ca901355 100644 --- a/bigstuff.cpp +++ b/bigstuff.cpp @@ -866,15 +866,17 @@ void setLandSphere(cell *c) { } } -eLand euland[max_vec]; +vector euland; map euland3; map euland3_hash; eLand& get_euland(int c) { + euland.resize(max_vec); return euland[c & (max_vec-1)]; } void clear_euland(eLand first) { + euland.resize(max_vec); for(int i=0; istore(euland); + gd->store(euland3); + gd->store(euland3_hash); + }); + } diff --git a/blizzard.cpp b/blizzard.cpp index 613cad22..a5295fd0 100644 --- a/blizzard.cpp +++ b/blizzard.cpp @@ -244,7 +244,13 @@ auto ccm_blizzard = addHook(clearmemory, 0, [] () { blizzardcells.clear(); bcells.clear(); }) + -addHook(hooks_removecells, 0, [] () { ++ addHook(hooks_gamedata, 0, [] (gamedata* gd) { + gd->store(arrowtraps); + gd->store(blizzardcells); + gd->store(bcells); + gd->store(blizzard_N); + }) ++ addHook(hooks_removecells, 0, [] () { eliminate_if(arrowtraps, is_cell_removed); }); diff --git a/complex2.cpp b/complex2.cpp index ef00caeb..c855f8dc 100644 --- a/complex2.cpp +++ b/complex2.cpp @@ -189,7 +189,8 @@ namespace brownian { vector to_remove; for(auto p: futures) if(is_cell_removed(p.first)) to_remove.push_back(p.first); for(auto r: to_remove) futures.erase(r); - }) + addHook(clearmemory, 0, [] () { futures.clear(); }); + }) + addHook(clearmemory, 0, [] () { futures.clear(); }) + + addHook(hooks_gamedata, 0, [] (gamedata* gd) { gd->store(futures); }); } diff --git a/graph.cpp b/graph.cpp index 7051f407..648a561a 100644 --- a/graph.cpp +++ b/graph.cpp @@ -7476,8 +7476,9 @@ auto graphcm = addHook(clearmemory, 0, [] () { gd->store(animations); gd->store(flashes); gd->store(fallanims); + gd->store(radar_transform); + gd->store(actual_view_transform); }); -; //=== animation diff --git a/shmup.cpp b/shmup.cpp index 654cc8c1..552a2f6c 100644 --- a/shmup.cpp +++ b/shmup.cpp @@ -3777,7 +3777,7 @@ void clearMemory() { void gamedata(hr::gamedata* gd) { if(shmup::on) { - for(int i=0; istore(pc[i]); + gd->store(pc[0]); // assuming 1 player! gd->store(nextmove); gd->store(curtime); gd->store(nextdragon); @@ -3789,6 +3789,9 @@ void gamedata(hr::gamedata* gd) { gd->store(lmousetarget); gd->store(nonvirtual); gd->store(additional); + if(WDIM == 3) gd->store(swordmatrix[0]); // assuming 1 player! + gd->store(traplist); + gd->store(firetraplist); } } diff --git a/system.cpp b/system.cpp index af0ff023..c8b17855 100644 --- a/system.cpp +++ b/system.cpp @@ -1386,11 +1386,15 @@ addHook(hooks_gamedata, 0, [] (gamedata* gd) { gd->store(crush_now); gd->store(crush_next); gd->store(rosemap); + gd->store(airmap); gd->store(adj_memo); gd->store(pd_from); gd->store(pd_range); gd->store(pathqm); gd->store(reachedfrom); + gd->store(gravity_state); + gd->store(last_gravity_state); + gd->store(shpos); }) + addHook(hooks_removecells, 0, [] () { eliminate_if(crush_next, is_cell_removed);