ScummVM API documentation
OSystem_libretro Class Reference
Inheritance diagram for OSystem_libretro:
EventsBaseBackend ModularGraphicsBackend BaseBackend Common::EventSource BaseBackend OSystem OSystem Common::NonCopyable Common::NonCopyable

Public Member Functions

void initBackend (void) override
 
void engineInit (void) override
 
void refreshRetroSettings (void)
 
void refreshScreen (void)
 
void destroy (void)
 
void quit () override
 
void resetGraphicsManager (void)
 
void getScreen (const Graphics::Surface *&screen)
 
int16 getScreenWidth (void)
 
int16 getScreenHeight (void)
 
bool isOverlayInGUI (void)
 
bool pollEvent (Common::Event &event) override
 
uint32 getMillis (bool skipRecord=false) override
 
void delayMillis (uint msecs) override
 
Common::MutexInternalcreateMutex (void) override
 
void requestQuit (void)
 
void resetQuit (void)
 
void setMousePosition (int x, int y)
 
Common::Point convertWindowToVirtual (int x, int y) const
 
void getTimeAndDate (TimeDate &t, bool skipRecord) const override
 
Audio::MixergetMixer (void) override
 
Common::Path getDefaultConfigFileName (void) override
 
void logMessage (LogMessageType::Type type, const char *message) override
 
int testGame (const char *filedata, bool autodetect)
 
void addSysArchivesToSearchSet (Common::SearchSet &s, int priority=0) override
 
const char *const * buildHelpDialogData () override
 
Common::String getSaveDir (void)
 
GUI::OptionsContainerWidgetbuildBackendOptionsWidget (GUI::GuiObject *boss, const Common::String &name, const Common::String &target) const override
 
void applyBackendSettings () override
 
void processInputs (void)
 
void processKeyEvent (bool down, unsigned keycode, uint32 character, uint16 key_modifiers)
 
- Public Member Functions inherited from BaseBackend
bool setScaler (const char *name, int factor) override final
 
- Public Member Functions inherited from OSystem
void destroy ()
 
virtual void init ()
 
bool backendInitialized () const
 
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)
 
bool setGraphicsMode (const char *name)
 
Graphics::PixelFormat getScreenFormat () const
 
Common::List< Graphics::PixelFormatgetSupportedFormats () const
 
virtual Common::Array< uint > getSupportedAntiAliasingLevels () const
 
virtual OpenGL::ContextType getOpenGLType () const
 
bool setStretchMode (const char *name)
 
virtual uint32 getDoubleClickTime () const
 
virtual Common::TimerManagergetTimerManager ()
 
Common::EventManagergetEventManager ()
 
virtual Common::HardwareInputSetgetHardwareInputSet ()
 
virtual Common::KeymapArray getGlobalKeymaps ()
 
virtual Common::KeymapperDefaultBindingsgetKeymapperDefaultBindings ()
 
AudioCDManagergetAudioCDManager ()
 
virtual void fatalError ()
 
virtual void setWindowCaption (const Common::U32String &caption)
 
virtual Common::SaveFileManagergetSavefileManager ()
 
virtual Common::TextToSpeechManagergetTextToSpeechManager ()
 
virtual Common::DialogManagergetDialogManager ()
 
virtual DLC::StoregetDLCStore ()
 
virtual FilesystemFactorygetFilesystemFactory ()
 
virtual Common::SeekableReadStreamcreateConfigReadStream ()
 
virtual Common::WriteStreamcreateConfigWriteStream ()
 
virtual Common::Path getDefaultLogFileName ()
 
virtual void registerDefaultSettings (const Common::String &target) const
 
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 ()
 
- Public Member Functions inherited from ModularGraphicsBackend
bool hasFeature (Feature f) override
 
void setFeatureState (Feature f, bool enable) override
 
bool getFeatureState (Feature f) override
 
GraphicsManagergetGraphicsManager ()
 
const GraphicsModegetSupportedGraphicsModes () const override
 
int getDefaultGraphicsMode () const override
 
bool setGraphicsMode (int mode, uint flags=kGfxModeNoFlags) override
 
int getGraphicsMode () const override
 
bool setShader (const Common::Path &name) override final
 
const GraphicsModegetSupportedStretchModes () const override final
 
int getDefaultStretchMode () const override final
 
bool setStretchMode (int mode) override final
 
int getStretchMode () const override final
 
uint getDefaultScaler () const override final
 
uint getDefaultScaleFactor () const override final
 
bool setScaler (uint mode, int factor) override final
 
uint getScaler () const override final
 
uint getScaleFactor () const override final
 
void initSize (uint width, uint height, const Graphics::PixelFormat *format=NULL) override final
 
void initSizeHint (const Graphics::ModeList &modes) override final
 
int getScreenChangeID () const override final
 
void beginGFXTransaction () override final
 
OSystem::TransactionError endGFXTransaction () override final
 
int16 getHeight () override final
 
int16 getWidth () override final
 
PaletteManagergetPaletteManager () override final
 
void copyRectToScreen (const void *buf, int pitch, int x, int y, int w, int h) override final
 
Graphics::SurfacelockScreen () override final
 
void unlockScreen () override final
 
void fillScreen (uint32 col) override final
 
void fillScreen (const Common::Rect &r, uint32 col) override final
 
void updateScreen () override final
 
void setShakePos (int shakeXOffset, int shakeYOffset) override final
 
void setFocusRectangle (const Common::Rect &rect) override final
 
void clearFocusRectangle () override final
 
void showOverlay (bool inGUI) override final
 
void hideOverlay () override final
 
bool isOverlayVisible () const override final
 
Graphics::PixelFormat getOverlayFormat () const override final
 
void clearOverlay () override final
 
void grabOverlay (Graphics::Surface &surface) override final
 
void copyRectToOverlay (const void *buf, int pitch, int x, int y, int w, int h) override final
 
int16 getOverlayHeight () override final
 
int16 getOverlayWidth () override final
 
float getHiDPIScreenFactor () const override final
 
bool showMouse (bool visible) override final
 
void warpMouse (int x, int y) override final
 
void setMouseCursor (const void *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, bool dontScale=false, const Graphics::PixelFormat *format=NULL, const byte *mask=NULL) override final
 
void setCursorPalette (const byte *colors, uint start, uint num) override final
 
bool lockMouse (bool lock) override final
 
void displayMessageOnOSD (const Common::U32String &msg) override final
 
void displayActivityIconOnOSD (const Graphics::Surface *icon) override final
 
void saveScreenshot () override final
 

Public Attributes

Audio::MixerImpl_mixer
 
bool _mouseButtons [2]
 
bool _ptrmouseButton
 
int _mouseX
 
int _mouseY
 

Additional Inherited Members

- Public Types inherited from OSystem
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
}
 
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)
}
 
- Protected Attributes inherited from OSystem
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
 
- Protected Attributes inherited from ModularGraphicsBackend
GraphicsManager_graphicsManager
 

Member Function Documentation

◆ initBackend()

void OSystem_libretro::initBackend ( void  )
overridevirtual

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 from EventsBaseBackend.

◆ engineInit()

void OSystem_libretro::engineInit ( void  )
overridevirtual

Allow the backend to perform engine-specific initialization.

Called just before the engine is run.

Reimplemented from OSystem.

◆ quit()

void OSystem_libretro::quit ( )
inlineoverridevirtual

Quit (exit) the application.

Implements OSystem.

◆ pollEvent()

bool OSystem_libretro::pollEvent ( Common::Event event)
overridevirtual

Query an event from the source.

Parameters
eventReference to the event struct where the event should be stored.
Return values
trueIf an event was polled, false otherwise.

Implements Common::EventSource.

◆ getMillis()

uint32 OSystem_libretro::getMillis ( bool  skipRecord = false)
overridevirtual

Get the number of milliseconds since the program was started.

Parameters
skipRecordSkip recording of this value by the event recorder. This might be needed particularly when we are in an on-screen GUI loop where the player can pause the recording.

Implements OSystem.

◆ delayMillis()

void OSystem_libretro::delayMillis ( uint  msecs)
overridevirtual

Delay/sleep for the specified amount of milliseconds.

Implements OSystem.

◆ createMutex()

Common::MutexInternal* OSystem_libretro::createMutex ( void  )
overridevirtual

Create a new mutex.

Returns
The newly created mutex, or 0 if an error occurred.

Implements OSystem.

◆ getTimeAndDate()

void OSystem_libretro::getTimeAndDate ( TimeDate td,
bool  skipRecord 
) const
overridevirtual

Get the current time and date, in the local timezone.

On many systems, this corresponds to the combination of time() and localtime().

Implements OSystem.

◆ getMixer()

Audio::Mixer* OSystem_libretro::getMixer ( void  )
overridevirtual

Return the audio mixer.

For more information, see Audio::Mixer.

Implements OSystem.

◆ getDefaultConfigFileName()

Common::Path OSystem_libretro::getDefaultConfigFileName ( void  )
overridevirtual

Get the default file name (or even path) where the user configuration of ScummVM will be saved.

Note that not all ports can use this.

Reimplemented from OSystem.

◆ logMessage()

void OSystem_libretro::logMessage ( LogMessageType::Type  type,
const char *  message 
)
overridevirtual

Log the given message.

It is up to the backend where to log the different messages. The backend should aim at using a non-buffered output for it, so that no log data is lost in case of a crash.

The default implementation outputs them on stdout/stderr.

Parameters
typeType of the message.
messageThe message itself.

Implements OSystem.

◆ addSysArchivesToSearchSet()

void OSystem_libretro::addSysArchivesToSearchSet ( Common::SearchSet s,
int  priority = 0 
)
overridevirtual

Add system-specific Common::Archive objects to the given SearchSet. For example, on Unix, the directory corresponding to DATA_PATH (if set), or, on macOS, the 'Resource' dir in the app bundle.

Parameters
sSearchSet to which the system-specific dirs, if any, are added.
priorityPriority with which those dirs are added.

Reimplemented from OSystem.

◆ buildHelpDialogData()

const char* const* OSystem_libretro::buildHelpDialogData ( )
overridevirtual

Return list of strings used for building help dialog

The strings represented in triplets:

  • Name of a tab (will be translated)
  • ZIP pack name with images (optional)
  • Text of the tab with Markdown formatting (also be translated)

The string list is null-terminated.

Reimplemented from OSystem.

◆ buildBackendOptionsWidget()

GUI::OptionsContainerWidget* OSystem_libretro::buildBackendOptionsWidget ( GUI::GuiObject boss,
const Common::String name,
const Common::String target 
) const
overridevirtual

Return a GUI widget container for configuring the specified target options.

The returned widget is shown in the Backend tab in the options dialog. Backends can build custom options dialogs.

Backends that don't want to have a Backend tab in the options dialog can return nullptr.

Parameters
bossthe widget / dialog the returned widget is a child of
namethe name the returned widget must use
targetname of a config manager target

Reimplemented from OSystem.

◆ applyBackendSettings()

void OSystem_libretro::applyBackendSettings ( )
overridevirtual

Notify the backend that the settings editable from the game tab in the options dialog may have changed and that they need to be applied if necessary.

Reimplemented from OSystem.


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