ScummVM API documentation
scene5130.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_PLAYABLE_SCENE5130_H
23#define HOLLYWOOD_MONSTERS_SCENES_PLAYABLE_SCENE5130_H
24
25#include "common/array.h"
26#include "common/random.h"
27#include "common/str.h"
28#include "common/types.h"
29
30#include "hollywood/monsters/music.h"
31#include "hollywood/monsters/scenes/presentation_scene.h"
32#include "hollywood/scene_text_store.h"
33
34namespace Hollywood {
35
36class HollywoodEngine;
37
38// Runs the modal cocktail mixer reached from scene 5120 and returns its result
39// through GameplayState before handing control back to the salon.
41public:
43 ~Scene5130() override;
44
45 bool play();
46
47private:
48 bool load();
49 bool loadInventoryOwnerPalette();
50 void expandFillRunsToSavedFramebuffer();
51 void runIntroAnimation();
52 void runMixerLoop();
53 void handleMixerAction(byte actionId);
54 void runChangeDrinkAction();
55 void runOpenTapAction();
56 void runMixResultAction(bool correctRecipe);
57 bool selectedRecipeIsCorrect() const;
58 void applySuccessDrinkPalette();
59 void applyFailureDrinkPalette();
60 void applyDrinkPalette(byte red, byte green, byte blue);
61 void drawFrame();
62 void drawDrinkStrip();
63 void drawFrameOverlays() override;
64 void drawCaption();
65 void startSpeechLine(uint16 rowIndex, byte frameIndex);
66 void startSpeechPart();
67 void startNextSpeechPart();
68 void advanceSpeech(uint32 millis);
69 void waitForSpeechLine();
70 void stopSpeechLine();
71 void beginSpeechLine(uint16 rowIndex, byte frameIndex);
72 void advanceRuntime(uint32 millis);
73 void updateAmbientMusic(uint32 millis);
74 bool fadePaletteFromBlack();
75 bool fadePaletteToBlack();
76 bool waitAndRender(uint32 millis);
77 bool waitForRuntime(uint32 millis);
78 bool pollEvents(bool allowSkip) override;
79 byte actionAtCursor() const;
80 Common::String captionForAction(byte actionId) const;
81 void setPaletteEntry6Bit(byte colorIndex, byte red, byte green, byte blue);
82 void stopAudio() override;
83 bool animationPlaybackShouldStop() const override;
84 void presentAnimationFrame() override;
85 bool waitForAnimationFrame(uint32 millis, bool allowSkip) override;
86
87 IndexedSurfaceBuffer _baseFramebuffer;
88 Common::Array<byte> _fillRuns;
89 Common::Array<byte> _paletteMask;
90 SceneTextStore _textStore;
91 SpeechPlayer _speech;
92 SoundBank0Player _soundBank0;
94 byte _selectedDrinks[3];
95 byte _selectedDrinkCount;
96 byte _currentDrinkId;
97 uint _drinkStripRow;
98 byte _pendingActionId;
99 byte _hoverActionId;
100 uint16 _speechTextRecordId;
101 uint16 _speechVoiceSampleId;
102 byte _speechPartIndex;
103 byte _speechPartCount;
104 uint32 _speechRemainingMillis;
105 uint32 _ambientMusicTimerMillis;
106 bool _speechActive;
107 bool _mixerActionsEnabled;
108 bool _deferredExitRequested;
109 bool _exitRequested;
110};
111
112} // End of namespace Hollywood
113
114#endif // HOLLYWOOD_MONSTERS_SCENES_PLAYABLE_SCENE5130_H
Definition: random.h:44
Definition: str.h:59
Definition: hollywood.h:47
Definition: graphics.h:74
Definition: presentation_scene.h:38
Definition: scene5130.h:40
Definition: scene_text_store.h:64
Definition: music.h:82
Definition: music.h:57