mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-07-20 23:46:48 +00:00
df -> dbg_engine and dbg_gfx layers; df (core) -> d
This commit is contained in:
+13
-13
@@ -160,8 +160,8 @@ internal UI_BOX_CUSTOM_DRAW(ui_line_edit_draw)
|
||||
box->rect.y1-2.f,
|
||||
};
|
||||
Rng2F32 select_rect = union_2f32(cursor_rect, mark_rect);
|
||||
d_rect(select_rect, select_color, font_size/2.f, 0, 1.f);
|
||||
d_rect(cursor_rect, cursor_color, 0.f, 0, 1.f);
|
||||
dr_rect(select_rect, select_color, font_size/2.f, 0, 1.f);
|
||||
dr_rect(cursor_rect, cursor_color, 0.f, 0, 1.f);
|
||||
}
|
||||
|
||||
internal UI_Signal
|
||||
@@ -347,12 +347,12 @@ internal UI_BOX_CUSTOM_DRAW(ui_image_draw)
|
||||
UI_ImageDrawData *draw_data = (UI_ImageDrawData *)user_data;
|
||||
if(r_handle_match(draw_data->texture, r_handle_zero()))
|
||||
{
|
||||
R_Rect2DInst *inst = d_rect(box->rect, v4f32(0, 0, 0, 0), 0, 0, 1.f);
|
||||
R_Rect2DInst *inst = dr_rect(box->rect, v4f32(0, 0, 0, 0), 0, 0, 1.f);
|
||||
MemoryCopyArray(inst->corner_radii, box->corner_radii);
|
||||
}
|
||||
else D_Tex2DSampleKindScope(draw_data->sample_kind)
|
||||
else DR_Tex2DSampleKindScope(draw_data->sample_kind)
|
||||
{
|
||||
R_Rect2DInst *inst = d_img(box->rect, draw_data->region, draw_data->texture, draw_data->tint, 0, 0, 0);
|
||||
R_Rect2DInst *inst = dr_img(box->rect, draw_data->region, draw_data->texture, draw_data->tint, 0, 0, 0);
|
||||
MemoryCopyArray(inst->corner_radii, box->corner_radii);
|
||||
}
|
||||
if(draw_data->blur > 0.01f)
|
||||
@@ -365,7 +365,7 @@ internal UI_BOX_CUSTOM_DRAW(ui_image_draw)
|
||||
clip = intersect_2f32(b->rect, clip);
|
||||
}
|
||||
}
|
||||
R_PassParams_Blur *blur = d_blur(intersect_2f32(clip, box->rect), draw_data->blur, 0);
|
||||
R_PassParams_Blur *blur = dr_blur(intersect_2f32(clip, box->rect), draw_data->blur, 0);
|
||||
MemoryCopyArray(blur->corner_radii, box->corner_radii);
|
||||
}
|
||||
}
|
||||
@@ -569,13 +569,13 @@ internal UI_BOX_CUSTOM_DRAW(ui_sat_val_picker_draw)
|
||||
|
||||
// rjf: white -> rgb background
|
||||
{
|
||||
R_Rect2DInst *inst = d_rect(pad_2f32(box->rect, -1.f), v4f32(hue_rgb.x, hue_rgb.y, hue_rgb.z, 1), 4.f, 0, 1.f);
|
||||
R_Rect2DInst *inst = dr_rect(pad_2f32(box->rect, -1.f), v4f32(hue_rgb.x, hue_rgb.y, hue_rgb.z, 1), 4.f, 0, 1.f);
|
||||
inst->colors[Corner_00] = inst->colors[Corner_01] = v4f32(1, 1, 1, 1);
|
||||
}
|
||||
|
||||
// rjf: black gradient overlay
|
||||
{
|
||||
R_Rect2DInst *inst = d_rect(pad_2f32(box->rect, -1.f), v4f32(0, 0, 0, 0), 4.f, 0, 1.f);
|
||||
R_Rect2DInst *inst = dr_rect(pad_2f32(box->rect, -1.f), v4f32(0, 0, 0, 0), 4.f, 0, 1.f);
|
||||
inst->colors[Corner_01] = v4f32(0, 0, 0, 1);
|
||||
inst->colors[Corner_11] = v4f32(0, 0, 0, 1);
|
||||
}
|
||||
@@ -589,7 +589,7 @@ internal UI_BOX_CUSTOM_DRAW(ui_sat_val_picker_draw)
|
||||
center.y - half_size,
|
||||
center.x + half_size,
|
||||
center.y + half_size);
|
||||
d_rect(rect, v4f32(1, 1, 1, 1), half_size/2, 2.f, 1.f);
|
||||
dr_rect(rect, v4f32(1, 1, 1, 1), half_size/2, 2.f, 1.f);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -680,7 +680,7 @@ internal UI_BOX_CUSTOM_DRAW(ui_hue_picker_draw)
|
||||
Vec3F32 rgb1 = rgb_from_hsv(v3f32(hue1, 1, 1));
|
||||
Vec4F32 rgba0 = v4f32(rgb0.x, rgb0.y, rgb0.z, 1);
|
||||
Vec4F32 rgba1 = v4f32(rgb1.x, rgb1.y, rgb1.z, 1);
|
||||
R_Rect2DInst *inst = d_rect(rect, v4f32(0, 0, 0, 0), 0, 0, 0.f);
|
||||
R_Rect2DInst *inst = dr_rect(rect, v4f32(0, 0, 0, 0), 0, 0, 0.f);
|
||||
inst->colors[Corner_00] = rgba0;
|
||||
inst->colors[Corner_01] = rgba1;
|
||||
inst->colors[Corner_10] = rgba0;
|
||||
@@ -698,7 +698,7 @@ internal UI_BOX_CUSTOM_DRAW(ui_hue_picker_draw)
|
||||
center.y - 2.f,
|
||||
center.x + half_size,
|
||||
center.y + 2.f);
|
||||
d_rect(rect, v4f32(1, 1, 1, 1), half_size/2, 2.f, 1.f);
|
||||
dr_rect(rect, v4f32(1, 1, 1, 1), half_size/2, 2.f, 1.f);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -772,7 +772,7 @@ internal UI_BOX_CUSTOM_DRAW(ui_alpha_picker_draw)
|
||||
Vec2F32 center = center_2f32(rect);
|
||||
rect.x0 += (center.x - rect.x0) * 0.3f;
|
||||
rect.x1 += (center.x - rect.x1) * 0.3f;
|
||||
R_Rect2DInst *inst = d_rect(rect, v4f32(0, 0, 0, 0), 0, 0, 0);
|
||||
R_Rect2DInst *inst = dr_rect(rect, v4f32(0, 0, 0, 0), 0, 0, 0);
|
||||
inst->colors[Corner_00] = inst->colors[Corner_10] = v4f32(1, 1, 1, 1);
|
||||
}
|
||||
|
||||
@@ -785,7 +785,7 @@ internal UI_BOX_CUSTOM_DRAW(ui_alpha_picker_draw)
|
||||
center.y - 2.f,
|
||||
center.x + half_size,
|
||||
center.y + 2.f);
|
||||
d_rect(rect, v4f32(1, 1, 1, 1), half_size/2, 2.f, 1.f);
|
||||
dr_rect(rect, v4f32(1, 1, 1, 1), half_size/2, 2.f, 1.f);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+23
-23
@@ -1,8 +1,8 @@
|
||||
// Copyright (c) 2024 Epic Games Tools
|
||||
// Licensed under the MIT license (https://opensource.org/license/mit/)
|
||||
|
||||
#undef RADDBG_LAYER_COLOR
|
||||
#define RADDBG_LAYER_COLOR 0.80f, 0.40f, 0.35f
|
||||
#undef MARKUP_LAYER_COLOR
|
||||
#define MARKUP_LAYER_COLOR 0.80f, 0.40f, 0.35f
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Globals
|
||||
@@ -719,10 +719,10 @@ ui_string_hover_string(Arena *arena)
|
||||
return result;
|
||||
}
|
||||
|
||||
internal D_FancyRunList
|
||||
internal DR_FancyRunList
|
||||
ui_string_hover_runs(Arena *arena)
|
||||
{
|
||||
D_FancyRunList result = d_fancy_run_list_copy(arena, &ui_state->string_hover_fancy_runs);
|
||||
DR_FancyRunList result = dr_fancy_run_list_copy(arena, &ui_state->string_hover_fancy_runs);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1490,7 +1490,7 @@ ui_end_build(void)
|
||||
{
|
||||
arena_clear(ui_state->string_hover_arena);
|
||||
ui_state->string_hover_string = push_str8_copy(ui_state->string_hover_arena, box_display_string);
|
||||
ui_state->string_hover_fancy_runs = d_fancy_run_list_copy(ui_state->string_hover_arena, &b->display_string_runs);
|
||||
ui_state->string_hover_fancy_runs = dr_fancy_run_list_copy(ui_state->string_hover_arena, &b->display_string_runs);
|
||||
ui_state->string_hover_begin_us = os_now_microseconds();
|
||||
}
|
||||
ui_state->string_hover_build_index = ui_state->build_index;
|
||||
@@ -2366,9 +2366,9 @@ ui_box_equip_display_string(UI_Box *box, String8 string)
|
||||
if(box->flags & UI_BoxFlag_DrawText && (box->fastpath_codepoint == 0 || !(box->flags & UI_BoxFlag_DrawTextFastpathCodepoint)))
|
||||
{
|
||||
String8 display_string = ui_box_display_string(box);
|
||||
D_FancyStringNode fancy_string_n = {0, {box->font, display_string, box->palette->colors[text_color_code], box->font_size, 0, 0}};
|
||||
D_FancyStringList fancy_strings = {&fancy_string_n, &fancy_string_n, 1};
|
||||
box->display_string_runs = d_fancy_run_list_from_fancy_string_list(ui_build_arena(), box->tab_size, box->text_raster_flags, &fancy_strings);
|
||||
DR_FancyStringNode fancy_string_n = {0, {box->font, display_string, box->palette->colors[text_color_code], box->font_size, 0, 0}};
|
||||
DR_FancyStringList fancy_strings = {&fancy_string_n, &fancy_string_n, 1};
|
||||
box->display_string_runs = dr_fancy_run_list_from_fancy_string_list(ui_build_arena(), box->tab_size, box->text_raster_flags, &fancy_strings);
|
||||
}
|
||||
else if(box->flags & UI_BoxFlag_DrawText && box->flags & UI_BoxFlag_DrawTextFastpathCodepoint && box->fastpath_codepoint != 0)
|
||||
{
|
||||
@@ -2379,17 +2379,17 @@ ui_box_equip_display_string(UI_Box *box, String8 string)
|
||||
U64 fpcp_pos = str8_find_needle(display_string, 0, fpcp, StringMatchFlag_CaseInsensitive);
|
||||
if(fpcp_pos < display_string.size)
|
||||
{
|
||||
D_FancyStringNode pst_fancy_string_n = {0, {box->font, str8_skip(display_string, fpcp_pos+fpcp.size), box->palette->colors[text_color_code], box->font_size, 0, 0}};
|
||||
D_FancyStringNode cdp_fancy_string_n = {&pst_fancy_string_n, {box->font, str8_substr(display_string, r1u64(fpcp_pos, fpcp_pos+fpcp.size)), box->palette->colors[text_color_code], box->font_size, 3.f, 0}};
|
||||
D_FancyStringNode pre_fancy_string_n = {&cdp_fancy_string_n, {box->font, str8_prefix(display_string, fpcp_pos), box->palette->colors[text_color_code], box->font_size, 0, 0}};
|
||||
D_FancyStringList fancy_strings = {&pre_fancy_string_n, &pst_fancy_string_n, 3};
|
||||
box->display_string_runs = d_fancy_run_list_from_fancy_string_list(ui_build_arena(), box->tab_size, box->text_raster_flags, &fancy_strings);
|
||||
DR_FancyStringNode pst_fancy_string_n = {0, {box->font, str8_skip(display_string, fpcp_pos+fpcp.size), box->palette->colors[text_color_code], box->font_size, 0, 0}};
|
||||
DR_FancyStringNode cdp_fancy_string_n = {&pst_fancy_string_n, {box->font, str8_substr(display_string, r1u64(fpcp_pos, fpcp_pos+fpcp.size)), box->palette->colors[text_color_code], box->font_size, 3.f, 0}};
|
||||
DR_FancyStringNode pre_fancy_string_n = {&cdp_fancy_string_n, {box->font, str8_prefix(display_string, fpcp_pos), box->palette->colors[text_color_code], box->font_size, 0, 0}};
|
||||
DR_FancyStringList fancy_strings = {&pre_fancy_string_n, &pst_fancy_string_n, 3};
|
||||
box->display_string_runs = dr_fancy_run_list_from_fancy_string_list(ui_build_arena(), box->tab_size, box->text_raster_flags, &fancy_strings);
|
||||
}
|
||||
else
|
||||
{
|
||||
D_FancyStringNode fancy_string_n = {0, {box->font, display_string, box->palette->colors[UI_ColorCode_Text], box->font_size, 0, 0}};
|
||||
D_FancyStringList fancy_strings = {&fancy_string_n, &fancy_string_n, 1};
|
||||
box->display_string_runs = d_fancy_run_list_from_fancy_string_list(ui_build_arena(), box->tab_size, box->text_raster_flags, &fancy_strings);
|
||||
DR_FancyStringNode fancy_string_n = {0, {box->font, display_string, box->palette->colors[UI_ColorCode_Text], box->font_size, 0, 0}};
|
||||
DR_FancyStringList fancy_strings = {&fancy_string_n, &fancy_string_n, 1};
|
||||
box->display_string_runs = dr_fancy_run_list_from_fancy_string_list(ui_build_arena(), box->tab_size, box->text_raster_flags, &fancy_strings);
|
||||
}
|
||||
scratch_end(scratch);
|
||||
}
|
||||
@@ -2397,19 +2397,19 @@ ui_box_equip_display_string(UI_Box *box, String8 string)
|
||||
}
|
||||
|
||||
internal void
|
||||
ui_box_equip_display_fancy_strings(UI_Box *box, D_FancyStringList *strings)
|
||||
ui_box_equip_display_fancy_strings(UI_Box *box, DR_FancyStringList *strings)
|
||||
{
|
||||
box->flags |= UI_BoxFlag_HasDisplayString;
|
||||
box->string = d_string_from_fancy_string_list(ui_build_arena(), strings);
|
||||
box->display_string_runs = d_fancy_run_list_from_fancy_string_list(ui_build_arena(), box->tab_size, box->text_raster_flags, strings);
|
||||
box->string = dr_string_from_fancy_string_list(ui_build_arena(), strings);
|
||||
box->display_string_runs = dr_fancy_run_list_from_fancy_string_list(ui_build_arena(), box->tab_size, box->text_raster_flags, strings);
|
||||
}
|
||||
|
||||
internal inline void
|
||||
ui_box_equip_display_string_fancy_runs(UI_Box *box, String8 string, D_FancyRunList *runs)
|
||||
ui_box_equip_display_string_fancy_runs(UI_Box *box, String8 string, DR_FancyRunList *runs)
|
||||
{
|
||||
box->flags |= UI_BoxFlag_HasDisplayString;
|
||||
box->string = push_str8_copy(ui_build_arena(), string);
|
||||
box->display_string_runs = d_fancy_run_list_copy(ui_build_arena(), runs);
|
||||
box->display_string_runs = dr_fancy_run_list_copy(ui_build_arena(), runs);
|
||||
}
|
||||
|
||||
internal inline void
|
||||
@@ -2420,12 +2420,12 @@ ui_box_equip_fuzzy_match_ranges(UI_Box *box, FuzzyMatchRangeList *matches)
|
||||
}
|
||||
|
||||
internal void
|
||||
ui_box_equip_draw_bucket(UI_Box *box, D_Bucket *bucket)
|
||||
ui_box_equip_draw_bucket(UI_Box *box, DR_Bucket *bucket)
|
||||
{
|
||||
box->flags |= UI_BoxFlag_DrawBucket;
|
||||
if(box->draw_bucket != 0)
|
||||
{
|
||||
D_BucketScope(box->draw_bucket) d_sub_bucket(bucket);
|
||||
D_BucketScope(box->draw_bucket) dr_sub_bucket(bucket);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
+7
-7
@@ -418,7 +418,7 @@ struct UI_Box
|
||||
OS_Cursor hover_cursor;
|
||||
U32 fastpath_codepoint;
|
||||
UI_Key group_key;
|
||||
D_Bucket *draw_bucket;
|
||||
DR_Bucket *draw_bucket;
|
||||
UI_BoxCustomDrawFunctionType *custom_draw;
|
||||
void *custom_draw_user_data;
|
||||
UI_Palette *palette;
|
||||
@@ -433,7 +433,7 @@ struct UI_Box
|
||||
F32 text_padding;
|
||||
|
||||
//- rjf: per-build artifacts
|
||||
D_FancyRunList display_string_runs;
|
||||
DR_FancyRunList display_string_runs;
|
||||
Rng2F32 rect;
|
||||
Vec2F32 fixed_position_animated;
|
||||
Vec2F32 position_delta;
|
||||
@@ -636,7 +636,7 @@ struct UI_State
|
||||
String8 drag_state_data;
|
||||
Arena *string_hover_arena;
|
||||
String8 string_hover_string;
|
||||
D_FancyRunList string_hover_fancy_runs;
|
||||
DR_FancyRunList string_hover_fancy_runs;
|
||||
U64 string_hover_begin_us;
|
||||
U64 string_hover_build_index;
|
||||
U64 last_time_mousemoved_us;
|
||||
@@ -769,7 +769,7 @@ internal String8 ui_get_drag_data(U64 min_required_size);
|
||||
|
||||
//- rjf: hovered string info
|
||||
internal B32 ui_string_hover_active(void);
|
||||
internal D_FancyRunList ui_string_hover_runs(Arena *arena);
|
||||
internal DR_FancyRunList ui_string_hover_runs(Arena *arena);
|
||||
|
||||
//- rjf: interaction keys
|
||||
internal UI_Key ui_hot_key(void);
|
||||
@@ -836,10 +836,10 @@ internal UI_Box * ui_build_box_from_stringf(UI_BoxFlags flags, char *fm
|
||||
|
||||
//- rjf: box node equipment
|
||||
internal inline void ui_box_equip_display_string(UI_Box *box, String8 string);
|
||||
internal inline void ui_box_equip_display_fancy_strings(UI_Box *box, D_FancyStringList *strings);
|
||||
internal inline void ui_box_equip_display_string_fancy_runs(UI_Box *box, String8 string, D_FancyRunList *runs);
|
||||
internal inline void ui_box_equip_display_fancy_strings(UI_Box *box, DR_FancyStringList *strings);
|
||||
internal inline void ui_box_equip_display_string_fancy_runs(UI_Box *box, String8 string, DR_FancyRunList *runs);
|
||||
internal inline void ui_box_equip_fuzzy_match_ranges(UI_Box *box, FuzzyMatchRangeList *matches);
|
||||
internal inline void ui_box_equip_draw_bucket(UI_Box *box, D_Bucket *bucket);
|
||||
internal inline void ui_box_equip_draw_bucket(UI_Box *box, DR_Bucket *bucket);
|
||||
internal inline void ui_box_equip_custom_draw(UI_Box *box, UI_BoxCustomDrawFunctionType *custom_draw, void *user_data);
|
||||
|
||||
//- rjf: box accessors / queries
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
// Copyright (c) 2024 Epic Games Tools
|
||||
// Licensed under the MIT license (https://opensource.org/license/mit/)
|
||||
|
||||
#undef RADDBG_LAYER_COLOR
|
||||
#define RADDBG_LAYER_COLOR 0.70f, 0.30f, 0.15f
|
||||
#undef MARKUP_LAYER_COLOR
|
||||
#define MARKUP_LAYER_COLOR 0.70f, 0.30f, 0.15f
|
||||
|
||||
#include "ui_core.c"
|
||||
#include "ui_basic_widgets.c"
|
||||
|
||||
Reference in New Issue
Block a user