aboutsummaryrefslogtreecommitdiff
path: root/src/test/Profiling.cpp
diff options
context:
space:
mode:
authorJAROWMR <jarorutjes07@gmail.com>2024-12-05 21:10:07 +0100
committerJAROWMR <jarorutjes07@gmail.com>2024-12-05 21:10:07 +0100
commit9604616001ac273f2c966c3c829638e905def7bf (patch)
tree7e958c2b658a4dbc9e79068d7309513efa928937 /src/test/Profiling.cpp
parent018a451051669506be447aa925ecb6a9f5aaf418 (diff)
parent1f4e961d7f9d6887c807cac1a362f2d178b0860b (diff)
merge with master and keypressed added to game
Diffstat (limited to 'src/test/Profiling.cpp')
-rw-r--r--src/test/Profiling.cpp23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/test/Profiling.cpp b/src/test/Profiling.cpp
index d2f219e..91be769 100644
--- a/src/test/Profiling.cpp
+++ b/src/test/Profiling.cpp
@@ -1,3 +1,4 @@
+#include "manager/Mediator.h"
#include "system/ParticleSystem.h"
#include "system/PhysicsSystem.h"
#include "system/RenderSystem.h"
@@ -8,9 +9,9 @@
#define private public
#define protected public
-#include <crepe/ComponentManager.h>
+#include <crepe/manager/ComponentManager.h>
#include <crepe/api/Event.h>
-#include <crepe/api/EventManager.h>
+#include <crepe/manager/EventManager.h>
#include <crepe/api/GameObject.h>
#include <crepe/api/ParticleEmitter.h>
#include <crepe/api/Rigidbody.h>
@@ -52,13 +53,14 @@ public:
// Maximum duration to stop test
const std::chrono::microseconds duration = 16000us;
- ComponentManager mgr;
+ Mediator m;
+ ComponentManager mgr{m};
// Add system used for profling tests
- CollisionSystem collision_sys{mgr};
- PhysicsSystem physics_sys{mgr};
- ParticleSystem particle_sys{mgr};
- RenderSystem render_sys{mgr};
- ScriptSystem script_sys{mgr};
+ CollisionSystem collision_sys{m};
+ PhysicsSystem physics_sys{m};
+ ParticleSystem particle_sys{m};
+ RenderSystem render_sys{m};
+ ScriptSystem script_sys{m};
// Test data
std::map<std::string, std::chrono::microseconds> timings;
@@ -159,7 +161,8 @@ TEST_F(Profiling, Profiling_2) {
.gravity_scale = 0.0,
.body_type = Rigidbody::BodyType::STATIC,
});
- gameobject.add_component<BoxCollider>(vec2{0, 0}, 1, 1);
+ gameobject.add_component<BoxCollider>(vec2{0, 0}, vec2{1, 1});
+
gameobject.add_component<BehaviorScript>().set_script<TestScript>();
Color color(0, 0, 0, 0);
auto img = Texture("asset/texture/green_square.png");
@@ -192,7 +195,7 @@ TEST_F(Profiling, Profiling_3) {
.gravity_scale = 0,
.body_type = Rigidbody::BodyType::STATIC,
});
- gameobject.add_component<BoxCollider>(vec2{0, 0}, 1, 1);
+ gameobject.add_component<BoxCollider>(vec2{0, 0}, vec2{1, 1});
gameobject.add_component<BehaviorScript>().set_script<TestScript>();
Color color(0, 0, 0, 0);
auto img = Texture("asset/texture/green_square.png");