diff options
author | Paul Gilbert | 2014-05-20 21:11:53 -0400 |
---|---|---|
committer | Paul Gilbert | 2014-05-20 21:11:53 -0400 |
commit | df23dff5177ece670f2fd8222337faa80baf12bd (patch) | |
tree | a4184fb2a8ee321aebce4ffaabda9f09e49e2e70 /engines | |
parent | 6f66459f4ab89aeb152d7b13b4289ab7ba8cfca4 (diff) | |
download | scummvm-rg350-df23dff5177ece670f2fd8222337faa80baf12bd.tar.gz scummvm-rg350-df23dff5177ece670f2fd8222337faa80baf12bd.tar.bz2 scummvm-rg350-df23dff5177ece670f2fd8222337faa80baf12bd.zip |
MADS: Change the animation _animMode to an enum'ed _bgType
Diffstat (limited to 'engines')
-rw-r--r-- | engines/mads/animation.cpp | 10 | ||||
-rw-r--r-- | engines/mads/animation.h | 8 |
2 files changed, 11 insertions, 7 deletions
diff --git a/engines/mads/animation.cpp b/engines/mads/animation.cpp index f006d1fe61..f55e485c20 100644 --- a/engines/mads/animation.cpp +++ b/engines/mads/animation.cpp @@ -36,7 +36,7 @@ void AAHeader::load(Common::SeekableReadStream *f) { _flags = f->readByte(); f->skip(2); - _animMode = f->readUint16LE(); + _bgType = (AnimBgType)f->readUint16LE(); _roomNumber = f->readUint16LE(); f->skip(2); _manualFlag = f->readUint16LE() != 0; @@ -186,7 +186,7 @@ void Animation::load(UserInterface &interfaceSurface, MSurface &depthSurface, _header.load(stream); delete stream; - if (_header._animMode == 4) + if (_header._bgType == ANIMBG_INTERFACE) flags |= PALFLAG_RESERVED; if (flags & ANIMFLAG_LOAD_BACKGROUND) { @@ -296,7 +296,7 @@ void Animation::load(UserInterface &interfaceSurface, MSurface &depthSurface, if (usageList.size() > 0) _vm->_palette->_paletteUsage.updateUsage(usageList, _header._messagesCount); - if (_header._animMode == 4) { + if (_header._bgType == ANIMBG_INTERFACE) { // Remaps the sprite list indexes for frames to the loaded sprite list indexes for (uint i = 0; i < _frameEntries.size(); ++i) { int spriteListIndex = _frameEntries[i]._spriteSlot._spritesIndex; @@ -377,7 +377,7 @@ bool Animation::drawFrame(SpriteAsset &spriteSet, const Common::Point &pt, int f void Animation::loadInterface(UserInterface &interfaceSurface, MSurface &depthSurface, AAHeader &header, int flags, Common::Array<PaletteCycle> *palCycles, SceneInfo *sceneInfo) { _scene->_depthStyle = 0; - if (header._animMode <= 2) { + if (header._bgType <= ANIMBG_FULL_SIZE) { _vm->_palette->_paletteUsage.setEmpty(); sceneInfo->load(header._roomNumber, flags, header._interfaceFile, 0, depthSurface, interfaceSurface); _scene->_depthStyle = sceneInfo->_depthStyle == 2 ? 1 : 0; @@ -386,7 +386,7 @@ void Animation::loadInterface(UserInterface &interfaceSurface, MSurface &depthSu for (uint i = 0; i < sceneInfo->_paletteCycles.size(); ++i) palCycles->push_back(sceneInfo->_paletteCycles[i]); } - } else if (header._animMode == 4) { + } else if (header._bgType == ANIMBG_INTERFACE) { // Load a scene interface Common::String resourceName = "*" + header._interfaceFile; interfaceSurface.load(resourceName); diff --git a/engines/mads/animation.h b/engines/mads/animation.h index a1d957ee45..715f6e49a5 100644 --- a/engines/mads/animation.h +++ b/engines/mads/animation.h @@ -40,6 +40,11 @@ enum AnimFlag { ANIMFLAG_LOAD_BACKGROUND_ONLY = 0x0200 // Load background only }; +enum AnimBgType { + ANIMBG_ROOM = 1, ANIMBG_FULL_SIZE = 2, ANIMBG_BLACK_SCREEN = 3, + ANIMBG_INTERFACE = 4 +}; + class MADSEngine; class Scene; @@ -112,7 +117,7 @@ public: int _frameEntriesCount; int _messagesCount; byte _flags; - int _animMode; + AnimBgType _bgType; int _roomNumber; bool _manualFlag; int _spritesIndex; @@ -215,7 +220,6 @@ public: int getCurrentFrame() const { return _currentFrame; } bool freeFlag() const { return _freeFlag; } - bool getAnimMode() const { return _header._animMode; } int roomNumber() const { return _header._roomNumber; } void resetSpriteSetsCount() { _header._spriteSetsCount = 0; } // CHECKME: See if it doesn't leak the memory when the destructor is called |