scummvm/engines/pink/pink.h

179 lines
4.4 KiB
C
Raw Normal View History

/* 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.
*
* 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.
*
* 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
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef PINK_PINK_H
#define PINK_PINK_H
#include "common/random.h"
#include "common/savefile.h"
2018-05-21 09:30:27 +00:00
#include "engines/engine.h"
#include "engines/savestate.h"
2018-05-21 09:30:27 +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"
#include "pink/pda_mgr.h"
/*
* This is the namespace of the Pink engine.
*
* Status of this engine: In Development
*
* Internal name of original engine: OxCart Runtime
*
* Games using this engine:
* - The Pink Panther: Passport to Peril
* - The Pink Panther: Hokus Pokus Pink
*
* Peril game status:
* Fully playable*
*
* Pokus game status:
2018-05-13 11:06:57 +00:00
* Fully Playable*
*
* Known bugs:
2020-06-05 16:49:55 +00:00
* PDA is partially usable(ActionText is not implemented)
*/
struct ADGameDescription;
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
}
namespace Pink {
class Console;
class Director;
class Archive;
class NamedObject;
class Module;
class Page;
class LeadActor;
enum {
2018-05-22 05:03:37 +00:00
kPinkDebugGeneral = 1 << 0,
kPinkDebugLoadingResources = 1 << 1,
kPinkDebugLoadingObjects = 1 << 2,
kPinkDebugScripts = 1 << 3,
kPinkDebugActions = 1 << 4
};
class PinkEngine : public Engine {
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-06-13 10:28:24 +00:00
Common::Error run() override;
2018-06-13 10:28:24 +00:00
bool hasFeature(EngineFeature f) const override;
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;
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
2018-06-13 10:28:24 +00:00
bool canSaveGameStateCurrently() override;
Common::String getSaveStateName(int slot) const override {
return Common::String::format("%s.s%02d", _targetName.c_str(), slot);
}
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-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-07-22 18:26:09 +00:00
void executeMenuCommand(uint id);
bool executePageChangeCommand(uint id);
2018-07-22 18:26:09 +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; };
Director *getDirector() { return _director; }
2018-06-10 07:54:08 +00:00
PDAMgr &getPdaMgr() { return _pdaMgr; }
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);
private:
2018-05-22 05:03:37 +00:00
Common::Error init();
2018-06-13 10:28:24 +00:00
void initMenu();
2018-07-22 18:26:09 +00:00
bool loadCursors();
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;
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-05-22 05:03:37 +00:00
Common::String _nextModule;
Common::String _nextPage;
Common::PEResources *_exeResources;
2018-05-22 05:03:37 +00:00
OrbFile _orb;
BroFile *_bro;
2018-07-22 18:26:09 +00:00
Graphics::MacMenu *_menu;
Director *_director;
2018-05-22 05:03:37 +00:00
LeadActor *_actor;
2018-05-22 05:03:37 +00:00
Module *_module;
2018-05-22 08:58:02 +00:00
Array<NamedObject *> _modules;
StringMap _variables;
PDAMgr _pdaMgr;
const ADGameDescription *_desc;
};
WARN_UNUSED_RESULT bool readSaveHeader(Common::InSaveFile &in, SaveStateDescriptor &desc, bool skipThumbnail = true);
Common::String generateSaveName(int slot, const char *gameId);
} // End of namespace Pink
2018-05-22 03:04:44 +00:00
#endif