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

Base OSystem class for all SDL ports. More...

#include <sdl.h>

Inheritance diagram for OSystem_SDL:
Collaboration diagram for OSystem_SDL:

List of all members.

Public Member Functions

 OSystem_SDL ()
virtual ~OSystem_SDL ()
virtual void init ()
 Pre-initialize backend.
virtual SdlMixerManagergetMixerManager ()
 Get the Mixer Manager instance.
virtual bool hasFeature (Feature f)
 Determine whether the backend supports the specified feature.
virtual void initBackend ()
 The following method is called once, from main.cpp, after all config data (including command line params etc.
virtual void engineInit ()
 Allows the backend to perform engine specific init.
virtual void engineDone ()
 Allows the backend to perform engine specific de-init.
virtual void quit ()
 Quit (exit) the application.
virtual void fatalError ()
 Signals that a fatal error inside the client code has happened.
virtual void logMessage (LogMessageType::Type type, const char *message)
 Logs a given message.
virtual Common::String getSystemLanguage () const
 Returns the locale of the system.
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 void setWindowCaption (const char *caption)
 Set a window caption or any other comparable status display to the given value.
virtual void addSysArchivesToSearchSet (Common::SearchSet &s, int priority=0)
 Add system specific Common::Archive objects to the given SearchSet.
virtual uint32 getMillis (bool skipRecord=false)
 Get the number of milliseconds since the program was started.
virtual void delayMillis (uint msecs)
 Delay/sleep for the specified amount of milliseconds.
virtual void getTimeAndDate (TimeDate &td) const
 Get the current time and date, in the local timezone.
virtual Audio::MixergetMixer ()
 Return the audio mixer.
virtual Common::TimerManagergetTimerManager ()
 Return the timer manager singleton.
virtual Common::SaveFileManagergetSavefileManager ()
 Return the SaveFileManager, used to store and load savestates and other modifiable persistent game data.
virtual Common::String getScreenshotsPath ()
virtual void setupScreen (uint screenW, uint screenH, bool fullscreen, bool accel3d) override
 Set the size of the screen.
virtual void launcherInitSize (uint w, uint h) override
 !!! ResidualVM specific method !!! Set the size of the launcher virtual screen.

Protected Member Functions

void detectDesktopResolution ()
void detectFramebufferSupport ()
virtual Common::EventSourcegetDefaultEventSource ()
virtual void initSDL ()
 Initialze the SDL library.
virtual AudioCDManagercreateAudioCDManager ()
 Create the audio CD manager.
virtual Common::WriteStreamcreateLogFile ()

Protected Attributes

bool _inited
bool _initedSDL
SdlMixerManager_mixerManager
 Mixer manager that configures and setups SDL for the wrapped Audio::Mixer, the true mixer.
SdlEventSource_eventSource
 The event source we use for obtaining SDL events.
SdlWindow_window
 The SDL output window.
ResVmSdlGraphicsManager::Capabilities _capabilities
Backends::Log::Log_logger

Detailed Description

Base OSystem class for all SDL ports.

Definition at line 40 of file sdl.h.


Constructor & Destructor Documentation

OSystem_SDL::OSystem_SDL (  ) 

Definition at line 71 of file sdl.cpp.

OSystem_SDL::~OSystem_SDL (  )  [virtual]

Definition at line 87 of file sdl.cpp.


Member Function Documentation

void OSystem_SDL::addSysArchivesToSearchSet ( Common::SearchSet s,
int  priority = 0 
) [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 from OSystem.

Reimplemented in OSystem_MacOSX, OSystem_POSIX, and OSystem_Win32.

Definition at line 359 of file sdl.cpp.

AudioCDManager * OSystem_SDL::createAudioCDManager (  )  [protected, virtual]

Create the audio CD manager.

Reimplemented in OSystem_MacOSX, OSystem_POSIX, and OSystem_Win32.

Definition at line 595 of file sdl.cpp.

virtual Common::WriteStream* OSystem_SDL::createLogFile (  )  [inline, protected, virtual]

Reimplemented in OSystem_POSIX, OSystem_PS3, and OSystem_Win32.

Definition at line 138 of file sdl.h.

void OSystem_SDL::delayMillis ( uint  msecs  )  [virtual]

Delay/sleep for the specified amount of milliseconds.

Implements OSystem.

Definition at line 553 of file sdl.cpp.

void OSystem_SDL::detectDesktopResolution (  )  [protected]

Definition at line 260 of file sdl.cpp.

void OSystem_SDL::detectFramebufferSupport (  )  [protected]
void OSystem_SDL::engineDone (  )  [virtual]

Allows the backend to perform engine specific de-init.

Called after the engine finishes.

Reimplemented from OSystem.

Definition at line 321 of file sdl.cpp.

void OSystem_SDL::engineInit (  )  [virtual]

Allows the backend to perform engine specific init.

Called just before the engine is run.

Reimplemented from OSystem.

Definition at line 311 of file sdl.cpp.

void OSystem_SDL::fatalError (  )  [virtual]

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

This should quit the application.

Reimplemented from OSystem.

Definition at line 433 of file sdl.cpp.

virtual Common::EventSource* OSystem_SDL::getDefaultEventSource (  )  [inline, protected, virtual]

Implements BaseBackend.

Definition at line 125 of file sdl.h.

uint32 OSystem_SDL::getMillis ( bool  skipRecord = false  )  [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.

Implements OSystem.

Definition at line 543 of file sdl.cpp.

Audio::Mixer * OSystem_SDL::getMixer (  )  [virtual]

Return the audio mixer.

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

Reimplemented from ModularBackend.

Definition at line 572 of file sdl.cpp.

SdlMixerManager * OSystem_SDL::getMixerManager (  )  [virtual]

Get the Mixer Manager instance.

Not to confuse with getMixer(), that returns Audio::Mixer. The Mixer Manager is a SDL wrapper class for the Audio::Mixer. Used by other managers.

Definition at line 577 of file sdl.cpp.

Common::SaveFileManager * OSystem_SDL::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 from OSystem.

Definition at line 604 of file sdl.cpp.

Common::String OSystem_SDL::getScreenshotsPath (  )  [virtual]

Reimplemented in OSystem_MacOSX, and OSystem_Win32.

Definition at line 613 of file sdl.cpp.

Common::String OSystem_SDL::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 from OSystem.

Reimplemented in OSystem_MacOSX, and OSystem_Win32.

Definition at line 456 of file sdl.cpp.

Common::String OSystem_SDL::getTextFromClipboard (  )  [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 from OSystem.

Reimplemented in OSystem_MacOSX.

Definition at line 498 of file sdl.cpp.

void OSystem_SDL::getTimeAndDate ( TimeDate t  )  const [virtual]

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

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

Implements OSystem.

Definition at line 560 of file sdl.cpp.

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

Return the timer manager singleton.

For more information, refer to the TimerManager documentation.

Reimplemented from OSystem.

Definition at line 587 of file sdl.cpp.

bool OSystem_SDL::hasFeature ( Feature  f  )  [virtual]

Determine whether the backend supports the specified feature.

Reimplemented from ModularBackend.

Reimplemented in OSystem_MacOSX, OSystem_POSIX, and OSystem_Win32.

Definition at line 171 of file sdl.cpp.

bool OSystem_SDL::hasTextInClipboard (  )  [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 from OSystem.

Reimplemented in OSystem_MacOSX.

Definition at line 490 of file sdl.cpp.

void OSystem_SDL::init (  )  [virtual]

Pre-initialize backend.

It should be called after instantiating the backend. Early needed managers are created here.

Reimplemented in OSystem_AmigaOS, OSystem_MacOSX, OSystem_POSIX, OSystem_PS3, and OSystem_Win32.

Definition at line 134 of file sdl.cpp.

void OSystem_SDL::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 from BaseBackend.

Reimplemented in OSystem_MacOSX, OSystem_POSIX, OSystem_PS3, and OSystem_Win32.

Definition at line 182 of file sdl.cpp.

void OSystem_SDL::initSDL (  )  [protected, virtual]

Initialze the SDL library.

Definition at line 328 of file sdl.cpp.

void OSystem_SDL::launcherInitSize ( uint  width,
uint  height 
) [override, 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

Implements OSystem.

Definition at line 417 of file sdl.cpp.

void OSystem_SDL::logMessage ( LogMessageType::Type  type,
const char *  message 
) [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

Implements OSystem.

Reimplemented in OSystem_Win32.

Definition at line 439 of file sdl.cpp.

void OSystem_SDL::quit (  )  [virtual]

Quit (exit) the application.

Reimplemented from ModularBackend.

Definition at line 428 of file sdl.cpp.

bool OSystem_SDL::setTextInClipboard ( const Common::String text  )  [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 from OSystem.

Reimplemented in OSystem_MacOSX.

Definition at line 523 of file sdl.cpp.

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

Reimplemented from ModularBackend.

Definition at line 391 of file sdl.cpp.

void OSystem_SDL::setWindowCaption ( const char *  caption  )  [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 from OSystem.

Definition at line 372 of file sdl.cpp.


Member Data Documentation

The event source we use for obtaining SDL events.

Definition at line 111 of file sdl.h.

bool OSystem_SDL::_inited [protected]

Definition at line 96 of file sdl.h.

bool OSystem_SDL::_initedSDL [protected]

Definition at line 97 of file sdl.h.

Definition at line 139 of file sdl.h.

Mixer manager that configures and setups SDL for the wrapped Audio::Mixer, the true mixer.

Definition at line 106 of file sdl.h.

The SDL output window.

Definition at line 116 of file sdl.h.


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


Generated on Sat Jan 12 2019 05:03:24 for ResidualVM by doxygen 1.7.1
curved edge   curved edge