mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-04 21:08:40 +00:00
always-refresh dev option
This commit is contained in:
@@ -65,6 +65,7 @@ D_CmdTable: // | | | |
|
|||||||
@table(name)
|
@table(name)
|
||||||
D_DevToggleTable:
|
D_DevToggleTable:
|
||||||
{
|
{
|
||||||
|
{always_refresh}
|
||||||
{simulate_lag}
|
{simulate_lag}
|
||||||
{draw_ui_text_pos}
|
{draw_ui_text_pos}
|
||||||
{draw_ui_focus_debug}
|
{draw_ui_focus_debug}
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ D_CmdKind_Attach,
|
|||||||
D_CmdKind_COUNT,
|
D_CmdKind_COUNT,
|
||||||
} D_CmdKind;
|
} D_CmdKind;
|
||||||
|
|
||||||
|
global B32 DEV_always_refresh = 0;
|
||||||
global B32 DEV_simulate_lag = 0;
|
global B32 DEV_simulate_lag = 0;
|
||||||
global B32 DEV_draw_ui_text_pos = 0;
|
global B32 DEV_draw_ui_text_pos = 0;
|
||||||
global B32 DEV_draw_ui_focus_debug = 0;
|
global B32 DEV_draw_ui_focus_debug = 0;
|
||||||
@@ -54,6 +55,7 @@ global B32 DEV_cmd_context_tooltips = 0;
|
|||||||
global B32 DEV_updating_indicator = 0;
|
global B32 DEV_updating_indicator = 0;
|
||||||
struct {B32 *value_ptr; String8 name;} DEV_toggle_table[] =
|
struct {B32 *value_ptr; String8 name;} DEV_toggle_table[] =
|
||||||
{
|
{
|
||||||
|
{&DEV_always_refresh, str8_lit_comp("always_refresh")},
|
||||||
{&DEV_simulate_lag, str8_lit_comp("simulate_lag")},
|
{&DEV_simulate_lag, str8_lit_comp("simulate_lag")},
|
||||||
{&DEV_draw_ui_text_pos, str8_lit_comp("draw_ui_text_pos")},
|
{&DEV_draw_ui_text_pos, str8_lit_comp("draw_ui_text_pos")},
|
||||||
{&DEV_draw_ui_focus_debug, str8_lit_comp("draw_ui_focus_debug")},
|
{&DEV_draw_ui_focus_debug, str8_lit_comp("draw_ui_focus_debug")},
|
||||||
|
|||||||
@@ -2324,7 +2324,7 @@ dw_read_line_file(String8 data,
|
|||||||
DW_LNCT lnct = enc_arr[enc_idx*2 + 0];
|
DW_LNCT lnct = enc_arr[enc_idx*2 + 0];
|
||||||
DW_FormKind form_kind = enc_arr[enc_idx*2 + 1];
|
DW_FormKind form_kind = enc_arr[enc_idx*2 + 1];
|
||||||
DW_Form form = {0};
|
DW_Form form = {0};
|
||||||
U64 bytes_read;
|
U64 bytes_read = 0;
|
||||||
switch (lnct) {
|
switch (lnct) {
|
||||||
case DW_LNCT_Path: {
|
case DW_LNCT_Path: {
|
||||||
bytes_read = dw_read_form(data, cursor, version, format, address_size, form_kind, max_U64, &form);
|
bytes_read = dw_read_form(data, cursor, version, format, address_size, form_kind, max_U64, &form);
|
||||||
|
|||||||
@@ -11294,7 +11294,7 @@ rd_frame(void)
|
|||||||
OS_EventList events = {0};
|
OS_EventList events = {0};
|
||||||
if(rd_state->frame_depth == 1)
|
if(rd_state->frame_depth == 1)
|
||||||
{
|
{
|
||||||
events = os_get_events(scratch.arena, rd_state->num_frames_requested == 0);
|
events = os_get_events(scratch.arena, rd_state->num_frames_requested == 0 && !DEV_always_refresh);
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////
|
//////////////////////////////
|
||||||
@@ -11333,7 +11333,7 @@ rd_frame(void)
|
|||||||
F32 target_hz = os_get_gfx_info()->default_refresh_rate;
|
F32 target_hz = os_get_gfx_info()->default_refresh_rate;
|
||||||
if(rd_state->frame_index > 32)
|
if(rd_state->frame_index > 32)
|
||||||
{
|
{
|
||||||
F32 possible_alternate_hz_targets[] = {target_hz, 60.f, 120.f, 144.f, 240.f};
|
F32 possible_alternate_hz_targets[] = {target_hz, 60.f, 75.f, 120.f, 144.f, 165.f, 240.f, 360.f};
|
||||||
F32 best_target_hz = target_hz;
|
F32 best_target_hz = target_hz;
|
||||||
S64 best_target_hz_frame_time_us_diff = max_S64;
|
S64 best_target_hz_frame_time_us_diff = max_S64;
|
||||||
for(U64 idx = 0; idx < ArrayCount(possible_alternate_hz_targets); idx += 1)
|
for(U64 idx = 0; idx < ArrayCount(possible_alternate_hz_targets); idx += 1)
|
||||||
|
|||||||
Reference in New Issue
Block a user