ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

Interface for ScummVM backends. More...

#include <system.h>

Inheritance diagram for OSystem:
Collaboration diagram for OSystem:

List of all members.

Classes

struct  GraphicsMode
 !!! Not used in ResidualVM !!! More...

Public Member Functions

void destroy ()
 Destoy this OSystem instance.
virtual void initBackend ()
 The following method is called once, from main.cpp, after all config data (including command line params etc.
bool backendInitialized () const
 Return false if initBackend() has not yet been called and true otherwise.
virtual void engineInit ()
 Allows the backend to perform engine specific init.
virtual void engineDone ()
 Allows the backend to perform engine specific de-init.
Overlay

In order to be able to display dialogs atop the game graphics, backends must provide an overlay mode.

The overlay is currently forced at 16 bpp.

For 'coolness' we usually want to have an overlay which is blended over the game graphics. On backends which support alpha blending, this is no issue; but on other systems this needs some trickery.

Essentially, we fake (alpha) blending on these systems by copying the current game graphics into the overlay buffer when activating the overlay, then manually compose whatever graphics we want to show in the overlay. This works because we assume the game to be "paused" whenever an overlay is active.

virtual void showOverlay ()=0
 Activate the overlay mode.
virtual void hideOverlay ()=0
 Deactivate the overlay mode.
virtual Graphics::PixelFormat getOverlayFormat () const =0
 Returns the pixel format description of the overlay.
virtual void clearOverlay ()=0
 Reset the overlay.
virtual void grabOverlay (void *buf, int pitch)=0
 Copy the content of the overlay into a buffer provided by the caller.
virtual void copyRectToOverlay (const void *buf, int pitch, int x, int y, int w, int h)=0
 Blit a graphics buffer to the overlay.
virtual int16 getOverlayHeight ()=0
 Return the height of the overlay.
virtual int16 getOverlayWidth ()=0
 Return the width of the overlay.
Mouse

This is the lower level implementation as provided by the backends.

The engines should use the Graphics::CursorManager class instead of using it directly.

virtual bool showMouse (bool visible)=0
 Show or hide the mouse cursor.
virtual bool lockMouse (bool lock)=0
 Lock or unlock the mouse cursor within the window.
virtual void warpMouse (int x, int y)=0
 Move ("warp") the mouse cursor to the specified position in virtual screen coordinates.
virtual void setMouseCursor (const void *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, bool dontScale=false, const Graphics::PixelFormat *format=nullptr)=0
 !!! Not used in ResidualVM !!!
virtual void setCursorPalette (const byte *colors, uint start, uint num)
 !!! Not used in ResidualVM !!!
Events and Time

virtual uint32 getMillis (bool skipRecord=false)=0
 Get the number of milliseconds since the program was started.
virtual void delayMillis (uint msecs)=0
 Delay/sleep for the specified amount of milliseconds.
virtual void getTimeAndDate (TimeDate &t) const =0
 Get the current time and date, in the local timezone.
virtual Common::TimerManagergetTimerManager ()
 Return the timer manager singleton.
Common::EventManagergetEventManager ()
 Return the event manager singleton.
Sound

virtual Audio::MixergetMixer ()=0
 Return the audio mixer.
Audio CD

AudioCDManagergetAudioCDManager ()
 Return the audio cd manager.
Miscellaneous

virtual void quit ()=0
 Quit (exit) the application.
virtual void fatalError ()
 Signals that a fatal error inside the client code has happened.
virtual void setWindowCaption (const char *caption)
 Set a window caption or any other comparable status display to the given value.
virtual void displayMessageOnOSD (const char *msg)=0
 !!! Not used in ResidualVM !!!
virtual void displayActivityIconOnOSD (const Graphics::Surface *icon)=0
 Display an icon indicating background activity.
virtual Common::SaveFileManagergetSavefileManager ()
 Return the SaveFileManager, used to store and load savestates and other modifiable persistent game data.
virtual FilesystemFactorygetFilesystemFactory ()
 Returns the FilesystemFactory object, depending on the current architecture.
virtual void addSysArchivesToSearchSet (Common::SearchSet &s, int priority=0)
 Add system specific Common::Archive objects to the given SearchSet.
virtual
Common::SeekableReadStream
createConfigReadStream ()
 Open the default config file for reading, by returning a suitable ReadStream instance.
virtual Common::WriteStreamcreateConfigWriteStream ()
 Open the default config file for writing, by returning a suitable WriteStream instance.
virtual Common::String getDefaultConfigFileName ()
 Get the default file name (or even path) where the user configuration of ScummVM will be saved.
virtual void logMessage (LogMessageType::Type type, const char *message)=0
 Logs a given message.
virtual bool displayLogFile ()
 Open the log file in a way that allows the user to review it, and possibly email it (or parts of it) to the ScummVM team, e.g.
virtual bool hasTextInClipboard ()
 Returns whether there is text available in the clipboard.
virtual Common::String getTextFromClipboard ()
 Returns clipboard contents as a String.
virtual bool setTextInClipboard (const Common::String &text)
 Set the content of the clipboard to the given string.
virtual bool openUrl (const Common::String &url)
 Open the given Url in the default browser (if available on the target system).
virtual Common::String getSystemLanguage () const
 Returns the locale of the system.
virtual bool isConnectionLimited ()
 Returns whether connection's limited (if available on the target system).

Protected Member Functions

 OSystem ()
virtual ~OSystem ()

Feature flags



enum  Feature {
  kFeatureFullscreenMode, kFeatureAspectRatioCorrection, kFeatureFilteringMode, kFeatureStretchMode,
  kFeatureVirtualKeyboard, kFeatureCursorPalette, kFeatureOverlaySupportsAlpha, kFeatureIconifyWindow,
  kFeatureDisableKeyFiltering, kFeatureOpenGL, kFeatureSideTextures, kFeatureVSync,
  kFeatureFullscreenToggleKeepsContext, kFeatureDisplayLogFile, kFeatureClipboardSupport, kFeatureOpenUrl,
  kFeatureOnScreenControl, kFeatureTouchpadMode, kFeatureSwapMenuAndBackButtons, kFeatureKbdMouseSpeed,
  kFeatureJoystickDeadzone, kFeatureShader, kFeatureSystemBrowserDialog
}
 

A feature in this context means an ability of the backend which can be either on or off.

More...
virtual bool hasFeature (Feature f)
 Determine whether the backend supports the specified feature.
virtual void setFeatureState (Feature f, bool enable)
 En-/disable the specified feature.
virtual bool getFeatureState (Feature f)
 Query the state of the specified feature.

Graphics

The way graphics work in the class OSystem are meant to make it possible for game frontends to implement all they need in an efficient manner.

The downside of this is that it may be rather complicated for backend authors to fully understand and implement the semantics of the OSystem interface.

!!! Below description not apply for ResidualVM !!!

The graphics visible to the user in the end are actually composed in three layers: the game graphics, the overlay graphics, and the mouse.

First, there are the game graphics. The methods in this section deal with them exclusively. In particular, the size of the game graphics is defined by a call to initSize(), and copyRectToScreen() blits the data in the current pixel format into the game layer. Let W and H denote the width and height of the game graphics.

Before the user sees these graphics, the backend may apply some transformations to it; for example, the may be scaled to better fit on the visible screen; or aspect ratio correction may be performed (see kFeatureAspectRatioCorrection). As a result of this, a pixel of the game graphics may occupy a region bigger than a single pixel on the screen. We define p_w and p_h to be the width resp. height of a game pixel on the screen.

In addition, there is a vertical "shake offset" (as defined by setShakePos) which is used in some games to provide a shaking effect. Note that shaking is applied to all three layers, i.e. also to the overlay and the mouse. We denote the shake offset by S.

Putting this together, a pixel (x,y) of the game graphics is transformed to a rectangle of height p_h and width p_w appearing at position (p_w * x, p_hw * (y + S)) on the real screen (in addition, a backend may choose to offset everything, e.g. to center the graphics on the screen).

The next layer is the overlay. It is composed over the game graphics. Historically the overlay size had always been a multiple of the game resolution, for example when the game resolution was 320x200 and the user selected a 2x scaler and did not enable aspect ratio correction it had a size of 640x400. An exception was the aspect ratio correction, which did allow for non multiples of the vertical resolution of the game screen. Nowadays the overlay size does not need to have any relation to the game resolution though, for example the overlay resolution might be the same as the physical screen resolution. The overlay is forced to a 16bpp mode right now.

Finally, there is the mouse layer. This layer doesn't have to actually exist within the backend -- it all depends on how a backend chooses to implement mouse cursors, but in the default SDL backend, it really is a separate layer. The mouse can have a palette of its own, if the backend supports it.

On a note for OSystem users here. We do not require our graphics to be thread safe and in fact most/all backends using OpenGL are not. So do *not* try to call any of these functions from a timer and/or audio callback (like readBuffer of AudioStreams).



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)
}
 

!!! Not used in ResidualVM !!!

More...
virtual const GraphicsModegetSupportedGraphicsModes () const =0
 !!! Not used in ResidualVM !!!
virtual int getDefaultGraphicsMode () const =0
 !!! Not used in ResidualVM !!!
virtual bool setGraphicsMode (int mode)=0
 !!! Not used in ResidualVM !!!
bool setGraphicsMode (const char *name)
 !!! Not used in ResidualVM !!!
virtual int getGraphicsMode () const =0
 !!! Not used in ResidualVM !!!
virtual void resetGraphicsScale ()
 !!! Not used in ResidualVM !!!
virtual Graphics::PixelFormat getScreenFormat () const =0
 !!! Not used in ResidualVM !!!
virtual Common::List
< Graphics::PixelFormat
getSupportedFormats () const =0
 !!! Not used in ResidualVM !!!
virtual Common::Array< uintgetSupportedAntiAliasingLevels () const
 !!! ResidualVM specific method !!!
virtual const GraphicsModegetSupportedShaders () const
 !!! Not used in ResidualVM !!!
virtual bool setShader (int id)
 !!! Not used in ResidualVM !!!
virtual int getShader () const
 Determine which shader is currently active.
virtual const GraphicsModegetSupportedStretchModes () const
 Retrieve a list of all stretch modes supported by this backend.
virtual int getDefaultStretchMode () const
 Return the ID of the 'default' stretch mode.
virtual bool setStretchMode (int mode)
 Switch to the specified stretch mode.
bool setStretchMode (const char *name)
 Switch to the stretch mode with the given name.
virtual int getStretchMode () const
 Determine which stretch mode is currently active.
virtual void initSize (uint width, uint height, const Graphics::PixelFormat *format=nullptr)=0
 Set the size and color format of the virtual screen.
virtual void initSizeHint (const Graphics::ModeList &modes)
 Send a list of graphics modes to the backend so it can make a decision about the best way to set up the display hardware.
virtual void launcherInitSize (uint width, uint height)=0
 !!! ResidualVM specific method !!! Set the size of the launcher virtual screen.
virtual int getScreenChangeID () const
 !!! Not used in ResidualVM !!!
virtual void beginGFXTransaction ()
 !!! Not used in ResidualVM !!!
virtual TransactionError endGFXTransaction ()
 !!! Not used in ResidualVM !!!
virtual void setupScreen (uint screenW, uint screenH, bool fullscreen, bool accel3d)=0
 Set the size of the screen.
virtual Graphics::PixelBuffer getScreenPixelBuffer ()=0
 Return a Graphics::PixelBuffer representing the framebuffer.
virtual void suggestSideTextures (Graphics::Surface *left, Graphics::Surface *right)
 Suggest textures to render at the side of the game window.
virtual int16 getHeight ()=0
 Returns the currently set virtual screen height.
virtual int16 getWidth ()=0
 Returns the currently set virtual screen width.
virtual PaletteManagergetPaletteManager ()=0
 !!! Not used in ResidualVM !!!
virtual void copyRectToScreen (const void *buf, int pitch, int x, int y, int w, int h)=0
 !!! Not used in ResidualVM !!!
virtual Graphics::SurfacelockScreen ()=0
 !!! Not used in ResidualVM !!!
virtual void unlockScreen ()=0
 Unlock the screen framebuffer, and mark it as dirty (i.e.
virtual void fillScreen (uint32 col)=0
 Fills the screen with a given color value.
virtual void updateScreen ()=0
 Flush the whole screen, that is render the current content of the screen framebuffer to the display.
virtual void setShakePos (int shakeOffset)=0
 !!! Not used in ResidualVM !!!
virtual void setFocusRectangle (const Common::Rect &rect)
 !!! Not used in ResidualVM !!!
virtual void clearFocusRectangle ()
 Clears the focus set by a call to setFocusRectangle().
virtual void saveScreenshot ()
 !!! ResidualVM specific method !!! Instruct the backend to capture a screenshot of the current screen.

Mutex handling

Historically, the OSystem API used to have a method which allowed creating threads.

Hence mutex support was needed for thread syncing. To ease portability, though, we decided to remove the threading API. Instead, we now use timers (see setTimerCallback() and Common::Timer). But since those may be implemented using threads (and in fact, that's how our primary backend, the SDL one, does it on many systems), we still have to do mutex syncing in our timer callbacks. In addition, the sound mixer uses a mutex in case the backend runs it from a dedicated thread (as e.g. the SDL backend does).

Hence backends which do not use threads to implement the timers simply can use dummy implementations for these methods.



typedef struct OpaqueMutex * MutexRef
virtual MutexRef createMutex ()=0
 Create a new mutex.
virtual void lockMutex (MutexRef mutex)=0
 Lock the given mutex.
virtual void unlockMutex (MutexRef mutex)=0
 Unlock the given mutex.
virtual void deleteMutex (MutexRef mutex)=0
 Delete the given mutex.

Module slots

For backend authors only, the following pointers (= "slots) to various subsystem managers / factories / etc.

can and should be set to a suitable instance of the respective type.

For some of the slots, a default instance is set if your backend does not do so. For details, please look at the documentation of each slot.

A backend may setup slot values in its initBackend() method, its constructor or somewhere in between. But it must a slot's value no later than in its initBackend() implementation, because OSystem::initBackend() will create any default instances if none has been set yet (and for other slots, will verify that one has been set; if not, an error may be generated).



AudioCDManager_audiocdManager
 No default value is provided for _audiocdManager by OSystem.
Common::EventManager_eventManager
 No default value is provided for _eventManager by OSystem.
Common::TimerManager_timerManager
 No default value is provided for _timerManager by OSystem.
Common::SaveFileManager_savefileManager
 No default value is provided for _savefileManager by OSystem.
FilesystemFactory_fsFactory
 No default value is provided for _fsFactory by OSystem.
bool _backendInitialized
 Indicate if initBackend() has been called.

Detailed Description

Interface for ScummVM backends.

If you want to port ScummVM to a system which 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, to handle user input events, control audio CD playback, and sound output.

Definition at line 111 of file system.h.


Member Typedef Documentation

typedef struct OpaqueMutex* OSystem::MutexRef

Definition at line 1314 of file system.h.


Member Enumeration Documentation

A feature in this context means an ability of the backend which can be either on or off.

Examples include:

  • fullscreen mode
  • aspect ration correction
  • a virtual keyboard for text entry (on PDAs)

One has to distinguish between the *availability* of a feature, which can be checked using hasFeature(), and its *state*. For example, the SDL backend *has* the kFeatureFullscreenMode, so hasFeature returns true for it. On the other hand, fullscreen mode may be active or not; this can be determined by checking the state via getFeatureState(). Finally, to switch between fullscreen and windowed mode, use setFeatureState().

Enumerator:
kFeatureFullscreenMode 

If supported, this feature flag can be used to switch between windowed and fullscreen mode.

kFeatureAspectRatioCorrection 

Control aspect ratio correction.

Aspect ratio correction is used to correct games running at 320x200 (i.e with an aspect ratio of 8:5), but which on their original hardware were displayed with the standard 4:3 ratio (that is, the original graphics used non-square pixels). When the backend support this, then games running at 320x200 pixels should be scaled up to 320x240 pixels. For all other resolutions, ignore this feature flag.

Note:
Backend implementors can find utility functions in common/scaler.h which can be used to implement aspect ratio correction. In stretch200To240() can stretch a rect, including (very fast) particular, interpolation, and works in-place.
kFeatureFilteringMode 

If supported this flag can be used to switch between unfiltered and filtered graphics modes.

kFeatureStretchMode 

Indicate if stretch modes are supported by the backend.

kFeatureVirtualKeyboard 

Determine whether a virtual keyboard is to be shown or not.

This would mostly be implemented by backends for hand held devices, like PocketPC, Palms, Symbian phones like the P800, Zaurus, etc.

kFeatureCursorPalette 

Backends supporting this feature allow specifying a custom palette for the cursor.

The custom palette is used if the feature state is set to true by the client code via setFeatureState().

It is currently used only by some Macintosh versions of Humongous Entertainment games. If the backend doesn't implement this feature then the engine switches to b/w versions of cursors. The GUI also relies on this feature for mouse cursors.

kFeatureOverlaySupportsAlpha 

A backend have this feature if its overlay pixel format has an alpha channel which offers at least 3-4 bits of accuracy (as opposed to just a single alpha bit).

This feature has no associated state.

kFeatureIconifyWindow 

Client code can set the state of this feature to true in order to iconify the application window.

kFeatureDisableKeyFiltering 

Setting the state of this feature to true tells the backend to disable all key filtering/mapping, in cases where it would be beneficial to do so.

As an example case, this is used in the AGI engine's predictive dialog. When the dialog is displayed this feature is set so that backends with phone-like keypad temporarily unmap all user actions which leads to comfortable word entry. Conversely, when the dialog exits the feature is set to false.

TODO: The word 'beneficial' above is very unclear. Beneficial to whom and for what??? Just giving an example is not enough.

TODO: Fingolfin suggests that the way the feature is used can be generalized in this sense: Have a keyboard mapping feature, which the engine queries for to assign keys to actions ("Here's my default key map for these actions, what do you want them set to?").

kFeatureOpenGL 
kFeatureSideTextures 
kFeatureVSync 

If supported, this feature flag can be used to check if waiting for vertical sync before refreshing the screen to reduce tearing is enabled.

ResidualVM specific

kFeatureFullscreenToggleKeepsContext 

When a backend supports this feature, it guarantees the graphics context is not destroyed when switching to and from fullscreen.

For OpenGL that means the context is kept with all of its content: texture, programs...

For TinyGL that means the backbuffer surface is kept.

ResidualVM specific

kFeatureDisplayLogFile 

The presence of this feature indicates whether the displayLogFile() call is supported.

This feature has no associated state.

kFeatureClipboardSupport 

The presence of this feature indicates whether the hasTextInClipboard(), getTextFromClipboard() and setTextInClipboard() calls are supported.

This feature has no associated state.

kFeatureOpenUrl 

The presence of this feature indicates whether the openUrl() call is supported.

This feature has no associated state.

kFeatureOnScreenControl 

show on-screen control

kFeatureTouchpadMode 

mouse emulation mode

kFeatureSwapMenuAndBackButtons 

swap menu and back buttons

kFeatureKbdMouseSpeed 

keyboard mouse and joystick mouse speed

kFeatureJoystickDeadzone 

change analog joystick deadzone

kFeatureShader 

shaders

kFeatureSystemBrowserDialog 

Supports for using the native system file browser dialog through the DialogManager.

Definition at line 270 of file system.h.

!!! Not used in ResidualVM !!!

This type is able to save the different errors which can happen while changing GFX config values inside GFX transactions.

endGFXTransaction returns a ORed combination of the '*Failed' values if any problem occures, on success 0.

See also:
endGFXTransaction
Enumerator:
kTransactionSuccess 

Everything fine (use EQUAL check for this one!).

kTransactionAspectRatioFailed 

Failed switching aspect ratio correction mode.

kTransactionFullscreenFailed 

Failed switching fullscreen mode.

kTransactionModeSwitchFailed 

Failed switching the GFX graphics mode (setGraphicsMode).

kTransactionSizeChangeFailed 

Failed switching the screen dimensions (initSize).

kTransactionFormatNotSupported 

Failed setting the color format.

kTransactionFilteringFailed 

Failed setting the filtering mode.

kTransactionStretchModeSwitchFailed 

Failed setting the stretch mode.

Definition at line 862 of file system.h.


Constructor & Destructor Documentation

OSystem::OSystem (  )  [protected]

Definition at line 41 of file system.cpp.

OSystem::~OSystem (  )  [protected, virtual]

Definition at line 59 of file system.cpp.


Member Function Documentation

virtual void OSystem::addSysArchivesToSearchSet ( Common::SearchSet s,
int  priority = 0 
) [inline, virtual]

Add system specific Common::Archive objects to the given SearchSet.

E.g. on Unix the dir corresponding to DATA_PATH (if set), or on Mac OS X the 'Resource' dir in the app bundle.

Todo:
Come up with a better name. This one sucks.
Parameters:
s the SearchSet to which the system specific dirs, if any, are added
priority the priority with which those dirs are added

Reimplemented in OSystem_MacOSX, OSystem_POSIX, OSystem_SDL, and OSystem_Win32.

Definition at line 1499 of file system.h.

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.

Definition at line 238 of file system.h.

virtual void OSystem::beginGFXTransaction (  )  [inline, virtual]

!!! Not used in ResidualVM !!!

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, some ugliness may result. E.g. the window might briefly switch to 320x200 or 1280x800. Using transactions, this can be avoided.

Note:
Transaction support is optional, and the default implementations of the relevant methods simply do nothing.
See also:
endGFXTransaction

Reimplemented in ModularBackend.

Definition at line 849 of file system.h.

virtual void OSystem::clearFocusRectangle (  )  [inline, virtual]

Clears the focus set by a call to setFocusRectangle().

This allows the engine to clear the focus during times when no particular area of the screen has the focus.

See also:
setFocusRectangle

Reimplemented in ModularBackend.

Definition at line 1053 of file system.h.

virtual void OSystem::clearOverlay (  )  [pure 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. Either it 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.

Implemented in ModularBackend.

virtual void OSystem::copyRectToOverlay ( const void *  buf,
int  pitch,
int  x,
int  y,
int  w,
int  h 
) [pure virtual]

Blit a graphics buffer to the overlay.

In a sense, this is the reverse of grabOverlay.

Parameters:
buf the buffer containing the graphics data source
pitch the pitch of the buffer (number of bytes in a scanline)
x the x coordinate of the destination rectangle
y the y coordinate of the destination rectangle
w the width of the destination rectangle
h the height of the destination rectangle
See also:
copyRectToScreen
grabOverlay

Implemented in ModularBackend.

virtual void OSystem::copyRectToScreen ( const void *  buf,
int  pitch,
int  x,
int  y,
int  w,
int  h 
) [pure virtual]

!!! Not used in ResidualVM !!!

Blit a bitmap to the virtual screen. The real screen will not immediately be updated to reflect the changes. Client code has to to 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.

Parameters:
buf the buffer containing the graphics data source
pitch the pitch of the buffer (number of bytes in a scanline)
x the x coordinate of the destination rectangle
y the y coordinate of the destination rectangle
w the width of the destination rectangle
h the height of the destination rectangle
Note:
The specified destination rectangle must be completly contained in the visible screen space, and must be non-empty. If not, a backend may or may not perform clipping, trigger an assert or silently corrupt memory.
See also:
updateScreen
getScreenFormat

Implemented in ModularBackend.

Common::SeekableReadStream * OSystem::createConfigReadStream (  )  [virtual]

Open the default config file for reading, by returning a suitable ReadStream instance.

It is the callers responsiblity to delete the stream after use.

Definition at line 174 of file system.cpp.

Common::WriteStream * OSystem::createConfigWriteStream (  )  [virtual]

Open the default config file for writing, by returning a suitable WriteStream instance.

It is the callers responsiblity to delete the stream after use.

May return 0 to indicate that writing to config file is not possible.

Definition at line 179 of file system.cpp.

virtual MutexRef OSystem::createMutex (  )  [pure virtual]

Create a new mutex.

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

Implemented in ModularBackend.

virtual void OSystem::delayMillis ( uint  msecs  )  [pure virtual]

Delay/sleep for the specified amount of milliseconds.

Implemented in OSystem_SDL.

virtual void OSystem::deleteMutex ( MutexRef  mutex  )  [pure virtual]

Delete the given mutex.

Make sure the mutex is unlocked before you delete it. If you delete a locked mutex, the behavior is undefined, in particular, your program may crash.

Parameters:
mutex the mutex to delete.

Implemented in ModularBackend.

void OSystem::destroy (  ) 

Destoy this OSystem instance.

Definition at line 115 of file system.cpp.

virtual void OSystem::displayActivityIconOnOSD ( const Graphics::Surface icon  )  [pure virtual]

Display an icon indicating 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.

Parameters:
icon the icon to display on screen

Implemented in BaseBackend, and ModularBackend.

virtual bool OSystem::displayLogFile (  )  [inline, virtual]

Open the log file in a way that allows the user to review it, and possibly email it (or parts of it) to the ScummVM team, e.g.

as part of a bug report.

On a desktop operating system, this would typically launch some kind of (external) text editor / viewer. On a phone, it might also cause a context switch to another application. Finally, on some ports, it might not be supported at all, and so do nothing.

The kFeatureDisplayLogFile feature flag can be used to test whether this call has been implemented by the active backend.

Returns:
true if all seems to have gone fine, false if an error occurred
Note:
An error could mean that the log file did not exist, or the editor could not launch. However, a return value of true does not guarantee that the user actually will see the log file.
It is up to the backend to ensure that the system is in a state that allows the user to actually see the displayed log files. This might for example require leaving fullscreen mode.

Reimplemented in OSystem_MacOSX, OSystem_POSIX, and OSystem_Win32.

Definition at line 1563 of file system.h.

virtual void OSystem::displayMessageOnOSD ( const char *  msg  )  [pure virtual]

!!! Not used in ResidualVM !!!

Display a message in an 'on screen display'. That is, display it in a fashion where it is visible on or near the screen (e.g. in a transparent rectangle over the regular screen content; or in a message box beneath it; etc.).

The message is expected to be provided in the current TranslationManager charset.

Note:
There is a default implementation in BaseBackend which uses a TimedMessageDialog to display the message. Hence implementing this is optional.
Parameters:
msg the message to display on screen

Implemented in BaseBackend, and ModularBackend.

virtual TransactionError OSystem::endGFXTransaction (  )  [inline, virtual]

!!! Not used in ResidualVM !!!

End (and thereby commit) the current GFX transaction.

See also:
beginGFXTransaction
kTransactionError
Returns:
returns a ORed combination of TransactionError values or 0 on success

Reimplemented in ModularBackend.

Definition at line 881 of file system.h.

virtual void OSystem::engineDone (  )  [inline, virtual]

Allows the backend to perform engine specific de-init.

Called after the engine finishes.

Reimplemented in OSystem_SDL.

Definition at line 250 of file system.h.

virtual void OSystem::engineInit (  )  [inline, virtual]

Allows the backend to perform engine specific init.

Called just before the engine is run.

Reimplemented in OSystem_SDL.

Definition at line 244 of file system.h.

void OSystem::fatalError (  )  [virtual]

Signals that a fatal error inside the client code has happened.

This should quit the application.

Reimplemented in OSystem_SDL.

Definition at line 164 of file system.cpp.

virtual void OSystem::fillScreen ( uint32  col  )  [pure virtual]

Fills the screen with a given color value.

!!! Not used in ResidualVM !!!

Note:
We are using uint32 here even though currently we only support 8bpp indexed mode. Thus the value should be always inside [0, 255] for now.

Implemented in BaseBackend, and ModularBackend.

AudioCDManager* OSystem::getAudioCDManager (  )  [inline]

Return the audio cd manager.

For more information, refer to the AudioCDManager documentation.

Definition at line 1372 of file system.h.

Common::String OSystem::getDefaultConfigFileName (  )  [virtual]

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

Note that not all ports may use this.

Reimplemented in OSystem_POSIX, OSystem_PS3, OSystem_RISCOS, and OSystem_Win32.

Definition at line 188 of file system.cpp.

virtual int OSystem::getDefaultGraphicsMode (  )  const [pure virtual]

!!! Not used in ResidualVM !!!

Return the ID of the 'default' graphics mode. What exactly this means is up to the backend. This mode is set by the client code when no user overrides are present (i.e. if no custom graphics mode is selected via the command line or a config file).

Returns:
the ID of the 'default' graphics mode

Implemented in ModularBackend.

virtual int OSystem::getDefaultStretchMode (  )  const [inline, virtual]

Return the ID of the 'default' stretch mode.

What exactly this means is up to the backend. This mode is set by the client code when no user overrides are present (i.e. if no custom stretch mode is selected via the command line or a config file).

Returns:
the ID of the 'default' graphics mode

Reimplemented in ModularBackend.

Definition at line 735 of file system.h.

Common::EventManager* OSystem::getEventManager (  )  [inline]

Return the event manager singleton.

For more information, refer to the EventManager documentation.

Definition at line 1253 of file system.h.

virtual bool OSystem::getFeatureState ( Feature  f  )  [inline, virtual]

Query the state of the specified feature.

For example, test whether fullscreen mode is active or not.

Reimplemented in ModularBackend.

Definition at line 460 of file system.h.

FilesystemFactory * OSystem::getFilesystemFactory (  )  [virtual]

Returns the FilesystemFactory object, depending on the current architecture.

Returns:
the FSNode factory for the current architecture

Definition at line 169 of file system.cpp.

virtual int OSystem::getGraphicsMode (  )  const [pure virtual]

!!! Not used in ResidualVM !!!

Determine which graphics mode is currently active.

Returns:
the ID of the active graphics mode

Implemented in ModularBackend.

virtual int16 OSystem::getHeight (  )  [pure virtual]

Returns the currently set virtual screen height.

See also:
initSize
Returns:
the currently set virtual screen height

Implemented in ModularBackend.

virtual uint32 OSystem::getMillis ( bool  skipRecord = false  )  [pure virtual]

Get the number of milliseconds since the program was started.

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

Implemented in OSystem_SDL.

virtual Audio::Mixer* OSystem::getMixer (  )  [pure virtual]

Return the audio mixer.

For more information, refer to the Audio::Mixer documentation.

Implemented in ModularBackend, and OSystem_SDL.

virtual Graphics::PixelFormat OSystem::getOverlayFormat (  )  const [pure virtual]

Returns the pixel format description of the overlay.

See also:
Graphics::PixelFormat

Implemented in ModularBackend.

virtual int16 OSystem::getOverlayHeight (  )  [pure virtual]

Return the height of the overlay.

See also:
getHeight

Implemented in ModularBackend.

virtual int16 OSystem::getOverlayWidth (  )  [pure virtual]

Return the width of the overlay.

See also:
getWidth

Implemented in ModularBackend.

virtual PaletteManager* OSystem::getPaletteManager (  )  [pure virtual]

!!! Not used in ResidualVM !!!

Return the palette manager singleton. For more information, refer to the PaletteManager documentation.

Implemented in ModularBackend.

Common::SaveFileManager * OSystem::getSavefileManager (  )  [virtual]

Return the SaveFileManager, used to store and load savestates and other modifiable persistent game data.

For more information, refer to the SaveFileManager documentation.

Reimplemented in OSystem_SDL.

Definition at line 205 of file system.cpp.

virtual int OSystem::getScreenChangeID (  )  const [inline, virtual]

!!! Not used in ResidualVM !!!

Return an int value which is changed whenever any screen parameters (like the resolution) change. That is, whenever a EVENT_SCREEN_CHANGED would be 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).

Returns:
an integer which can be used to track screen changes
Note:
Backends which generate EVENT_SCREEN_CHANGED events MUST overload this method appropriately.

Reimplemented in ModularBackend.

Definition at line 829 of file system.h.

virtual Graphics::PixelFormat OSystem::getScreenFormat (  )  const [pure virtual]

!!! Not used in ResidualVM !!!

Determine the pixel format currently in use for screen rendering.

Returns:
the active screen pixel format.
See also:
Graphics::PixelFormat

Implemented in ModularBackend.

virtual Graphics::PixelBuffer OSystem::getScreenPixelBuffer (  )  [pure virtual]

Return a Graphics::PixelBuffer representing the framebuffer.

The caller can then perform arbitrary graphics transformations on the framebuffer (blitting, scrolling, etc.). !!! ResidualVM specific method: !!!

Implemented in ModularBackend.

virtual int OSystem::getShader (  )  const [inline, virtual]

Determine which shader is currently active.

Returns:
the ID of the active shader

Reimplemented in ModularBackend.

Definition at line 713 of file system.h.

virtual int OSystem::getStretchMode (  )  const [inline, virtual]

Determine which stretch mode is currently active.

Returns:
the ID of the active stretch mode

Reimplemented in ModularBackend.

Definition at line 762 of file system.h.

virtual Common::Array<uint> OSystem::getSupportedAntiAliasingLevels (  )  const [inline, virtual]

!!! ResidualVM specific method !!!

Retrieve a list of supported levels of anti-aliasting. Anti-aliasing only works when using one of the hardware accelerated renderers. An empty list means anti-aliasing is not supported.

Reimplemented in OSystem_SDL.

Definition at line 679 of file system.h.

virtual Common::List<Graphics::PixelFormat> OSystem::getSupportedFormats (  )  const [pure virtual]

!!! Not used in ResidualVM !!!

Returns a list of all pixel formats supported by the backend. The first item in the list must be directly supported by hardware, and provide the largest color space of those formats with direct hardware support. It is also strongly recommended that remaining formats should be placed in order of descending preference for the backend to use.

EG: a backend that supports 32-bit ABGR and 16-bit 555 BGR in hardware and provides conversion from equivalent RGB(A) modes should order its list 1) Graphics::PixelFormat(4, 0, 0, 0, 0, 0, 8, 16, 24) 2) Graphics::PixelFormat(2, 3, 3, 3, 8, 0, 5, 10, 0) 3) Graphics::PixelFormat(4, 0, 0, 0, 0, 24, 16, 8, 0) 4) Graphics::PixelFormat(2, 3, 3, 3, 8, 10, 5, 0, 0) 5) Graphics::PixelFormat::createFormatCLUT8()

See also:
Graphics::PixelFormat
Note:
Backends supporting RGB color should accept game data in RGB color order, even if hardware uses BGR or some other color order.

Implemented in ModularBackend.

virtual const GraphicsMode* OSystem::getSupportedGraphicsModes (  )  const [pure virtual]

!!! Not used in ResidualVM !!!

Retrieve a list of all graphics modes supported by this backend. This can be both video modes as well as graphic filters/scalers; it is completely up to the backend maintainer to decide what is appropriate here and what not. The list is terminated by an all-zero entry.

Returns:
a list of supported graphics modes

Implemented in ModularBackend.

virtual const GraphicsMode* OSystem::getSupportedShaders (  )  const [inline, virtual]

!!! Not used in ResidualVM !!!

Retrieve a list of all hardware shaders supported by this backend. This can be only hardware shaders. it is completely up to the backend maintainer to decide what is appropriate here and what not. The list is terminated by an all-zero entry.

Returns:
a list of supported shaders

Reimplemented in ModularBackend.

Definition at line 693 of file system.h.

virtual const GraphicsMode* OSystem::getSupportedStretchModes (  )  const [inline, virtual]

Retrieve a list of all stretch modes supported by this backend.

It is completely up to the backend maintainer to decide what is appropriate here and what not. The list is terminated by an all-zero entry.

Returns:
a list of supported stretch modes

Reimplemented in ModularBackend.

Definition at line 722 of file system.h.

Common::String OSystem::getSystemLanguage (  )  const [virtual]

Returns the locale of the system.

This returns the currently set up locale of the system, on which ScummVM is run.

The format of the locale is language_country. These should match the POSIX locale values.

For information about POSIX locales read here: http://en.wikipedia.org/wiki/Locale#POSIX-type_platforms

The default implementation returns "en_US".

Returns:
locale of the system

Reimplemented in OSystem_MacOSX, OSystem_SDL, and OSystem_Win32.

Definition at line 192 of file system.cpp.

virtual Common::String OSystem::getTextFromClipboard (  )  [inline, virtual]

Returns clipboard contents as a String.

The kFeatureClipboardSupport feature flag can be used to test whether this call has been implemented by the active backend.

Returns:
clipboard contents ("" if hasTextInClipboard() == false)

Reimplemented in OSystem_MacOSX, and OSystem_SDL.

Definition at line 1585 of file system.h.

virtual void OSystem::getTimeAndDate ( TimeDate t  )  const [pure virtual]

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

Corresponds on many systems to the combination of time() and localtime().

Implemented in OSystem_SDL.

Common::TimerManager * OSystem::getTimerManager (  )  [virtual]

Return the timer manager singleton.

For more information, refer to the TimerManager documentation.

Reimplemented in OSystem_SDL.

Definition at line 201 of file system.cpp.

virtual int16 OSystem::getWidth (  )  [pure virtual]

Returns the currently set virtual screen width.

See also:
initSize
Returns:
the currently set virtual screen width

Implemented in ModularBackend.

virtual void OSystem::grabOverlay ( void *  buf,
int  pitch 
) [pure virtual]

Copy the content of the overlay into a buffer provided by the caller.

This is only used to implement fake alpha blending.

Implemented in ModularBackend.

virtual bool OSystem::hasFeature ( Feature  f  )  [inline, virtual]

Determine whether the backend supports the specified feature.

Reimplemented in ModularBackend, OSystem_MacOSX, OSystem_POSIX, OSystem_RISCOS, OSystem_SDL, and OSystem_Win32.

Definition at line 448 of file system.h.

virtual bool OSystem::hasTextInClipboard (  )  [inline, virtual]

Returns whether there is text available in the clipboard.

The kFeatureClipboardSupport feature flag can be used to test whether this call has been implemented by the active backend.

Returns:
true if there is text in the clipboard, false otherwise

Reimplemented in OSystem_MacOSX, and OSystem_SDL.

Definition at line 1574 of file system.h.

virtual void OSystem::hideOverlay (  )  [pure virtual]

Deactivate the overlay mode.

Implemented in ModularBackend.

void OSystem::initBackend (  )  [virtual]

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

) are 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 BaseBackend, OSystem_MacOSX, OSystem_POSIX, OSystem_PS3, OSystem_RISCOS, OSystem_SDL, and OSystem_Win32.

Definition at line 91 of file system.cpp.

virtual void OSystem::initSize ( uint  width,
uint  height,
const Graphics::PixelFormat format = nullptr 
) [pure virtual]

Set the size and color format of the virtual screen.

Typical sizes include:

  • 320x200 (e.g. for most SCUMM games, and Simon)
  • 320x240 (e.g. for FM-TOWN SCUMM games)
  • 640x480 (e.g. for Curse of Monkey Island)

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 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: CLUT8 (e.g. 256 color, for most games) RGB555 (e.g. 16-bit color, for later SCUMM HE games) RGB565 (e.g. 16-bit color, for Urban Runner)

This is the pixel format for which the client code generates data; this 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.

Parameters:
width the new virtual screen width
height the new virtual screen height
format the new virtual screen pixel format

Implemented in ModularBackend.

virtual void OSystem::initSizeHint ( const Graphics::ModeList modes  )  [inline, virtual]

Send a list of graphics modes to the backend so it can make a decision about the best way to set up the display hardware.

Engines that switch between different virtual screen sizes during a game should call this function prior to any call to initSize. Engines that use only a single screen size do not need to call this function.

Parameters:
modes the list of graphics modes the engine will probably use.

Reimplemented in ModularBackend.

Definition at line 803 of file system.h.

bool OSystem::isConnectionLimited (  )  [virtual]

Returns whether connection's limited (if available on the target system).

Returns true if connection seems limited.

Definition at line 196 of file system.cpp.

virtual void OSystem::launcherInitSize ( uint  width,
uint  height 
) [pure virtual]

!!! ResidualVM specific method !!! Set the size of the launcher virtual screen.

Parameters:
width the new virtual screen width
height the new virtual screen height

Implemented in OSystem_SDL.

virtual bool OSystem::lockMouse ( bool  lock  )  [pure virtual]

Lock or unlock the mouse cursor within the window.

ResidualVM specific method

Implemented in ModularBackend.

virtual void OSystem::lockMutex ( MutexRef  mutex  )  [pure virtual]

Lock the given mutex.

Note:
ScummVM code assumes that the mutex implementation supports recursive locking. That is, a thread may lock a mutex twice w/o deadlocking. In case of a multilock, the mutex has to be unlocked as many times as it was locked befored it really becomes unlocked.
Parameters:
mutex the mutex to lock.

Implemented in ModularBackend.

virtual Graphics::Surface* OSystem::lockScreen (  )  [pure virtual]

!!! Not used in ResidualVM !!!

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 matching call to unlockScreen(). Calling code should make sure to only lock the framebuffer for the briefest periods of time possible, as the whole system is potentially stalled while the lock is active. Returns 0 if an error occurred. Otherwise a surface with the pixel format described by getScreenFormat is returned.

The returned surface must *not* be deleted by the client code.

See also:
getScreenFormat

Implemented in ModularBackend.

virtual void OSystem::logMessage ( LogMessageType::Type  type,
const char *  message 
) [pure virtual]

Logs a 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:
type the type of the message
message the message itself

Implemented in OSystem_RISCOS, OSystem_SDL, and OSystem_Win32.

virtual bool OSystem::openUrl ( const Common::String url  )  [inline, virtual]

Open the given Url in the default browser (if available on the target system).

Returns:
true on success, false otherwise.
Note:
It is up to the backend to ensure that the system is in a state that allows the user to actually see the web page. This might for example require leaving fullscreen mode.

url the URL to open

Reimplemented in OSystem_MacOSX, OSystem_POSIX, OSystem_RISCOS, and OSystem_Win32.

Definition at line 1610 of file system.h.

virtual void OSystem::quit (  )  [pure virtual]

Quit (exit) the application.

Implemented in ModularBackend, and OSystem_SDL.

virtual void OSystem::resetGraphicsScale (  )  [inline, virtual]

!!! Not used in ResidualVM !!!

Sets the graphics scale factor to x1. Games with large screen sizes reset the scale to x1 so the screen will not be too big when starting the game.

Reimplemented in ModularBackend.

Definition at line 623 of file system.h.

virtual void OSystem::saveScreenshot (  )  [inline, virtual]

!!! ResidualVM specific method !!! Instruct the backend to capture a screenshot of the current screen.

The backend can persist it the way it considers appropriate.

Reimplemented in ModularBackend.

Definition at line 1061 of file system.h.

virtual void OSystem::setCursorPalette ( const byte colors,
uint  start,
uint  num 
) [inline, virtual]

!!! Not used in ResidualVM !!!

Replace the specified range of cursor 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.

Backends which implement it should have kFeatureCursorPalette flag set

See also:
setPalette
kFeatureCursorPalette

Reimplemented in ModularBackend.

Definition at line 1215 of file system.h.

virtual void OSystem::setFeatureState ( Feature  f,
bool  enable 
) [inline, virtual]

En-/disable the specified feature.

For example, this may be used to enable fullscreen mode, or to deactivate aspect correction, etc.

Reimplemented in ModularBackend.

Definition at line 454 of file system.h.

virtual void OSystem::setFocusRectangle ( const Common::Rect rect  )  [inline, virtual]

!!! Not used in ResidualVM !!!

Sets the area of the screen that has the focus. For example, when a character is speaking, they will have the focus. Allows for pan-and-scan style views where the backend could 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.

Parameters:
rect A rectangle on the screen to be focused on
See also:
clearFocusRectangle

Reimplemented in ModularBackend.

Definition at line 1045 of file system.h.

bool OSystem::setGraphicsMode ( const char *  name  ) 

!!! Not used in ResidualVM !!!

Switch to the graphics mode with the given name. If 'name' is unknown, or if switching to the new mode failed, this method returns false.

Parameters:
name the name of the new graphics mode
Returns:
true if the switch was successful, false otherwise
Note:
This is implemented via the setGraphicsMode(int) method, as well as getSupportedGraphicsModes() and getDefaultGraphicsMode(). In particular, backends do not have to overload this!

Definition at line 121 of file system.cpp.

virtual bool OSystem::setGraphicsMode ( int  mode  )  [pure virtual]

!!! Not used in ResidualVM !!!

Switch to the specified graphics mode. If switching to the new mode failed, this method returns false.

Parameters:
mode the ID of the new graphics mode
Returns:
true if the switch was successful, false otherwise

Implemented in ModularBackend.

virtual void OSystem::setMouseCursor ( const void *  buf,
uint  w,
uint  h,
int  hotspotX,
int  hotspotY,
uint32  keycolor,
bool  dontScale = false,
const Graphics::PixelFormat format = nullptr 
) [pure virtual]

!!! Not used in ResidualVM !!!

Set the bitmap used for drawing the cursor.

Parameters:
buf the 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).
dontScale Whether the cursor should never be scaled. An exception are high ppi displays, where the cursor would be too small to notice otherwise, these are allowed to scale the cursor anyway.
format pointer to the pixel format which cursor graphic uses (0 means CLUT8)

Implemented in ModularBackend.

virtual bool OSystem::setShader ( int  id  )  [inline, virtual]

!!! Not used in ResidualVM !!!

Switch to the specified shader mode. If switching to the new mode failed, this method returns false.

Parameters:
mode the ID of the new shader mode
Returns:
true if the switch was successful, false otherwise

Reimplemented in ModularBackend.

Definition at line 707 of file system.h.

virtual void OSystem::setShakePos ( int  shakeOffset  )  [pure virtual]

!!! Not used in ResidualVM !!!

Set current shake position, a feature needed for some SCUMM screen effects. The effect causes the displayed graphics to be shifted upwards by the specified (always positive) offset. The area at the bottom of the screen which is moved into view by this is filled with black. This does not cause any graphic data to be lost - that is, 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.

Parameters:
shakeOffset the shake offset
Note:
This is currently used in the SCUMM, QUEEN and KYRA engines.

Implemented in ModularBackend.

bool OSystem::setStretchMode ( const char *  name  ) 

Switch to the stretch mode with the given name.

If 'name' is unknown, or if switching to the new mode failed, this method returns false.

Parameters:
name the name of the new stretch mode
Returns:
true if the switch was successful, false otherwise
Note:
This is implemented via the setStretchMode(int) method, as well as getSupportedStretchModes() and getDefaultStretchMode(). In particular, backends do not have to overload this!

Definition at line 143 of file system.cpp.

virtual bool OSystem::setStretchMode ( int  mode  )  [inline, virtual]

Switch to the specified stretch mode.

If switching to the new mode failed, this method returns false.

Parameters:
mode the ID of the new graphics mode
Returns:
true if the switch was successful, false otherwise

Reimplemented in ModularBackend.

Definition at line 744 of file system.h.

virtual bool OSystem::setTextInClipboard ( const Common::String text  )  [inline, virtual]

Set the content of the clipboard to the given string.

The kFeatureClipboardSupport feature flag can be used to test whether this call has been implemented by the active backend.

Returns:
true if the text was properly set in the clipboard, false otherwise

Reimplemented in OSystem_MacOSX, and OSystem_SDL.

Definition at line 1596 of file system.h.

virtual void OSystem::setupScreen ( uint  screenW,
uint  screenH,
bool  fullscreen,
bool  accel3d 
) [pure virtual]

Set the size of the screen.

!!! ResidualVM specific method: !!!

Parameters:
width the new screen width
height the new screen height
fullscreen the new screen will be displayed in fullscreeen mode

Implemented in ModularBackend, and OSystem_SDL.

virtual void OSystem::setWindowCaption ( const char *  caption  )  [inline, virtual]

Set a window caption or any other comparable status display to the given value.

The caption must be a pure ISO LATIN 1 string. Passing a string with a different encoding may lead to unexpected behavior, even crashes.

Parameters:
caption the window caption to use, as an ISO LATIN 1 string

Reimplemented in OSystem_SDL.

Definition at line 1400 of file system.h.

virtual bool OSystem::showMouse ( bool  visible  )  [pure virtual]

Show or hide the mouse cursor.

Currently the backend is not required to immediately draw the mouse cursor on showMouse(true).

TODO: We might want to reconsider this fact, check Graphics::CursorManager::showMouse for some details about this.

See also:
Graphics::CursorManager::showMouse

Implemented in ModularBackend.

virtual void OSystem::showOverlay (  )  [pure virtual]

Activate the overlay mode.

Implemented in ModularBackend.

virtual void OSystem::suggestSideTextures ( Graphics::Surface left,
Graphics::Surface right 
) [inline, virtual]

Suggest textures to render at the side of the game window.

This enables eg. Grim to render the game in a widescreen format.

The system must take a copy of the Surfaces, as they will be free()d automatically.

!!! ResidualVM specific method: !!!

Parameters:
left Texture to be used on the left
height Texture to be used on the right

Reimplemented in ModularBackend.

Definition at line 914 of file system.h.

virtual void OSystem::unlockMutex ( MutexRef  mutex  )  [pure virtual]

Unlock the given mutex.

Parameters:
mutex the mutex to unlock.

Implemented in ModularBackend.

virtual void OSystem::unlockScreen (  )  [pure virtual]

Unlock the screen framebuffer, and mark it as dirty (i.e.

during the next updateScreen() call, the whole screen will be updated.

Implemented in ModularBackend.

virtual void OSystem::updateScreen (  )  [pure virtual]

Flush the whole screen, that is render the current content of the screen framebuffer to the display.

This method could 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>

Implemented in ModularBackend.

virtual void OSystem::warpMouse ( int  x,
int  y 
) [pure virtual]

Move ("warp") the mouse cursor to the specified position in virtual screen coordinates.

Parameters:
x the new x position of the mouse
y the new y position of the mouse

Implemented in ModularBackend.


Member Data Documentation

No default value is provided for _audiocdManager by OSystem.

However, BaseBackend::initBackend() does set a default value if none has been set before.

Note:
_audiocdManager is deleted by the OSystem destructor.

Definition at line 144 of file system.h.

Indicate if initBackend() has been called.

Definition at line 211 of file system.h.

No default value is provided for _eventManager by OSystem.

However, BaseBackend::initBackend() does set a default value if none has been set before.

Note:
_eventManager is deleted by the OSystem destructor.

Definition at line 153 of file system.h.

No default value is provided for _fsFactory by OSystem.

Note that _fsFactory is typically required very early on, so it usually should be set in the backends constructor or shortly thereafter, and before initBackend() is called.

Note:
_fsFactory is deleted by the OSystem destructor.

Definition at line 205 of file system.h.

No default value is provided for _savefileManager by OSystem.

Note:
_savefileManager is deleted by the OSystem destructor.

Definition at line 167 of file system.h.

No default value is provided for _timerManager by OSystem.

Note:
_timerManager is deleted by the OSystem destructor.

Definition at line 160 of file system.h.


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


Generated on Sat Nov 9 2019 05:01:32 for ResidualVM by doxygen 1.7.1
curved edge   curved edge