From 770496ee9d0e45480c0e0f8951adb8eee247bfe1 Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Tue, 10 Dec 2024 19:50:26 +0100 Subject: big WIP --- src/test/Profiling.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/test/Profiling.cpp') diff --git a/src/test/Profiling.cpp b/src/test/Profiling.cpp index c753bca..3f48ced 100644 --- a/src/test/Profiling.cpp +++ b/src/test/Profiling.cpp @@ -36,7 +36,7 @@ class TestScript : public Script { subscribe( [this](const CollisionEvent & ev) -> bool { return this->oncollision(ev); }); } - void update() { + void fixed_update() { // Retrieve component from the same GameObject this script is on } }; @@ -77,9 +77,9 @@ public: }); // initialize systems here: //calls init - script_sys.update(); + script_sys.fixed_update(); //creates window - render_sys.update(); + render_sys.frame_update(); } // Helper function to time an update call and store its duration @@ -97,12 +97,12 @@ public: // Run and profile all systems, return the total time in milliseconds std::chrono::microseconds run_all_systems() { std::chrono::microseconds total_microseconds = 0us; - total_microseconds += time_function("PhysicsSystem", [&]() { physics_sys.update(); }); + total_microseconds += time_function("PhysicsSystem", [&]() { physics_sys.fixed_update(); }); total_microseconds - += time_function("CollisionSystem", [&]() { collision_sys.update(); }); + += time_function("CollisionSystem", [&]() { collision_sys.fixed_update(); }); total_microseconds - += time_function("ParticleSystem", [&]() { particle_sys.update(); }); - total_microseconds += time_function("RenderSystem", [&]() { render_sys.update(); }); + += time_function("ParticleSystem", [&]() { particle_sys.fixed_update(); }); + total_microseconds += time_function("RenderSystem", [&]() { render_sys.frame_update(); }); return total_microseconds; } @@ -227,7 +227,7 @@ TEST_F(DISABLED_ProfilingTest, Profiling_3) { .sprite = test_sprite, }); } - render_sys.update(); + render_sys.frame_update(); this->game_object_count++; this->total_time = 0us; -- cgit v1.2.3