diff --git a/components.cpp b/components.cpp index 4dd9dad..4f918cf 100644 --- a/components.cpp +++ b/components.cpp @@ -1,7 +1,6 @@ #include "components.hpp" #include "point.hpp" -#include "easings.hpp" namespace components { static ComponentMap MAP; diff --git a/components.hpp b/components.hpp index c42f8f5..b2fee3d 100644 --- a/components.hpp +++ b/components.hpp @@ -10,7 +10,6 @@ #include #include #include -#include "easings.hpp" #include "json_mods.hpp" #include "goap.hpp" #include diff --git a/easing.cpp b/easing.cpp index 9278875..613d360 100644 --- a/easing.cpp +++ b/easing.cpp @@ -1,4 +1,3 @@ -#include "easings.hpp" #include "rand.hpp" #include "animation.hpp" #include diff --git a/easings.hpp b/easings.hpp deleted file mode 100644 index 4788871..0000000 --- a/easings.hpp +++ /dev/null @@ -1,63 +0,0 @@ -#pragma once -#include - -namespace ease { - - enum Style { - NONE=0, - SINE=1, - OUT_CIRC=2, - OUT_BOUNCE=3, - IN_OUT_BACK=4, - RANDOM=5, - NORM_DIST=6, - LINEAR=7 - }; - - enum Motion { - RUSH=0, - SHAKE=1, - BOUNCE=2, - SQUEEZE=3, - SQUASH=4, - STRETCH=5, - GROW=6, - SLIDE=7, - NO_MOTION=1000, - }; - - inline double sine(double x) { - return (std::sin(x) + 1.0) / 2.0; - } - - inline double out_circ(double x) { - return std::sqrt(1.0f - ((x - 1.0f) * (x - 1.0f))); - } - - inline double out_bounce(double x) { - constexpr const double n1 = 7.5625; - constexpr const double d1 = 2.75; - - if (x < 1 / d1) { - return n1 * x * x; - } else if (x < 2 / d1) { - x -= 1.5; - return n1 * (x / d1) * x + 0.75; - } else if (x < 2.5 / d1) { - x -= 2.25; - return n1 * (x / d1) * x + 0.9375; - } else { - x -= 2.625; - return n1 * (x / d1) * x + 0.984375; - } - } - - inline double in_out_back(double x) { - constexpr const double c1 = 1.70158; - constexpr const double c2 = c1 * 1.525; - - return x < 0.5 - ? (std::pow(2.0 * x, 2.0) * ((c2 + 1.0) * 2.0 * x - c2)) / 2.0 - : (std::pow(2.0 * x - 2.0, 2.0) * ((c2 + 1.0) * (x * 2.0 - 2.0) + c2) + 2.0) / 2.0; - } -} diff --git a/gui/main_ui.cpp b/gui/main_ui.cpp index 09e26f0..4c419d6 100644 --- a/gui/main_ui.cpp +++ b/gui/main_ui.cpp @@ -1,6 +1,5 @@ #include "gui/main_ui.hpp" #include "components.hpp" -#include "easings.hpp" #include #include "animation.hpp" #include "constants.hpp" diff --git a/meson.build b/meson.build index 59043f1..229e502 100644 --- a/meson.build +++ b/meson.build @@ -147,7 +147,6 @@ executable('runtests', sources + [ 'tests/config.cpp', 'tests/dbc.cpp', 'tests/dinkyecs.cpp', - 'tests/easings.cpp', 'tests/event_router.cpp', 'tests/fsm.cpp', 'tests/inventory.cpp', diff --git a/tests/components.cpp b/tests/components.cpp index cfa1a06..d656dc3 100644 --- a/tests/components.cpp +++ b/tests/components.cpp @@ -3,7 +3,6 @@ #include "dinkyecs.hpp" #include "config.hpp" #include -#include "easings.hpp" using namespace components; using namespace DinkyECS; diff --git a/tests/easings.cpp b/tests/easings.cpp deleted file mode 100644 index 5ae7fe7..0000000 --- a/tests/easings.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#include -#include "easings.hpp" -#include - -TEST_CASE("make sure the easing functions at least run", "[easings]") { - double out = ease::sine(1.3); - REQUIRE(out <= 1.0); - - out = ease::out_circ(3.444); - REQUIRE(std::isnan(out)); - - out = ease::out_bounce(1.13); - REQUIRE(out <= 10 ); - - out = ease::out_bounce(out); - out = ease::out_bounce(out); - out = ease::out_bounce(out); - - out = ease::in_out_back(3.4); - REQUIRE(out < 250.0); -} diff --git a/tools/arena_ui.cpp b/tools/arena_ui.cpp index a75df88..d419fab 100644 --- a/tools/arena_ui.cpp +++ b/tools/arena_ui.cpp @@ -1,5 +1,4 @@ #include "arena_ui.hpp" -#include "easings.hpp" #include "sound.hpp" #include