2018-03-15 20:02:52 +00:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
|
|
|
*
|
|
|
|
* ScummVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
|
|
|
*
|
2021-12-26 17:47:58 +00:00
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
2018-03-15 20:02:52 +00:00
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2021-12-26 17:47:58 +00:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2018-03-15 20:02:52 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef PINK_PINK_H
|
|
|
|
#define PINK_PINK_H
|
|
|
|
|
|
|
|
#include "common/random.h"
|
2018-12-10 18:12:18 +00:00
|
|
|
#include "common/savefile.h"
|
2018-05-21 09:30:27 +00:00
|
|
|
|
2018-03-15 20:02:52 +00:00
|
|
|
#include "engines/engine.h"
|
2018-12-10 18:12:18 +00:00
|
|
|
#include "engines/savestate.h"
|
2018-05-21 09:30:27 +00:00
|
|
|
|
2018-03-15 20:02:52 +00:00
|
|
|
#include "gui/debugger.h"
|
2018-05-21 09:30:27 +00:00
|
|
|
|
|
|
|
#include "pink/constants.h"
|
|
|
|
#include "pink/file.h"
|
2018-05-21 18:38:02 +00:00
|
|
|
#include "pink/utils.h"
|
2018-06-01 19:31:35 +00:00
|
|
|
#include "pink/pda_mgr.h"
|
2018-03-15 20:02:52 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* This is the namespace of the Pink engine.
|
|
|
|
*
|
|
|
|
* Status of this engine: In Development
|
|
|
|
*
|
2018-03-17 15:36:18 +00:00
|
|
|
* Internal name of original engine: OxCart Runtime
|
2018-03-15 20:02:52 +00:00
|
|
|
*
|
|
|
|
* Games using this engine:
|
|
|
|
* - The Pink Panther: Passport to Peril
|
|
|
|
* - The Pink Panther: Hokus Pokus Pink
|
2018-05-12 19:37:04 +00:00
|
|
|
*
|
|
|
|
* Peril game status:
|
|
|
|
* Fully playable*
|
|
|
|
*
|
|
|
|
* Pokus game status:
|
2018-05-13 11:06:57 +00:00
|
|
|
* Fully Playable*
|
2018-05-12 19:37:04 +00:00
|
|
|
*
|
|
|
|
* Known bugs:
|
2020-06-05 16:49:55 +00:00
|
|
|
* PDA is partially usable(ActionText is not implemented)
|
2018-03-15 20:02:52 +00:00
|
|
|
*/
|
|
|
|
|
2018-12-10 18:12:18 +00:00
|
|
|
struct ADGameDescription;
|
|
|
|
|
2019-12-31 19:19:42 +00:00
|
|
|
namespace Common {
|
|
|
|
class PEResources;
|
|
|
|
}
|
|
|
|
|
2018-07-22 18:26:09 +00:00
|
|
|
namespace Graphics {
|
|
|
|
class MacMenu;
|
2020-01-30 22:48:02 +00:00
|
|
|
struct WinCursorGroup;
|
2018-07-22 18:26:09 +00:00
|
|
|
}
|
|
|
|
|
2018-03-15 20:02:52 +00:00
|
|
|
namespace Pink {
|
|
|
|
|
|
|
|
class Console;
|
2018-07-11 19:59:44 +00:00
|
|
|
class Director;
|
2018-03-17 15:36:18 +00:00
|
|
|
class Archive;
|
2018-03-22 05:47:45 +00:00
|
|
|
class NamedObject;
|
2018-03-17 15:36:18 +00:00
|
|
|
class Module;
|
2018-05-31 20:11:08 +00:00
|
|
|
class Page;
|
2018-03-25 19:32:07 +00:00
|
|
|
class LeadActor;
|
2018-03-15 20:02:52 +00:00
|
|
|
|
|
|
|
enum {
|
2018-05-22 05:03:37 +00:00
|
|
|
kPinkDebugGeneral = 1 << 0,
|
|
|
|
kPinkDebugLoadingResources = 1 << 1,
|
|
|
|
kPinkDebugLoadingObjects = 1 << 2,
|
2018-07-21 16:40:12 +00:00
|
|
|
kPinkDebugScripts = 1 << 3,
|
|
|
|
kPinkDebugActions = 1 << 4
|
2018-03-15 20:02:52 +00:00
|
|
|
};
|
|
|
|
|
2018-03-17 15:36:18 +00:00
|
|
|
class PinkEngine : public Engine {
|
2018-03-15 20:02:52 +00:00
|
|
|
public:
|
2018-05-22 05:03:37 +00:00
|
|
|
PinkEngine(OSystem *system, const ADGameDescription *desc);
|
2020-02-09 11:05:31 +00:00
|
|
|
~PinkEngine() override;
|
2018-03-15 20:02:52 +00:00
|
|
|
|
2018-06-13 10:28:24 +00:00
|
|
|
Common::Error run() override;
|
2018-03-17 15:36:18 +00:00
|
|
|
|
2018-06-13 10:28:24 +00:00
|
|
|
bool hasFeature(EngineFeature f) const override;
|
2018-05-25 17:50:02 +00:00
|
|
|
|
2020-02-09 11:05:31 +00:00
|
|
|
Common::Error loadGameState(int slot) override;
|
2018-06-13 10:28:24 +00:00
|
|
|
bool canLoadGameStateCurrently() override;
|
2018-05-25 17:50:02 +00:00
|
|
|
|
2020-02-05 06:13:33 +00:00
|
|
|
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
|
2018-06-13 10:28:24 +00:00
|
|
|
bool canSaveGameStateCurrently() override;
|
2021-11-13 21:20:07 +00:00
|
|
|
Common::String getSaveStateName(int slot) const override {
|
2020-02-07 05:54:41 +00:00
|
|
|
return Common::String::format("%s.s%02d", _targetName.c_str(), slot);
|
|
|
|
}
|
2018-05-25 17:50:02 +00:00
|
|
|
|
2018-06-21 09:12:02 +00:00
|
|
|
friend class Console;
|
|
|
|
|
2018-06-13 10:28:24 +00:00
|
|
|
protected:
|
2020-02-09 11:05:31 +00:00
|
|
|
void pauseEngineIntern(bool pause) override;
|
2018-06-13 05:45:30 +00:00
|
|
|
|
2018-06-13 10:28:24 +00:00
|
|
|
public:
|
2018-05-22 05:03:37 +00:00
|
|
|
void load(Archive &archive);
|
2018-06-13 10:28:24 +00:00
|
|
|
|
|
|
|
void changeScene();
|
|
|
|
|
2020-02-13 20:28:22 +00:00
|
|
|
bool isPeril() const;
|
2018-06-29 14:03:35 +00:00
|
|
|
|
2018-06-13 10:28:24 +00:00
|
|
|
void setVariable(Common::String &variable, Common::String &value);
|
2020-02-13 20:28:22 +00:00
|
|
|
bool checkValueOfVariable(const Common::String &variable, const Common::String &value) const;
|
2018-03-17 15:36:18 +00:00
|
|
|
|
2018-07-22 18:26:09 +00:00
|
|
|
void executeMenuCommand(uint id);
|
2020-03-03 00:03:38 +00:00
|
|
|
bool executePageChangeCommand(uint id);
|
2018-07-22 18:26:09 +00:00
|
|
|
|
2018-12-10 18:12:18 +00:00
|
|
|
Common::Language getLanguage() const;
|
2018-05-22 05:03:37 +00:00
|
|
|
OrbFile *getOrb() { return &_orb; }
|
|
|
|
BroFile *getBro() { return _bro; }
|
|
|
|
Common::RandomSource &getRnd() { return _rnd; };
|
2018-07-11 19:59:44 +00:00
|
|
|
Director *getDirector() { return _director; }
|
2018-06-10 07:54:08 +00:00
|
|
|
PDAMgr &getPdaMgr() { return _pdaMgr; }
|
2018-03-25 19:32:07 +00:00
|
|
|
|
2018-06-10 07:54:08 +00:00
|
|
|
void setNextExecutors(const Common::String &nextModule, const Common::String &nextPage) { _nextModule = nextModule; _nextPage = nextPage; }
|
2018-05-22 05:03:37 +00:00
|
|
|
void setLeadActor(LeadActor *actor) { _actor = actor; };
|
|
|
|
void setCursor(uint cursorIndex);
|
2018-03-15 20:02:52 +00:00
|
|
|
|
|
|
|
private:
|
2018-05-22 05:03:37 +00:00
|
|
|
Common::Error init();
|
2018-06-13 10:28:24 +00:00
|
|
|
|
2020-02-13 19:56:41 +00:00
|
|
|
void initMenu();
|
2018-07-22 18:26:09 +00:00
|
|
|
|
2020-02-13 19:56:41 +00:00
|
|
|
bool loadCursors();
|
2018-03-27 16:20:09 +00:00
|
|
|
|
2018-06-13 10:28:24 +00:00
|
|
|
void initModule(const Common::String &moduleName, const Common::String &pageName, Archive *saveFile);
|
|
|
|
void addModule(const Common::String &moduleName);
|
|
|
|
void removeModule();
|
|
|
|
|
2020-02-12 23:16:56 +00:00
|
|
|
void openLocalWebPage(const Common::String &pageName) const;
|
2020-02-12 22:13:23 +00:00
|
|
|
|
2018-06-13 10:28:24 +00:00
|
|
|
private:
|
2018-05-22 05:03:37 +00:00
|
|
|
Common::RandomSource _rnd;
|
2018-05-22 08:58:02 +00:00
|
|
|
Common::Array<Graphics::WinCursorGroup *> _cursors;
|
2018-03-15 20:02:52 +00:00
|
|
|
|
2018-05-22 05:03:37 +00:00
|
|
|
Common::String _nextModule;
|
|
|
|
Common::String _nextPage;
|
2018-03-15 20:02:52 +00:00
|
|
|
|
2019-12-31 19:19:42 +00:00
|
|
|
Common::PEResources *_exeResources;
|
|
|
|
|
2018-05-22 05:03:37 +00:00
|
|
|
OrbFile _orb;
|
|
|
|
BroFile *_bro;
|
2018-03-15 20:02:52 +00:00
|
|
|
|
2018-07-22 18:26:09 +00:00
|
|
|
Graphics::MacMenu *_menu;
|
2018-07-11 19:59:44 +00:00
|
|
|
Director *_director;
|
2018-05-22 05:03:37 +00:00
|
|
|
LeadActor *_actor;
|
2018-03-23 19:51:13 +00:00
|
|
|
|
2018-05-22 05:03:37 +00:00
|
|
|
Module *_module;
|
2018-05-22 08:58:02 +00:00
|
|
|
Array<NamedObject *> _modules;
|
2018-03-22 05:47:45 +00:00
|
|
|
|
2018-05-25 17:50:02 +00:00
|
|
|
StringMap _variables;
|
2018-06-01 19:31:35 +00:00
|
|
|
PDAMgr _pdaMgr;
|
2018-03-17 15:36:18 +00:00
|
|
|
|
2018-12-10 18:12:18 +00:00
|
|
|
const ADGameDescription *_desc;
|
2018-03-15 20:02:52 +00:00
|
|
|
};
|
|
|
|
|
2018-06-29 09:56:20 +00:00
|
|
|
WARN_UNUSED_RESULT bool readSaveHeader(Common::InSaveFile &in, SaveStateDescriptor &desc, bool skipThumbnail = true);
|
2018-05-25 17:50:02 +00:00
|
|
|
Common::String generateSaveName(int slot, const char *gameId);
|
|
|
|
|
2018-03-15 20:02:52 +00:00
|
|
|
} // End of namespace Pink
|
|
|
|
|
2018-05-22 03:04:44 +00:00
|
|
|
#endif
|