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

Protected Member Functions

virtual Common::EventSourcegetDefaultEventSource () override
virtual void initSDL ()
 Initialze the SDL library.
virtual AudioCDManagercreateAudioCDManager ()
 Create the audio CD manager.
virtual Common::String getDefaultLogFileName ()
virtual Common::WriteStreamcreateLogFile ()
virtual char * convertEncoding (const char *to, const char *from, const char *string, size_t length) override
 This allows derived classes to implement encoding conversion using platform specific API.

Protected Attributes

bool _inited
bool _initedSDL
Common::String _logFilePath
 The path of the currently open log file, if any.
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.
Common::EventSource_eventSourceWrapper
SdlWindow_window
 The SDL output window.
Backends::Log::Log_logger

Detailed Description

Base OSystem class for all SDL ports.

Definition at line 44 of file sdl.h.


Constructor & Destructor Documentation

OSystem_SDL::OSystem_SDL (  ) 

Definition at line 76 of file sdl.cpp.

OSystem_SDL::~OSystem_SDL (  )  [virtual]

Definition at line 99 of file sdl.cpp.


Member Function Documentation

void OSystem_SDL::addSysArchivesToSearchSet ( Common::SearchSet s,
int  priority = 0 
) [override, 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 435 of file sdl.cpp.

char * OSystem_SDL::convertEncoding ( const char *  to,
const char *  from,
const char *  string,
size_t  length 
) [override, protected, virtual]

This allows derived classes to implement encoding conversion using platform specific API.

This method shouldn't be called directly. Use Common::Encoding instead.

Parameters:
to Encoding to convert the string to
from Encoding to convert the string from
string The string that should be converted
length Size of the string in bytes
Returns:
Converted string, which must be freed by the caller (using free() and not delete[]), or nullptr if the conversion isn't possible.

Reimplemented from OSystem.

Reimplemented in OSystem_Win32.

Definition at line 884 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 708 of file sdl.cpp.

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

Definition at line 559 of file sdl.cpp.

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

Delay/sleep for the specified amount of milliseconds.

Implements OSystem.

Definition at line 666 of file sdl.cpp.

void OSystem_SDL::engineDone (  )  [override, virtual]

Allows the backend to perform engine specific de-init.

Called after the engine finishes.

Reimplemented from OSystem.

Definition at line 392 of file sdl.cpp.

void OSystem_SDL::engineInit (  )  [override, virtual]

Allows the backend to perform engine specific init.

Called just before the engine is run.

Reimplemented from OSystem.

Definition at line 376 of file sdl.cpp.

void OSystem_SDL::fatalError (  )  [override, virtual]

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

This should quit the application.

Reimplemented from OSystem.

Definition at line 514 of file sdl.cpp.

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

Implements BaseBackend.

Definition at line 149 of file sdl.h.

virtual Common::String OSystem_SDL::getDefaultLogFileName (  )  [inline, protected, virtual]

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

Definition at line 162 of file sdl.h.

Common::KeymapArray OSystem_SDL::getGlobalKeymaps (  )  [override, virtual]

Return a platform-specific global keymap.

Returns:
Keymap with actions appropriate for the platform

The caller will use and delete the return object.

See keymapper documentation for further reference.

Reimplemented from OSystem.

Definition at line 519 of file sdl.cpp.

Common::HardwareInputSet * OSystem_SDL::getHardwareInputSet (  )  [override, virtual]

Register hardware inputs with keymapper.

Returns:
HardwareInputSet with all keys and recommended mappings

See keymapper documentation for further reference.

Reimplemented from OSystem.

Reimplemented in OSystem_PS3.

Definition at line 528 of file sdl.cpp.

uint32 OSystem_SDL::getMillis ( bool  skipRecord = false  )  [override, 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 656 of file sdl.cpp.

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

Return the audio mixer.

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

Reimplemented from ModularBackend.

Definition at line 685 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 690 of file sdl.cpp.

Common::SaveFileManager * OSystem_SDL::getSavefileManager (  )  [override, 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 717 of file sdl.cpp.

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

Reimplemented in OSystem_MacOSX, OSystem_POSIX, and OSystem_Win32.

Definition at line 726 of file sdl.cpp.

Common::String OSystem_SDL::getSystemLanguage (  )  const [override, 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 579 of file sdl.cpp.

void OSystem_SDL::getTimeAndDate ( TimeDate t  )  const [override, 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 673 of file sdl.cpp.

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

Return the timer manager singleton.

For more information, refer to the TimerManager documentation.

Reimplemented from OSystem.

Definition at line 700 of file sdl.cpp.

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

Determine whether the backend supports the specified feature.

Reimplemented from ModularBackend.

Reimplemented in OSystem_MacOSX, OSystem_POSIX, OSystem_RISCOS, and OSystem_Win32.

Definition at line 175 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, OSystem_RISCOS, and OSystem_Win32.

Definition at line 148 of file sdl.cpp.

void OSystem_SDL::initBackend (  )  [override, 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, OSystem_RISCOS, and OSystem_Win32.

Definition at line 185 of file sdl.cpp.

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

Initialze the SDL library.

Definition at line 404 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 497 of file sdl.cpp.

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

Definition at line 542 of file sdl.cpp.

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

Quit (exit) the application.

Implements OSystem.

Definition at line 509 of file sdl.cpp.

void OSystem_SDL::setWindowCaption ( const char *  caption  )  [override, 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 448 of file sdl.cpp.


Member Data Documentation

The event source we use for obtaining SDL events.

Definition at line 132 of file sdl.h.

Definition at line 133 of file sdl.h.

bool OSystem_SDL::_inited [protected]

Definition at line 107 of file sdl.h.

bool OSystem_SDL::_initedSDL [protected]

Definition at line 108 of file sdl.h.

The path of the currently open log file, if any.

Note:
This is currently a string and not an FSNode for simplicity; e.g. we don't need to include fs.h here, and currently the only use of this value is to use it to open the log file in an editor; for that, we need it only as a string anyway.

Definition at line 121 of file sdl.h.

Definition at line 164 of file sdl.h.

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

Definition at line 127 of file sdl.h.

The SDL output window.

Definition at line 138 of file sdl.h.


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


Generated on Sat May 30 2020 05:02:25 for ResidualVM by doxygen 1.7.1
curved edge   curved edge