ScummVM
Sky::SkyEngine Class Reference

#include <sky.h>

+ Inheritance diagram for Sky::SkyEngine:
+ Collaboration diagram for Sky::SkyEngine:

Public Member Functions

 SkyEngine (OSystem *syst)
 
 ~SkyEngine () override
 
void syncSoundSettings () override
 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...
 
Common::Error loadGameState (int slot) override
 Load a game state. More...
 
Common::Error saveGameState (int slot, const Common::String &desc, bool isAutosave=false) override
 Save a game state. More...
 
bool canLoadGameStateCurrently () override
 Indicates whether a game state can be loaded. 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...
 
- 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 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 bool isDemo ()
 
static bool isCDVersion ()
 
static void * fetchItem (uint32 num)
 
- 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...
 

Static Public Attributes

static void * _itemList [300]
 
static SystemVars _systemVars = {0, 0, 0, 0, 4316, 0, 0, false, false }
 
static const char * shortcutsKeymapId = "sky-shortcuts"
 

Protected Member Functions

Common::Error init ()
 
Common::Error go ()
 
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...
 
void delay (int32 amount)
 
void handleKey ()
 
void initItemList ()
 
void initVirgin ()
 
void loadFixedItems ()
 
- Protected Member Functions inherited from Engine
virtual int runDialog (GUI::Dialog &dialog)
 
virtual void pauseEngineIntern (bool pause)
 Actual implementation of pauseEngine by subclasses. More...
 

Protected Attributes

SkyAction _action
 
Common::KeyState _keyPressed
 
Sound_skySound
 
Disk_skyDisk
 
Text_skyText
 
Logic_skyLogic
 
Mouse_skyMouse
 
Screen_skyScreen
 
Control_skyControl
 
SkyCompact_skyCompact
 
Debugger_debugger
 
MusicBase_skyMusic
 
byte _fastMode
 
- Protected Attributes inherited from Engine
Common::TimerManager_timer
 
Common::EventManager_eventMan
 
Common::SaveFileManager_saveFileMan
 
GUI::Dialog_mainMenuDialog
 
const Common::String _targetName
 

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
OSystem_system
 
Audio::Mixer_mixer
 

Detailed Description

Definition at line 75 of file sky.h.

Constructor & Destructor Documentation

◆ SkyEngine()

Sky::SkyEngine::SkyEngine ( OSystem syst)

Definition at line 77 of file sky.cpp.

◆ ~SkyEngine()

Sky::SkyEngine::~SkyEngine ( )
override

Definition at line 81 of file sky.cpp.

Member Function Documentation

◆ canLoadGameStateCurrently()

bool Sky::SkyEngine::canLoadGameStateCurrently ( )
overridevirtual

Indicates whether a game state can be loaded.

Reimplemented from Engine.

Definition at line 408 of file detection.cpp.

◆ canSaveGameStateCurrently()

bool Sky::SkyEngine::canSaveGameStateCurrently ( )
overridevirtual

Indicates whether a game state can be saved.

Reimplemented from Engine.

Definition at line 412 of file detection.cpp.

◆ delay()

void Sky::SkyEngine::delay ( int32  amount)
protected

Definition at line 382 of file sky.cpp.

◆ fetchItem()

void * Sky::SkyEngine::fetchItem ( uint32  num)
static

Definition at line 378 of file sky.cpp.

◆ getSaveStateName()

virtual Common::String Sky::SkyEngine::getSaveStateName ( int  slot) const
inlineoverridevirtual

Generates the savegame filename.

Reimplemented from Engine.

Definition at line 105 of file sky.h.

◆ go()

Common::Error Sky::SkyEngine::go ( )
protected

Definition at line 162 of file sky.cpp.

◆ handleKey()

void Sky::SkyEngine::handleKey ( )
protected

Definition at line 119 of file sky.cpp.

◆ hasFeature()

bool Sky::SkyEngine::hasFeature ( EngineFeature  f) const
overrideprotectedvirtual

Determine whether the engine supports the specified feature.

Reimplemented from Engine.

Definition at line 114 of file detection.cpp.

◆ init()

Common::Error Sky::SkyEngine::init ( void  )
protected

Definition at line 243 of file sky.cpp.

◆ initItemList()

void Sky::SkyEngine::initItemList ( )
protected

Definition at line 352 of file sky.cpp.

◆ initVirgin()

void Sky::SkyEngine::initVirgin ( )
protected

Definition at line 114 of file sky.cpp.

◆ isCDVersion()

bool Sky::SkyEngine::isCDVersion ( )
static

Definition at line 447 of file sky.cpp.

◆ isDemo()

bool Sky::SkyEngine::isDemo ( )
static

Definition at line 428 of file sky.cpp.

◆ loadFixedItems()

void Sky::SkyEngine::loadFixedItems ( )
protected

Definition at line 359 of file sky.cpp.

◆ loadGameState()

Common::Error Sky::SkyEngine::loadGameState ( int  slot)
overridevirtual

Load a game state.

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

Reimplemented from Engine.

Definition at line 382 of file detection.cpp.

◆ run()

Common::Error Sky::SkyEngine::run ( )
inlineoverrideprotectedvirtual

Init the engine and start its main loop.

Returns
returns kNoError on success, else an error code.

Implements Engine.

Definition at line 120 of file sky.h.

◆ saveGameState()

Common::Error Sky::SkyEngine::saveGameState ( int  slot,
const Common::String desc,
bool  isAutosave = false 
)
overridevirtual

Save a game state.

Parameters
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
returns kNoError on success, else an error code.

Reimplemented from Engine.

Definition at line 387 of file detection.cpp.

◆ syncSoundSettings()

void Sky::SkyEngine::syncSoundSettings ( )
overridevirtual

Notify the engine that the sound settings in the config manager may have changed and that it hence should adjust any internal volume etc.

values accordingly. The default implementation sets the volume levels of all mixer sound types according to the config entries of the active domain. When overwriting, call the default implementation first, then adjust the volumes further (if required).

Note
When setting volume levels, respect the "mute" config entry.
The volume for the plain sound type is reset to the maximum volume. If the engine can associate its own value for this type, it needs to overwrite this member and set it accordingly.
Todo:
find a better name for this

Reimplemented from Engine.

Definition at line 98 of file sky.cpp.

Member Data Documentation

◆ _action

SkyAction Sky::SkyEngine::_action
protected

Definition at line 77 of file sky.h.

◆ _debugger

Debugger* Sky::SkyEngine::_debugger
protected

Definition at line 88 of file sky.h.

◆ _fastMode

byte Sky::SkyEngine::_fastMode
protected

Definition at line 130 of file sky.h.

◆ _itemList

void * Sky::SkyEngine::_itemList
static

Definition at line 110 of file sky.h.

◆ _keyPressed

Common::KeyState Sky::SkyEngine::_keyPressed
protected

Definition at line 78 of file sky.h.

◆ _skyCompact

SkyCompact* Sky::SkyEngine::_skyCompact
protected

Definition at line 87 of file sky.h.

◆ _skyControl

Control* Sky::SkyEngine::_skyControl
protected

Definition at line 86 of file sky.h.

◆ _skyDisk

Disk* Sky::SkyEngine::_skyDisk
protected

Definition at line 81 of file sky.h.

◆ _skyLogic

Logic* Sky::SkyEngine::_skyLogic
protected

Definition at line 83 of file sky.h.

◆ _skyMouse

Mouse* Sky::SkyEngine::_skyMouse
protected

Definition at line 84 of file sky.h.

◆ _skyMusic

MusicBase* Sky::SkyEngine::_skyMusic
protected

Definition at line 90 of file sky.h.

◆ _skyScreen

Screen* Sky::SkyEngine::_skyScreen
protected

Definition at line 85 of file sky.h.

◆ _skySound

Sound* Sky::SkyEngine::_skySound
protected

Definition at line 80 of file sky.h.

◆ _skyText

Text* Sky::SkyEngine::_skyText
protected

Definition at line 82 of file sky.h.

◆ _systemVars

SystemVars Sky::SkyEngine::_systemVars = {0, 0, 0, 0, 4316, 0, 0, false, false }
static

Definition at line 112 of file sky.h.

◆ shortcutsKeymapId

const char * Sky::SkyEngine::shortcutsKeymapId = "sky-shortcuts"
static

Definition at line 114 of file sky.h.


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