1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-09-04 19:47:54 +00:00

improved parameter animation

This commit is contained in:
Zeno Rogue
2023-08-09 01:01:32 +02:00
parent a13ba9bdbe
commit 5057f10358
6 changed files with 131 additions and 100 deletions

View File

@@ -112,18 +112,15 @@ EX namespace arg {
return strtoll(argcs(), NULL, 16);
}
int parameter_id;
EX void shift_arg_formula(ld& x, const reaction_t& r IS(reaction_t())) {
shift(); ld old = x; x = argf();
#if CAP_ANIMATIONS
anims::animate_parameter(x, args(), r);
#endif
if(old != x && r) r();
shift();
auto par = anims::find_param(&x);
if(!par) par = param_f(x, "tmp_parameter_" + its(parameter_id++))->set_reaction(r);
par->load_as_animation(args());
}
EX void shift_arg_formula_matrix(struct hr::trans23& x) {
shift(); x = parsematrix23(args()); // TODO animate
}
#if HDR
// an useful macro