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#ifdef ENABLE_AGOS2
23
24#ifndef AGOS_ANIMATION_H
25#define AGOS_ANIMATION_H
26
27#include "video/dxa_decoder.h"
28#include "video/smk_decoder.h"
29#include "video/subtitles.h"
30#include "audio/mixer.h"
31
32namespace AGOS {
33
34class AGOSEngine_Feeble;
35
36class MoviePlayer {
37protected:
38 AGOSEngine_Feeble *_vm;
39
40 Audio::Mixer *_mixer;
41
42 Audio::SoundHandle _bgSound;
43 Audio::AudioStream *_bgSoundStream;
44
45 bool _leftButtonDown;
46 bool _rightButtonDown;
47 bool _skipMovie;
48 uint32 _ticks;
49
50 char baseName[40];
51public:
52 enum VideoFlags {
53 TYPE_OMNITV = 1,
54 TYPE_LOOPING = 2
55 };
56
57 MoviePlayer(AGOSEngine_Feeble *vm);
58 virtual ~MoviePlayer();
59
60 virtual bool load() = 0;
61 virtual void play();
62 virtual void playVideo() = 0;
63 virtual void nextFrame() = 0;
64 virtual void stopVideo() = 0;
65
66protected:
67 virtual void handleNextFrame();
68 virtual bool processFrame() = 0;
69 virtual void startSound() {}
70 Video::Subtitles _subtitles;
71};
72
73class MoviePlayerDXA : public MoviePlayer, Video::DXADecoder {
74 static const char *const _sequenceList[90];
75 uint8 _sequenceNum;
76public:
77 MoviePlayerDXA(AGOSEngine_Feeble *vm, const char *name);
78
79 bool load() override;
80 void playVideo() override;
81 void nextFrame() override;
82 void stopVideo() override;
83
84protected:
85 void readSoundData(Common::SeekableReadStream *stream) override;
86
87private:
88 void handleNextFrame() override;
89 bool processFrame() override;
90 void startSound() override;
91 void copyFrameToBuffer(byte *dst, uint x, uint y, uint pitch);
92};
93
94class MoviePlayerSMK : public MoviePlayer, Video::SmackerDecoder {
95public:
96 MoviePlayerSMK(AGOSEngine_Feeble *vm, const char *name);
97
98 bool load() override;
99 void playVideo() override;
100 void nextFrame() override;
101 void stopVideo() override;
102
103private:
104 void handleNextFrame() override;
105 bool processFrame() override;
106 void startSound() override;
107 void copyFrameToBuffer(byte *dst, uint x, uint y, uint pitch);
108};
109
110MoviePlayer *makeMoviePlayer(AGOSEngine_Feeble *vm, const char *name);
111
112} // End of namespace AGOS
113
114#endif
115
116#endif // ENABLE_AGOS2
Definition: audiostream.h:50
Definition: mixer.h:70
Definition: mixer.h:49
Definition: stream.h:745
Definition: dxa_decoder.h:44
Definition: smk_decoder.h:77
Definition: subtitles.h:78