From 0020957906369c2806a414f84e1025977cd39f70 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sat, 6 Mar 2021 11:47:54 +0100 Subject: [PATCH] finalizer struct, and fixed animations breaking --- hyper.h | 6 ++++++ screenshot.cpp | 9 ++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/hyper.h b/hyper.h index 88b58d9b..cb906765 100644 --- a/hyper.h +++ b/hyper.h @@ -628,6 +628,12 @@ template struct dynamicval { ~dynamicval() { where = backup; } }; +struct finalizer { + reaction_t f; + finalizer(reaction_t r) : f(r) {} + ~finalizer() { f(); } + }; + static const int MAXPLAYER = 7; #define DEFAULTCONTROL (multi::players == 1 && !shmup::on && !multi::alwaysuse && !(rug::rugged && rug::renderonce)) diff --git a/screenshot.cpp b/screenshot.cpp index 4858023a..f5f86dc3 100644 --- a/screenshot.cpp +++ b/screenshot.cpp @@ -771,7 +771,14 @@ EX void take(string fname, const function& what IS(default_screenshot_co #else int multiplier = shot_aa; #endif - + + vector chg; + for(auto ap: anims::aps) chg.push_back(*ap.value == ap.last); + finalizer f([&] { + for(int i=0; i v(vid, vid); dynamicval v2(inHighQual, true); dynamicval v6(auraNOGL, true);