ScummVM API documentation
Tot::TotEngine Class Reference
Inheritance diagram for Tot::TotEngine:
Engine

Public Member Functions

 TotEngine (OSystem *syst, const ADGameDescription *gameDesc)
 
uint32 getFeatures () const
 
Common::String getGameId () const
 
uint32 getRandomNumber (uint maxNum)
 
bool hasFeature (EngineFeature f) const override
 
void drawFontSurface (Graphics::BgiFont &litt)
 
Common::Error saveGameStream (Common::WriteStream *stream, bool isAutosave=false) override
 
Common::Error loadGameStream (Common::SeekableReadStream *stream) override
 
bool canLoadGameStateCurrently (Common::U32String *msg=nullptr) override
 
bool canSaveGameStateCurrently (Common::U32String *msg=nullptr) override
 
void loadScreenData (uint screenNumber)
 
void clearScreenLayers ()
 
void clearAnimation ()
 
void buttonBorder (uint x1, uint y1, uint x2, uint y2, byte color1, byte color2, byte color3, byte color4, byte color5)
 
void drawMenu (byte menuNumber)
 
void readTextFile ()
 
void loadAnimationForDirection (Common::SeekableReadStream *stream, int direction)
 
void sayLine (uint textRef, byte textColor, byte shadowColor, uint &responseNumber, bool isWithinConversation)
 
void goToObject (byte zone1, byte zone2)
 
void readObject (uint objPos)
 
TextEntry readTextRegister ()
 
void drawInventory ()
 
void drawInventoryMask ()
 
void setRoomTrajectories (int height, int width, TRAJECTORIES_OP op, bool fixGrids=true)
 
void saveRoomData (RoomFileRegister *room, Common::SeekableWriteStream *stream)
 
void initializeScreenFile ()
 
- 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 ()
 
virtual int getAutosaveSlot () const
 
virtual bool gameTypeHasAddOns () const
 
virtual bool dirCanBeGameAddOn (const Common::FSDirectory &dir) const
 
virtual bool dirMustBeGameAddOn (const Common::FSDirectory &dir) const
 
Common::ErrorCode updateAddOns (const MetaEngine *metaEngine) 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

Graphics::Screen_screen = nullptr
 
Tot::GraphicsManager_graphics = nullptr
 
SoundManager_sound = nullptr
 
MouseManager_mouse = nullptr
 
ChronoManager_chrono = nullptr
 
bool _showMouseGrid = false
 
bool _showScreenGrid = false
 
bool _showGameGrid = false
 
bool _drawObjectAreas = false
 
Common::Language _lang = Common::ES_ESP
 
Common::MemorySeekableReadWriteStream_conversationData = nullptr
 
Common::MemorySeekableReadWriteStream_rooms = nullptr
 
Common::MemorySeekableReadWriteStream_sceneObjectsData = nullptr
 
bool _roomChange = false
 
bool _isTVOn = false
 
bool _isVasePlaced = false
 
bool _isScytheTaken = false
 
bool _isTridentTaken = false
 
bool _isPottersWheelDelivered = false
 
bool _isMudDelivered = false
 
bool _isGreenDevilDelivered = false
 
bool _isRedDevilCaptured = false
 
bool _isPottersManualDelivered = false
 
bool _isCupboardOpen = false
 
bool _isChestOpen = false
 
bool _isTrapSet = false
 
bool _isPeterCoughing = false
 
bool _isSealRemoved = false
 
bool _inGame = false
 
bool _firstTimeDone = false
 
bool _isIntroSeen = false
 
bool _shouldQuitGame = false
 
bool _startNewGame = false
 
bool _continueGame = false
 
bool _isSavingDisabled = false
 
bool _isDrawingEnabled = false
 
bool _isSecondaryAnimationEnabled = false
 
InventoryEntry _inventory [kInventoryIconCount]
 
byte * _inventoryIconBitmaps [kInventoryIconCount]
 
byte _inventoryPosition = 0
 
CharacterAnim _mainCharAnimation
 
uint _mainCharFrameSize
 
SecondaryAnim _secondaryAnimation
 
uint _secondaryAnimFrameSize
 
byte _actionCode = 0
 
byte _oldActionCode = 0
 
byte _trajectorySteps = 0
 
byte _doorIndex = 0
 
byte _gamePart = 1
 
byte _secondaryAnimationFrameCount = 0
 
byte _secondaryAnimDirCount = 0
 
byte _cpCounter = 0
 
byte _cpCounter2 = 0
 
byte _destinationX = 0
 
byte _destinationY = 0
 
byte _charFacingDirection = 0
 
uint _secondaryAnimWidth = 0
 
uint _secondaryAnimHeight = 0
 
uint _backpackObjectCode = 0
 
uint _oldposx = 0
 
uint _oldposy = 0
 
int _element1 = 0
 
int _element2 = 0
 
uint16 _characterPosX = 0
 
uint16 _characterPosY = 0
 
int _xframe2 = 0
 
int _yframe2 = 0
 
Common::File _verbFile
 
Common::String _oldInventoryObjectName
 
Common::String _inventoryObjectName
 
Common::String _characterName = ""
 
Common::String _decryptionKey
 
uint _niche [2][4]
 
RoomFileRegister_currentRoomData = nullptr
 
ScreenObject _curObject
 
Route _mainRoute
 
Common::Point _trajectory [300]
 
uint _trajectoryLength = 0
 
uint _currentTrajectoryIndex = 0
 
uint _currentSecondaryTrajectoryIndex = 0
 
byte _currentZone = 0
 
byte _targetZone = 0
 
byte _oldTargetZone = 0
 
byte _maxXGrid = 0
 
byte _maxYGrid = 0
 
byte _movementGridForSecondaryAnim [10][10]
 
byte _mouseGridForSecondaryAnim [10][10]
 
byte _maskGridSecondaryAnim [10][10]
 
byte _maskMouseSecondaryAnim [10][10]
 
bool _list1Complete = false
 
bool _list2Complete = false
 
bool _obtainedList1 = false
 
bool _obtainedList2 = false
 
bool _firstTimeTopicA [kCharacterCount] = { false }
 
bool _firstTimeTopicB [kCharacterCount] = { false }
 
bool _firstTimeTopicC [kCharacterCount] = { false }
 
bool _bookTopic [kCharacterCount] = { false }
 
bool _mintTopic [kCharacterCount] = { false }
 
bool _caves [5] = { false }
 
uint16 _firstList [5] = { 0 }
 
uint16 _secondList [5] = { 0 }
 
int32 _screenSize = 65520
 
byte _iframe = 0
 
byte _iframe2 = 0
 
ObjectInfo _depthMap [kNumScreenOverlays]
 
byte * _screenLayers [kNumScreenOverlays]
 
byte * _curCharacterAnimationFrame
 
byte * _curSecondaryAnimationFrame
 
byte * _sceneBackground
 
byte * _characterDirtyRect
 
byte * _backgroundCopy
 
uint _currentRoomNumber = 0
 
bool _isLoadingFromLauncher = false
 
bool _saveAllowed = false
 
uint _oldGridX = 0
 
uint _oldGridY = 0
 
SavedGame _savedGame
 
uint _curDepth = 0
 
uint16 _dirtyMainSpriteX = 0
 
uint16 _dirtyMainSpriteY = 0
 
uint _dirtyMainSpriteX2 = 0
 
uint _dirtyMainSpriteY2 = 0
 
byte * _spriteBackground
 
- Public Attributes inherited from Engine
OSystem_system
 
Audio::Mixer_mixer
 

Protected Member Functions

Common::Error run () override
 
- Protected Member Functions inherited from Engine
virtual int runDialog (GUI::Dialog &dialog)
 
void defaultSyncSoundSettings ()
 
virtual void pauseEngineIntern (bool pause)
 

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 bool warnUserAboutUnsupportedAddOn (Common::String addOnName)
 
static void errorAddingAddOnWithoutBaseGame (Common::String addOnName, Common::String gameId)
 
static void errorUnsupportedGame (Common::String extraMsg)
 
- 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 Tot::TotEngine::run ( )
overrideprotectedvirtual

Initialize the engine and start its main loop.

Returns
kNoError on success, otherwise an error code.

Implements Engine.

◆ getGameId()

Common::String Tot::TotEngine::getGameId ( ) const

Returns the game Id

◆ getRandomNumber()

uint32 Tot::TotEngine::getRandomNumber ( uint  maxNum)
inline

Gets a random number

◆ hasFeature()

bool Tot::TotEngine::hasFeature ( EngineFeature  f) const
inlineoverridevirtual

Determine whether the engine supports the specified feature.

Reimplemented from Engine.

◆ saveGameStream()

Common::Error Tot::TotEngine::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.

◆ loadGameStream()

Common::Error Tot::TotEngine::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.

◆ canLoadGameStateCurrently()

bool Tot::TotEngine::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.

◆ canSaveGameStateCurrently()

bool Tot::TotEngine::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.

Member Data Documentation

◆ _inventoryIconBitmaps

byte* Tot::TotEngine::_inventoryIconBitmaps[kInventoryIconCount]

Keeps an array of all inventory icon bitmaps

◆ _inventoryPosition

byte Tot::TotEngine::_inventoryPosition = 0

Position within inventory

◆ _mainCharAnimation

CharacterAnim Tot::TotEngine::_mainCharAnimation

Animation sequences

◆ _actionCode

byte Tot::TotEngine::_actionCode = 0

Currently selected action.

◆ _oldActionCode

byte Tot::TotEngine::_oldActionCode = 0

Previously selected action.

◆ _trajectorySteps

byte Tot::TotEngine::_trajectorySteps = 0

Number of trajectory changes

◆ _doorIndex

byte Tot::TotEngine::_doorIndex = 0

index of currently selected door.

◆ _gamePart

byte Tot::TotEngine::_gamePart = 1

1 first part, 2 second part

◆ _secondaryAnimationFrameCount

byte Tot::TotEngine::_secondaryAnimationFrameCount = 0

Number of frames of secondary animation

◆ _secondaryAnimDirCount

byte Tot::TotEngine::_secondaryAnimDirCount = 0

Number of directions of the secondary animation

◆ _cpCounter

byte Tot::TotEngine::_cpCounter = 0

Data protection control

◆ _destinationX

byte Tot::TotEngine::_destinationX = 0

Coordinates of target step

◆ _charFacingDirection

byte Tot::TotEngine::_charFacingDirection = 0

Current character facing direction 0: upwards 1: right 2: downwards 3: left

◆ _secondaryAnimWidth

uint Tot::TotEngine::_secondaryAnimWidth = 0

Width and height of secondary animation

◆ _backpackObjectCode

uint Tot::TotEngine::_backpackObjectCode = 0

Code of selected object in the backpack

◆ _oldposx

uint Tot::TotEngine::_oldposx = 0

Auxiliary vars for grid update

◆ _element1

int Tot::TotEngine::_element1 = 0

Amplitude of movement

◆ _characterPosX

uint16 Tot::TotEngine::_characterPosX = 0

Current position of the main character

◆ _xframe2

int Tot::TotEngine::_xframe2 = 0

Target position of the main character?

◆ _verbFile

Common::File Tot::TotEngine::_verbFile

Text map

◆ _oldInventoryObjectName

Common::String Tot::TotEngine::_oldInventoryObjectName

Auxiliary vars with current inventory object name.

◆ _characterName

Common::String Tot::TotEngine::_characterName = ""

Name of player

◆ _niche

uint Tot::TotEngine::_niche[2][4]

State of the niches in part 2

◆ _mainRoute

Route Tot::TotEngine::_mainRoute

New movement to execute.

◆ _trajectory

Common::Point Tot::TotEngine::_trajectory[300]

Matrix of positions for a trajectory between two points

◆ _trajectoryLength

uint Tot::TotEngine::_trajectoryLength = 0

Longitude of the trajectory matrix.

◆ _currentTrajectoryIndex

uint Tot::TotEngine::_currentTrajectoryIndex = 0

Position within the trajectory matrix

◆ _currentSecondaryTrajectoryIndex

uint Tot::TotEngine::_currentSecondaryTrajectoryIndex = 0

Position within the trajectory matrix for secondary animation

◆ _currentZone

byte Tot::TotEngine::_currentZone = 0

Screen areas

◆ _maxXGrid

byte Tot::TotEngine::_maxXGrid = 0

Amplitude of grid slices

◆ _movementGridForSecondaryAnim

byte Tot::TotEngine::_movementGridForSecondaryAnim[10][10]

capture of movement grid of secondary animation

◆ _mouseGridForSecondaryAnim

byte Tot::TotEngine::_mouseGridForSecondaryAnim[10][10]

capture of mouse grid of secondary animation

◆ _maskGridSecondaryAnim

byte Tot::TotEngine::_maskGridSecondaryAnim[10][10]

movement mask for grid of secondary animation

◆ _maskMouseSecondaryAnim

byte Tot::TotEngine::_maskMouseSecondaryAnim[10][10]

mouse mask for grid of secondary animation

◆ _firstTimeTopicA

bool Tot::TotEngine::_firstTimeTopicA[kCharacterCount] = { false }

Conversation topic unlocks

◆ _firstList

uint16 Tot::TotEngine::_firstList[5] = { 0 }

First and second lists of objects to retrieve in the game

◆ _iframe

byte Tot::TotEngine::_iframe = 0

Frame number for the animations

◆ _depthMap

ObjectInfo Tot::TotEngine::_depthMap[kNumScreenOverlays]

Depth of screenobjects

◆ _screenLayers

byte* Tot::TotEngine::_screenLayers[kNumScreenOverlays]

Bitmaps of screenobjects

◆ _curCharacterAnimationFrame

byte* Tot::TotEngine::_curCharacterAnimationFrame

Current frame of main character

◆ _curSecondaryAnimationFrame

byte* Tot::TotEngine::_curSecondaryAnimationFrame

Current frame of secondary animation

◆ _sceneBackground

byte* Tot::TotEngine::_sceneBackground

Pointer storing the screen as it displays on the game

◆ _characterDirtyRect

byte* Tot::TotEngine::_characterDirtyRect

Dirty patch of screen to repaint on every frame

◆ _backgroundCopy

byte* Tot::TotEngine::_backgroundCopy

Stores a copy of the background bitmap

◆ _oldGridX

uint Tot::TotEngine::_oldGridX = 0

Previous positions of the mouse within the screen grid

◆ _dirtyMainSpriteX

uint16 Tot::TotEngine::_dirtyMainSpriteX = 0

Point of origin of the area surrounding the main character. Calculated using the position of the character.

◆ _dirtyMainSpriteX2

uint Tot::TotEngine::_dirtyMainSpriteX2 = 0

End point of origin of the area surrounding the main character. Calculated using the position of the character + dimension


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