Now the Animation system is no more. Next is cleaning up the quick hacks I needed to finally get rid of it, like animate2::has.
This commit is contained in:
parent
b504afef2a
commit
89ca204f3d
15 changed files with 356 additions and 423 deletions
|
|
@ -11,7 +11,6 @@
|
|||
#include "sound.hpp"
|
||||
#include "components.hpp"
|
||||
|
||||
|
||||
using namespace components;
|
||||
using namespace textures;
|
||||
using namespace std::chrono_literals;
|
||||
|
|
|
|||
|
|
@ -1,48 +0,0 @@
|
|||
#include <catch2/catch_test_macros.hpp>
|
||||
#include "animation.hpp"
|
||||
#include "textures.hpp"
|
||||
#include "config.hpp"
|
||||
#include "rand.hpp"
|
||||
|
||||
using namespace components;
|
||||
using namespace textures;
|
||||
|
||||
TEST_CASE("animation easing tests", "[animation]") {
|
||||
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));
|
||||
}
|
||||
|
||||
|
||||
TEST_CASE("animation utility API", "[animation]") {
|
||||
textures::init();
|
||||
animation::init();
|
||||
|
||||
auto blanket = textures::get_sprite("ritual_crafting_area");
|
||||
auto anim = animation::load("ritual_crafting_area");
|
||||
|
||||
anim.play();
|
||||
|
||||
while(anim.apply(*blanket.sprite, {0,0})) {
|
||||
fmt::println("animation: {}", anim.subframe);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue