ScummVM API documentation
Freescape::FreescapeEngine Class Reference
Inheritance diagram for Freescape::FreescapeEngine:
Engine Freescape::CastleEngine Freescape::DarkEngine Freescape::DrillerEngine Freescape::EclipseEngine

Public Member Functions

 FreescapeEngine (OSystem *syst, const ADGameDescription *gd)
 
bool isDemo () const
 
bool isSpaceStationOblivion ()
 
bool isDriller ()
 
bool isDark ()
 
bool isEclipse ()
 
bool isEclipse2 ()
 
bool isCastle ()
 
bool isAmiga ()
 
bool isAtariST ()
 
bool isDOS ()
 
bool isSpectrum ()
 
bool isCPC ()
 
bool isC64 ()
 
Common::Error run () override
 
void centerCrossair ()
 
virtual void borderScreen ()
 
virtual void titleScreen ()
 
void drawFullscreenSurface (Graphics::Surface *surface)
 
virtual void loadBorder ()
 
virtual void processBorder ()
 
void waitInLoop (int maxWait)
 
void drawBorder ()
 
void drawTitle ()
 
virtual void drawBackground ()
 
void clearBackground ()
 
virtual void drawUI ()
 
virtual void drawInfoMenu ()
 
void drawBorderScreenAndWait (Graphics::Surface *surface, int maxWait=INT_MAX)
 
virtual void drawCrossair (Graphics::Surface *surface)
 
virtual void loadAssets ()
 
virtual void loadAssetsDemo ()
 
virtual void loadAssetsFullGame ()
 
virtual void loadAssetsAtariFullGame ()
 
virtual void loadAssetsAtariDemo ()
 
virtual void loadAssetsAmigaFullGame ()
 
virtual void loadAssetsAmigaDemo ()
 
virtual void loadAssetsDOSFullGame ()
 
virtual void loadAssetsDOSDemo ()
 
virtual void loadAssetsZXFullGame ()
 
virtual void loadAssetsZXDemo ()
 
virtual void loadAssetsCPCFullGame ()
 
virtual void loadAssetsCPCDemo ()
 
virtual void loadAssetsC64FullGame ()
 
virtual void loadAssetsC64Demo ()
 
virtual void drawDOSUI (Graphics::Surface *surface)
 
virtual void drawZXUI (Graphics::Surface *surface)
 
virtual void drawCPCUI (Graphics::Surface *surface)
 
virtual void drawC64UI (Graphics::Surface *surface)
 
virtual void drawAmigaAtariSTUI (Graphics::Surface *surface)
 
void loadDataBundle ()
 
Graphics::SurfaceloadBundledImage (const Common::String &name, bool appendRenderMode=true)
 
byte * getPaletteFromNeoImage (Common::SeekableReadStream *stream, int offset)
 
Graphics::ManagedSurfaceloadAndConvertNeoImage (Common::SeekableReadStream *stream, int offset, byte *palette=nullptr)
 
Graphics::ManagedSurfaceloadAndCenterScrImage (Common::SeekableReadStream *stream)
 
void loadPalettes (Common::SeekableReadStream *file, int offset)
 
byte * loadPalette (Common::SeekableReadStream *file)
 
void swapPalette (uint16 areaID)
 
virtual byte * findCGAPalette (uint16 levelID)
 
void loadColorPalette ()
 
void loadDemoData (Common::SeekableReadStream *file, int offset, int size)
 
int decodeAmigaAtariKey (int code)
 
int decodeDOSKey (int code)
 
Common::Event decodeDOSMouseEvent (int code, int repetition)
 
uint16 readField (Common::SeekableReadStream *file, int nbits)
 
uint16 readPtr (Common::SeekableReadStream *file)
 
Common::Array< uint16 > readArray (Common::SeekableReadStream *file, int size)
 
void load8bitBinary (Common::SeekableReadStream *file, int offset, int ncolors)
 
Areaload8bitArea (Common::SeekableReadStream *file, uint16 ncolors)
 
Objectload8bitObject (Common::SeekableReadStream *file)
 
Groupload8bitGroup (Common::SeekableReadStream *file, byte rawFlagsAndType)
 
Groupload8bitGroupV1 (Common::SeekableReadStream *file, byte rawFlagsAndType)
 
Groupload8bitGroupV2 (Common::SeekableReadStream *file, byte rawFlagsAndType)
 
void loadGlobalObjects (Common::SeekableReadStream *file, int offset, int size)
 
void renderPixels8bitBinImage (Graphics::ManagedSurface *surface, int row, int column, int bit, int count)
 
void renderPixels8bitBinCGAImage (Graphics::ManagedSurface *surface, int &i, int &j, uint8 pixels, int color)
 
void renderPixels8bitBinEGAImage (Graphics::ManagedSurface *surface, int &i, int &j, uint8 pixels, int color)
 
Graphics::ManagedSurfaceload8bitBinImage (Common::SeekableReadStream *file, int offset)
 
void load8bitBinImageRow (Common::SeekableReadStream *file, Graphics::ManagedSurface *surface, int row)
 
void load8bitBinImageRowIteration (Common::SeekableReadStream *file, Graphics::ManagedSurface *surface, int row, int bit)
 
int execute8bitBinImageCommand (Common::SeekableReadStream *file, Graphics::ManagedSurface *surface, int row, int pixels, int bit)
 
int execute8bitBinImageSingleCommand (Common::SeekableReadStream *file, Graphics::ManagedSurface *surface, int row, int pixels, int bit, int count)
 
int execute8bitBinImageMultiCommand (Common::SeekableReadStream *file, Graphics::ManagedSurface *surface, int row, int pixels, int bit, int count)
 
void parseAmigaAtariHeader (Common::SeekableReadStream *file)
 
Common::SeekableReadStreamdecryptFileAmigaAtari (const Common::Path &packed, const Common::Path &unpacker, uint32 unpackArrayOffset)
 
virtual void gotoArea (uint16 areaID, int entranceID)
 
virtual void initKeymaps (Common::Keymap *engineKeyMap, Common::Keymap *infoScreenKeyMap, const char *target)
 
void processInput ()
 
void resetInput ()
 
void generateDemoInput ()
 
virtual void pressedKey (const int keycode)
 
virtual void releasedKey (const int keycode)
 
Common::Point getNormalizedPosition (Common::Point position)
 
virtual bool onScreenControls (Common::Point mouse)
 
void move (CameraMovement direction, uint8 scale, float deltaTime)
 
void resolveCollisions (Math::Vector3d newPosition)
 
virtual void checkIfStillInArea ()
 
void changePlayerHeight (int index)
 
void increaseStepSize ()
 
void decreaseStepSize ()
 
void changeStepSize ()
 
void changeAngle ()
 
bool rise ()
 
void lower ()
 
bool checkFloor (Math::Vector3d currentPosition)
 
bool tryStepUp (Math::Vector3d currentPosition)
 
bool tryStepDown (Math::Vector3d currentPosition)
 
void rotate (float xoffset, float yoffset)
 
void activate ()
 
void shoot ()
 
void traverseEntrance (uint16 entranceID)
 
Math::Vector3d directionToVector (float pitch, float heading, bool useTable)
 
void updateCamera ()
 
bool runCollisionConditions (Math::Vector3d const lastPosition, Math::Vector3d const newPosition)
 
virtual void executeMovementConditions ()
 
bool executeObjectConditions (GeometricObject *obj, bool shot, bool collided, bool activated)
 
void executeEntranceConditions (Entrance *entrance)
 
void executeLocalGlobalConditions (bool shot, bool collided, bool timer)
 
bool executeCode (FCLInstructionVector &code, bool shot, bool collided, bool timer, bool activated)
 
bool checkConditional (FCLInstruction &instruction, bool shot, bool collided, bool timer, bool activated)
 
bool checkIfGreaterOrEqual (FCLInstruction &instruction)
 
bool checkIfLessOrEqual (FCLInstruction &instruction)
 
void executeExecute (FCLInstruction &instruction, bool shot, bool collided, bool activated)
 
void executeIncrementVariable (FCLInstruction &instruction)
 
void executeDecrementVariable (FCLInstruction &instruction)
 
void executeSetVariable (FCLInstruction &instruction)
 
void executeGoto (FCLInstruction &instruction)
 
void executeIfThenElse (FCLInstruction &instruction)
 
virtual void executeMakeInvisible (FCLInstruction &instruction)
 
void executeMakeVisible (FCLInstruction &instruction)
 
void executeToggleVisibility (FCLInstruction &instruction)
 
virtual void executeDestroy (FCLInstruction &instruction)
 
virtual void executeRedraw (FCLInstruction &instruction)
 
void executeSound (FCLInstruction &instruction)
 
void executeDelay (FCLInstruction &instruction)
 
bool executeEndIfNotEqual (FCLInstruction &instruction)
 
void executeSetBit (FCLInstruction &instruction)
 
void executeClearBit (FCLInstruction &instruction)
 
void executeToggleBit (FCLInstruction &instruction)
 
bool executeEndIfBitNotEqual (FCLInstruction &instruction)
 
bool executeEndIfVisibilityIsEqual (FCLInstruction &instruction)
 
void executeSwapJet (FCLInstruction &instruction)
 
virtual void executePrint (FCLInstruction &instruction)
 
void executeSPFX (FCLInstruction &instruction)
 
void executeStartAnim (FCLInstruction &instruction)
 
void waitForSounds ()
 
void stopAllSounds ()
 
bool isPlayingSound ()
 
void playSound (int index, bool sync)
 
void playWav (const Common::Path &filename)
 
void playMusic (const Common::Path &filename)
 
void queueSoundConst (double hzFreq, int duration)
 
void playSilence (int duration, bool sync)
 
void playSoundConst (double hzFreq, int duration, bool sync)
 
void playSoundSweepIncWL (double hzFreq1, double hzFreq2, double wlStepPerMS, int resolution, bool sync)
 
uint16 playSoundDOSSpeaker (uint16 startFrequency, soundSpeakerFx *speakerFxInfo)
 
void playSoundDOS (soundSpeakerFx *speakerFxInfo, bool sync)
 
virtual void playSoundFx (int index, bool sync)
 
virtual void loadSoundsFx (Common::SeekableReadStream *file, int offset, int number)
 
void loadSpeakerFxDOS (Common::SeekableReadStream *file, int offsetFreq, int offsetDuration)
 
void loadSpeakerFxZX (Common::SeekableReadStream *file, int sfxTable, int sfxData)
 
void playSoundZX (Common::Array< soundUnitZX > *data)
 
void drawFrame ()
 
void flashScreen (int backgroundColor)
 
void insertTemporaryMessage (const Common::String message, int deadline)
 
void getLatestMessages (Common::String &message, int &deadline)
 
void clearTemporalMessages ()
 
void loadMessagesFixedSize (Common::SeekableReadStream *file, int offset, int size, int number)
 
virtual void loadMessagesVariableSize (Common::SeekableReadStream *file, int offset, int number)
 
void drawFullscreenMessageAndWait (Common::String message)
 
void drawFullscreenMessage (Common::String message, uint32 front, Graphics::Surface *surface)
 
void loadFonts (Common::SeekableReadStream *file, int offset)
 
void loadFonts (byte *font, int charNumber)
 
Common::Array< Graphics::ManagedSurface * > getChars (Common::SeekableReadStream *file, int offset, int charsNumber)
 
Common::Array< Graphics::ManagedSurface * > getCharsAmigaAtariInternal (int sizeX, int sizeY, int additional, int m1, int m2, Common::SeekableReadStream *file, int offset, int charsNumber)
 
Common::Array< Graphics::ManagedSurface * > getCharsAmigaAtari (Common::SeekableReadStream *file, int offset, int charsNumber)
 
virtual void drawStringInSurface (const Common::String &str, int x, int y, uint32 fontColor, uint32 backColor, Graphics::Surface *surface, int offset=0)
 
virtual void drawStringInSurface (const Common::String &str, int x, int y, uint32 primaryFontColor, uint32 secondaryFontColor, uint32 backColor, Graphics::Surface *surface, int offset=0)
 
Graphics::SurfacedrawStringsInSurface (const Common::Array< Common::String > &lines, Graphics::Surface *surface)
 
virtual void initGameState ()
 
void setGameBit (int index)
 
void clearGameBit (int index)
 
void toggleGameBit (int index)
 
uint16 getGameBit (int index)
 
void checkIfPlayerWasCrushed ()
 
virtual bool checkIfGameEnded ()
 
virtual void endGame ()
 
virtual void checkSensors ()
 
virtual void drawSensorShoot (Sensor *sensor)
 
void takeDamageFromSensor ()
 
bool hasFeature (EngineFeature f) const override
 
bool canLoadGameStateCurrently (Common::U32String *msg=nullptr) override
 
bool canSaveAutosaveCurrently () override
 
bool canSaveGameStateCurrently (Common::U32String *msg=nullptr) override
 
Common::Error loadGameStream (Common::SeekableReadStream *stream) override
 
Common::Error saveGameStream (Common::WriteStream *stream, bool isAutosave=false) override
 
virtual Common::Error saveGameStreamExtended (Common::WriteStream *stream, bool isAutosave=false)
 
virtual Common::Error loadGameStreamExtended (Common::SeekableReadStream *stream)
 
void pauseEngineIntern (bool pause) override
 
bool startCountdown (uint32 delay)
 
void removeTimers ()
 
void getTimeFromCountdown (int &seconds, int &minutes, int &hours)
 
virtual void updateTimeVariables ()
 
- 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 int getAutosaveSlot () const
 
 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 ()
 
bool enhancementEnabled (int32 cls)
 
virtual void syncSoundSettings ()
 
virtual void applyGameSettings ()
 
virtual void flipMute ()
 
virtual Common::String getSaveStateName (int slot) const
 
virtual Common::Error loadGameState (int slot)
 
void setGameToLoadSlot (int slot)
 
virtual Common::Error saveGameState (int slot, const Common::String &desc, bool isAutosave=false)
 
bool saveGameDialog ()
 
bool loadGameDialog ()
 

Public Attributes

const ADGameDescription_gameDescription
 
GameStateControl _gameStateControl
 
uint32 _variant
 
Common::Language _language
 
Common::Rect _viewArea
 
Common::Rect _fullscreenViewArea
 
Graphics::ManagedSurface_border
 
Graphics::ManagedSurface_title
 
Graphics::ManagedSurface_background
 
Texture_borderTexture
 
Texture_titleTexture
 
Texture_uiTexture
 
Texture_skyTexture
 
Common::Array< Graphics::Surface * > _indicators
 
Common::HashMap< uint16, Texture * > _borderCGAByArea
 
Common::HashMap< uint16, byte * > _paletteCGAByArea
 
uint8 _binaryBits
 
Common::Archive_dataBundle
 
const CGAPaletteEntry_rawCGAPaletteByArea
 
Common::HashMap< uint16, byte * > _paletteByArea
 
Common::Array< byte > _demoData
 
int _demoIndex
 
int _currentDemoInputCode
 
int _currentDemoInputRepetition
 
Common::Array< Common::Event_demoEvents
 
Common::Point _currentDemoMousePosition
 
uint16 _startArea
 
uint16 _endArea
 
AreaMap _areaMap
 
Area_currentArea
 
bool _gotoExecuted
 
Math::Vector3d _scale
 
uint16 _startEntrance
 
uint16 _endEntrance
 
Common::HashMap< int, const struct entrancesTableEntry * > _entranceTable
 
bool _demoMode
 
bool _disableDemoMode
 
bool _flyMode
 
bool _shootMode
 
bool _noClipMode
 
bool _invertY
 
EventManagerWrapper_eventManager
 
bool _hasFallen
 
int _maxFallingDistance
 
int _maxShield
 
int _maxEnergy
 
float _lastFrame
 
float _yaw
 
float _pitch
 
int _angleRotationIndex
 
Common::Array< float > _angleRotations
 
Common::Point _crossairPosition
 
float _mouseSensitivity
 
Math::Vector3d _upVector
 
Math::Vector3d _cameraFront
 
Math::Vector3d _cameraRight
 
Math::Vector3d _position
 
Math::Vector3d _rotation
 
Math::Vector3d _velocity
 
Math::Vector3d _lastPosition
 
int _playerHeightNumber
 
int _playerHeightMaxNumber
 
uint16 _playerHeight
 
uint16 _playerWidth
 
uint16 _playerDepth
 
uint16 _stepUpDistance
 
int _playerStepIndex
 
Common::Array< int > _playerSteps
 
Common::Array< Common::String_conditionSources
 
Common::Array< FCLInstructionVector_conditions
 
Math::Vector3d _objExecutingCodeSize
 
bool _executingGlobalCode
 
Audio::SoundHandle _soundFxHandle
 
Audio::SoundHandle _musicHandle
 
Freescape::SizedPCSpeaker_speaker
 
bool _syncSound
 
bool _firstSound
 
bool _usePrerecordedSounds
 
Common::HashMap< uint16, soundFx * > _soundsFx
 
Common::HashMap< uint16, soundSpeakerFx * > _soundsSpeakerFx
 
Common::HashMap< uint16, Common::Array< soundUnitZX > * > _soundsSpeakerFxZX
 
int _soundIndexShoot
 
int _soundIndexCollide
 
int _soundIndexFall
 
int _soundIndexClimb
 
int _soundIndexMenu
 
int _soundIndexStart
 
int _soundIndexAreaChange
 
int _soundIndexHit
 
int _soundIndexNoShield
 
int _soundIndexNoEnergy
 
int _soundIndexFallen
 
int _soundIndexTimeout
 
int _soundIndexForceEndGame
 
int _soundIndexCrushed
 
int _soundIndexMissionComplete
 
int _screenW
 
int _screenH
 
Renderer_gfx
 
Graphics::FrameLimiter_frameLimiter
 
bool _vsyncEnabled
 
Common::RenderMode _renderMode
 
ColorMap _colorMap
 
int _underFireFrames
 
int _avoidRenderingFrames
 
int _shootingFrames
 
GeometricObject_delayedShootObject
 
uint8 _colorNumber
 
Math::Vector3d _scaleVector
 
float _nearClipPlane
 
float _farClipPlane
 
Common::StringArray _temporaryMessages
 
Common::Array< int > _temporaryMessageDeadlines
 
Common::StringArray _messagesList
 
Common::String _noShieldMessage
 
Common::String _noEnergyMessage
 
Common::String _fallenMessage
 
Common::String _timeoutMessage
 
Common::String _forceEndGameMessage
 
Common::String _crushedMessage
 
Common::String _outOfReachMessage
 
Common::String _noEffectMessage
 
Common::StringArray _currentAreaMessages
 
Common::StringArray _currentEphymeralMessages
 
Font _font
 
bool _fontLoaded
 
StateVars _gameStateVars
 
uint32 _gameStateBits
 
int _endGameDelayTicks
 
bool _endGameKeyPressed
 
bool _endGamePlayerEndArea
 
bool _forceEndGame
 
bool _playerWasCrushed
 
Common::HashMap< uint16, bool > _exploredAreas
 
ObjectArray _sensors
 
Graphics::Surface_savedScreen
 
bool _timerStarted
 
int _initialCountdown
 
int _countdown
 
int _ticks
 
int _ticksFromEnd
 
int _lastTick
 
int _lastMinute
 
bool _useExtendedTimer
 
bool _disableSensors
 
bool _disableFalling
 
Common::RandomSource_rnd
 
- Public Attributes inherited from Engine
OSystem_system
 
Audio::Mixer_mixer
 

Additional Inherited Members

- Public Types inherited from Engine
enum  EngineFeature {
  kSupportsSubtitleOptions, kSupportsReturnToLauncher, kSupportsLoadingDuringRuntime, kSupportsSavingDuringRuntime,
  kSupportsChangingOptionsDuringRuntime, kSupportsArbitraryResolutions, kSupportsHelp, kSupportsQuitDialogOverride
}
 
- Static Public Member Functions inherited from Engine
static void quitGame ()
 
static bool shouldQuit ()
 
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
 
int32 _activeEnhancements = kEnhGameBreakingBugFixes
 

Member Function Documentation

◆ run()

Common::Error Freescape::FreescapeEngine::run ( )
overridevirtual

Initialize the engine and start its main loop.

Returns
kNoError on success, otherwise an error code.

Implements Engine.

◆ hasFeature()

bool Freescape::FreescapeEngine::hasFeature ( EngineFeature  f) const
overridevirtual

Determine whether the engine supports the specified feature.

Reimplemented from Engine.

◆ canLoadGameStateCurrently()

bool Freescape::FreescapeEngine::canLoadGameStateCurrently ( Common::U32String msg = nullptr)
inlineoverridevirtual

Indicate whether a game state can be loaded.

Parameters
msgOptional pointer to message explaining why it is disabled

Reimplemented from Engine.

◆ canSaveAutosaveCurrently()

bool Freescape::FreescapeEngine::canSaveAutosaveCurrently ( )
inlineoverridevirtual

Indicate whether an autosave can currently be done.

Reimplemented from Engine.

◆ canSaveGameStateCurrently()

bool Freescape::FreescapeEngine::canSaveGameStateCurrently ( Common::U32String msg = nullptr)
inlineoverridevirtual

Indicate whether a game state can be saved.

Parameters
msgOptional pointer to message explaining why it is disabled

Reimplemented from Engine.

◆ loadGameStream()

Common::Error Freescape::FreescapeEngine::loadGameStream ( Common::SeekableReadStream stream)
overridevirtual

Load a game state.

Parameters
streamThe stream to load the save state from.
Returns
kNoError on success, otherwise an error code.

Reimplemented from Engine.

◆ saveGameStream()

Common::Error Freescape::FreescapeEngine::saveGameStream ( Common::WriteStream stream,
bool  isAutosave = false 
)
overridevirtual

Save a game state.

Parameters
streamThe write stream to save the savegame data to.
isAutosaveExpected to be true if an autosave is being created.
Returns
kNoError on success, otherwise an error code.

Reimplemented from Engine.

◆ pauseEngineIntern()

void Freescape::FreescapeEngine::pauseEngineIntern ( bool  pause)
overridevirtual

Actual implementation of pauseEngine by subclasses.

See also
Engine::pauseEngine

Reimplemented from Engine.


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