Pink::PinkEngine Class Reference

#include <pink.h>

+ Inheritance diagram for Pink::PinkEngine:
+ Collaboration diagram for Pink::PinkEngine:

Public Member Functions

 PinkEngine (OSystem *system, const ADGameDescription *desc)
 ~PinkEngine () override
Common::Error run () override
 Init the engine and start its main loop. More...
bool hasFeature (EngineFeature f) const override
 Determine whether the engine supports the specified feature. More...
Common::Error loadGameState (int slot) override
 Load a game state. More...
bool canLoadGameStateCurrently () override
 Indicates whether a game state can be loaded. More...
Common::Error saveGameState (int slot, const Common::String &desc, bool isAutosave=false) override
 Save a game state. More...
bool canSaveGameStateCurrently () override
 Indicates whether a game state can be saved. More...
virtual Common::String getSaveStateName (int slot) const override
 Generates the savegame filename. More...
void load (Archive &archive)
void changeScene ()
bool isPeril () const
void setVariable (Common::String &variable, Common::String &value)
bool checkValueOfVariable (const Common::String &variable, const Common::String &value) const
void executeMenuCommand (uint id)
Common::Language getLanguage () const
OrbFilegetOrb ()
BroFilegetBro ()
Common::RandomSourcegetRnd ()
DirectorgetDirector ()
PDAMgrgetPdaMgr ()
void setNextExecutors (const Common::String &nextModule, const Common::String &nextPage)
void setLeadActor (LeadActor *actor)
void setCursor (uint cursorIndex)
- Public Member Functions inherited from Engine
 Engine (OSystem *syst)
virtual ~Engine ()
virtual void initializePath (const Common::FSNode &gamePath)
 Init SearchMan according to the game path. More...
virtual void errorString (const char *buf_input, char *buf_output, int buf_output_size)
 Prepare an error string, which is printed by the error() function. More...
virtual GUI::DebuggergetDebugger ()
 Return the engine's debugger instance, if any. More...
void setDebugger (GUI::Debugger *debugger)
 Sets the engine's debugger. More...
GUI::DebuggergetOrCreateDebugger ()
 Return the engine's debugger instance, or create one if none is present. More...
virtual void syncSoundSettings ()
 Notify the engine that the sound settings in the config manager may have changed and that it hence should adjust any internal volume etc. More...
virtual void flipMute ()
 Flip mute all sound option. More...
virtual Common::Error loadGameStream (Common::SeekableReadStream *stream)
 Load a game state. More...
void setGameToLoadSlot (int slot)
 Sets the game slot for a savegame to be loaded after global main menu execution. More...
virtual Common::Error saveGameStream (Common::WriteStream *stream, bool isAutosave=false)
 Save a game state. More...
bool saveGameDialog ()
 Shows the ScummVM save dialog, allowing users to save their game. More...
bool loadGameDialog ()
 Shows the ScummVM Restore dialog, allowing users to load a game. More...
void pauseEngine (bool pause)
 Pause or resume the engine. More...
bool isPaused () const
 Return whether the engine is currently paused or not. More...
void openMainMenuDialog ()
 Run the Global Main Menu Dialog. More...
uint32 getTotalPlayTime () const
 Get the total play time. More...
void setTotalPlayTime (uint32 time=0)
 Set the game time counter to the specified time. More...
Common::TimerManagergetTimerManager ()
Common::EventManagergetEventManager ()
Common::SaveFileManagergetSaveFileManager ()
void checkCD ()
 On some systems, check if the game appears to be run from CD. More...
void handleAutoSave ()
 Checks for whether it's time to do an autosave, and if so, does it. More...
void saveAutosaveIfEnabled ()
 Does an autosave immediately if autosaves are turned on. More...
virtual bool canSaveAutosaveCurrently ()
 Indicates whether an autosave can currently be saved. More...
virtual int getAutosaveSlot () const
 Returns the slot that should be used for autosaves. More...
bool shouldPerformAutoSave (int lastSaveTime)

Static Public Member Functions

static void pauseEngine (void *engine, bool pause)
- Static Public Member Functions inherited from Engine
static void quitGame ()
 Request the engine to quit. More...
static bool shouldQuit ()
 Return whether the ENGINE should quit respectively should return to the launcher. More...
static MetaEnginegetMetaEngine ()
static bool warnUserAboutUnsupportedGame ()
 Display a warning to the user that the game is not fully supported. More...

Protected Member Functions

void pauseEngineIntern (bool pause) override
 Actual implementation of pauseEngine by subclasses. More...
- Protected Member Functions inherited from Engine
virtual int runDialog (GUI::Dialog &dialog)

Private Member Functions

Common::Error init ()
void initMenu ()
bool loadCursors ()
void initModule (const Common::String &moduleName, const Common::String &pageName, Archive *saveFile)
void addModule (const Common::String &moduleName)
void removeModule ()
void openLocalWebPage (const Common::String &pageName) const

Private Attributes

Common::RandomSource _rnd
Common::Array< Graphics::WinCursorGroup * > _cursors
Common::String _nextModule
Common::String _nextPage
OrbFile _orb
Array< NamedObject * > _modules
StringMap _variables
PDAMgr _pdaMgr
const ADGameDescription_desc


class Console

Additional Inherited Members

- Public Types inherited from Engine
enum  EngineFeature { kSupportsSubtitleOptions, kSupportsRTL, kSupportsLoadingDuringRuntime, kSupportsSavingDuringRuntime }
 A feature in this context means an ability of the engine which can be either available or not. More...
- Public Attributes inherited from Engine
- Protected Attributes inherited from Engine
const Common::String _targetName

Detailed Description

Definition at line 90 of file pink.h.

Constructor & Destructor Documentation

◆ PinkEngine()

Pink::PinkEngine::PinkEngine ( OSystem system,
const ADGameDescription desc 

Definition at line 43 of file pink.cpp.

◆ ~PinkEngine()

Pink::PinkEngine::~PinkEngine ( )

Definition at line 58 of file pink.cpp.

Member Function Documentation

◆ addModule()

void Pink::PinkEngine::addModule ( const Common::String moduleName)

Definition at line 196 of file pink.cpp.

◆ canLoadGameStateCurrently()

bool Pink::PinkEngine::canLoadGameStateCurrently ( )

Indicates whether a game state can be loaded.

Reimplemented from Engine.

Definition at line 279 of file pink.cpp.

◆ canSaveGameStateCurrently()

bool Pink::PinkEngine::canSaveGameStateCurrently ( )

Indicates whether a game state can be saved.

Reimplemented from Engine.

Definition at line 283 of file pink.cpp.

◆ changeScene()

void Pink::PinkEngine::changeScene ( )

Definition at line 186 of file pink.cpp.

◆ checkValueOfVariable()

bool Pink::PinkEngine::checkValueOfVariable ( const Common::String variable,
const Common::String value 
) const

Definition at line 226 of file pink.cpp.

◆ executeMenuCommand()

void Pink::PinkEngine::executeMenuCommand ( uint  id)

Definition at line 142 of file gui.cpp.

◆ getBro()

BroFile* Pink::PinkEngine::getBro ( )

Definition at line 129 of file pink.h.

◆ getDirector()

Director* Pink::PinkEngine::getDirector ( )

Definition at line 131 of file pink.h.

◆ getLanguage()

Common::Language Pink::PinkEngine::getLanguage ( ) const

Definition at line 31 of file detection.cpp.

◆ getOrb()

OrbFile* Pink::PinkEngine::getOrb ( )

Definition at line 128 of file pink.h.

◆ getPdaMgr()

PDAMgr& Pink::PinkEngine::getPdaMgr ( )

Definition at line 132 of file pink.h.

◆ getRnd()

Common::RandomSource& Pink::PinkEngine::getRnd ( )

Definition at line 130 of file pink.h.

◆ getSaveStateName()

virtual Common::String Pink::PinkEngine::getSaveStateName ( int  slot) const

Generates the savegame filename.

Reimplemented from Engine.

Definition at line 104 of file pink.h.

◆ hasFeature()

bool Pink::PinkEngine::hasFeature ( Engine::EngineFeature  f) const

Determine whether the engine supports the specified feature.

Reimplemented from Engine.

Definition at line 287 of file pink.cpp.

◆ init()

Common::Error Pink::PinkEngine::init ( void  )

Definition at line 72 of file pink.cpp.

◆ initMenu()

void Pink::PinkEngine::initMenu ( )

Definition at line 134 of file gui.cpp.

◆ initModule()

void Pink::PinkEngine::initModule ( const Common::String moduleName,
const Common::String pageName,
Archive saveFile 

Definition at line 173 of file pink.cpp.

◆ isPeril()

bool Pink::PinkEngine::isPeril ( ) const

Definition at line 299 of file pink.cpp.

◆ load()

void Pink::PinkEngine::load ( Archive archive)

Definition at line 167 of file pink.cpp.

◆ loadCursors()

bool Pink::PinkEngine::loadCursors ( )

Definition at line 232 of file pink.cpp.

◆ loadGameState()

Common::Error Pink::PinkEngine::loadGameState ( int  slot)

Load a game state.

slotthe slot from which a savestate should be loaded
returns kNoError on success, else an error code.

Reimplemented from Engine.

Definition at line 32 of file saveload.cpp.

◆ openLocalWebPage()

void Pink::PinkEngine::openLocalWebPage ( const Common::String pageName) const

Definition at line 365 of file gui.cpp.

◆ pauseEngine()

void Pink::PinkEngine::pauseEngine ( void *  engine,
bool  pause 

Definition at line 162 of file pink.cpp.

◆ pauseEngineIntern()

void Pink::PinkEngine::pauseEngineIntern ( bool  pause)

Actual implementation of pauseEngine by subclasses.

See there for details.

Reimplemented from Engine.

Definition at line 294 of file pink.cpp.

◆ removeModule()

void Pink::PinkEngine::removeModule ( )

Definition at line 210 of file pink.cpp.

◆ run()

Common::Error Pink::PinkEngine::run ( )

Init the engine and start its main loop.

returns kNoError on success, else an error code.

Implements Engine.

Definition at line 118 of file pink.cpp.

◆ saveGameState()

Common::Error Pink::PinkEngine::saveGameState ( int  slot,
const Common::String desc,
bool  isAutosave = false 

Save a game state.

slotthe slot into which the savestate should be stored
desca description for the savestate, entered by the user
isAutosaveExpected to be true if an autosave is being created
returns kNoError on success, else an error code.

Reimplemented from Engine.

Definition at line 52 of file saveload.cpp.

◆ setCursor()

void Pink::PinkEngine::setCursor ( uint  cursorIndex)

Definition at line 271 of file pink.cpp.

◆ setLeadActor()

void Pink::PinkEngine::setLeadActor ( LeadActor actor)

Definition at line 135 of file pink.h.

◆ setNextExecutors()

void Pink::PinkEngine::setNextExecutors ( const Common::String nextModule,
const Common::String nextPage 

Definition at line 134 of file pink.h.

◆ setVariable()

void Pink::PinkEngine::setVariable ( Common::String variable,
Common::String value 

Definition at line 222 of file pink.cpp.

Friends And Related Function Documentation

◆ Console

friend class Console

Definition at line 110 of file pink.h.

Member Data Documentation

◆ _actor

LeadActor* Pink::PinkEngine::_actor

Definition at line 165 of file pink.h.

◆ _bro

BroFile* Pink::PinkEngine::_bro

Definition at line 161 of file pink.h.

◆ _cursors

Common::Array<Graphics::WinCursorGroup *> Pink::PinkEngine::_cursors

Definition at line 153 of file pink.h.

◆ _desc

const ADGameDescription* Pink::PinkEngine::_desc

Definition at line 173 of file pink.h.

◆ _director

Director* Pink::PinkEngine::_director

Definition at line 164 of file pink.h.

◆ _exeResources

Common::PEResources* Pink::PinkEngine::_exeResources

Definition at line 158 of file pink.h.

◆ _menu

Graphics::MacMenu* Pink::PinkEngine::_menu

Definition at line 163 of file pink.h.

◆ _module

Module* Pink::PinkEngine::_module

Definition at line 167 of file pink.h.

◆ _modules

Array<NamedObject *> Pink::PinkEngine::_modules

Definition at line 168 of file pink.h.

◆ _nextModule

Common::String Pink::PinkEngine::_nextModule

Definition at line 155 of file pink.h.

◆ _nextPage

Common::String Pink::PinkEngine::_nextPage

Definition at line 156 of file pink.h.

◆ _orb

OrbFile Pink::PinkEngine::_orb

Definition at line 160 of file pink.h.

◆ _pdaMgr

PDAMgr Pink::PinkEngine::_pdaMgr

Definition at line 171 of file pink.h.

◆ _rnd

Common::RandomSource Pink::PinkEngine::_rnd

Definition at line 152 of file pink.h.

◆ _variables

StringMap Pink::PinkEngine::_variables

Definition at line 170 of file pink.h.

The documentation for this class was generated from the following files: