ScummVM API documentation
scene9110.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_SCENE9110_H
23#define HOLLYWOOD_MONSTERS_SCENES_INTRO_SCENE9110_H
24
25#include "common/array.h"
26#include "common/random.h"
27#include "common/str.h"
28
29#include "hollywood/monsters/music.h"
30#include "hollywood/monsters/scenes/presentation_scene.h"
31#include "hollywood/scene_text_store.h"
32
33namespace Hollywood {
34
35class HollywoodEngine;
36
38public:
40
41 bool play();
42
43private:
44 enum SpeechWaitMode {
45 kWaitChunk2MouthMotion,
46 kWaitChunk3Animation
47 };
48
49 struct SpeechTextStyle {
50 uint16 centerX;
51 uint16 topY;
52 byte colorIndex;
53 byte red;
54 byte green;
55 byte blue;
56 bool updatePalette;
57 };
58
59 struct SpeechStep {
60 uint16 rowIndex;
61 byte frameIndex;
62 SpeechTextStyle speechTextStyle;
63 SpeechWaitMode waitMode;
64 };
65
66 bool load();
67 bool loadResourceI11Assets();
68 void initializeCompositeState();
69 void runSpeechSequence();
70 void runSpeechStep(const SpeechStep &step);
71 void waitForSpeechOrDelay(uint32 fallbackMillis, SpeechWaitMode waitMode);
72 bool advanceAnimationTimers(uint32 millis, SpeechWaitMode waitMode);
73 void drawCompositeToFramebuffer();
74 void presentComposite();
75 byte nextMouthFrameVariant();
76
77 void beginSubtitle(const SceneSpeechCue &popup, const SpeechTextStyle &speechTextStyle);
78
79 void stopAudio() override;
80
81 enum {
82 kI11RequiredChunkCount = 4,
83 kI11Chunk2DescriptorCount = 15,
84 kI11Chunk3DescriptorCount = 8,
85 kStage911Index = 911
86 };
87
88 enum {
89 kChunk3Layer = 0,
90 kMouthLayer,
91 kIdleLayer,
92 kCycleLayer
93 };
94
95 MusicPlayer *_music;
96 SpeechPlayer _speech;
97 SceneTextStore _text;
99 Common::Array<byte> _paletteResource;
100 IndexedSurfaceBuffer _baseFramebuffer;
101 uint32 _mouthAccumulator;
102 uint32 _idleAccumulator;
103 uint32 _cycleAccumulator;
104 uint32 _musicFadeAccumulator;
105 uint _chunk3Track;
106 byte _chunk2CycleDirection;
107 byte _lastMouthVariant;
108};
109
110} // End of namespace Hollywood
111
112#endif // HOLLYWOOD_MONSTERS_SCENES_INTRO_SCENE9110_H
Definition: random.h:44
Definition: hollywood.h:47
Definition: graphics.h:74
Definition: music.h:31
Definition: presentation_scene.h:38
Definition: scene9110.h:37
Definition: scene_text_store.h:64
Definition: music.h:57
Definition: scene_text_store.h:37