Add frame tick system for continuous animation
- Added INPUT_FRAME_TICK event type to input_event.h - Added wants_frame_updates() virtual method to Game base class - Implemented frame tick logic in main loop (basic1.cpp and emulator/main.cpp) - Added Lua bindings: game.set_frame_updates(bool) and INPUT.FRAME_TICK - Updated LuaGame to support frame updates via registry flag - Updated ball.lua to use continuous frame updates for smooth animation - Both hardware and emulator now support continuous animation for physics/games
This commit is contained in:
@@ -520,6 +520,14 @@ int main()
|
||||
}
|
||||
needs_refresh = true;
|
||||
}
|
||||
} else if (launcher.is_game_selected()) {
|
||||
// No input, but check if game wants continuous updates
|
||||
current_game = launcher.get_selected_game();
|
||||
if (current_game->wants_frame_updates()) {
|
||||
// Send frame tick event for animation/physics updates
|
||||
InputEvent frame_tick = {INPUT_FRAME_TICK, 0, 0, 0, 0, 0, true};
|
||||
needs_refresh = current_game->update(frame_tick);
|
||||
}
|
||||
}
|
||||
|
||||
// 4. Redraw and queue async refresh on Core 1
|
||||
|
||||
Reference in New Issue
Block a user