From b15d92e470fa09a76540b42d1ab1b6f24515ee74 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 28 Dec 2004 20:29:42 +0000 Subject: [PATCH] Fix running ScummVM in plugin-mode svn-id: r16360 --- base/plugins.cpp | 2 ++ common/config-manager.cpp | 2 ++ common/singleton.h | 8 ++++++-- gui/newgui.cpp | 2 ++ sound/audiocd.cpp | 2 ++ 5 files changed, 14 insertions(+), 2 deletions(-) diff --git a/base/plugins.cpp b/base/plugins.cpp index ddc00320c7f..08093e0d762 100644 --- a/base/plugins.cpp +++ b/base/plugins.cpp @@ -196,6 +196,8 @@ void DynamicPlugin::unloadPlugin() { #pragma mark - +DECLARE_SINGLETON(PluginManager); + PluginManager::PluginManager() { } diff --git a/common/config-manager.cpp b/common/config-manager.cpp index 5bf26fbe509..fc7bbdfec1d 100644 --- a/common/config-manager.cpp +++ b/common/config-manager.cpp @@ -24,6 +24,8 @@ #include "common/config-manager.h" +DECLARE_SINGLETON(Common::ConfigManager); + #if defined(UNIX) #ifdef MACOSX #define DEFAULT_CONFIG_FILE "Library/Preferences/ScummVM Preferences" diff --git a/common/singleton.h b/common/singleton.h index d259102e07b..8ea666cbedc 100644 --- a/common/singleton.h +++ b/common/singleton.h @@ -55,8 +55,12 @@ protected: ~Singleton() { } }; -template -T* Singleton::_singleton=0; +//TODO: The following poses a problem when building ScummVM with plugins... + +//template +//T* Singleton::_singleton=0; + +#define DECLARE_SINGLETON(T) T* Common::Singleton::_singleton=0 } // End of namespace Common diff --git a/gui/newgui.cpp b/gui/newgui.cpp index fb6b2f1784f..1720e943a86 100644 --- a/gui/newgui.cpp +++ b/gui/newgui.cpp @@ -28,6 +28,8 @@ //#define NEW_FONT_CODE +DECLARE_SINGLETON(GUI::NewGui); + namespace GUI { diff --git a/sound/audiocd.cpp b/sound/audiocd.cpp index 1084b98fb85..aceed46306c 100644 --- a/sound/audiocd.cpp +++ b/sound/audiocd.cpp @@ -57,6 +57,8 @@ static const TrackFormat TRACK_FORMATS[] = { }; +DECLARE_SINGLETON(AudioCDManager); + AudioCDManager::AudioCDManager() { memset(&_cd, 0, sizeof(_cd)); memset(_cached_tracks, 0, sizeof(_cached_tracks));