#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 |
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.
void Sci::GuestAdditions::syncSoundSettingsFromScummVM | ( | ) | const |
Synchronises audio volume settings from ScummVM to the game. Called whenever the ScummVM global menu is dismissed.
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.
void Sci::GuestAdditions::reset | ( | ) |
Clears audio settings synchronisation state.
void Sci::GuestAdditions::sciEngineRunGameHook | ( | ) |
Guest additions hook for SciEngine::runGame.
void Sci::GuestAdditions::writeVarHook | ( | const int | type, |
const int | index, | ||
const reg_t | value | ||
) |
Guest additions hook for write_var.
bool Sci::GuestAdditions::kDoSoundMasterVolumeHook | ( | const int | volume | ) | const |
Guest additions hook for kDoSoundMasterVolume.
bool Sci::GuestAdditions::userHasControl | ( | ) |
Determines whether the user has control.
bool Sci::GuestAdditions::kGetEventHook | ( | ) | const |
Guest additions hook for kGetEvent.
bool Sci::GuestAdditions::kWaitHook | ( | ) | const |
Guest additions hook for kWait.
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.