ScummVM API documentation
scene9090.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_SCENE9090_H
23#define HOLLYWOOD_MONSTERS_SCENES_INTRO_SCENE9090_H
24
25#include "common/random.h"
26
27#include "hollywood/monsters/gameplay/actor_renderer.h"
28#include "hollywood/monsters/music.h"
29#include "hollywood/monsters/scenes/presentation_scene.h"
30#include "hollywood/scene_text_store.h"
31#include "hollywood/monsters/scenes/speech_overlay.h"
32
33namespace Hollywood {
34
35class HollywoodEngine;
36
38public:
40
41 bool play();
42
43private:
44 // Sue's five speech cels replace her upper body; her full-body bank remains on cel 0.
45 struct ActorSpeechDescriptor {
46 uint32 runStreamOffset;
47 uint32 runCount;
48 int16 anchorX;
49 int16 anchorY;
50 };
51
52 struct ActorSpeechBank {
53 Common::Array<byte> runStreams;
55 };
56
57 bool load();
58 bool loadActorResources();
59 void initializeOfficeState();
60 void composeFrame();
61 void drawOfficePatch(uint chunkIndex);
62 void drawDeskActor();
63 void drawInsetActor();
64 void drawClock();
65 void drawSecondaryActor();
66 int drawSecondarySpeechFrame();
67 void runDialogueSequence();
68 void setDeskFacing(byte facingMode);
69 void returnDeskActorToForward();
70 void animateDeskFrames(byte firstFrame, byte lastFrame);
71 void setInsetVariant(byte variant);
72 void animateSecondaryTurn(byte facing);
73 bool playClockedCompositeRange(byte &targetFrame, byte firstFrame,
74 byte lastFrame, uint32 frameMillis);
75 void presentAnimationFrame() override;
76 bool waitForAnimationFrame(uint32 millis, bool allowSkip) override;
77 void runSpeechLine(byte stepIndex);
78 void runConcurrentSpeechLines(byte firstStepIndex, byte secondStepIndex);
79 void runSpeechSteps(const byte *stepIndices, uint stepCount);
80 void advanceDialogueAnimations(uint32 deltaMillis, bool deskSpeaking,
81 bool secondarySpeaking, bool insetSpeaking);
82 void advanceClock(uint32 deltaMillis);
83 byte nextFrameExcluding(byte maximumFrame, byte previousFrame);
84 void beginSubtitle(SpeechOverlay &subtitle, uint16 textRecordId, byte colorIndex,
85 uint16 anchorX, uint16 anchorY, bool secondaryActor);
86 void clearSubtitles();
87 void drawFrameOverlays() override;
88 void stopAudio() override;
89
90 MusicPlayer *_music;
91 SpeechPlayer _primarySpeech;
92 SpeechPlayer _secondarySpeech;
93 SoundBank0Player _clockSound;
94 SoundBank0Player _ambientSound;
95 SceneTextStore _text;
97 Common::Array<byte> _paletteResource;
98 Common::Array<byte> _presentationPaletteRemapTable;
99 IndexedSurfaceBuffer _baseFramebuffer;
100 ActorSpriteBank _secondaryActorBank;
101 ActorSpeechBank _secondarySpeechBank;
102 SpeechOverlay _primarySubtitle;
103 SpeechOverlay _secondarySubtitle;
104 byte _deskFrame;
105 byte _deskFacingMode;
106 byte _insetFrame;
107 byte _insetVariant;
108 byte _secondaryFacing;
109 byte _secondaryCel;
110 byte _secondarySpeechFrame;
111 byte _clockFrames[3];
112 byte _lastDeskTalkFrame;
113 byte _lastInsetTalkFrame;
114 uint32 _deskFrameAccumulator;
115 uint32 _insetFrameAccumulator;
116 uint32 _secondaryFrameAccumulator;
117 uint32 _clockAccumulator;
118 bool _secondarySpeechVisible;
119 bool _advanceClockDuringAnimation;
120};
121
122} // End of namespace Hollywood
123
124#endif // HOLLYWOOD_MONSTERS_SCENES_INTRO_SCENE9090_H
Definition: random.h:44
Definition: hollywood.h:47
Definition: graphics.h:74
Definition: music.h:31
Definition: presentation_scene.h:38
Definition: scene9090.h:37
Definition: scene_text_store.h:64
Definition: music.h:82
Definition: music.h:57
Definition: actor_renderer.h:46
Definition: speech_overlay.h:38