mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2024-11-28 23:13:02 +00:00
Lua Profiler no longer requires DEVELOPMENT=1
This commit is contained in:
parent
741d742bab
commit
1d039e6675
5 changed files with 9 additions and 9 deletions
|
@ -675,12 +675,12 @@ void render_hud(void) {
|
||||||
render_hud_timer();
|
render_hud_timer();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(DEVELOPMENT)
|
|
||||||
extern bool configLuaProfiler;
|
extern bool configLuaProfiler;
|
||||||
if (configLuaProfiler) {
|
if (configLuaProfiler) {
|
||||||
extern void lua_profiler_update_counters();
|
extern void lua_profiler_update_counters();
|
||||||
lua_profiler_update_counters();
|
lua_profiler_update_counters();
|
||||||
}
|
}
|
||||||
|
#ifdef DEVELOPMENT
|
||||||
extern bool configCtxProfiler;
|
extern bool configCtxProfiler;
|
||||||
if (configCtxProfiler) {
|
if (configCtxProfiler) {
|
||||||
extern void ctx_profiler_update_counters();
|
extern void ctx_profiler_update_counters();
|
||||||
|
|
|
@ -143,8 +143,8 @@ bool configUncappedFramerate = true;
|
||||||
unsigned int configFrameLimit = 60;
|
unsigned int configFrameLimit = 60;
|
||||||
unsigned int configDrawDistance = 5;
|
unsigned int configDrawDistance = 5;
|
||||||
bool configDisablePopups = false;
|
bool configDisablePopups = false;
|
||||||
#if defined(DEVELOPMENT)
|
|
||||||
bool configLuaProfiler = false;
|
bool configLuaProfiler = false;
|
||||||
|
#ifdef DEVELOPMENT
|
||||||
bool configCtxProfiler = false;
|
bool configCtxProfiler = false;
|
||||||
#endif
|
#endif
|
||||||
unsigned int configInterpolationMode = 1;
|
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_stay_in_level_after_star", .type = CONFIG_TYPE_UINT , .uintValue = &configStayInLevelAfterStar},
|
||||||
{.name = "coop_compatibility", .type = CONFIG_TYPE_BOOL , .boolValue = &configCoopCompatibility},
|
{.name = "coop_compatibility", .type = CONFIG_TYPE_BOOL , .boolValue = &configCoopCompatibility},
|
||||||
{.name = "disable_popups", .type = CONFIG_TYPE_BOOL , .boolValue = &configDisablePopups},
|
{.name = "disable_popups", .type = CONFIG_TYPE_BOOL , .boolValue = &configDisablePopups},
|
||||||
#if defined(DEVELOPMENT)
|
|
||||||
{.name = "lua_profiler", .type = CONFIG_TYPE_BOOL , .boolValue = &configLuaProfiler},
|
{.name = "lua_profiler", .type = CONFIG_TYPE_BOOL , .boolValue = &configLuaProfiler},
|
||||||
|
#ifdef DEVELOPMENT
|
||||||
{.name = "ctx_profiler", .type = CONFIG_TYPE_BOOL , .boolValue = &configCtxProfiler},
|
{.name = "ctx_profiler", .type = CONFIG_TYPE_BOOL , .boolValue = &configCtxProfiler},
|
||||||
#endif
|
#endif
|
||||||
{.name = "interpolation_mode", .type = CONFIG_TYPE_UINT , .uintValue = &configInterpolationMode},
|
{.name = "interpolation_mode", .type = CONFIG_TYPE_UINT , .uintValue = &configInterpolationMode},
|
||||||
|
|
|
@ -102,8 +102,8 @@ extern bool configUncappedFramerate;
|
||||||
extern unsigned int configFrameLimit;
|
extern unsigned int configFrameLimit;
|
||||||
extern unsigned int configDrawDistance;
|
extern unsigned int configDrawDistance;
|
||||||
extern bool configDisablePopups;
|
extern bool configDisablePopups;
|
||||||
#if defined(DEVELOPMENT)
|
|
||||||
extern bool configLuaProfiler;
|
extern bool configLuaProfiler;
|
||||||
|
#ifdef DEVELOPMENT
|
||||||
extern bool configCtxProfiler;
|
extern bool configCtxProfiler;
|
||||||
#endif
|
#endif
|
||||||
extern unsigned int configInterpolationMode;
|
extern unsigned int configInterpolationMode;
|
||||||
|
|
|
@ -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, DISABLE_POPUPS), &configDisablePopups, NULL);
|
||||||
|
|
||||||
djui_checkbox_create(body, DLANG(MISC, COOP_COMPATIBILITY), &configCoopCompatibility, djui_panel_compatibility_checkbox_on_value_change);
|
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, 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);
|
djui_button_create(body, DLANG(MISC, MENU_OPTIONS), DJUI_BUTTON_STYLE_NORMAL, djui_panel_main_menu_create);
|
||||||
|
|
|
@ -98,22 +98,20 @@ int smlua_call_hook(lua_State* L, int nargs, int nresults, int errfunc, struct M
|
||||||
struct Mod* prev = gLuaActiveMod;
|
struct Mod* prev = gLuaActiveMod;
|
||||||
gLuaActiveMod = activeMod;
|
gLuaActiveMod = activeMod;
|
||||||
gLuaLastHookMod = activeMod;
|
gLuaLastHookMod = activeMod;
|
||||||
#if defined(DEVELOPMENT)
|
|
||||||
extern bool configLuaProfiler;
|
extern bool configLuaProfiler;
|
||||||
if (configLuaProfiler) {
|
if (configLuaProfiler) {
|
||||||
lua_profiler_start_counter(activeMod);
|
lua_profiler_start_counter(activeMod);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
CTX_BEGIN(CTX_HOOK);
|
CTX_BEGIN(CTX_HOOK);
|
||||||
int rc = smlua_pcall(L, nargs, nresults, errfunc);
|
int rc = smlua_pcall(L, nargs, nresults, errfunc);
|
||||||
CTX_END(CTX_HOOK);
|
CTX_END(CTX_HOOK);
|
||||||
|
|
||||||
#if defined(DEVELOPMENT)
|
|
||||||
if (configLuaProfiler) {
|
if (configLuaProfiler) {
|
||||||
lua_profiler_stop_counter(activeMod);
|
lua_profiler_stop_counter(activeMod);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
gLuaActiveMod = prev;
|
gLuaActiveMod = prev;
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue