aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/sdl
diff options
context:
space:
mode:
authorAlejandro Marzini2010-07-02 06:44:42 +0000
committerAlejandro Marzini2010-07-02 06:44:42 +0000
commitf9c3a4547cbf1b1942402d618fa403a7fb1cb656 (patch)
tree63bb999ef23998b17aea9f5bc9712bc2a8f9bfbf /backends/platform/sdl
parent055fc3282f73bd9aa64cec2661258d3baf5ec66e (diff)
downloadscummvm-rg350-f9c3a4547cbf1b1942402d618fa403a7fb1cb656.tar.gz
scummvm-rg350-f9c3a4547cbf1b1942402d618fa403a7fb1cb656.tar.bz2
scummvm-rg350-f9c3a4547cbf1b1942402d618fa403a7fb1cb656.zip
Cleanup and documentation.
svn-id: r50589
Diffstat (limited to 'backends/platform/sdl')
-rw-r--r--backends/platform/sdl/macosx/macosx-main.cpp2
-rw-r--r--backends/platform/sdl/macosx/macosx.h8
-rw-r--r--backends/platform/sdl/main.cpp5
-rw-r--r--backends/platform/sdl/posix/posix-main.cpp4
-rw-r--r--backends/platform/sdl/sdl.h59
-rw-r--r--backends/platform/sdl/win32/win32-main.cpp9
-rw-r--r--backends/platform/sdl/win32/win32.cpp4
-rw-r--r--backends/platform/sdl/win32/win32.h4
8 files changed, 49 insertions, 46 deletions
diff --git a/backends/platform/sdl/macosx/macosx-main.cpp b/backends/platform/sdl/macosx/macosx-main.cpp
index 1df811624f..023860b19f 100644
--- a/backends/platform/sdl/macosx/macosx-main.cpp
+++ b/backends/platform/sdl/macosx/macosx-main.cpp
@@ -25,8 +25,6 @@
#ifdef MACOSX
-#include "common/scummsys.h"
-
#include "backends/platform/sdl/macosx/macosx.h"
#include "backends/plugins/sdl/sdl-provider.h"
#include "base/main.h"
diff --git a/backends/platform/sdl/macosx/macosx.h b/backends/platform/sdl/macosx/macosx.h
index 1febd1a51d..3c583a0ac0 100644
--- a/backends/platform/sdl/macosx/macosx.h
+++ b/backends/platform/sdl/macosx/macosx.h
@@ -31,11 +31,11 @@
class OSystem_MacOSX : public OSystem_POSIX {
public:
OSystem_MacOSX();
- ~OSystem_MacOSX() {}
+ virtual ~OSystem_MacOSX() {}
- void initBackend();
- void addSysArchivesToSearchSet(Common::SearchSet &s, int priority = 0);
- void setupIcon();
+ virtual void initBackend();
+ virtual void addSysArchivesToSearchSet(Common::SearchSet &s, int priority = 0);
+ virtual void setupIcon();
};
#endif
diff --git a/backends/platform/sdl/main.cpp b/backends/platform/sdl/main.cpp
index 75d248841e..38d0259121 100644
--- a/backends/platform/sdl/main.cpp
+++ b/backends/platform/sdl/main.cpp
@@ -23,12 +23,9 @@
*
*/
-#include "common/scummsys.h"
-
// Several SDL based ports use a custom main, and hence do not want to compile
// of this file. The following "#if" ensures that.
-#if !defined(__MAEMO__) && !defined(_WIN32_WCE) && !defined(GP2XWIZ)&& !defined(LINUXMOTO) && !defined(__SYMBIAN32__) && !defined(WIN32) && !defined(UNIX)
-
+#if !defined(UNIX) && !defined(WIN32) && !defined(__MAEMO__) && !defined(__SYMBIAN32__)
#include "backends/platform/sdl/sdl.h"
#include "backends/plugins/sdl/sdl-provider.h"
diff --git a/backends/platform/sdl/posix/posix-main.cpp b/backends/platform/sdl/posix/posix-main.cpp
index e2bc2c8682..ad11fc230e 100644
--- a/backends/platform/sdl/posix/posix-main.cpp
+++ b/backends/platform/sdl/posix/posix-main.cpp
@@ -23,9 +23,7 @@
*
*/
-#if defined(UNIX) && !defined(MACOSX) && !defined(SAMSUNGTV) && !defined(LINUXMOTO) && !defined(GP2XWIZ)
-
-#include "common/scummsys.h"
+#if defined(UNIX) && !defined(MACOSX) && !defined(SAMSUNGTV) && !defined(LINUXMOTO) && !defined(GP2XWIZ) && !defined(GP2X)
#include "backends/platform/sdl/posix/posix.h"
#include "backends/plugins/sdl/sdl-provider.h"
diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h
index c238422906..f2b513752f 100644
--- a/backends/platform/sdl/sdl.h
+++ b/backends/platform/sdl/sdl.h
@@ -23,8 +23,8 @@
*
*/
-#ifndef SDL_COMMON_H
-#define SDL_COMMON_H
+#ifndef PLATFORM_SDL_H
+#define PLATFORM_SDL_H
#if defined(__SYMBIAN32__)
#include <esdl\SDL.h>
@@ -36,59 +36,72 @@
#include "backends/graphics/sdl/sdl-graphics.h"
#include "backends/mixer/sdl/sdl-mixer.h"
+/**
+ * Base OSystem class for all SDL ports.
+ */
class OSystem_SDL : public ModularBackend {
public:
OSystem_SDL();
virtual ~OSystem_SDL();
- /** Pre-initialize backend, it should be called after
- * instantiating the backend. Early needed managers
- * are created here.
+ /**
+ * Pre-initialize backend. It should be called after
+ * instantiating the backend. Early needed managers are
+ * created here.
*/
virtual void init();
- virtual void initBackend();
+ /**
+ * Get the Graphics Manager instance. Used by other managers.
+ */
+ virtual SdlGraphicsManager *getGraphicsManager();
- virtual Common::HardwareKeySet *getHardwareKeySet();
+ /**
+ * 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.
+ */
+ virtual SdlMixerManager *getMixerManager();
+ // Override functions from ModularBackend
+ virtual void initBackend();
+ virtual Common::HardwareKeySet *getHardwareKeySet();
virtual void quit();
virtual void deinit();
-
virtual void setWindowCaption(const char *caption);
-
virtual void addSysArchivesToSearchSet(Common::SearchSet &s, int priority = 0);
virtual Common::SeekableReadStream *createConfigReadStream();
virtual Common::WriteStream *createConfigWriteStream();
-
virtual bool pollEvent(Common::Event &event);
-
virtual uint32 getMillis();
virtual void delayMillis(uint msecs);
virtual void getTimeAndDate(TimeDate &td) const;
-
virtual Audio::Mixer *getMixer();
- // Get the Graphics Manager instance, used by other managers
- virtual SdlGraphicsManager *getGraphicsManager();
-
- // Get the Sdl Mixer Manager instance (not the Audio::Mixer)
- virtual SdlMixerManager *getMixerManager();
-
protected:
bool _inited;
bool _initedSDL;
- // Mixer manager that encapsulates the actual Audio::Mixer
+ /**
+ * Mixer manager that configures and setups SDL for
+ * the wrapped Audio::Mixer, the true mixer.
+ */
SdlMixerManager *_mixerManager;
- // Initialze SDL library
+ /**
+ * Initialze the SDL library.
+ */
virtual void initSDL();
- // Setup the window icon
+ /**
+ * Setup the window icon.
+ */
virtual void setupIcon();
- // Get the file path where the user configuration
- // of ScummVM will be saved
+ /**
+ * Get the file path where the user configuration
+ * of ScummVM will be saved.
+ */
virtual Common::String getDefaultConfigFileName();
};
diff --git a/backends/platform/sdl/win32/win32-main.cpp b/backends/platform/sdl/win32/win32-main.cpp
index ffabeffc9d..25f208ddac 100644
--- a/backends/platform/sdl/win32/win32-main.cpp
+++ b/backends/platform/sdl/win32/win32-main.cpp
@@ -26,14 +26,12 @@
#ifdef WIN32
// Fix for bug #2895217 "MSVC compilation broken with r47595":
-// We need to keep this on top of the "common/scummsys.h" include,
+// We need to keep this on top of the "common/scummsys.h"(base/main.h) include,
// otherwise we will get errors about the windows headers redefining
// "ARRAYSIZE" for example.
+#define WIN32_LEAN_AND_MEAN
#include <windows.h>
-// winnt.h defines ARRAYSIZE, but we want our own one...
-#undef ARRAYSIZE
-
-#include "common/scummsys.h"
+#undef ARRAYSIZE // winnt.h defines ARRAYSIZE, but we want our own one...
#include "backends/platform/sdl/win32/win32.h"
#include "backends/plugins/sdl/sdl-provider.h"
@@ -45,7 +43,6 @@ int __stdcall WinMain(HINSTANCE /*hInst*/, HINSTANCE /*hPrevInst*/, LPSTR /*lpC
}
int main(int argc, char *argv[]) {
-
// Create our OSystem instance
g_system = new OSystem_Win32();
assert(g_system);
diff --git a/backends/platform/sdl/win32/win32.cpp b/backends/platform/sdl/win32/win32.cpp
index 28cb13def4..05005dee6f 100644
--- a/backends/platform/sdl/win32/win32.cpp
+++ b/backends/platform/sdl/win32/win32.cpp
@@ -26,8 +26,8 @@
#ifdef WIN32
#include <windows.h>
-// winnt.h defines ARRAYSIZE, but we want our own one... - this is needed before including util.h
-#undef ARRAYSIZE
+#define WIN32_LEAN_AND_MEAN
+#undef ARRAYSIZE // winnt.h defines ARRAYSIZE, but we want our own one...
#include "backends/platform/sdl/win32/win32.h"
#include "backends/fs/windows/windows-fs-factory.h"
diff --git a/backends/platform/sdl/win32/win32.h b/backends/platform/sdl/win32/win32.h
index 7ae8802fc1..f18ee6ead1 100644
--- a/backends/platform/sdl/win32/win32.h
+++ b/backends/platform/sdl/win32/win32.h
@@ -30,10 +30,10 @@
class OSystem_Win32 : public OSystem_SDL {
public:
- void init();
+ virtual void init();
protected:
- Common::String getDefaultConfigFileName();
+ virtual Common::String getDefaultConfigFileName();
};
#endif