ScummVM API documentation
animation.h
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 modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (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, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef ACCESS_ANIMATION_H
23 #define ACCESS_ANIMATION_H
24 
25 #include "common/scummsys.h"
26 #include "common/array.h"
27 #include "common/memstream.h"
28 #include "access/data.h"
29 #include "access/files.h"
30 
31 namespace Access {
32 
33 class AnimationResource;
34 class Animation;
35 class AnimationFrame;
36 class AnimationFramePart;
37 
38 class AnimationManager : public Manager {
39 private:
40  Common::Array<Animation *> _animationTimers;
41  AnimationResource *_animation;
42 public:
43  Animation *_animStart;
44  Common::Point _base;
45  int _frameScale;
46 public:
49  void freeAnimationData();
50  void loadAnimations(Resource *res);
51 
52  Animation *findAnimation(int animId);
53  Animation *setAnimation(int animId);
54 
55  void animate(int animId);
56 
60  void clearTimers();
61 
65  void setAnimTimer(Animation *anim);
66 
70  void updateTimers();
71 };
72 
74 private:
75  Common::Array<Animation *> _animations;
76 public:
79 
80  int getCount() { return _animations.size(); }
81  Animation *getAnimation(int idx) { return _animations[idx]; }
82 };
83 
84 class Animation : public Manager {
85 private:
87 
88  void anim0();
89  void anim1();
90  void anim2();
91  void anim3();
92  void anim4();
93  void animNone();
94  void anim7();
95 
96  AnimationFrame *calcFrame();
97  AnimationFrame *calcFrame1();
98  void setFrame(AnimationFrame *frame);
99  void setFrame1(AnimationFrame *frame);
100 public:
101  int _type;
102  int _scaling;
103  int _frameNumber;
104  int _initialTicks;
105  int _loopCount;
106  int _countdownTicks;
107  int _currentLoopCount;
108 public:
110  ~Animation();
111 
112  void animate();
113 };
114 
116 public:
117  int _baseX, _baseY;
118  int _frameDelay;
120 public:
121  AnimationFrame(Common::SeekableReadStream *stream, int startOffset);
122  ~AnimationFrame();
123 };
124 
126 public:
127  byte _flags;
128  int _spritesIndex;
129  int _frameIndex;
130  Common::Point _position;
131  int _offsetY;
132 public:
134 };
135 
136 } // End of namespace Access
137 
138 #endif /* ACCESS_ANIMATION_H */
void setAnimTimer(Animation *anim)
Definition: data.h:37
Definition: access.h:84
Definition: array.h:52
Definition: animation.h:84
Definition: stream.h:745
Definition: files.h:54
Definition: animation.h:115
Definition: animation.h:125
Definition: rect.h:45
Definition: animation.h:38
Definition: animation.h:73
size_type size() const
Definition: array.h:315
Definition: access.h:62