ScummVM
ZVision::ZVision Class Reference

#include <zvision.h>

Inheritance diagram for ZVision::ZVision:
Collaboration diagram for ZVision::ZVision:

Public Member Functions

 ZVision (OSystem *syst, const ZVisionGameDescription *gameDesc)
 
 ~ZVision ()
 
Common::Error run ()
 Init the engine and start its main loop. More...
 
void pauseEngineIntern (bool pause)
 Actual implementation of pauseEngine by subclasses. More...
 
ZVisionGameId getGameId () const
 
Common::Language getLanguage () const
 
uint32 getFeatures () const
 
ScriptManagergetScriptManager () const
 
RenderManagergetRenderManager () const
 
CursorManagergetCursorManager () const
 
SaveManagergetSaveManager () const
 
StringManagergetStringManager () const
 
SearchManagergetSearchManager () const
 
TextRenderergetTextRenderer () const
 
MidiManagergetMidiManager () const
 
MenuHandlergetMenuHandler () const
 
Common::RandomSourcegetRandomSource () const
 
int16 getKeyboardVelocity () const
 
int16 getMouseVelocity () const
 
uint8 getZvisionKey (Common::KeyCode scummKeyCode)
 
void startClock ()
 
void stopClock ()
 
void initScreen ()
 
void initHiresScreen ()
 
void playVideo (Video::VideoDecoder &videoDecoder, const Common::Rect &destRect=Common::Rect(0, 0, 0, 0), bool skippable=true, Subtitle *sub=NULL)
 Play a video until it is finished. More...
 
Video::VideoDecoderloadAnimation (const Common::String &fileName)
 
Common::String generateSaveFileName (uint slot)
 
void setRenderDelay (uint)
 
bool canRender ()
 
void fpsTimer ()
 
int getFPS () const
 
GUI::DebuggergetDebugger ()
 Return the engine's debugger instance, if any. More...
 
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 loadSettings ()
 
void saveSettings ()
 
bool ifQuit ()
 
bool hasFeature (EngineFeature f) const
 Determine whether the engine supports the specified feature. More...
 
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 &desc)
 Save a game state. More...
 
- 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 void fpsTimerCallback (void *refCon)
 
- 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::Rect _workingWindow
 A Rectangle centered inside the actual window. More...
 
const Graphics::PixelFormat _resourcePixelFormat
 
const Graphics::PixelFormat _screenPixelFormat
 
- Public Attributes inherited from Engine
OSystem_system
 
Audio::Mixer_mixer
 

Private Member Functions

void initialize ()
 
void initFonts ()
 
void parseStrFile (const Common::String fileName)
 
void processEvents ()
 Called every frame from ZVision::run() to process any events from EventMan. More...
 
void onMouseMove (const Common::Point &pos)
 
void registerDefaultSettings ()
 
void shortKeys (Common::Event)
 
void cheatCodes (uint8 key)
 
void pushKeyToCheatBuf (uint8 key)
 
bool checkCode (const char *code)
 
uint8 getBufferedKey (uint8 pos)
 
double getVobAmplification (Common::String fileName) const
 

Private Attributes

Console_console
 
const ZVisionGameDescription_gameDescription
 
const int _desiredFrameTime
 
Common::RandomSource_rnd
 
ScriptManager_scriptManager
 
RenderManager_renderManager
 
CursorManager_cursorManager
 
StringManager_stringManager
 
SearchManager_searchManager
 
TextRenderer_textRenderer
 
MidiManager_midiManager
 
SaveManager_saveManager
 
MenuHandler_menu
 
Clock _clock
 
int _audioId
 
Common::Event _event
 
int _frameRenderDelay
 
int _renderedFrameCount
 
int _fps
 
int16 _mouseVelocity
 
int16 _keyboardVelocity
 
bool _doubleFPS
 
bool _videoIsPlaying
 
uint8 _cheatBuffer [KEYBUF_SIZE]
 

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...
 
- 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 99 of file zvision.h.

Constructor & Destructor Documentation

◆ ZVision()

ZVision::ZVision::ZVision ( OSystem syst,
const ZVisionGameDescription gameDesc 
)

Definition at line 79 of file zvision.cpp.

◆ ~ZVision()

ZVision::ZVision::~ZVision ( )

Definition at line 111 of file zvision.cpp.

Member Function Documentation

◆ canLoadGameStateCurrently()

bool ZVision::ZVision::canLoadGameStateCurrently ( )
virtual

Indicates whether a game state can be loaded.

Reimplemented from Engine.

Definition at line 114 of file detection.cpp.

◆ canRender()

bool ZVision::ZVision::canRender ( )

Definition at line 381 of file zvision.cpp.

◆ canSaveGameStateCurrently()

bool ZVision::ZVision::canSaveGameStateCurrently ( )
virtual

Indicates whether a game state can be saved.

Reimplemented from Engine.

Definition at line 118 of file detection.cpp.

◆ cheatCodes()

void ZVision::ZVision::cheatCodes ( uint8  key)
private

Definition at line 96 of file events.cpp.

◆ checkCode()

bool ZVision::ZVision::checkCode ( const char *  code)
private

Definition at line 51 of file events.cpp.

◆ fpsTimer()

void ZVision::ZVision::fpsTimer ( )

Definition at line 399 of file zvision.cpp.

◆ fpsTimerCallback()

void ZVision::ZVision::fpsTimerCallback ( void refCon)
static

Definition at line 395 of file zvision.cpp.

◆ generateSaveFileName()

Common::String ZVision::ZVision::generateSaveFileName ( uint  slot)

Definition at line 373 of file zvision.cpp.

◆ getBufferedKey()

uint8 ZVision::ZVision::getBufferedKey ( uint8  pos)
private

Definition at line 64 of file events.cpp.

◆ getCursorManager()

CursorManager* ZVision::ZVision::getCursorManager ( ) const
inline

Definition at line 167 of file zvision.h.

◆ getDebugger()

GUI::Debugger * ZVision::ZVision::getDebugger ( )
virtual

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 385 of file zvision.cpp.

◆ getFeatures()

uint32 ZVision::ZVision::getFeatures ( ) const

Definition at line 51 of file detection.cpp.

◆ getFPS()

int ZVision::ZVision::getFPS ( ) const
inline

Definition at line 230 of file zvision.h.

◆ getGameId()

ZVisionGameId ZVision::ZVision::getGameId ( ) const

Definition at line 45 of file detection.cpp.

◆ getKeyboardVelocity()

int16 ZVision::ZVision::getKeyboardVelocity ( ) const
inline

Definition at line 192 of file zvision.h.

◆ getLanguage()

Common::Language ZVision::ZVision::getLanguage ( ) const

Definition at line 48 of file detection.cpp.

◆ getMenuHandler()

MenuHandler* ZVision::ZVision::getMenuHandler ( ) const
inline

Definition at line 185 of file zvision.h.

◆ getMidiManager()

MidiManager* ZVision::ZVision::getMidiManager ( ) const
inline

Definition at line 182 of file zvision.h.

◆ getMouseVelocity()

int16 ZVision::ZVision::getMouseVelocity ( ) const
inline

Definition at line 195 of file zvision.h.

◆ getRandomSource()

Common::RandomSource* ZVision::ZVision::getRandomSource ( ) const
inline

Definition at line 189 of file zvision.h.

◆ getRenderManager()

RenderManager* ZVision::ZVision::getRenderManager ( ) const
inline

Definition at line 164 of file zvision.h.

◆ getSaveManager()

SaveManager* ZVision::ZVision::getSaveManager ( ) const
inline

Definition at line 170 of file zvision.h.

◆ getScriptManager()

ScriptManager* ZVision::ZVision::getScriptManager ( ) const
inline

Definition at line 161 of file zvision.h.

◆ getSearchManager()

SearchManager* ZVision::ZVision::getSearchManager ( ) const
inline

Definition at line 176 of file zvision.h.

◆ getStringManager()

StringManager* ZVision::ZVision::getStringManager ( ) const
inline

Definition at line 173 of file zvision.h.

◆ getTextRenderer()

TextRenderer* ZVision::ZVision::getTextRenderer ( ) const
inline

Definition at line 179 of file zvision.h.

◆ getVobAmplification()

double ZVision::ZVision::getVobAmplification ( Common::String  fileName) const
private

Definition at line 149 of file video.cpp.

◆ getZvisionKey()

uint8 ZVision::ZVision::getZvisionKey ( Common::KeyCode  scummKeyCode)

Definition at line 397 of file events.cpp.

◆ hasFeature()

bool ZVision::ZVision::hasFeature ( EngineFeature  f) const
virtual

Determine whether the engine supports the specified feature.

Reimplemented from Engine.

Definition at line 98 of file detection.cpp.

◆ ifQuit()

bool ZVision::ZVision::ifQuit ( )

Definition at line 499 of file events.cpp.

◆ initFonts()

void ZVision::ZVision::initFonts ( )
private

◆ initHiresScreen()

void ZVision::ZVision::initHiresScreen ( )

Definition at line 417 of file zvision.cpp.

◆ initialize()

void ZVision::ZVision::initialize ( )
private

Definition at line 175 of file zvision.cpp.

◆ initScreen()

void ZVision::ZVision::initScreen ( )

Definition at line 404 of file zvision.cpp.

◆ loadAnimation()

Video::VideoDecoder * ZVision::ZVision::loadAnimation ( const Common::String fileName)

Definition at line 42 of file video.cpp.

◆ loadGameState()

Common::Error ZVision::ZVision::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 105 of file detection.cpp.

◆ loadSettings()

void ZVision::ZVision::loadSettings ( )

Definition at line 141 of file zvision.cpp.

◆ onMouseMove()

void ZVision::ZVision::onMouseMove ( const Common::Point pos)
private

Definition at line 292 of file events.cpp.

◆ parseStrFile()

void ZVision::ZVision::parseStrFile ( const Common::String  fileName)
private

◆ pauseEngineIntern()

void ZVision::ZVision::pauseEngineIntern ( bool  pause)
virtual

Actual implementation of pauseEngine by subclasses.

See there for details.

Reimplemented from Engine.

Definition at line 363 of file zvision.cpp.

◆ playVideo()

void ZVision::ZVision::playVideo ( Video::VideoDecoder videoDecoder,
const Common::Rect destRect = Common::Rect(0, 0, 0, 0),
bool  skippable = true,
Subtitle sub = NULL 
)

Play a video until it is finished.

This is a blocking call. It will call _clock.stop() when the video starts and _clock.start() when the video finishes. It will also consume all events during video playback.

Parameters
videoDecoderThe video to play
destRectWhere to put the video. (In working window coords)
skippableIf true, the video can be skipped at any time using [Spacebar]

Definition at line 71 of file video.cpp.

◆ processEvents()

void ZVision::ZVision::processEvents ( )
private

Called every frame from ZVision::run() to process any events from EventMan.

Definition at line 191 of file events.cpp.

◆ pushKeyToCheatBuf()

void ZVision::ZVision::pushKeyToCheatBuf ( uint8  key)
private

Definition at line 44 of file events.cpp.

◆ registerDefaultSettings()

void ZVision::ZVision::registerDefaultSettings ( )
private

Definition at line 130 of file zvision.cpp.

◆ run()

Common::Error ZVision::ZVision::run ( )
virtual

Init the engine and start its main loop.

Returns
returns kNoError on success, else an error code.

Implements Engine.

Definition at line 246 of file zvision.cpp.

◆ saveGameState()

Common::Error ZVision::ZVision::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 109 of file detection.cpp.

◆ saveSettings()

void ZVision::ZVision::saveSettings ( )

Definition at line 162 of file zvision.cpp.

◆ setRenderDelay()

void ZVision::ZVision::setRenderDelay ( uint  delay)

Definition at line 377 of file zvision.cpp.

◆ shortKeys()

void ZVision::ZVision::shortKeys ( Common::Event  event)
private

Definition at line 71 of file events.cpp.

◆ startClock()

void ZVision::ZVision::startClock ( )
inline

Definition at line 201 of file zvision.h.

◆ stopClock()

void ZVision::ZVision::stopClock ( )
inline

Definition at line 205 of file zvision.h.

◆ syncSoundSettings()

void ZVision::ZVision::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 389 of file zvision.cpp.

Member Data Documentation

◆ _audioId

int ZVision::ZVision::_audioId
private

Definition at line 138 of file zvision.h.

◆ _cheatBuffer

uint8 ZVision::ZVision::_cheatBuffer[KEYBUF_SIZE]
private

Definition at line 151 of file zvision.h.

◆ _clock

Clock ZVision::ZVision::_clock
private

Definition at line 135 of file zvision.h.

◆ _console

Console* ZVision::ZVision::_console
private

Definition at line 115 of file zvision.h.

◆ _cursorManager

CursorManager* ZVision::ZVision::_cursorManager
private

Definition at line 126 of file zvision.h.

◆ _desiredFrameTime

const int ZVision::ZVision::_desiredFrameTime
private

Definition at line 118 of file zvision.h.

◆ _doubleFPS

bool ZVision::ZVision::_doubleFPS
private

Definition at line 148 of file zvision.h.

◆ _event

Common::Event ZVision::ZVision::_event
private

Definition at line 141 of file zvision.h.

◆ _fps

int ZVision::ZVision::_fps
private

Definition at line 145 of file zvision.h.

◆ _frameRenderDelay

int ZVision::ZVision::_frameRenderDelay
private

Definition at line 143 of file zvision.h.

◆ _gameDescription

const ZVisionGameDescription* ZVision::ZVision::_gameDescription
private

Definition at line 116 of file zvision.h.

◆ _keyboardVelocity

int16 ZVision::ZVision::_keyboardVelocity
private

Definition at line 147 of file zvision.h.

◆ _menu

MenuHandler* ZVision::ZVision::_menu
private

Definition at line 132 of file zvision.h.

◆ _midiManager

MidiManager* ZVision::ZVision::_midiManager
private

Definition at line 130 of file zvision.h.

◆ _mouseVelocity

int16 ZVision::ZVision::_mouseVelocity
private

Definition at line 146 of file zvision.h.

◆ _renderedFrameCount

int ZVision::ZVision::_renderedFrameCount
private

Definition at line 144 of file zvision.h.

◆ _renderManager

RenderManager* ZVision::ZVision::_renderManager
private

Definition at line 125 of file zvision.h.

◆ _resourcePixelFormat

const Graphics::PixelFormat ZVision::ZVision::_resourcePixelFormat

Definition at line 111 of file zvision.h.

◆ _rnd

Common::RandomSource* ZVision::ZVision::_rnd
private

Definition at line 121 of file zvision.h.

◆ _saveManager

SaveManager* ZVision::ZVision::_saveManager
private

Definition at line 131 of file zvision.h.

◆ _screenPixelFormat

const Graphics::PixelFormat ZVision::ZVision::_screenPixelFormat

Definition at line 112 of file zvision.h.

◆ _scriptManager

ScriptManager* ZVision::ZVision::_scriptManager
private

Definition at line 124 of file zvision.h.

◆ _searchManager

SearchManager* ZVision::ZVision::_searchManager
private

Definition at line 128 of file zvision.h.

◆ _stringManager

StringManager* ZVision::ZVision::_stringManager
private

Definition at line 127 of file zvision.h.

◆ _textRenderer

TextRenderer* ZVision::ZVision::_textRenderer
private

Definition at line 129 of file zvision.h.

◆ _videoIsPlaying

bool ZVision::ZVision::_videoIsPlaying
private

Definition at line 149 of file zvision.h.

◆ _workingWindow

Common::Rect ZVision::ZVision::_workingWindow

A Rectangle centered inside the actual window.

All in-game coordinates are given in this coordinate space. Also, all images are clipped to the edges of this Rectangle

Definition at line 110 of file zvision.h.


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