diff --git a/src/game/hud.c b/src/game/hud.c index 50b2c3f2b..25804d2ef 100644 --- a/src/game/hud.c +++ b/src/game/hud.c @@ -675,12 +675,12 @@ void render_hud(void) { render_hud_timer(); } -#if defined(DEVELOPMENT) extern bool configLuaProfiler; if (configLuaProfiler) { extern void lua_profiler_update_counters(); lua_profiler_update_counters(); } +#ifdef DEVELOPMENT extern bool configCtxProfiler; if (configCtxProfiler) { extern void ctx_profiler_update_counters(); diff --git a/src/pc/configfile.c b/src/pc/configfile.c index 0142c48f9..02ee9904b 100644 --- a/src/pc/configfile.c +++ b/src/pc/configfile.c @@ -143,8 +143,8 @@ bool configUncappedFramerate = true; unsigned int configFrameLimit = 60; unsigned int configDrawDistance = 5; bool configDisablePopups = false; -#if defined(DEVELOPMENT) bool configLuaProfiler = false; +#ifdef DEVELOPMENT bool configCtxProfiler = false; #endif unsigned int configInterpolationMode = 1; @@ -261,8 +261,8 @@ static const struct ConfigOption options[] = { {.name = "coop_stay_in_level_after_star", .type = CONFIG_TYPE_UINT , .uintValue = &configStayInLevelAfterStar}, {.name = "coop_compatibility", .type = CONFIG_TYPE_BOOL , .boolValue = &configCoopCompatibility}, {.name = "disable_popups", .type = CONFIG_TYPE_BOOL , .boolValue = &configDisablePopups}, -#if defined(DEVELOPMENT) {.name = "lua_profiler", .type = CONFIG_TYPE_BOOL , .boolValue = &configLuaProfiler}, +#ifdef DEVELOPMENT {.name = "ctx_profiler", .type = CONFIG_TYPE_BOOL , .boolValue = &configCtxProfiler}, #endif {.name = "interpolation_mode", .type = CONFIG_TYPE_UINT , .uintValue = &configInterpolationMode}, diff --git a/src/pc/configfile.h b/src/pc/configfile.h index c41f3179a..dcb5a0499 100644 --- a/src/pc/configfile.h +++ b/src/pc/configfile.h @@ -102,8 +102,8 @@ extern bool configUncappedFramerate; extern unsigned int configFrameLimit; extern unsigned int configDrawDistance; extern bool configDisablePopups; -#if defined(DEVELOPMENT) extern bool configLuaProfiler; +#ifdef DEVELOPMENT extern bool configCtxProfiler; #endif extern unsigned int configInterpolationMode; diff --git a/src/pc/djui/djui_panel_misc.c b/src/pc/djui/djui_panel_misc.c index aeeeb13a9..b18c315d2 100644 --- a/src/pc/djui/djui_panel_misc.c +++ b/src/pc/djui/djui_panel_misc.c @@ -49,8 +49,10 @@ void djui_panel_misc_create(struct DjuiBase* caller) { { djui_checkbox_create(body, DLANG(MISC, DISABLE_POPUPS), &configDisablePopups, NULL); - djui_checkbox_create(body, DLANG(MISC, COOP_COMPATIBILITY), &configCoopCompatibility, djui_panel_compatibility_checkbox_on_value_change); +#ifndef DEVELOPMENT + djui_checkbox_create(body, DLANG(MISC, LUA_PROFILER), &configLuaProfiler, NULL); +#endif djui_button_create(body, DLANG(MISC, LANGUAGE), DJUI_BUTTON_STYLE_NORMAL, djui_panel_language_create); djui_button_create(body, DLANG(MISC, MENU_OPTIONS), DJUI_BUTTON_STYLE_NORMAL, djui_panel_main_menu_create); diff --git a/src/pc/lua/smlua_hooks.c b/src/pc/lua/smlua_hooks.c index b58f195b6..51354f554 100644 --- a/src/pc/lua/smlua_hooks.c +++ b/src/pc/lua/smlua_hooks.c @@ -98,22 +98,20 @@ int smlua_call_hook(lua_State* L, int nargs, int nresults, int errfunc, struct M struct Mod* prev = gLuaActiveMod; gLuaActiveMod = activeMod; gLuaLastHookMod = activeMod; -#if defined(DEVELOPMENT) + extern bool configLuaProfiler; if (configLuaProfiler) { lua_profiler_start_counter(activeMod); } -#endif CTX_BEGIN(CTX_HOOK); int rc = smlua_pcall(L, nargs, nresults, errfunc); CTX_END(CTX_HOOK); -#if defined(DEVELOPMENT) if (configLuaProfiler) { lua_profiler_stop_counter(activeMod); } -#endif + gLuaActiveMod = prev; return rc; }