Llarlen
26-10-2008 09:54:46
In order to compile OgreAL on OSX, some changes were necessary:
1. Slight change to an include path
2. Fix for two virtual overrides
3. Undefine a default assertion macro
Works for me, hope it helps someone else too.
Oh and don't forget to add "__MACOSX__" to preprocessor macros. It's required by Ogg/os_types.h.
1. Slight change to an include path
Index: Add-ons/Sound/OgreAL/Include/OgreALPrereqs.h
===================================================================
--- Add-ons/Sound/OgreAL/Include/OgreALPrereqs.h (Revision 156)
+++ Add-ons/Sound/OgreAL/Include/OgreALPrereqs.h (Revision 249)
@@ -1,212 +1,217 @@
#elif OGRE_COMPILER == OGRE_COMPILER_GNUC
- # include "AL/al.h"
- # include "AL/alc.h"
+ # if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+ # include "OpenAL/al.h"
+ # include "OpenAL/alc.h"
+ # else
+ # include "AL/al.h"
+ # include "AL/alc.h"
+ # endif
# if defined(OGREAL_EXPORT) && OGRE_COMP_VER >= 400
# define OgreAL_Export __attribute__ ((visibility("default")))
2. Fix for two virtual overrides
Index: Add-ons/Sound/OgreAL/Include/OgreALListener.h
===================================================================
--- Add-ons/Sound/OgreAL/Include/OgreALListener.h (Revision 156)
+++ Add-ons/Sound/OgreAL/Include/OgreALListener.h (Revision 249)
@@ -140,7 +140,7 @@
void _updateRenderQueue(Ogre::RenderQueue* queue);
/** Overridden from MovableObject */
void _notifyAttached(Ogre::Node* parent, bool isTagPoint = false);
- #if OGRE_VERSION_MAJOR == 1 && OGRE_VERSION_MINOR == 5
+ #if OGRE_VERSION_MAJOR == 1 && OGRE_VERSION_MINOR >= 5
/** Overridden from MovableObject */
virtual void visitRenderables(Ogre::Renderable::Visitor* visitor, bool debugRenderables = false){}
#endif
Index: Add-ons/Sound/OgreAL/Include/OgreALSound.h
===================================================================
--- Add-ons/Sound/OgreAL/Include/OgreALSound.h (Revision 156)
+++ Add-ons/Sound/OgreAL/Include/OgreALSound.h (Revision 249)
@@ -307,14 +307,14 @@
void _updateRenderQueue(Ogre::RenderQueue* queue);
/** Notifies the sound when it is attached to a node */
void _notifyAttached(Ogre::Node *parent, bool isTagPoint = false);
- #if(OGRE_VERSION_MAJOR == 1 && OGRE_VERSION_MINOR == 5)
+ #if(OGRE_VERSION_MAJOR == 1 && OGRE_VERSION_MINOR >= 5)
/** Overridden from MovableObject */
virtual void visitRenderables(Ogre::Renderable::Visitor* visitor, bool debugRenderables = false){}
#endif
3. Undefine a default assertion macro
Index: Add-ons/Sound/OgreAL/Include/OgreALException.h
===================================================================
--- Add-ons/Sound/OgreAL/Include/OgreALException.h (Revision 156)
+++ Add-ons/Sound/OgreAL/Include/OgreALException.h (Revision 249)
@@ -1,87 +1,91 @@
#include "OgreString.h"
#include "OgreALPrereqs.h"
namespace OgreAL {
+#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+// Undefine that default assertion macro...
+#undef check
+#endif
void check(bool condition, const int errorNumber, const Ogre::String& description, const Ogre::String& source);
void check(const Error error, const Ogre::String& description, const Ogre::String& source);
Works for me, hope it helps someone else too.
Oh and don't forget to add "__MACOSX__" to preprocessor macros. It's required by Ogg/os_types.h.