From 9e08d319c02befb66d9934f7aecea145bc7fa4c2 Mon Sep 17 00:00:00 2001 From: cryham Date: Tue, 26 Nov 2024 12:15:29 +0100 Subject: [PATCH] make it build, drop CVar, use Camera* // todo: audio --- src/sound/RefCountingObject.h | 13 +- src/sound/RefCountingObjectPtr.h | 4 +- src/sound/Sound.cpp | 4 +- src/sound/Sound.h | 6 +- src/sound/SoundManager.cpp | 211 ++++++++++++++++--------------- src/sound/SoundManager.h | 12 +- src/sound/SoundScriptManager.cpp | 103 +++++++++------ src/sound/SoundScriptManager.h | 28 ++-- 8 files changed, 208 insertions(+), 173 deletions(-) diff --git a/src/sound/RefCountingObject.h b/src/sound/RefCountingObject.h index caa34233..28e8865c 100644 --- a/src/sound/RefCountingObject.h +++ b/src/sound/RefCountingObject.h @@ -6,11 +6,11 @@ #pragma once -#include +// #include #include // Against accidental threaded access -#include "Application.h" // Provides access to AppContext -#include "AppContext.h" // Stores main thread ID for debug checking +#include "Declare.h" // Provides access to AppContext +//#include "AppContext.h" // Stores main thread ID for debug checking #if !defined(RefCoutingObject_DEBUGTRACE) @@ -19,7 +19,8 @@ #if !defined(RefCountingObject_ASSERT) # include -# define RefCountingObject_ASSERT(_Expr_) assert(_Expr_) +// # define RefCountingObject_ASSERT(_Expr_) assert(_Expr_) +# define RefCountingObject_ASSERT(_Expr_) #endif /// Self reference-counting objects, as requred by AngelScript garbage collector. @@ -62,7 +63,7 @@ template class RefCountingObject } } - static void RegisterRefCountingObject(AS_NAMESPACE_QUALIFIER asIScriptEngine* engine, const char* name) + /*static void RegisterRefCountingObject(AS_NAMESPACE_QUALIFIER asIScriptEngine* engine, const char* name) { int r; @@ -76,7 +77,7 @@ template class RefCountingObject // Registering the addref/release behaviours r = engine->RegisterObjectBehaviour(name, asBEHAVE_ADDREF, "void f()", asMETHOD(T,AddRef), asCALL_THISCALL); RefCountingObject_ASSERT( r >= 0 ); r = engine->RegisterObjectBehaviour(name, asBEHAVE_RELEASE, "void f()", asMETHOD(T,Release), asCALL_THISCALL); RefCountingObject_ASSERT( r >= 0 ); - } + }*/ int m_refcount = 0; std::mutex m_refcount_mtx; // Against accidental threaded access diff --git a/src/sound/RefCountingObjectPtr.h b/src/sound/RefCountingObjectPtr.h index 122a49a9..bb333a0a 100644 --- a/src/sound/RefCountingObjectPtr.h +++ b/src/sound/RefCountingObjectPtr.h @@ -43,8 +43,8 @@ class RefCountingObjectPtr bool operator!=(const T* o) const { return m_ref != o; } // Compare nullptr - bool operator==(const nullptr_t) const { return m_ref == nullptr; } - bool operator!=(const nullptr_t) const { return m_ref != nullptr; } + bool operator==(const std::nullptr_t) const { return m_ref == nullptr; } + bool operator!=(const std::nullptr_t) const { return m_ref != nullptr; } // Get the reference T *GetRef() { return m_ref; } // To be invoked from C++ only!! diff --git a/src/sound/Sound.cpp b/src/sound/Sound.cpp index ce2112df..b338817e 100644 --- a/src/sound/Sound.cpp +++ b/src/sound/Sound.cpp @@ -18,7 +18,7 @@ along with Rigs of Rods. If not, see . */ -#ifdef USE_OPENAL +// #ifdef USE_OPENAL #include "Sound.h" #include "SoundManager.h" @@ -167,4 +167,4 @@ void Sound::setVelocity(Ogre::Vector3 vel) sound_manager->recomputeSource(source_index, REASON_VLCT, 0.0f, &vel); } -#endif // USE_OPENAL +// #endif // USE_OPENAL diff --git a/src/sound/Sound.h b/src/sound/Sound.h index d84bd79f..6393d486 100644 --- a/src/sound/Sound.h +++ b/src/sound/Sound.h @@ -18,11 +18,11 @@ along with Rigs of Rods. If not, see . */ -#ifdef USE_OPENAL +// #ifdef USE_OPENAL #pragma once -#include "Application.h" +// #include "Application.h" #include "RefCountingObject.h" #ifdef __APPLE__ @@ -102,4 +102,4 @@ class Sound : public RefCountingObject } // namespace RoR -#endif // USE_OPENAL +// #endif // USE_OPENAL diff --git a/src/sound/SoundManager.cpp b/src/sound/SoundManager.cpp index 1c0c9a55..2c331afd 100644 --- a/src/sound/SoundManager.cpp +++ b/src/sound/SoundManager.cpp @@ -19,16 +19,16 @@ along with Rigs of Rods. If not, see . */ -#ifdef USE_OPENAL +// #ifdef USE_OPENAL #include "SoundManager.h" -#include "Application.h" +#include "Declare.h" #include "Sound.h" #include -#define LOGSTREAM Ogre::LogManager::getSingleton().stream() << "[RoR|Audio] " +#define LOGSTREAM Ogre::LogManager::getSingleton().stream() << "@@ " bool _checkALErrors(const char* filename, int linenum) { @@ -52,20 +52,21 @@ const float SoundManager::MAX_DISTANCE = 500.0f; const float SoundManager::ROLLOFF_FACTOR = 1.0f; const float SoundManager::REFERENCE_DISTANCE = 7.5f; + SoundManager::SoundManager() { - if (App::audio_device_name->getStr() == "") + if (Audio::audio_device_name == "") { LOGSTREAM << "No audio device configured, opening default."; audio_device = alcOpenDevice(nullptr); } else { - audio_device = alcOpenDevice(App::audio_device_name->getStr().c_str()); + audio_device = alcOpenDevice(Audio::audio_device_name.c_str()); if (!audio_device) { - LOGSTREAM << "Failed to open configured audio device \"" << App::audio_device_name->getStr() << "\", opening default."; - App::audio_device_name->setStr(""); + LOGSTREAM << "Failed to open configured audio device \"" << Audio::audio_device_name << "\", opening default."; + Audio::audio_device_name = ""; audio_device = alcOpenDevice(nullptr); } } @@ -121,10 +122,10 @@ SoundManager::SoundManager() alAuxiliaryEffectSlotf = (LPALAUXILIARYEFFECTSLOTF)alGetProcAddress("alAuxiliaryEffectSlotf"); alAuxiliaryEffectSlotfv = (LPALAUXILIARYEFFECTSLOTFV)alGetProcAddress("alAuxiliaryEffectSlotfv"); - if (App::audio_enable_efx->getBool()) + if (Audio::audio_enable_efx) { // allow user to change reverb engines at will - switch(App::audio_efx_reverb_engine->getEnum()) + switch(Audio::audio_efx_reverb_engine) { case EfxReverbEngine::EAXREVERB: m_efx_reverb_engine = EfxReverbEngine::EAXREVERB; break; case EfxReverbEngine::REVERB: m_efx_reverb_engine = EfxReverbEngine::REVERB; break; @@ -193,7 +194,7 @@ SoundManager::SoundManager() else { LOG("SoundManager: OpenAL EFX extension not found, disabling EFX"); - App::audio_enable_efx->setVal(false); + Audio::audio_enable_efx = false; } // generate the AL sources @@ -208,13 +209,13 @@ SoundManager::SoundManager() alSourcef(hardware_sources[hardware_sources_num], AL_MAX_DISTANCE, MAX_DISTANCE); // connect source to listener slot effect - if(App::audio_enable_efx->getBool()) + if(Audio::audio_enable_efx) { alSource3i(hardware_sources[hardware_sources_num], AL_AUXILIARY_SEND_FILTER, m_listener_slot, 0, AL_FILTER_NULL); } } - alDopplerFactor(App::audio_doppler_factor->getFloat()); + alDopplerFactor(Audio::audio_doppler_factor); alSpeedOfSound(343.3f); for (int i = 0; i < MAX_HARDWARE_SOURCES; i++) @@ -378,7 +379,7 @@ void SoundManager::Update(const float dt_sec) recomputeAllSources(); UpdateAlListener(); - if(App::audio_enable_efx->getBool()) + if(Audio::audio_enable_efx) { // apply filters to sources when appropriate for(int hardware_index = 0; hardware_index < hardware_sources_num; hardware_index++) @@ -434,7 +435,7 @@ void SoundManager::UpdateListenerEffectSlot(const float dt_sec) EFXEAXREVERBPROPERTIES current_environmental_properties = *m_listener_efx_reverb_properties; // early reflections panning, delay and strength - if (App::audio_enable_reflection_panning->getBool() && m_efx_reverb_engine == EfxReverbEngine::EAXREVERB) + if (Audio::audio_enable_reflection_panning && m_efx_reverb_engine == EfxReverbEngine::EAXREVERB) { std::tuple target_early_reflections_properties = this->ComputeEarlyReflectionsProperties(); @@ -450,30 +451,30 @@ void SoundManager::UpdateListenerEffectSlot(const float dt_sec) this->SmoothlyUpdateAlAuxiliaryEffectSlot(dt_sec, m_listener_slot, ¤t_environmental_properties); } -void SoundManager::SmoothlyUpdateAlAuxiliaryEffectSlot(const float dt_sec, const ALuint slot_id, const EFXEAXREVERBPROPERTIES* target_efx_properties) +void SoundManager::SmoothlyUpdateAlAuxiliaryEffectSlot(const float dt_sec, const ALuint slot_id, const EFXEAXREVERBPROPERTIES* target) { const float time_to_target = 0.333f; // seconds to reach the target properties from the current properties const float step = std::min(dt_sec / time_to_target, 1.0f); - static std::map current_efx_properties_of_slot; + static std::map cur; // current_efx_properties_of_slot - if (target_efx_properties == nullptr) + if (target == nullptr) { this->alAuxiliaryEffectSloti(slot_id, AL_EFFECTSLOT_EFFECT, AL_EFFECTSLOT_NULL); return; } - const auto it = current_efx_properties_of_slot.find(slot_id); - if (it == current_efx_properties_of_slot.end()) + const auto it = cur.find(slot_id); + if (it == cur.end()) { // previously unseen effect slot, set a starting point - current_efx_properties_of_slot[slot_id] = *target_efx_properties; + cur[slot_id] = *target; } ALuint efx_effect_id; // create new AL effect if not existing if(m_efx_effect_id_map.find(slot_id) == m_efx_effect_id_map.end()) { - efx_effect_id = this->CreateAlEffect(target_efx_properties); + efx_effect_id = this->CreateAlEffect(target); m_efx_effect_id_map[slot_id] = efx_effect_id; } else @@ -482,80 +483,80 @@ void SoundManager::SmoothlyUpdateAlAuxiliaryEffectSlot(const float dt_sec, const } // compute intermediate step between current and target properties using linear interpolation based on time step - current_efx_properties_of_slot[slot_id] = - { - current_efx_properties_of_slot[slot_id].flDensity + step * (target_efx_properties->flDensity - current_efx_properties_of_slot[slot_id].flDensity), - current_efx_properties_of_slot[slot_id].flDiffusion + step * (target_efx_properties->flDiffusion - current_efx_properties_of_slot[slot_id].flDiffusion), - current_efx_properties_of_slot[slot_id].flGain + step * (target_efx_properties->flGain - current_efx_properties_of_slot[slot_id].flGain), - current_efx_properties_of_slot[slot_id].flGainHF + step * (target_efx_properties->flGainHF - current_efx_properties_of_slot[slot_id].flGainHF), - current_efx_properties_of_slot[slot_id].flGainLF + step * (target_efx_properties->flGainLF - current_efx_properties_of_slot[slot_id].flGainLF), - current_efx_properties_of_slot[slot_id].flDecayTime + step * (target_efx_properties->flDecayTime - current_efx_properties_of_slot[slot_id].flDecayTime), - current_efx_properties_of_slot[slot_id].flDecayHFRatio + step * (target_efx_properties->flDecayHFRatio - current_efx_properties_of_slot[slot_id].flDecayHFRatio), - current_efx_properties_of_slot[slot_id].flDecayLFRatio + step * (target_efx_properties->flDecayLFRatio - current_efx_properties_of_slot[slot_id].flDecayLFRatio), - current_efx_properties_of_slot[slot_id].flReflectionsGain + step * (target_efx_properties->flReflectionsGain - current_efx_properties_of_slot[slot_id].flReflectionsGain), - current_efx_properties_of_slot[slot_id].flReflectionsDelay + step * (target_efx_properties->flReflectionsDelay - current_efx_properties_of_slot[slot_id].flReflectionsDelay), - current_efx_properties_of_slot[slot_id].flReflectionsPan[0] + step * (target_efx_properties->flReflectionsPan[0] - current_efx_properties_of_slot[slot_id].flReflectionsPan[0]), - current_efx_properties_of_slot[slot_id].flReflectionsPan[1] + step * (target_efx_properties->flReflectionsPan[1] - current_efx_properties_of_slot[slot_id].flReflectionsPan[1]), - current_efx_properties_of_slot[slot_id].flReflectionsPan[2] + step * (target_efx_properties->flReflectionsPan[2] - current_efx_properties_of_slot[slot_id].flReflectionsPan[2]), - current_efx_properties_of_slot[slot_id].flLateReverbGain + step * (target_efx_properties->flLateReverbGain - current_efx_properties_of_slot[slot_id].flLateReverbGain), - current_efx_properties_of_slot[slot_id].flLateReverbDelay + step * (target_efx_properties->flLateReverbDelay - current_efx_properties_of_slot[slot_id].flLateReverbDelay), - current_efx_properties_of_slot[slot_id].flLateReverbPan[0] + step * (target_efx_properties->flLateReverbPan[0] - current_efx_properties_of_slot[slot_id].flLateReverbPan[0]), - current_efx_properties_of_slot[slot_id].flLateReverbPan[1] + step * (target_efx_properties->flLateReverbPan[1] - current_efx_properties_of_slot[slot_id].flLateReverbPan[1]), - current_efx_properties_of_slot[slot_id].flLateReverbPan[2] + step * (target_efx_properties->flLateReverbPan[2] - current_efx_properties_of_slot[slot_id].flLateReverbPan[2]), - current_efx_properties_of_slot[slot_id].flEchoTime + step * (target_efx_properties->flEchoTime - current_efx_properties_of_slot[slot_id].flEchoTime), - current_efx_properties_of_slot[slot_id].flEchoDepth + step * (target_efx_properties->flEchoDepth - current_efx_properties_of_slot[slot_id].flEchoDepth), - current_efx_properties_of_slot[slot_id].flModulationTime + step * (target_efx_properties->flModulationTime - current_efx_properties_of_slot[slot_id].flModulationTime), - current_efx_properties_of_slot[slot_id].flModulationDepth + step * (target_efx_properties->flModulationDepth - current_efx_properties_of_slot[slot_id].flModulationDepth), - current_efx_properties_of_slot[slot_id].flAirAbsorptionGainHF + step * (target_efx_properties->flAirAbsorptionGainHF - current_efx_properties_of_slot[slot_id].flAirAbsorptionGainHF), - current_efx_properties_of_slot[slot_id].flHFReference + step * (target_efx_properties->flHFReference - current_efx_properties_of_slot[slot_id].flHFReference), - current_efx_properties_of_slot[slot_id].flLFReference + step * (target_efx_properties->flLFReference - current_efx_properties_of_slot[slot_id].flLFReference), - current_efx_properties_of_slot[slot_id].flRoomRolloffFactor + step * (target_efx_properties->flRoomRolloffFactor - current_efx_properties_of_slot[slot_id].flRoomRolloffFactor), - static_cast(std::round(current_efx_properties_of_slot[slot_id].iDecayHFLimit + step * (target_efx_properties->iDecayHFLimit - current_efx_properties_of_slot[slot_id].iDecayHFLimit))), + cur[slot_id] = + { + cur[slot_id].flDensity + step * (target->flDensity - cur[slot_id].flDensity), + cur[slot_id].flDiffusion + step * (target->flDiffusion - cur[slot_id].flDiffusion), + cur[slot_id].flGain + step * (target->flGain - cur[slot_id].flGain), + cur[slot_id].flGainHF + step * (target->flGainHF - cur[slot_id].flGainHF), + cur[slot_id].flGainLF + step * (target->flGainLF - cur[slot_id].flGainLF), + cur[slot_id].flDecayTime + step * (target->flDecayTime - cur[slot_id].flDecayTime), + cur[slot_id].flDecayHFRatio + step * (target->flDecayHFRatio - cur[slot_id].flDecayHFRatio), + cur[slot_id].flDecayLFRatio + step * (target->flDecayLFRatio - cur[slot_id].flDecayLFRatio), + cur[slot_id].flReflectionsGain + step * (target->flReflectionsGain - cur[slot_id].flReflectionsGain), + cur[slot_id].flReflectionsDelay + step * (target->flReflectionsDelay - cur[slot_id].flReflectionsDelay), + cur[slot_id].flReflectionsPan[0] + step * (target->flReflectionsPan[0] - cur[slot_id].flReflectionsPan[0]), + cur[slot_id].flReflectionsPan[1] + step * (target->flReflectionsPan[1] - cur[slot_id].flReflectionsPan[1]), + cur[slot_id].flReflectionsPan[2] + step * (target->flReflectionsPan[2] - cur[slot_id].flReflectionsPan[2]), + cur[slot_id].flLateReverbGain + step * (target->flLateReverbGain - cur[slot_id].flLateReverbGain), + cur[slot_id].flLateReverbDelay + step * (target->flLateReverbDelay - cur[slot_id].flLateReverbDelay), + cur[slot_id].flLateReverbPan[0] + step * (target->flLateReverbPan[0] - cur[slot_id].flLateReverbPan[0]), + cur[slot_id].flLateReverbPan[1] + step * (target->flLateReverbPan[1] - cur[slot_id].flLateReverbPan[1]), + cur[slot_id].flLateReverbPan[2] + step * (target->flLateReverbPan[2] - cur[slot_id].flLateReverbPan[2]), + cur[slot_id].flEchoTime + step * (target->flEchoTime - cur[slot_id].flEchoTime), + cur[slot_id].flEchoDepth + step * (target->flEchoDepth - cur[slot_id].flEchoDepth), + cur[slot_id].flModulationTime + step * (target->flModulationTime - cur[slot_id].flModulationTime), + cur[slot_id].flModulationDepth + step * (target->flModulationDepth - cur[slot_id].flModulationDepth), + cur[slot_id].flAirAbsorptionGainHF + step * (target->flAirAbsorptionGainHF - cur[slot_id].flAirAbsorptionGainHF), + cur[slot_id].flHFReference + step * (target->flHFReference - cur[slot_id].flHFReference), + cur[slot_id].flLFReference + step * (target->flLFReference - cur[slot_id].flLFReference), + cur[slot_id].flRoomRolloffFactor + step * (target->flRoomRolloffFactor - cur[slot_id].flRoomRolloffFactor), + static_cast(std::round(cur[slot_id].iDecayHFLimit + step * (target->iDecayHFLimit - cur[slot_id].iDecayHFLimit))), }; // update AL effect to intermediate values switch (m_efx_reverb_engine) { case EfxReverbEngine::EAXREVERB: - this->alEffectf( efx_effect_id, AL_EAXREVERB_DENSITY, current_efx_properties_of_slot[slot_id].flDensity); - this->alEffectf( efx_effect_id, AL_EAXREVERB_DIFFUSION, current_efx_properties_of_slot[slot_id].flDiffusion); - this->alEffectf( efx_effect_id, AL_EAXREVERB_GAIN, current_efx_properties_of_slot[slot_id].flGain); - this->alEffectf( efx_effect_id, AL_EAXREVERB_GAINHF, current_efx_properties_of_slot[slot_id].flGainHF); - this->alEffectf( efx_effect_id, AL_EAXREVERB_GAINLF, current_efx_properties_of_slot[slot_id].flGainLF); - this->alEffectf( efx_effect_id, AL_EAXREVERB_DECAY_TIME, current_efx_properties_of_slot[slot_id].flDecayTime); - this->alEffectf( efx_effect_id, AL_EAXREVERB_DECAY_HFRATIO, current_efx_properties_of_slot[slot_id].flDecayHFRatio); - this->alEffectf( efx_effect_id, AL_EAXREVERB_DECAY_LFRATIO, current_efx_properties_of_slot[slot_id].flDecayLFRatio); - this->alEffectf( efx_effect_id, AL_EAXREVERB_REFLECTIONS_GAIN, current_efx_properties_of_slot[slot_id].flReflectionsGain); - this->alEffectf( efx_effect_id, AL_EAXREVERB_REFLECTIONS_DELAY, current_efx_properties_of_slot[slot_id].flReflectionsDelay); - this->alEffectfv(efx_effect_id, AL_EAXREVERB_REFLECTIONS_PAN, current_efx_properties_of_slot[slot_id].flReflectionsPan); - this->alEffectf( efx_effect_id, AL_EAXREVERB_LATE_REVERB_GAIN, current_efx_properties_of_slot[slot_id].flLateReverbGain); - this->alEffectf( efx_effect_id, AL_EAXREVERB_LATE_REVERB_DELAY, current_efx_properties_of_slot[slot_id].flLateReverbDelay); - this->alEffectfv(efx_effect_id, AL_EAXREVERB_LATE_REVERB_PAN, current_efx_properties_of_slot[slot_id].flLateReverbPan); - this->alEffectf( efx_effect_id, AL_EAXREVERB_ECHO_TIME, current_efx_properties_of_slot[slot_id].flEchoTime); - this->alEffectf( efx_effect_id, AL_EAXREVERB_ECHO_DEPTH, current_efx_properties_of_slot[slot_id].flEchoDepth); - this->alEffectf( efx_effect_id, AL_EAXREVERB_MODULATION_TIME, current_efx_properties_of_slot[slot_id].flModulationTime); - this->alEffectf( efx_effect_id, AL_EAXREVERB_MODULATION_DEPTH, current_efx_properties_of_slot[slot_id].flModulationDepth); - this->alEffectf( efx_effect_id, AL_EAXREVERB_AIR_ABSORPTION_GAINHF, current_efx_properties_of_slot[slot_id].flAirAbsorptionGainHF); - this->alEffectf( efx_effect_id, AL_EAXREVERB_HFREFERENCE, current_efx_properties_of_slot[slot_id].flHFReference); - this->alEffectf( efx_effect_id, AL_EAXREVERB_LFREFERENCE, current_efx_properties_of_slot[slot_id].flLFReference); - this->alEffectf( efx_effect_id, AL_EAXREVERB_ROOM_ROLLOFF_FACTOR, current_efx_properties_of_slot[slot_id].flRoomRolloffFactor); - this->alEffecti( efx_effect_id, AL_EAXREVERB_DECAY_HFLIMIT, current_efx_properties_of_slot[slot_id].iDecayHFLimit); + this->alEffectf( efx_effect_id, AL_EAXREVERB_DENSITY, cur[slot_id].flDensity); + this->alEffectf( efx_effect_id, AL_EAXREVERB_DIFFUSION, cur[slot_id].flDiffusion); + this->alEffectf( efx_effect_id, AL_EAXREVERB_GAIN, cur[slot_id].flGain); + this->alEffectf( efx_effect_id, AL_EAXREVERB_GAINHF, cur[slot_id].flGainHF); + this->alEffectf( efx_effect_id, AL_EAXREVERB_GAINLF, cur[slot_id].flGainLF); + this->alEffectf( efx_effect_id, AL_EAXREVERB_DECAY_TIME, cur[slot_id].flDecayTime); + this->alEffectf( efx_effect_id, AL_EAXREVERB_DECAY_HFRATIO, cur[slot_id].flDecayHFRatio); + this->alEffectf( efx_effect_id, AL_EAXREVERB_DECAY_LFRATIO, cur[slot_id].flDecayLFRatio); + this->alEffectf( efx_effect_id, AL_EAXREVERB_REFLECTIONS_GAIN, cur[slot_id].flReflectionsGain); + this->alEffectf( efx_effect_id, AL_EAXREVERB_REFLECTIONS_DELAY, cur[slot_id].flReflectionsDelay); + this->alEffectfv(efx_effect_id, AL_EAXREVERB_REFLECTIONS_PAN, cur[slot_id].flReflectionsPan); + this->alEffectf( efx_effect_id, AL_EAXREVERB_LATE_REVERB_GAIN, cur[slot_id].flLateReverbGain); + this->alEffectf( efx_effect_id, AL_EAXREVERB_LATE_REVERB_DELAY, cur[slot_id].flLateReverbDelay); + this->alEffectfv(efx_effect_id, AL_EAXREVERB_LATE_REVERB_PAN, cur[slot_id].flLateReverbPan); + this->alEffectf( efx_effect_id, AL_EAXREVERB_ECHO_TIME, cur[slot_id].flEchoTime); + this->alEffectf( efx_effect_id, AL_EAXREVERB_ECHO_DEPTH, cur[slot_id].flEchoDepth); + this->alEffectf( efx_effect_id, AL_EAXREVERB_MODULATION_TIME, cur[slot_id].flModulationTime); + this->alEffectf( efx_effect_id, AL_EAXREVERB_MODULATION_DEPTH, cur[slot_id].flModulationDepth); + this->alEffectf( efx_effect_id, AL_EAXREVERB_AIR_ABSORPTION_GAINHF, cur[slot_id].flAirAbsorptionGainHF); + this->alEffectf( efx_effect_id, AL_EAXREVERB_HFREFERENCE, cur[slot_id].flHFReference); + this->alEffectf( efx_effect_id, AL_EAXREVERB_LFREFERENCE, cur[slot_id].flLFReference); + this->alEffectf( efx_effect_id, AL_EAXREVERB_ROOM_ROLLOFF_FACTOR, cur[slot_id].flRoomRolloffFactor); + this->alEffecti( efx_effect_id, AL_EAXREVERB_DECAY_HFLIMIT, cur[slot_id].iDecayHFLimit); break; case EfxReverbEngine::REVERB: - this->alEffectf( efx_effect_id, AL_REVERB_DENSITY, current_efx_properties_of_slot[slot_id].flDensity); - this->alEffectf( efx_effect_id, AL_REVERB_DIFFUSION, current_efx_properties_of_slot[slot_id].flDiffusion); - this->alEffectf( efx_effect_id, AL_REVERB_GAIN, current_efx_properties_of_slot[slot_id].flGain); - this->alEffectf( efx_effect_id, AL_REVERB_GAINHF, current_efx_properties_of_slot[slot_id].flGainHF); - this->alEffectf( efx_effect_id, AL_REVERB_DECAY_TIME, current_efx_properties_of_slot[slot_id].flDecayTime); - this->alEffectf( efx_effect_id, AL_REVERB_DECAY_HFRATIO, current_efx_properties_of_slot[slot_id].flDecayHFRatio); - this->alEffectf( efx_effect_id, AL_REVERB_REFLECTIONS_GAIN, current_efx_properties_of_slot[slot_id].flReflectionsGain); - this->alEffectf( efx_effect_id, AL_REVERB_REFLECTIONS_DELAY, current_efx_properties_of_slot[slot_id].flReflectionsDelay); - this->alEffectf( efx_effect_id, AL_REVERB_LATE_REVERB_GAIN, current_efx_properties_of_slot[slot_id].flLateReverbGain); - this->alEffectf( efx_effect_id, AL_REVERB_LATE_REVERB_DELAY, current_efx_properties_of_slot[slot_id].flLateReverbDelay); - this->alEffectf( efx_effect_id, AL_REVERB_AIR_ABSORPTION_GAINHF, current_efx_properties_of_slot[slot_id].flAirAbsorptionGainHF); - this->alEffectf( efx_effect_id, AL_REVERB_ROOM_ROLLOFF_FACTOR, current_efx_properties_of_slot[slot_id].flRoomRolloffFactor); - this->alEffectf( efx_effect_id, AL_REVERB_DECAY_HFLIMIT, current_efx_properties_of_slot[slot_id].iDecayHFLimit); + this->alEffectf( efx_effect_id, AL_REVERB_DENSITY, cur[slot_id].flDensity); + this->alEffectf( efx_effect_id, AL_REVERB_DIFFUSION, cur[slot_id].flDiffusion); + this->alEffectf( efx_effect_id, AL_REVERB_GAIN, cur[slot_id].flGain); + this->alEffectf( efx_effect_id, AL_REVERB_GAINHF, cur[slot_id].flGainHF); + this->alEffectf( efx_effect_id, AL_REVERB_DECAY_TIME, cur[slot_id].flDecayTime); + this->alEffectf( efx_effect_id, AL_REVERB_DECAY_HFRATIO, cur[slot_id].flDecayHFRatio); + this->alEffectf( efx_effect_id, AL_REVERB_REFLECTIONS_GAIN, cur[slot_id].flReflectionsGain); + this->alEffectf( efx_effect_id, AL_REVERB_REFLECTIONS_DELAY, cur[slot_id].flReflectionsDelay); + this->alEffectf( efx_effect_id, AL_REVERB_LATE_REVERB_GAIN, cur[slot_id].flLateReverbGain); + this->alEffectf( efx_effect_id, AL_REVERB_LATE_REVERB_DELAY, cur[slot_id].flLateReverbDelay); + this->alEffectf( efx_effect_id, AL_REVERB_AIR_ABSORPTION_GAINHF, cur[slot_id].flAirAbsorptionGainHF); + this->alEffectf( efx_effect_id, AL_REVERB_ROOM_ROLLOFF_FACTOR, cur[slot_id].flRoomRolloffFactor); + this->alEffectf( efx_effect_id, AL_REVERB_DECAY_HFLIMIT, cur[slot_id].iDecayHFLimit); break; case EfxReverbEngine::NONE: @@ -592,9 +593,10 @@ std::tuple SoundManager::ComputeEarlyReflectionsPro raycast_direction.normalise(); // accompany direction vector for how the intersectsTris function works + // todo: audio restore // check for nearby collision meshes - Ray ray = Ray(m_listener_position, raycast_direction * max_distance * App::GetGameContext()->GetTerrain()->GetCollisions()->GetCellSize()); - std::pair intersection = App::GetGameContext()->GetTerrain()->GetCollisions()->intersectsTris(ray); +/* Ray ray = Ray(m_listener_position, raycast_direction * max_distance * Audio::GetGameContext()->GetTerrain()->GetCollisions()->GetCellSize()); + std::pair intersection = Audio::GetGameContext()->GetTerrain()->GetCollisions()->intersectsTris(ray); if (intersection.first) { @@ -604,7 +606,7 @@ std::tuple SoundManager::ComputeEarlyReflectionsPro ray.setDirection(ray.getDirection().normalisedCopy()); // check for nearby collision boxes - for (const collision_box_t& collision_box : App::GetGameContext()->GetTerrain()->GetCollisions()->getCollisionBoxes()) +/* for (const collision_box_t& collision_box : Audio::GetGameContext()->GetTerrain()->GetCollisions()->getCollisionBoxes()) { if (!collision_box.enabled || collision_box.virt) { continue; } intersection = ray.intersects(Ogre::AxisAlignedBox(collision_box.lo, collision_box.hi)); @@ -615,11 +617,11 @@ std::tuple SoundManager::ComputeEarlyReflectionsPro } // check for nearby actors - const ActorPtrVec& actors = App::GetGameContext()->GetActorManager()->GetActors(); + const ActorPtrVec& actors = Audio::GetGameContext()->GetActorManager()->GetActors(); for(const ActorPtr& actor : actors) { // ignore own truck if player is driving one - if (actor == App::GetGameContext()->GetPlayerCharacter()->GetActorCoupling()) { continue; } + if (actor == Audio::GetGameContext()->GetPlayerCharacter()->GetActorCoupling()) { continue; } intersection = ray.intersects(actor->ar_bounding_box); if (intersection.first && intersection.second <= max_distance) @@ -627,7 +629,7 @@ std::tuple SoundManager::ComputeEarlyReflectionsPro closest_surface_distance_in_this_direction = std::min(closest_surface_distance_in_this_direction, intersection.second); } } - +*/ closest_surface_distance = std::min(closest_surface_distance, closest_surface_distance_in_this_direction); if(closest_surface_distance_in_this_direction <= max_distance) @@ -820,9 +822,11 @@ void SoundManager::recomputeAllSources() void SoundManager::UpdateObstructionFilter(const int hardware_index) const { + // todo: audio restore +#if 0 if(hardware_sources_map[hardware_index] == -1) { return; } // no sound assigned to hardware source - if(!App::audio_enable_obstruction->getBool()) + if(!Audio::audio_enable_obstruction) { // detach the obstruction filter in case it was attached when the feature was previously enabled alSourcei(hardware_sources[hardware_index], AL_DIRECT_FILTER, AL_FILTER_NULL); @@ -835,7 +839,7 @@ void SoundManager::UpdateObstructionFilter(const int hardware_index) const // TODO: Simulate diffraction path. // always obstruct sounds if the player is in a vehicle - if(App::GetSoundScriptManager()->ListenerIsInsideThePlayerCoupledActor()) + if(Audio::GetSoundScriptManager()->ListenerIsInsideThePlayerCoupledActor()) { obstruction_detected = true; } @@ -853,7 +857,7 @@ void SoundManager::UpdateObstructionFilter(const int hardware_index) const Ray direct_path_to_sound = Ray(m_listener_position, direction_to_sound); // perform line of sight check against terrain - intersection = App::GetGameContext()->GetTerrain()->GetCollisions()->intersectsTerrain(direct_path_to_sound, distance_to_sound); + intersection = Audio::GetGameContext()->GetTerrain()->GetCollisions()->intersectsTerrain(direct_path_to_sound, distance_to_sound); obstruction_detected = intersection.first; if(!obstruction_detected) @@ -861,7 +865,7 @@ void SoundManager::UpdateObstructionFilter(const int hardware_index) const // perform line of sight check against collision meshes // for this to work correctly, the direction vector of the ray must have // the length of the distance from the listener to the sound - intersection = App::GetGameContext()->GetTerrain()->GetCollisions()->intersectsTris(direct_path_to_sound); + intersection = Audio::GetGameContext()->GetTerrain()->GetCollisions()->intersectsTris(direct_path_to_sound); obstruction_detected = intersection.first; } @@ -872,7 +876,7 @@ void SoundManager::UpdateObstructionFilter(const int hardware_index) const if(!obstruction_detected) { // perform line of sight check agains collision boxes - for (const collision_box_t& collision_box : App::GetGameContext()->GetTerrain()->GetCollisions()->getCollisionBoxes()) + for (const collision_box_t& collision_box : Audio::GetGameContext()->GetTerrain()->GetCollisions()->getCollisionBoxes()) { if (!collision_box.enabled || collision_box.virt) { continue; } @@ -888,7 +892,7 @@ void SoundManager::UpdateObstructionFilter(const int hardware_index) const if(!obstruction_detected) { // perform line of sight check against actors - const ActorPtrVec& actors = App::GetGameContext()->GetActorManager()->GetActors(); + const ActorPtrVec& actors = Audio::GetGameContext()->GetActorManager()->GetActors(); bool soundsource_belongs_to_current_actor = false; for(const ActorPtr actor : actors) { @@ -933,6 +937,7 @@ void SoundManager::UpdateObstructionFilter(const int hardware_index) const // reset direct filter for the source in case it has been set previously alSourcei(hardware_sources[hardware_index], AL_DIRECT_FILTER, AL_FILTER_NULL); } +#endif } void SoundManager::recomputeSource(int source_index, int reason, float vfl, Vector3* vvec) @@ -965,7 +970,7 @@ void SoundManager::recomputeSource(int source_index, int reason, float vfl, Vect break; case Sound::REASON_STOP: alSourceStop(hw_source); break; - case Sound::REASON_GAIN: alSourcef(hw_source, AL_GAIN, vfl * App::audio_master_volume->getFloat()); + case Sound::REASON_GAIN: alSourcef(hw_source, AL_GAIN, vfl * Audio::audio_master_volume); break; case Sound::REASON_LOOP: alSourcei(hw_source, AL_LOOPING, (vfl > 0.5) ? AL_TRUE : AL_FALSE); break; @@ -1032,7 +1037,7 @@ void SoundManager::assign(int source_index, int hardware_index) // the hardware source is supposed to be stopped! alSourcei(hw_source, AL_BUFFER, audio_source->buffer); - alSourcef(hw_source, AL_GAIN, audio_source->gain * App::audio_master_volume->getFloat()); + alSourcef(hw_source, AL_GAIN, audio_source->gain * Audio::audio_master_volume); alSourcei(hw_source, AL_LOOPING, (audio_source->loop) ? AL_TRUE : AL_FALSE); alSourcef(hw_source, AL_PITCH, audio_source->pitch); alSource3f(hw_source, AL_POSITION, audio_source->position.x, audio_source->position.y, audio_source->position.z); @@ -1072,7 +1077,7 @@ void SoundManager::resumeAllSounds() if (!audio_device) return; // no mutex needed - alListenerf(AL_GAIN, App::audio_master_volume->getFloat()); + alListenerf(AL_GAIN, Audio::audio_master_volume); } void SoundManager::setMasterVolume(float v) @@ -1080,7 +1085,7 @@ void SoundManager::setMasterVolume(float v) if (!audio_device) return; // no mutex needed - App::audio_master_volume->setVal(v); // TODO: Use 'pending' mechanism and set externally, only 'apply' here. + Audio::audio_master_volume = v; // TODO: Use 'pending' mechanism and set externally, only 'apply' here. alListenerf(AL_GAIN, v); } @@ -1315,4 +1320,4 @@ bool SoundManager::loadWAVFile(String filename, ALuint buffer, Ogre::String reso return false; } -#endif // USE_OPENAL +// #endif // USE_OPENAL diff --git a/src/sound/SoundManager.h b/src/sound/SoundManager.h index 00319a47..9fe5650f 100644 --- a/src/sound/SoundManager.h +++ b/src/sound/SoundManager.h @@ -19,14 +19,14 @@ along with Rigs of Rods. If not, see . */ -#ifdef USE_OPENAL +// #ifdef USE_OPENAL #pragma once -#include "Actor.h" -#include "Application.h" -#include "Collisions.h" -#include "GameContext.h" +// #include "Actor.h" +// #include "Application.h" +// #include "Collisions.h" +// #include "GameContext.h" #include "Sound.h" #include "SoundScriptManager.h" @@ -325,4 +325,4 @@ class SoundManager } // namespace RoR -#endif // USE_OPENAL +// #endif // USE_OPENAL diff --git a/src/sound/SoundScriptManager.cpp b/src/sound/SoundScriptManager.cpp index e85d244d..8d4d5509 100644 --- a/src/sound/SoundScriptManager.cpp +++ b/src/sound/SoundScriptManager.cpp @@ -18,17 +18,19 @@ along with Rigs of Rods. If not, see . */ -#ifdef USE_OPENAL +// #ifdef USE_OPENAL + #include "SoundScriptManager.h" -#include "Actor.h" -#include "CameraManager.h" -#include "GameContext.h" -#include "IWater.h" +// #include "Actor.h" +// #include "CameraManager.h" +// #include "GameContext.h" +// #include "IWater.h" +#include "OgreCamera.h" #include "Sound.h" #include "SoundManager.h" -#include "Utils.h" +// #include "Utils.h" #include @@ -40,6 +42,23 @@ const float SoundScriptInstance::PITCHDOWN_CUTOFF_FACTOR = 5.0f; const SoundPtr SoundScriptInstance::SOUNDPTR_NULL; // Dummy value to be returned as const reference. + + +// Audio static // todo: audio rem, use pSet +float Audio::audio_master_volume = 1.0; +bool Audio::audio_enable_creak = false; +bool Audio::audio_enable_obstruction = false; +bool Audio::audio_enable_reflection_panning = false; +std::string Audio::audio_device_name; +float Audio::audio_doppler_factor = 1.0; +bool Audio::audio_menu_music = false; +bool Audio::audio_enable_efx = true; +bool Audio::audio_engine_controls_environmental_audio = true; +int Audio::audio_efx_reverb_engine = 2; //(int)EfxReverbEngine::EAXREVERB +std::string Audio::audio_default_listener_efx_preset; +std::string Audio::audio_force_listener_efx_preset; + + SoundScriptManager::SoundScriptManager() : disabled(true) , loading_base(false) @@ -109,7 +128,7 @@ void SoundScriptManager::trigOnce(const ActorPtr& actor, int trig, int linkType, if (actor) { - trigOnce(actor->ar_instance_id, trig, linkType, linkItemID); + // trigOnce(actor->ar_instance_id, trig, linkType, linkItemID); } } @@ -137,7 +156,7 @@ void SoundScriptManager::trigStart(const ActorPtr& actor, int trig, int linkType if (actor) { - trigStart(actor->ar_instance_id, trig, linkType, linkItemID); + // trigStart(actor->ar_instance_id, trig, linkType, linkItemID); } } @@ -168,7 +187,7 @@ void SoundScriptManager::trigStop(const ActorPtr& actor, int trig, int linkType, if (actor) { - trigStop(actor->ar_instance_id, trig, linkType, linkItemID); + // trigStop(actor->ar_instance_id, trig, linkType, linkItemID); } } @@ -198,7 +217,7 @@ void SoundScriptManager::trigKill(const ActorPtr& actor, int trig, int linkType, if (actor) { - trigKill(actor->ar_instance_id, trig, linkType, linkItemID); + // trigKill(actor->ar_instance_id, trig, linkType, linkItemID); } } @@ -228,7 +247,7 @@ void SoundScriptManager::trigToggle(const ActorPtr& actor, int trig, int linkTyp if (actor) { - trigToggle(actor->ar_instance_id, trig, linkType, linkItemID); + // trigToggle(actor->ar_instance_id, trig, linkType, linkItemID); } } @@ -248,10 +267,10 @@ bool SoundScriptManager::getTrigState(const ActorPtr& actor, int trig, int linkT if (disabled) return false; - if (actor) - return getTrigState(actor->ar_instance_id, trig, linkType, linkItemID); - else - return false; + // if (actor) + // return getTrigState(actor->ar_instance_id, trig, linkType, linkItemID); + // else + // return false; } bool SoundScriptManager::getTrigState(int actor_id, int trig, int linkType, int linkItemID) @@ -269,7 +288,7 @@ void SoundScriptManager::modulate(const ActorPtr& actor, int mod, float value, i if (actor) { - modulate(actor->ar_instance_id, mod, value, linkType, linkItemID); + // modulate(actor->ar_instance_id, mod, value, linkType, linkItemID); } } @@ -307,12 +326,14 @@ void SoundScriptManager::modulate(int actor_id, int mod, float value, int linkTy } } -void SoundScriptManager::update(float dt_sec) +void SoundScriptManager::update(float dt_sec, + Ogre::Camera* camera_node) + //Ogre::SceneNode* camera_node) { - if (App::sim_state->getEnum() == SimState::RUNNING || - App::sim_state->getEnum() == SimState::EDITOR_MODE) + // if (Audio::sim_state->getEnum() == SimState::RUNNING || + // Audio::sim_state->getEnum() == SimState::EDITOR_MODE) { - Ogre::SceneNode* camera_node = App::GetCameraManager()->GetCameraNode(); + // Ogre::SceneNode* camera_node = Audio::GetCameraManager()->GetCameraNode(); static Vector3 last_camera_position; Ogre::Vector3 camera_position = camera_node->getPosition(); Vector3 camera_velocity = (camera_position - last_camera_position) / dt_sec; @@ -323,10 +344,11 @@ void SoundScriptManager::update(float dt_sec) SetListener(camera_position, camera_direction, camera_up, camera_velocity); Ogre::Vector3 listener_position = sound_manager->GetListenerPosition(); - const auto water = App::GetGameContext()->GetTerrain()->getWater(); - m_listener_is_underwater = (water != nullptr ? water->IsUnderWater(listener_position) : false); + // todo: audio new restore + // const auto water = Audio::GetGameContext()->GetTerrain()->getWater(); + m_listener_is_underwater = 0; // (water != nullptr ? water->IsUnderWater(listener_position) : false); - ActorPtr actor_of_player = App::GetGameContext()->GetPlayerCharacter()->GetActorCoupling(); + /*ActorPtr actor_of_player = Audio::GetGameContext()->GetPlayerCharacter()->GetActorCoupling(); if (actor_of_player != nullptr) { m_listener_is_inside_the_player_coupled_actor = actor_of_player->ar_bounding_box.contains(listener_position); @@ -334,10 +356,15 @@ void SoundScriptManager::update(float dt_sec) else { m_listener_is_inside_the_player_coupled_actor = false; - } + }*/ + m_listener_is_inside_the_player_coupled_actor = 0; SetListenerEnvironment(camera_position); sound_manager->Update(dt_sec); + + // for (auto& in : instances) // test- + // if (in) + // removeInstance(in); } } @@ -355,7 +382,7 @@ void SoundScriptManager::SetListenerEnvironment(Vector3 listener_position) const EFXEAXREVERBPROPERTIES* listener_reverb_properties = nullptr; - if (App::audio_engine_controls_environmental_audio->getBool()) + if (Audio::audio_engine_controls_environmental_audio) { if(ListenerIsUnderwater()) { @@ -373,13 +400,13 @@ void SoundScriptManager::SetListenerEnvironment(Vector3 listener_position) sound_manager->SetAirAbsorptionFactor(1.0f); } - if (App::audio_enable_efx->getBool()) + if (Audio::audio_enable_efx) { listener_reverb_properties = GetReverbPresetAt(listener_position); } } - if (App::audio_enable_efx->getBool()) + if (Audio::audio_enable_efx) { // always update the environment in case it was changed via console or script sound_manager->SetListenerEnvironment(listener_reverb_properties); @@ -391,13 +418,13 @@ const EFXEAXREVERBPROPERTIES* SoundScriptManager::GetReverbPresetAt(const Ogre:: // for the listener we do additional checks if(position == sound_manager->GetListenerPosition()) { - if (!App::audio_force_listener_efx_preset->getStr().empty()) + if (!Audio::audio_force_listener_efx_preset.empty()) { - return sound_manager->GetEfxProperties(App::audio_force_listener_efx_preset->getStr()); + return sound_manager->GetEfxProperties(Audio::audio_force_listener_efx_preset); } } - - const auto water = App::GetGameContext()->GetTerrain()->getWater(); +/* // todo: audio new restore + const auto water = Audio::GetGameContext()->GetTerrain()->getWater(); bool position_is_underwater = (water != nullptr ? water->IsUnderWater(position) : false); if(position_is_underwater) { @@ -405,7 +432,7 @@ const EFXEAXREVERBPROPERTIES* SoundScriptManager::GetReverbPresetAt(const Ogre:: } // check if position is inside a collision box with a reverb_preset assigned to it - for (const collision_box_t& collision_box : App::GetGameContext()->GetTerrain()->GetCollisions()->getCollisionBoxes()) + for (const collision_box_t& collision_box : Audio::GetGameContext()->GetTerrain()->GetCollisions()->getCollisionBoxes()) { if (!collision_box.reverb_preset_name.empty()) { @@ -417,10 +444,10 @@ const EFXEAXREVERBPROPERTIES* SoundScriptManager::GetReverbPresetAt(const Ogre:: } } } - +*/ if(position == sound_manager->GetListenerPosition()) { - return sound_manager->GetEfxProperties(App::audio_default_listener_efx_preset->getStr()); + return sound_manager->GetEfxProperties(Audio::audio_default_listener_efx_preset); } else { @@ -467,6 +494,7 @@ SoundScriptInstancePtr SoundScriptManager::createInstance(Ogre::String templaten if (templates.find(templatename) == templates.end()) { + LOG("SoundScriptManager: not found template: "+templatename); return NULL; // found no template with this name } @@ -588,7 +616,8 @@ void SoundScriptManager::parseScript(DataStreamPtr& stream, const String& groupN while (!stream->eof()) { - line = SanitizeUtf8String(stream->getLine()); + // line = SanitizeUtf8String(stream->getLine()); + line = stream->getLine(); // ignore comments & blanks if (!(line.length() == 0 || line.substr(0, 2) == "//")) { @@ -850,7 +879,7 @@ bool SoundScriptTemplate::setParameter(Ogre::StringVector vec) trigger_source = SS_TRIG_GEARSLIDE; return true; }; - if (vec[1] == String("creak") && App::audio_enable_creak->getBool()) + if (vec[1] == String("creak") && Audio::audio_enable_creak) { trigger_source = SS_TRIG_CREAK; return true; @@ -1563,4 +1592,4 @@ void SoundScriptInstance::setEnabled(bool e) } } -#endif // USE_OPENAL +// #endif // USE_OPENAL diff --git a/src/sound/SoundScriptManager.h b/src/sound/SoundScriptManager.h index c8065433..ca70b432 100644 --- a/src/sound/SoundScriptManager.h +++ b/src/sound/SoundScriptManager.h @@ -19,17 +19,16 @@ along with Rigs of Rods. If not, see . */ -#ifdef USE_OPENAL +// #ifdef USE_OPENAL #pragma once -#include "AngelScriptBindings.h" -#include "Application.h" +// #include "Application.h" #include "RefCountingObjectPtr.h" #include "Sound.h" #include "SoundManager.h" -#include +// #include #ifdef __APPLE__ #include @@ -338,7 +337,8 @@ class SoundScriptManager : public Ogre::ScriptLoader bool isDisabled() { return disabled; } - void update(float dt_sec); + // void update(float dt_sec, Ogre::SceneNode* camera_node); + void update(float dt_sec, Ogre::Camera* camera_node); /** * @return True if the listener position is below water level. False otherwise. @@ -400,14 +400,14 @@ class SoundScriptManager : public Ogre::ScriptLoader } // namespace RoR -#else // USE_OPENAL +// #else // USE_OPENAL -#define SOUND_PLAY_ONCE(_ACTOR_, _TRIG_) -#define SOUND_START(_ACTOR_, _TRIG_) -#define SOUND_STOP(_ACTOR_, _TRIG_) -#define SOUND_TOGGLE(_ACTOR_, _TRIG_) -#define SOUND_KILL(_ACTOR_, _TRIG_) -#define SOUND_GET_STATE(_ACTOR_, _TRIG_) (false) -#define SOUND_MODULATE(_ACTOR_, _MOD_, _VALUE_) +// #define SOUND_PLAY_ONCE(_ACTOR_, _TRIG_) +// #define SOUND_START(_ACTOR_, _TRIG_) +// #define SOUND_STOP(_ACTOR_, _TRIG_) +// #define SOUND_TOGGLE(_ACTOR_, _TRIG_) +// #define SOUND_KILL(_ACTOR_, _TRIG_) +// #define SOUND_GET_STATE(_ACTOR_, _TRIG_) (false) +// #define SOUND_MODULATE(_ACTOR_, _MOD_, _VALUE_) -#endif // USE_OPENAL +// #endif // USE_OPENAL