ScummVM API documentation
Gamos::GamosEngine Class Reference
Inheritance diagram for Gamos::GamosEngine:
Engine Gamos::KeyCodes

Public Member Functions

void rndSeed (uint32 seed)
 
uint32 rnd ()
 
uint16 rndRange16 (uint32 range)
 
 GamosEngine (OSystem *syst, const GamosGameDescription *gameDesc)
 
uint32 getFeatures () const
 
Common::String getGameId () const
 
Common::Language getGameLanguage ()
 
Common::String getRunFile () const
 
uint32 getEngineVersion () const
 
- 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 ()
 
virtual bool hasFeature (EngineFeature f) const
 
bool enhancementEnabled (int32 cls)
 
virtual void applyGameSettings ()
 
virtual void flipMute ()
 
virtual Common::String getSaveStateName (int slot) const
 
virtual Common::Error loadGameState (int slot)
 
virtual Common::Error loadGameStream (Common::SeekableReadStream *stream)
 
void setGameToLoadSlot (int slot)
 
virtual bool canLoadGameStateCurrently (Common::U32String *msg=nullptr)
 
virtual Common::Error saveGameState (int slot, const Common::String &desc, bool isAutosave=false)
 
virtual Common::Error saveGameStream (Common::WriteStream *stream, bool isAutosave=false)
 
virtual bool canSaveGameStateCurrently (Common::U32String *msg=nullptr)
 
bool saveGameDialog ()
 
bool loadGameDialog ()
 
- Public Member Functions inherited from Gamos::KeyCodes
uint8 getWinCode (uint16 code) const
 
uint16 getScummCode (uint8 code) const
 
void setCP1251 ()
 
void setCP1252 ()
 
uint16 getCPCode (uint16 code) const
 

Public Attributes

Graphics::Screen_screen = nullptr
 
- Public Attributes inherited from Engine
OSystem_system
 
Audio::Mixer_mixer
 

Protected Member Functions

Common::Error run () override
 
void readCMDByte ()
 
bool loadModule (uint id)
 
bool loader2 ()
 
bool loadResHandler (uint tp, uint pid, uint p1, uint p2, uint p3, const byte *data, uint32 dataSize)
 
bool loadResHandler (uint tp, uint pid, uint p1, uint p2, uint p3, const RawData &data)
 
bool reuseLastResource (uint tp, uint pid, uint p1, uint p2, uint p3)
 
bool initMainDatas ()
 
bool init (const Common::String &moduleName)
 
bool loadInitModule ()
 
void readElementsConfig (const RawData &data)
 
void setFPS (uint fps)
 
void loadXorSeq (const byte *data, uint32 dataSize, int id)
 
bool loadSpriteInfo (int32 id, const byte *data, uint32 dataSize)
 
bool loadSpriteSeqLength (int32 id, const byte *data, uint32 dataSize)
 
bool loadSpriteSeqImageInfo (int32 id, int32 p1, const byte *data, uint32 dataSize)
 
bool loadSpriteSeqImageData (int32 id, int32 p1, int32 p2, const byte *data, uint32 dataSize)
 
bool loadMidiTrack (int32 id, const byte *data, uint32 dataSize)
 
bool loadBackground (int32 id, const byte *data, uint32 dataSize)
 
void freeImages ()
 
void freeSequences ()
 
bool playMidi (Common::Array< byte > *buffer)
 
bool playSound (uint id)
 
int stepVolume (int volume, int target)
 
void changeVolume ()
 
void syncSoundSettings () override
 
void stopMidi ()
 
void stopCDAudio ()
 
void stopSounds ()
 
bool playIntro ()
 
bool playMovie (uint32 id)
 
uint32 playMidiTrack (uint32 id)
 
void setErrMessage (const Common::String &msg)
 
void updateScreen (bool checkers, const Common::Rect &rect)
 
void readData2 (const RawData &data)
 
uint8 update (Common::Point screenSize, Common::Point mouseMove, Common::Point actPos, uint8 act2, uint8 act1, uint16 keyCode, bool mouseInWindow)
 
int32 doActions (const Actions &a, bool absolute)
 
uint32 savedDoActions (const Actions &a)
 
void preprocessData (int id, ActEntry *e)
 
void preprocessDataB1 (int id, ActEntry *e)
 
int processData (ActEntry e, bool absolute)
 
void executeScript (int32 scriptAddr, ObjectAction *act, Object *pobj, int32 index, byte *storage, Common::Point cell, uint8 t)
 
void processActionCurObject (ActEntry e)
 
void createActiveObject (ActEntry e, Common::Point cell)
 
void removeObjectAtCoords (Common::Point cell, bool deleteGfxObj)
 
ObjectgetFreeObject ()
 
void removeObject (Object *obj)
 
void removeObjectMarkDirty (Object *obj)
 
void removeObjectByIDMarkDirty (int32 id)
 
void removeSubtitles (Object *obj)
 
void cycleNextInputObj (Object *obj)
 
bool updateObjects ()
 
bool updateMouseCursor (Common::Point mouseMove)
 
bool scrollAndDraw ()
 
bool updateVMInputFrameStates ()
 
bool updateGfxFrames (Object *obj, bool p2, bool p1)
 
void updateGfxObjectPosition (Object *obj)
 
void addDirtRectOnObject (Object *obj)
 
void addDirtyRect (const Common::Rect &rect)
 
void doDraw ()
 
void flushDirtyRects (bool apply)
 
bool usePalette (const byte *pal, int num, int fade, bool winColors)
 
bool setPaletteCurrentGS ()
 
bool loadImage (Image *img)
 
uint32 doScript (uint32 scriptAddress)
 
bool createGfxObject (uint32 id, Common::Point position, bool p)
 
void gfxObjectCalculateFlip (int32 sprId, Object *obj, bool p)
 
void updateLinkedGfxObject (Object *obj)
 
bool moviePlayerPlay (int id)
 
void setCursor (int id, bool dirtRect)
 
void processInput (Common::Point move, Common::Point actPos, uint8 act2, uint8 act1)
 
bool checkPointOnLinkedGfx (Object *obj, Common::Point pos)
 
void setNeedReload ()
 
ObjectaddSubtitleImage (uint32 frame, int32 spr, int32 *pX, int32 y)
 
void addSubtitles (VM::Context *ctx, byte memtype, int32 offset, int32 sprId, int32 x, int32 y)
 
void FUN_00407db8 (uint8 p)
 
byte FUN_00408648 (uint8 p1, uint8 p2, uint8 p3)
 
byte FUN_004084bc (uint8 p)
 
byte FUN_00408510 (uint8 p)
 
byte FUN_0040856c ()
 
byte FUN_004085d8 (uint8 p)
 
byte pathFindCalcMove (bool faceTarget)
 
byte pathFindMoveToTarget ()
 
byte pathFindTraceMove (uint8 p)
 
byte pathFindSetNeighbor (uint8 checkVal, uint8 setVal)
 
byte FUN_004088cc (uint8 p1, uint8 p2, uint8 p3)
 
byte FUN_004086e4 (const Common::Array< byte > &arr)
 
byte FUN_00408778 (const Common::Array< byte > &arr)
 
byte FUN_0040881c (const Common::Array< byte > &arr)
 
bool FUN_0040705c (int a, int b)
 
void runRenewStaticGfxCurObj (uint8 val, bool rnd)
 
void removeStaticGfxCurObj ()
 
int txtInputBegin (VM::Context *ctx, byte memtype, int32 offset, int sprId, int32 x, int32 y)
 
void txtInputProcess (uint8 c)
 
void txtInputEraseBack (int n)
 
bool onTxtInputUpdate (uint8 c)
 
void storeToGameScreen (int id)
 
bool switchToGameScreen (int id, bool doNotStore)
 
Common::String makeSaveName (const Common::String &main, int id, const Common::String &ext) const
 
void writeVMData (Common::SeekableWriteStream *stream, const Common::Array< XorArg > &seq)
 
void readVMData (Common::SeekableReadStream *stream, const Common::Array< XorArg > &seq)
 
bool writeStateFile ()
 
void writeStateData (Common::SeekableWriteStream *stream)
 
void zeroVMData (const Common::Array< XorArg > &seq)
 
bool loadStateFile ()
 
void loadStateData (Common::SeekableReadStream *stream)
 
bool writeSaveFile (int id)
 
bool loadSaveFile (int id)
 
bool deleteSaveFile (int id)
 
void writeObjectData (Common::SeekableWriteStream *stream, const Object *obj)
 
void loadObjectData (Common::SeekableReadStream *stream, Object *obj)
 
void vmCallDispatcher (VM::Context *ctx, uint32 funcID)
 
void dumpActions ()
 
void playVideo (const Common::String &video, const Common::Point &pos, const Common::Point &size)
 
void surfacePaletteRemap (Graphics::Surface *dst, const byte *tgtPalette, const Graphics::Surface *src, const byte *srcPalette, int srcCount)
 
bool eventsSkip (bool breakOnInput=false)
 
- Protected Member Functions inherited from Engine
virtual int runDialog (GUI::Dialog &dialog)
 
void defaultSyncSoundSettings ()
 
virtual void pauseEngineIntern (bool pause)
 
- Protected Member Functions inherited from Gamos::KeyCodes
void setCPTable (const uint16 *table, uint16 size, uint16 offset=0x80)
 

Static Protected Member Functions

static uint32 getU32 (const void *ptr)
 
static void callbackVMCallDispatcher (void *engine, VM::Context *ctx, uint32 funcID)
 
static Common::String gamos_itoa (int value, uint radix)
 

Additional Inherited Members

- Public Types inherited from Engine
enum  EngineFeature {
  kSupportsSubtitleOptions, kSupportsReturnToLauncher, kSupportsLoadingDuringRuntime, kSupportsSavingDuringRuntime,
  kSupportsChangingOptionsDuringRuntime, kSupportsArbitraryResolutions, kSupportsHelp, kSupportsQuitDialogOverride
}
 
- Public Types inherited from Gamos::KeyCodes
enum  {
  WIN_INVALID = 0, WIN_LBUTTON = 0x01, WIN_RBUTTON = 0x02, WIN_CANCEL = 0x03,
  WIN_MBUTTON = 0x04, WIN_XBUTTON1 = 0x05, WIN_XBUTTON2 = 0x06, WIN_BACK = 0x08,
  WIN_TAB = 0x09, WIN_CLEAR = 0x0C, WIN_RETURN = 0x0D, WIN_SHIFT = 0x10,
  WIN_CONTROL = 0x11, WIN_MENU = 0x12, WIN_PAUSE = 0x13, WIN_CAPITAL = 0x14,
  WIN_KANA = 0x15, WIN_JUNJA = 0x17, WIN_FINAL = 0x18, WIN_KANJI = 0x19,
  WIN_ESCAPE = 0x1B, WIN_CONVERT = 0x1C, WIN_NONCONVERT = 0x1D, WIN_ACCEPT = 0x1E,
  WIN_MODECHANGE = 0x1F, WIN_SPACE = 0x20, WIN_PRIOR = 0x21, WIN_NEXT = 0x22,
  WIN_END = 0x23, WIN_HOME = 0x24, WIN_LEFT = 0x25, WIN_UP = 0x26,
  WIN_RIGHT = 0x27, WIN_DOWN = 0x28, WIN_SELECT = 0x29, WIN_PRINT = 0x2A,
  WIN_EXECUTE = 0x2B, WIN_SNAPSHOT = 0x2C, WIN_INSERT = 0x2D, WIN_DELETE = 0x2E,
  WIN_HELP = 0x2F, WIN_0 = 0x30, WIN_1 = 0x31, WIN_2 = 0x32,
  WIN_3 = 0x33, WIN_4 = 0x34, WIN_5 = 0x35, WIN_6 = 0x36,
  WIN_7 = 0x37, WIN_8 = 0x38, WIN_9 = 0x39, WIN_A = 0x41,
  WIN_B = 0x42, WIN_C = 0x43, WIN_D = 0x44, WIN_E = 0x45,
  WIN_F = 0x46, WIN_G = 0x47, WIN_H = 0x48, WIN_I = 0x49,
  WIN_J = 0x4A, WIN_K = 0x4B, WIN_L = 0x4C, WIN_M = 0x4D,
  WIN_N = 0x4E, WIN_O = 0x4F, WIN_P = 0x50, WIN_Q = 0x51,
  WIN_R = 0x52, WIN_S = 0x53, WIN_T = 0x54, WIN_U = 0x55,
  WIN_V = 0x56, WIN_W = 0x57, WIN_X = 0x58, WIN_Y = 0x59,
  WIN_Z = 0x5A, WIN_LWIN = 0x5B, WIN_RWIN = 0x5C, WIN_APPS = 0x5D,
  WIN_SLEEP = 0x5F, WIN_NUMPAD0 = 0x60, WIN_NUMPAD1 = 0x61, WIN_NUMPAD2 = 0x62,
  WIN_NUMPAD3 = 0x63, WIN_NUMPAD4 = 0x64, WIN_NUMPAD5 = 0x65, WIN_NUMPAD6 = 0x66,
  WIN_NUMPAD7 = 0x67, WIN_NUMPAD8 = 0x68, WIN_NUMPAD9 = 0x69, WIN_MULTIPLY = 0x6A,
  WIN_ADD = 0x6B, WIN_SEPARATOR = 0x6C, WIN_SUBTRACT = 0x6D, WIN_DECIMAL = 0x6E,
  WIN_DIVIDE = 0x6F, WIN_F1 = 0x70, WIN_F2 = 0x71, WIN_F3 = 0x72,
  WIN_F4 = 0x73, WIN_F5 = 0x74, WIN_F6 = 0x75, WIN_F7 = 0x76,
  WIN_F8 = 0x77, WIN_F9 = 0x78, WIN_F10 = 0x79, WIN_F11 = 0x7A,
  WIN_F12 = 0x7B, WIN_F13 = 0x7C, WIN_F14 = 0x7D, WIN_F15 = 0x7E,
  WIN_F16 = 0x7F, WIN_F17 = 0x80, WIN_F18 = 0x81, WIN_F19 = 0x82,
  WIN_F20 = 0x83, WIN_F21 = 0x84, WIN_F22 = 0x85, WIN_F23 = 0x86,
  WIN_F24 = 0x87, WIN_NAVIGATION_VIEW = 0x88, WIN_NAVIGATION_MENU = 0x89, WIN_NAVIGATION_UP = 0x8A,
  WIN_NAVIGATION_DOWN = 0x8B, WIN_NAVIGATION_LEFT = 0x8C, WIN_NAVIGATION_RIGHT = 0x8D, WIN_NAVIGATION_ACCEPT = 0x8E,
  WIN_NAVIGATION_CANCEL = 0x8F, WIN_NUMLOCK = 0x90, WIN_SCROLL = 0x91, WIN_OEM_NEC_EQUAL = 0x92,
  WIN_OEM_FJ_JISHO = 0x92, WIN_OEM_FJ_MASSHOU = 0x93, WIN_OEM_FJ_TOUROKU = 0x94, WIN_OEM_FJ_LOYA = 0x95,
  WIN_OEM_FJ_ROYA = 0x96, WIN_LSHIFT = 0xA0, WIN_RSHIFT = 0xA1, WIN_LCONTROL = 0xA2,
  WIN_RCONTROL = 0xA3, WIN_LMENU = 0xA4, WIN_RMENU = 0xA5, WIN_BROWSER_BACK = 0xA6,
  WIN_BROWSER_FORWARD = 0xA7, WIN_BROWSER_REFRESH = 0xA8, WIN_BROWSER_STOP = 0xA9, WIN_BROWSER_SEARCH = 0xAA,
  WIN_BROWSER_FAVORITES = 0xAB, WIN_BROWSER_HOME = 0xAC, WIN_VOLUME_MUTE = 0xAD, WIN_VOLUME_DOWN = 0xAE,
  WIN_VOLUME_UP = 0xAF, WIN_MEDIA_NEXT_TRACK = 0xB0, WIN_MEDIA_PREV_TRACK = 0xB1, WIN_MEDIA_STOP = 0xB2,
  WIN_MEDIA_PLAY_PAUSE = 0xB3, WIN_LAUNCH_MAIL = 0xB4, WIN_LAUNCH_MEDIA_SELECT = 0xB5, WIN_LAUNCH_APP1 = 0xB6,
  WIN_LAUNCH_APP2 = 0xB7, WIN_OEM_1 = 0xBA, WIN_OEM_PLUS = 0xBB, WIN_OEM_COMMA = 0xBC,
  WIN_OEM_MINUS = 0xBD, WIN_OEM_PERIOD = 0xBE, WIN_OEM_2 = 0xBF, WIN_OEM_3 = 0xC0,
  WIN_GAMEPAD_A = 0xC3, WIN_GAMEPAD_B = 0xC4, WIN_GAMEPAD_X = 0xC5, WIN_GAMEPAD_Y = 0xC6,
  WIN_GAMEPAD_RIGHT_SHOULDER = 0xC7, WIN_GAMEPAD_LEFT_SHOULDER = 0xC8, WIN_GAMEPAD_LEFT_TRIGGER = 0xC9, WIN_GAMEPAD_RIGHT_TRIGGER = 0xCA,
  WIN_GAMEPAD_DPAD_UP = 0xCB, WIN_GAMEPAD_DPAD_DOWN = 0xCC, WIN_GAMEPAD_DPAD_LEFT = 0xCD, WIN_GAMEPAD_DPAD_RIGHT = 0xCE,
  WIN_GAMEPAD_MENU = 0xCF, WIN_GAMEPAD_VIEW = 0xD0, WIN_GAMEPAD_LEFT_THUMBSTICK_BUTTON = 0xD1, WIN_GAMEPAD_RIGHT_THUMBSTICK_BUTTON = 0xD2,
  WIN_GAMEPAD_LEFT_THUMBSTICK_UP = 0xD3, WIN_GAMEPAD_LEFT_THUMBSTICK_DOWN = 0xD4, WIN_GAMEPAD_LEFT_THUMBSTICK_RIGHT = 0xD5, WIN_GAMEPAD_LEFT_THUMBSTICK_LEFT = 0xD6,
  WIN_GAMEPAD_RIGHT_THUMBSTICK_UP = 0xD7, WIN_GAMEPAD_RIGHT_THUMBSTICK_DOWN = 0xD8, WIN_GAMEPAD_RIGHT_THUMBSTICK_RIGHT = 0xD9, WIN_GAMEPAD_RIGHT_THUMBSTICK_LEFT = 0xDA,
  WIN_OEM_4 = 0xDB, WIN_OEM_5 = 0xDC, WIN_OEM_6 = 0xDD, WIN_OEM_7 = 0xDE,
  WIN_OEM_8 = 0xDF, WIN_OEM_AX = 0xE1, WIN_OEM_102 = 0xE2, WIN_ICO_HELP = 0xE3,
  WIN_ICO_00 = 0xE4, WIN_PROCESSKEY = 0xE5, WIN_ICO_CLEAR = 0xE6, WIN_PACKET = 0xE7,
  WIN_OEM_RESET = 0xE9, WIN_OEM_JUMP = 0xEA, WIN_OEM_PA1 = 0xEB, WIN_OEM_PA2 = 0xEC,
  WIN_OEM_PA3 = 0xED, WIN_OEM_WSCTRL = 0xEE, WIN_OEM_CUSEL = 0xEF, WIN_OEM_ATTN = 0xF0,
  WIN_OEM_FINISH = 0xF1, WIN_OEM_COPY = 0xF2, WIN_OEM_AUTO = 0xF3, WIN_OEM_ENLW = 0xF4,
  WIN_OEM_BACKTAB = 0xF5, WIN_ATTN = 0xF6, WIN_CRSEL = 0xF7, WIN_EXSEL = 0xF8,
  WIN_EREOF = 0xF9, WIN_PLAY = 0xFA, WIN_ZOOM = 0xFB, WIN_NONAME = 0xFC,
  WIN_PA1 = 0xFD, WIN_OEM_CLEAR = 0xFE
}
 
- 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 Gamos::GamosEngine::run ( )
overrideprotectedvirtual

Initialize the engine and start its main loop.

Returns
kNoError on success, otherwise an error code.

Implements Engine.

◆ syncSoundSettings()

void Gamos::GamosEngine::syncSoundSettings ( )
overrideprotectedvirtual

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: