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 
30 namespace Graphics {
31 struct Surface;
32 }
33 
34 namespace Video {
35 class VideoDecoder;
36 }
37 
38 namespace Sword1 {
39 
40 enum DecoderType {
41  kVideoDecoderDXA = 0,
42  kVideoDecoderSMK = 1,
43  kVideoDecoderPSX = 2,
44  kVideoDecoderMP2 = 3
45 };
46 
47 class MovieText {
48 public:
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 
61 class MoviePlayer {
62 public:
63  MoviePlayer(SwordEngine *vm, Text *textMan, ResMan *resMan, Sound *sound, OSystem *system, Video::VideoDecoder *decoder, DecoderType decoderType);
64  virtual ~MoviePlayer();
65  bool load(uint32 id);
66  void play();
67 
68 protected:
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 
81  Video::VideoDecoder *_decoder;
82 
83  bool playVideo();
84  void performPostProcessing(byte *screen);
85  void drawFramePSX(const Graphics::Surface *frame);
86 
87  uint32 getBlackColor();
88  uint32 findTextColor();
89  void convertColor(byte r, byte g, byte b, float &h, float &s, float &v);
90 };
91 
92 MoviePlayer *makeMoviePlayer(uint32 id, SwordEngine *vm, Text *textMan, ResMan *resMan, Sound *sound, OSystem *system);
93 
94 } // End of namespace Sword1
95 
96 #endif
Definition: str.h:59
Definition: surface.h:67
Definition: animation.h:47
Definition: sword1.h:104
Definition: sound.h:109
Definition: text.h:48
Definition: list.h:44
Definition: resman.h:65
Definition: animation.h:38
Definition: video_decoder.h:53
Definition: formatinfo.h:28
Definition: animation.h:61
Definition: system.h:161
Definition: avi_frames.h:36