Building with Ogre1.8

dermont

03-11-2011 13:01:29

There have been a number of changes to variable names in v1.8. You probably haven't got around to thinking of updating but since the update to build with 1.8 is trivial and doesn't affect v1.7 hopefully it can be applied to svn.

https://bitbucket.org/sinbad/ogre/chang ... ingleton.h


Index: ogreoggsoundmanager.cpp
===================================================================
--- ogreoggsoundmanager.cpp (revision 411)
+++ ogreoggsoundmanager.cpp (working copy)
@@ -47,7 +47,12 @@
bool OgreOggSound::OgreOggSoundManager::mShuttingDown = false;
#endif

+
+#if OGRE_VERSION_MAJOR == 1 && OGRE_VERSION_MINOR <= 7
template<> OgreOggSound::OgreOggSoundManager* Ogre::Singleton<OgreOggSound::OgreOggSoundManager>::ms_Singleton = 0;
+#else
+template<> OgreOggSound::OgreOggSoundManager* Ogre::Singleton<OgreOggSound::OgreOggSoundManager>::msSingleton = 0;
+#endif

namespace OgreOggSound
{
@@ -215,13 +220,26 @@
/*/////////////////////////////////////////////////////////////////*/
OgreOggSoundManager* OgreOggSoundManager::getSingletonPtr(void)
{
+#if OGRE_VERSION_MAJOR == 1 && OGRE_VERSION_MINOR <= 7
return ms_Singleton;
+#else
+ return msSingleton;
+#endif
}
/*/////////////////////////////////////////////////////////////////*/
OgreOggSoundManager& OgreOggSoundManager::getSingleton(void)
{
- if ( !ms_Singleton ) OGRE_EXCEPT( Ogre::Exception::ERR_ITEM_NOT_FOUND, "'OgreOggSound[_d]' plugin NOT loaded! - use loadPlugin()", "OgreOggSoundManager::getSingleton()");
+#if OGRE_VERSION_MAJOR == 1 && OGRE_VERSION_MINOR <= 7
+ if ( !ms_Singleton )
+#else
+ if ( !msSingleton )
+#endif
+OGRE_EXCEPT( Ogre::Exception::ERR_ITEM_NOT_FOUND, "'OgreOggSound[_d]' plugin NOT loaded! - use loadPlugin()", "OgreOggSoundManager::getSingleton()");
+#if OGRE_VERSION_MAJOR == 1 && OGRE_VERSION_MINOR <= 7
return ( *ms_Singleton );
+#else
+ return ( *msSingleton );
+#endif
}
/*/////////////////////////////////////////////////////////////////*/
bool OgreOggSoundManager::init( const std::string &deviceName,

stickymango

22-11-2011 22:08:29

Thanks for this, I haven't got round to looking at 1.8 yet but will review these ammendments and incorporate any changes.

Thanks!