ScummVM API documentation
Sci::GuestAdditions Class Reference

#include <guest_additions.h>

Public Member Functions

 GuestAdditions (EngineState *state, GameFeatures *features, Kernel *kernel)
 
void syncSoundSettingsFromScummVM () const
 
void syncAudioOptionsFromScummVM () const
 
void reset ()
 
void sciEngineRunGameHook ()
 
void writeVarHook (const int type, const int index, const reg_t value)
 
bool kDoSoundMasterVolumeHook (const int volume) const
 
bool userHasControl ()
 
bool kGetEventHook () const
 
bool kWaitHook () const
 
void patchGameSaveRestore () const
 

Detailed Description

The GuestAdditions class hooks into the SCI virtual machine to provide enhanced interactions between the ScummVM GUI and the game engine. Currently, this enhanced functionality encompasses synchronisation of audio volumes and other audio-related settings, and integration of the ScummVM GUI when saving and loading game states.

NOTE: Some parts of the code used to manage audio sync are applied as script patches using the normal ScriptPatcher mechanism. These patches prevent the game from resetting audio volumes to defaults when starting up, and prevent the game from restoring audio volumes stored inside of a save game.

Member Function Documentation

◆ syncSoundSettingsFromScummVM()

void Sci::GuestAdditions::syncSoundSettingsFromScummVM ( ) const

Synchronises audio volume settings from ScummVM to the game. Called whenever the ScummVM global menu is dismissed.

◆ syncAudioOptionsFromScummVM()

void Sci::GuestAdditions::syncAudioOptionsFromScummVM ( ) const

Synchronises all audio settings from ScummVM to the game. Called when the game is first started, and when save games are loaded.

◆ reset()

void Sci::GuestAdditions::reset ( )

Clears audio settings synchronisation state.

◆ sciEngineRunGameHook()

void Sci::GuestAdditions::sciEngineRunGameHook ( )

Guest additions hook for SciEngine::runGame.

◆ writeVarHook()

void Sci::GuestAdditions::writeVarHook ( const int  type,
const int  index,
const reg_t  value 
)

Guest additions hook for write_var.

◆ kDoSoundMasterVolumeHook()

bool Sci::GuestAdditions::kDoSoundMasterVolumeHook ( const int  volume) const

Guest additions hook for kDoSoundMasterVolume.

Returns
true if the default action should be prevented

◆ userHasControl()

bool Sci::GuestAdditions::userHasControl ( )

Determines whether the user has control.

◆ kGetEventHook()

bool Sci::GuestAdditions::kGetEventHook ( ) const

Guest additions hook for kGetEvent.

◆ kWaitHook()

bool Sci::GuestAdditions::kWaitHook ( ) const

Guest additions hook for kWait.

◆ patchGameSaveRestore()

void Sci::GuestAdditions::patchGameSaveRestore ( ) const

Patches game scripts to use the ScummVM save/load dialogue instead of the game's native save/load dialogue when a user tries to save or restore a game from inside the game.


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