diff --git a/CMakeLists.txt b/CMakeLists.txt index 8a4adfc..e5148b1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -64,7 +64,7 @@ target_include_directories(sandbox_trace target_link_libraries(sandbox_trace PUBLIC - ${GAME_LIBS} + lib_scenes_trace pthread dl ) diff --git a/scenes/CMakeLists.txt b/scenes/CMakeLists.txt index aa6c957..8726afb 100644 --- a/scenes/CMakeLists.txt +++ b/scenes/CMakeLists.txt @@ -20,3 +20,32 @@ target_link_libraries(lib_scenes PUBLIC lib_engine ) + +add_library(lib_scenes_trace STATIC + assets_loader.c + player_ent.c + items_ent.c + water_flow.c + editor_scene.c + menu_scene.c + level_select_scene.c + game_scene.c + game_systems.c + scene_systems.c + camera_systems.c + engine_impl.c +) +target_compile_definitions(lib_scenes_trace + PUBLIC + TRACY_ENABLE + TRACY_ON_DEMAND +) +target_include_directories(lib_scenes_trace + PUBLIC + ${CMAKE_CURRENT_LIST_DIR} + ${CMAKE_CURRENT_LIST_DIR}/../tracy/public/ +) +target_link_libraries(lib_scenes_trace + PUBLIC + lib_engine +) diff --git a/scenes/game_systems.c b/scenes/game_systems.c index 1e50abd..ab44738 100644 --- a/scenes/game_systems.c +++ b/scenes/game_systems.c @@ -1,3 +1,7 @@ +#ifdef TRACY_ENABLE +#include "tracy/TracyC.h" +#endif + #include "game_systems.h" #include "scene_impl.h" @@ -702,6 +706,9 @@ void spike_collision_system(Scene_t* scene) void tile_collision_system(Scene_t* scene) { + #ifdef TRACY_ENABLE + TracyCZoneN(ctx, "TileCol", true) + #endif static bool checked_entities[MAX_COMP_POOL_SIZE] = {0}; LevelSceneData_t* data = &(CONTAINER_OF(scene, LevelScene_t, scene)->data); @@ -794,6 +801,9 @@ void tile_collision_system(Scene_t* scene) } } } + #ifdef TRACY_ENABLE + TracyCZoneEnd(ctx) + #endif } void edge_velocity_check_system(Scene_t* scene)