ScummVM API documentation
Gnap::GnapEngine Class Reference
Inheritance diagram for Gnap::GnapEngine:
Engine

Public Member Functions

 GnapEngine (OSystem *syst, const ADGameDescription *gd)
 
void updateEvents ()
 
void gameUpdateTick ()
 
void saveTimers ()
 
void restoreTimers ()
 
void pauseGame ()
 
void resumeGame ()
 
void updatePause ()
 
int getRandom (int max)
 
int readSavegameDescription (int savegameNum, Common::String &description)
 
int loadSavegame (int savegameNum)
 
Common::Error saveGameState (int slot, const Common::String &desc, bool isAutosave=false) override
 
Common::Error loadGameState (int slot) override
 
void synchronize (Common::Serializer &s)
 
void writeSavegameHeader (Common::OutSaveFile *out, GnapSavegameHeader &header)
 
void delayTicks (int val, int idx, bool updateCursor)
 
void delayTicksA (int val, int idx)
 
void delayTicksCursor (int val)
 
void setHotspot (int index, int16 x1, int16 y1, int16 x2, int16 y2, uint16 flags=SF_NONE, int16 walkX=-1, int16 walkY=-1)
 
int getHotspotIndexAtPos (Common::Point pos)
 
void updateCursorByHotspot ()
 
int getClickedHotspotId ()
 
int getInventoryItemSpriteNum (int index)
 
void updateMouseCursor ()
 
void setVerbCursor (int verbCursor)
 
void setCursor (int cursorIndex)
 
void showCursor ()
 
void hideCursor ()
 
void setGrabCursorSprite (int index)
 
void createGrabCursorSprite (int spriteId)
 
void freeGrabCursorSprite ()
 
void updateGrabCursorSprite (int x, int y)
 
void invClear ()
 
void invAdd (int itemId)
 
void invRemove (int itemId)
 
bool invHas (int itemId)
 
void clearFlags ()
 
void setFlag (int num)
 
void clearFlag (int num)
 
bool isFlag (int num)
 
Graphics::SurfaceaddFullScreenSprite (int resourceId, int id)
 
void removeFullScreenSprite ()
 
void showFullScreenSprite (int resourceId)
 
void queueInsertDeviceIcon ()
 
void insertDeviceIconActive ()
 
void removeDeviceIconActive ()
 
void setDeviceHotspot (int hotspotIndex, int x1, int y1, int x2, int y2)
 
int getSequenceTotalDuration (int resourceId)
 
bool isSoundPlaying (int resourceId)
 
void playSound (int resourceId, bool looping)
 
void stopSound (int resourceId)
 
void setSoundVolume (int resourceId, int volume)
 
void updateTimers ()
 
void initGameFlags (int num)
 
void loadStockDat ()
 
void mainLoop ()
 
void initScene ()
 
void endSceneInit ()
 
void afterScene ()
 
int initSceneLogic ()
 
void runSceneLogic ()
 
void checkGameKeys ()
 
void startSoundTimerA (int timerIndex)
 
int playSoundA ()
 
void startSoundTimerB (int timerIndex)
 
int playSoundB ()
 
void startSoundTimerC (int timerIndex)
 
int playSoundC ()
 
void startIdleTimer (int timerIndex)
 
void updateIdleTimer ()
 
void screenEffect (int dir, byte r, byte g, byte b)
 
bool isKeyStatus1 (int key)
 
bool isKeyStatus2 (int key)
 
void clearKeyStatus1 (int key)
 
void clearAllKeyStatus1 ()
 
void deleteSurface (Graphics::Surface **surface)
 
void createMenuSprite ()
 
void freeMenuSprite ()
 
void initMenuHotspots1 ()
 
void initMenuHotspots2 ()
 
void initMenuQuitQueryHotspots ()
 
void initSaveLoadHotspots ()
 
void drawInventoryFrames ()
 
void insertInventorySprites ()
 
void removeInventorySprites ()
 
void runMenu ()
 
void updateMenuStatusInventory ()
 
void updateMenuStatusMainMenu ()
 
void updateMenuStatusSaveGame ()
 
void updateMenuStatusLoadGame ()
 
void updateMenuStatusQueryQuit ()
 
bool isPointBlocked (int gridX, int gridY)
 
bool isPointBlocked (Common::Point gridPos)
 
void initSceneGrid (int gridMinX, int gridMinY, int gridMaxX, int gridMaxY)
 
bool testWalk (int animationIndex, int someStatus, int gridX1, int gridY1, int gridX2, int gridY2)
 
void doCallback (int callback)
 
void initGlobalSceneVars ()
 
void playSequences (int fullScreenSpriteId, int sequenceId1, int sequenceId2, int sequenceId3)
 
void toyUfoSetStatus (int flagNum)
 
int toyUfoGetSequenceId ()
 
bool toyUfoCheckTimer ()
 
void toyUfoFlyTo (int destX, int destY, int minX, int maxX, int minY, int maxY, int animationIndex)
 
void playMidi (const char *name)
 
void stopMidi ()
 
- 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
 
 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 syncSoundSettings ()
 
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 bool canLoadGameStateCurrently (Common::U32String *msg=nullptr)
 
virtual Common::Error saveGameStream (Common::WriteStream *stream, bool isAutosave=false)
 
virtual bool canSaveGameStateCurrently (Common::U32String *msg=nullptr)
 
bool saveGameDialog ()
 
bool loadGameDialog ()
 

Static Public Member Functions

static WARN_UNUSED_RESULT bool readSavegameHeader (Common::InSaveFile *in, GnapSavegameHeader &header, bool skipThumbnail=true)
 
- 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)
 

Public Attributes

Common::RandomSource_random
 
Common::PEResources_exe
 
DatManager_dat
 
SpriteCache_spriteCache
 
SoundCache_soundCache
 
SequenceCache_sequenceCache
 
GameSys_gameSys
 
SoundMan_soundMan
 
Debugger_debugger
 
Scene_scene
 
PlayerGnap_gnap
 
PlayerPlat_plat
 
MusicPlayer_music
 
Graphics::Font_font
 
Common::MemoryWriteStreamDynamic_tempThumbnail
 
int _lastUpdateClock
 
bool _gameDone
 
bool _keyPressState [512]
 
bool _keyDownState [512]
 
bool _isPaused
 
Graphics::Surface_pauseSprite
 
int _timers [kMaxTimers]
 
int _savedTimers [kMaxTimers]
 
MouseButtonState _mouseButtonState
 
MouseButtonState _mouseClickState
 
bool _sceneSavegameLoaded
 
bool _wasSavegameLoaded
 
Graphics::Surface_backgroundSurface
 
int _prevSceneNum
 
int _currentSceneNum
 
int _newSceneNum
 
bool _sceneDone
 
bool _sceneWaiting
 
uint32 _inventory
 
uint32 _gameFlags
 
Hotspot _hotspots [20]
 
Common::Point _hotspotsWalkPos [20]
 
int _hotspotsCount
 
int _sceneClickedHotspot
 
bool _isWaiting
 
bool _isLeavingScene
 
bool _isStockDatLoaded
 
int _newCursorValue
 
int _cursorValue
 
int _verbCursor
 
int _cursorIndex
 
Common::Point _mousePos
 
int _leftClickMouseX
 
int _leftClickMouseY
 
Graphics::Surface_grabCursorSprite
 
int _currGrabCursorX
 
int _currGrabCursorY
 
int _grabCursorSpriteIndex
 
int _newGrabCursorSpriteIndex
 
Graphics::Surface_fullScreenSprite
 
int _fullScreenSpriteId
 
int _deviceX1
 
int _deviceY1
 
int _soundTimerIndexA
 
int _soundTimerIndexB
 
int _soundTimerIndexC
 
int _idleTimerIndex
 
int _menuStatus
 
int _menuSpritesIndex
 
bool _menuDone
 
Graphics::Surface_menuBackgroundSurface
 
Graphics::Surface_menuQuitQuerySprite
 
Graphics::Surface_largeSprite
 
Graphics::Surface_menuSaveLoadSprite
 
Graphics::Surface_menuSprite2
 
Graphics::Surface_menuSprite1
 
char _savegameFilenames [7][30]
 
Graphics::Surface_savegameSprites [7]
 
Graphics::Surface_spriteHandle
 
Graphics::Surface_cursorSprite
 
int _menuInventoryIndices [30]
 
Graphics::Surface_menuInventorySprites [30]
 
int _savegameIndex
 
int _gridMinX
 
int _gridMinY
 
int _gridMaxX
 
int _gridMaxY
 
int _toyUfoNextSequenceId
 
int _toyUfoSequenceId
 
int _toyUfoId
 
int _toyUfoActionStatus
 
int _toyUfoX
 
int _toyUfoY
 
int _s18GarbageCanPos
 
- Public Attributes inherited from Engine
OSystem_system
 
Audio::Mixer_mixer
 

Protected Member Functions

Common::Error run () override
 
bool hasFeature (EngineFeature f) const 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
}
 
- Protected Attributes inherited from Engine
Common::TimerManager_timer
 
Common::EventManager_eventMan
 
Common::SaveFileManager_saveFileMan
 
GUI::Dialog_mainMenuDialog
 
const Common::String _targetName
 

Member Function Documentation

◆ run()

Common::Error Gnap::GnapEngine::run ( )
overrideprotectedvirtual

Initialize the engine and start its main loop.

Returns
kNoError on success, otherwise an error code.

Implements Engine.

◆ hasFeature()

bool Gnap::GnapEngine::hasFeature ( EngineFeature  f) const
overrideprotectedvirtual

Determine whether the engine supports the specified feature.

Reimplemented from Engine.

◆ saveGameState()

Common::Error Gnap::GnapEngine::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.

◆ loadGameState()

Common::Error Gnap::GnapEngine::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.


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