mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-06-28 01:52:06 +08:00
mici ui replay: fix indeterminism with swiping and animations (#37110)
* fix: get_time and get_frame_time determinism * remove some hackiness * don't need that
This commit is contained in:
@@ -90,8 +90,11 @@ def run_replay():
|
||||
main_layout = MiciMainLayout()
|
||||
main_layout.set_rect(rl.Rectangle(0, 0, gui_app.width, gui_app.height))
|
||||
|
||||
frame = 0
|
||||
script_index = 0
|
||||
frame = 0
|
||||
# Override raylib timing functions to return deterministic values based on frame count instead of real time
|
||||
rl.get_frame_time = lambda: 1.0 / FPS
|
||||
rl.get_time = lambda: frame / FPS
|
||||
|
||||
for should_render in gui_app.render():
|
||||
while script_index < len(SCRIPT) and SCRIPT[script_index][0] == frame:
|
||||
|
||||
Reference in New Issue
Block a user