ScummVM
Tinsel::TinselEngine Class Reference

#include <tinsel.h>

Inheritance diagram for Tinsel::TinselEngine:
Collaboration diagram for Tinsel::TinselEngine:

Public Member Functions

 TinselEngine (OSystem *syst, const TinselGameDescription *gameDesc)
 
virtual ~TinselEngine ()
 
int getGameId ()
 
uint32 getGameID () const
 
uint32 getFeatures () const
 
Common::Language getLanguage () const
 
uint16 getVersion () const
 
uint32 getFlags () const
 
Common::Platform getPlatform () const
 
bool getIsADGFDemo () const
 
bool isV1CD () const
 
const char * getSampleIndex (LANGUAGE lang)
 
const char * getSampleFile (LANGUAGE lang)
 
const char * getTextFile (LANGUAGE lang)
 
const Common::String getTargetName () const
 
Common::String getSavegameFilename (int16 saveNum) const
 
Common::SaveFileManagergetSaveFileMan ()
 
Graphics::Surfacescreen ()
 
Common::Point getMousePosition () const
 
void setMousePosition (Common::Point pt)
 
void divertKeyInput (KEYFPTR fptr)
 
int getRandomNumber (int maxNumber)
 
uint8 getKeyDirection () const
 
- 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 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 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 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...
 
virtual Common::Error saveGameState (int slot, const Common::String &desc)
 Save a game state. More...
 
virtual bool canSaveGameStateCurrently ()
 Indicates whether a game state can be saved. More...
 

Public Attributes

const TinselGameDescription_gameDescription
 
MidiDriver_driver
 
SoundManager_sound
 
MidiMusicPlayer_midiMusic
 
PCMMusicPlayer_pcmMusic
 
BMVPlayer_bmv
 
Config_config
 
KEYFPTR _keyHandler
 
Common::List< Common::EventType_mouseButtons
 Stack of pending mouse button events. More...
 
Common::List< Common::Event_keypresses
 Stack of pending keypresses. More...
 
RectList _clipRects
 List of all clip rectangles. More...
 
- Public Attributes inherited from Engine
OSystem_system
 
Audio::Mixer_mixer
 

Protected Member Functions

virtual void initializePath (const Common::FSNode &gamePath)
 Init SearchMan according to the game path. More...
 
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...
 
Common::Error loadGameState (int slot)
 Load a game state. More...
 
bool canLoadGameStateCurrently ()
 Indicates whether a game state can be loaded. 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

GUI::DebuggergetDebugger ()
 Return the engine's debugger instance, if any. More...
 
void NextGameCycle ()
 
void CreateConstProcesses ()
 Start the processes that continue between scenes. More...
 
void RestartGame ()
 Restart the game. More...
 
void RestartDrivers ()
 Init palette and object managers, scheduler, keyboard and mouse. More...
 
void ChopDrivers ()
 Remove keyboard, mouse and joystick drivers. More...
 
void ProcessKeyEvent (const Common::Event &event)
 Process a keyboard event. More...
 
bool pollEvent ()
 

Private Attributes

int _gameId
 
Common::KeyState _keyPressed
 
Common::RandomSource _random
 
Graphics::Surface _screenSurface
 
Common::Point _mousePos
 
uint8 _dosPlayerDir
 
Console_console
 

Static Private Attributes

static const char *const _sampleIndices [][3]
 
static const char *const _sampleFiles [][3]
 
static const char *const _textFiles [][3]
 

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...
 
- 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...
 
- 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 147 of file tinsel.h.

Constructor & Destructor Documentation

◆ TinselEngine()

Tinsel::TinselEngine::TinselEngine ( OSystem syst,
const TinselGameDescription gameDesc 
)

Definition at line 821 of file tinsel.cpp.

◆ ~TinselEngine()

Tinsel::TinselEngine::~TinselEngine ( )
virtual

Definition at line 855 of file tinsel.cpp.

Member Function Documentation

◆ canLoadGameStateCurrently()

bool Tinsel::TinselEngine::canLoadGameStateCurrently ( )
protectedvirtual

Indicates whether a game state can be loaded.

Reimplemented from Engine.

Definition at line 453 of file detection.cpp.

◆ ChopDrivers()

void Tinsel::TinselEngine::ChopDrivers ( )
private

Remove keyboard, mouse and joystick drivers.

Definition at line 1172 of file tinsel.cpp.

◆ CreateConstProcesses()

void Tinsel::TinselEngine::CreateConstProcesses ( )
private

Start the processes that continue between scenes.

Definition at line 1091 of file tinsel.cpp.

◆ divertKeyInput()

void Tinsel::TinselEngine::divertKeyInput ( KEYFPTR  fptr)
inline

Definition at line 242 of file tinsel.h.

◆ getDebugger()

GUI::Debugger* Tinsel::TinselEngine::getDebugger ( )
inlineprivatevirtual

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 155 of file tinsel.h.

◆ getFeatures()

uint32 Tinsel::TinselEngine::getFeatures ( ) const

Definition at line 50 of file detection.cpp.

◆ getFlags()

uint32 Tinsel::TinselEngine::getFlags ( ) const

◆ getGameId()

int Tinsel::TinselEngine::getGameId ( )
inline

Definition at line 179 of file tinsel.h.

◆ getGameID()

uint32 Tinsel::TinselEngine::getGameID ( ) const

Definition at line 46 of file detection.cpp.

◆ getIsADGFDemo()

bool Tinsel::TinselEngine::getIsADGFDemo ( ) const

Definition at line 66 of file detection.cpp.

◆ getKeyDirection()

uint8 Tinsel::TinselEngine::getKeyDirection ( ) const
inline

Definition at line 244 of file tinsel.h.

◆ getLanguage()

Common::Language Tinsel::TinselEngine::getLanguage ( ) const

Definition at line 54 of file detection.cpp.

◆ getMousePosition()

Common::Point Tinsel::TinselEngine::getMousePosition ( ) const
inline

Definition at line 232 of file tinsel.h.

◆ getPlatform()

Common::Platform Tinsel::TinselEngine::getPlatform ( ) const

Definition at line 58 of file detection.cpp.

◆ getRandomNumber()

int Tinsel::TinselEngine::getRandomNumber ( int  maxNumber)
inline

Definition at line 243 of file tinsel.h.

◆ getSampleFile()

const char * Tinsel::TinselEngine::getSampleFile ( LANGUAGE  lang)

Definition at line 1257 of file tinsel.cpp.

◆ getSampleIndex()

const char * Tinsel::TinselEngine::getSampleIndex ( LANGUAGE  lang)

Definition at line 1237 of file tinsel.cpp.

◆ getSaveFileMan()

Common::SaveFileManager* Tinsel::TinselEngine::getSaveFileMan ( )
inline

Definition at line 229 of file tinsel.h.

◆ getSavegameFilename()

Common::String Tinsel::TinselEngine::getSavegameFilename ( int16  saveNum) const

Definition at line 876 of file tinsel.cpp.

◆ getTargetName()

const Common::String Tinsel::TinselEngine::getTargetName ( ) const
inline

Definition at line 227 of file tinsel.h.

◆ getTextFile()

const char * Tinsel::TinselEngine::getTextFile ( LANGUAGE  lang)

Definition at line 1277 of file tinsel.cpp.

◆ getVersion()

uint16 Tinsel::TinselEngine::getVersion ( ) const

Definition at line 62 of file detection.cpp.

◆ hasFeature()

bool Tinsel::TinselEngine::hasFeature ( EngineFeature  f) const
protectedvirtual

Determine whether the engine supports the specified feature.

Reimplemented from Engine.

Definition at line 122 of file detection.cpp.

◆ initializePath()

void Tinsel::TinselEngine::initializePath ( const Common::FSNode gamePath)
protectedvirtual

Init SearchMan according to the game path.

By default it adds the directory in non-flat mode with a depth of 4 as priority 0 to SearchMan.

Parameters
gamePathThe base directory of the game data.

Reimplemented from Engine.

Definition at line 880 of file tinsel.cpp.

◆ isV1CD()

bool Tinsel::TinselEngine::isV1CD ( ) const

Definition at line 70 of file detection.cpp.

◆ loadGameState()

Common::Error Tinsel::TinselEngine::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 399 of file detection.cpp.

◆ NextGameCycle()

void Tinsel::TinselEngine::NextGameCycle ( )
private

Definition at line 1024 of file tinsel.cpp.

◆ pollEvent()

bool Tinsel::TinselEngine::pollEvent ( )
private

Definition at line 1048 of file tinsel.cpp.

◆ ProcessKeyEvent()

void Tinsel::TinselEngine::ProcessKeyEvent ( const Common::Event event)
private

Process a keyboard event.

Definition at line 1186 of file tinsel.cpp.

◆ RestartDrivers()

void Tinsel::TinselEngine::RestartDrivers ( )
private

Init palette and object managers, scheduler, keyboard and mouse.

Definition at line 1139 of file tinsel.cpp.

◆ RestartGame()

void Tinsel::TinselEngine::RestartGame ( )
private

Restart the game.

Definition at line 1103 of file tinsel.cpp.

◆ run()

Common::Error Tinsel::TinselEngine::run ( )
protectedvirtual

Init the engine and start its main loop.

Returns
returns kNoError on success, else an error code.

Implements Engine.

Definition at line 894 of file tinsel.cpp.

◆ screen()

Graphics::Surface& Tinsel::TinselEngine::screen ( )
inline

Definition at line 230 of file tinsel.h.

◆ setMousePosition()

void Tinsel::TinselEngine::setMousePosition ( Common::Point  pt)
inline

Definition at line 233 of file tinsel.h.

Member Data Documentation

◆ _bmv

BMVPlayer* Tinsel::TinselEngine::_bmv

Definition at line 201 of file tinsel.h.

◆ _clipRects

RectList Tinsel::TinselEngine::_clipRects

List of all clip rectangles.

Definition at line 215 of file tinsel.h.

◆ _config

Config* Tinsel::TinselEngine::_config

Definition at line 203 of file tinsel.h.

◆ _console

Console* Tinsel::TinselEngine::_console
private

Definition at line 154 of file tinsel.h.

◆ _dosPlayerDir

uint8 Tinsel::TinselEngine::_dosPlayerDir
private

Definition at line 153 of file tinsel.h.

◆ _driver

MidiDriver* Tinsel::TinselEngine::_driver

Definition at line 197 of file tinsel.h.

◆ _gameDescription

const TinselGameDescription* Tinsel::TinselEngine::_gameDescription

Definition at line 183 of file tinsel.h.

◆ _gameId

int Tinsel::TinselEngine::_gameId
private

Definition at line 148 of file tinsel.h.

◆ _keyHandler

KEYFPTR Tinsel::TinselEngine::_keyHandler

Definition at line 205 of file tinsel.h.

◆ _keyPressed

Common::KeyState Tinsel::TinselEngine::_keyPressed
private

Definition at line 149 of file tinsel.h.

◆ _keypresses

Common::List<Common::Event> Tinsel::TinselEngine::_keypresses

Stack of pending keypresses.

Definition at line 211 of file tinsel.h.

◆ _midiMusic

MidiMusicPlayer* Tinsel::TinselEngine::_midiMusic

Definition at line 199 of file tinsel.h.

◆ _mouseButtons

Common::List<Common::EventType> Tinsel::TinselEngine::_mouseButtons

Stack of pending mouse button events.

Definition at line 208 of file tinsel.h.

◆ _mousePos

Common::Point Tinsel::TinselEngine::_mousePos
private

Definition at line 152 of file tinsel.h.

◆ _pcmMusic

PCMMusicPlayer* Tinsel::TinselEngine::_pcmMusic

Definition at line 200 of file tinsel.h.

◆ _random

Common::RandomSource Tinsel::TinselEngine::_random
private

Definition at line 150 of file tinsel.h.

◆ _sampleFiles

const char *const Tinsel::TinselEngine::_sampleFiles
staticprivate
Initial value:
= {
{ "english.smp", "english1.smp", "english2.smp" },
{ "french.smp", "french1.smp", "french2.smp" },
{ "german.smp", "german1.smp", "german2.smp" },
{ "english.smp", "english1.smp", "english2.smp" },
{ "english.smp", "english1.smp", "english2.smp" },
{ "english.smp", "english1.smp", "english2.smp" },
{ "english.smp", "english1.smp", "english2.smp" },
{ "english.smp", "english1.smp", "english2.smp" },
{ "us.smp", "us1.smp", "us2.smp" },
}

Definition at line 158 of file tinsel.h.

◆ _sampleIndices

const char *const Tinsel::TinselEngine::_sampleIndices
staticprivate
Initial value:
= {
{ "english.idx", "english1.idx", "english2.idx" },
{ "french.idx", "french1.idx", "french2.idx" },
{ "german.idx", "german1.idx", "german2.idx" },
{ "english.idx", "english1.idx", "english2.idx" },
{ "english.idx", "english1.idx", "english2.idx" },
{ "english.idx", "english1.idx", "english2.idx" },
{ "english.idx", "english1.idx", "english2.idx" },
{ "english.idx", "english1.idx", "english2.idx" },
{ "us.idx", "us1.idx", "us2.idx" }
}

Definition at line 157 of file tinsel.h.

◆ _screenSurface

Graphics::Surface Tinsel::TinselEngine::_screenSurface
private

Definition at line 151 of file tinsel.h.

◆ _sound

SoundManager* Tinsel::TinselEngine::_sound

Definition at line 198 of file tinsel.h.

◆ _textFiles

const char *const Tinsel::TinselEngine::_textFiles
staticprivate
Initial value:
= {
{ "english.txt", "english1.txt", "english2.txt" },
{ "french.txt", "french1.txt", "french2.txt" },
{ "german.txt", "german1.txt", "german2.txt" },
{ "italian.txt", "italian1.txt", "italian2.txt" },
{ "spanish.txt", "spanish1.txt", "spanish2.txt" },
{ "english.txt", "english1.txt", "english2.txt" },
{ "english.txt", "english1.txt", "english2.txt" },
{ "english.txt", "english1.txt", "english2.txt" },
{ "us.txt", "us1.txt", "us2.txt" }
}

Definition at line 159 of file tinsel.h.


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