ScummVM API documentation
OSystem Class Referenceabstract

#include <system.h>

Inheritance diagram for OSystem:
Common::NonCopyable BaseBackend EventsBaseBackend ModularGraphicsBackend ModularMixerBackend N3DS::OSystem_3DS OSystem_Dreamcast OSystem_iOS7 OSystem_libretro OSystem_N64 OSystem_PSP OSystem_Wii OSystem_Android OSystem_Atari OSystem_iOS7 OSystem_libretro OSystem_SDL OSystem_Atari OSystem_DS OSystem_SDL

Classes

struct  GraphicsMode
 

Public Types

enum  Task { kLocalServer, kCloudDownload, kDataPackDownload }
 
enum  Feature {
  kFeatureFullscreenMode, kFeatureAspectRatioCorrection, kFeatureFilteringMode, kFeatureStretchMode,
  kFeatureVirtualKeyboard, kFeatureCursorPalette, kFeatureCursorAlpha, kFeatureCursorMask,
  kFeatureCursorMaskInvert, kFeatureCursorMaskPaletteXorColorXnor, kFeatureOverlaySupportsAlpha, kFeatureIconifyWindow,
  kFeatureOpenGLForGame, kFeatureShadersForGame, kFeatureVSync, kFeatureFullscreenToggleKeepsContext,
  kFeatureDisplayLogFile, kFeatureClipboardSupport, kFeatureOpenUrl, kFeatureTouchpadMode,
  kFeatureKbdMouseSpeed, kFeatureJoystickDeadzone, kFeatureScalers, kFeatureShaders,
  kFeatureDLC, kFeatureSystemBrowserDialog, kFeatureNoQuit, kFeatureTouchscreen,
  kFeatureCpuNEON, kFeatureCpuSSE2, kFeatureCpuSSE41, kFeatureCpuAVX2,
  kFeatureCpuAltivec, kFeatureRotationMode
}
 
enum  GfxModeFlags { kGfxModeNoFlags = 0, kGfxModeRender3d = (1 << 0) }
 
enum  TransactionError {
  kTransactionSuccess = 0, kTransactionAspectRatioFailed = (1 << 0), kTransactionFullscreenFailed = (1 << 1), kTransactionModeSwitchFailed = (1 << 2),
  kTransactionSizeChangeFailed = (1 << 3), kTransactionFormatNotSupported = (1 << 4), kTransactionFilteringFailed = (1 << 5), kTransactionStretchModeSwitchFailed = (1 << 6),
  kTransactionShaderChangeFailed = (1 << 7), kTransactionVSyncFailed = (1 << 8)
}
 

Public Member Functions

void destroy ()
 
virtual void init ()
 
virtual void initBackend ()
 
bool backendInitialized () const
 
virtual void engineInit ()
 
virtual void engineDone ()
 
virtual void taskStarted (Task)
 
virtual void taskFinished (Task)
 
virtual void updateStartSettings (const Common::String &executable, Common::String &command, Common::StringMap &startSettings, Common::StringArray &additionalArgs)
 
virtual bool hasFeature (Feature f)
 
virtual void setFeatureState (Feature f, bool enable)
 
virtual bool getFeatureState (Feature f)
 
virtual const GraphicsModegetSupportedGraphicsModes () const
 
virtual int getDefaultGraphicsMode () const
 
virtual bool setGraphicsMode (int mode, uint flags=kGfxModeNoFlags)
 
bool setGraphicsMode (const char *name)
 
virtual int getGraphicsMode () const
 
Graphics::PixelFormat getScreenFormat () const
 
Common::List< Graphics::PixelFormatgetSupportedFormats () const
 
virtual Common::Array< uint > getSupportedAntiAliasingLevels () const
 
virtual OpenGL::ContextType getOpenGLType () const
 
virtual bool setShader (const Common::Path &fileName)
 
virtual const GraphicsModegetSupportedStretchModes () const
 
virtual int getDefaultStretchMode () const
 
virtual bool setStretchMode (int mode)
 
bool setStretchMode (const char *name)
 
virtual int getStretchMode () const
 
virtual uint getDefaultScaler () const
 
virtual uint getDefaultScaleFactor () const
 
virtual bool setScaler (uint mode, int factor)
 
virtual bool setScaler (const char *name, int factor)
 
virtual uint getScaler () const
 
virtual uint getScaleFactor () const
 
virtual void initSize (uint width, uint height, const Graphics::PixelFormat *format=nullptr)=0
 
virtual void initSizeHint (const Graphics::ModeList &modes)
 
virtual int getScreenChangeID () const
 
virtual void beginGFXTransaction ()
 
virtual TransactionError endGFXTransaction ()
 
virtual int16 getHeight ()=0
 
virtual int16 getWidth ()=0
 
virtual PaletteManagergetPaletteManager ()=0
 
virtual float getHiDPIScreenFactor () const
 
virtual void copyRectToScreen (const void *buf, int pitch, int x, int y, int w, int h)=0
 
virtual Graphics::SurfacelockScreen ()=0
 
virtual void unlockScreen ()=0
 
virtual void fillScreen (uint32 col)=0
 
virtual void fillScreen (const Common::Rect &r, uint32 col)=0
 
virtual void updateScreen ()=0
 
virtual void setShakePos (int shakeXOffset, int shakeYOffset)=0
 
virtual void setFocusRectangle (const Common::Rect &rect)
 
virtual void clearFocusRectangle ()
 
virtual void saveScreenshot ()
 
virtual void showOverlay (bool inGUI=true)=0
 
virtual void hideOverlay ()=0
 
virtual bool isOverlayVisible () const =0
 
virtual Graphics::PixelFormat getOverlayFormat () const =0
 
virtual void clearOverlay ()=0
 
virtual void grabOverlay (Graphics::Surface &surface)=0
 
virtual void copyRectToOverlay (const void *buf, int pitch, int x, int y, int w, int h)=0
 
virtual int16 getOverlayHeight ()=0
 
virtual int16 getOverlayWidth ()=0
 
virtual bool showMouse (bool visible)=0
 
virtual bool lockMouse (bool lock)
 
virtual void warpMouse (int x, int y)=0
 
virtual void setMouseCursor (const void *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, bool dontScale=false, const Graphics::PixelFormat *format=nullptr, const byte *mask=nullptr)=0
 
virtual void setCursorPalette (const byte *colors, uint start, uint num)
 
virtual uint32 getDoubleClickTime () const
 
virtual uint32 getMillis (bool skipRecord=false)=0
 
virtual void delayMillis (uint msecs)=0
 
virtual void getTimeAndDate (TimeDate &td, bool skipRecord=false) const =0
 
virtual Common::TimerManagergetTimerManager ()
 
Common::EventManagergetEventManager ()
 
virtual Common::HardwareInputSetgetHardwareInputSet ()
 
virtual Common::KeymapArray getGlobalKeymaps ()
 
virtual Common::KeymapperDefaultBindingsgetKeymapperDefaultBindings ()
 
virtual Common::MutexInternalcreateMutex ()=0
 
virtual Audio::MixergetMixer ()=0
 
AudioCDManagergetAudioCDManager ()
 
virtual void quit ()=0
 
virtual void fatalError ()
 
virtual void setWindowCaption (const Common::U32String &caption)
 
virtual void displayMessageOnOSD (const Common::U32String &msg)=0
 
virtual void displayActivityIconOnOSD (const Graphics::Surface *icon)=0
 
virtual Common::SaveFileManagergetSavefileManager ()
 
virtual Common::TextToSpeechManagergetTextToSpeechManager ()
 
virtual Common::DialogManagergetDialogManager ()
 
virtual DLC::StoregetDLCStore ()
 
virtual FilesystemFactorygetFilesystemFactory ()
 
virtual void addSysArchivesToSearchSet (Common::SearchSet &s, int priority=0)
 
virtual Common::SeekableReadStreamcreateConfigReadStream ()
 
virtual Common::WriteStreamcreateConfigWriteStream ()
 
virtual Common::Path getDefaultConfigFileName ()
 
virtual Common::Path getDefaultLogFileName ()
 
virtual void registerDefaultSettings (const Common::String &target) const
 
virtual GUI::OptionsContainerWidgetbuildBackendOptionsWidget (GUI::GuiObject *boss, const Common::String &name, const Common::String &target) const
 
virtual const char *const * buildHelpDialogData ()
 
virtual void applyBackendSettings ()
 
virtual void logMessage (LogMessageType::Type type, const char *message)=0
 
virtual void messageBox (LogMessageType::Type type, const char *message)
 
virtual bool displayLogFile ()
 
virtual bool hasTextInClipboard ()
 
virtual Common::U32String getTextFromClipboard ()
 
virtual bool setTextInClipboard (const Common::U32String &text)
 
virtual bool openUrl (const Common::String &url)
 
virtual Common::String getSystemLanguage () const
 
virtual bool isConnectionLimited ()
 

Protected Attributes

AudioCDManager_audiocdManager
 
Common::EventManager_eventManager
 
Common::TimerManager_timerManager
 
Common::SaveFileManager_savefileManager
 
Common::TextToSpeechManager_textToSpeechManager
 
Common::DialogManager_dialogManager
 
FilesystemFactory_fsFactory
 
DLC::Store_dlcStore
 
Common::U32String _clipboard
 
bool _dummyUnused
 

Detailed Description

Interface for ScummVM backends.

If you want to port ScummVM to a system that is not currently covered by any of our backends, this is the place to start. ScummVM will create an instance of a subclass of this interface and use it to interact with the system.

In particular, a backend provides:

  • A video surface for ScummVM to draw in
  • Methods to create timers
  • Methods to handle user input events
  • Control audio CD playback
  • Sound output

Member Enumeration Documentation

◆ Task

Identify a task that ScummVM can perform.

Enumerator
kLocalServer 

The local server is running, allowing connections from other devices to transfer files.

kCloudDownload 

ScummVM is downloading games or synchronizing savegames from the cloud.

kDataPackDownload 

ScummVM is downloading an icons or shaders pack.

Member Function Documentation

◆ destroy()

void OSystem::destroy ( )

Destoy this OSystem instance.

◆ init()

virtual void OSystem::init ( )
inlinevirtual

◆ initBackend()

virtual void OSystem::initBackend ( )
virtual

The following method is called once, from main.cpp, after all config data (including command line params etc.) is fully loaded.

Note
Subclasses should always invoke the implementation of their parent class. They should do so near the end of their own implementation.

Reimplemented in OSystem_Android, OSystem_DS, OSystem_Wii, OSystem_N64, N3DS::OSystem_3DS, OSystem_iOS7, OSystem_libretro, OSystem_Dreamcast, OSystem_PSP, OSystem_SDL, EventsBaseBackend, OSystem_MacOSX, OSystem_MorphOS, OSystem_AmigaOS, BaseBackend, OSystem_POSIX, OSystem_PSP2, OSystem_Win32, OSystem_Atari, OSystem_KolibriOS, OSystem_SDL_Miyoo, OSystem_SDL_Opendingux, OSystem_PS3, OSystem_RISCOS, OSystem_SDL_Sailfish, and OSystem_Switch.

◆ backendInitialized()

bool OSystem::backendInitialized ( ) const
inline

Return false if initBackend() has not yet been called and true otherwise.

Some functionalities such as mutexes cannot be used until the backend is initialized.

◆ engineInit()

virtual void OSystem::engineInit ( void  )
inlinevirtual

Allow the backend to perform engine-specific initialization.

Called just before the engine is run.

Reimplemented in OSystem_Android, OSystem_Wii, OSystem_DS, OSystem_iOS7, OSystem_libretro, and OSystem_SDL.

◆ engineDone()

virtual void OSystem::engineDone ( )
inlinevirtual

Allow the backend to perform engine-specific deinitialization.

Called after the engine finishes.

Reimplemented in OSystem_Android, OSystem_Wii, OSystem_DS, OSystem_PSP, OSystem_iOS7, and OSystem_SDL.

◆ taskStarted()

virtual void OSystem::taskStarted ( Task  )
inlinevirtual

Allow the backend to be notified when a task is started.

Reimplemented in OSystem_iOS7.

◆ taskFinished()

virtual void OSystem::taskFinished ( Task  )
inlinevirtual

Allow the backend to be notified when a task is finished.

Reimplemented in OSystem_iOS7.

◆ updateStartSettings()

virtual void OSystem::updateStartSettings ( const Common::String executable,
Common::String command,
Common::StringMap startSettings,
Common::StringArray additionalArgs 
)
virtual

Allow the backend to customize the start settings, such as for example starting automatically a game under certain circumstances.

This function is called after the command line parameters have been parsed, and thus the initial value of command and settings will reflect those.

The default implementation checks if the executable name is "scummvm-auto" or if a file named "scummvm-autorun" sits next to it to enable autorun mode.

Reimplemented in OSystem_Android, OSystem_iOS7, and OSystem_MacOSX.


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