ScummVM API documentation
smacker.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 STARK_VISUAL_SMACKER_H
23 #define STARK_VISUAL_SMACKER_H
24 
25 #include "engines/stark/visual/visual.h"
26 
27 #include "common/rect.h"
28 #include "common/stream.h"
29 
30 namespace Video {
31 class VideoDecoder;
32 }
33 
34 namespace Graphics {
35 struct Surface;
36 }
37 
38 namespace Stark {
39 
40 namespace Gfx {
41 class Driver;
42 class SurfaceRenderer;
43 class Bitmap;
44 }
45 
46 class VisualSmacker : public Visual {
47 public:
48  static const VisualType TYPE = Visual::kSmackerStream;
49 
51  virtual ~VisualSmacker();
52 
53  void loadSmacker(Common::SeekableReadStream *stream);
54  void loadBink(Common::SeekableReadStream *stream);
55  void update();
56  void render(const Common::Point &position);
57  bool isDone();
58 
60  void rewind();
61 
63  bool isPointSolid(const Common::Point &point) const;
64 
68  void readOriginalSize(Common::SeekableReadStream *stream);
69 
70  int getWidth() const;
71  int getHeight() const;
72 
73  int getFrameNumber() const;
74  Common::Point getPosition() const { return _position; }
75  void setPosition(const Common::Point &pos) { _position = pos; }
76 
78  uint32 getDuration() const;
79 
81  uint32 getCurrentTime() const;
82 
83  void overrideFrameRate(int32 framerate);
84 
86  void pause(bool pause);
87 
88 private:
89  void init();
90 
91  Video::VideoDecoder *_decoder;
92  const Graphics::Surface *_surface;
93 
94  Common::Point _position;
95  int32 _originalWidth;
96  int32 _originalHeight;
97 
98  Gfx::Driver *_gfx;
99  Gfx::SurfaceRenderer *_surfaceRenderer;
100  Gfx::Bitmap *_bitmap;
101  int32 _overridenFramerate;
102 };
103 
104 } // End of namespace Stark
105 
106 #endif // STARK_VISUAL_SMACKER_H
Definition: surface.h:67
Definition: visual.h:29
Definition: stream.h:745
Definition: surfacerenderer.h:36
Definition: smacker.h:46
Definition: driver.h:44
Definition: video_decoder.h:53
Definition: console.h:27
Definition: bitmap.h:38
Definition: formatinfo.h:28
Definition: rect.h:45
Definition: avi_frames.h:36