[Orxonox-commit 601] r3133 - branches/pch/src/orxonox/sound
rgrieder at orxonox.net
rgrieder at orxonox.net
Tue Jun 9 22:06:57 CEST 2009
Author: rgrieder
Date: 2009-06-09 22:06:57 +0200 (Tue, 09 Jun 2009)
New Revision: 3133
Modified:
branches/pch/src/orxonox/sound/SoundBase.cc
branches/pch/src/orxonox/sound/SoundBase.h
branches/pch/src/orxonox/sound/SoundMainMenu.cc
branches/pch/src/orxonox/sound/SoundMainMenu.h
branches/pch/src/orxonox/sound/SoundManager.cc
branches/pch/src/orxonox/sound/SoundManager.h
Log:
Reduced header file dependencies in the sound classes.
Modified: branches/pch/src/orxonox/sound/SoundBase.cc
===================================================================
--- branches/pch/src/orxonox/sound/SoundBase.cc 2009-06-09 18:59:57 UTC (rev 3132)
+++ branches/pch/src/orxonox/sound/SoundBase.cc 2009-06-09 20:06:57 UTC (rev 3133)
@@ -25,16 +25,23 @@
* ...
*
*/
+
+#include "SoundBase.h"
+
#include <vector>
#include <AL/alut.h>
#include <vorbis/vorbisfile.h>
+#include <boost/static_assert.hpp>
+#include "util/Math.h"
+#include "core/Core.h"
#include "orxonox/objects/worldentities/WorldEntity.h"
-#include "util/Math.h"
-#include "SoundBase.h"
#include "SoundManager.h"
-#include "core/Core.h"
+// Make sure we correctly avoid including al.h in the header
+BOOST_STATIC_ASSERT(sizeof(uint32_t) == sizeof(ALuint));
+BOOST_STATIC_ASSERT(sizeof(int32_t) == sizeof(ALint));
+
namespace orxonox
{
SoundManager* SoundBase::soundmanager_s = NULL;
Modified: branches/pch/src/orxonox/sound/SoundBase.h
===================================================================
--- branches/pch/src/orxonox/sound/SoundBase.h 2009-06-09 18:59:57 UTC (rev 3132)
+++ branches/pch/src/orxonox/sound/SoundBase.h 2009-06-09 20:06:57 UTC (rev 3133)
@@ -25,14 +25,12 @@
* ...
*
*/
-#ifndef _SOUNDBASE_H__
-#define _SOUNDBASE_H__
+#ifndef _SoundBase_H__
+#define _SoundBase_H__
-#include <AL/al.h>
+#include "OrxonoxPrereqs.h"
#include <string>
-#include "OrxonoxPrereqs.h"
-
namespace orxonox
{
/**
@@ -59,15 +57,15 @@
bool loadFile(std::string filename);
private:
- ALuint loadOggFile(std::string filename);
- ALuint source_;
- ALuint buffer_;
+ uint32_t loadOggFile(std::string filename);
+ uint32_t source_;
+ uint32_t buffer_;
WorldEntity* entity_;
- ALint getSourceState();
+ int32_t getSourceState();
static SoundManager* soundmanager_s;
}; // class SoundBase
} // namepsace orxonox
-#endif // _SOUNDBASE_H__
+#endif /* _SoundBase_H__ */
Modified: branches/pch/src/orxonox/sound/SoundMainMenu.cc
===================================================================
--- branches/pch/src/orxonox/sound/SoundMainMenu.cc 2009-06-09 18:59:57 UTC (rev 3132)
+++ branches/pch/src/orxonox/sound/SoundMainMenu.cc 2009-06-09 20:06:57 UTC (rev 3133)
@@ -27,6 +27,7 @@
*/
#include "SoundMainMenu.h"
+
#include "core/CoreIncludes.h"
#include "core/ConfigValueIncludes.h"
Modified: branches/pch/src/orxonox/sound/SoundMainMenu.h
===================================================================
--- branches/pch/src/orxonox/sound/SoundMainMenu.h 2009-06-09 18:59:57 UTC (rev 3132)
+++ branches/pch/src/orxonox/sound/SoundMainMenu.h 2009-06-09 20:06:57 UTC (rev 3133)
@@ -26,13 +26,13 @@
*
*/
-#ifndef _SOUNDMAINMENU_H__
-#define _SOUNDMAINMENU_H__
+#ifndef _SoundMainMenu_H__
+#define _SoundMainMenu_H__
+#include "OrxonoxPrereqs.h"
+
#include <string>
-
#include "core/OrxonoxClass.h"
-#include "OrxonoxPrereqs.h"
#include "SoundBase.h"
namespace orxonox
@@ -47,4 +47,5 @@
std::string filename_;
};
}
-#endif
+
+#endif /* _SoundMainMenu_H__ */
Modified: branches/pch/src/orxonox/sound/SoundManager.cc
===================================================================
--- branches/pch/src/orxonox/sound/SoundManager.cc 2009-06-09 18:59:57 UTC (rev 3132)
+++ branches/pch/src/orxonox/sound/SoundManager.cc 2009-06-09 20:06:57 UTC (rev 3133)
@@ -26,13 +26,14 @@
*
*/
+#include "SoundManager.h"
+
#include <AL/alut.h>
+#include "util/Math.h"
#include "orxonox/CameraManager.h"
#include "orxonox/objects/worldentities/Camera.h"
-#include "util/Math.h"
#include "SoundBase.h"
-#include "SoundManager.h"
namespace orxonox
{
Modified: branches/pch/src/orxonox/sound/SoundManager.h
===================================================================
--- branches/pch/src/orxonox/sound/SoundManager.h 2009-06-09 18:59:57 UTC (rev 3132)
+++ branches/pch/src/orxonox/sound/SoundManager.h 2009-06-09 20:06:57 UTC (rev 3133)
@@ -24,15 +24,18 @@
* Co-authors:
* ...
*/
-#ifndef _SOUNDMANGER_H__
-#define _SOUNDMANGER_H__
+#ifndef _SoundManager_H__
+#define _SoundManager_H__
-#include <AL/al.h>
-#include <AL/alc.h>
+#include "OrxonoxPrereqs.h"
-#include "OrxonoxPrereqs.h"
+#include <list>
#include "orxonox/objects/Tickable.h"
+// forward declarations
+typedef struct ALCcontext_struct ALCcontext;
+typedef struct ALCdevice_struct ALCdevice;
+
namespace orxonox
{
/**
@@ -48,7 +51,7 @@
~SoundManager();
void addSound(SoundBase* sound);
void removeSound(SoundBase* sound);
- virtual void tick(float dt);
+ void tick(float dt);
bool isSoundAvailable();
private:
@@ -60,4 +63,4 @@
}; // class SoundManager
} // namespace orxonox
-#endif // _SOUNDMANAGER_H__
+#endif /* _SoundManager_H__ */
More information about the Orxonox-commit
mailing list