Permalink
Browse files

fix headless compilation

  • Loading branch information...
1 parent 8b04e77 commit 21956fea8a7f6b9efed6191a1ab28e5dde7b4f90 -jk- committed Mar 14, 2011
Showing with 15 additions and 4 deletions.
  1. +6 −2 rts/Lua/LuaUnsyncedCtrl.cpp
  2. +9 −2 rts/Lua/LuaUnsyncedRead.cpp
@@ -61,8 +61,6 @@
#include "System/LogOutput.h"
#include "System/NetProtocol.h"
#include "System/Util.h"
-#include "System/Sound/EFX.h"
-#include "System/Sound/EFXPresets.h"
#include "System/Sound/ISound.h"
#include "System/Sound/SoundChannels.h"
#include "System/FileSystem/FileHandler.h"
@@ -73,6 +71,10 @@
#include <boost/cstdint.hpp>
#include <Platform/Misc.h>
+#if !defined(HEADLESS) && !defined(NO_SOUND)
+ #include "System/Sound/EFX.h"
+ #include "System/Sound/EFXPresets.h"
+#endif
using namespace std;
@@ -713,6 +715,7 @@ int LuaUnsyncedCtrl::SetSoundStreamVolume(lua_State* L)
int LuaUnsyncedCtrl::SetSoundEffectParams(lua_State* L)
{
+#if !defined(HEADLESS) && !defined(NO_SOUND)
if (!efx)
return 0;
@@ -804,6 +807,7 @@ int LuaUnsyncedCtrl::SetSoundEffectParams(lua_State* L)
//! commit effects
efx->CommitEffects();
+#endif /// !defined(HEADLESS) && !defined(NO_SOUND)
return 0;
}
@@ -58,10 +58,13 @@
#include "System/FileSystem/FileHandler.h"
#include "System/FileSystem/VFSHandler.h"
#include "System/FileSystem/FileSystem.h"
-#include "System/Sound/EFX.h"
-#include "System/Sound/EFXPresets.h"
#include "System/Sound/SoundChannels.h"
+#if !defined(HEADLESS) && !defined(NO_SOUND)
+ #include "System/Sound/EFX.h"
+ #include "System/Sound/EFXPresets.h"
+#endif
+
using namespace std;
const int CMD_INDEX_OFFSET = 1; // starting index for command descriptions
@@ -1465,6 +1468,9 @@ int LuaUnsyncedRead::GetSoundStreamTime(lua_State* L)
int LuaUnsyncedRead::GetSoundEffectParams(lua_State* L)
{
+#if defined(HEADLESS) || defined(NO_SOUND)
+ return 0;
+#else
if (!efx || !efx->sfxProperties)
return 0;
@@ -1535,6 +1541,7 @@ int LuaUnsyncedRead::GetSoundEffectParams(lua_State* L)
}
return 1;
+#endif //! defined(HEADLESS) || defined(NO_SOUND)
}

0 comments on commit 21956fe

Please sign in to comment.