ScummVM API documentation
mac_nebular.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 MADS_NEBULAR_MAC_NEBULAR_H
23#define MADS_NEBULAR_MAC_NEBULAR_H
24
25#include "common/rect.h"
26#include "common/str.h"
27#include "graphics/managed_surface.h"
28#include "mads/core/font.h"
29#include "mads/core/general.h"
30
31namespace Common {
32struct Event;
33}
34
35namespace MADS {
36namespace RexNebular {
37
38class MacResourceProvider;
39class MacNebularMenu;
40class RexNebularEngine;
41
42enum MacNebularDisplaySize {
43 kMacNebularDisplay100 = 0,
44 kMacNebularDisplay150 = 1,
45 kMacNebularDisplay200 = 2
46};
47
48// Returns true when the Macintosh palette replaced the DOS defaults.
49bool setMacintoshMessageColors(int primaryR, int primaryG, int primaryB,
50 int secondaryR, int secondaryG, int secondaryB);
51
53private:
54 RexNebularEngine &_engine;
55 MacResourceProvider *_resources = nullptr;
56 MacNebularMenu *_menus = nullptr;
59 Graphics::ManagedSurface _aboutPicture;
60 Common::Rect _popupRect;
61 RGBcolor _palette[256];
62 RGBcolor _aboutPalette[256];
63 bool _useOriginalMenus;
64 int _displaySize;
65 bool _hideMenuBar;
66 bool _preferencesAtStartup;
67 bool _showPreferencesAtStartup;
68 bool _startupPreferencesReady = false;
69 bool _storyLocked;
70 Common::String _storyPassword;
71 bool _fullFrameActive = false;
72 bool _aboutActive = false;
73 bool _aboutRoomLoaded = false;
74 bool _gameplayHandoffPending = false;
75 bool _gameplayHandoffEffectSeen = false;
76 bool _popupActive = false;
77 int _popupAskLine = -1;
78 int _popupAskX = 0;
79 int _popupAskY = 0;
80 bool _layoutLogged = false;
81 uint32 _lastMacintoshSoundTick = (uint32)-1;
82 uint32 _macintoshSoundPausedAt = 0;
83 uint32 _macintoshSoundPausedTicks = 0;
84 bool _macintoshSoundPaused = false;
85
86 int getSceneWidth() const;
87 int getSceneHeight() const;
88 int getSceneX() const;
89 int getSceneY() const;
90 int getInterfaceY() const;
91 void showAbout();
92public:
93 explicit MacNebular(RexNebularEngine &engine);
95
96 void initGraphics();
97 bool initResources();
98 void applyGameSettings();
99 void selectDifficulty();
100 int selectResumeSlot();
101 bool usesOriginalMenus() const { return _useOriginalMenus; }
102 int getDisplaySize() const { return _displaySize; }
103 bool getHideMenuBar() const { return _hideMenuBar; }
104 bool getPreferencesAtStartup() const { return _preferencesAtStartup; }
105 Common::String getApplicationVersion() const;
106 bool getStoryLocked() const { return _storyLocked; }
107 bool verifyStoryPassword(const Common::String &password) const;
108 void setDisplaySize(int displaySize, bool persist);
109 void setHideMenuBar(bool hide);
110 void setPreferencesAtStartup(bool show, bool persist);
111 void setStoryLocked(bool locked, const Common::String &password);
112 void setFullFrameActive(bool active);
113 bool isFullFrameActive() const { return _fullFrameActive; }
114 void setOuterMenuActive(bool active);
115 void notifyOuterMenuFrameReady();
116 Common::Point screenToGame(const Common::Point &point) const;
117 Common::Point gameToScreen(const Common::Point &point) const;
118 bool handleMacEvent(Common::Event &event);
119 void serviceUI();
120 void serviceSound();
121 void setPalette(const RGBcolor *palette, int firstColor, int numColors);
122 void getPalette(RGBcolor *palette, int firstColor, int numColors) const;
123 void presentScreen(int shakeOffset);
124 void showPopup();
125 int editPopup(char *target, int maxLength);
126 int runCopyProtectionDialog(const Common::String &title,
127 const Common::String &subtitle, const Common::String &prompt,
128 char *target, int maxLength);
129 void hidePopup();
130 int getTextWidth(FontPtr font, const char *text, int spacing) const;
131 bool drawText(FontPtr font, Buffer *target, const char *text, int x,
132 int y, int color, int spacing) const;
133};
134
135} // namespace RexNebular
136} // namespace MADS
137
138#endif
Definition: str.h:59
Definition: managed_surface.h:51
Definition: mac_nebular.h:52
Definition: mac_menus.h:48
Definition: mac_resources.h:43
Definition: nebular.h:44
Definition: algorithm.h:29
Definition: events.h:218
Definition: rect.h:144
Definition: rect.h:536
Definition: general.h:57
Definition: font.h:33
Definition: general.h:42