mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-06-14 16:12:24 -07:00
eliminate now-unnecessary config writing mechanism
This commit is contained in:
@@ -13,7 +13,7 @@ typedef U64 CTRL_MachineID;
|
||||
#define CTRL_MachineID_Local (1)
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Machine/Handle Pair Types
|
||||
//~ rjf: Entity Handle Types
|
||||
|
||||
typedef struct CTRL_MachineIDHandlePair CTRL_MachineIDHandlePair;
|
||||
struct CTRL_MachineIDHandlePair
|
||||
|
||||
@@ -5370,12 +5370,6 @@ d_cfg_strings_from_core(Arena *arena, String8 root_path, D_CfgSrc source)
|
||||
return strs;
|
||||
}
|
||||
|
||||
internal void
|
||||
d_cfg_push_write_string(D_CfgSrc src, String8 string)
|
||||
{
|
||||
str8_list_push(d_state->cfg_write_arenas[src], &d_state->cfg_write_data[src], push_str8_copy(d_state->cfg_write_arenas[src], string));
|
||||
}
|
||||
|
||||
//- rjf: current path
|
||||
|
||||
internal String8
|
||||
@@ -5814,12 +5808,6 @@ d_init(void)
|
||||
// rjf: set up run state
|
||||
d_state->ctrl_last_run_arena = arena_alloc();
|
||||
|
||||
// rjf: set up config write state
|
||||
for(D_CfgSrc src = (D_CfgSrc)0; src < D_CfgSrc_COUNT; src = (D_CfgSrc)(src+1))
|
||||
{
|
||||
d_state->cfg_write_arenas[src] = arena_alloc();
|
||||
}
|
||||
|
||||
// rjf: set up initial browse path
|
||||
{
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
|
||||
@@ -1027,11 +1027,6 @@ struct D_State
|
||||
Arena *cfg_arena;
|
||||
D_CfgTable cfg_table;
|
||||
|
||||
// rjf: config writing state
|
||||
B32 cfg_write_issued[D_CfgSrc_COUNT];
|
||||
Arena *cfg_write_arenas[D_CfgSrc_COUNT];
|
||||
String8List cfg_write_data[D_CfgSrc_COUNT];
|
||||
|
||||
// rjf: current path
|
||||
Arena *current_path_arena;
|
||||
String8 current_path;
|
||||
@@ -1452,7 +1447,6 @@ internal D_CfgTable *d_cfg_table(void);
|
||||
internal String8 d_cfg_escaped_from_raw_string(Arena *arena, String8 string);
|
||||
internal String8 d_cfg_raw_from_escaped_string(Arena *arena, String8 string);
|
||||
internal String8List d_cfg_strings_from_core(Arena *arena, String8 root_path, D_CfgSrc source);
|
||||
internal void d_cfg_push_write_string(D_CfgSrc src, String8 string);
|
||||
|
||||
//- rjf: current path
|
||||
internal String8 d_current_path(void);
|
||||
|
||||
@@ -9272,8 +9272,6 @@ df_frame(void)
|
||||
break;
|
||||
}
|
||||
}
|
||||
arena_clear(d_state->cfg_write_arenas[src]);
|
||||
MemoryZeroStruct(&d_state->cfg_write_data[src]);
|
||||
String8 path = d_cfg_path_from_src(src);
|
||||
String8List d_strs = d_cfg_strings_from_core(scratch.arena, path, src);
|
||||
String8List df_strs = df_cfg_strings_from_gfx(scratch.arena, path, src);
|
||||
@@ -9284,8 +9282,7 @@ df_frame(void)
|
||||
str8_list_concat_in_place(&strs, &df_strs);
|
||||
String8 data = str8_list_join(scratch.arena, &strs, 0);
|
||||
String8 data_indented = indented_from_string(scratch.arena, data);
|
||||
d_state->cfg_write_issued[src] = 1;
|
||||
d_cfg_push_write_string(src, data_indented);
|
||||
os_write_data_to_file_path(path, data_indented);
|
||||
}break;
|
||||
|
||||
//- rjf: code navigation
|
||||
@@ -12129,24 +12126,6 @@ df_frame(void)
|
||||
df_state->num_frames_requested -= 1;
|
||||
}
|
||||
|
||||
//////////////////////////////
|
||||
//- rjf: write config changes (TODO(rjf): @msgs)
|
||||
//
|
||||
ProfScope("write config changes")
|
||||
{
|
||||
for(D_CfgSrc src = (D_CfgSrc)0; src < D_CfgSrc_COUNT; src = (D_CfgSrc)(src+1)) ProfScope("write %.*s config data", str8_varg(d_cfg_src_string_table[src]))
|
||||
{
|
||||
if(d_state->cfg_write_issued[src])
|
||||
{
|
||||
d_state->cfg_write_issued[src] = 0;
|
||||
String8 path = d_cfg_path_from_src(src);
|
||||
os_write_data_list_to_file_path(path, d_state->cfg_write_data[src]);
|
||||
}
|
||||
arena_clear(d_state->cfg_write_arenas[src]);
|
||||
MemoryZeroStruct(&d_state->cfg_write_data[src]);
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////
|
||||
//- rjf: submit rendering to all windows
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user