ScummVM API documentation
BladeRunner::BladeRunnerEngine Class Reference
Inheritance diagram for BladeRunner::BladeRunnerEngine:
Engine

Public Types

enum  { kKeyRepeatInitialDelay = 400, kKeyRepeatSustainDelay = 100 }
 
enum  BladeRunnerEngineMappableAction {
  kMpActionToggleCombat, kMpActionCutsceneSkip, kMpActionDialogueSkip, kMpActionToggleKiaOptions,
  kMpActionOpenKiaDatabase, kMpActionOpenKIATabHelp, kMpActionOpenKIATabSaveGame, kMpActionOpenKIATabLoadGame,
  kMpActionOpenKIATabCrimeSceneDatabase, kMpActionOpenKIATabSuspectDatabase, kMpActionOpenKIATabClueDatabase, kMpActionOpenKIATabQuitGame,
  kMpActionScrollUp, kMpActionScrollDown, kMpConfirmDlg, kMpDeleteSelectedSvdGame,
  kMpActionToggleCluePrivacy
}
 
typedef Common::Array< Common::EventActiveCustomEventsArray
 
- Public Types inherited from Engine
enum  EngineFeature {
  kSupportsSubtitleOptions, kSupportsReturnToLauncher, kSupportsLoadingDuringRuntime, kSupportsSavingDuringRuntime,
  kSupportsChangingOptionsDuringRuntime, kSupportsArbitraryResolutions, kSupportsHelp, kSupportsQuitDialogOverride
}
 

Public Member Functions

 BladeRunnerEngine (OSystem *syst, const ADGameDescription *desc)
 
bool hasFeature (EngineFeature f) const override
 
bool canLoadGameStateCurrently (Common::U32String *msg=nullptr) override
 
Common::Error loadGameState (int slot) override
 
bool canSaveGameStateCurrently (Common::U32String *msg=nullptr) override
 
Common::Error saveGameState (int slot, const Common::String &desc, bool isAutosave=false) override
 
int getAutosaveSlot () const override
 
void pauseEngineIntern (bool pause) override
 
Common::Error run () override
 
bool checkFiles (Common::Array< Common::String > &missingFiles)
 
bool startup (bool hasSavegames=false)
 
void initChapterAndScene ()
 
void shutdown ()
 
bool loadSplash ()
 
Common::Point getMousePos () const
 
bool isMouseButtonDown () const
 
void gameLoop ()
 
void gameTick ()
 
void actorsUpdate ()
 
void walkingReset ()
 
void handleEvents ()
 
void handleKeyUp (Common::Event &event)
 
void handleKeyDown (Common::Event &event)
 
void handleMouseAction (int x, int y, bool mainButton, bool buttonDown, int scrollDirection=0)
 
void handleMouseClickExit (int exitId, int x, int y, bool buttonDown)
 
void handleMouseClickRegion (int regionId, int x, int y, bool buttonDown)
 
void handleMouseClickItem (int itemId, bool buttonDown)
 
void handleMouseClickActor (int actorId, bool mainButton, bool buttonDown, Vector3 &scenePosition, int x, int y)
 
void handleMouseClick3DObject (int objectId, bool buttonDown, bool isClickable, bool isTarget)
 
void handleMouseClickEmpty (int x, int y, Vector3 &scenePosition, bool buttonDown)
 
bool isAllowedRepeatedKey (const Common::KeyState &currKeyState)
 
void handleCustomEventStart (Common::Event &event)
 
void handleCustomEventStop (Common::Event &event)
 
bool isAllowedRepeatedCustomEvent (const Common::Event &currEvent)
 
bool shouldDropRogueCustomEvent (const Common::Event &evt)
 
void cleanupPendingRepeatingEvents (const Common::String &keymapperId)
 
void gameWaitForActive ()
 
void loopActorSpeaking ()
 
void loopQueuedDialogueStillPlaying ()
 
void outtakePlay (int id, bool no_localization, int container=-1)
 
void outtakePlay (const Common::String &basenameNoExt, bool no_localization, int container=-3)
 
bool openArchive (const Common::String &name)
 
bool closeArchive (const Common::String &name)
 
bool isArchiveOpen (const Common::String &name) const
 
bool openArchiveEnhancedEdition ()
 
void syncSoundSettings () override
 
bool isSubtitlesEnabled ()
 
void setSubtitlesEnabled (bool newVal)
 
Common::SeekableReadStreamgetResourceStream (const Common::String &name)
 
bool playerHasControl ()
 
void playerLosesControl ()
 
void playerGainsControl (bool force=false)
 
void playerDied ()
 
bool saveGame (Common::WriteStream &stream, Graphics::Surface *thumb=NULL, bool origformat=false)
 
bool loadGame (Common::SeekableReadStream &stream, int version)
 
void newGame (int difficulty)
 
void autoSaveGame (int textId, bool endgame)
 
void ISez (const Common::String &str)
 
void blitToScreen (const Graphics::Surface &src) const
 
Graphics::Surface generateThumbnail () const
 
Common::String getTargetName () const
 
uint8 getExtraCNotify ()
 
void setExtraCNotify (uint8 val)
 
- Public Member Functions inherited from Engine
MetaEnginegetMetaEngine () const
 
void setMetaEngine (MetaEngine *metaEngine)
 
PauseToken pauseEngine ()
 
bool isPaused () const
 
void openMainMenuDialog ()
 
uint32 getTotalPlayTime () const
 
void setTotalPlayTime (uint32 time=0)
 
Common::TimerManagergetTimerManager ()
 
Common::EventManagergetEventManager ()
 
Common::SaveFileManagergetSaveFileManager ()
 
bool existExtractedCDAudioFiles (uint track=1)
 
bool isDataAndCDAudioReadFromSameCD ()
 
void warnMissingExtractedCDAudio ()
 
void handleAutoSave ()
 
void saveAutosaveIfEnabled ()
 
virtual bool canSaveAutosaveCurrently ()
 
 Engine (OSystem *syst)
 
virtual ~Engine ()
 
virtual void initializePath (const Common::FSNode &gamePath)
 
virtual void errorString (const char *buf_input, char *buf_output, int buf_output_size)
 
virtual GUI::DebuggergetDebugger () final
 
void setDebugger (GUI::Debugger *debugger)
 
GUI::DebuggergetOrCreateDebugger ()
 
virtual void applyGameSettings ()
 
virtual void flipMute ()
 
virtual Common::String getSaveStateName (int slot) const
 
virtual Common::Error loadGameStream (Common::SeekableReadStream *stream)
 
void setGameToLoadSlot (int slot)
 
virtual Common::Error saveGameStream (Common::WriteStream *stream, bool isAutosave=false)
 
bool saveGameDialog ()
 
bool loadGameDialog ()
 

Public Attributes

bool _gameIsRunning
 
bool _windowIsActive
 
int _playerLosesControlCounter
 
int _extraCPos
 
uint8 _extraCNotify
 
Common::String _languageCode
 
Common::Language _language
 
bool _russianCP1251
 
bool _noMusicDriver
 
ActorDialogueQueue_actorDialogueQueue
 
ScreenEffects_screenEffects
 
AIScripts_aiScripts
 
AmbientSounds_ambientSounds
 
AudioCache_audioCache
 
AudioMixer_audioMixer
 
AudioPlayer_audioPlayer
 
AudioSpeech_audioSpeech
 
Chapters_chapters
 
CrimesDatabase_crimesDatabase
 
Combat_combat
 
DialogueMenu_dialogueMenu
 
Elevator_elevator
 
EndCredits_endCredits
 
ESPER_esper
 
GameFlags_gameFlags
 
GameInfo_gameInfo
 
ItemPickup_itemPickup
 
Items_items
 
KIA_kia
 
Lights_lights
 
Font_mainFont
 
Subtitles_subtitles
 
Mouse_mouse
 
Music_music
 
Obstacles_obstacles
 
Overlays_overlays
 
PoliceMaze_policeMaze
 
Scene_scene
 
SceneObjects_sceneObjects
 
SceneScript_sceneScript
 
Scores_scores
 
Settings_settings
 
SliceAnimations_sliceAnimations
 
SliceRenderer_sliceRenderer
 
Spinner_spinner
 
SuspectsDatabase_suspectsDatabase
 
Time_time
 
View_view
 
Framelimiter_framelimiter
 
VK_vk
 
Waypoints_waypoints
 
int * _gameVars
 
TextResource_textActorNames
 
TextResource_textCrimes
 
TextResource_textClueTypes
 
TextResource_textKIA
 
TextResource_textSpinnerDestinations
 
TextResource_textVK
 
TextResource_textOptions
 
Shapes_shapes
 
Actor_actors [kActorCount]
 
Actor_playerActor
 
Graphics::PixelFormat _screenPixelFormat
 
Graphics::Surface _surfaceFront
 
Graphics::Surface _surfaceBack
 
bool _surfaceFrontCreated
 
bool _surfaceBackCreated
 
ZBuffer_zbuffer
 
Common::RandomSource _rnd
 
Debugger_debugger
 
Math::CosineTable * _cosTable1024
 
Math::SineTable * _sinTable1024
 
bool _isWalkingInterruptible
 
bool _interruptWalking
 
bool _playerActorIdle
 
bool _playerDead
 
bool _actorIsSpeaking
 
bool _actorSpeakStopIsRequested
 
bool _gameOver
 
bool _gameJustLaunched
 
int _gameAutoSaveTextId
 
bool _gameIsAutoSaving
 
bool _gameIsLoading
 
bool _sceneIsLoading
 
bool _vqaIsPlaying
 
bool _vqaStopIsRequested
 
bool _subtitlesEnabled
 
bool _showSubtitlesForTextCrawl
 
bool _sitcomMode
 
bool _shortyMode
 
bool _noDelayMillisFramelimiter
 
bool _framesPerSecondMax
 
bool _disableStaminaDrain
 
bool _spanishCreditsCorrection
 
bool _cutContent
 
bool _enhancedEdition
 
bool _validBootParam
 
int _walkSoundId
 
int _walkSoundVolume
 
int _walkSoundPan
 
int _runningActorId
 
uint32 _mouseClickTimeLast
 
uint32 _mouseClickTimeDiff
 
int _walkingToExitId
 
bool _isInsideScriptExit
 
int _walkingToRegionId
 
bool _isInsideScriptRegion
 
int _walkingToObjectId
 
bool _isInsideScriptObject
 
int _walkingToItemId
 
bool _isInsideScriptItem
 
bool _walkingToEmpty
 
int _walkingToEmptyX
 
int _walkingToEmptyY
 
bool _isInsideScriptEmpty
 
int _walkingToActorId
 
bool _isInsideScriptActor
 
int _actorUpdateCounter
 
uint32 _actorUpdateTimeLast
 
uint32 _timeOfMainGameLoopTickPrevious
 
bool _isNonInteractiveDemo
 
Common::KeyState _currentKeyDown
 
uint32 _keyRepeatTimeLast
 
uint32 _keyRepeatTimeDelay
 
uint32 _customEventRepeatTimeLast
 
uint32 _customEventRepeatTimeDelay
 
ActiveCustomEventsArray _activeCustomEvents
 
- Public Attributes inherited from Engine
OSystem_system
 
Audio::Mixer_mixer
 

Static Public Attributes

static const int kArchiveCount = 12
 
static const int kActorCount = 100
 
static const int kActorVoiceOver = kActorCount - 1
 
static const int kMaxCustomConcurrentRepeatableEvents = 20
 
static const int16 kOriginalGameWidth = 640
 
static const int16 kOriginalGameHeight = 480
 
static const int16 kDemoGameWidth = 320
 
static const int16 kDemoGameHeight = 200
 
static const int kBladeRunnerScummVMVersion = 2
 
static const char * kGameplayKeymapId
 
static const char * kKiaKeymapId
 
static const char * kCommonKeymapId
 

Additional Inherited Members

- Static Public Member Functions inherited from Engine
static void quitGame ()
 
static bool shouldQuit ()
 
static MetaEngineDetectiongetMetaEngineDetection ()
 
static bool warnUserAboutUnsupportedGame (Common::String msg=Common::String())
 
static void errorUnsupportedGame (Common::String extraMsg)
 
- Protected Member Functions inherited from Engine
virtual int runDialog (GUI::Dialog &dialog)
 
void defaultSyncSoundSettings ()
 
- Protected Attributes inherited from Engine
Common::TimerManager_timer
 
Common::EventManager_eventMan
 
Common::SaveFileManager_saveFileMan
 
GUI::Dialog_mainMenuDialog
 
const Common::String _targetName
 

Member Function Documentation

◆ hasFeature()

bool BladeRunner::BladeRunnerEngine::hasFeature ( EngineFeature  f) const
overridevirtual

Determine whether the engine supports the specified feature.

Reimplemented from Engine.

◆ canLoadGameStateCurrently()

bool BladeRunner::BladeRunnerEngine::canLoadGameStateCurrently ( Common::U32String msg = nullptr)
overridevirtual

Indicate whether a game state can be loaded.

Parameters
msgOptional pointer to message explaining why it is disabled

Reimplemented from Engine.

◆ loadGameState()

Common::Error BladeRunner::BladeRunnerEngine::loadGameState ( int  slot)
overridevirtual

Load a game state.

Parameters
slotThe slot from which a save state should be loaded.
Returns
kNoError on success, otherwise an error code.

Reimplemented from Engine.

◆ canSaveGameStateCurrently()

bool BladeRunner::BladeRunnerEngine::canSaveGameStateCurrently ( Common::U32String msg = nullptr)
overridevirtual

Indicate whether a game state can be saved.

Parameters
msgOptional pointer to message explaining why it is disabled

Reimplemented from Engine.

◆ saveGameState()

Common::Error BladeRunner::BladeRunnerEngine::saveGameState ( int  slot,
const Common::String desc,
bool  isAutosave = false 
)
overridevirtual

Save a game state.

Parameters
slotThe slot into which the save state should be stored.
descDescription for the save state, entered by the user.
isAutosaveExpected to be true if an autosave is being created.
Returns
kNoError on success, otherwise an error code.

Reimplemented from Engine.

◆ getAutosaveSlot()

int BladeRunner::BladeRunnerEngine::getAutosaveSlot ( ) const
inlineoverridevirtual

NOTE: Disable support for external autosave (ScummVM's feature). Main reason is that it's not easy to properly label this autosave, since currently it would translate "Autosave" to the ScummVM GUI language which ends up showing as "?????? ??????" on non-latin languages (eg. Greek), and in addition is inconsistent with the game's own GUI language. Secondary reason is that the game already has an autosaving mechanism, albeit only at the start of a new Act. And final reason would be to prevent an autosave at an unforeseen moment, if we've failed to account for all cases that the game should not save by itself; currently those are listed in BladeRunnerEngine::canSaveGameStateCurrently().

Reimplemented from Engine.

◆ pauseEngineIntern()

void BladeRunner::BladeRunnerEngine::pauseEngineIntern ( bool  pause)
overridevirtual

Actual implementation of pauseEngine by subclasses.

See also
Engine::pauseEngine

Reimplemented from Engine.

◆ run()

Common::Error BladeRunner::BladeRunnerEngine::run ( )
overridevirtual

Initialize the engine and start its main loop.

Returns
kNoError on success, otherwise an error code.

Implements Engine.

◆ syncSoundSettings()

void BladeRunner::BladeRunnerEngine::syncSoundSettings ( )
overridevirtual

Notify the engine that the sound settings in the config manager might have changed and that it should adjust any internal volume (and other) 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.

Reimplemented from Engine.


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