Public Member Functions | |
virtual void | initBackend () |
virtual bool | hasFeature (OSystem::Feature f) |
virtual void | setFeatureState (OSystem::Feature f, bool enable) |
virtual bool | getFeatureState (OSystem::Feature f) |
bool | pollEvent (Common::Event &event) override |
bool | notifyEvent (const Common::Event &event) override |
Common::HardwareInputSet * | getHardwareInputSet () override |
Common::KeymapArray | getGlobalKeymaps () override |
Common::KeymapperDefaultBindings * | getKeymapperDefaultBindings () override |
void | registerDefaultSettings (const Common::String &target) const override |
GUI::OptionsContainerWidget * | buildBackendOptionsWidget (GUI::GuiObject *boss, const Common::String &name, const Common::String &target) const override |
void | applyBackendSettings () override |
virtual uint32 | getMillis (bool skipRecord=false) |
virtual void | delayMillis (uint msecs) |
virtual void | getTimeAndDate (TimeDate &td, bool skipRecord=false) const |
virtual Common::MutexInternal * | createMutex () |
virtual void | logMessage (LogMessageType::Type type, const char *message) |
virtual Audio::Mixer * | getMixer () |
virtual PaletteManager * | getPaletteManager () |
virtual Common::String | getSystemLanguage () const |
virtual void | fatalError () |
virtual void | quit () |
virtual Common::Path | getDefaultConfigFileName () |
void | addSysArchivesToSearchSet (Common::SearchSet &s, int priority) override |
Graphics::PixelFormat | getScreenFormat () const |
virtual Common::List< Graphics::PixelFormat > | getSupportedFormats () const |
void | initSize (uint width, uint height, const Graphics::PixelFormat *format=NULL) |
virtual int | getScreenChangeID () const |
GraphicsModeID | chooseMode (Graphics::PixelFormat *format) |
bool | setGraphicsMode (GraphicsModeID modeID) |
void | beginGFXTransaction () |
OSystem::TransactionError | endGFXTransaction () |
int16 | getHeight () |
int16 | getWidth () |
float | getScaleRatio () const |
void | setPalette (const byte *colors, uint start, uint num) |
void | grabPalette (byte *colors, uint start, uint num) const |
void | copyRectToScreen (const void *buf, int pitch, int x, int y, int w, int h) |
Graphics::Surface * | lockScreen () |
void | unlockScreen () |
void | updateScreen () |
void | setShakePos (int shakeXOffset, int shakeYOffset) |
void | setFocusRectangle (const Common::Rect &rect) |
void | clearFocusRectangle () |
void | showOverlay (bool inGUI) |
void | hideOverlay () |
bool | isOverlayVisible () const |
Graphics::PixelFormat | getOverlayFormat () const |
void | clearOverlay () |
void | grabOverlay (Graphics::Surface &surface) |
void | copyRectToOverlay (const void *buf, int pitch, int x, int y, int w, int h) |
virtual int16 | getOverlayHeight () |
virtual int16 | getOverlayWidth () |
void | displayMessageOnOSD (const Common::U32String &msg) override |
void | displayActivityIconOnOSD (const Graphics::Surface *icon) override |
bool | showMouse (bool visible) |
void | warpMouse (int x, int y) |
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) |
void | setCursorPalette (const byte *colors, uint start, uint num) |
void | transformPoint (touchPosition &point) |
void | clipPoint (touchPosition &point) |
void | setCursorDelta (float deltaX, float deltaY) |
void | updateFocus () |
void | updateMagnify () |
void | updateBacklight () |
void | updateConfig () |
void | updateSize () |
Public Member Functions inherited from BaseBackend | |
bool | setScaler (const char *name, int factor) override final |
void | fillScreen (uint32 col) override |
void | fillScreen (const Common::Rect &r, uint32 col) override |
Public Member Functions inherited from OSystem | |
void | destroy () |
virtual void | init () |
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 const GraphicsMode * | getSupportedGraphicsModes () 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::PixelFormat > | getSupportedFormats () const |
virtual Common::Array< uint > | getSupportedAntiAliasingLevels () const |
virtual OpenGL::ContextType | getOpenGLType () const |
virtual bool | setShader (const Common::Path &fileName) |
virtual const GraphicsMode * | getSupportedStretchModes () 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 uint | getScaler () const |
virtual uint | getScaleFactor () const |
virtual void | initSizeHint (const Graphics::ModeList &modes) |
virtual float | getHiDPIScreenFactor () const |
virtual void | saveScreenshot () |
virtual bool | lockMouse (bool lock) |
virtual uint32 | getDoubleClickTime () const |
virtual Common::TimerManager * | getTimerManager () |
Common::EventManager * | getEventManager () |
AudioCDManager * | getAudioCDManager () |
virtual void | setWindowCaption (const Common::U32String &caption) |
virtual Common::SaveFileManager * | getSavefileManager () |
virtual Common::TextToSpeechManager * | getTextToSpeechManager () |
virtual Common::DialogManager * | getDialogManager () |
virtual DLC::Store * | getDLCStore () |
virtual FilesystemFactory * | getFilesystemFactory () |
virtual Common::SeekableReadStream * | createConfigReadStream () |
virtual Common::WriteStream * | createConfigWriteStream () |
virtual const char *const * | buildHelpDialogData () |
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 bool | isConnectionLimited () |
Public Member Functions inherited from PaletteManager | |
void | setPalette (const Graphics::Palette &pal, uint start=0) |
Graphics::Palette | grabPalette (uint start, uint num) |
Public Member Functions inherited from Common::EventObserver | |
virtual void | notifyPoll () |
Public Attributes | |
volatile bool | exiting |
volatile bool | sleeping |
PauseToken | _sleepPauseToken |
bool | _showCursor |
bool | _snapToBorder |
bool | _stretchToFit |
Screen | _screen |
Protected Attributes | |
Audio::MixerImpl * | _mixer |
Backends::Log::Log * | _logger |
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 |
|
virtual |
The following method is called once, from main.cpp, after all config data (including command line params etc.) is fully loaded.
Reimplemented from EventsBaseBackend.
|
virtual |
Determine whether the backend supports the specified feature.
Reimplemented from OSystem.
|
virtual |
Enable or disable the specified feature.
For example, this may be used to enable fullscreen mode or to deactivate aspect correction, etc.
Reimplemented from OSystem.
|
virtual |
Query the state of the specified feature.
For example, test whether fullscreen mode is active or not.
Reimplemented from OSystem.
|
overridevirtual |
Query an event from the source.
event | Reference to the event struct where the event should be stored. |
true | If an event was polled, false otherwise. |
Implements Common::EventSource.
|
overridevirtual |
Notify the observer of an incoming event.
An observer is supposed to 'eat' the event, with returning true, when it wants to prevent other observers from receiving the event. A usage example here is the keymapper: If it processes an Event, it should 'eat' it and create a new event, which the EventDispatcher will then catch.
event | The event that is incoming. |
true | If the event should not be passed to other observers, false otherwise. |
Implements Common::EventObserver.
|
overridevirtual |
Register hardware inputs with keymapper.
For more information, see keymapper.
Reimplemented from OSystem.
|
overridevirtual |
Return a platform-specific global keymap.
The caller will use and delete the return object.
For more information, see keymapper.
Reimplemented from OSystem.
|
overridevirtual |
Return platform-specific default keybindings.
For more information, see keymapper.
Reimplemented from OSystem.
|
overridevirtual |
Register the default values for the settings the backend uses into the configuration manager.
target | name of a config manager target |
Reimplemented from OSystem.
|
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.
boss | the widget / dialog the returned widget is a child of |
name | the name the returned widget must use |
target | name of a config manager target |
Reimplemented from OSystem.
|
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.
|
virtual |
Get the number of milliseconds since the program was started.
skipRecord | Skip 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.
|
virtual |
Delay/sleep for the specified amount of milliseconds.
Implements OSystem.
|
virtual |
Get the current time and date, in the local timezone.
On many systems, this corresponds to the combination of time() and localtime().
Implements OSystem.
|
virtual |
|
virtual |
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.
type | Type of the message. |
message | The message itself. |
Implements OSystem.
|
virtual |
|
inlinevirtual |
|
virtual |
Return the language of the system.
This returns the currently set language of the system on which ScummVM is run.
The format is an ISO 639 language code, optionally followed by an ISO 3166-1 country code in the form language_country.
For information about POSIX locales, see the following link: https://en.wikipedia.org/wiki/ISO_639 https://en.wikipedia.org/wiki/ISO_3166-1
The default implementation returns "en_US".
Reimplemented from OSystem.
|
virtual |
Signal that a fatal error inside the client code has occurred.
This should quit the application.
Reimplemented from OSystem.
|
virtual |
Quit (exit) the application.
Implements OSystem.
|
virtual |
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.
|
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.
s | SearchSet to which the system-specific dirs, if any, are added. |
priority | Priority with which those dirs are added. |
Reimplemented from OSystem.
|
virtual |
Set the size and color format of the virtual screen.
Typical sizes include:
This is the resolution for which the client code generates data. This is not necessarily equal to the actual display size. For example, a backend may magnify the graphics to fit on the screen (see also the GraphicsMode), stretch the data to perform aspect ratio correction, or shrink it to fit on small screens (in cell phones).
Typical formats include:
This is the pixel format for which the client code generates data. It is not necessarily equal to the hardware pixel format. For example, a backend may perform color lookup of 8-bit graphics before pushing a screen to hardware, or correct the ARGB color order.
width | New virtual screen width. |
height | New virtual screen height. |
format | New virtual screen pixel format. |
Implements OSystem.
|
inlinevirtual |
Return an int value that is changed whenever any screen parameters (like the resolution) change, i.e. whenever EVENT_SCREEN_CHANGED is sent.
You can track this value in your code to detect screen changes in case you do not have full control over the event loop(s) being used (like the GUI code).
Reimplemented from OSystem.
|
virtual |
Begin a new GFX transaction, which is a sequence of GFX mode changes.
The idea behind GFX transactions is to make it possible to activate several different GFX changes at once as a "batch" operation. For example, assume we are running in 320x200 with a 2x scaler (thus using 640x400 pixels in total). Now, we want to switch to 640x400 with the 1x scaler. Without transactions, we have to choose whether we want to first switch the scaler mode, or first to 640x400 mode. In either case, depending on the backend implementation, problems may occur. For example, the window might briefly switch to 320x200 or 1280x800. Using transactions, this can be avoided.
Reimplemented from OSystem.
|
virtual |
End (and thereby commit) the current GFX transaction.
Reimplemented from OSystem.
|
inlinevirtual |
|
inlinevirtual |
|
virtual |
Replace the specified range of the palette with new colors. The palette entries from 'start' till (start+num-1) will be replaced - so a full palette update is accomplished via start=0, num=256.
The palette data is specified in interleaved RGB format. That is, the first byte of the memory block 'colors' points at is the red component of the first new color; the second byte the green component of the first new color; the third byte the blue component, the last byte to the alpha (transparency) value. Then the second color starts, and so on. So memory looks like this: R1-G1-B1-R2-G2-B2-R3-...
colors | the new palette data, in interleaved RGB format |
start | the first palette entry to be updated |
num | the number of palette entries to be updated |
Implements PaletteManager.
|
virtual |
Grabs a specified part of the currently active palette. The format is the same as for setPalette.
This should return exactly the same RGB data as was setup via previous setPalette calls.
For example, for every valid value of start and num of the following code:
byte origPal[num*3]; // Setup origPal's data however you like g_system->setPalette(origPal, start, num); byte obtainedPal[num*3]; g_system->grabPalette(obtainedPal, start, num);
the following should be true:
memcmp(origPal, obtainedPal, num*3) == 0
colors | the palette data, in interleaved RGB format |
start | the first platte entry to be read |
num | the number of palette entries to be read |
Implements PaletteManager.
|
virtual |
Blit a bitmap to the virtual screen.
The real screen will not immediately be updated to reflect the changes. Client code must call updateScreen to ensure any changes are visible to the user. This can be used to optimize drawing and reduce flicker.
If the current pixel format has one byte per pixel, the graphics data uses 8 bits per pixel, using the palette specified via setPalette. If more than one byte per pixel is in use, the graphics data uses the pixel format returned by getScreenFormat.
buf | Buffer containing the graphics data source. |
pitch | Pitch of the buffer (number of bytes in a scanline). |
x | x coordinate of the destination rectangle. |
y | y coordinate of the destination rectangle. |
w | Width of the destination rectangle. |
h | Height of the destination rectangle. |
Implements OSystem.
|
virtual |
Lock the active screen framebuffer and return a Graphics::Surface representing it.
The caller can then perform arbitrary graphics transformations on the framebuffer (blitting, scrolling, etc.). Must be followed by a matching call to unlockScreen(). Code that is calling this should make sure to only lock the framebuffer for the shortest time possible, as the whole system is potentially stalled while the lock is active.
The returned surface must not be deleted by the client code.
Implements OSystem.
|
virtual |
Unlock the screen framebuffer, and mark it as dirty, i.e. during the next updateScreen() call, the whole screen will be updated.
Implements OSystem.
|
virtual |
Flush the whole screen, i.e. render the current content of the screen framebuffer to the display.
This method may be called very often by engines. Backends are hence supposed to only perform any redrawing if it is necessary and otherwise return immediately. See https://wiki.scummvm.org/index.php/HOWTO-Backends#updateScreen.28.29_method
Implements OSystem.
|
virtual |
Set current shake position, a feature needed for screen effects in some engines.
The effect causes the displayed graphics to be shifted downwards and rightwards by the specified offsets (the offsets can be negative to shift upwards or leftwards). The area at the border of the screen which is moved into view by this (for example at the bottom when moving upward) is filled with black. This does not cause any graphic data to be lost. To restore the original view, the game engine only has to call this method again with offset equal to zero. No calls to copyRectToScreen are necessary.
shakeXOffset | Shake x offset. |
shakeYOffset | Shake y offset. |
Implements OSystem.
|
virtual |
Set the area of the screen that has the focus.
For example, when a character is speaking, they will have the focus. This allows for pan-and-scan style views where the backend can follow the speaking character or area of interest on the screen.
The backend is responsible for clipping the rectangle and deciding how best to zoom the screen to show any shape and size rectangle the engine provides.
rect | Rectangle on the screen to be focused on. |
Reimplemented from OSystem.
|
virtual |
Clear the focus set by a call to setFocusRectangle().
This allows the engine to clear the focus when no particular area of the screen has the focus.
Reimplemented from OSystem.
|
virtual |
Activate the overlay mode.
Implements OSystem.
|
virtual |
Deactivate the overlay mode.
Implements OSystem.
|
inlinevirtual |
Return true if the overlay mode is activated, false otherwise.
Implements OSystem.
|
virtual |
Return the pixel format description of the overlay.
Implements OSystem.
|
virtual |
Reset the overlay.
After calling this method while the overlay mode is active, the user should be seeing only the game graphics. How this is achieved depends on how the backend implements the overlay. It either sets all pixels of the overlay to be transparent (when alpha blending is used) or, in case of fake alpha blending, it might just put a copy of the current game graphics screen into the overlay.
Implements OSystem.
|
virtual |
Copy the content of the overlay into a surface provided by the caller.
This is only used to implement fake alpha blending.
Implements OSystem.
|
virtual |
Blit a graphics buffer to the overlay.
In a sense, this is the reverse of grabOverlay.
buf | Buffer containing the graphics data source. |
pitch | Pitch of the buffer (number of bytes in a scanline). |
x | x coordinate of the destination rectangle. |
y | y coordinate of the destination rectangle. |
w | Width of the destination rectangle. |
h | Height of the destination rectangle. |
Implements OSystem.
|
virtual |
|
virtual |
|
overridevirtual |
Display a message in an 'on-screen display'.
Displays a message in such a way that it is visible on or near the screen, for example in a transparent rectangle over the regular screen content, or in a message box beneath it.
The message is expected to be provided in the current TranslationManager charset.
msg | The message to display on the screen. |
Reimplemented from BaseBackend.
|
overridevirtual |
Display an icon that indicates background activity.
The icon is displayed in an 'on-screen display'. It is visible above the regular screen content or near it.
The caller keeps ownership of the icon. It is acceptable to free the surface just after the call.
There is no preferred pixel format for the icon. The backend should convert its copy of the icon to an appropriate format.
The caller must call this method again with a null pointer as a parameter to indicate the icon should no longer be displayed.
icon | The icon to display on the screen. |
Reimplemented from BaseBackend.
|
virtual |
Show or hide the mouse cursor.
Currently, the backend is not required to immediately draw the mouse cursor on showMouse(true).
Implements OSystem.
|
virtual |
Move ("warp") the mouse cursor to the specified position in virtual screen coordinates.
x | New x position of the mouse. |
y | New y position of the mouse. |
Implements OSystem.
|
virtual |
Set the bitmap used for drawing the cursor.
buf | Pixmap data to be used. |
w | Width of the mouse cursor. |
h | Height of the mouse cursor. |
hotspotX | Horizontal offset from the left side to the hotspot. |
hotspotY | Vertical offset from the top side to the hotspot. |
keycolor | Transparency color value. This should not exceed the maximum color value of the specified format. In case it does, the behavior is undefined. The backend might just error out or simply ignore the value. (The SDL backend will just assert to prevent abuse of this). This parameter does nothing if a mask is provided. |
dontScale | Whether the cursor should never be scaled. An exception is high ppi displays, where the cursor might be too small to notice otherwise, these are allowed to scale the cursor anyway. |
format | Pointer to the pixel format that the cursor graphic uses (0 means CLUT8). |
mask | A mask containing values from the CursorMaskValue enum for each cursor pixel. |
Implements OSystem.
|
virtual |
Replace the specified range of cursor palette with new colors.
The palette entries from 'start' till (start+num-1) will be replaced - so a full palette update is accomplished via start=0, num=256.
Backends which implement this should have the kFeatureCursorPalette flag set.
Reimplemented from OSystem.