aboutsummaryrefslogtreecommitdiff
path: root/src/test/Profiling.cpp
diff options
context:
space:
mode:
authorWBoerenkamps <wrj.boerenkamps@student.avans.nl>2024-12-11 17:21:43 +0100
committerWBoerenkamps <wrj.boerenkamps@student.avans.nl>2024-12-11 17:21:43 +0100
commitc585731ab4557e2a03be9630a54295a3700103fc (patch)
tree1baff648eb415fbc81612077dce5c2551abf12a2 /src/test/Profiling.cpp
parent4bb6e89d93596c9c53798b1b9a01c588cabfe881 (diff)
parent30c17c98e54c1534664de08ca3838c40c859d166 (diff)
Merge branch 'master' of https://github.com/lonkaars/crepe into wouter/text-component
Diffstat (limited to 'src/test/Profiling.cpp')
-rw-r--r--src/test/Profiling.cpp44
1 files changed, 24 insertions, 20 deletions
diff --git a/src/test/Profiling.cpp b/src/test/Profiling.cpp
index c753bca..cc4c637 100644
--- a/src/test/Profiling.cpp
+++ b/src/test/Profiling.cpp
@@ -1,9 +1,11 @@
-#include "manager/Mediator.h"
-#include "system/ParticleSystem.h"
-#include "system/PhysicsSystem.h"
-#include "system/RenderSystem.h"
#include <chrono>
#include <cmath>
+#include <crepe/api/Asset.h>
+#include <crepe/manager/Mediator.h>
+#include <crepe/manager/ResourceManager.h>
+#include <crepe/system/ParticleSystem.h>
+#include <crepe/system/PhysicsSystem.h>
+#include <crepe/system/RenderSystem.h>
#include <gtest/gtest.h>
#define private public
@@ -54,6 +56,8 @@ public:
const std::chrono::microseconds duration = 16000us;
Mediator m;
+ SDLContext sdl_context{m};
+ ResourceManager resman{m};
ComponentManager mgr{m};
// Add system used for profling tests
CollisionSystem collision_sys{m};
@@ -167,15 +171,15 @@ TEST_F(DISABLED_ProfilingTest, Profiling_2) {
gameobject.add_component<BoxCollider>(vec2{0, 0}, vec2{1, 1});
gameobject.add_component<BehaviorScript>().set_script<TestScript>();
- auto img = Texture("asset/texture/square.png");
Sprite & test_sprite = gameobject.add_component<Sprite>(
- img, Sprite::Data{
- .color = {0, 0, 0, 0},
- .flip = {.flip_x = false, .flip_y = false},
- .sorting_in_layer = 1,
- .order_in_layer = 1,
- .size = {.y = 500},
- });
+ Asset{"asset/texture/square.png"},
+ Sprite::Data{
+ .color = {0, 0, 0, 0},
+ .flip = {.flip_x = false, .flip_y = false},
+ .sorting_in_layer = 1,
+ .order_in_layer = 1,
+ .size = {.y = 500},
+ });
}
this->game_object_count++;
@@ -205,15 +209,15 @@ TEST_F(DISABLED_ProfilingTest, Profiling_3) {
});
gameobject.add_component<BoxCollider>(vec2{0, 0}, vec2{1, 1});
gameobject.add_component<BehaviorScript>().set_script<TestScript>();
- auto img = Texture("asset/texture/square.png");
Sprite & test_sprite = gameobject.add_component<Sprite>(
- img, Sprite::Data{
- .color = {0, 0, 0, 0},
- .flip = {.flip_x = false, .flip_y = false},
- .sorting_in_layer = 1,
- .order_in_layer = 1,
- .size = {.y = 500},
- });
+ Asset{"asset/texture/square.png"},
+ Sprite::Data{
+ .color = {0, 0, 0, 0},
+ .flip = {.flip_x = false, .flip_y = false},
+ .sorting_in_layer = 1,
+ .order_in_layer = 1,
+ .size = {.y = 500},
+ });
auto & test = gameobject.add_component<ParticleEmitter>(ParticleEmitter::Data{
.max_particles = 10,
.emission_rate = 100,