mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-06-19 22:33:04 -04:00
Frame Interp: UI Pacing Simplification
This commit is contained in:
@@ -64,11 +64,9 @@ bool g_enabled = false;
|
||||
bool g_recording = false;
|
||||
bool g_interpolating = false;
|
||||
bool g_sync_presentation = false;
|
||||
uint32_t g_presentation_counter = 0;
|
||||
|
||||
float g_step = 0.0f;
|
||||
uint32_t g_pending_presentation_ui_ticks = 0;
|
||||
uint32_t g_current_presentation_ui_ticks = 0;
|
||||
bool g_ui_tick_pending = false;
|
||||
|
||||
Recording g_current_recording;
|
||||
Recording g_previous_recording;
|
||||
@@ -371,11 +369,6 @@ void interpolate(float step) {
|
||||
interpolate_branch(old_root, g_current_recording.root, g_step);
|
||||
}
|
||||
|
||||
void notify_presentation_frame() {
|
||||
ensure_initialized();
|
||||
++g_presentation_counter;
|
||||
}
|
||||
|
||||
void request_presentation_sync() {
|
||||
ensure_initialized();
|
||||
if (!g_enabled) {
|
||||
@@ -396,33 +389,14 @@ float get_interpolation_step() {
|
||||
return presentation_sync_active() ? 1.0f : g_step;
|
||||
}
|
||||
|
||||
void notify_sim_tick_complete() {
|
||||
void set_ui_tick_pending(bool value) {
|
||||
if (g_ui_tick_pending == value) { return; }
|
||||
g_ui_tick_pending = value;
|
||||
}
|
||||
|
||||
bool get_ui_tick_pending() {
|
||||
ensure_initialized();
|
||||
g_pending_presentation_ui_ticks++;
|
||||
}
|
||||
|
||||
uint32_t begin_presentation_ui_pass() {
|
||||
ensure_initialized();
|
||||
g_current_presentation_ui_ticks = g_pending_presentation_ui_ticks;
|
||||
g_pending_presentation_ui_ticks = 0;
|
||||
return g_current_presentation_ui_ticks;
|
||||
}
|
||||
|
||||
uint32_t get_presentation_ui_advance_ticks() {
|
||||
if (!s_initialized) {
|
||||
return 0;
|
||||
}
|
||||
if (!g_enabled) {
|
||||
return 1;
|
||||
}
|
||||
return g_current_presentation_ui_ticks;
|
||||
}
|
||||
|
||||
void end_presentation_ui_pass() {
|
||||
if (!s_initialized) {
|
||||
return;
|
||||
}
|
||||
g_current_presentation_ui_ticks = 0;
|
||||
return g_enabled ? g_ui_tick_pending : true;
|
||||
}
|
||||
|
||||
void open_child(const void* key, int32_t id) {
|
||||
|
||||
Reference in New Issue
Block a user