mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-07-25 00:47:52 +00:00
expand f_push_run_from_... to basing its tab-advance logic on what base column it is starting at - currently assume this is 0, basically doing the most naive tab alignment version that will work for leading spaces but for nothing else, and also assume 4-space tab width for now
This commit is contained in:
@@ -6534,7 +6534,7 @@ DF_VIEW_UI_FUNCTION_DEF(Code)
|
||||
{
|
||||
ui_label(full_path);
|
||||
ui_spacer(ui_em(1.5f, 1));
|
||||
ui_labelf("Line: %I64d, Col: %I64d", tv->cursor.line, tv->cursor.column);
|
||||
ui_labelf("Line: %I64d, Column: %I64d", tv->cursor.line, tv->cursor.column);
|
||||
ui_spacer(ui_pct(1, 0));
|
||||
ui_labelf("(read only)");
|
||||
ui_labelf("%s",
|
||||
@@ -7386,7 +7386,7 @@ DF_VIEW_UI_FUNCTION_DEF(Disassembly)
|
||||
U64 cursor_vaddr = (1 <= dv->cursor.line && dv->cursor.line <= dasm_info.insts.count) ? (dasm_vaddr_range.min+dasm_info.insts.v[dv->cursor.line-1].code_off) : 0;
|
||||
ui_labelf("%S", path_normalized_from_string(scratch.arena, module->name));
|
||||
ui_spacer(ui_em(1.5f, 1));
|
||||
ui_labelf("Address: 0x%I64x, Line: %I64d, Col: %I64d", cursor_vaddr, dv->cursor.line, dv->cursor.column);
|
||||
ui_labelf("Address: 0x%I64x, Line: %I64d, Column: %I64d", cursor_vaddr, dv->cursor.line, dv->cursor.column);
|
||||
ui_spacer(ui_pct(1, 0));
|
||||
ui_labelf("(read only)");
|
||||
ui_labelf("bin");
|
||||
@@ -8180,7 +8180,7 @@ DF_VIEW_UI_FUNCTION_DEF(Output)
|
||||
UI_TextColor(df_rgba_from_theme_color(DF_ThemeColor_WeakText))
|
||||
UI_Font(code_font)
|
||||
{
|
||||
ui_labelf("Line: %I64d, Col: %I64d", tv->cursor.line, tv->cursor.column);
|
||||
ui_labelf("Line: %I64d, Column: %I64d", tv->cursor.line, tv->cursor.column);
|
||||
ui_spacer(ui_pct(1, 0));
|
||||
ui_labelf("(read only)");
|
||||
}
|
||||
|
||||
@@ -568,6 +568,7 @@ internal F_Run
|
||||
f_push_run_from_string(Arena *arena, F_Tag tag, F32 size, F_RunFlags flags, String8 string)
|
||||
{
|
||||
ProfBeginFunction();
|
||||
F32 base_column = 0.f;
|
||||
|
||||
//- rjf: map tag/size to style node
|
||||
F_Hash2StyleRasterCacheNode *hash2style_node = f_hash2style_from_tag_size(tag, size);
|
||||
@@ -788,6 +789,14 @@ f_push_run_from_string(Arena *arena, F_Tag tag, F32 size, F_RunFlags flags, Stri
|
||||
}
|
||||
}
|
||||
|
||||
// rjf: on tabs -> expand advance
|
||||
F32 advance = info->advance;
|
||||
if(is_tab)
|
||||
{
|
||||
F32 tab_width = 4.f;
|
||||
advance *= tab_width - mod_f32(base_column, tab_width);
|
||||
}
|
||||
|
||||
// rjf: push piece
|
||||
{
|
||||
F_Piece *piece = f_piece_chunk_list_push_new(arena, &piece_chunks, string.size);
|
||||
@@ -797,7 +806,7 @@ f_push_run_from_string(Arena *arena, F_Tag tag, F32 size, F_RunFlags flags, Stri
|
||||
info->subrect.y0,
|
||||
info->subrect.x0 + info->raster_dim.x,
|
||||
info->subrect.y0 + info->raster_dim.y);
|
||||
piece->advance = info->advance;
|
||||
piece->advance = advance;
|
||||
piece->decode_size = piece_substring.size;
|
||||
piece->offset = v2s16(0, -hash2style_node->ascent - 4);
|
||||
}
|
||||
|
||||
@@ -125,26 +125,25 @@ r_d3d11_instance_buffer_from_size(U64 size)
|
||||
return buffer;
|
||||
}
|
||||
|
||||
internal
|
||||
void r_res_kind_to_usage(R_ResourceKind kind, D3D11_USAGE* d3d11_usage, UINT* cpu_access_flags)
|
||||
internal void
|
||||
r_usage_access_flags_from_resource_kind(R_ResourceKind kind, D3D11_USAGE *out_d3d11_usage, UINT *out_cpu_access_flags)
|
||||
{
|
||||
//- rjf: kind -> usage * cpu access flags
|
||||
switch(kind)
|
||||
{
|
||||
case R_ResourceKind_Static:
|
||||
{
|
||||
*d3d11_usage = D3D11_USAGE_IMMUTABLE;
|
||||
*cpu_access_flags = 0;
|
||||
*out_d3d11_usage = D3D11_USAGE_IMMUTABLE;
|
||||
*out_cpu_access_flags = 0;
|
||||
}break;
|
||||
case R_ResourceKind_Dynamic:
|
||||
{
|
||||
*d3d11_usage = D3D11_USAGE_DEFAULT;
|
||||
*cpu_access_flags = 0;
|
||||
*out_d3d11_usage = D3D11_USAGE_DEFAULT;
|
||||
*out_cpu_access_flags = 0;
|
||||
}break;
|
||||
case R_ResourceKind_Stream:
|
||||
{
|
||||
*d3d11_usage = D3D11_USAGE_DYNAMIC;
|
||||
*cpu_access_flags = D3D11_CPU_ACCESS_WRITE;
|
||||
*out_d3d11_usage = D3D11_USAGE_DYNAMIC;
|
||||
*out_cpu_access_flags = D3D11_CPU_ACCESS_WRITE;
|
||||
}break;
|
||||
default:
|
||||
{
|
||||
@@ -587,7 +586,7 @@ r_tex2d_alloc(R_ResourceKind kind, Vec2S32 size, R_Tex2DFormat format, void *dat
|
||||
|
||||
D3D11_USAGE d3d11_usage = D3D11_USAGE_DEFAULT;
|
||||
UINT cpu_access_flags = 0;
|
||||
r_res_kind_to_usage(kind, &d3d11_usage, &cpu_access_flags);
|
||||
r_usage_access_flags_from_resource_kind(kind, &d3d11_usage, &cpu_access_flags);
|
||||
if (kind == R_ResourceKind_Static)
|
||||
{
|
||||
Assert(data != 0 && "static texture must have initial data provided");
|
||||
@@ -732,7 +731,7 @@ r_buffer_alloc(R_ResourceKind kind, U64 size, void *data)
|
||||
|
||||
D3D11_USAGE d3d11_usage = D3D11_USAGE_DEFAULT;
|
||||
UINT cpu_access_flags = 0;
|
||||
r_res_kind_to_usage(kind, &d3d11_usage, &cpu_access_flags);
|
||||
r_usage_access_flags_from_resource_kind(kind, &d3d11_usage, &cpu_access_flags);
|
||||
if (kind == R_ResourceKind_Static)
|
||||
{
|
||||
Assert(data != 0 && "static buffer must have initial data provided");
|
||||
|
||||
@@ -173,6 +173,6 @@ internal R_Handle r_d3d11_handle_from_tex2d(R_D3D11_Tex2D *texture);
|
||||
internal R_D3D11_Buffer *r_d3d11_buffer_from_handle(R_Handle handle);
|
||||
internal R_Handle r_d3d11_handle_from_buffer(R_D3D11_Buffer *buffer);
|
||||
internal ID3D11Buffer *r_d3d11_instance_buffer_from_size(U64 size);
|
||||
internal void r_res_kind_to_usage(R_ResourceKind kind, D3D11_USAGE* d3d11_usage, UINT* cpu_access_flags);
|
||||
internal void r_usage_access_flags_from_resource_kind(R_ResourceKind kind, D3D11_USAGE *out_d3d11_usage, UINT *out_cpu_access_flags);
|
||||
|
||||
#endif // RENDER_D3D11_H
|
||||
|
||||
Reference in New Issue
Block a user