ScummVM API documentation
smackerplayer.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 NEVERHOOD_SMACKERPLAYER_H
23 #define NEVERHOOD_SMACKERPLAYER_H
24 
25 #include "video/smk_decoder.h"
26 #include "neverhood/neverhood.h"
27 #include "neverhood/entity.h"
28 #include "neverhood/subtitles.h"
29 
30 namespace Neverhood {
31 
32 class Scene;
33 class Palette;
34 class SmackerPlayer;
35 
36 class SmackerSurface : public BaseSurface {
37 public:
39  void draw() override;
40  void setSmackerFrame(const Graphics::Surface *smackerFrame);
41  void unsetSmackerFrame();
42  void renderSubtitles();
43 protected:
44  const Graphics::Surface *_smackerFrame;
46  uint32 frameNumber;
47  friend class SmackerPlayer;
48 };
49 
51 public:
53  void draw() override;
54 };
55 
57 public:
58  void forceSeekToFrame(uint frame);
59 };
60 
61 class SmackerPlayer : public Entity {
62 public:
63  SmackerPlayer(NeverhoodEngine *vm, Scene *scene, uint32 fileHash, bool doubleSurface, bool flag, bool paused = false);
64  ~SmackerPlayer() override;
65  Common::SharedPtr<BaseSurface> getSurface() { return _smackerSurface; }
66  void open(uint32 fileHash, bool keepLastFrame);
67  void close();
68  void gotoFrame(int frameNumber);
69  uint32 getFrameCount();
70  uint32 getFrameNumber();
71  uint getStatus();
72  void setDrawPos(int16 x, int16 y);
73  void rewind();
74  bool isDone() { return getFrameNumber() + 1 == getFrameCount(); }
75  NeverhoodSmackerDecoder *getSmackerDecoder() const { return _smackerDecoder; }
76 protected:
77  Scene *_scene;
78  Palette *_palette;
79  NeverhoodSmackerDecoder *_smackerDecoder;
80  Common::SharedPtr<SmackerSurface> _smackerSurface;
81  uint32 _fileHash;
82  bool _smackerFirst;
83  bool _doubleSurface;
85  bool _keepLastFrame;
86  bool _videoDone;
87  bool _paused;
88  int _drawX, _drawY;
89  void update();
90  void updateFrame();
91  void updatePalette();
92 };
93 
94 } // End of namespace Neverhood
95 
96 #endif /* NEVERHOOD_SMACKERPLAYER_H */
Definition: background.h:30
Definition: surface.h:67
Definition: neverhood.h:60
Definition: palette.h:30
Definition: stream.h:745
Definition: smk_decoder.h:76
Definition: ptr.h:572
Definition: entity.h:77
Definition: smackerplayer.h:61
Definition: scene.h:41
Definition: smackerplayer.h:50
Definition: smackerplayer.h:36
Definition: ptr.h:159
Definition: graphics.h:85
Definition: smackerplayer.h:56
Definition: atari-screen.h:44