ScummVM
Sword1::SwordEngine Class Reference

#include <sword1.h>

Inheritance diagram for Sword1::SwordEngine:
Collaboration diagram for Sword1::SwordEngine:

Public Member Functions

 SwordEngine (OSystem *syst)
 
virtual ~SwordEngine ()
 
void reinitialize ()
 
bool mouseIsActive ()
 
- Public Member Functions inherited from Engine
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...
 
 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 void initKeymap ()
 
virtual void deinitKeymap ()
 
virtual void flipMute ()
 Flip mute all sound option. More...
 
void setGameToLoadSlot (int slot)
 Sets the game slot for a savegame to be loaded after global main menu execution. More...
 

Static Public Member Functions

static bool isMac ()
 
static bool isPsx ()
 
static bool isWindows ()
 
- 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 bool warnUserAboutUnsupportedGame ()
 Display a warning to the user that the game is not fully supported. More...
 

Public Attributes

uint32 _features
 
- Public Attributes inherited from Engine
OSystem_system
 
Audio::Mixer_mixer
 

Static Public Attributes

static SystemVars _systemVars
 

Protected Member Functions

Common::Error init ()
 
Common::Error go ()
 
virtual Common::Error run ()
 Init the engine and start its main loop. More...
 
virtual bool hasFeature (EngineFeature f) const
 Determine whether the engine supports the specified feature. 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...
 
GUI::DebuggergetDebugger ()
 Return the engine's debugger instance, if any. More...
 
Common::Error loadGameState (int slot)
 Load a game state. More...
 
bool canLoadGameStateCurrently ()
 Indicates whether a game state can be loaded. More...
 
Common::Error saveGameState (int slot, const Common::String &desc)
 Save a game state. More...
 
bool canSaveGameStateCurrently ()
 Indicates whether a game state can be saved. More...
 
- Protected Member Functions inherited from Engine
virtual int runDialog (GUI::Dialog &dialog)
 
bool shouldPerformAutoSave (int lastSaveTime)
 Indicate whether an autosave should be performed. More...
 
virtual void pauseEngineIntern (bool pause)
 Actual implementation of pauseEngine by subclasses. More...
 

Private Member Functions

void delay (int32 amount)
 
void checkCdFiles ()
 
void checkCd ()
 
void showFileErrorMsg (uint8 type, bool *fileExists)
 
void flagsToBool (bool *dest, uint8 flags)
 
void reinitRes ()
 
uint8 mainLoop ()
 

Private Attributes

SwordConsole_console
 
Common::Point _mouseCoord
 
uint16 _mouseState
 
Common::KeyState _keyPressed
 
ResMan_resMan
 
ObjectMan_objectMan
 
Screen_screen
 
Mouse_mouse
 
Logic_logic
 
Sound_sound
 
Menu_menu
 
Music_music
 
Control_control
 

Static Private Attributes

static const uint8 _cdList [TOTAL_SECTIONS]
 
static const CdFile _pcCdFileList []
 
static const CdFile _macCdFileList []
 
static const CdFile _psxCdFileList []
 

Friends

class SwordConsole
 

Additional Inherited Members

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

Detailed Description

Definition at line 81 of file sword1.h.

Constructor & Destructor Documentation

◆ SwordEngine()

Sword1::SwordEngine::SwordEngine ( OSystem syst)

Definition at line 47 of file sword1.cpp.

◆ ~SwordEngine()

Sword1::SwordEngine::~SwordEngine ( )
virtual

Definition at line 82 of file sword1.cpp.

Member Function Documentation

◆ canLoadGameStateCurrently()

bool Sword1::SwordEngine::canLoadGameStateCurrently ( )
protectedvirtual

Indicates whether a game state can be loaded.

Reimplemented from Engine.

Definition at line 365 of file detection.cpp.

◆ canSaveGameStateCurrently()

bool Sword1::SwordEngine::canSaveGameStateCurrently ( )
protectedvirtual

Indicates whether a game state can be saved.

Reimplemented from Engine.

Definition at line 375 of file detection.cpp.

◆ checkCd()

void Sword1::SwordEngine::checkCd ( )
private

Definition at line 622 of file sword1.cpp.

◆ checkCdFiles()

void Sword1::SwordEngine::checkCdFiles ( )
private

Definition at line 441 of file sword1.cpp.

◆ delay()

void Sword1::SwordEngine::delay ( int32  amount)
private

Definition at line 722 of file sword1.cpp.

◆ flagsToBool()

void Sword1::SwordEngine::flagsToBool ( bool *  dest,
uint8  flags 
)
private

Definition at line 246 of file sword1.cpp.

◆ getDebugger()

GUI::Debugger* Sword1::SwordEngine::getDebugger ( )
inlineprotectedvirtual

Return the engine's debugger instance, if any.

Used by error() to invoke the debugger when a severe error is reported.

Reimplemented from Engine.

Definition at line 111 of file sword1.h.

◆ go()

Common::Error Sword1::SwordEngine::go ( )
protected

Definition at line 577 of file sword1.cpp.

◆ hasFeature()

bool Sword1::SwordEngine::hasFeature ( EngineFeature  f) const
protectedvirtual

Determine whether the engine supports the specified feature.

Reimplemented from Engine.

Definition at line 116 of file detection.cpp.

◆ init()

Common::Error Sword1::SwordEngine::init ( void  )
protected

Definition at line 95 of file sword1.cpp.

◆ isMac()

static bool Sword1::SwordEngine::isMac ( )
inlinestatic

Definition at line 93 of file sword1.h.

◆ isPsx()

static bool Sword1::SwordEngine::isPsx ( )
inlinestatic

Definition at line 94 of file sword1.h.

◆ isWindows()

static bool Sword1::SwordEngine::isWindows ( )
inlinestatic

Definition at line 95 of file sword1.h.

◆ loadGameState()

Common::Error Sword1::SwordEngine::loadGameState ( int  slot)
protectedvirtual

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 355 of file detection.cpp.

◆ mainLoop()

uint8 Sword1::SwordEngine::mainLoop ( )
private

Definition at line 644 of file sword1.cpp.

◆ mouseIsActive()

bool Sword1::SwordEngine::mouseIsActive ( )

Definition at line 765 of file sword1.cpp.

◆ reinitialize()

void Sword1::SwordEngine::reinitialize ( )

Definition at line 172 of file sword1.cpp.

◆ reinitRes()

void Sword1::SwordEngine::reinitRes ( )
private

Definition at line 770 of file sword1.cpp.

◆ run()

virtual Common::Error Sword1::SwordEngine::run ( )
inlineprotectedvirtual

Init the engine and start its main loop.

Returns
returns kNoError on success, else an error code.

Implements Engine.

Definition at line 101 of file sword1.h.

◆ saveGameState()

Common::Error Sword1::SwordEngine::saveGameState ( int  slot,
const Common::String desc 
)
protectedvirtual

Save a game state.

Parameters
slotthe slot into which the savestate should be stored
desca description for the savestate, entered by the user
Returns
returns kNoError on success, else an error code.

Reimplemented from Engine.

Definition at line 369 of file detection.cpp.

◆ showFileErrorMsg()

void Sword1::SwordEngine::showFileErrorMsg ( uint8  type,
bool *  fileExists 
)
private

Definition at line 365 of file sword1.cpp.

◆ syncSoundSettings()

void Sword1::SwordEngine::syncSoundSettings ( )
protectedvirtual

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 183 of file sword1.cpp.

Friends And Related Function Documentation

◆ SwordConsole

friend class SwordConsole
friend

Definition at line 82 of file sword1.h.

Member Data Documentation

◆ _cdList

const uint8 Sword1::SwordEngine::_cdList
staticprivate

Definition at line 145 of file sword1.h.

◆ _console

SwordConsole* Sword1::SwordEngine::_console
private

Definition at line 128 of file sword1.h.

◆ _control

Control* Sword1::SwordEngine::_control
private

Definition at line 144 of file sword1.h.

◆ _features

uint32 Sword1::SwordEngine::_features

Definition at line 89 of file sword1.h.

◆ _keyPressed

Common::KeyState Sword1::SwordEngine::_keyPressed
private

Definition at line 134 of file sword1.h.

◆ _logic

Logic* Sword1::SwordEngine::_logic
private

Definition at line 140 of file sword1.h.

◆ _macCdFileList

const CdFile Sword1::SwordEngine::_macCdFileList
staticprivate

Definition at line 147 of file sword1.h.

◆ _menu

Menu* Sword1::SwordEngine::_menu
private

Definition at line 142 of file sword1.h.

◆ _mouse

Mouse* Sword1::SwordEngine::_mouse
private

Definition at line 139 of file sword1.h.

◆ _mouseCoord

Common::Point Sword1::SwordEngine::_mouseCoord
private

Definition at line 132 of file sword1.h.

◆ _mouseState

uint16 Sword1::SwordEngine::_mouseState
private

Definition at line 133 of file sword1.h.

◆ _music

Music* Sword1::SwordEngine::_music
private

Definition at line 143 of file sword1.h.

◆ _objectMan

ObjectMan* Sword1::SwordEngine::_objectMan
private

Definition at line 137 of file sword1.h.

◆ _pcCdFileList

const CdFile Sword1::SwordEngine::_pcCdFileList
staticprivate

Definition at line 146 of file sword1.h.

◆ _psxCdFileList

const CdFile Sword1::SwordEngine::_psxCdFileList
staticprivate
Initial value:
= {
{ "paris2.clu", FLAG_CD1 },
{ "ireland.clu", FLAG_CD1 },
{ "paris3.clu", FLAG_CD1 },
{ "paris4.clu", FLAG_CD1 },
{ "scotland.clu", FLAG_CD1 },
{ "spain.clu", FLAG_CD1 },
{ "syria.clu", FLAG_CD1 },
{ "train.clu", FLAG_CD1 },
{ "train.plx", FLAG_CD1 },
{ "compacts.clu", FLAG_CD1 | FLAG_DEMO | FLAG_IMMED },
{ "general.clu", FLAG_CD1 | FLAG_DEMO | FLAG_IMMED },
{ "maps.clu", FLAG_CD1 | FLAG_DEMO },
{ "paris1.clu", FLAG_CD1 | FLAG_DEMO},
{ "scripts.clu", FLAG_CD1 | FLAG_DEMO | FLAG_IMMED },
{ "swordres.rif", FLAG_CD1 | FLAG_DEMO | FLAG_IMMED },
{ "text.clu", FLAG_CD1 | FLAG_DEMO },
{ "speech.dat", FLAG_SPEECH1 | FLAG_DEMO },
{ "speech.tab", FLAG_SPEECH1 | FLAG_DEMO },
{ "speech.inf", FLAG_SPEECH1 | FLAG_DEMO },
{ "speech.lis", FLAG_SPEECH1 | FLAG_DEMO }
}

Definition at line 148 of file sword1.h.

◆ _resMan

ResMan* Sword1::SwordEngine::_resMan
private

Definition at line 136 of file sword1.h.

◆ _screen

Screen* Sword1::SwordEngine::_screen
private

Definition at line 138 of file sword1.h.

◆ _sound

Sound* Sword1::SwordEngine::_sound
private

Definition at line 141 of file sword1.h.

◆ _systemVars

SystemVars Sword1::SwordEngine::_systemVars
static

Definition at line 86 of file sword1.h.


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