aboutsummaryrefslogtreecommitdiff
path: root/engines/mads/user_interface.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2015-03-14 19:24:56 -0400
committerPaul Gilbert2015-03-14 19:24:56 -0400
commit299bfa3696aaf3c689798faef198d714eb234f4f (patch)
tree7b288acabcbc7d6f61c0c995018002791791dab0 /engines/mads/user_interface.cpp
parent97ef41707ab957099b4972bba501479001315e69 (diff)
downloadscummvm-rg350-299bfa3696aaf3c689798faef198d714eb234f4f.tar.gz
scummvm-rg350-299bfa3696aaf3c689798faef198d714eb234f4f.tar.bz2
scummvm-rg350-299bfa3696aaf3c689798faef198d714eb234f4f.zip
MADS: Fix showing inventory pictures when inventory animating is off
Diffstat (limited to 'engines/mads/user_interface.cpp')
-rw-r--r--engines/mads/user_interface.cpp25
1 files changed, 14 insertions, 11 deletions
diff --git a/engines/mads/user_interface.cpp b/engines/mads/user_interface.cpp
index eced2fdb12..93a555d9c7 100644
--- a/engines/mads/user_interface.cpp
+++ b/engines/mads/user_interface.cpp
@@ -864,13 +864,13 @@ void UserInterface::loadInventoryAnim(int objectId) {
Scene &scene = _vm->_game->_scene;
noInventoryAnim();
- if (_vm->_invObjectsAnimated) {
- Common::String resName = Common::String::format("*OB%.3dI", objectId);
- SpriteAsset *asset = new SpriteAsset(_vm, resName, ASSET_SPINNING_OBJECT);
- _invSpritesIndex = scene._sprites.add(asset, 1);
- if (_invSpritesIndex >= 0) {
- _invFrameNumber = 1;
- }
+ // WORKAROUND: Even in still mode, we now load the animation frames for the
+ // object, so we can show the first frame as a 'still'
+ Common::String resName = Common::String::format("*OB%.3dI", objectId);
+ SpriteAsset *asset = new SpriteAsset(_vm, resName, ASSET_SPINNING_OBJECT);
+ _invSpritesIndex = scene._sprites.add(asset, 1);
+ if (_invSpritesIndex >= 0) {
+ _invFrameNumber = 1;
}
}
@@ -902,10 +902,13 @@ void UserInterface::inventoryAnim() {
_invSpritesIndex < 0)
return;
- // Move to the next frame number in the sequence, resetting if at the end
- SpriteAsset *asset = scene._sprites[_invSpritesIndex];
- if (++_invFrameNumber > asset->getCount())
- _invFrameNumber = 1;
+ // WORKAROUND: Fix still inventory display, which was broken in the original
+ if (_vm->_invObjectsAnimated) {
+ // Move to the next frame number in the sequence, resetting if at the end
+ SpriteAsset *asset = scene._sprites[_invSpritesIndex];
+ if (++_invFrameNumber > asset->getCount())
+ _invFrameNumber = 1;
+ }
// Loop through the slots list for inventory animation entry
for (uint i = 0; i < _uiSlots.size(); ++i) {