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 PRINCE_ANIMATION_H
23 #define PRINCE_ANIMATION_H
24 
25 #include "common/array.h"
26 #include "common/stream.h"
27 
28 #include "graphics/surface.h"
29 
30 namespace Prince {
31 
32 class Animation {
33 public:
34  Animation();
35  ~Animation();
36  bool loadStream(Common::SeekableReadStream &stream);
37 
38  int16 getLoopCount() const;
39  int32 getPhaseCount() const;
40  int32 getFrameCount() const;
41  int16 getBaseX() const;
42  int16 getBaseY() const;
43  int16 getPhaseOffsetX(int phaseIndex) const;
44  int16 getPhaseOffsetY(int phaseIndex) const;
45  int16 getPhaseFrameIndex(int phaseIndex) const;
46  Graphics::Surface *getFrame(int frameIndex);
47  void clear();
48 
49 private:
50  struct Phase {
51  int16 _phaseOffsetX;
52  int16 _phaseOffsetY;
53  uint16 _phaseToFrameIndex;
54  };
55  struct Frame {
56  bool _isCompressed;
57  uint32 _dataSize;
58  byte *_compressedData;
59  Graphics::Surface *_surface;
60  };
61  Common::Array<Frame> _frameList;
62  Common::Array<Phase> _phaseList;
63  int16 _loopCount;
64  int16 _phaseCount;
65  int32 _frameCount;
66  int16 _baseX;
67  int16 _baseY;
68 };
69 
70 } // End of namespace Prince
71 
72 #endif
Definition: surface.h:67
Definition: stream.h:745
Definition: animation.h:32
Definition: animation.h:30