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#ifndef SWORD1_ANIMATION_H
23#define SWORD1_ANIMATION_H
24
25#include "common/list.h"
26
27#include "sword1/screen.h"
28#include "sword1/sound.h"
29
30namespace Graphics {
31struct Surface;
32}
33
34namespace Video {
35class VideoDecoder;
36}
37
38namespace Sword1 {
39
40enum DecoderType {
41 kVideoDecoderDXA = 0,
42 kVideoDecoderSMK = 1,
43 kVideoDecoderPSX = 2,
44 kVideoDecoderMP2 = 3
45};
46
47class MovieText {
48public:
49 uint16 _startFrame;
50 uint16 _endFrame;
51 uint16 _color;
52 Common::String _text;
53 MovieText(int startFrame, int endFrame, const Common::String &text, int color) {
54 _startFrame = startFrame;
55 _endFrame = endFrame;
56 _text = text;
57 _color = color;
58 }
59};
60
62public:
63 MoviePlayer(SwordEngine *vm, Text *textMan, ResMan *resMan, Sound *sound, OSystem *system, Video::VideoDecoder *decoder, DecoderType decoderType);
64 virtual ~MoviePlayer();
65 Common::Error load(uint32 id);
66 void play();
67
68protected:
69 SwordEngine *_vm;
70 Text *_textMan;
71 ResMan *_resMan;
72 Sound *_sound;
73 OSystem *_system;
74 Common::List<MovieText> _movieTexts;
75 int _textX, _textY, _textWidth, _textHeight;
76 int _textColor;
77 uint32 _black;
78 uint32 _c1Color, _c2Color, _c3Color, _c4Color;
79 DecoderType _decoderType;
80 bool _modeChange;
81
82 Video::VideoDecoder *_decoder;
83
84 bool playVideo();
85 void performPostProcessing(byte *screen);
86 void drawFramePSX(const Graphics::Surface *frame);
87
88 uint32 getBlackColor();
89 uint32 findTextColor();
90 void convertColor(byte r, byte g, byte b, float &h, float &s, float &v);
91};
92
93MoviePlayer *makeMoviePlayer(uint32 id, SwordEngine *vm, Text *textMan, ResMan *resMan, Sound *sound, OSystem *system);
94
95} // End of namespace Sword1
96
97#endif
Definition: error.h:81
Definition: list.h:44
Definition: str.h:59
Definition: system.h:166
Definition: animation.h:61
Definition: animation.h:47
Definition: resman.h:65
Definition: sound.h:109
Definition: sword1.h:104
Definition: text.h:48
Definition: video_decoder.h:53
Definition: formatinfo.h:28
Definition: animation.h:38
Definition: surface.h:67