Lua Profiler no longer requires DEVELOPMENT=1

This commit is contained in:
Agent X 2023-12-14 19:40:22 -05:00
parent 741d742bab
commit 1d039e6675
5 changed files with 9 additions and 9 deletions

View file

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

View file

@ -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},

View file

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

View file

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

View file

@ -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;
}