diff options
author | Paul Gilbert | 2015-01-11 18:29:36 -0500 |
---|---|---|
committer | Paul Gilbert | 2015-01-11 18:29:36 -0500 |
commit | 892a504009e0d7d6d6304d485bf2fad9519781e9 (patch) | |
tree | c93772ef32327ee6cf0c1e054b65089950748d22 | |
parent | 4745bfe182fa0824aee2525ff196d93060c2cd0c (diff) | |
download | scummvm-rg350-892a504009e0d7d6d6304d485bf2fad9519781e9.tar.gz scummvm-rg350-892a504009e0d7d6d6304d485bf2fad9519781e9.tar.bz2 scummvm-rg350-892a504009e0d7d6d6304d485bf2fad9519781e9.zip |
XEEN: Implemented loading of object animation data
-rw-r--r-- | engines/xeen/interface.cpp | 11 | ||||
-rw-r--r-- | engines/xeen/map.cpp | 53 | ||||
-rw-r--r-- | engines/xeen/map.h | 25 |
3 files changed, 83 insertions, 6 deletions
diff --git a/engines/xeen/interface.cpp b/engines/xeen/interface.cpp index b003e9aedd..665ce6728d 100644 --- a/engines/xeen/interface.cpp +++ b/engines/xeen/interface.cpp @@ -868,6 +868,17 @@ void Interface::draw3d(bool flag) { moveMonsters(); } + int e3 = 0xE302 + _objNumber * 8; + Direction dir = _vm->_party._mazeDirection; + bool flag2 = _flag2; + int objNum = _objNumber - 1; + + for (uint i = 0; i < _vm->_map->_mobData._objects.size(); ++i) { + if (flag2) { + + } + } + // TODO: more warning("TODO"); diff --git a/engines/xeen/map.cpp b/engines/xeen/map.cpp index c70b0cfe6d..836680c24f 100644 --- a/engines/xeen/map.cpp +++ b/engines/xeen/map.cpp @@ -809,6 +809,49 @@ void HeadData::synchronize(Common::SeekableReadStream &s) { /*------------------------------------------------------------------------*/ +/** + * Synchronize data for an entry within an animation entry + */ +void AnimationFrame::synchronize(Common::SeekableReadStream &s) { + _left = s.readByte(); + _back = s.readByte(); + _right = s.readByte(); + _front = s.readByte(); +} + +/** + * Synchronize data for an animation entry + */ +void AnimationEntry::synchronize(Common::SeekableReadStream &s) { + _frame1.synchronize(s); + _flipped.synchronize(s); + _frame2.synchronize(s); +} + +/** + * Synchronize data for object animations within the game + */ +void AnimationInfo::synchronize(Common::SeekableReadStream &s) { + AnimationEntry entry; + + clear(); + while (s.pos() < s.size()) { + entry.synchronize(s); + push_back(entry); + } +} + +/** + * Load the animation info objects in the game + */ +void AnimationInfo::load(const Common::String &name) { + File f(name); + synchronize(f); + f.close(); +} + +/*------------------------------------------------------------------------*/ + Map::Map(XeenEngine *vm) : _vm(vm), _mobData(vm) { _townPortalSide = 0; _sideObj = 0; @@ -849,7 +892,7 @@ void Map::load(int mapId) { if (_vm->getGameID() == GType_WorldOfXeen) { if (_vm->_loadDarkSide) { - _objPicSprites.load("clouds.dat"); + _animationInfo.load("clouds.dat"); _monsterData.load("xeen.mon"); _wallPicSprites.load("xeenpic.dat"); } else { @@ -859,7 +902,7 @@ void Map::load(int mapId) { case 115: case 116: case 128: - _objPicSprites.load("clouds.dat"); + _animationInfo.load("clouds.dat"); _monsterData.load("dark.mon"); _wallPicSprites.load("darkpic.dat"); _sideObj = 0; @@ -869,7 +912,7 @@ void Map::load(int mapId) { case 119: case 120: case 124: - _objPicSprites.load("clouds.dat"); + _animationInfo.load("clouds.dat"); _monsterData.load("xeen.mon"); _wallPicSprites.load("darkpic.dat"); _sideObj = 0; @@ -878,12 +921,12 @@ void Map::load(int mapId) { case 125: case 126: case 127: - _objPicSprites.load("clouds.dat"); + _animationInfo.load("clouds.dat"); _monsterData.load("dark.mon"); _wallPicSprites.load("xeenpic.dat"); break; default: - _objPicSprites.load("dark.dat"); + _animationInfo.load("dark.dat"); _monsterData.load("ddark.mon"); _wallPicSprites.load("darkpic.dat"); break; diff --git a/engines/xeen/map.h b/engines/xeen/map.h index d26dffff82..228dfb8e22 100644 --- a/engines/xeen/map.h +++ b/engines/xeen/map.h @@ -311,13 +311,36 @@ public: void synchronize(Common::SeekableReadStream &s); }; +struct AnimationFrame { + int _front, _left, _back, _right; + + AnimationFrame(): _front(0), _left(0), _back(0), _right(0) {} + + void synchronize(Common::SeekableReadStream &s); +}; + +struct AnimationEntry { + AnimationFrame _frame1; + AnimationFrame _flipped; + AnimationFrame _frame2; + + void synchronize(Common::SeekableReadStream &s); +}; + +class AnimationInfo : public Common::Array<AnimationEntry> { +public: + void synchronize(Common::SeekableReadStream &s); + + void load(const Common::String &name); +}; + class Map { private: XeenEngine *_vm; MazeData _mazeData[9]; Common::String _mazeName; HeadData _headData; - SpriteResource _objPicSprites; + AnimationInfo _animationInfo; MonsterData _monsterData; SpriteResource _wallPicSprites; int _townPortalSide; |