aboutsummaryrefslogtreecommitdiff
path: root/engines/draci
diff options
context:
space:
mode:
authorRobert Špalek2009-11-07 00:36:23 +0000
committerRobert Špalek2009-11-07 00:36:23 +0000
commitfdad4e7b543af2debcc35492e46c979ab1dd8fec (patch)
treefe981d61e2d6f88c5fe6a636faa72345c4e1989c /engines/draci
parentc65eefbdf769a90c7b5d8b883a5a2e870b65516a (diff)
downloadscummvm-rg350-fdad4e7b543af2debcc35492e46c979ab1dd8fec.tar.gz
scummvm-rg350-fdad4e7b543af2debcc35492e46c979ab1dd8fec.tar.bz2
scummvm-rg350-fdad4e7b543af2debcc35492e46c979ab1dd8fec.zip
Done research on ignored animation flags and commented the code
svn-id: r45711
Diffstat (limited to 'engines/draci')
-rw-r--r--engines/draci/game.cpp24
-rw-r--r--engines/draci/script.cpp4
2 files changed, 22 insertions, 6 deletions
diff --git a/engines/draci/game.cpp b/engines/draci/game.cpp
index 0d9e41f125..15ec8028f4 100644
--- a/engines/draci/game.cpp
+++ b/engines/draci/game.cpp
@@ -1178,12 +1178,24 @@ int Game::loadAnimation(uint animNum, uint z) {
uint numFrames = animationReader.readByte();
- // FIXME: handle these properly
- animationReader.readByte(); // Memory logic field, not used
- animationReader.readByte(); // Disable erasing field, not used
-
- bool cyclic = animationReader.readByte();
-
+ // The following two flags are ignored by the played. Memory logic was
+ // a hint to the old player whether it should cache the sprites or load
+ // them on demand. We have 1 memory manager and ignore these hints.
+ animationReader.readByte();
+ // The disable erasing field is just a (poor) optimization flag that
+ // turns of drawing the background underneath the sprite. By reading
+ // the source code of the old player, I'm not sure if that would ever
+ // have worked. There are only 6 animations in the game with this flag
+ // true. All of them have just 1 animation phase and they are used to
+ // patch a part of the original background by a new sprite. This
+ // should work with the default logic as well---just play this
+ // animation on top of the background. Since the only meaning of the
+ // flag was optimization, ignoring should be OK even without dipping
+ // into details.
+ animationReader.readByte();
+ const bool cyclic = animationReader.readByte();
+
+ // FIXME: handle this properly
animationReader.readByte(); // Relative field, not used
Animation *anim = _vm->_anims->addAnimation(animNum, z, false);
diff --git a/engines/draci/script.cpp b/engines/draci/script.cpp
index 1bb833da22..f47cda4567 100644
--- a/engines/draci/script.cpp
+++ b/engines/draci/script.cpp
@@ -389,6 +389,10 @@ void Script::load(Common::Queue<int> &params) {
}
}
+ // We don't test here whether an animation is loaded in the
+ // AnimationManager while not being registered in the object's array of
+ // animations. This cannot legally happen and an assertion will be
+ // thrown by loadAnimation().
loadObjectAnimation(obj, animID);
}