ScummVM API documentation
scene9010.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 HOLLYWOOD_MONSTERS_SCENES_INTRO_SCENE9010_H
23#define HOLLYWOOD_MONSTERS_SCENES_INTRO_SCENE9010_H
24
25#include "common/array.h"
26#include "common/file.h"
27#include "common/str.h"
28
29#include "hollywood/monsters/music.h"
30#include "hollywood/resource.h"
31#include "hollywood/monsters/scenes/presentation_scene.h"
32#include "hollywood/scene_text_store.h"
33
34namespace Hollywood {
35
36class HollywoodEngine;
37
39public:
41
42 bool play();
43 bool skipRequested() const { return _skipRequested; }
44 const IndexedSurfaceBuffer &transitionFramebuffer() const { return _sceneFramebuffer; }
45 const Common::Array<byte> &transitionPalette() const { return _paletteCurrent; }
46
47private:
48 struct SpeechTextStyle {
49 uint16 centerX;
50 uint16 topY;
51 byte colorIndex;
52 byte red;
53 byte green;
54 byte blue;
55 };
56
57 enum I02FramePayloadFormat {
58 kI02FramePayloadUnknown,
59 kI02FramePayloadBlockList,
60 kI02FramePayloadScreenRows,
61 kI02FramePayloadSceneRows
62 };
63
64 bool playScene9010();
65
66 bool loadScene9010Resources();
67 bool loadI02StillFrameResource();
68 bool validateI02AnimationResources();
69
70 bool runPoseTransition(bool targetAlternatePose);
71 bool playSpeechExchange(byte descriptorIndex);
72 bool playI02Animation();
73 uint detectI02ChunkedFrameCount(ResourceChunkTable &chunkTable) const;
74 bool loadI02ChunkedFrame(uint frameIndex);
75 bool readI02StreamFrame(Common::File &file);
76 void setI02PaletteFrame(uint frameIndex);
77 I02FramePayloadFormat detectI02FramePayloadFormat(const Common::Array<byte> &payload) const;
78 bool isValidI02BlockListFrame(const Common::Array<byte> &payload) const;
79 void drawI02FramePayload(const Common::Array<byte> &payload);
80 void drawRawI02ScreenRows(const Common::Array<byte> &payload);
81 void drawRawI02SceneRows(const Common::Array<byte> &payload);
82 byte nextTalkingFrameVariant();
83
84 void drawCharacterFrame(byte frameIndex);
85
86 void updateScene9010PaletteFade();
87 void beginSubtitle(const SceneSpeechCue &popup, uint segmentIndex);
88 SpeechTextStyle getCurrentSpeechTextStyle() const;
89
90 bool delayScene9010(uint32 millis);
91 void stopAudio() override;
92
93 uint16 readUint16(const Common::Array<byte> &source, uint offset) const;
94 uint32 readUint32(const Common::Array<byte> &source, uint offset) const;
95
96 enum {
97 kSceneFramebufferSize = 0x100000,
98 kRawScreenFrameSize = 0x4b000,
99 kRawSceneFrameSize = kSceneBufferByteCount,
100 kCharacterFrameDescriptorCount = 17
101 };
102
103 MusicPlayer _music;
104 SpeechPlayer _speech;
105 SceneTextStore _text;
106 Common::Array<byte> _paletteSource;
107 Common::Array<byte> _characterSpriteResource;
108 Common::Array<byte> _i02PaletteTable;
109 Common::Array<byte> _i02FramePayload;
110 I02FramePayloadFormat _i02FramePayloadFormat;
111 bool _i02SingleFrameOnly;
112 IndexedSurfaceBuffer _frameDecodeBuffer;
113 bool _alternatePoseActive;
114 byte _characterFrameIndex;
115 byte _lastTalkingFrameVariant;
116 byte _scene9010FadeCountdown;
117 bool _scene9010FadeComplete;
118 uint32 _scene9010FadeAccumulator;
119};
120
121} // End of namespace Hollywood
122
123#endif // HOLLYWOOD_MONSTERS_SCENES_INTRO_SCENE9010_H
Definition: file.h:47
Definition: hollywood.h:47
Definition: graphics.h:74
Definition: music.h:31
Definition: presentation_scene.h:38
Definition: scene9010.h:38
Definition: scene_text_store.h:64
Definition: music.h:57
Definition: resource.h:46
Definition: scene_text_store.h:37