ScummVM API documentation
pink.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 PINK_PINK_H
23#define PINK_PINK_H
24
25#include "common/random.h"
26#include "common/savefile.h"
27
28#include "engines/engine.h"
29#include "engines/savestate.h"
30
31#include "gui/debugger.h"
32
33#include "pink/constants.h"
34#include "pink/file.h"
35#include "pink/utils.h"
36#include "pink/pda_mgr.h"
37
38/*
39 * This is the namespace of the Pink engine.
40 *
41 * Status of this engine: In Development
42 *
43 * Internal name of original engine: OxCart Runtime
44 *
45 * Games using this engine:
46 * - The Pink Panther: Passport to Peril
47 * - The Pink Panther: Hokus Pokus Pink
48 *
49 * Peril game status:
50 * Fully playable*
51 *
52 * Pokus game status:
53 * Fully Playable*
54 *
55 * Known bugs:
56 * PDA is partially usable(ActionText is not implemented)
57 */
58
60
61namespace Common {
62 class PEResources;
63}
64
65namespace Graphics {
66class MacMenu;
67struct WinCursorGroup;
68class PaletteLookup;
69}
70
71namespace Pink {
72
73class Console;
74class Screen;
75class Archive;
76class NamedObject;
77class Module;
78class Page;
79class LeadActor;
80
81enum {
82 kPinkDebugGeneral = 1,
83 kPinkDebugLoadingResources,
84 kPinkDebugLoadingObjects,
85 kPinkDebugScripts,
86 kPinkDebugActions,
87};
88
89enum {
90 GF_COMPRESSED = 1 << 0,
91};
92
93enum PINKActions {
94 kActionNone,
95 kActionSkipWalk,
96 kActionSkipWalkAndCancelInteraction,
97 kActionSkipSequence,
98 kActionSkipSubSequence,
99 kActionRestartSequence,
100};
101
102extern Graphics::PaletteLookup *g_paletteLookup;
103
104class PinkEngine : public Engine {
105public:
106 PinkEngine(OSystem *system, const ADGameDescription *desc);
107 ~PinkEngine() override;
108
109 Common::Error run() override;
110
111 bool hasFeature(EngineFeature f) const override;
112
113 Common::Error loadGameState(int slot) override;
114 bool canLoadGameStateCurrently(Common::U32String *msg = nullptr) override;
115
116 Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
117 bool canSaveGameStateCurrently(Common::U32String *msg = nullptr) override;
118 Common::String getSaveStateName(int slot) const override {
119 return Common::String::format("%s.s%02d", _targetName.c_str(), slot);
120 }
121 SaveStateList listSaves() const;
122
123 friend class Console;
124
125protected:
126 void pauseEngineIntern(bool pause) override;
127
128public:
129 void load(Archive &archive);
130
131 void changeScene();
132
133 bool isPeril() const;
134 bool isPerilDemo() const;
135
136 void setVariable(Common::String &variable, Common::String &value);
137 bool checkValueOfVariable(const Common::String &variable, const Common::String &value) const;
138
139 void executeMenuCommand(uint id);
140 bool executePageChangeCommand(uint id);
141
142 Common::Language getLanguage() const;
143 OrbFile *getOrb() { return &_orb; }
144 BroFile *getBro() { return _bro; }
145 Common::RandomSource &getRnd() { return _rnd; };
146 Screen *getScreen() { return _screen; }
147 PDAMgr &getPdaMgr() { return _pdaMgr; }
148
149 void setNextExecutors(const Common::String &nextModule, const Common::String &nextPage) { _nextModule = nextModule; _nextPage = nextPage; }
150 void setLeadActor(LeadActor *actor) { _actor = actor; };
151 void setCursor(uint cursorIndex);
152
153private:
154 Common::Error init();
155
156 void initMenu();
157
158 bool loadCursors();
159
160 void initModule(const Common::String &moduleName, const Common::String &pageName, Archive *saveFile);
161 void addModule(const Common::String &moduleName);
162 void removeModule();
163
164 void openLocalWebPage(const Common::String &pageName) const;
165
166private:
169
170 Common::String _nextModule;
171 Common::String _nextPage;
172
173 Common::PEResources *_exeResources;
174
175 OrbFile _orb;
176 BroFile *_bro;
177
178 Graphics::MacMenu *_menu;
179 Screen *_screen;
180 LeadActor *_actor;
181
182 Module *_module;
183 Array<NamedObject *> _modules;
184
185 StringMap _variables;
186 PDAMgr _pdaMgr;
187
188 const ADGameDescription *_desc;
189 bool _isPeril;
190 bool _isPerilDemo;
191};
192
193WARN_UNUSED_RESULT bool readSaveHeader(Common::InSaveFile &in, SaveStateDescriptor &desc, bool skipThumbnail = true);
194Common::String generateSaveName(int slot, const char *gameId);
195
196} // End of namespace Pink
197
198#endif
Definition: error.h:81
Definition: winexe_pe.h:48
Definition: random.h:44
Definition: stream.h:745
Definition: str.h:59
static String format(MSVC_PRINTF const char *fmt,...) GCC_PRINTF(1
Definition: ustr.h:57
Definition: engine.h:149
const Common::String _targetName
Definition: engine.h:186
EngineFeature
Definition: engine.h:282
Definition: macmenu.h:95
Definition: palette.h:195
Definition: system.h:166
Definition: archive.h:39
Definition: file.h:76
Definition: console.h:31
Definition: file.h:51
Definition: pink.h:104
bool canLoadGameStateCurrently(Common::U32String *msg=nullptr) override
void pauseEngineIntern(bool pause) override
Common::Error loadGameState(int slot) override
Common::String getSaveStateName(int slot) const override
Definition: pink.h:118
bool hasFeature(EngineFeature f) const override
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave=false) override
Common::Error run() override
bool canSaveGameStateCurrently(Common::U32String *msg=nullptr) override
Definition: savestate.h:56
Language
Definition: language.h:45
bool skipThumbnail(Common::SeekableReadStream &in)
Definition: algorithm.h:29
Definition: formatinfo.h:28
Definition: advancedDetector.h:164
Definition: atari-screen.h:58