ScummVM API documentation
scene9170.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_SCENE9170_H
23#define HOLLYWOOD_MONSTERS_SCENES_INTRO_SCENE9170_H
24
25#include "common/random.h"
26
27#include "hollywood/monsters/music.h"
28#include "hollywood/monsters/scenes/presentation_scene.h"
29#include "hollywood/scene_text_store.h"
30
31namespace Hollywood {
32
33class HollywoodEngine;
34
35// Renders the ending as a viewport over a tall canvas whose animated channels
36// restore clean rectangles before redrawing.
38public:
40
41 bool play();
42
43private:
44 bool load();
45 void runSequence();
46 void buildInitialStaticFrame();
47 void switchToLowerRoomFrame();
48 void addBlockListToCanvas(uint chunkIndex, int yOffset);
49 void copyBaseToCanvasAtYOffset(int yOffset);
50 void clearCanvasRows(int yOffset, int rowCount);
51 void composeFrame();
52 void restoreSpriteChannel(uint chunkIndex, uint descriptorCount, const byte *frameMap,
53 uint frameMapSize, byte frameIndex);
54 void drawSpriteChannel(uint chunkIndex, uint descriptorCount, const byte *frameMap,
55 uint frameMapSize, byte frameIndex);
56 void scrollByTable(const byte *table, uint tableSize, bool add);
57 void scrollTo(uint targetRowOffset, int step);
58 void waitWithAnimations(uint32 millis, byte speakerGroup, bool animateAmbient,
59 bool presentChanges = true);
60 void fadeInPalette();
61 void startLowerRoomAmbience();
62 void stopLowerRoomAmbience();
63 void advanceLowerRoomAmbience();
64 void runSpeechLine(byte rowIndex, byte frameIndex, uint16 centerX, uint16 topY,
65 byte red, byte green, byte blue, byte speakerGroup);
66 void runSpeechCue(uint16 textRecordId, byte continuationCount, uint16 voiceSampleId,
67 uint16 centerX, uint16 topY, byte speakerGroup);
68 void advanceSpeechAnimation(byte speakerGroup);
69 void advanceSpeakerIdleAnimation(byte speakerGroup);
70 void advanceUpperIdleAnimations(byte speakerGroup);
71 void resetSpeakerFrame(byte speakerGroup);
72 byte nextTalkingFrame();
73 void runEventOverlayFrames();
74 void runShake();
75 uint presentRowOffset() const override;
76 int subtitleViewportYOffset() const override;
77 void stopAudio() override;
78
79 MusicPlayer *_music;
80 SpeechPlayer _speech;
81 SpeechPlayer _ambientSpeech;
82 SoundBank0Player _sound;
83 SoundBank0Player _ambientSound;
84 SceneTextStore _text;
86 Common::Array<byte> _paletteResource;
87 IndexedSurfaceBuffer _baseFramebuffer;
88 IndexedSurfaceBuffer _staticFramebuffer;
89 uint _rowOffset;
90 bool _upperActorsEnabled;
91 bool _lowerActorsEnabled;
92 bool _upperDirty[3];
93 bool _lowerDirty;
94 bool _effectDirty;
95 bool _eventDirty;
96 byte _upperFrames[3];
97 byte _lowerFrame;
98 byte _effectFrame;
99 byte _eventFrame;
100 byte _lastTalkingFrame;
101 int _channelCanvasOffset;
102 bool _ambientEffectsEnabled;
103 uint16 _ambientSpeechSampleId;
104 bool _shakeActive;
105 uint _shakeRowOffset;
106};
107
108} // End of namespace Hollywood
109
110#endif // HOLLYWOOD_MONSTERS_SCENES_INTRO_SCENE9170_H
Definition: random.h:44
Definition: hollywood.h:47
Definition: graphics.h:74
Definition: music.h:31
Definition: presentation_scene.h:38
Definition: scene9170.h:37
Definition: scene_text_store.h:64
Definition: music.h:82
Definition: music.h:57