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:
11
lib/game.h
11
lib/game.h
@@ -94,6 +94,17 @@ public:
|
||||
*/
|
||||
virtual bool wants_to_exit() const { return false; }
|
||||
|
||||
/**
|
||||
* @brief Check if game wants continuous frame updates
|
||||
*
|
||||
* Games that need animation or continuous updates (like physics simulations)
|
||||
* can override this to return true. They will receive INPUT_FRAME_TICK events
|
||||
* every frame, even without user input.
|
||||
*
|
||||
* @return true if game needs frame updates, false for event-driven only
|
||||
*/
|
||||
virtual bool wants_frame_updates() const { return false; }
|
||||
|
||||
/**
|
||||
* @brief Get the type of game for safe downcasting without RTTI
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user