diff options
author | elupus <elupus@svn> | 2010-05-24 12:47:06 +0000 |
---|---|---|
committer | elupus <elupus@svn> | 2010-05-24 12:47:06 +0000 |
commit | a9b07580caa16dfc58e2413949e55bcbe9ad7844 (patch) | |
tree | 6f53513286ff59b0ca213e1ae419e33f25682fcb | |
parent | 6de461f8691d3a648fae8a4e157c0f80758de24b (diff) |
changed: put a few more objects in system globals to control create/destruction order
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@30531 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
-rw-r--r-- | guilib/AudioContext.cpp | 3 | ||||
-rw-r--r-- | guilib/AudioContext.h | 2 | ||||
-rw-r--r-- | xbmc/GUILargeTextureManager.cpp | 3 | ||||
-rw-r--r-- | xbmc/GUILargeTextureManager.h | 2 | ||||
-rw-r--r-- | xbmc/GUISettings.cpp | 3 | ||||
-rw-r--r-- | xbmc/GUISettings.h | 2 | ||||
-rw-r--r-- | xbmc/SystemGlobals.h | 7 |
7 files changed, 16 insertions, 6 deletions
diff --git a/guilib/AudioContext.cpp b/guilib/AudioContext.cpp index 5815be5caf..1fd0e60de0 100644 --- a/guilib/AudioContext.cpp +++ b/guilib/AudioContext.cpp @@ -24,13 +24,14 @@ #include "GUIAudioManager.h" #include "Settings.h" #include "GUISettings.h" +#include "SystemGlobals.h" #ifdef _WIN32 #include "WINDirectSound.h" #endif extern HWND g_hWnd; -CAudioContext g_audioContext; +CAudioContext& g_audioContext = g_SystemGlobals.m_audioContext; #ifdef _WIN32 static GUID g_digitaldevice; diff --git a/guilib/AudioContext.h b/guilib/AudioContext.h index 12c79ccecd..06ed683cfa 100644 --- a/guilib/AudioContext.h +++ b/guilib/AudioContext.h @@ -73,4 +73,4 @@ protected: bool m_bAC3EncoderActive; }; -extern CAudioContext g_audioContext; +extern CAudioContext& g_audioContext; diff --git a/xbmc/GUILargeTextureManager.cpp b/xbmc/GUILargeTextureManager.cpp index 7a43ab45a0..b5f0061f69 100644 --- a/xbmc/GUILargeTextureManager.cpp +++ b/xbmc/GUILargeTextureManager.cpp @@ -30,10 +30,11 @@ #include "GraphicContext.h" #include "utils/log.h" #include "TextureCache.h" +#include "SystemGlobals.h" using namespace std; -CGUILargeTextureManager g_largeTextureManager; +CGUILargeTextureManager& g_largeTextureManager = g_SystemGlobals.m_largeTextureManager; CImageLoader::CImageLoader(const CStdString &path) diff --git a/xbmc/GUILargeTextureManager.h b/xbmc/GUILargeTextureManager.h index 9fa8c05d15..94979a2d90 100644 --- a/xbmc/GUILargeTextureManager.h +++ b/xbmc/GUILargeTextureManager.h @@ -146,6 +146,6 @@ private: CCriticalSection m_listSection; }; -extern CGUILargeTextureManager g_largeTextureManager; +extern CGUILargeTextureManager& g_largeTextureManager; diff --git a/xbmc/GUISettings.cpp b/xbmc/GUISettings.cpp index ff1c6442a2..520fff8e59 100644 --- a/xbmc/GUISettings.cpp +++ b/xbmc/GUISettings.cpp @@ -44,6 +44,7 @@ #include "cores/dvdplayer/DVDCodecs/Video/CrystalHD/CrystalHD.h" #include "utils/PCMRemap.h" #include "GUIFont.h" // for FONT_STYLE_* definitions +#include "SystemGlobals.h" using namespace std; using namespace ADDON; @@ -62,7 +63,7 @@ using namespace ADDON; #define TEXT_OFF 351 #define TEXT_NONE 231 -class CGUISettings g_guiSettings; +CGUISettings& g_guiSettings = g_SystemGlobals.m_guiSettings; #ifdef _LINUX #define DEFAULT_VISUALISATION "opengl_spectrum.vis" diff --git a/xbmc/GUISettings.h b/xbmc/GUISettings.h index bacf33fdc9..1f09bdb9d3 100644 --- a/xbmc/GUISettings.h +++ b/xbmc/GUISettings.h @@ -474,4 +474,4 @@ private: void LoadFromXML(TiXmlElement *pRootElement, mapIter &it, bool advanced = false); }; -extern class CGUISettings g_guiSettings; +extern CGUISettings& g_guiSettings; diff --git a/xbmc/SystemGlobals.h b/xbmc/SystemGlobals.h index 0379daa6c3..852c2823d0 100644 --- a/xbmc/SystemGlobals.h +++ b/xbmc/SystemGlobals.h @@ -26,11 +26,16 @@ #include "GraphicContext.h" #include "MouseStat.h" #include "Application.h" +#include "GUILargeTextureManager.h" +#include "AudioContext.h" +#include "GUISettings.h" struct CSystemGlobals { // Classes that must be initialized/destructed in a specific order because of dependencies. + CGUISettings m_guiSettings; + #if defined(_WIN32) && defined(HAS_GL) CWinSystemWin32GL m_Windowing; #endif @@ -47,7 +52,9 @@ struct CSystemGlobals CWinSystemX11GL m_Windowing; #endif + CGUILargeTextureManager m_largeTextureManager; CXBMCRenderManager m_renderManager; + CAudioContext m_audioContext; CGraphicContext m_graphicsContext; CMouseStat m_Mouse; CApplication m_application; |