From 9217472f0e4e801659c0a448dcbf57c28fd36ee2 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sun, 2 Apr 2006 14:16:31 +0000 Subject: With this change, backends are now responsible for instantiating their OSystem class before calling scummvm_main (Note: PalmOS and Symbian are not yet converted, and won't work currently) svn-id: r21557 --- common/system.h | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'common/system.h') diff --git a/common/system.h b/common/system.h index 115b9e7afa..2c22fb4132 100644 --- a/common/system.h +++ b/common/system.h @@ -27,7 +27,6 @@ #include "common/scummsys.h" #include "common/mutex.h" #include "common/rect.h" -#include "common/singleton.h" namespace Graphics { struct Surface; @@ -47,10 +46,15 @@ namespace Common { * methods to create timers, to handle user input events, * control audio CD playback, and sound output. */ -class OSystem : public Common::Singleton { +class OSystem { +private: + // Prevent copying OSystem objects by accident. + OSystem(const OSystem&); + OSystem& operator= (const OSystem&); + protected: - static OSystem *makeInstance(); - friend class Common::Singleton; + OSystem() { } + virtual ~OSystem() { } public: @@ -926,8 +930,8 @@ public: }; -/** The global OSystem instance. Inited in main(). */ -#define g_system (&OSystem::instance()) +/** The global OSystem instance. Initialised in main(). */ +extern OSystem *g_system; #endif -- cgit v1.2.3