ScummVM API documentation
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_H
23 #define MADS_NEBULAR_H
24 
25 #include "mads/mads.h"
26 
27 namespace MADS {
28 namespace RexNebular {
29 
30 class MacNebular;
31 
33  uint8 _version;
34  Common::String _saveName;
35  Graphics::Surface *_thumbnail;
36  int _year, _month, _day;
37  int _hour, _minute;
38  int _totalFrames;
39 
40  void readSavegameHeader(Common::SeekableReadStream *src);
41  void writeSavegameHeader(Common::WriteStream *dest);
42 };
43 
44 class RexNebularEngine : public MADSEngine {
45 private:
46  friend class MacNebular;
47  MacNebular *_macNebular = nullptr;
48 
49  void showRecipe();
50 
51 protected:
52  void applyGameSettings() override;
53  Common::Point screenToGame(const Common::Point &point) const override;
54  Common::Point gameToScreen(const Common::Point &point) const override;
55  void presentScreen(int shakeOffset) override;
56  bool handleMacEvent(Common::Event &event) override;
57  void serviceMacintoshUI() override;
58  void serviceMacintoshSound() override;
59 
60 public:
61  RexNebularEngine(OSystem *syst, const MADSGameDescription *gameDesc);
62  ~RexNebularEngine() override;
63 
64  Common::Error run() override;
65  void syncRoom(Common::Serializer &s) override;
66  void selectMacintoshDifficulty();
67  int selectMacintoshResumeSlot();
68  bool usesOriginalMacintoshMenus() const;
69  int getMacintoshDisplaySize() const;
70  bool getMacintoshHideMenuBar() const;
71  bool getMacintoshPreferencesAtStartup() const;
72  Common::String getMacintoshApplicationVersion() const;
73  bool getMacintoshStoryLocked() const;
74  bool verifyMacintoshStoryPassword(const Common::String &password) const;
75  void setMacintoshDisplaySize(int displaySize, bool persist);
76  void setMacintoshHideMenuBar(bool hide);
77  void setMacintoshPreferencesAtStartup(bool show, bool persist);
78  void setMacintoshStoryLocked(bool locked,
79  const Common::String &password);
80  void setMacintoshOuterMenuActive(bool active);
81  void notifyMacintoshOuterMenuFrameReady();
82  void setMacintoshFullFrameActive(bool active);
83  bool isMacintoshFullFrameActive() const;
84  int runMacintoshCopyProtectionDialog(const Common::String &title,
85  const Common::String &subtitle, const Common::String &prompt,
86  char *target, int maxLength);
87 
88  int main_copy_verify() override;
89  void global_init_code() override;
90  void section_music(int section_num) override;
91  void global_section_constructor() override;
92  void global_daemon_code() override;
93  void global_verb_filter() override;
94  void global_pre_parser_code() override;
95  void global_parser_code() override;
96  void global_error_code() override;
97  void global_room_init() override {}
98  void global_sound_driver() override;
99  bool hasInterfaceAnimations() const override;
100  bool drawPopup() override;
101  int editMacintoshPopup(char *target, int maxLength) override;
102  void onPopupDestroyed() override;
103  int getMacintoshTextWidth(FontPtr font, const char *text,
104  int spacing) const override;
105  bool drawMacintoshText(FontPtr font, Buffer *target, const char *text,
106  int x, int y, int color, int spacing) const override;
107  bool getInterfaceSentenceColor(byte &foreground) const override;
108  bool hasMacintoshInterface() const override;
109  bool setMacintoshPalette(const RGBcolor *palette, int firstColor,
110  int numColors) override;
111  bool getMacintoshPalette(RGBcolor *palette, int firstColor,
112  int numColors) const override;
113 };
114 
115 } // namespace RexNebular
116 } // namespace MADS
117 
118 #endif
Definition: font.h:33
Definition: str.h:59
Definition: surface.h:67
Definition: general.h:42
Definition: stream.h:77
Definition: error.h:81
Definition: general.h:57
Definition: stream.h:745
Definition: serializer.h:80
Definition: nebular.h:32
Definition: nebular.h:44
Definition: events.h:218
Definition: rect.h:144
Definition: detection.h:42
Definition: mads.h:69
Definition: anim_timer.h:27
Definition: system.h:166
Definition: mac_nebular.h:52