ScummVM API documentation
cfo_decoder.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 CHEWY_VIDEO_CFO_DECODER_H
23#define CHEWY_VIDEO_CFO_DECODER_H
24
25#include "graphics/surface.h"
26#include "video/flic_decoder.h"
27
28namespace Chewy {
29
30#define MAX_SOUND_EFFECTS 14
31
32class Sound;
33
34// A FLIC decoder, with a modified header and additional custom frames
36public:
37 CfoDecoder(Sound *sound, bool disposeMusic) : Video::FlicDecoder(), _sound(sound), _disposeMusic(disposeMusic) {}
38 ~CfoDecoder() override {}
39
40 bool loadStream(Common::SeekableReadStream *stream) override;
41
42private:
43 Sound *_sound;
44 bool _disposeMusic;
45
46 class CfoVideoTrack : public Video::FlicDecoder::FlicVideoTrack {
47 public:
48 CfoVideoTrack(Common::SeekableReadStream *stream, uint16 frameCount, uint16 width, uint16 height, Sound *sound, bool disposeMusic);
49 ~CfoVideoTrack() override;
50
51 void readHeader() override;
52
53 const Graphics::Surface *decodeNextFrame() override;
54
55 private:
56 void handleFrame() override;
57 void handleCustomFrame();
58 void fadeOut();
59
60 Sound *_sound;
61 bool _disposeMusic;
62
63 uint8 *_soundEffects[MAX_SOUND_EFFECTS];
64 uint32 _soundEffectSize[MAX_SOUND_EFFECTS];
65 uint8 *_musicData;
66 uint32 _musicSize;
67
68 uint8 _sfxBalances[MAX_SOUND_EFFECTS];
69 uint8 _sfxGlobalVolume;
70 uint8 _musicVolume;
71 };
72};
73
74} // End of namespace Chewy
75
76#endif
Definition: cfo_decoder.h:35
bool loadStream(Common::SeekableReadStream *stream) override
Definition: sound.h:35
Definition: stream.h:745
Definition: flic_decoder.h:62
Definition: flic_decoder.h:50
virtual const Graphics::Surface * decodeNextFrame()
Definition: surface.h:67