Needed to remove more dead code.
This commit is contained in:
parent
03be0884a4
commit
b61dd167b8
9 changed files with 0 additions and 91 deletions
|
|
@ -1,7 +1,6 @@
|
||||||
#include "components.hpp"
|
#include "components.hpp"
|
||||||
|
|
||||||
#include "point.hpp"
|
#include "point.hpp"
|
||||||
#include "easings.hpp"
|
|
||||||
|
|
||||||
namespace components {
|
namespace components {
|
||||||
static ComponentMap MAP;
|
static ComponentMap MAP;
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@
|
||||||
#include <SFML/System/Vector2.hpp>
|
#include <SFML/System/Vector2.hpp>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <optional>
|
#include <optional>
|
||||||
#include "easings.hpp"
|
|
||||||
#include "json_mods.hpp"
|
#include "json_mods.hpp"
|
||||||
#include "goap.hpp"
|
#include "goap.hpp"
|
||||||
#include <array>
|
#include <array>
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
#include "easings.hpp"
|
|
||||||
#include "rand.hpp"
|
#include "rand.hpp"
|
||||||
#include "animation.hpp"
|
#include "animation.hpp"
|
||||||
#include <fmt/core.h>
|
#include <fmt/core.h>
|
||||||
|
|
|
||||||
63
easings.hpp
63
easings.hpp
|
|
@ -1,63 +0,0 @@
|
||||||
#pragma once
|
|
||||||
#include <cmath>
|
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
#include "gui/main_ui.hpp"
|
#include "gui/main_ui.hpp"
|
||||||
#include "components.hpp"
|
#include "components.hpp"
|
||||||
#include "easings.hpp"
|
|
||||||
#include <fmt/xchar.h>
|
#include <fmt/xchar.h>
|
||||||
#include "animation.hpp"
|
#include "animation.hpp"
|
||||||
#include "constants.hpp"
|
#include "constants.hpp"
|
||||||
|
|
|
||||||
|
|
@ -147,7 +147,6 @@ executable('runtests', sources + [
|
||||||
'tests/config.cpp',
|
'tests/config.cpp',
|
||||||
'tests/dbc.cpp',
|
'tests/dbc.cpp',
|
||||||
'tests/dinkyecs.cpp',
|
'tests/dinkyecs.cpp',
|
||||||
'tests/easings.cpp',
|
|
||||||
'tests/event_router.cpp',
|
'tests/event_router.cpp',
|
||||||
'tests/fsm.cpp',
|
'tests/fsm.cpp',
|
||||||
'tests/inventory.cpp',
|
'tests/inventory.cpp',
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@
|
||||||
#include "dinkyecs.hpp"
|
#include "dinkyecs.hpp"
|
||||||
#include "config.hpp"
|
#include "config.hpp"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include "easings.hpp"
|
|
||||||
|
|
||||||
using namespace components;
|
using namespace components;
|
||||||
using namespace DinkyECS;
|
using namespace DinkyECS;
|
||||||
|
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
#include <catch2/catch_test_macros.hpp>
|
|
||||||
#include "easings.hpp"
|
|
||||||
#include <cmath>
|
|
||||||
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
#include "arena_ui.hpp"
|
#include "arena_ui.hpp"
|
||||||
#include "easings.hpp"
|
|
||||||
#include "sound.hpp"
|
#include "sound.hpp"
|
||||||
#include <fmt/xchar.h>
|
#include <fmt/xchar.h>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue