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
30namespace Neverhood {
31
32class Scene;
33class Palette;
34class SmackerPlayer;
35
37public:
39 void draw() override;
40 void setSmackerFrame(const Graphics::Surface *smackerFrame);
41 void unsetSmackerFrame();
42 void renderSubtitles();
43protected:
44 const Graphics::Surface *_smackerFrame;
46 uint32 frameNumber;
47 friend class SmackerPlayer;
48};
49
51public:
53 void draw() override;
54};
55
57public:
58 void forceSeekToFrame(uint frame);
59};
60
61class SmackerPlayer : public Entity {
62public:
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; }
76protected:
77 Scene *_scene;
78 Palette *_palette;
79 NeverhoodSmackerDecoder *_smackerDecoder;
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: ptr.h:572
Definition: stream.h:745
Definition: ptr.h:159
Definition: graphics.h:85
Definition: entity.h:77
Definition: neverhood.h:69
Definition: smackerplayer.h:56
Definition: palette.h:30
Definition: scene.h:41
Definition: smackerplayer.h:50
Definition: smackerplayer.h:61
Definition: smackerplayer.h:36
Definition: atari-screen.h:42
Definition: smk_decoder.h:77
Definition: surface.h:67