ScummVM API documentation
options_menu.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_GAMEPLAY_OPTIONS_MENU_H
23#define HOLLYWOOD_MONSTERS_GAMEPLAY_OPTIONS_MENU_H
24
25#include "common/array.h"
26#include "common/path.h"
27#include "common/str.h"
28#include "common/types.h"
29#include "graphics/managed_surface.h"
30
31#include "hollywood/monsters/graphics.h"
32#include "hollywood/monsters/music.h"
33
34namespace Graphics {
35struct Surface;
36}
37
38namespace Hollywood {
39
40class HollywoodEngine;
41
43public:
45
46 void setAudioContext(const Common::Path &soundBank0ArchiveName, bool hasSpeechPreviewSample,
47 uint16 speechPreviewSampleId);
48 bool run(const Common::Array<byte> &basePalette);
49
50private:
51 enum HitAction {
52 kHitNone,
53 kHitSave,
54 kHitLoad,
55 kHitQuit,
56 kHitPlay,
57 kHitMusicToggle,
58 kHitSoundToggle,
59 kHitTestToggle,
60 kHitMusicDown,
61 kHitMusicUp,
62 kHitSoundDown,
63 kHitSoundUp,
64 kHitVoiceDown,
65 kHitVoiceUp,
66 kHitTextSpeedDown,
67 kHitTextSpeedUp,
68 kHitSpeechText,
69 kHitSpeechVoice,
70 kHitSpeechBoth,
71 kHitLanguage,
72 kHitConfirmQuit,
73 kHitCancelQuit
74 };
75
76 bool load();
77 bool loadMenuFramebuffer();
78 bool loadObjectPalette();
79 bool loadObjectPaletteFromResource000();
80 void preparePalette(const Common::Array<byte> &basePalette);
81 void pollEvents(bool &done);
82 void handleKeyDown(uint16 keycode, bool &done);
83 void handleLeftClick(uint16 cursorX, uint16 cursorY, bool &done);
84 HitAction hitActionAt(uint16 cursorX, uint16 cursorY) const;
85 bool isVolumeHitAction(HitAction action) const;
86 bool applyVolumeHitAction(HitAction action);
87 void startHeldVolume(HitAction action);
88 void stopHeldVolume();
89 void advanceHeldVolume(uint32 delta);
90 bool pointInGlobalRect(uint16 cursorX, uint16 cursorY, uint16 left, uint16 top,
91 uint16 right, uint16 bottom) const;
92 void changeVolume(byte &volume, int delta);
93 void setSpeechMode(byte mode);
94 void beginAudioSession();
95 void endAudioSession();
96 void disableTestAudio();
97 void updateTestAudio();
98 void stopTestAudio();
99 uint16 testMusicCueId() const;
100 uint16 testSoundCueId() const;
101 void captureGameplayPreview();
102 byte nearestPreviewPaletteColor(uint red, uint green, uint blue) const;
103 void composeScreen();
104 void drawGameplayPreview();
105 void drawControls(Graphics::Surface &surface);
106 void drawQuitConfirmation(Graphics::Surface &surface);
107 void drawText(Graphics::Surface &surface, const Common::String &text, int globalX, int y,
108 byte color, bool centered);
109 void drawQuitConfirmationBacking();
110 void drawQuitButtonFrame(int globalLeft, int globalRight);
111 void shiftGlobalRectColors(int globalLeft, int top, int globalRight, int bottom, int delta);
112 void drawStatusDot(int globalX, int y, byte color);
113 void drawStatusDots();
114 void drawValueBar(int rowIndex, byte value, byte color);
115 void drawToggleSquare(int columnIndex, int rowIndex, byte color);
116 void present();
117
118 HollywoodEngine *_vm;
119 IndexedSurfaceBuffer _menuFramebuffer;
120 Common::Array<byte> _objectPaletteTriples;
121 Common::Array<byte> _palette;
123 Graphics::ManagedSurface _gameplayPreview;
124 Palette6Bit _displayPalette;
125 MusicPlayer _testMusic;
126 SoundBank0Player _testSound;
127 SpeechPlayer _testSpeech;
128 Common::Path _soundBank0ArchiveName;
129 uint16 _speechPreviewSampleId;
130 bool _loaded;
131 bool _confirmQuit;
132 bool _loadedGame;
133 bool _sceneMusicWasPlaying;
134 bool _hasSpeechPreviewSample;
135 HitAction _heldVolumeAction;
136 uint32 _heldVolumeAccumulator;
137 uint32 _heldVolumeRepeatMillis;
138};
139
140} // End of namespace Hollywood
141
142#endif // HOLLYWOOD_MONSTERS_GAMEPLAY_OPTIONS_MENU_H
Definition: path.h:52
Definition: str.h:59
Definition: managed_surface.h:51
Definition: options_menu.h:42
Definition: hollywood.h:47
Definition: graphics.h:74
Definition: music.h:31
Definition: graphics.h:51
Definition: music.h:82
Definition: music.h:57
Definition: formatinfo.h:28
Definition: surface.h:67