Test integrate tracy into scenes

main
En Yi 2024-08-24 21:44:23 +08:00
parent b2beaea248
commit ca5c653b9d
3 changed files with 40 additions and 1 deletions

View File

@ -64,7 +64,7 @@ target_include_directories(sandbox_trace
target_link_libraries(sandbox_trace
PUBLIC
${GAME_LIBS}
lib_scenes_trace
pthread
dl
)

View File

@ -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
)

View File

@ -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)