From 84366ad533fb42d00f6645052b9e56f693b81a2c Mon Sep 17 00:00:00 2001 From: fgenesis Date: Mon, 20 Jun 2016 01:56:27 +0200 Subject: [PATCH] hopefully fix build on gcc6, tiny cleanup ... in fact i forgot that much more cleanup was already done on the experimental branch. whatever. --- Aquaria/Avatar.cpp | 1 - BBGE/SoundManager.cpp | 23 +---------------------- BBGE/SoundManager.h | 25 +++---------------------- 3 files changed, 4 insertions(+), 45 deletions(-) diff --git a/Aquaria/Avatar.cpp b/Aquaria/Avatar.cpp index 355f807..c9aa7c7 100644 --- a/Aquaria/Avatar.cpp +++ b/Aquaria/Avatar.cpp @@ -563,7 +563,6 @@ void SongIcon::openNote() PlaySfx play; play.name = sfx; - play.channel = 1 + note; channel = dsq->sound->playSfx(play); diff --git a/BBGE/SoundManager.cpp b/BBGE/SoundManager.cpp index de3ec16..96fe38e 100644 --- a/BBGE/SoundManager.cpp +++ b/BBGE/SoundManager.cpp @@ -894,8 +894,6 @@ void SoundManager::setSfxChannelsVolume(float v) bool SoundManager::playVoice(const std::string &name, SoundVoiceType svt, float vmod) { - //debugLog("playVoice, masterSoundLock: " + name); - if (!enabled) return false; bool checkOther = true; @@ -1219,9 +1217,6 @@ bool SoundManager::playMusic(const std::string &name, SoundLoopType slt, SoundFa { if (isPlayingMusic(name)) { - #ifdef BBGE_BUILD_OPENALOGG - if (masterSoundLock) SDL_mutexV(masterSoundLock); - #endif return false; } } @@ -1552,27 +1547,11 @@ Buffer SoundManager::loadSoundIntoBank(const std::string &filename, const std::s Buffer SoundManager::loadLocalSound(const std::string &filename) { - Buffer b = loadSoundIntoBank(filename, localSoundPath, fileType, SFXLOAD_LOCAL); - -#ifdef BBGE_BUILD_FMODEX - return b; -#endif - - return BBGE_AUDIO_NOCHANNEL; + return loadSoundIntoBank(filename, localSoundPath, fileType, SFXLOAD_LOCAL); } void SoundManager::setMusicSpeed(float speed) { - /* - FMOD_CAPS caps; - FMOD_SPEAKERMODE speakerMode; - int minf, maxf; - SoundCore::system->getDriverCaps(0, &caps, &minf, &maxf, &speakerMode); - std::ostringstream os; - os << "minf: " << minf << " maxf: " << maxf; - debugLog(os.str()); - */ - musicChannel->setFrequency(speed); } diff --git a/BBGE/SoundManager.h b/BBGE/SoundManager.h index 245388a..b764766 100644 --- a/BBGE/SoundManager.h +++ b/BBGE/SoundManager.h @@ -21,42 +21,24 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef SOUNDMANAGER_H #define SOUNDMANAGER_H +#include #include #include #include #include #include "Vector.h" -// if using SDL_MIXER -//const int BBGE_AUDIO_NOCHANNEL = -1; - - - #define BBGE_BUILD_FMODEX -//#define BBGE_BUILD_BASS20 -//#define BBGE_BUILD_SDLMIXER -//#define BBGE_BUILD_IRRKLANG -//#define BBGE_BUILD_OPENALOGG - - -#ifdef BBGE_BUILD_OPENALOGG - const int BBGE_AUDIO_NOCHANNEL = -1; -#elif defined(BBGE_BUILD_FMODEX) - const int BBGE_AUDIO_NOCHANNEL = 0; -#endif +#define BBGE_AUDIO_NOCHANNEL NULL const int BBGE_AUDIO_LOOPINFINITE = -1; const int BBGE_AUDIO_LOOPNONE = 0; namespace SoundCore { -#if defined(BBGE_BUILD_OPENALOGG) - //struct Buffer; -#elif defined(BBGE_BUILD_FMODEX) typedef void *Buffer; -#endif } enum SoundEffectType @@ -105,7 +87,7 @@ enum SoundLoadType struct PlaySfx { PlaySfx() : priority(0.5), handle(0), vol(1), fade(SFT_NONE), - time(0), freq(1), loops(0), channel(BBGE_AUDIO_NOCHANNEL), + time(0), freq(1), loops(0), maxdist(0), x(0), y(0), relative(true), positional(false) {} std::string name; @@ -114,7 +96,6 @@ struct PlaySfx float time; float freq; int loops; - int channel; float priority; float maxdist; // distance gain attenuation. if 0: use default value, -1: don't attenuate at all SoundFadeType fade;