Created a nice utility library for doing animations, and used it in the ritual crafting UI.
This commit is contained in:
parent
0a40135f5d
commit
1aa6674e42
14 changed files with 213 additions and 150 deletions
|
@ -60,34 +60,3 @@ TEST_CASE("make sure json_mods works", "[components]") {
|
|||
auto boss2 = world.get<BossFight>(devils_fingers);
|
||||
REQUIRE(boss2.stage != std::nullopt);
|
||||
}
|
||||
|
||||
|
||||
TEST_CASE("animation component special cases", "[components]") {
|
||||
Animation anim;
|
||||
|
||||
anim.easing = ease::NONE;
|
||||
float res = anim.twitching();
|
||||
REQUIRE(res == 0.0);
|
||||
|
||||
anim.easing = ease::SINE;
|
||||
anim.subframe = 1.0f;
|
||||
res = anim.twitching();
|
||||
REQUIRE(!std::isnan(res));
|
||||
|
||||
anim.easing = ease::OUT_CIRC;
|
||||
res = anim.twitching();
|
||||
REQUIRE(!std::isnan(res));
|
||||
|
||||
anim.easing = ease::OUT_BOUNCE;
|
||||
res = anim.twitching();
|
||||
REQUIRE(!std::isnan(res));
|
||||
|
||||
anim.easing = ease::IN_OUT_BACK;
|
||||
res = anim.twitching();
|
||||
REQUIRE(!std::isnan(res));
|
||||
|
||||
anim.easing = ease::FUCKFACE;
|
||||
bool throws = false;
|
||||
try { anim.twitching(); } catch(...) { throws = true; }
|
||||
REQUIRE(throws);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue