debug console different size when minimized
This commit is contained in:
parent
d48706d1f7
commit
751472eb86
14
src/user.c
14
src/user.c
@ -485,11 +485,11 @@ INTERNAL LOG_EVENT_CALLBACK_FUNC_DEF(debug_console_log_callback, log)
|
|||||||
sys_mutex_unlock(&lock);
|
sys_mutex_unlock(&lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
INTERNAL void draw_debug_console(b32 minimized)
|
INTERNAL void draw_debug_console(i32 level, b32 minimized)
|
||||||
{
|
{
|
||||||
struct temp_arena scratch = scratch_begin_no_conflict();
|
struct temp_arena scratch = scratch_begin_no_conflict();
|
||||||
|
|
||||||
struct v2 desired_start_pos = V2(10, 400);
|
struct v2 desired_start_pos = V2(10, minimized ? 100 : 600);
|
||||||
i64 fade_time_ns = NS_FROM_SECONDS(10);
|
i64 fade_time_ns = NS_FROM_SECONDS(10);
|
||||||
f32 fade_curve = 0.5;
|
f32 fade_curve = 0.5;
|
||||||
f32 spacing = 0;
|
f32 spacing = 0;
|
||||||
@ -520,6 +520,7 @@ INTERNAL void draw_debug_console(b32 minimized)
|
|||||||
opacity *= math_pow(lin, fade_curve);
|
opacity *= math_pow(lin, fade_curve);
|
||||||
}
|
}
|
||||||
if (draw_pos.y > -desired_start_pos.y && opacity > 0) {
|
if (draw_pos.y > -desired_start_pos.y && opacity > 0) {
|
||||||
|
if (log->level <= level) {
|
||||||
/* Draw background */
|
/* Draw background */
|
||||||
u32 color_index = log->index & 1; /* Alternate colors for greater distinction between logs */
|
u32 color_index = log->index & 1; /* Alternate colors for greater distinction between logs */
|
||||||
u32 color = info_colors[color_index];
|
u32 color = info_colors[color_index];
|
||||||
@ -546,6 +547,7 @@ INTERNAL void draw_debug_console(b32 minimized)
|
|||||||
|
|
||||||
bounds_top = min_f32(bounds_top, draw_bounds.y);
|
bounds_top = min_f32(bounds_top, draw_bounds.y);
|
||||||
bounds_bottom = max_f32(bounds_bottom, draw_bounds.y + draw_bounds.height);
|
bounds_bottom = max_f32(bounds_bottom, draw_bounds.y + draw_bounds.height);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -2006,13 +2008,17 @@ INTERNAL void user_update(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
#if DEVELOPER
|
#if DEVELOPER
|
||||||
draw_debug_console(!G.debug_draw);
|
b32 console_minimized = !G.debug_draw;
|
||||||
|
i32 console_level = LOG_LEVEL_DEBUG;
|
||||||
|
draw_debug_console(console_level, console_minimized);
|
||||||
#else
|
#else
|
||||||
if (G.debug_draw) {
|
if (G.debug_draw) {
|
||||||
draw_debug_console(false);
|
draw_debug_console(LOG_LEVEL_INFO, false);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
/* ========================== *
|
/* ========================== *
|
||||||
* Render
|
* Render
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user