Frame Interp: Game Clock Refactor & Ring Item Selection

This commit is contained in:
Irastris
2026-04-17 23:11:54 -04:00
parent 3f6cad3eb4
commit ea18075de8
7 changed files with 156 additions and 16 deletions
+3
View File
@@ -204,6 +204,9 @@ private:
/* 0x6D1 */ u8 field_0x6d1;
/* 0x6D2 */ u8 field_0x6d2;
/* 0x6D3 */ u8 field_0x6d3;
#if TARGET_PC
f32 mSelectItemSlideElapsed[4];
#endif
};
#endif /* D_MENU_D_MENU_RING_H */
+1
View File
@@ -22,6 +22,7 @@ float get_interpolation_step();
void request_presentation_sync();
bool presentation_sync_active();
// TODO: These should be phased out as UI is progressively updated to use game_clock
void set_ui_tick_pending(bool value);
bool get_ui_tick_pending();
+32
View File
@@ -0,0 +1,32 @@
#ifndef DUSK_GAME_CLOCK_H
#define DUSK_GAME_CLOCK_H
#include <stddef.h>
namespace dusk {
namespace game_clock {
void ensure_initialized();
void reset_accumulator();
constexpr float sim_pace() { return 1.0f / 30.0f; }
constexpr float period_for_original_frames(float frame_count) { return frame_count * sim_pace(); }
constexpr float ui_maximum_dt() { return 0.05f; }
constexpr float ui_initial_dt() { return 1.0f / 60.0f; }
struct MainLoopPacer {
float presentation_dt_seconds;
bool is_interpolating;
bool do_sim_tick;
float interpolation_step;
float sim_pace;
};
MainLoopPacer advance_main_loop();
float consume_interval(const void* consumer);
} // namespace game_clock
} // namespace dusk
#endif // DUSK_GAME_CLOCK_H