Tony::TonyEngine Class Reference

#include <tony.h>

Inheritance diagram for Tony::TonyEngine:
Collaboration diagram for Tony::TonyEngine:

Public Types

enum  DataDir {
- 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 Member Functions

GUI::DebuggergetDebugger ()
 Return the engine's debugger instance, if any. More...
 TonyEngine (OSystem *syst, const TonyGameDescription *gameDesc)
virtual ~TonyEngine ()
uint32 getFeatures () const
Common::Language getLanguage () const
uint16 getVersion () const
bool getIsDemo () const
bool isCompressed () const
RMGfxEnginegetEngine ()
virtual bool canLoadGameStateCurrently ()
 Indicates whether a game state can be loaded. More...
virtual 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 &desc)
 Save a game state. More...
void play ()
 Play the game. More...
void close ()
void getDataDirectory (DataDir dir, char *path)
void showLocation ()
void hideLocation ()
uint32 getTime ()
 Reads the time. More...
void freezeTime ()
void unfreezeTime ()
void playMusic (int nChannel, const Common::String &fn, int nFX, bool bLoop, int nSync)
void stopMusic (int nChannel)
void playSFX (int nSfx, int nFX=0)
void stopSFX (int nSfx)
void playUtilSFX (int nSfx, int nFX=0)
void stopUtilSFX (int nSfx)
FPSfxcreateSFX (Common::SeekableReadStream *stream)
void preloadSFX (int nSfx, const char *fn)
void unloadAllSFX ()
void preloadUtilSFX (int nSfx, const char *fn)
void unloadAllUtilSFX ()
void pauseSound (bool bPause)
 Stop all the audio. More...
void setMusicVolume (int nChannel, int volume)
int getMusicVolume (int nChannel)
void autoSave (CORO_PARAM)
 Handle saving. More...
void saveState (int n, const char *name)
void loadState (CORO_PARAM, int n)
void grabThumbnail ()
 Get a thumbnail. More...
uint16getThumbnail ()
void quitGame ()
void openInitLoadMenu (CORO_PARAM)
void openInitOptions (CORO_PARAM)
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...
void saveSoundSettings ()
- 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 getSaveStateFileName (int n)
- 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::String _funcListStrings [300]
Common::RandomSource _randomSource
RMResUpdate _resUpdate
uint32 _hEndOfFrame
Common::File _vdbFP
SoundCodecs _vdbCodec
Common::Array< VoiceHeader_voices
FPSound _theSound
Common::List< FPSfx * > _activeSfx
Globals _globals
int16 _cTableDialog [256]
int16 _lTableDialog [256]
int16 _cTableMacc [256]
int16 _lTableMacc [256]
int16 _cTableCred [256]
int16 _lTableCred [256]
int16 _cTableObj [256]
int16 _lTableObj [256]
FPStream_stream [6]
bool _bPaused
bool _bDrawLocation
int _startTime
int _initialLoadSlotNumber
int _loadSlotNumber
RMGameBoxes _theBoxes
RMWindow _window
RMGfxEngine _theEngine
bool _bQuitNow
bool _bTimeFreezed
int _nTimeFreezed
const TonyGameDescription_gameDescription
- Public Attributes inherited from Engine

Protected Member Functions

virtual Common::Error run ()
 Run the game. More...
virtual bool hasFeature (EngineFeature f) const
 Determine whether the engine supports the specified feature. 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

Common::ErrorCode init ()
 Initialize the game. More...
bool loadTonyDat ()
void initMusic ()
void closeMusic ()
bool openVoiceDatabase ()
void closeVoiceDatabase ()
void initCustomFunctionMap ()

Static Private Member Functions

static void playProcess (CORO_PARAM, const void *param)
 Main process for playing the game. More...
static void doNextMusic (CORO_PARAM, const void *param)

Additional Inherited Members

- Protected Attributes inherited from Engine
const Common::String _targetName

Detailed Description

Definition at line 84 of file tony.h.

Member Enumeration Documentation

◆ DataDir


Definition at line 124 of file tony.h.

Constructor & Destructor Documentation

◆ TonyEngine()

Tony::TonyEngine::TonyEngine ( OSystem syst,
const TonyGameDescription gameDesc 

Definition at line 41 of file tony.cpp.

◆ ~TonyEngine()

Tony::TonyEngine::~TonyEngine ( )

Definition at line 91 of file tony.cpp.

Member Function Documentation

◆ autoSave()

void Tony::TonyEngine::autoSave ( CORO_PARAM  )

Handle saving.

Definition at line 541 of file tony.cpp.

◆ canLoadGameStateCurrently()

bool Tony::TonyEngine::canLoadGameStateCurrently ( )

Indicates whether a game state can be loaded.

Reimplemented from Engine.

Definition at line 740 of file tony.cpp.

◆ canSaveGameStateCurrently()

bool Tony::TonyEngine::canSaveGameStateCurrently ( )

Indicates whether a game state can be saved.

Reimplemented from Engine.

Definition at line 744 of file tony.cpp.

◆ close()

void Tony::TonyEngine::close ( )

Definition at line 713 of file tony.cpp.

◆ closeMusic()

void Tony::TonyEngine::closeMusic ( )

Definition at line 501 of file tony.cpp.

◆ closeVoiceDatabase()

void Tony::TonyEngine::closeVoiceDatabase ( )

Definition at line 615 of file tony.cpp.

◆ createSFX()

FPSfx * Tony::TonyEngine::createSFX ( Common::SeekableReadStream stream)

Definition at line 439 of file tony.cpp.

◆ doNextMusic()

void Tony::TonyEngine::doNextMusic ( CORO_PARAM  ,
const void param 

Definition at line 349 of file tony.cpp.

◆ freezeTime()

void Tony::TonyEngine::freezeTime ( )

Definition at line 724 of file tony.cpp.

◆ getDataDirectory()

void Tony::TonyEngine::getDataDirectory ( DataDir  dir,
char *  path 

◆ getDebugger()

GUI::Debugger* Tony::TonyEngine::getDebugger ( )

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 113 of file tony.h.

◆ getEngine()

RMGfxEngine* Tony::TonyEngine::getEngine ( )

Definition at line 163 of file tony.h.

◆ getFeatures()

uint32 Tony::TonyEngine::getFeatures ( ) const

Definition at line 44 of file detection.cpp.

◆ getIsDemo()

bool Tony::TonyEngine::getIsDemo ( ) const

Definition at line 52 of file detection.cpp.

◆ getLanguage()

Common::Language Tony::TonyEngine::getLanguage ( ) const

Definition at line 48 of file detection.cpp.

◆ getMusicVolume()

int Tony::TonyEngine::getMusicVolume ( int  nChannel)

Definition at line 531 of file tony.cpp.

◆ getSaveStateFileName()

Common::String Tony::TonyEngine::getSaveStateFileName ( int  n)

Definition at line 537 of file tony.cpp.

◆ getThumbnail()

uint16 * Tony::TonyEngine::getThumbnail ( )

Definition at line 627 of file tony.cpp.

◆ getTime()

uint32 Tony::TonyEngine::getTime ( )

Reads the time.

Returns the millisecond timer.

Definition at line 736 of file tony.cpp.

◆ getVersion()

uint16 Tony::TonyEngine::getVersion ( ) const

◆ grabThumbnail()

void Tony::TonyEngine::grabThumbnail ( )

Get a thumbnail.

Definition at line 623 of file tony.cpp.

◆ hasFeature()

bool Tony::TonyEngine::hasFeature ( EngineFeature  f) const

Determine whether the engine supports the specified feature.

Reimplemented from Engine.

Definition at line 103 of file detection.cpp.

◆ hideLocation()

void Tony::TonyEngine::hideLocation ( )

Definition at line 797 of file tony.cpp.

◆ init()

Common::ErrorCode Tony::TonyEngine::init ( void  )

Initialize the game.

Definition at line 119 of file tony.cpp.

◆ initCustomFunctionMap()

void Tony::TonyEngine::initCustomFunctionMap ( )

Definition at line 280 of file tony.cpp.

◆ initMusic()

void Tony::TonyEngine::initMusic ( )

Definition at line 480 of file tony.cpp.

◆ isCompressed()

bool Tony::TonyEngine::isCompressed ( ) const

Definition at line 56 of file detection.cpp.

◆ loadGameState()

Common::Error Tony::TonyEngine::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 748 of file tony.cpp.

◆ loadState()

void Tony::TonyEngine::loadState ( CORO_PARAM  ,
int  n 

Definition at line 562 of file tony.cpp.

◆ loadTonyDat()

bool Tony::TonyEngine::loadTonyDat ( )

Definition at line 190 of file tony.cpp.

◆ openInitLoadMenu()

void Tony::TonyEngine::openInitLoadMenu ( CORO_PARAM  )

Definition at line 635 of file tony.cpp.

◆ openInitOptions()

void Tony::TonyEngine::openInitOptions ( CORO_PARAM  )

Definition at line 639 of file tony.cpp.

◆ openVoiceDatabase()

bool Tony::TonyEngine::openVoiceDatabase ( )

Definition at line 575 of file tony.cpp.

◆ pauseSound()

void Tony::TonyEngine::pauseSound ( bool  bPause)

Stop all the audio.

Definition at line 512 of file tony.cpp.

◆ play()

void Tony::TonyEngine::play ( )

Play the game.

Definition at line 699 of file tony.cpp.

◆ playMusic()

void Tony::TonyEngine::playMusic ( int  nChannel,
const Common::String fn,
int  nFX,
bool  bLoop,
int  nSync 

Definition at line 284 of file tony.cpp.

◆ playProcess()

void Tony::TonyEngine::playProcess ( CORO_PARAM  ,
const void param 

Main process for playing the game.

This needs to be in a separate process, since there are some things that can briefly block the execution of process. For now, all ScummVm event handling is dispatched to within the context of this process. If it ever proves a problem, we may have to look into whether it's feasible to have it still remain in the outer 'main' process.

Definition at line 651 of file tony.cpp.

◆ playSFX()

void Tony::TonyEngine::playSFX ( int  nSfx,
int  nFX = 0 

Definition at line 377 of file tony.cpp.

◆ playUtilSFX()

void Tony::TonyEngine::playUtilSFX ( int  nSfx,
int  nFX = 0 

Definition at line 405 of file tony.cpp.

◆ preloadSFX()

void Tony::TonyEngine::preloadSFX ( int  nSfx,
const char *  fn 

Definition at line 427 of file tony.cpp.

◆ preloadUtilSFX()

void Tony::TonyEngine::preloadUtilSFX ( int  nSfx,
const char *  fn 

Definition at line 447 of file tony.cpp.

◆ quitGame()

void Tony::TonyEngine::quitGame ( )

Definition at line 631 of file tony.cpp.

◆ run()

Common::Error Tony::TonyEngine::run ( )

Run the game.

Implements Engine.

Definition at line 105 of file tony.cpp.

◆ saveGameState()

Common::Error Tony::TonyEngine::saveGameState ( int  slot,
const Common::String desc 

Save a game state.

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

Reimplemented from Engine.

Definition at line 753 of file tony.cpp.

◆ saveSoundSettings()

void Tony::TonyEngine::saveSoundSettings ( )

Definition at line 780 of file tony.cpp.

◆ saveState()

void Tony::TonyEngine::saveState ( int  n,
const char *  name 

Definition at line 557 of file tony.cpp.

◆ setMusicVolume()

void Tony::TonyEngine::setMusicVolume ( int  nChannel,
int  volume 

Definition at line 527 of file tony.cpp.

◆ showLocation()

void Tony::TonyEngine::showLocation ( )

Definition at line 793 of file tony.cpp.

◆ stopMusic()

void Tony::TonyEngine::stopMusic ( int  nChannel)

Definition at line 394 of file tony.cpp.

◆ stopSFX()

void Tony::TonyEngine::stopSFX ( int  nSfx)

Definition at line 401 of file tony.cpp.

◆ stopUtilSFX()

void Tony::TonyEngine::stopUtilSFX ( int  nSfx)

Definition at line 423 of file tony.cpp.

◆ syncSoundSettings()

void Tony::TonyEngine::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.

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).

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.
find a better name for this

Reimplemented from Engine.

Definition at line 765 of file tony.cpp.

◆ unfreezeTime()

void Tony::TonyEngine::unfreezeTime ( )

Definition at line 729 of file tony.cpp.

◆ unloadAllSFX()

void Tony::TonyEngine::unloadAllSFX ( )

Definition at line 460 of file tony.cpp.

◆ unloadAllUtilSFX()

void Tony::TonyEngine::unloadAllUtilSFX ( )

Definition at line 470 of file tony.cpp.

Member Data Documentation

◆ _activeSfx

Common::List<FPSfx *> Tony::TonyEngine::_activeSfx

Definition at line 110 of file tony.h.

◆ _bDrawLocation

bool Tony::TonyEngine::_bDrawLocation

Definition at line 139 of file tony.h.

◆ _bPaused

bool Tony::TonyEngine::_bPaused

Definition at line 138 of file tony.h.

◆ _bQuitNow

bool Tony::TonyEngine::_bQuitNow

Definition at line 150 of file tony.h.

◆ _bTimeFreezed

bool Tony::TonyEngine::_bTimeFreezed

Definition at line 151 of file tony.h.

◆ _cTableCred

int16 Tony::TonyEngine::_cTableCred[256]

Definition at line 119 of file tony.h.

◆ _cTableDialog

int16 Tony::TonyEngine::_cTableDialog[256]

Definition at line 115 of file tony.h.

◆ _cTableMacc

int16 Tony::TonyEngine::_cTableMacc[256]

Definition at line 117 of file tony.h.

◆ _cTableObj

int16 Tony::TonyEngine::_cTableObj[256]

Definition at line 121 of file tony.h.

◆ _curThumbnail

uint16* Tony::TonyEngine::_curThumbnail

Definition at line 141 of file tony.h.

◆ _debugger

Debugger* Tony::TonyEngine::_debugger

Definition at line 112 of file tony.h.

◆ _funcList

LPCUSTOMFUNCTION Tony::TonyEngine::_funcList[300]

Definition at line 101 of file tony.h.

◆ _funcListStrings

Common::String Tony::TonyEngine::_funcListStrings[300]

Definition at line 102 of file tony.h.

◆ _gameDescription

const TonyGameDescription* Tony::TonyEngine::_gameDescription

Definition at line 157 of file tony.h.

◆ _globals

Globals Tony::TonyEngine::_globals

Definition at line 111 of file tony.h.

◆ _hEndOfFrame

uint32 Tony::TonyEngine::_hEndOfFrame

Definition at line 105 of file tony.h.

◆ _initialLoadSlotNumber

int Tony::TonyEngine::_initialLoadSlotNumber

Definition at line 142 of file tony.h.

◆ _loadSlotNumber

int Tony::TonyEngine::_loadSlotNumber

Definition at line 143 of file tony.h.

◆ _lTableCred

int16 Tony::TonyEngine::_lTableCred[256]

Definition at line 120 of file tony.h.

◆ _lTableDialog

int16 Tony::TonyEngine::_lTableDialog[256]

Definition at line 116 of file tony.h.

◆ _lTableMacc

int16 Tony::TonyEngine::_lTableMacc[256]

Definition at line 118 of file tony.h.

◆ _lTableObj

int16 Tony::TonyEngine::_lTableObj[256]

Definition at line 122 of file tony.h.

◆ _nTimeFreezed

int Tony::TonyEngine::_nTimeFreezed

Definition at line 152 of file tony.h.

◆ _randomSource

Common::RandomSource Tony::TonyEngine::_randomSource

Definition at line 103 of file tony.h.

◆ _resUpdate

RMResUpdate Tony::TonyEngine::_resUpdate

Definition at line 104 of file tony.h.

◆ _sfx

FPSfx* Tony::TonyEngine::_sfx[MAX_SFX_CHANNELS]

Definition at line 136 of file tony.h.

◆ _startTime

int Tony::TonyEngine::_startTime

Definition at line 140 of file tony.h.

◆ _stream

FPStream* Tony::TonyEngine::_stream[6]

Definition at line 135 of file tony.h.

◆ _theBoxes

RMGameBoxes Tony::TonyEngine::_theBoxes

Definition at line 146 of file tony.h.

◆ _theEngine

RMGfxEngine Tony::TonyEngine::_theEngine

Definition at line 148 of file tony.h.

◆ _theSound

FPSound Tony::TonyEngine::_theSound

Definition at line 109 of file tony.h.

◆ _utilSfx

FPSfx* Tony::TonyEngine::_utilSfx[MAX_SFX_CHANNELS]

Definition at line 137 of file tony.h.

◆ _vdbCodec

SoundCodecs Tony::TonyEngine::_vdbCodec

Definition at line 107 of file tony.h.

◆ _vdbFP

Common::File Tony::TonyEngine::_vdbFP

Definition at line 106 of file tony.h.

◆ _voices

Common::Array<VoiceHeader> Tony::TonyEngine::_voices

Definition at line 108 of file tony.h.

◆ _window

RMWindow Tony::TonyEngine::_window

Definition at line 147 of file tony.h.

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