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 * Additional copyright for this file:
8 * Copyright (C) 1994-1998 Revolution Software Ltd.
9 *
10 * This program is free software: you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation, either version 3 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program. If not, see <http://www.gnu.org/licenses/>.
22 */
23
24#ifndef SWORD2_ANIMATION_H
25#define SWORD2_ANIMATION_H
26
27#include "sword2/screen.h"
28
29namespace Graphics {
30struct Surface;
31}
32
33namespace Video {
34class VideoDecoder;
35}
36
37namespace Sword2 {
38
39enum DecoderType {
40 kVideoDecoderDXA = 0,
41 kVideoDecoderSMK = 1,
42 kVideoDecoderPSX = 2,
43 kVideoDecoderMP2 = 3
44};
45
46struct MovieText {
47 uint16 _startFrame;
48 uint16 _endFrame;
49 uint32 _textNumber;
50 byte *_textMem;
51 SpriteInfo _textSprite;
52 uint16 _speechId;
53 bool _played;
54
55 void reset() {
56 _textMem = nullptr;
57 _speechId = 0;
58 _played = false;
59 }
60};
61
63public:
64 MoviePlayer(Sword2Engine *vm, OSystem *system, Video::VideoDecoder *decoder, DecoderType decoderType);
65 virtual ~MoviePlayer();
66
67 Common::Error load(const char *name);
68 void play(MovieText *movieTexts, uint32 numMovieTexts, uint32 leadIn, uint32 leadOut);
69
70protected:
71 Sword2Engine *_vm;
72 OSystem *_system;
73 MovieText *_movieTexts;
74 uint32 _numMovieTexts;
75 uint32 _currentMovieText;
76 byte *_textSurface;
77 int _textX, _textY;
78 byte _white, _black;
79 DecoderType _decoderType;
80 bool _modeChange;
81
82 Video::VideoDecoder *_decoder;
83
84 uint32 _leadOut;
85 int _leadOutFrame;
86
87 void performPostProcessing(Graphics::Surface *screen, uint16 pitch);
88 bool playVideo();
89 void drawFramePSX(const Graphics::Surface *frame);
90
91 void openTextObject(uint32 index);
92 void closeTextObject(uint32 index, Graphics::Surface *screen, uint16 pitch);
93 void drawTextObject(uint32 index, Graphics::Surface *screen, uint16 pitch);
94
95 uint32 getBlackColor();
96 uint32 getWhiteColor();
97};
98
99MoviePlayer *makeMoviePlayer(const char *name, Sword2Engine *vm, OSystem *system, uint32 frameCount);
100
101} // End of namespace Sword2
102
103#endif
Definition: error.h:81
Definition: system.h:166
Definition: animation.h:62
Definition: sword2.h:99
Definition: video_decoder.h:53
Definition: formatinfo.h:28
Definition: animation.h:37
Definition: surface.h:67
Definition: animation.h:46
Definition: screen.h:160