ScummVM
Supernova::SupernovaEngine Class Reference

#include <supernova.h>

+ Inheritance diagram for Supernova::SupernovaEngine:
+ Collaboration diagram for Supernova::SupernovaEngine:

Public Member Functions

 SupernovaEngine (OSystem *syst)
 
 ~SupernovaEngine () override
 
Common::Error run () override
 Init the engine and start its main loop. More...
 
Common::Error loadGameState (int slot) override
 Load a game state. More...
 
bool canLoadGameStateCurrently () override
 Indicates whether a game state can be loaded. More...
 
Common::Error saveGameState (int slot, const Common::String &desc, bool isAutosave=false) override
 Save a game state. More...
 
bool canSaveGameStateCurrently () override
 Indicates whether a game state can be saved. More...
 
bool hasFeature (EngineFeature f) const override
 Determine whether the engine supports the specified feature. More...
 
void pauseEngineIntern (bool pause) override
 Actual implementation of pauseEngine by subclasses. More...
 
Common::Error loadGameStrings ()
 
void init ()
 
virtual Common::String getSaveStateName (int slot) const override
 Generates the savegame filename. More...
 
bool loadGame (int slot)
 
bool saveGame (int slot, const Common::String &description)
 
bool serialize (Common::WriteStream *out)
 
bool deserialize (Common::ReadStream *in, int version)
 
bool quitGameDialog ()
 
void errorTempSave (bool saving)
 
void setTextSpeed ()
 
const Common::StringgetGameString (int idx) const
 
void setGameString (int idx, const Common::String &string)
 
void showHelpScreen1 ()
 
void showHelpScreen2 ()
 
Common::SeekableReadStreamgetBlockFromDatFile (Common::String name)
 
Common::Error showTextReader (const char *extension)
 
void playSound (AudioId sample)
 
void playSound (MusicId index)
 
void paletteFadeIn ()
 
void paletteFadeOut (int minBrightness=0)
 
void paletteBrightness ()
 
void renderImage (int section)
 
void renderImage (ImageId id, bool removeImage=false)
 
bool setCurrentImage (int filenumber)
 
void saveScreen (int x, int y, int width, int height)
 
void saveScreen (const GuiElement &guiElement)
 
void restoreScreen ()
 
void renderRoom (Room &room)
 
void renderMessage (const char *text, MessagePosition position=kMessageNormal)
 
void renderMessage (const Common::String &text, MessagePosition position=kMessageNormal)
 
void renderMessage (int stringId, MessagePosition position=kMessageNormal, Common::String var1="", Common::String var2="")
 
void renderMessage (int stringId, int x, int y)
 
void removeMessage ()
 
void renderText (const uint16 character)
 
void renderText (const char *text)
 
void renderText (const Common::String &text)
 
void renderText (int stringId)
 
void renderText (const uint16 character, int x, int y, byte color)
 
void renderText (const char *text, int x, int y, byte color)
 
void renderText (const Common::String &text, int x, int y, byte color)
 
void renderText (int stringId, int x, int y, byte color)
 
void renderText (const GuiElement &guiElement)
 
void renderBox (int x, int y, int width, int height, byte color)
 
void renderBox (const GuiElement &guiElement)
 
void setColor63 (byte value)
 
void stopSound ()
 
- 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 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 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)
 

Public Attributes

GameManager_gm
 
Sound_sound
 
ResourceManager_resMan
 
Screen_screen
 
bool _allowLoadGame
 
bool _allowSaveGame
 
Common::StringArray _gameStrings
 
Common::String _nullString
 
int _sleepAuoSaveVersion
 
Common::MemoryReadWriteStream_sleepAutoSave
 
uint _delay
 
int _textSpeed
 
char _MSPart
 
bool _improved
 
- Public Attributes inherited from Engine
OSystem_system
 
Audio::Mixer_mixer
 

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...
 
- 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...
 
- Protected Member Functions inherited from Engine
virtual int runDialog (GUI::Dialog &dialog)
 
- 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 62 of file supernova.h.

Constructor & Destructor Documentation

◆ SupernovaEngine()

Supernova::SupernovaEngine::SupernovaEngine ( OSystem syst)
explicit

Definition at line 78 of file supernova.cpp.

◆ ~SupernovaEngine()

Supernova::SupernovaEngine::~SupernovaEngine ( )
override

Definition at line 105 of file supernova.cpp.

Member Function Documentation

◆ canLoadGameStateCurrently()

bool Supernova::SupernovaEngine::canLoadGameStateCurrently ( )
overridevirtual

Indicates whether a game state can be loaded.

Reimplemented from Engine.

Definition at line 656 of file supernova.cpp.

◆ canSaveGameStateCurrently()

bool Supernova::SupernovaEngine::canSaveGameStateCurrently ( )
overridevirtual

Indicates whether a game state can be saved.

Reimplemented from Engine.

Definition at line 664 of file supernova.cpp.

◆ deserialize()

bool Supernova::SupernovaEngine::deserialize ( Common::ReadStream in,
int  version 
)

Definition at line 681 of file supernova.cpp.

◆ errorTempSave()

void Supernova::SupernovaEngine::errorTempSave ( bool  saving)

Definition at line 825 of file supernova.cpp.

◆ getBlockFromDatFile()

Common::SeekableReadStream * Supernova::SupernovaEngine::getBlockFromDatFile ( Common::String  name)

Definition at line 450 of file supernova.cpp.

◆ getGameString()

const Common::String & Supernova::SupernovaEngine::getGameString ( int  idx) const

Definition at line 203 of file supernova.cpp.

◆ getSaveStateName()

Common::String Supernova::SupernovaEngine::getSaveStateName ( int  slot) const
overridevirtual

Generates the savegame filename.

Reimplemented from Engine.

Definition at line 694 of file supernova.cpp.

◆ hasFeature()

bool Supernova::SupernovaEngine::hasFeature ( EngineFeature  f) const
overridevirtual

Determine whether the engine supports the specified feature.

Reimplemented from Engine.

Definition at line 162 of file supernova.cpp.

◆ init()

void Supernova::SupernovaEngine::init ( void  )

Definition at line 133 of file supernova.cpp.

◆ loadGame()

bool Supernova::SupernovaEngine::loadGame ( int  slot)

Definition at line 703 of file supernova.cpp.

◆ loadGameState()

Common::Error Supernova::SupernovaEngine::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 660 of file supernova.cpp.

◆ loadGameStrings()

Common::Error Supernova::SupernovaEngine::loadGameStrings ( )

Definition at line 180 of file supernova.cpp.

◆ paletteBrightness()

void Supernova::SupernovaEngine::paletteBrightness ( )

Definition at line 326 of file supernova.cpp.

◆ paletteFadeIn()

void Supernova::SupernovaEngine::paletteFadeIn ( )

Definition at line 335 of file supernova.cpp.

◆ paletteFadeOut()

void Supernova::SupernovaEngine::paletteFadeOut ( int  minBrightness = 0)

Definition at line 330 of file supernova.cpp.

◆ pauseEngineIntern()

void Supernova::SupernovaEngine::pauseEngineIntern ( bool  pause)
overridevirtual

Actual implementation of pauseEngine by subclasses.

See there for details.

Reimplemented from Engine.

Definition at line 175 of file supernova.cpp.

◆ playSound() [1/2]

void Supernova::SupernovaEngine::playSound ( AudioId  sample)

Definition at line 217 of file supernova.cpp.

◆ playSound() [2/2]

void Supernova::SupernovaEngine::playSound ( MusicId  index)

Definition at line 222 of file supernova.cpp.

◆ quitGameDialog()

bool Supernova::SupernovaEngine::quitGameDialog ( )

Definition at line 597 of file supernova.cpp.

◆ removeMessage()

void Supernova::SupernovaEngine::removeMessage ( )

Definition at line 278 of file supernova.cpp.

◆ renderBox() [1/2]

void Supernova::SupernovaEngine::renderBox ( const GuiElement guiElement)

Definition at line 322 of file supernova.cpp.

◆ renderBox() [2/2]

void Supernova::SupernovaEngine::renderBox ( int  x,
int  y,
int  width,
int  height,
byte  color 
)

Definition at line 318 of file supernova.cpp.

◆ renderImage() [1/2]

void Supernova::SupernovaEngine::renderImage ( ImageId  id,
bool  removeImage = false 
)

Definition at line 233 of file supernova.cpp.

◆ renderImage() [2/2]

void Supernova::SupernovaEngine::renderImage ( int  section)

Definition at line 227 of file supernova.cpp.

◆ renderMessage() [1/4]

void Supernova::SupernovaEngine::renderMessage ( const char *  text,
MessagePosition  position = kMessageNormal 
)

Definition at line 258 of file supernova.cpp.

◆ renderMessage() [2/4]

void Supernova::SupernovaEngine::renderMessage ( const Common::String text,
MessagePosition  position = kMessageNormal 
)

Definition at line 263 of file supernova.cpp.

◆ renderMessage() [3/4]

void Supernova::SupernovaEngine::renderMessage ( int  stringId,
int  x,
int  y 
)

Definition at line 273 of file supernova.cpp.

◆ renderMessage() [4/4]

void Supernova::SupernovaEngine::renderMessage ( int  stringId,
MessagePosition  position = kMessageNormal,
Common::String  var1 = "",
Common::String  var2 = "" 
)

Definition at line 268 of file supernova.cpp.

◆ renderRoom()

void Supernova::SupernovaEngine::renderRoom ( Room room)

Definition at line 254 of file supernova.cpp.

◆ renderText() [1/9]

void Supernova::SupernovaEngine::renderText ( const char *  text)

Definition at line 286 of file supernova.cpp.

◆ renderText() [2/9]

void Supernova::SupernovaEngine::renderText ( const char *  text,
int  x,
int  y,
byte  color 
)

Definition at line 306 of file supernova.cpp.

◆ renderText() [3/9]

void Supernova::SupernovaEngine::renderText ( const Common::String text)

Definition at line 290 of file supernova.cpp.

◆ renderText() [4/9]

void Supernova::SupernovaEngine::renderText ( const Common::String text,
int  x,
int  y,
byte  color 
)

Definition at line 310 of file supernova.cpp.

◆ renderText() [5/9]

void Supernova::SupernovaEngine::renderText ( const GuiElement guiElement)

Definition at line 298 of file supernova.cpp.

◆ renderText() [6/9]

void Supernova::SupernovaEngine::renderText ( const uint16  character)

Definition at line 282 of file supernova.cpp.

◆ renderText() [7/9]

void Supernova::SupernovaEngine::renderText ( const uint16  character,
int  x,
int  y,
byte  color 
)

Definition at line 302 of file supernova.cpp.

◆ renderText() [8/9]

void Supernova::SupernovaEngine::renderText ( int  stringId)

Definition at line 294 of file supernova.cpp.

◆ renderText() [9/9]

void Supernova::SupernovaEngine::renderText ( int  stringId,
int  x,
int  y,
byte  color 
)

Definition at line 314 of file supernova.cpp.

◆ restoreScreen()

void Supernova::SupernovaEngine::restoreScreen ( )

Definition at line 250 of file supernova.cpp.

◆ run()

Common::Error Supernova::SupernovaEngine::run ( )
overridevirtual

Init the engine and start its main loop.

Returns
returns kNoError on success, else an error code.

Implements Engine.

Definition at line 115 of file supernova.cpp.

◆ saveGame()

bool Supernova::SupernovaEngine::saveGame ( int  slot,
const Common::String description 
)

Definition at line 776 of file supernova.cpp.

◆ saveGameState()

Common::Error Supernova::SupernovaEngine::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 669 of file supernova.cpp.

◆ saveScreen() [1/2]

void Supernova::SupernovaEngine::saveScreen ( const GuiElement guiElement)

Definition at line 246 of file supernova.cpp.

◆ saveScreen() [2/2]

void Supernova::SupernovaEngine::saveScreen ( int  x,
int  y,
int  width,
int  height 
)

Definition at line 242 of file supernova.cpp.

◆ serialize()

bool Supernova::SupernovaEngine::serialize ( Common::WriteStream out)

Definition at line 673 of file supernova.cpp.

◆ setColor63()

void Supernova::SupernovaEngine::setColor63 ( byte  value)

Definition at line 342 of file supernova.cpp.

◆ setCurrentImage()

bool Supernova::SupernovaEngine::setCurrentImage ( int  filenumber)

Definition at line 238 of file supernova.cpp.

◆ setGameString()

void Supernova::SupernovaEngine::setGameString ( int  idx,
const Common::String string 
)

Definition at line 209 of file supernova.cpp.

◆ setTextSpeed()

void Supernova::SupernovaEngine::setTextSpeed ( )

Definition at line 346 of file supernova.cpp.

◆ showHelpScreen1()

void Supernova::SupernovaEngine::showHelpScreen1 ( )

Definition at line 407 of file supernova.cpp.

◆ showHelpScreen2()

void Supernova::SupernovaEngine::showHelpScreen2 ( )

Definition at line 432 of file supernova.cpp.

◆ showTextReader()

Common::Error Supernova::SupernovaEngine::showTextReader ( const char *  extension)

Definition at line 509 of file supernova.cpp.

◆ stopSound()

void Supernova::SupernovaEngine::stopSound ( )

Definition at line 832 of file supernova.cpp.

Member Data Documentation

◆ _allowLoadGame

bool Supernova::SupernovaEngine::_allowLoadGame

Definition at line 79 of file supernova.h.

◆ _allowSaveGame

bool Supernova::SupernovaEngine::_allowSaveGame

Definition at line 80 of file supernova.h.

◆ _delay

uint Supernova::SupernovaEngine::_delay

Definition at line 86 of file supernova.h.

◆ _gameStrings

Common::StringArray Supernova::SupernovaEngine::_gameStrings

Definition at line 81 of file supernova.h.

◆ _gm

GameManager* Supernova::SupernovaEngine::_gm

Definition at line 75 of file supernova.h.

◆ _improved

bool Supernova::SupernovaEngine::_improved

Definition at line 89 of file supernova.h.

◆ _MSPart

char Supernova::SupernovaEngine::_MSPart

Definition at line 88 of file supernova.h.

◆ _nullString

Common::String Supernova::SupernovaEngine::_nullString

Definition at line 82 of file supernova.h.

◆ _resMan

ResourceManager* Supernova::SupernovaEngine::_resMan

Definition at line 77 of file supernova.h.

◆ _screen

Screen* Supernova::SupernovaEngine::_screen

Definition at line 78 of file supernova.h.

◆ _sleepAuoSaveVersion

int Supernova::SupernovaEngine::_sleepAuoSaveVersion

Definition at line 83 of file supernova.h.

◆ _sleepAutoSave

Common::MemoryReadWriteStream* Supernova::SupernovaEngine::_sleepAutoSave

Definition at line 84 of file supernova.h.

◆ _sound

Sound* Supernova::SupernovaEngine::_sound

Definition at line 76 of file supernova.h.

◆ _textSpeed

int Supernova::SupernovaEngine::_textSpeed

Definition at line 87 of file supernova.h.


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