[Scummvm-cvs-logs] SF.net SVN: scummvm:[48574] scummvm/branches/branch-1-1-0
spalek at users.sourceforge.net
spalek at users.sourceforge.net
Tue Apr 6 21:18:06 CEST 2010
Revision: 48574
http://scummvm.svn.sourceforge.net/scummvm/?rev=48574&view=rev
Author: spalek
Date: 2010-04-06 19:17:55 +0000 (Tue, 06 Apr 2010)
Log Message:
-----------
back-ported bugfix r48460 for Dragon History
Modified Paths:
--------------
scummvm/branches/branch-1-1-0/engines/draci/animation.cpp
scummvm/branches/branch-1-1-0/engines/draci/animation.h
scummvm/branches/branch-1-1-0/engines/draci/game.cpp
scummvm/branches/branch-1-1-0/engines/draci/game.h
Property Changed:
----------------
scummvm/branches/branch-1-1-0/
scummvm/branches/branch-1-1-0/engines/draci/script.cpp
scummvm/branches/branch-1-1-0/engines/draci/script.h
Property changes on: scummvm/branches/branch-1-1-0
___________________________________________________________________
Modified: svn:mergeinfo
- /scummvm/branches/gsoc2009-draci:41389-44325
+ /scummvm/branches/gsoc2009-draci:41389-44325
/scummvm/trunk:48460
Modified: scummvm/branches/branch-1-1-0/engines/draci/animation.cpp
===================================================================
--- scummvm/branches/branch-1-1-0/engines/draci/animation.cpp 2010-04-06 17:51:30 UTC (rev 48573)
+++ scummvm/branches/branch-1-1-0/engines/draci/animation.cpp 2010-04-06 19:17:55 UTC (rev 48574)
@@ -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/branches/branch-1-1-0/engines/draci/animation.h
===================================================================
--- scummvm/branches/branch-1-1-0/engines/draci/animation.h 2010-04-06 17:51:30 UTC (rev 48573)
+++ scummvm/branches/branch-1-1-0/engines/draci/animation.h 2010-04-06 19:17:55 UTC (rev 48574)
@@ -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/branches/branch-1-1-0/engines/draci/game.cpp
===================================================================
--- scummvm/branches/branch-1-1-0/engines/draci/game.cpp 2010-04-06 17:51:30 UTC (rev 48573)
+++ scummvm/branches/branch-1-1-0/engines/draci/game.cpp 2010-04-06 19:17:55 UTC (rev 48574)
@@ -332,6 +332,7 @@
// animation ID. In this way, we obtain its itemID.
if (_animUnderCursor != NULL && _animUnderCursor != _inventoryAnim && _animUnderCursor->getID() != kOverlayImage) {
_itemUnderCursor = getItem(kInventoryItemsID - _animUnderCursor->getID());
+ assert(_itemUnderCursor != NULL);
assert(_itemUnderCursor->_anim == _animUnderCursor);
} else {
_itemUnderCursor = NULL;
Modified: scummvm/branches/branch-1-1-0/engines/draci/game.h
===================================================================
--- scummvm/branches/branch-1-1-0/engines/draci/game.h 2010-04-06 17:51:30 UTC (rev 48573)
+++ scummvm/branches/branch-1-1-0/engines/draci/game.h 2010-04-06 19:17:55 UTC (rev 48574)
@@ -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);
Property changes on: scummvm/branches/branch-1-1-0/engines/draci/script.cpp
___________________________________________________________________
Modified: svn:mergeinfo
-
+ /scummvm/trunk/engines/draci/script.cpp:48460
Property changes on: scummvm/branches/branch-1-1-0/engines/draci/script.h
___________________________________________________________________
Modified: svn:mergeinfo
-
+ /scummvm/trunk/engines/draci/script.h:48460
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