ScummVM
Toltecs::ToltecsEngine Class Reference

#include <toltecs.h>

Inheritance diagram for Toltecs::ToltecsEngine:
Collaboration diagram for Toltecs::ToltecsEngine:

Classes

struct  SaveHeader
 

Public Types

enum  kReadSaveHeaderError { kRSHENoError = 0, kRSHEInvalidType = 1, kRSHEInvalidVersion = 2, kRSHEIoError = 3 }
 
- 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...
 

Public Member Functions

 ToltecsEngine (OSystem *syst, const ToltecsGameDescription *gameDesc)
 
virtual ~ToltecsEngine ()
 
virtual bool hasFeature (EngineFeature f) const
 Determine whether the engine supports the specified feature. More...
 
uint32 getFeatures () const
 
Common::Language getLanguage () const
 
const Common::StringgetTargetName () const
 
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...
 
void setupSysStrings ()
 
void requestSavegame (int slotNum, Common::String &description)
 
void requestLoadgame (int slotNum)
 
void loadScene (uint resIndex)
 
void updateScreen ()
 
void drawScreen ()
 
void updateInput ()
 
void setGuiHeight (int16 guiHeight)
 
void setCamera (int16 x, int16 y)
 
bool getCameraChanged ()
 
void scrollCameraUp (int16 delta)
 
void scrollCameraDown (int16 delta)
 
void scrollCameraLeft (int16 delta)
 
void scrollCameraRight (int16 delta)
 
void updateCamera ()
 
void showMenu (MenuID menuId)
 
void talk (int16 slotIndex, int16 slotOffset)
 
void walk (byte *walkData)
 
int16 findRectAtPoint (byte *rectData, int16 x, int16 y, int16 index, int16 itemSize, byte *rectDataEnd)
 
const char * getSysString (int index) const
 
bool canLoadGameStateCurrently ()
 Indicates whether a game state can be loaded. More...
 
bool canSaveGameStateCurrently ()
 Indicates whether a game state can be saved. More...
 
Common::Error loadGameState (int slot)
 Load a game state. More...
 
Common::Error saveGameState (int slot, const Common::String &description)
 Save a game state. More...
 
void savegame (const char *filename, const char *description)
 
void loadgame (const char *filename)
 
const char * getSavegameFilename (int num)
 
- 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 Common::String getSavegameFilename (const Common::String &target, int num)
 
static WARN_UNUSED_RESULT kReadSaveHeaderError readSaveHeader (Common::SeekableReadStream *in, SaveHeader &header, bool skipThumbnail=true)
 
- 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

Common::RandomSource_rnd
 
const ToltecsGameDescription_gameDescription
 
int _cfgVoicesVolume
 
int _cfgMusicVolume
 
int _cfgSoundFXVolume
 
bool _cfgText
 
bool _cfgVoices
 
AnimationPlayer_anim
 
ArchiveReader_arc
 
Console_console
 
Input * _input
 
MenuSystem_menuSystem
 
MoviePlayer_moviePlayer
 
Music_music
 
Palette_palette
 
ResourceCache_res
 
ScriptInterpreter_script
 
Screen_screen
 
SegmentMap_segmap
 
Sound_sound
 
Common::String _sysStrings [kSysStrCount]
 
int _saveLoadRequested
 
int _saveLoadSlot
 
Common::String _saveLoadDescription
 
uint _sceneResIndex
 
int16 _sceneWidth
 
int16 _sceneHeight
 
int _counter01
 
int _counter02
 
bool _movieSceneFlag
 
byte _flag01
 
int16 _cameraX
 
int16 _cameraY
 
int16 _newCameraX
 
int16 _newCameraY
 
int16 _cameraHeight
 
int16 _guiHeight
 
bool _doSpeech
 
bool _doText
 
int16 _walkSpeedY
 
int16 _walkSpeedX
 
Common::KeyState _keyState
 
int16 _mouseX
 
int16 _mouseY
 
int16 _mouseDblClickTicks
 
bool _mouseWaitForRelease
 
byte _mouseButton
 
int16 _mouseDisabled
 
bool _leftButtonDown
 
bool _rightButtonDown
 
bool _isSaveAllowed
 
- Public Attributes inherited from Engine
OSystem_system
 
Audio::Mixer_mixer
 

Protected Member Functions

Common::Error run ()
 Init the engine and start its main loop. 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 Attributes

Common::KeyState _keyPressed
 

Additional Inherited Members

- 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 95 of file toltecs.h.

Member Enumeration Documentation

◆ kReadSaveHeaderError

Enumerator
kRSHENoError 
kRSHEInvalidType 
kRSHEInvalidVersion 
kRSHEIoError 

Definition at line 198 of file toltecs.h.

Constructor & Destructor Documentation

◆ ToltecsEngine()

Toltecs::ToltecsEngine::ToltecsEngine ( OSystem syst,
const ToltecsGameDescription gameDesc 
)

Definition at line 64 of file toltecs.cpp.

◆ ~ToltecsEngine()

Toltecs::ToltecsEngine::~ToltecsEngine ( )
virtual

Definition at line 68 of file toltecs.cpp.

Member Function Documentation

◆ canLoadGameStateCurrently()

bool Toltecs::ToltecsEngine::canLoadGameStateCurrently ( )
inlinevirtual

Indicates whether a game state can be loaded.

Reimplemented from Engine.

Definition at line 218 of file toltecs.h.

◆ canSaveGameStateCurrently()

bool Toltecs::ToltecsEngine::canSaveGameStateCurrently ( )
inlinevirtual

Indicates whether a game state can be saved.

Reimplemented from Engine.

Definition at line 219 of file toltecs.h.

◆ drawScreen()

void Toltecs::ToltecsEngine::drawScreen ( )

Definition at line 290 of file toltecs.cpp.

◆ findRectAtPoint()

int16 Toltecs::ToltecsEngine::findRectAtPoint ( byte rectData,
int16  x,
int16  y,
int16  index,
int16  itemSize,
byte rectDataEnd 
)

Definition at line 610 of file toltecs.cpp.

◆ getCameraChanged()

bool Toltecs::ToltecsEngine::getCameraChanged ( )

Definition at line 429 of file toltecs.cpp.

◆ getDebugger()

GUI::Debugger* Toltecs::ToltecsEngine::getDebugger ( )
inlinevirtual

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 115 of file toltecs.h.

◆ getFeatures()

uint32 Toltecs::ToltecsEngine::getFeatures ( ) const

Definition at line 41 of file detection.cpp.

◆ getLanguage()

Common::Language Toltecs::ToltecsEngine::getLanguage ( ) const

Definition at line 45 of file detection.cpp.

◆ getSavegameFilename() [1/2]

const char * Toltecs::ToltecsEngine::getSavegameFilename ( int  num)

Definition at line 214 of file saveload.cpp.

◆ getSavegameFilename() [2/2]

Common::String Toltecs::ToltecsEngine::getSavegameFilename ( const Common::String target,
int  num 
)
static

Definition at line 220 of file saveload.cpp.

◆ getSysString()

const char* Toltecs::ToltecsEngine::getSysString ( int  index) const
inline

Definition at line 194 of file toltecs.h.

◆ getTargetName()

const Common::String& Toltecs::ToltecsEngine::getTargetName ( ) const
inline

Definition at line 112 of file toltecs.h.

◆ hasFeature()

bool Toltecs::ToltecsEngine::hasFeature ( EngineFeature  f) const
virtual

Determine whether the engine supports the specified feature.

Reimplemented from Engine.

Definition at line 258 of file detection.cpp.

◆ loadgame()

void Toltecs::ToltecsEngine::loadgame ( const char *  filename)

Definition at line 139 of file saveload.cpp.

◆ loadGameState()

Common::Error Toltecs::ToltecsEngine::loadGameState ( int  slot)
virtual

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 202 of file saveload.cpp.

◆ loadScene()

void Toltecs::ToltecsEngine::loadScene ( uint  resIndex)

Definition at line 218 of file toltecs.cpp.

◆ readSaveHeader()

WARN_UNUSED_RESULT ToltecsEngine::kReadSaveHeaderError Toltecs::ToltecsEngine::readSaveHeader ( Common::SeekableReadStream in,
SaveHeader header,
bool  skipThumbnail = true 
)
static

Definition at line 44 of file saveload.cpp.

◆ requestLoadgame()

void Toltecs::ToltecsEngine::requestLoadgame ( int  slotNum)

Definition at line 213 of file toltecs.cpp.

◆ requestSavegame()

void Toltecs::ToltecsEngine::requestSavegame ( int  slotNum,
Common::String description 
)

Definition at line 207 of file toltecs.cpp.

◆ run()

Common::Error Toltecs::ToltecsEngine::run ( )
protectedvirtual

Init the engine and start its main loop.

Returns
returns kNoError on success, else an error code.

Implements Engine.

Definition at line 72 of file toltecs.cpp.

◆ savegame()

void Toltecs::ToltecsEngine::savegame ( const char *  filename,
const char *  description 
)

Definition at line 76 of file saveload.cpp.

◆ saveGameState()

Common::Error Toltecs::ToltecsEngine::saveGameState ( int  slot,
const Common::String desc 
)
virtual

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 208 of file saveload.cpp.

◆ scrollCameraDown()

void Toltecs::ToltecsEngine::scrollCameraDown ( int16  delta)

Definition at line 442 of file toltecs.cpp.

◆ scrollCameraLeft()

void Toltecs::ToltecsEngine::scrollCameraLeft ( int16  delta)

Definition at line 452 of file toltecs.cpp.

◆ scrollCameraRight()

void Toltecs::ToltecsEngine::scrollCameraRight ( int16  delta)

Definition at line 461 of file toltecs.cpp.

◆ scrollCameraUp()

void Toltecs::ToltecsEngine::scrollCameraUp ( int16  delta)

Definition at line 433 of file toltecs.cpp.

◆ setCamera()

void Toltecs::ToltecsEngine::setCamera ( int16  x,
int16  y 
)

Definition at line 419 of file toltecs.cpp.

◆ setGuiHeight()

void Toltecs::ToltecsEngine::setGuiHeight ( int16  guiHeight)

Definition at line 409 of file toltecs.cpp.

◆ setupSysStrings()

void Toltecs::ToltecsEngine::setupSysStrings ( )

Definition at line 196 of file toltecs.cpp.

◆ showMenu()

void Toltecs::ToltecsEngine::showMenu ( MenuID  menuId)

Definition at line 636 of file toltecs.cpp.

◆ syncSoundSettings()

void Toltecs::ToltecsEngine::syncSoundSettings ( )
virtual

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 647 of file toltecs.cpp.

◆ talk()

void Toltecs::ToltecsEngine::talk ( int16  slotIndex,
int16  slotOffset 
)

Definition at line 487 of file toltecs.cpp.

◆ updateCamera()

void Toltecs::ToltecsEngine::updateCamera ( )

Definition at line 471 of file toltecs.cpp.

◆ updateInput()

void Toltecs::ToltecsEngine::updateInput ( )

Definition at line 315 of file toltecs.cpp.

◆ updateScreen()

void Toltecs::ToltecsEngine::updateScreen ( void  )

Definition at line 255 of file toltecs.cpp.

◆ walk()

void Toltecs::ToltecsEngine::walk ( byte walkData)

Definition at line 525 of file toltecs.cpp.

Member Data Documentation

◆ _anim

AnimationPlayer* Toltecs::ToltecsEngine::_anim

Definition at line 150 of file toltecs.h.

◆ _arc

ArchiveReader* Toltecs::ToltecsEngine::_arc

Definition at line 151 of file toltecs.h.

◆ _cameraHeight

int16 Toltecs::ToltecsEngine::_cameraHeight

Definition at line 179 of file toltecs.h.

◆ _cameraX

int16 Toltecs::ToltecsEngine::_cameraX

Definition at line 177 of file toltecs.h.

◆ _cameraY

int16 Toltecs::ToltecsEngine::_cameraY

Definition at line 177 of file toltecs.h.

◆ _cfgMusicVolume

int Toltecs::ToltecsEngine::_cfgMusicVolume

Definition at line 146 of file toltecs.h.

◆ _cfgSoundFXVolume

int Toltecs::ToltecsEngine::_cfgSoundFXVolume

Definition at line 146 of file toltecs.h.

◆ _cfgText

bool Toltecs::ToltecsEngine::_cfgText

Definition at line 147 of file toltecs.h.

◆ _cfgVoices

bool Toltecs::ToltecsEngine::_cfgVoices

Definition at line 147 of file toltecs.h.

◆ _cfgVoicesVolume

int Toltecs::ToltecsEngine::_cfgVoicesVolume

Definition at line 146 of file toltecs.h.

◆ _console

Console* Toltecs::ToltecsEngine::_console

Definition at line 152 of file toltecs.h.

◆ _counter01

int Toltecs::ToltecsEngine::_counter01

Definition at line 173 of file toltecs.h.

◆ _counter02

int Toltecs::ToltecsEngine::_counter02

Definition at line 173 of file toltecs.h.

◆ _doSpeech

bool Toltecs::ToltecsEngine::_doSpeech

Definition at line 182 of file toltecs.h.

◆ _doText

bool Toltecs::ToltecsEngine::_doText

Definition at line 182 of file toltecs.h.

◆ _flag01

byte Toltecs::ToltecsEngine::_flag01

Definition at line 175 of file toltecs.h.

◆ _gameDescription

const ToltecsGameDescription* Toltecs::ToltecsEngine::_gameDescription

Definition at line 109 of file toltecs.h.

◆ _guiHeight

int16 Toltecs::ToltecsEngine::_guiHeight

Definition at line 180 of file toltecs.h.

◆ _input

Input* Toltecs::ToltecsEngine::_input

Definition at line 153 of file toltecs.h.

◆ _isSaveAllowed

bool Toltecs::ToltecsEngine::_isSaveAllowed

Definition at line 216 of file toltecs.h.

◆ _keyPressed

Common::KeyState Toltecs::ToltecsEngine::_keyPressed
private

Definition at line 96 of file toltecs.h.

◆ _keyState

Common::KeyState Toltecs::ToltecsEngine::_keyState

Definition at line 186 of file toltecs.h.

◆ _leftButtonDown

bool Toltecs::ToltecsEngine::_leftButtonDown

Definition at line 192 of file toltecs.h.

◆ _menuSystem

MenuSystem* Toltecs::ToltecsEngine::_menuSystem

Definition at line 154 of file toltecs.h.

◆ _mouseButton

byte Toltecs::ToltecsEngine::_mouseButton

Definition at line 190 of file toltecs.h.

◆ _mouseDblClickTicks

int16 Toltecs::ToltecsEngine::_mouseDblClickTicks

Definition at line 188 of file toltecs.h.

◆ _mouseDisabled

int16 Toltecs::ToltecsEngine::_mouseDisabled

Definition at line 191 of file toltecs.h.

◆ _mouseWaitForRelease

bool Toltecs::ToltecsEngine::_mouseWaitForRelease

Definition at line 189 of file toltecs.h.

◆ _mouseX

int16 Toltecs::ToltecsEngine::_mouseX

Definition at line 187 of file toltecs.h.

◆ _mouseY

int16 Toltecs::ToltecsEngine::_mouseY

Definition at line 187 of file toltecs.h.

◆ _moviePlayer

MoviePlayer* Toltecs::ToltecsEngine::_moviePlayer

Definition at line 155 of file toltecs.h.

◆ _movieSceneFlag

bool Toltecs::ToltecsEngine::_movieSceneFlag

Definition at line 174 of file toltecs.h.

◆ _music

Music* Toltecs::ToltecsEngine::_music

Definition at line 156 of file toltecs.h.

◆ _newCameraX

int16 Toltecs::ToltecsEngine::_newCameraX

Definition at line 178 of file toltecs.h.

◆ _newCameraY

int16 Toltecs::ToltecsEngine::_newCameraY

Definition at line 178 of file toltecs.h.

◆ _palette

Palette* Toltecs::ToltecsEngine::_palette

Definition at line 157 of file toltecs.h.

◆ _res

ResourceCache* Toltecs::ToltecsEngine::_res

Definition at line 158 of file toltecs.h.

◆ _rightButtonDown

bool Toltecs::ToltecsEngine::_rightButtonDown

Definition at line 192 of file toltecs.h.

◆ _rnd

Common::RandomSource* Toltecs::ToltecsEngine::_rnd

Definition at line 108 of file toltecs.h.

◆ _saveLoadDescription

Common::String Toltecs::ToltecsEngine::_saveLoadDescription

Definition at line 168 of file toltecs.h.

◆ _saveLoadRequested

int Toltecs::ToltecsEngine::_saveLoadRequested

Definition at line 166 of file toltecs.h.

◆ _saveLoadSlot

int Toltecs::ToltecsEngine::_saveLoadSlot

Definition at line 167 of file toltecs.h.

◆ _sceneHeight

int16 Toltecs::ToltecsEngine::_sceneHeight

Definition at line 171 of file toltecs.h.

◆ _sceneResIndex

uint Toltecs::ToltecsEngine::_sceneResIndex

Definition at line 170 of file toltecs.h.

◆ _sceneWidth

int16 Toltecs::ToltecsEngine::_sceneWidth

Definition at line 171 of file toltecs.h.

◆ _screen

Screen* Toltecs::ToltecsEngine::_screen

Definition at line 160 of file toltecs.h.

◆ _script

ScriptInterpreter* Toltecs::ToltecsEngine::_script

Definition at line 159 of file toltecs.h.

◆ _segmap

SegmentMap* Toltecs::ToltecsEngine::_segmap

Definition at line 161 of file toltecs.h.

◆ _sound

Sound* Toltecs::ToltecsEngine::_sound

Definition at line 162 of file toltecs.h.

◆ _sysStrings

Common::String Toltecs::ToltecsEngine::_sysStrings[kSysStrCount]

Definition at line 164 of file toltecs.h.

◆ _walkSpeedX

int16 Toltecs::ToltecsEngine::_walkSpeedX

Definition at line 184 of file toltecs.h.

◆ _walkSpeedY

int16 Toltecs::ToltecsEngine::_walkSpeedY

Definition at line 184 of file toltecs.h.


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