diff --git a/src/twn_loop.c b/src/twn_loop.c index c16fdcd..ecd9a97 100644 --- a/src/twn_loop.c +++ b/src/twn_loop.c @@ -351,8 +351,10 @@ static bool initialize(void) { /* that is why PhysicsFS is initialized before anything else */ toml_set_memutil(SDL_malloc, SDL_free); + profile_start("resolve_pack_dependencies()"); /* time to orderly resolve any dependencies present */ resolve_pack_dependencies("data"); + profile_end("resolve_pack_dependencies()"); /* load the config file into an opaque table */ { @@ -710,6 +712,8 @@ static void reset_state(void) { int enter_loop(int argc, char **argv) { + profile_start("startup"); + ctx.argc = argc; ctx.argv = argv; ctx.base_dir = SDL_GetBasePath(); @@ -793,6 +797,8 @@ int enter_loop(int argc, char **argv) { ctx.was_successful = true; ctx.game.initialization_needed = true; + profile_end("startup"); + while (ctx.is_running) { if (game_object_try_reloading()) { ctx.game.initialization_needed = true; @@ -802,7 +808,8 @@ int enter_loop(int argc, char **argv) { main_loop(); } - profile_list_stats(); + if (ctx.game.debug) + profile_list_stats(); /* loop is over */ game_object_unload();