From 38acce33fd95171a5d3a7a00cad57bb4a5711bad Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 17 Aug 2014 22:09:03 -0400 Subject: ACCESS: Add updateTimers so bubble boxes can be removed --- engines/access/bubble_box.cpp | 4 ++-- engines/access/data.cpp | 12 ++++++++++++ engines/access/data.h | 5 +++++ engines/access/events.cpp | 1 + 4 files changed, 20 insertions(+), 2 deletions(-) (limited to 'engines/access') diff --git a/engines/access/bubble_box.cpp b/engines/access/bubble_box.cpp index 5a17b3b1a3..6ea7ed8a0b 100644 --- a/engines/access/bubble_box.cpp +++ b/engines/access/bubble_box.cpp @@ -198,9 +198,9 @@ void BubbleBox::doBox(int item, int box) { delete[] iconData; // Set the up boundaries and color to use for the box background - _vm->_screen->_orgX1 = _bounds.left; + _vm->_screen->_orgX1 = _bounds.left - 2; _vm->_screen->_orgY1 = _bounds.top; - _vm->_screen->_orgX2 = _bounds.right; + _vm->_screen->_orgX2 = _bounds.right - 2; _vm->_screen->_orgY2 = _bounds.bottom; _vm->_screen->_lColor = 1; diff --git a/engines/access/data.cpp b/engines/access/data.cpp index 90f712af3b..124bfbca5a 100644 --- a/engines/access/data.cpp +++ b/engines/access/data.cpp @@ -46,6 +46,18 @@ void TimerList::restoreTimers() { } } +void TimerList::updateTimers() { + for (uint i = 0; i < size(); ++i) { + TimerEntry &te = (*this)[i]; + if (te._flag) { + if (!--te._timer) { + te._timer = te._initTm; + te._flag = false; + } + } + } +} + /*------------------------------------------------------------------------*/ byte Font::_fontColors[4]; diff --git a/engines/access/data.h b/engines/access/data.h index 7ddc5d610e..8ba3c58c82 100644 --- a/engines/access/data.h +++ b/engines/access/data.h @@ -68,6 +68,11 @@ public: * Resetore the set of previously saved timers */ void restoreTimers(); + + /** + * Update the timer list + */ + void updateTimers(); }; class ExtraCell { diff --git a/engines/access/events.cpp b/engines/access/events.cpp index 71ed5f433e..25a77f82de 100644 --- a/engines/access/events.cpp +++ b/engines/access/events.cpp @@ -175,6 +175,7 @@ bool EventsManager::checkForNextFrameCounter() { void EventsManager::nextFrame() { // Update timers _vm->_animation->updateTimers(); + _vm->_timers.updateTimers(); // Give time to the debugger _vm->_debugger->onFrame(); -- cgit v1.2.3