fixed non dev compile

This commit is contained in:
Isaac0-dev 2024-10-22 20:54:11 +10:00
parent a81d8fde26
commit fd99cee674
2 changed files with 17 additions and 13 deletions

View file

@ -59,6 +59,7 @@ bool debug_context_within(enum DebugContext ctx) {
return sCtxDepth[ctx] > 0; return sCtxDepth[ctx] > 0;
} }
#ifdef DEVELOPMENT
void debug_context_set_time(enum DebugContext ctx, f64 time) { void debug_context_set_time(enum DebugContext ctx, f64 time) {
if (ctx >= CTX_MAX) { return; } if (ctx >= CTX_MAX) { return; }
sCtxTime[ctx] = time; sCtxTime[ctx] = time;
@ -68,3 +69,4 @@ f64 debug_context_get_time(enum DebugContext ctx) {
if (ctx >= CTX_MAX) { return 0.0; } if (ctx >= CTX_MAX) { return 0.0; }
return sCtxTime[ctx]; return sCtxTime[ctx];
} }
#endif

View file

@ -38,9 +38,9 @@ struct DjuiCtxDisplay {
struct DjuiCtxDisplay *sCtxDisplay = NULL; struct DjuiCtxDisplay *sCtxDisplay = NULL;
void djui_ctx_display_update(void) { void djui_ctx_display_update(void) {
#ifdef DEVELOPMENT
if (!configCtxProfiler || sCtxDisplay == NULL) { return; } if (!configCtxProfiler || sCtxDisplay == NULL) { return; }
#ifdef DEVELOPMENT
// Time we have for a indivdual frame. If we exceed it. We are in the red. // Time we have for a indivdual frame. If we exceed it. We are in the red.
f64 frameTime = 1.0 / 30.0; f64 frameTime = 1.0 / 30.0;
s32 frameTimeMs = (s32)(frameTime * 1000000.0); s32 frameTimeMs = (s32)(frameTime * 1000000.0);
@ -77,10 +77,12 @@ void djui_ctx_display_update(void) {
} }
void djui_ctx_display_render(void) { void djui_ctx_display_render(void) {
#ifdef DEVELOPMENT
if (!configCtxProfiler || sCtxDisplay == NULL) { return; } if (!configCtxProfiler || sCtxDisplay == NULL) { return; }
djui_rect_render(&sCtxDisplay->base); djui_rect_render(&sCtxDisplay->base);
djui_base_render(&sCtxDisplay->base); djui_base_render(&sCtxDisplay->base);
#endif
} }
void djui_ctx_display_on_destroy(UNUSED struct DjuiBase* base) { void djui_ctx_display_on_destroy(UNUSED struct DjuiBase* base) {