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
31namespace Access {
32
33class AnimationResource;
34class Animation;
35class AnimationFrame;
36class AnimationFramePart;
37
38class AnimationManager : public Manager {
39private:
40 Common::Array<Animation *> _animationTimers;
41 AnimationResource *_animation;
42public:
43 Animation *_animStart;
44 Common::Point _base;
45public:
48 void freeAnimationData();
49 void loadAnimations(Resource *res);
50 void loadAnimations(int fileNum, int subfile);
51
52 Animation *findAnimation(int animId);
53 Animation *setAnimation(int animId);
54
55 void animate(int animId);
56
61
66
71
75 void popBackTimer() { if (_animationTimers.size()) _animationTimers.pop_back(); }
76
80 bool hasTimer() const { return !_animationTimers.empty(); };
81};
82
84private:
86public:
89
90 int getCount() const { return _animations.size(); }
91 Animation *getAnimation(int idx) { return _animations[idx]; }
92};
93
94class Animation : public Manager {
95private:
97
98 void anim0();
99 void anim1();
100 void anim2();
101 void anim3();
102 void anim4();
103 void animNone();
104 void anim7();
105 void anim8();
106 void anim9();
107 void anim10();
108 void anim11();
109 void anim12();
110
111 const AnimationFrame *calcFrame();
112 const AnimationFrame *calcFrame1();
113 void setFrame(const AnimationFrame *frame);
114 void setFrame1(const AnimationFrame *frame, int16 xoff = 0, int16 yoff = 0);
115public:
116 int _type;
117 int _scaling;
118 int _frameNumber;
119 int _initialTicks;
120 int _loopCount;
121 int _countdownTicks;
122 int _currentLoopCount;
123public:
125 ~Animation();
126
127 void animate();
128};
129
131public:
132 int _baseX, _baseY;
133 int _frameDelay;
135public:
136 AnimationFrame(Common::SeekableReadStream *stream, int startOffset);
138};
139
141public:
142 byte _flags;
143 int _spritesIndex;
144 int _frameIndex;
145 Common::Point _position;
146 int _offsetY;
147public:
149};
150
151} // End of namespace Access
152
153#endif /* ACCESS_ANIMATION_H */
Definition: access.h:141
Definition: animation.h:130
Definition: animation.h:140
Definition: animation.h:94
Definition: animation.h:38
void popBackTimer()
Definition: animation.h:75
void setAnimTimer(Animation *anim)
bool hasTimer() const
Definition: animation.h:80
Definition: animation.h:83
Definition: data.h:37
Definition: files.h:55
Definition: array.h:52
size_type size() const
Definition: array.h:316
bool empty() const
Definition: array.h:352
void pop_back()
Definition: array.h:200
Definition: stream.h:745
Definition: access.h:62
Definition: rect.h:144