1 /* ScummVM - Graphic Adventure Engine 2 * 3 * ScummVM is the legal property of its developers, whose names 4 * are too numerous to list here. Please refer to the COPYRIGHT 5 * file distributed with this source distribution. 6 * 7 * This program is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU General Public License 9 * as published by the Free Software Foundation; either version 2 10 * of the License, or (at your option) any later version. 11 * 12 * This program is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with this program; if not, write to the Free Software 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 20 * 21 */ 22 23 #ifndef HOPKINS_ANIM_H 24 #define HOPKINS_ANIM_H 25 26 #include "common/scummsys.h" 27 #include "common/endian.h" 28 #include "common/str.h" 29 #include "graphics/surface.h" 30 31 namespace Hopkins { 32 33 struct BankItem { 34 byte *_data; 35 bool _loadedFl; 36 Common::String _filename; 37 int _fileHeader; 38 int _objDataIdx; 39 }; 40 41 struct BqeAnimItem { 42 byte *_data; 43 bool _enabledFl; 44 }; 45 46 class HopkinsEngine; 47 48 class AnimationManager { 49 private: 50 bool _clearAnimationFl; 51 52 HopkinsEngine *_vm; 53 54 void initAnimBqe(); 55 int loadSpriteBank(int idx, const Common::String &filename); 56 void searchAnim(const byte *data, int animIndex, int count); 57 58 public: 59 BqeAnimItem _animBqe[35]; 60 BankItem Bank[8]; 61 62 AnimationManager(HopkinsEngine *vm); 63 void clearAll(); 64 65 void loadAnim(const Common::String &animName); 66 void clearAnim(); 67 void playAnim(const Common::String &hiresName, const Common::String &lowresName, uint32 rate1, uint32 rate2, uint32 rate3, bool skipSeqFl = false); 68 void playAnim2(const Common::String &hiresName, const Common::String &lowresName, uint32 rate1, uint32 rate2, uint32 rate3); 69 void playSequence(const Common::String &file, uint32 rate1, uint32 rate2, uint32 rate3, bool skipEscFl, bool skipSeqFl, bool noColFl = false); 70 void playSequence2(const Common::String &file, uint32 rate1, uint32 rate2, uint32 rate3, bool skipSeqFl = false); 71 setClearAnimFlag()72 void setClearAnimFlag() { _clearAnimationFl = true; } unsetClearAnimFlag()73 void unsetClearAnimFlag() { _clearAnimationFl = false; } 74 }; 75 76 } // End of namespace Hopkins 77 78 #endif /* HOPKINS_ANIM_H */ 79