diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/mads/game.cpp | 1 | ||||
-rw-r--r-- | engines/mads/game.h | 1 | ||||
-rw-r--r-- | engines/mads/scene.cpp | 4 | ||||
-rw-r--r-- | engines/mads/scene.h | 2 | ||||
-rw-r--r-- | engines/mads/screen.cpp | 13 | ||||
-rw-r--r-- | engines/mads/screen.h | 1 | ||||
-rw-r--r-- | engines/mads/user_interface.cpp | 4 |
7 files changed, 18 insertions, 8 deletions
diff --git a/engines/mads/game.cpp b/engines/mads/game.cpp index 2b42080d35..2736e77ef6 100644 --- a/engines/mads/game.cpp +++ b/engines/mads/game.cpp @@ -60,7 +60,6 @@ Game::Game(MADSEngine *vm): _vm(vm), _surface(nullptr), _objects(vm), _anyEmergency = false; _triggerMode = KERNEL_TRIGGER_PARSER; _triggerSetupMode = KERNEL_TRIGGER_PARSER; - _ticksExpiry = 0; _winStatus = 0; // Load the inventory object list diff --git a/engines/mads/game.h b/engines/mads/game.h index 54aef443a6..f41e7d248c 100644 --- a/engines/mads/game.h +++ b/engines/mads/game.h @@ -138,7 +138,6 @@ public: TriggerMode _triggerSetupMode; uint32 _priorFrameTimer; Common::String _aaName; - uint32 _ticksExpiry; int _winStatus; public: virtual ~Game(); diff --git a/engines/mads/scene.cpp b/engines/mads/scene.cpp index 71e6873de5..d37834ab55 100644 --- a/engines/mads/scene.cpp +++ b/engines/mads/scene.cpp @@ -582,4 +582,8 @@ void Scene::resetScene() { _sequences.clear(); } +void Scene::backgroundAnimation() { + warning("TODO: Scene::backgroundAnimation"); +} + } // End of namespace MADS diff --git a/engines/mads/scene.h b/engines/mads/scene.h index 1caba12851..1b0c9c9388 100644 --- a/engines/mads/scene.h +++ b/engines/mads/scene.h @@ -210,6 +210,8 @@ public: void changeDepthSurface(int arg1); void resetScene(); + + void backgroundAnimation(); }; } // End of namespace MADS diff --git a/engines/mads/screen.cpp b/engines/mads/screen.cpp index 8bb17d30a6..391ba71eeb 100644 --- a/engines/mads/screen.cpp +++ b/engines/mads/screen.cpp @@ -266,6 +266,7 @@ ScreenObjects::ScreenObjects(MADSEngine *vm) : _vm(vm) { _scrollerY = -1; _milliTime = 0; _eventFlag = false; + _baseTime = 0; } void ScreenObjects::add(const Common::Rect &bounds, Layer layer, ScrCategory category, int descId) { @@ -343,7 +344,7 @@ void ScreenObjects::check(bool scanFlag) { scene._action.refresh(); uint32 currentTicks = _vm->_events->getFrameCounter(); - if (currentTicks >= _vm->_game->_ticksExpiry) { + if (currentTicks >= _baseTime) { // Check the user interface slots to see if there's any slots that need to be expired UISlots &uiSlots = userInterface._uiSlots; for (uint idx = 0; idx < uiSlots.size(); ++idx) { @@ -354,12 +355,16 @@ void ScreenObjects::check(bool scanFlag) { slot._slotType = ST_EXPIRED; } + // TODO: The stuff here could probably be moved to Scene::doFrame + // Any background animation + scene.backgroundAnimation(); + // Handle animating the selected inventory animation userInterface.inventoryAnim(); - // Set the next frame expiry - _vm->_game->_ticksExpiry = currentTicks + 6; - } + // Set the base time + _baseTime = currentTicks + 6; + } } int ScreenObjects::scanBackwards(const Common::Point &pt, int layer) { diff --git a/engines/mads/screen.h b/engines/mads/screen.h index c733452aa2..d292a7a7d7 100644 --- a/engines/mads/screen.h +++ b/engines/mads/screen.h @@ -161,6 +161,7 @@ public: int _uiCount; uint32 _milliTime; bool _eventFlag; + uint32 _baseTime; /* * Constructor diff --git a/engines/mads/user_interface.cpp b/engines/mads/user_interface.cpp index d0139e2897..2cd1662077 100644 --- a/engines/mads/user_interface.cpp +++ b/engines/mads/user_interface.cpp @@ -264,7 +264,7 @@ void UserInterface::setup(int id) { scene._userInterface._uiSlots.clear(); scene._userInterface._uiSlots.fullRefresh(); - _vm->_game->_ticksExpiry = _vm->_events->getFrameCounter(); + _vm->_game->_screenObjects._baseTime = _vm->_events->getFrameCounter(); _highlightedCommandIndex = -1; _highlightedActionIndex = -1; _highlightedItemIndex = -1; @@ -590,7 +590,7 @@ void UserInterface::noInventoryAnim() { if (_invSpritesIndex >= 0) { scene._sprites.remove(_invSpritesIndex); - _vm->_game->_ticksExpiry = _vm->_events->getFrameCounter(); + _vm->_game->_screenObjects._baseTime = _vm->_events->getFrameCounter(); _invSpritesIndex = -1; } |