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

ModularBackend Class Reference

Base class for modular backends. More...

#include <modular-backend.h>

Inheritance diagram for ModularBackend:
Collaboration diagram for ModularBackend:

List of all members.

Public Member Functions

 ModularBackend ()
virtual ~ModularBackend ()
Features

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

virtual GraphicsManagergetGraphicsManager ()
virtual const GraphicsModegetSupportedGraphicsModes () const override
 !!! Not used in ResidualVM !!!
virtual int getDefaultGraphicsMode () const override
 !!! Not used in ResidualVM !!!
virtual bool setGraphicsMode (int mode) override
 !!! Not used in ResidualVM !!!
virtual int getGraphicsMode () const override
 !!! Not used in ResidualVM !!!
virtual const GraphicsModegetSupportedShaders () const override
 !!! Not used in ResidualVM !!!
virtual int getShader () const override
 Determine which shader is currently active.
virtual bool setShader (int id) override
 !!! Not used in ResidualVM !!!
virtual const GraphicsModegetSupportedStretchModes () const override
 Retrieve a list of all stretch modes supported by this backend.
virtual int getDefaultStretchMode () const override
 Return the ID of the 'default' stretch mode.
virtual bool setStretchMode (int mode) override
 Switch to the specified stretch mode.
virtual int getStretchMode () const override
 Determine which stretch mode is currently active.
virtual void resetGraphicsScale () override
 !!! Not used in ResidualVM !!!
virtual Graphics::PixelFormat getScreenFormat () const override
 !!! Not used in ResidualVM !!!
virtual Common::List
< Graphics::PixelFormat
getSupportedFormats () const override
 !!! Not used in ResidualVM !!!
virtual void initSize (uint width, uint height, const Graphics::PixelFormat *format=NULL) override
 Set the size and color format of the virtual screen.
virtual void setupScreen (uint screenW, uint screenH, bool fullscreen, bool accel3d)
 Set the size of the screen.
virtual Graphics::PixelBuffer getScreenPixelBuffer ()
 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 void initSizeHint (const Graphics::ModeList &modes) override
 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 int getScreenChangeID () const override
 !!! Not used in ResidualVM !!!
virtual void saveScreenshot () override
 !!! ResidualVM specific method !!! Instruct the backend to capture a screenshot of the current screen.
virtual void beginGFXTransaction () override
 !!! Not used in ResidualVM !!!
virtual OSystem::TransactionError endGFXTransaction () override
 !!! Not used in ResidualVM !!!
virtual int16 getHeight () override
 Returns the currently set virtual screen height.
virtual int16 getWidth () override
 Returns the currently set virtual screen width.
virtual PaletteManagergetPaletteManager () override
 !!! Not used in ResidualVM !!!
virtual void copyRectToScreen (const void *buf, int pitch, int x, int y, int w, int h) override
 !!! Not used in ResidualVM !!!
virtual Graphics::SurfacelockScreen () override
 !!! Not used in ResidualVM !!!
virtual void unlockScreen () override
 Unlock the screen framebuffer, and mark it as dirty (i.e.
virtual void fillScreen (uint32 col) override
 Fills the screen with a given color value.
virtual void updateScreen () override
 Flush the whole screen, that is render the current content of the screen framebuffer to the display.
virtual void setShakePos (int shakeOffset) override
 !!! Not used in ResidualVM !!!
virtual void setFocusRectangle (const Common::Rect &rect) override
 !!! Not used in ResidualVM !!!
virtual void clearFocusRectangle () override
 Clears the focus set by a call to setFocusRectangle().
virtual void showOverlay () override
 Activate the overlay mode.
virtual void hideOverlay () override
 Deactivate the overlay mode.
virtual Graphics::PixelFormat getOverlayFormat () const override
 Returns the pixel format description of the overlay.
virtual void clearOverlay () override
 Reset the overlay.
virtual void grabOverlay (void *buf, int pitch) override
 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) override
 Blit a graphics buffer to the overlay.
virtual int16 getOverlayHeight () override
 Return the height of the overlay.
virtual int16 getOverlayWidth () override
 Return the width of the overlay.
virtual bool showMouse (bool visible) override
 Show or hide the mouse cursor.
virtual void warpMouse (int x, int y) override
 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=NULL) override
 !!! Not used in ResidualVM !!!
virtual void setCursorPalette (const byte *colors, uint start, uint num) override
 !!! Not used in ResidualVM !!!
virtual bool lockMouse (bool lock)
 Lock or unlock the mouse cursor within the window.
Mutex handling

virtual MutexRef createMutex () override
 Create a new mutex.
virtual void lockMutex (MutexRef mutex) override
 Lock the given mutex.
virtual void unlockMutex (MutexRef mutex) override
 Unlock the given mutex.
virtual void deleteMutex (MutexRef mutex) override
 Delete the given mutex.
Sound

virtual Audio::MixergetMixer () override
 Return the audio mixer.
Miscellaneous

virtual void quit () override
 Quit (exit) the application.
virtual void displayMessageOnOSD (const char *msg) override
 !!! Not used in ResidualVM !!!
virtual void displayActivityIconOnOSD (const Graphics::Surface *icon) override
 Display an icon indicating background activity.

Protected Attributes

Managers variables

MutexManager_mutexManager
GraphicsManager_graphicsManager
Audio::Mixer_mixer

Detailed Description

Base class for modular backends.

It wraps most functions to their manager equivalent, but not all OSystem functions are implemented here.

A backend derivated from this class, will need to implement these functions on its own: OSystem::pollEvent() OSystem::getMillis() OSystem::delayMillis() OSystem::getTimeAndDate()

And, it should also initialize all the managers variables declared in this class, or override their related functions.

Definition at line 47 of file modular-backend.h.


Constructor & Destructor Documentation

ModularBackend::ModularBackend (  ) 

Definition at line 35 of file modular-backend.cpp.

ModularBackend::~ModularBackend (  )  [virtual]

Definition at line 43 of file modular-backend.cpp.


Member Function Documentation

void ModularBackend::beginGFXTransaction (  )  [override, 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 from OSystem.

Definition at line 156 of file modular-backend.cpp.

void ModularBackend::clearFocusRectangle (  )  [override, 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 from OSystem.

Definition at line 211 of file modular-backend.cpp.

void ModularBackend::clearOverlay (  )  [override, 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.

Implements OSystem.

Definition at line 227 of file modular-backend.cpp.

void ModularBackend::copyRectToOverlay ( const void *  buf,
int  pitch,
int  x,
int  y,
int  w,
int  h 
) [override, 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

Implements OSystem.

Definition at line 235 of file modular-backend.cpp.

void ModularBackend::copyRectToScreen ( const void *  buf,
int  pitch,
int  x,
int  y,
int  w,
int  h 
) [override, 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

Implements OSystem.

Definition at line 176 of file modular-backend.cpp.

OSystem::MutexRef ModularBackend::createMutex (  )  [override, virtual]

Create a new mutex.

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

Implements OSystem.

Definition at line 273 of file modular-backend.cpp.

void ModularBackend::deleteMutex ( MutexRef  mutex  )  [override, 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.

Implements OSystem.

Definition at line 288 of file modular-backend.cpp.

void ModularBackend::displayActivityIconOnOSD ( const Graphics::Surface icon  )  [override, 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

Reimplemented from BaseBackend.

Definition at line 302 of file modular-backend.cpp.

void ModularBackend::displayMessageOnOSD ( const char *  msg  )  [override, 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

Reimplemented from BaseBackend.

Definition at line 298 of file modular-backend.cpp.

OSystem::TransactionError ModularBackend::endGFXTransaction (  )  [override, 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 from OSystem.

Definition at line 160 of file modular-backend.cpp.

void ModularBackend::fillScreen ( uint32  col  )  [override, 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.

Reimplemented from BaseBackend.

Definition at line 188 of file modular-backend.cpp.

int ModularBackend::getDefaultGraphicsMode (  )  const [override, 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

Implements OSystem.

Definition at line 73 of file modular-backend.cpp.

int ModularBackend::getDefaultStretchMode (  )  const [override, 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 from OSystem.

Definition at line 101 of file modular-backend.cpp.

bool ModularBackend::getFeatureState ( Feature  f  )  [override, virtual]

Query the state of the specified feature.

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

Reimplemented from OSystem.

Definition at line 60 of file modular-backend.cpp.

GraphicsManager * ModularBackend::getGraphicsManager (  )  [virtual]

Definition at line 64 of file modular-backend.cpp.

int ModularBackend::getGraphicsMode (  )  const [override, virtual]

!!! Not used in ResidualVM !!!

Determine which graphics mode is currently active.

Returns:
the ID of the active graphics mode

Implements OSystem.

Definition at line 81 of file modular-backend.cpp.

int16 ModularBackend::getHeight (  )  [override, virtual]

Returns the currently set virtual screen height.

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

Implements OSystem.

Definition at line 164 of file modular-backend.cpp.

Audio::Mixer * ModularBackend::getMixer (  )  [override, virtual]

Return the audio mixer.

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

Implements OSystem.

Reimplemented in OSystem_SDL.

Definition at line 293 of file modular-backend.cpp.

Graphics::PixelFormat ModularBackend::getOverlayFormat (  )  const [override, virtual]

Returns the pixel format description of the overlay.

See also:
Graphics::PixelFormat

Implements OSystem.

Definition at line 223 of file modular-backend.cpp.

int16 ModularBackend::getOverlayHeight (  )  [override, virtual]

Return the height of the overlay.

See also:
getHeight

Implements OSystem.

Definition at line 239 of file modular-backend.cpp.

int16 ModularBackend::getOverlayWidth (  )  [override, virtual]

Return the width of the overlay.

See also:
getWidth

Implements OSystem.

Definition at line 243 of file modular-backend.cpp.

PaletteManager * ModularBackend::getPaletteManager (  )  [override, virtual]

!!! Not used in ResidualVM !!!

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

Implements OSystem.

Definition at line 172 of file modular-backend.cpp.

int ModularBackend::getScreenChangeID (  )  const [override, 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 from OSystem.

Definition at line 152 of file modular-backend.cpp.

Graphics::PixelFormat ModularBackend::getScreenFormat (  )  const [override, 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

Implements OSystem.

Definition at line 119 of file modular-backend.cpp.

Graphics::PixelBuffer ModularBackend::getScreenPixelBuffer (  )  [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: !!!

Implements OSystem.

Definition at line 135 of file modular-backend.cpp.

int ModularBackend::getShader (  )  const [override, virtual]

Determine which shader is currently active.

Returns:
the ID of the active shader

Reimplemented from OSystem.

Definition at line 93 of file modular-backend.cpp.

int ModularBackend::getStretchMode (  )  const [override, virtual]

Determine which stretch mode is currently active.

Returns:
the ID of the active stretch mode

Reimplemented from OSystem.

Definition at line 109 of file modular-backend.cpp.

Common::List< Graphics::PixelFormat > ModularBackend::getSupportedFormats (  )  const [override, 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.

Implements OSystem.

Definition at line 123 of file modular-backend.cpp.

const OSystem::GraphicsMode * ModularBackend::getSupportedGraphicsModes (  )  const [override, 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

Implements OSystem.

Definition at line 69 of file modular-backend.cpp.

const OSystem::GraphicsMode * ModularBackend::getSupportedShaders (  )  const [override, 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 from OSystem.

Definition at line 85 of file modular-backend.cpp.

const OSystem::GraphicsMode * ModularBackend::getSupportedStretchModes (  )  const [override, 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 from OSystem.

Definition at line 97 of file modular-backend.cpp.

int16 ModularBackend::getWidth (  )  [override, virtual]

Returns the currently set virtual screen width.

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

Implements OSystem.

Definition at line 168 of file modular-backend.cpp.

void ModularBackend::grabOverlay ( void *  buf,
int  pitch 
) [override, virtual]

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

This is only used to implement fake alpha blending.

Implements OSystem.

Definition at line 231 of file modular-backend.cpp.

bool ModularBackend::hasFeature ( Feature  f  )  [override, virtual]

Determine whether the backend supports the specified feature.

Reimplemented from OSystem.

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

Definition at line 52 of file modular-backend.cpp.

void ModularBackend::hideOverlay (  )  [override, virtual]

Deactivate the overlay mode.

Implements OSystem.

Definition at line 219 of file modular-backend.cpp.

void ModularBackend::initSize ( uint  width,
uint  height,
const Graphics::PixelFormat format = NULL 
) [override, 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

Implements OSystem.

Definition at line 144 of file modular-backend.cpp.

void ModularBackend::initSizeHint ( const Graphics::ModeList modes  )  [override, 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 from OSystem.

Definition at line 148 of file modular-backend.cpp.

bool ModularBackend::lockMouse ( bool  lock  )  [virtual]

Lock or unlock the mouse cursor within the window.

ResidualVM specific method

Implements OSystem.

Definition at line 252 of file modular-backend.cpp.

void ModularBackend::lockMutex ( MutexRef  mutex  )  [override, 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.

Implements OSystem.

Definition at line 278 of file modular-backend.cpp.

Graphics::Surface * ModularBackend::lockScreen (  )  [override, 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

Implements OSystem.

Definition at line 180 of file modular-backend.cpp.

void ModularBackend::quit (  )  [override, virtual]

Quit (exit) the application.

Implements OSystem.

Reimplemented in OSystem_SDL.

Definition at line 306 of file modular-backend.cpp.

void ModularBackend::resetGraphicsScale (  )  [override, 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 from OSystem.

Definition at line 113 of file modular-backend.cpp.

void ModularBackend::saveScreenshot (  )  [override, 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 from OSystem.

Definition at line 269 of file modular-backend.cpp.

void ModularBackend::setCursorPalette ( const byte colors,
uint  start,
uint  num 
) [override, 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 from OSystem.

Definition at line 265 of file modular-backend.cpp.

void ModularBackend::setFeatureState ( Feature  f,
bool  enable 
) [override, virtual]

En-/disable the specified feature.

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

Reimplemented from OSystem.

Definition at line 56 of file modular-backend.cpp.

void ModularBackend::setFocusRectangle ( const Common::Rect rect  )  [override, 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 from OSystem.

Definition at line 207 of file modular-backend.cpp.

bool ModularBackend::setGraphicsMode ( int  mode  )  [override, 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

Implements OSystem.

Definition at line 77 of file modular-backend.cpp.

void ModularBackend::setMouseCursor ( const void *  buf,
uint  w,
uint  h,
int  hotspotX,
int  hotspotY,
uint32  keycolor,
bool  dontScale = false,
const Graphics::PixelFormat format = NULL 
) [override, 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)

Implements OSystem.

Definition at line 261 of file modular-backend.cpp.

bool ModularBackend::setShader ( int  id  )  [override, 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 from OSystem.

Definition at line 89 of file modular-backend.cpp.

void ModularBackend::setShakePos ( int  shakeOffset  )  [override, 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.

Implements OSystem.

Definition at line 204 of file modular-backend.cpp.

bool ModularBackend::setStretchMode ( int  mode  )  [override, 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 from OSystem.

Definition at line 105 of file modular-backend.cpp.

void ModularBackend::setupScreen ( uint  screenW,
uint  screenH,
bool  fullscreen,
bool  accel3d 
) [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

Implements OSystem.

Reimplemented in OSystem_SDL.

Definition at line 130 of file modular-backend.cpp.

bool ModularBackend::showMouse ( bool  visible  )  [override, 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

Implements OSystem.

Definition at line 247 of file modular-backend.cpp.

void ModularBackend::showOverlay (  )  [override, virtual]

Activate the overlay mode.

Implements OSystem.

Definition at line 215 of file modular-backend.cpp.

void ModularBackend::suggestSideTextures ( Graphics::Surface left,
Graphics::Surface right 
) [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 from OSystem.

Definition at line 140 of file modular-backend.cpp.

void ModularBackend::unlockMutex ( MutexRef  mutex  )  [override, virtual]

Unlock the given mutex.

Parameters:
mutex the mutex to unlock.

Implements OSystem.

Definition at line 283 of file modular-backend.cpp.

void ModularBackend::unlockScreen (  )  [override, 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.

Definition at line 184 of file modular-backend.cpp.

void ModularBackend::updateScreen (  )  [override, 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>

Implements OSystem.

Definition at line 192 of file modular-backend.cpp.

void ModularBackend::warpMouse ( int  x,
int  y 
) [override, 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

Implements OSystem.

Definition at line 256 of file modular-backend.cpp.


Member Data Documentation

Definition at line 152 of file modular-backend.h.

Definition at line 153 of file modular-backend.h.

Definition at line 151 of file modular-backend.h.


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


Generated on Sat Jul 20 2019 05:02:15 for ResidualVM by doxygen 1.7.1
curved edge   curved edge