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 ()
 
virtual Common::Error run ()
 Init the engine and start its main loop. More...
 
virtual Common::Error loadGameState (int slot)
 Load a game state. More...
 
virtual bool canLoadGameStateCurrently ()
 Indicates whether a game state can be loaded. 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...
 
virtual bool hasFeature (EngineFeature f) const
 Determine whether the engine supports the specified feature. More...
 
virtual void pauseEngineIntern (bool pause)
 Actual implementation of pauseEngine by subclasses. More...
 
Common::Error loadGameStrings ()
 
void init ()
 
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
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 GUI::DebuggergetDebugger ()
 Return the engine's debugger instance, if any. 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...
 

Public Attributes

GameManager_gm
 
Console_console
 
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,
  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 Member Functions inherited from Engine
virtual int runDialog (GUI::Dialog &dialog)
 
bool shouldPerformAutoSave (int lastSaveTime)
 Indicate whether an autosave should be performed. 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 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 ( )

Definition at line 106 of file supernova.cpp.

Member Function Documentation

◆ canLoadGameStateCurrently()

bool Supernova::SupernovaEngine::canLoadGameStateCurrently ( )
virtual

Indicates whether a game state can be loaded.

Reimplemented from Engine.

Definition at line 659 of file supernova.cpp.

◆ canSaveGameStateCurrently()

bool Supernova::SupernovaEngine::canSaveGameStateCurrently ( )
virtual

Indicates whether a game state can be saved.

Reimplemented from Engine.

Definition at line 667 of file supernova.cpp.

◆ deserialize()

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

Definition at line 684 of file supernova.cpp.

◆ errorTempSave()

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

Definition at line 828 of file supernova.cpp.

◆ getBlockFromDatFile()

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

Definition at line 453 of file supernova.cpp.

◆ getGameString()

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

Definition at line 206 of file supernova.cpp.

◆ hasFeature()

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

Determine whether the engine supports the specified feature.

Reimplemented from Engine.

Definition at line 165 of file supernova.cpp.

◆ init()

void Supernova::SupernovaEngine::init ( void  )

Definition at line 136 of file supernova.cpp.

◆ loadGame()

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

Definition at line 697 of file supernova.cpp.

◆ loadGameState()

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

◆ loadGameStrings()

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

Definition at line 183 of file supernova.cpp.

◆ paletteBrightness()

void Supernova::SupernovaEngine::paletteBrightness ( )

Definition at line 329 of file supernova.cpp.

◆ paletteFadeIn()

void Supernova::SupernovaEngine::paletteFadeIn ( )

Definition at line 338 of file supernova.cpp.

◆ paletteFadeOut()

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

Definition at line 333 of file supernova.cpp.

◆ pauseEngineIntern()

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

Actual implementation of pauseEngine by subclasses.

See there for details.

Reimplemented from Engine.

Definition at line 178 of file supernova.cpp.

◆ playSound() [1/2]

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

Definition at line 220 of file supernova.cpp.

◆ playSound() [2/2]

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

Definition at line 225 of file supernova.cpp.

◆ quitGameDialog()

bool Supernova::SupernovaEngine::quitGameDialog ( )

Definition at line 600 of file supernova.cpp.

◆ removeMessage()

void Supernova::SupernovaEngine::removeMessage ( )

Definition at line 281 of file supernova.cpp.

◆ renderBox() [1/2]

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

Definition at line 321 of file supernova.cpp.

◆ renderBox() [2/2]

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

Definition at line 325 of file supernova.cpp.

◆ renderImage() [1/2]

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

Definition at line 230 of file supernova.cpp.

◆ renderImage() [2/2]

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

Definition at line 236 of file supernova.cpp.

◆ renderMessage() [1/4]

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

Definition at line 261 of file supernova.cpp.

◆ renderMessage() [2/4]

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

Definition at line 266 of file supernova.cpp.

◆ renderMessage() [3/4]

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

Definition at line 271 of file supernova.cpp.

◆ renderMessage() [4/4]

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

Definition at line 276 of file supernova.cpp.

◆ renderRoom()

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

Definition at line 257 of file supernova.cpp.

◆ renderText() [1/9]

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

Definition at line 285 of file supernova.cpp.

◆ renderText() [2/9]

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

Definition at line 289 of file supernova.cpp.

◆ renderText() [3/9]

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

Definition at line 293 of file supernova.cpp.

◆ renderText() [4/9]

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

Definition at line 297 of file supernova.cpp.

◆ renderText() [5/9]

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

Definition at line 305 of file supernova.cpp.

◆ renderText() [6/9]

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

Definition at line 309 of file supernova.cpp.

◆ renderText() [7/9]

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

Definition at line 313 of file supernova.cpp.

◆ renderText() [8/9]

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

Definition at line 317 of file supernova.cpp.

◆ renderText() [9/9]

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

Definition at line 301 of file supernova.cpp.

◆ restoreScreen()

void Supernova::SupernovaEngine::restoreScreen ( )

Definition at line 253 of file supernova.cpp.

◆ run()

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

Init the engine and start its main loop.

Returns
returns kNoError on success, else an error code.

Implements Engine.

Definition at line 117 of file supernova.cpp.

◆ saveGame()

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

Definition at line 774 of file supernova.cpp.

◆ saveGameState()

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

◆ saveScreen() [1/2]

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

Definition at line 245 of file supernova.cpp.

◆ saveScreen() [2/2]

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

Definition at line 249 of file supernova.cpp.

◆ serialize()

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

Definition at line 676 of file supernova.cpp.

◆ setColor63()

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

Definition at line 345 of file supernova.cpp.

◆ setCurrentImage()

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

Definition at line 241 of file supernova.cpp.

◆ setGameString()

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

Definition at line 212 of file supernova.cpp.

◆ setTextSpeed()

void Supernova::SupernovaEngine::setTextSpeed ( )

Definition at line 349 of file supernova.cpp.

◆ showHelpScreen1()

void Supernova::SupernovaEngine::showHelpScreen1 ( )

Definition at line 410 of file supernova.cpp.

◆ showHelpScreen2()

void Supernova::SupernovaEngine::showHelpScreen2 ( )

Definition at line 435 of file supernova.cpp.

◆ showTextReader()

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

Definition at line 512 of file supernova.cpp.

◆ stopSound()

void Supernova::SupernovaEngine::stopSound ( )

Definition at line 835 of file supernova.cpp.

Member Data Documentation

◆ _allowLoadGame

bool Supernova::SupernovaEngine::_allowLoadGame

Definition at line 80 of file supernova.h.

◆ _allowSaveGame

bool Supernova::SupernovaEngine::_allowSaveGame

Definition at line 81 of file supernova.h.

◆ _console

Console* Supernova::SupernovaEngine::_console

Definition at line 76 of file supernova.h.

◆ _delay

uint Supernova::SupernovaEngine::_delay

Definition at line 87 of file supernova.h.

◆ _gameStrings

Common::StringArray Supernova::SupernovaEngine::_gameStrings

Definition at line 82 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 90 of file supernova.h.

◆ _MSPart

char Supernova::SupernovaEngine::_MSPart

Definition at line 89 of file supernova.h.

◆ _nullString

Common::String Supernova::SupernovaEngine::_nullString

Definition at line 83 of file supernova.h.

◆ _resMan

ResourceManager* Supernova::SupernovaEngine::_resMan

Definition at line 78 of file supernova.h.

◆ _screen

Screen* Supernova::SupernovaEngine::_screen

Definition at line 79 of file supernova.h.

◆ _sleepAuoSaveVersion

int Supernova::SupernovaEngine::_sleepAuoSaveVersion

Definition at line 84 of file supernova.h.

◆ _sleepAutoSave

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

Definition at line 85 of file supernova.h.

◆ _sound

Sound* Supernova::SupernovaEngine::_sound

Definition at line 77 of file supernova.h.

◆ _textSpeed

int Supernova::SupernovaEngine::_textSpeed

Definition at line 88 of file supernova.h.


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