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 ZVISION_ANIMATION_NODE_H 24 #define ZVISION_ANIMATION_NODE_H 25 26 #include "zvision/scripting/scripting_effect.h" 27 #include "common/rect.h" 28 #include "common/list.h" 29 30 namespace Graphics { 31 struct Surface; 32 } 33 34 namespace Video { 35 class VideoDecoder; 36 } 37 38 namespace ZVision { 39 40 class ZVision; 41 42 class AnimationEffect : public ScriptingEffect { 43 public: 44 AnimationEffect(ZVision *engine, uint32 controlKey, const Common::String &fileName, int32 mask, int32 frate, bool disposeAfterUse = true); 45 ~AnimationEffect(); 46 47 struct playnode { 48 Common::Rect pos; 49 int32 slot; 50 int32 start; 51 int32 stop; 52 int32 loop; 53 int32 _curFrame; 54 int32 _delay; 55 Graphics::Surface *_scaled; 56 }; 57 58 private: 59 typedef Common::List<playnode> PlayNodes; 60 61 PlayNodes _playList; 62 63 int32 _mask; 64 bool _disposeAfterUse; 65 66 Video::VideoDecoder *_animation; 67 int32 _frmDelayOverride; 68 69 public: 70 bool process(uint32 deltaTimeInMillis); 71 72 void addPlayNode(int32 slot, int x, int y, int x2, int y2, int startFrame, int endFrame, int loops = 1); 73 74 bool stop(); 75 }; 76 77 } // End of namespace ZVision 78 79 #endif 80