Compare commits
2 Commits
ef04e4ce42
...
ca5c653b9d
Author | SHA1 | Date |
---|---|---|
|
ca5c653b9d | |
|
b2beaea248 |
|
@ -0,0 +1,3 @@
|
|||
[submodule "tracy"]
|
||||
path = tracy
|
||||
url = https://github.com/wolfpld/tracy.git
|
|
@ -2,7 +2,7 @@ set(PROJECT_NAME HATPC_remake)
|
|||
set(CMAKE_C_COMPILER clang)
|
||||
set(CMAKE_C_FLAGS "-Wall -Wextra")
|
||||
cmake_minimum_required(VERSION 3.22.1)
|
||||
project(${PROJECT_NAME} C)
|
||||
project(${PROJECT_NAME} C CXX)
|
||||
set(CMAKE_C_STANDARD 99)
|
||||
set(RAYLIB_DIR /usr/local/lib CACHE FILEPATH "directory to Raylib")
|
||||
set(LIBZSTD_DIR /usr/local/lib CACHE FILEPATH "directory to zstd")
|
||||
|
@ -45,6 +45,30 @@ target_include_directories(${PROJECT_NAME}
|
|||
target_link_libraries(${PROJECT_NAME}
|
||||
${GAME_LIBS}
|
||||
)
|
||||
|
||||
add_executable(sandbox_trace
|
||||
scene_test.c
|
||||
tracy/public/TracyClient.cpp
|
||||
)
|
||||
target_compile_definitions(sandbox_trace
|
||||
PUBLIC
|
||||
TRACY_ENABLE
|
||||
TRACY_ON_DEMAND
|
||||
)
|
||||
target_include_directories(sandbox_trace
|
||||
PRIVATE
|
||||
${CMAKE_CURRENT_LIST_DIR}
|
||||
PUBLIC
|
||||
tracy/public/
|
||||
)
|
||||
|
||||
target_link_libraries(sandbox_trace
|
||||
PUBLIC
|
||||
lib_scenes_trace
|
||||
pthread
|
||||
dl
|
||||
)
|
||||
|
||||
add_executable(scene_test
|
||||
scene_test.c
|
||||
)
|
||||
|
@ -54,6 +78,7 @@ target_include_directories(scene_test
|
|||
${CMAKE_CURRENT_LIST_DIR}
|
||||
)
|
||||
|
||||
|
||||
if (NOT EMSCRIPTEN)
|
||||
target_compile_options(scene_test PRIVATE -fsanitize=address -gdwarf-4)
|
||||
target_link_options(scene_test PRIVATE -fsanitize=address -gdwarf-4)
|
||||
|
|
15
scene_test.c
15
scene_test.c
|
@ -1,3 +1,6 @@
|
|||
#ifdef TRACY_ENABLE
|
||||
#include "tracy/TracyC.h"
|
||||
#endif
|
||||
#include "scene_impl.h"
|
||||
#include "ent_impl.h"
|
||||
#include "assets_loader.h"
|
||||
|
@ -89,10 +92,22 @@ int main(void)
|
|||
float frame_time = GetFrameTime();
|
||||
float delta_time = fminf(frame_time, DT);
|
||||
|
||||
#ifdef TRACY_ENABLE
|
||||
TracyCZoneN(ctx, "Overall", true)
|
||||
#endif
|
||||
#ifdef TRACY_ENABLE
|
||||
TracyCZoneN(ctx1, "Update", true)
|
||||
#endif
|
||||
update_scene(&scene.scene, delta_time);
|
||||
update_entity_manager(&scene.scene.ent_manager);
|
||||
#ifdef TRACY_ENABLE
|
||||
TracyCZoneEnd(ctx1)
|
||||
#endif
|
||||
// This is needed to advance time delta
|
||||
render_scene(&scene.scene);
|
||||
#ifdef TRACY_ENABLE
|
||||
TracyCZoneEnd(ctx)
|
||||
#endif
|
||||
update_sfx_list(&engine);
|
||||
if (WindowShouldClose()) break;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 5d542dc09f3d9378d005092a4ad446bd405f819a
|
Loading…
Reference in New Issue