From fdad4e7b543af2debcc35492e46c979ab1dd8fec Mon Sep 17 00:00:00 2001 From: Robert Špalek Date: Sat, 7 Nov 2009 00:36:23 +0000 Subject: Done research on ignored animation flags and commented the code svn-id: r45711 --- engines/draci/game.cpp | 24 ++++++++++++++++++------ engines/draci/script.cpp | 4 ++++ 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 ¶ms) { } } + // 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); } -- cgit v1.2.3