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 () override
 Pre-initialize backend.
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 MixerManagergetMixerManager () override
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 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.
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 48 of file sdl.h.


Constructor & Destructor Documentation

OSystem_SDL::OSystem_SDL (  ) 

Definition at line 80 of file sdl.cpp.

OSystem_SDL::~OSystem_SDL (  )  [virtual]

Definition at line 102 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 457 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 882 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 706 of file sdl.cpp.

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

Definition at line 581 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 669 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 410 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 388 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 536 of file sdl.cpp.

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 156 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 541 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 550 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 659 of file sdl.cpp.

MixerManager * OSystem_SDL::getMixerManager (  )  [override, virtual]

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

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

Reimplemented in OSystem_MacOSX, OSystem_POSIX, and OSystem_Win32.

Definition at line 724 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 601 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 676 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 698 of file sdl.cpp.

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

Determine whether the backend supports the specified feature.

Reimplemented from ModularGraphicsBackend.

Reimplemented in OSystem_MacOSX, OSystem_POSIX, OSystem_RISCOS, and OSystem_Win32.

Definition at line 183 of file sdl.cpp.

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

Pre-initialize backend.

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

Reimplemented from OSystem.

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

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

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

Initialze the SDL library.

Definition at line 426 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 519 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 564 of file sdl.cpp.

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

Quit (exit) the application.

Implements OSystem.

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


Member Data Documentation

The event source we use for obtaining SDL events.

Definition at line 127 of file sdl.h.

Definition at line 128 of file sdl.h.

bool OSystem_SDL::_inited [protected]

Definition at line 104 of file sdl.h.

bool OSystem_SDL::_initedSDL [protected]

Definition at line 105 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 122 of file sdl.h.

Definition at line 158 of file sdl.h.

The SDL output window.

Definition at line 133 of file sdl.h.


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


Generated on Sat Sep 19 2020 05:04:07 for ResidualVM by doxygen 1.7.1
curved edge   curved edge