Fix duplication symbol issue on Mac.
This may have affected Linux as well.
This commit is contained in:
+4
-4
@@ -14,7 +14,7 @@
|
||||
|
||||
|
||||
// Actor registration
|
||||
map<RString,CreateActorFn> & GetRegistrees()
|
||||
map<RString,CreateActorFn> & GetActorUtilRegistrees()
|
||||
{
|
||||
static map<RString, CreateActorFn> registrees;
|
||||
return registrees;
|
||||
@@ -22,13 +22,13 @@ map<RString,CreateActorFn> & GetRegistrees()
|
||||
|
||||
static bool IsRegistered( const RString& sClassName )
|
||||
{
|
||||
map<RString, CreateActorFn> & registrees = GetRegistrees();
|
||||
map<RString, CreateActorFn> & registrees = GetActorUtilRegistrees();
|
||||
return registrees.find( sClassName ) != registrees.end();
|
||||
}
|
||||
|
||||
void ActorUtil::Register( const RString& sClassName, CreateActorFn pfn )
|
||||
{
|
||||
map<RString, CreateActorFn> & registrees = GetRegistrees();
|
||||
map<RString, CreateActorFn> & registrees = GetActorUtilRegistrees();
|
||||
|
||||
map<RString,CreateActorFn>::iterator iter = registrees.find( sClassName );
|
||||
ASSERT_M( iter == registrees.end(), ssprintf("Actor class '%s' already registered.", sClassName.c_str()) );
|
||||
@@ -123,7 +123,7 @@ Actor* ActorUtil::LoadFromNode( const XNode* pNode, Actor *pParentActor )
|
||||
if( !bHasClass )
|
||||
bHasClass = pNode->GetAttrValue( "Type", sClass );
|
||||
|
||||
map<RString, CreateActorFn> & registrees = GetRegistrees();
|
||||
map<RString, CreateActorFn> & registrees = GetActorUtilRegistrees();
|
||||
|
||||
map<RString,CreateActorFn>::iterator iter = registrees.find( sClass );
|
||||
if( iter == registrees.end() )
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "RageUtil.h"
|
||||
#include "SubscriptionManager.h"
|
||||
|
||||
SubscriptionManager<LocalizedString> & GetSubscribers()
|
||||
SubscriptionManager<LocalizedString> & GetLocalizedSubscribers()
|
||||
{
|
||||
static SubscriptionManager<LocalizedString> subscribers;
|
||||
return subscribers;
|
||||
@@ -31,7 +31,7 @@ static LocalizedString::MakeLocalizer g_pMakeLocalizedStringImpl = LocalizedStri
|
||||
void LocalizedString::RegisterLocalizer( MakeLocalizer pFunc )
|
||||
{
|
||||
g_pMakeLocalizedStringImpl = pFunc;
|
||||
FOREACHS( LocalizedString*, GetSubscribers().m_pSubscribers, l )
|
||||
FOREACHS( LocalizedString*, GetLocalizedSubscribers().m_pSubscribers, l )
|
||||
{
|
||||
LocalizedString *pLoc = *l;
|
||||
pLoc->CreateImpl();
|
||||
@@ -40,7 +40,7 @@ void LocalizedString::RegisterLocalizer( MakeLocalizer pFunc )
|
||||
|
||||
LocalizedString::LocalizedString( const RString& sGroup, const RString& sName )
|
||||
{
|
||||
GetSubscribers().Subscribe( this );
|
||||
GetLocalizedSubscribers().Subscribe( this );
|
||||
|
||||
m_sGroup = sGroup;
|
||||
m_sName = sName;
|
||||
@@ -51,7 +51,7 @@ LocalizedString::LocalizedString( const RString& sGroup, const RString& sName )
|
||||
|
||||
LocalizedString::~LocalizedString()
|
||||
{
|
||||
GetSubscribers().Unsubscribe( this );
|
||||
GetLocalizedSubscribers().Unsubscribe( this );
|
||||
|
||||
SAFE_DELETE( m_pImpl );
|
||||
}
|
||||
|
||||
+4
-4
@@ -6,7 +6,7 @@
|
||||
|
||||
#include "SubscriptionManager.h"
|
||||
|
||||
SubscriptionManager<LuaBinding> & GetSubscribers()
|
||||
SubscriptionManager<LuaBinding> & GetBindingSubscribers()
|
||||
{
|
||||
static SubscriptionManager<LuaBinding> subscribers;
|
||||
return subscribers;
|
||||
@@ -16,7 +16,7 @@ namespace
|
||||
{
|
||||
void RegisterTypes( lua_State *L )
|
||||
{
|
||||
SubscriptionManager<LuaBinding> & subscribers = GetSubscribers();
|
||||
SubscriptionManager<LuaBinding> & subscribers = GetBindingSubscribers();
|
||||
|
||||
if( subscribers.m_pSubscribers.empty() )
|
||||
return;
|
||||
@@ -66,12 +66,12 @@ REGISTER_WITH_LUA_FUNCTION( RegisterTypes );
|
||||
|
||||
LuaBinding::LuaBinding()
|
||||
{
|
||||
GetSubscribers().Subscribe( this );
|
||||
GetBindingSubscribers().Subscribe( this );
|
||||
}
|
||||
|
||||
LuaBinding::~LuaBinding()
|
||||
{
|
||||
GetSubscribers().Unsubscribe( this );
|
||||
GetBindingSubscribers().Unsubscribe( this );
|
||||
}
|
||||
|
||||
void LuaBinding::Register( lua_State *L )
|
||||
|
||||
+8
-8
@@ -7,7 +7,7 @@
|
||||
#include "SubscriptionManager.h"
|
||||
#include "Foreach.h"
|
||||
|
||||
SubscriptionManager<IPreference> & GetSubscribers()
|
||||
SubscriptionManager<IPreference> & GetPreferenceSubscribers()
|
||||
{
|
||||
static SubscriptionManager<IPreference> subscribers;
|
||||
return subscribers;
|
||||
@@ -17,17 +17,17 @@ IPreference::IPreference( const RString& sName ):
|
||||
m_sName( sName ),
|
||||
m_bIsStatic( false )
|
||||
{
|
||||
GetSubscribers().Subscribe( this );
|
||||
GetPreferenceSubscribers().Subscribe( this );
|
||||
}
|
||||
|
||||
IPreference::~IPreference()
|
||||
{
|
||||
GetSubscribers().Unsubscribe( this );
|
||||
GetPreferenceSubscribers().Unsubscribe( this );
|
||||
}
|
||||
|
||||
IPreference *IPreference::GetPreferenceByName( const RString &sName )
|
||||
{
|
||||
FOREACHS( IPreference*, GetSubscribers().m_pSubscribers, p )
|
||||
FOREACHS( IPreference*, GetPreferenceSubscribers().m_pSubscribers, p )
|
||||
{
|
||||
if( !(*p)->GetName().CompareNoCase( sName ) )
|
||||
return *p;
|
||||
@@ -38,20 +38,20 @@ IPreference *IPreference::GetPreferenceByName( const RString &sName )
|
||||
|
||||
void IPreference::LoadAllDefaults()
|
||||
{
|
||||
FOREACHS_CONST( IPreference*, GetSubscribers().m_pSubscribers, p )
|
||||
FOREACHS_CONST( IPreference*, GetPreferenceSubscribers().m_pSubscribers, p )
|
||||
(*p)->LoadDefault();
|
||||
}
|
||||
|
||||
void IPreference::ReadAllPrefsFromNode( const XNode* pNode, bool bIsStatic )
|
||||
{
|
||||
ASSERT( pNode != NULL );
|
||||
FOREACHS_CONST( IPreference*, GetSubscribers().m_pSubscribers, p )
|
||||
FOREACHS_CONST( IPreference*, GetPreferenceSubscribers().m_pSubscribers, p )
|
||||
(*p)->ReadFrom( pNode, bIsStatic );
|
||||
}
|
||||
|
||||
void IPreference::SavePrefsToNode( XNode* pNode )
|
||||
{
|
||||
FOREACHS_CONST( IPreference*, GetSubscribers().m_pSubscribers, p )
|
||||
FOREACHS_CONST( IPreference*, GetPreferenceSubscribers().m_pSubscribers, p )
|
||||
(*p)->WriteTo( pNode );
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ void IPreference::ReadAllDefaultsFromNode( const XNode* pNode )
|
||||
{
|
||||
if( pNode == NULL )
|
||||
return;
|
||||
FOREACHS_CONST( IPreference*, GetSubscribers().m_pSubscribers, p )
|
||||
FOREACHS_CONST( IPreference*, GetPreferenceSubscribers().m_pSubscribers, p )
|
||||
(*p)->ReadDefaultFrom( pNode );
|
||||
}
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ LoadedThemeData *g_pLoadedThemeData = NULL;
|
||||
// For self-registering metrics
|
||||
#include "SubscriptionManager.h"
|
||||
|
||||
SubscriptionManager<IThemeMetric> & GetSubscribers()
|
||||
SubscriptionManager<IThemeMetric> & GetMetricSubscribers()
|
||||
{
|
||||
static SubscriptionManager<IThemeMetric> subscribers;
|
||||
return subscribers;
|
||||
@@ -100,7 +100,7 @@ public:
|
||||
|
||||
void ThemeManager::Subscribe( IThemeMetric *p )
|
||||
{
|
||||
GetSubscribers().Subscribe( p );
|
||||
GetMetricSubscribers().Subscribe( p );
|
||||
|
||||
// It's ThemeManager's responsibility to make sure all of its subscribers
|
||||
// are updated with current data. If a metric is created after
|
||||
@@ -112,7 +112,7 @@ void ThemeManager::Subscribe( IThemeMetric *p )
|
||||
|
||||
void ThemeManager::Unsubscribe( IThemeMetric *p )
|
||||
{
|
||||
GetSubscribers().Unsubscribe( p );
|
||||
GetMetricSubscribers().Unsubscribe( p );
|
||||
}
|
||||
|
||||
|
||||
@@ -434,13 +434,13 @@ void ThemeManager::SwitchThemeAndLanguage( const RString &sThemeName_, const RSt
|
||||
void ThemeManager::ReloadSubscribers()
|
||||
{
|
||||
// reload subscribers
|
||||
FOREACHS_CONST( IThemeMetric*, GetSubscribers().m_pSubscribers, p )
|
||||
FOREACHS_CONST( IThemeMetric*, GetMetricSubscribers().m_pSubscribers, p )
|
||||
(*p)->Read();
|
||||
}
|
||||
|
||||
void ThemeManager::ClearSubscribers()
|
||||
{
|
||||
FOREACHS_CONST( IThemeMetric*, GetSubscribers().m_pSubscribers, p )
|
||||
FOREACHS_CONST( IThemeMetric*, GetMetricSubscribers().m_pSubscribers, p )
|
||||
(*p)->Clear();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user