[Scummvm-cvs-logs] SF.net SVN: scummvm:[48460] scummvm/trunk/engines/draci
spalek at users.sourceforge.net
spalek at users.sourceforge.net
Fri Apr 2 00:01:40 CEST 2010
Revision: 48460
http://scummvm.svn.sourceforge.net/scummvm/?rev=48460&view=rev
Author: spalek
Date: 2010-04-01 22:01:40 +0000 (Thu, 01 Apr 2010)
Log Message:
-----------
Dragon History: fixing properly bug 2976774
The previous bugfix just hid the problem by removing an assert, but it might demonstrate
itself in another way later. This is a proper bugfix.
Modified Paths:
--------------
scummvm/trunk/engines/draci/animation.cpp
scummvm/trunk/engines/draci/animation.h
scummvm/trunk/engines/draci/game.cpp
scummvm/trunk/engines/draci/game.h
Modified: scummvm/trunk/engines/draci/animation.cpp
===================================================================
--- scummvm/trunk/engines/draci/animation.cpp 2010-04-01 19:16:26 UTC (rev 48459)
+++ scummvm/trunk/engines/draci/animation.cpp 2010-04-01 22:01:40 UTC (rev 48460)
@@ -295,6 +295,11 @@
}
void AnimationManager::pauseAnimations() {
+ if (_animationPauseCounter++) {
+ // Already paused
+ return;
+ }
+
Common::List<Animation *>::iterator it;
for (it = _animations.begin(); it != _animations.end(); ++it) {
@@ -308,6 +313,11 @@
}
void AnimationManager::unpauseAnimations() {
+ if (--_animationPauseCounter) {
+ // Still paused
+ return;
+ }
+
Common::List<Animation *>::iterator it;
for (it = _animations.begin(); it != _animations.end(); ++it) {
Modified: scummvm/trunk/engines/draci/animation.h
===================================================================
--- scummvm/trunk/engines/draci/animation.h 2010-04-01 19:16:26 UTC (rev 48459)
+++ scummvm/trunk/engines/draci/animation.h 2010-04-01 22:01:40 UTC (rev 48460)
@@ -178,7 +178,7 @@
class AnimationManager {
public:
- AnimationManager(DraciEngine *vm) : _vm(vm), _lastIndex(-1) {}
+ AnimationManager(DraciEngine *vm) : _vm(vm), _lastIndex(-1), _animationPauseCounter(0) {}
~AnimationManager() { deleteAll(); }
void insert(Animation *anim, bool allocateIndex);
@@ -214,6 +214,12 @@
* See Animation::_index for details.
*/
int _lastIndex;
+
+ /** How many times the animations are paused.
+ * Needed because the animations can be paused once by entering the
+ * inventory and then again by entering the game menu. When they are
+ * unpaused the first time, they should be kept paused. */
+ int _animationPauseCounter;
};
} // End of namespace Draci
Modified: scummvm/trunk/engines/draci/game.cpp
===================================================================
--- scummvm/trunk/engines/draci/game.cpp 2010-04-01 19:16:26 UTC (rev 48459)
+++ scummvm/trunk/engines/draci/game.cpp 2010-04-01 22:01:40 UTC (rev 48460)
@@ -332,8 +332,8 @@
// animation ID. In this way, we obtain its itemID.
if (_animUnderCursor != NULL && _animUnderCursor != _inventoryAnim && _animUnderCursor->getID() != kOverlayImage) {
_itemUnderCursor = getItem(kInventoryItemsID - _animUnderCursor->getID());
- if (_itemUnderCursor != NULL)
- assert(_itemUnderCursor->_anim == _animUnderCursor);
+ assert(_itemUnderCursor != NULL);
+ assert(_itemUnderCursor->_anim == _animUnderCursor);
} else {
_itemUnderCursor = NULL;
}
Modified: scummvm/trunk/engines/draci/game.h
===================================================================
--- scummvm/trunk/engines/draci/game.h 2010-04-01 19:16:26 UTC (rev 48459)
+++ scummvm/trunk/engines/draci/game.h 2010-04-01 22:01:40 UTC (rev 48460)
@@ -252,7 +252,7 @@
int getItemStatus(int itemID) const { return _itemStatus[itemID]; }
void setItemStatus(int itemID, int status) { _itemStatus[itemID] = status; }
- GameItem *getItem(int id) { return id >= 0 ? &_items[id] : NULL; }
+ GameItem *getItem(int id) { return id >= 0 && id < (int) _info._numItems ? &_items[id] : NULL; }
GameItem *getCurrentItem() const { return _currentItem; }
void setCurrentItem(GameItem *item) { _currentItem = item; }
void removeItem(GameItem *item);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list