فهرست منبع

Merge pull request #2281 from marauder2k7/OpenALDevBuildBranch

OpenALEffects
Areloch 6 سال پیش
والد
کامیت
33f8a75529

+ 51 - 0
Engine/source/sfx/openal/LoadOAL.h

@@ -36,6 +36,8 @@
 #else
 #  include <al/al.h>
 #  include <al/alc.h>
+#  include <AL/alext.h>
+#  include <AL/efx-presets.h>
 #endif
 
 #ifndef ALAPIENTRY
@@ -134,6 +136,31 @@ typedef void *         (ALCAPIENTRY *LPALCGETPROCADDRESS)(ALCdevice *device, con
 typedef ALCenum        (ALCAPIENTRY *LPALCGETENUMVALUE)(ALCdevice *device, const ALCchar *enumname );
 typedef const ALCchar* (ALCAPIENTRY *LPALCGETSTRING)( ALCdevice *device, ALCenum param );
 typedef void           (ALCAPIENTRY *LPALCGETINTEGERV)( ALCdevice *device, ALCenum param, ALCsizei size, ALCint *dest );
+///Changes for effects
+typedef void			  (ALAPIENTRY *LPALGENEFFECTS)(ALsizei n, ALuint *effects);
+typedef void			  (ALAPIENTRY *LPALDELETEEFFECTS)(ALsizei n, const ALuint *effects);
+typedef ALboolean      (ALAPIENTRY *LPALISEFFECT)(ALuint effect);
+typedef void			  (ALAPIENTRY *LPALEFFECTI)(ALuint effect, ALenum param, ALint value);
+typedef void			  (ALAPIENTRY *LPALEFFECTIV)(ALuint effect, ALenum param, const ALint *values);
+typedef void			  (ALAPIENTRY *LPALEFFECTF)(ALuint effect, ALenum param, ALfloat value);
+typedef void			  (ALAPIENTRY *LPALEFFECTFV)(ALuint effect, ALenum param, const ALfloat *values);
+typedef void			  (ALAPIENTRY *LPALGETEFFECTI)(ALuint effect, ALenum param, ALint *value);
+typedef void			  (ALAPIENTRY *LPALGETEFFECTIV)(ALuint effect, ALenum param, ALint *values);
+typedef void			  (ALAPIENTRY *LPALGETEFFECTF)(ALuint effect, ALenum param, ALfloat *value);
+typedef void			  (ALAPIENTRY *LPALGETEFFECTFV)(ALuint effect, ALenum param, ALfloat *values);
+typedef void			  (ALAPIENTRY *LPALRELEASEALEFFECTS)(ALCdevice *device);
+typedef void			  (ALAPIENTRY *LPALGENAUXILIARYEFFECTSLOTS)(ALsizei n, ALuint *effectslots);
+typedef void			  (ALAPIENTRY *LPALDELETEAUXILIARYEFFECTSLOTS)(ALsizei n, const ALuint *effectslots);
+typedef ALboolean      (ALAPIENTRY *LPALISAUXILIARYEFFECTSLOT)(ALuint effectslot);
+typedef void		     (ALAPIENTRY *LPALAUXILIARYEFFECTSLOTI)(ALuint effectslot, ALenum param, ALint value);
+typedef void			  (ALAPIENTRY *LPALAUXILIARYEFFECTSLOTIV)(ALuint effectslot, ALenum param, const ALint *values);
+typedef void			  (ALAPIENTRY *LPALAUXILIARYEFFECTSLOTF)(ALuint effectslot, ALenum param, ALfloat value);
+typedef void			  (ALAPIENTRY *LPALAUXILIARYEFFECTSLOTFV)(ALuint effectslot, ALenum param, const ALfloat *values);
+typedef void			  (ALAPIENTRY *LPALGETAUXILIARYEFFECTSLOTI)(ALuint effectslot, ALenum param, ALint *value);
+typedef void			  (ALAPIENTRY *LPALGETAUXILIARYEFFECTSLOTIV)(ALuint effectslot, ALenum param, ALint *values);
+typedef void			  (ALAPIENTRY *LPALGETAUXILIARYEFFECTSLOTF)(ALuint effectslot, ALenum param, ALfloat *value);
+typedef void			  (ALAPIENTRY *LPALGETAUXILIARYEFFECTSLOTFV)(ALuint effectslot, ALenum param, ALfloat *values);
+typedef void			  (ALAPIENTRY *LPALSOURCE3I)(ALuint source, ALenum param, ALint value1, ALint value2, ALint value3);
 
 typedef struct
 {
@@ -166,6 +193,7 @@ typedef struct
 	LPALISSOURCE				   alIsSource;
 	LPALSOURCEI					   alSourcei;
 	LPALSOURCEF					   alSourcef;
+   LPALSOURCE3I				   alSource3i;
 	LPALSOURCE3F				   alSource3f;
 	LPALSOURCEFV				   alSourcefv;
 	LPALGETSOURCEI				   alGetSourcei;
@@ -203,6 +231,29 @@ typedef struct
 	LPALCISEXTENSIONPRESENT		alcIsExtensionPresent;
 	LPALCGETPROCADDRESS			alcGetProcAddress;
 	LPALCGETENUMVALUE			   alcGetEnumValue;
+   LPALGENEFFECTS				   alGenEffects;
+   LPALDELETEEFFECTS			   alDeleteEffects;
+   LPALISEFFECT				   alIsEffect;
+   LPALEFFECTI					   alEffecti;
+   LPALEFFECTIV				   alEffectiv;
+   LPALEFFECTF					   alEffectf;
+   LPALEFFECTFV				   alEffectfv;
+   LPALGETEFFECTI 				alGetEffecti;
+   LPALGETEFFECTIV				alGetEffectiv;
+   LPALGETEFFECTF				   alGetEffectf;
+   LPALGETEFFECTFV				alGetEffectfv;
+   LPALRELEASEALEFFECTS		   alReleaseEffects;
+   LPALGENAUXILIARYEFFECTSLOTS			alGenAuxiliaryEffectSlots;
+   LPALDELETEAUXILIARYEFFECTSLOTS		alDeleteAuxiliaryEffectSlots;
+   LPALISAUXILIARYEFFECTSLOT				alIsAuxiliaryEffectSlot;
+   LPALAUXILIARYEFFECTSLOTI				alAuxiliaryEffectSloti;
+   LPALAUXILIARYEFFECTSLOTIV				alAuxiliaryEffectSlotiv;
+   LPALAUXILIARYEFFECTSLOTF				alAuxiliaryEffectSlotf;
+   LPALAUXILIARYEFFECTSLOTFV				alAuxiliaryEffectSlotfv;
+   LPALGETAUXILIARYEFFECTSLOTI			alGetAuxiliaryEffectSloti;
+   LPALGETAUXILIARYEFFECTSLOTIV			alGetAuxiliaryEffectSlotiv;
+   LPALGETAUXILIARYEFFECTSLOTF			alGetAuxiliaryEffectSlotf;
+   LPALGETAUXILIARYEFFECTSLOTFV			alGetAuxiliaryEffectSlotfv;
 } OPENALFNTABLE, *LPOPENALFNTABLE;
 #endif
 

+ 127 - 4
Engine/source/sfx/openal/sfxALDevice.cpp

@@ -42,16 +42,21 @@ SFXALDevice::SFXALDevice(  SFXProvider *provider,
 
    // TODO: The OpenAL device doesn't set the primary buffer
    // $pref::SFX::frequency or $pref::SFX::bitrate!
+   //check auxiliary device sends 4 and add them to the device
+   ALint attribs[4] = { 0 };
+   ALCint iSends = 0;
+   attribs[0] = ALC_MAX_AUXILIARY_SENDS;
+   attribs[1] = 4;
 
    mDevice = mOpenAL.alcOpenDevice( name );
    mOpenAL.alcGetError( mDevice );
    if( mDevice ) 
    {
-      mContext = mOpenAL.alcCreateContext( mDevice, NULL );
+      mContext = mOpenAL.alcCreateContext( mDevice, attribs );
 
       if( mContext ) 
          mOpenAL.alcMakeContextCurrent( mContext );
-
+      mOpenAL.alcGetIntegerv(mDevice, ALC_MAX_AUXILIARY_SENDS, 1, &iSends);
       U32 err = mOpenAL.alcGetError( mDevice );
       
       if( err != ALC_NO_ERROR )
@@ -78,7 +83,10 @@ SFXALDevice::SFXALDevice(  SFXProvider *provider,
 SFXALDevice::~SFXALDevice()
 {
    _releaseAllResources();
-
+   ///cleanup our effects
+   mOpenAL.alDeleteAuxiliaryEffectSlots(4, effectSlot);
+   mOpenAL.alDeleteEffects(2, effect);
+   ///cleanup of effects ends
    mOpenAL.alcMakeContextCurrent( NULL );
 	mOpenAL.alcDestroyContext( mContext );
 	mOpenAL.alcCloseDevice( mDevice );
@@ -145,6 +153,9 @@ void SFXALDevice::setListener( U32 index, const SFXListenerProperties& listener
    mOpenAL.alListenerfv( AL_POSITION, pos );
    mOpenAL.alListenerfv( AL_VELOCITY, velocity );
    mOpenAL.alListenerfv( AL_ORIENTATION, (const F32 *)&tupple[0] );
+   ///Pass a unit size to openal, 1.0 assumes 1 meter to 1 game unit.
+   ///Crucial for air absorbtion calculations.
+   mOpenAL.alListenerf(AL_METERS_PER_UNIT, 1.0f);
 }
 
 //-----------------------------------------------------------------------------
@@ -164,7 +175,13 @@ void SFXALDevice::setDistanceModel( SFXDistanceModel model )
          if( mUserRolloffFactor != mRolloffFactor )
             _setRolloffFactor( mUserRolloffFactor );
          break;
-         
+         /// create a case for our exponential distance model
+      case SFXDistanceModelExponent:
+         mOpenAL.alDistanceModel(AL_EXPONENT_DISTANCE_CLAMPED);
+         if (mUserRolloffFactor != mRolloffFactor)
+            _setRolloffFactor(mUserRolloffFactor);
+         break;
+
       default:
          AssertWarn( false, "SFXALDevice::setDistanceModel - distance model not implemented" );
    }
@@ -200,3 +217,109 @@ void SFXALDevice::setRolloffFactor( F32 factor )
       
    mUserRolloffFactor = factor;
 }
+
+void SFXALDevice::openSlots()
+{
+   for (uLoop = 0; uLoop < 4; uLoop++)
+   {
+      mOpenAL.alGenAuxiliaryEffectSlots(1, &effectSlot[uLoop]);
+   }
+
+   for (uLoop = 0; uLoop < 2; uLoop++)
+   {
+      mOpenAL.alGenEffects(1, &effect[uLoop]);
+   }
+   ///debug string output so we know our slots are open
+   Platform::outputDebugString("Slots Open");
+}
+
+///create reverb effect
+void SFXALDevice::setReverb(const SFXReverbProperties& reverb)
+{
+   ///output a debug string so we know each time the reverb changes
+   Platform::outputDebugString("Updated");
+
+   ///load an efxeaxreverb default and add our values from
+   ///sfxreverbproperties to it
+   EFXEAXREVERBPROPERTIES prop = EFX_REVERB_PRESET_GENERIC;
+
+   prop.flDensity = reverb.flDensity;
+   prop.flDiffusion = reverb.flDiffusion;
+   prop.flGain = reverb.flGain;
+   prop.flGainHF = reverb.flGainHF;
+   prop.flGainLF = reverb.flGainLF;
+   prop.flDecayTime = reverb.flDecayTime;
+   prop.flDecayHFRatio = reverb.flDecayHFRatio;
+   prop.flDecayLFRatio = reverb.flDecayLFRatio;
+   prop.flReflectionsGain = reverb.flReflectionsGain;
+   prop.flReflectionsDelay = reverb.flReflectionsDelay;
+   prop.flLateReverbGain = reverb.flLateReverbGain;
+   prop.flLateReverbDelay = reverb.flLateReverbDelay;
+   prop.flEchoTime = reverb.flEchoTime;
+   prop.flEchoDepth = reverb.flEchoDepth;
+   prop.flModulationTime = reverb.flModulationTime;
+   prop.flModulationDepth = reverb.flModulationDepth;
+   prop.flAirAbsorptionGainHF = reverb.flAirAbsorptionGainHF;
+   prop.flHFReference = reverb.flHFReference;
+   prop.flLFReference = reverb.flLFReference;
+   prop.flRoomRolloffFactor = reverb.flRoomRolloffFactor;
+   prop.iDecayHFLimit = reverb.iDecayHFLimit;
+
+   if (mOpenAL.alGetEnumValue("AL_EFFECT_EAXREVERB") != 0)
+   {
+
+      /// EAX Reverb is available. Set the EAX effect type
+
+      mOpenAL.alEffecti(effect[0], AL_EFFECT_TYPE, AL_EFFECT_EAXREVERB);
+
+      ///add our values to the setup of the reverb
+
+      mOpenAL.alEffectf(effect[0], AL_EAXREVERB_DENSITY, prop.flDensity);
+      mOpenAL.alEffectf(effect[0], AL_EAXREVERB_DIFFUSION, prop.flDiffusion);
+      mOpenAL.alEffectf(effect[0], AL_EAXREVERB_GAIN, prop.flGain);
+      mOpenAL.alEffectf(effect[0], AL_EAXREVERB_GAINHF, prop.flGainHF);
+      mOpenAL.alEffectf(effect[0], AL_EAXREVERB_GAINLF, prop.flGainLF);
+      mOpenAL.alEffectf(effect[0], AL_EAXREVERB_DECAY_TIME, prop.flDecayTime);
+      mOpenAL.alEffectf(effect[0], AL_EAXREVERB_DECAY_HFRATIO, prop.flDecayHFRatio);
+      mOpenAL.alEffectf(effect[0], AL_EAXREVERB_DECAY_LFRATIO, prop.flDecayLFRatio);
+      mOpenAL.alEffectf(effect[0], AL_EAXREVERB_REFLECTIONS_GAIN, prop.flReflectionsGain);
+      mOpenAL.alEffectf(effect[0], AL_EAXREVERB_REFLECTIONS_DELAY, prop.flReflectionsDelay);
+      mOpenAL.alEffectf(effect[0], AL_EAXREVERB_LATE_REVERB_GAIN, prop.flLateReverbGain);
+      mOpenAL.alEffectf(effect[0], AL_EAXREVERB_LATE_REVERB_DELAY, prop.flLateReverbDelay);
+      mOpenAL.alEffectf(effect[0], AL_EAXREVERB_ECHO_TIME, prop.flEchoTime);
+      mOpenAL.alEffectf(effect[0], AL_EAXREVERB_ECHO_DEPTH, prop.flEchoDepth);
+      mOpenAL.alEffectf(effect[0], AL_EAXREVERB_MODULATION_TIME, prop.flModulationTime);
+      mOpenAL.alEffectf(effect[0], AL_EAXREVERB_MODULATION_DEPTH, prop.flModulationDepth);
+      mOpenAL.alEffectf(effect[0], AL_EAXREVERB_AIR_ABSORPTION_GAINHF, prop.flAirAbsorptionGainHF);
+      mOpenAL.alEffectf(effect[0], AL_EAXREVERB_HFREFERENCE, prop.flHFReference);
+      mOpenAL.alEffectf(effect[0], AL_EAXREVERB_LFREFERENCE, prop.flLFReference);
+      mOpenAL.alEffectf(effect[0], AL_EAXREVERB_ROOM_ROLLOFF_FACTOR, prop.flRoomRolloffFactor);
+      mOpenAL.alEffecti(effect[0], AL_EAXREVERB_DECAY_HFLIMIT, prop.iDecayHFLimit);
+      mOpenAL.alAuxiliaryEffectSloti(1, AL_EFFECTSLOT_EFFECT, effect[0]);
+      Platform::outputDebugString("eax reverb properties set");
+
+   }
+   else
+   {
+
+      /// No EAX Reverb. Set the standard reverb effect
+      mOpenAL.alEffecti(effect[0], AL_EFFECT_TYPE, AL_EFFECT_REVERB);
+
+      mOpenAL.alEffectf(effect[0], AL_REVERB_DENSITY, prop.flDensity);
+      mOpenAL.alEffectf(effect[0], AL_REVERB_DIFFUSION, prop.flDiffusion);
+      mOpenAL.alEffectf(effect[0], AL_REVERB_GAIN, prop.flGain);
+      mOpenAL.alEffectf(effect[0], AL_REVERB_GAINHF, prop.flGainHF);
+      mOpenAL.alEffectf(effect[0], AL_REVERB_DECAY_TIME, prop.flDecayTime);
+      mOpenAL.alEffectf(effect[0], AL_REVERB_DECAY_HFRATIO, prop.flDecayHFRatio);
+      mOpenAL.alEffectf(effect[0], AL_REVERB_REFLECTIONS_GAIN, prop.flReflectionsGain);
+      mOpenAL.alEffectf(effect[0], AL_REVERB_REFLECTIONS_DELAY, prop.flReflectionsDelay);
+      mOpenAL.alEffectf(effect[0], AL_REVERB_LATE_REVERB_GAIN, prop.flLateReverbGain);
+      mOpenAL.alEffectf(effect[0], AL_REVERB_LATE_REVERB_DELAY, prop.flLateReverbDelay);
+      mOpenAL.alEffectf(effect[0], AL_REVERB_AIR_ABSORPTION_GAINHF, prop.flAirAbsorptionGainHF);
+      mOpenAL.alEffectf(effect[0], AL_REVERB_ROOM_ROLLOFF_FACTOR, prop.flRoomRolloffFactor);
+      mOpenAL.alEffecti(effect[0], AL_REVERB_DECAY_HFLIMIT, prop.iDecayHFLimit);
+      mOpenAL.alAuxiliaryEffectSloti(1, AL_EFFECTSLOT_EFFECT, effect[0]);
+
+   }
+
+}

+ 9 - 0
Engine/source/sfx/openal/sfxALDevice.h

@@ -85,6 +85,15 @@ class SFXALDevice : public SFXDevice
       virtual void setDistanceModel( SFXDistanceModel model );
       virtual void setDopplerFactor( F32 factor );
       virtual void setRolloffFactor( F32 factor );
+      //function for openAL to open slots
+      virtual void openSlots();
+      //slots
+      ALuint	effectSlot[4] = { 0 };
+      ALuint	effect[2] = { 0 };
+      ALuint   uLoop;
+      //get values from sfxreverbproperties and pass it to openal device
+      virtual void setReverb(const SFXReverbProperties& reverb);
+      virtual void resetReverb() {}
 };
 
 #endif // _SFXALDEVICE_H_

+ 2 - 1
Engine/source/sfx/openal/sfxALVoice.cpp

@@ -118,7 +118,8 @@ void SFXALVoice::_play()
    #ifdef DEBUG_SPEW
    Platform::outputDebugString( "[SFXALVoice] Starting playback" );
    #endif
-   
+   //send every voice that plays to the alauxiliary slot that has the reverb
+   mOpenAL.alSource3i(mSourceName, AL_AUXILIARY_SEND_FILTER, 1, 0, AL_FILTER_NULL);
    mOpenAL.alSourcePlay( mSourceName );
    
    //WORKAROUND: Adjust play cursor for buggy OAL when resuming playback.  Do this after alSourcePlay

+ 111 - 0
Engine/source/sfx/openal/win32/LoadOAL.cpp

@@ -439,7 +439,118 @@ ALboolean LoadOAL10Library(char *szOALFullPathName, LPOPENALFNTABLE lpOALFnTable
 		OutputDebugStringA("Failed to retrieve 'alcGetEnumValue' function address\n");
 		return AL_FALSE;
 	}
+   lpOALFnTable->alGenEffects = (LPALGENEFFECTS)GetProcAddress(g_hOpenALDLL, "alGenEffects");
+   if (lpOALFnTable->alGenEffects == NULL)
+   {
+      OutputDebugStringA("Failed to retrieve 'alGenEffects' function address\n");
+   }
+   lpOALFnTable->alEffecti = (LPALEFFECTI)GetProcAddress(g_hOpenALDLL, "alEffecti");
+   if (lpOALFnTable->alEffecti == NULL)
+   {
+      OutputDebugStringA("Failed to retrieve 'alEffecti' function address\n");
+   }
+   lpOALFnTable->alEffectiv = (LPALEFFECTIV)GetProcAddress(g_hOpenALDLL, "alEffectiv");
+   if (lpOALFnTable->alEffectiv == NULL)
+   {
+      OutputDebugStringA("Failed to retrieve 'alEffectiv' function address\n");
+   }
+   lpOALFnTable->alEffectf = (LPALEFFECTF)GetProcAddress(g_hOpenALDLL, "alEffectf");
+   if (lpOALFnTable->alEffectf == NULL)
+   {
+      OutputDebugStringA("Failed to retrieve 'alEffectf' function address\n");
+   }
+   lpOALFnTable->alEffectfv = (LPALEFFECTFV)GetProcAddress(g_hOpenALDLL, "alEffectfv");
+   if (lpOALFnTable->alEffectfv == NULL)
+   {
+      OutputDebugStringA("Failed to retrieve 'alEffectfv' function address\n");
+   }
+   lpOALFnTable->alGetEffecti = (LPALGETEFFECTI)GetProcAddress(g_hOpenALDLL, "alGetEffecti");
+   if (lpOALFnTable->alGetEffecti == NULL)
+   {
+      OutputDebugStringA("Failed to retrieve 'alGetEffecti' function address\n");
+   }
+   lpOALFnTable->alGetEffectiv = (LPALGETEFFECTIV)GetProcAddress(g_hOpenALDLL, "alGetEffectiv");
+   if (lpOALFnTable->alGetEffectiv == NULL)
+   {
+      OutputDebugStringA("Failed to retrieve 'alGetEffectiv' function address\n");
+   }
+   lpOALFnTable->alGetEffectf = (LPALGETEFFECTF)GetProcAddress(g_hOpenALDLL, "alGetEffectf");
+   if (lpOALFnTable->alGetEffectf == NULL)
+   {
+      OutputDebugStringA("Failed to retrieve 'alGetEffectf' function address\n");
+   }
+   lpOALFnTable->alGetEffectfv = (LPALGETEFFECTFV)GetProcAddress(g_hOpenALDLL, "alGetEffectfv");
+   if (lpOALFnTable->alGetEffectfv == NULL)
+   {
+      OutputDebugStringA("Failed to retrieve 'alGetEffectfv' function address\n");
+   }
 
+   lpOALFnTable->alDeleteEffects = (LPALDELETEEFFECTS)GetProcAddress(g_hOpenALDLL, "alDeleteEffects");
+   if (lpOALFnTable->alDeleteEffects == NULL)
+   {
+      OutputDebugStringA("Failed to retrieve 'alDeleteEffects' function address\n");
+   }
+   lpOALFnTable->alIsEffect = (LPALISEFFECT)GetProcAddress(g_hOpenALDLL, "alIsEffect");
+   if (lpOALFnTable->alIsEffect == NULL)
+   {
+      OutputDebugStringA("Failed to retrieve 'alIsEffect' function address\n");
+   }
+   lpOALFnTable->alAuxiliaryEffectSlotf = (LPALAUXILIARYEFFECTSLOTF)GetProcAddress(g_hOpenALDLL, "alAuxiliaryEffectSlotf");
+   if (lpOALFnTable->alAuxiliaryEffectSlotf == NULL)
+   {
+      OutputDebugStringA("Failed to retrieve 'alAuxiliaryEffectSlotf' function address\n");
+   }
+   lpOALFnTable->alAuxiliaryEffectSlotfv = (LPALAUXILIARYEFFECTSLOTFV)GetProcAddress(g_hOpenALDLL, "alAuxiliaryEffectSlotfv");
+   if (lpOALFnTable->alAuxiliaryEffectSlotfv == NULL)
+   {
+      OutputDebugStringA("Failed to retrieve 'alAuxiliaryEffectSlotfv' function address\n");
+   }
+   lpOALFnTable->alAuxiliaryEffectSloti = (LPALAUXILIARYEFFECTSLOTI)GetProcAddress(g_hOpenALDLL, "alAuxiliaryEffectSloti");
+   if (lpOALFnTable->alAuxiliaryEffectSloti == NULL)
+   {
+      OutputDebugStringA("Failed to retrieve 'alAuxiliaryEffectSloti' function address\n");
+   }
+   lpOALFnTable->alAuxiliaryEffectSlotiv = (LPALAUXILIARYEFFECTSLOTIV)GetProcAddress(g_hOpenALDLL, "alAuxiliaryEffectSlotiv");
+   if (lpOALFnTable->alAuxiliaryEffectSlotiv == NULL)
+   {
+      OutputDebugStringA("Failed to retrieve 'alAuxiliaryEffectSlotiv' function address\n");
+   }
+   lpOALFnTable->alIsAuxiliaryEffectSlot = (LPALISAUXILIARYEFFECTSLOT)GetProcAddress(g_hOpenALDLL, "alIsAuxiliaryEffectSlot");
+   if (lpOALFnTable->alIsAuxiliaryEffectSlot == NULL)
+   {
+      OutputDebugStringA("Failed to retrieve 'alIsAuxiliaryEffectSlot' function address\n");
+   }
+   lpOALFnTable->alGenAuxiliaryEffectSlots = (LPALGENAUXILIARYEFFECTSLOTS)GetProcAddress(g_hOpenALDLL, "alGenAuxiliaryEffectSlots");
+   if (lpOALFnTable->alGenAuxiliaryEffectSlots == NULL)
+   {
+      OutputDebugStringA("Failed to retrieve 'alGenAuxiliaryEffectSlots' function address\n");
+   }
+   lpOALFnTable->alDeleteAuxiliaryEffectSlots = (LPALDELETEAUXILIARYEFFECTSLOTS)GetProcAddress(g_hOpenALDLL, "alDeleteAuxiliaryEffectSlots");
+   if (lpOALFnTable->alDeleteAuxiliaryEffectSlots == NULL)
+   {
+      OutputDebugStringA("Failed to retrieve 'alDeleteAuxiliaryEffectSlots' function address\n");
+   }
+   lpOALFnTable->alGetAuxiliaryEffectSlotf = (LPALGETAUXILIARYEFFECTSLOTF)GetProcAddress(g_hOpenALDLL, "alGetAuxiliaryEffectSlotf");
+   if (lpOALFnTable->alGetAuxiliaryEffectSlotf == NULL)
+   {
+      OutputDebugStringA("Failed to retrieve 'alGetAuxiliaryEffectSlotf' function address\n");
+   }
+   lpOALFnTable->alGetAuxiliaryEffectSlotfv = (LPALGETAUXILIARYEFFECTSLOTFV)GetProcAddress(g_hOpenALDLL, "alGetAuxiliaryEffectSlotfv");
+   if (lpOALFnTable->alGetAuxiliaryEffectSlotfv == NULL)
+   {
+      OutputDebugStringA("Failed to retrieve 'alGetAuxiliaryEffectSlotfv' function address\n");
+   }
+   lpOALFnTable->alGetAuxiliaryEffectSloti = (LPALGETAUXILIARYEFFECTSLOTI)GetProcAddress(g_hOpenALDLL, "alGetAuxiliaryEffectSloti");
+   if (lpOALFnTable->alGetAuxiliaryEffectSloti == NULL)
+   {
+      OutputDebugStringA("Failed to retrieve 'alGetAuxiliaryEffectSloti' function address\n");
+   }
+   lpOALFnTable->alGetAuxiliaryEffectSlotiv = (LPALGETAUXILIARYEFFECTSLOTIV)GetProcAddress(g_hOpenALDLL, "alGetAuxiliaryEffectSlotiv");
+   if (lpOALFnTable->alGetAuxiliaryEffectSlotiv == NULL)
+   {
+      OutputDebugStringA("Failed to retrieve 'alGetAuxiliaryEffectSlotiv' function address\n");
+   }
+   lpOALFnTable->alSource3i = (LPALSOURCE3I)GetProcAddress(g_hOpenALDLL, "alSource3i");
 	return AL_TRUE;
 }
 

+ 189 - 154
Engine/source/sfx/sfxCommon.h

@@ -153,6 +153,7 @@ enum SFXDistanceModel
 {
    SFXDistanceModelLinear,             ///< Volume decreases linearly from min to max where it reaches zero.
    SFXDistanceModelLogarithmic,        ///< Volume halves every min distance steps starting from min distance; attenuation stops at max distance.
+   SFXDistanceModelExponent,           /// exponential falloff for distance attenuation.
 };
 
 DefineEnumType( SFXDistanceModel );
@@ -187,6 +188,14 @@ inline F32 SFXDistanceAttenuation( SFXDistanceModel model, F32 minDistance, F32
          
          gain = minDistance / ( minDistance + rolloffFactor * ( distance - minDistance ) );
          break;
+
+         ///create exponential distance model    
+      case SFXDistanceModelExponent:
+         distance = getMax(distance, minDistance);
+         distance = getMin(distance, maxDistance);
+
+         gain = pow((distance / minDistance), (-rolloffFactor));
+         break;
          
    }
    
@@ -313,97 +322,97 @@ class SFXFormat
 /// Reverb environment properties.
 ///
 /// @note A given device may not implement all properties.
+///restructure our reverbproperties to match openal
+
 class SFXReverbProperties
 {
-   public:
-   
-      typedef void Parent;
-         
-      F32   mEnvSize;
-      F32   mEnvDiffusion;
-      S32   mRoom;
-      S32   mRoomHF;
-      S32   mRoomLF;
-      F32   mDecayTime;
-      F32   mDecayHFRatio;
-      F32   mDecayLFRatio;
-      S32   mReflections;
-      F32   mReflectionsDelay;
-      F32   mReflectionsPan[ 3 ];
-      S32   mReverb;
-      F32   mReverbDelay;
-      F32   mReverbPan[ 3 ];
-      F32   mEchoTime;
-      F32   mEchoDepth;
-      F32   mModulationTime;
-      F32   mModulationDepth;
-      F32   mAirAbsorptionHF;
-      F32   mHFReference;
-      F32   mLFReference;
-      F32   mRoomRolloffFactor;
-      F32   mDiffusion;
-      F32   mDensity;
-      S32   mFlags;
-      
-      SFXReverbProperties()
-         : mEnvSize( 7.5f ),
-           mEnvDiffusion( 1.0f ),
-           mRoom( -1000 ),
-           mRoomHF( -100 ),
-           mRoomLF( 0 ),
-           mDecayTime( 1.49f ),
-           mDecayHFRatio( 0.83f ),
-           mDecayLFRatio( 1.0f ),
-           mReflections( -2602 ),
-           mReflectionsDelay( 0.007f ),
-           mReverb( 200 ),
-           mReverbDelay( 0.011f ),
-           mEchoTime( 0.25f ),
-           mEchoDepth( 0.0f ),
-           mModulationTime( 0.25f ),
-           mModulationDepth( 0.0f ),
-           mAirAbsorptionHF( -5.0f ),
-           mHFReference( 5000.0f ),
-           mLFReference( 250.0f ),
-           mRoomRolloffFactor( 0.0f ),
-           mDiffusion( 100.0f ),
-           mDensity( 100.0f ),
-           mFlags( 0 )
-      {
-         mReflectionsPan[ 0 ] = 0.0f;
-         mReflectionsPan[ 1 ] = 0.0f;
-         mReflectionsPan[ 2 ] = 0.0f;
-         
-         mReverbPan[ 0 ] = 0.0f;
-         mReverbPan[ 1 ] = 0.0f;
-         mReverbPan[ 2 ] = 0.0f;
-      }
-      
-      void validate()
-      {
-         mEnvSize                = mClampF( mEnvSize,                1.0f,     100.0f );
-         mEnvDiffusion           = mClampF( mEnvDiffusion,           0.0f,     1.0f );
-         mRoom                   = mClamp( mRoom,                    -10000,  0 );
-         mRoomHF                 = mClamp( mRoomHF,                  -10000,  0 );
-         mRoomLF                 = mClamp( mRoomLF,                  -10000,  0 );
-         mDecayTime              = mClampF( mDecayTime,              0.1f,     20.0f );
-         mDecayHFRatio           = mClampF( mDecayHFRatio,           0.1f,     2.0f );
-         mDecayLFRatio           = mClampF( mDecayLFRatio,           0.1f,     2.0f );
-         mReflections            = mClamp( mReflections,             -10000,  1000 );
-         mReflectionsDelay       = mClampF( mReflectionsDelay,       0.0f,     0.3f );
-         mReverb                 = mClamp( mReverb,                  -10000,  2000 );
-         mReverbDelay            = mClampF( mReverbDelay,            0.0f,     0.1f );
-         mEchoTime               = mClampF( mEchoTime,               0.075f,   0.25f );
-         mEchoDepth              = mClampF( mEchoDepth,              0.0f,     1.0f );
-         mModulationTime         = mClampF( mModulationTime,         0.04f,    4.0f );
-         mModulationDepth        = mClampF( mModulationDepth,        0.0f,     1.0f );
-         mAirAbsorptionHF        = mClampF( mAirAbsorptionHF,        -100.0f,    0.0f );
-         mHFReference            = mClampF( mHFReference,            1000.0f,  20000.0f );
-         mLFReference            = mClampF( mLFReference,            20.0f,    1000.0f );
-         mRoomRolloffFactor      = mClampF( mRoomRolloffFactor,      0.0f,     10.0f );
-         mDiffusion              = mClampF( mDiffusion,              0.0f,     100.0f );
-         mDensity                = mClampF( mDensity,                0.0f,     100.0f );
-      }
+public:
+
+   struct Parent;
+
+   float flDensity;
+   float flDiffusion;
+   float flGain;
+   float flGainHF;
+   float flGainLF;
+   float flDecayTime;
+   float flDecayHFRatio;
+   float flDecayLFRatio;
+   float flReflectionsGain;
+   float flReflectionsDelay;
+   float flReflectionsPan[3];
+   float flLateReverbGain;
+   float flLateReverbDelay;
+   float flLateReverbPan[3];
+   float flEchoTime;
+   float flEchoDepth;
+   float flModulationTime;
+   float flModulationDepth;
+   float flAirAbsorptionGainHF;
+   float flHFReference;
+   float flLFReference;
+   float flRoomRolloffFactor;
+   int   iDecayHFLimit;
+
+   ///set our defaults to be the same as no reverb otherwise our reverb
+   ///effects menu sounds
+   SFXReverbProperties()
+   {
+      flDensity = 0.0f;
+      flDiffusion = 0.0f;
+      flGain = 0.0f;
+      flGainHF = 0.0f;
+      flGainLF = 0.0000f;
+      flDecayTime = 0.0f;
+      flDecayHFRatio = 0.0f;
+      flDecayLFRatio = 0.0f;
+      flReflectionsGain = 0.0f;
+      flReflectionsDelay = 0.0f;
+      flReflectionsPan[3] = 0.0f;
+      flLateReverbGain = 0.0f;
+      flLateReverbDelay = 0.0f;
+      flLateReverbPan[3] = 0.0f;
+      flEchoTime = 0.0f;
+      flEchoDepth = 0.0f;
+      flModulationTime = 0.0f;
+      flModulationDepth = 0.0f;
+      flAirAbsorptionGainHF = 0.0f;
+      flHFReference = 0.0f;
+      flLFReference = 0.0f;
+      flRoomRolloffFactor = 0.0f;
+      iDecayHFLimit = 0;
+   }
+
+   void validate()
+   {
+      flDensity = mClampF(flDensity, 0.0f, 1.0f);
+      flDiffusion = mClampF(flDiffusion, 0.0f, 1.0f);
+      flGain = mClampF(flGain, 0.0f, 1.0f);
+      flGainHF = mClampF(flGainHF, 0.0f, 1.0f);
+      flGainLF = mClampF(flGainLF, 0.0f, 1.0f);
+      flDecayTime = mClampF(flDecayTime, 0.1f, 20.0f);
+      flDecayHFRatio = mClampF(flDecayHFRatio, 0.1f, 2.0f);
+      flDecayLFRatio = mClampF(flDecayLFRatio, 0.1f, 2.0f);
+      flReflectionsGain = mClampF(flReflectionsGain, 0.0f, 3.16f);
+      flReflectionsDelay = mClampF(flReflectionsDelay, 0.0f, 0.3f);
+      flReflectionsPan[0] = mClampF(flReflectionsPan[0], -1.0f, 1.0f);
+      flReflectionsPan[1] = mClampF(flReflectionsPan[1], -1.0f, 1.0f);
+      flReflectionsPan[2] = mClampF(flReflectionsPan[2], -1.0f, 1.0f);
+      flLateReverbGain = mClampF(flLateReverbGain, 0.0f, 10.0f);
+      flLateReverbDelay = mClampF(flLateReverbDelay, 0.0f, 0.1f);
+      flLateReverbPan[0] = mClampF(flLateReverbPan[0], -1.0f, 1.0f);
+      flLateReverbPan[1] = mClampF(flLateReverbPan[1], -1.0f, 1.0f);
+      flLateReverbPan[2] = mClampF(flLateReverbPan[2], -1.0f, 1.0f);
+      flEchoTime = mClampF(flEchoTime, 0.075f, 0.25f);
+      flEchoDepth = mClampF(flEchoDepth, 0.0f, 1.0f);
+      flModulationTime = mClampF(flModulationTime, 0.04f, 4.0f);
+      flModulationDepth = mClampF(flModulationDepth, 0.0f, 1.0f);
+      flAirAbsorptionGainHF = mClampF(flAirAbsorptionGainHF, 0.892f, 1.0f);
+      flHFReference = mClampF(flHFReference, 1000.0f, 20000.0f);
+      flLFReference = mClampF(flLFReference, 20.0f, 1000.0f);
+      flRoomRolloffFactor = mClampF(flRoomRolloffFactor, 0.0f, 10.0f);
+      iDecayHFLimit = mClampF(iDecayHFLimit, 0, 1);
+   }
 };
 
 
@@ -415,73 +424,99 @@ class SFXReverbProperties
 /// Sound reverb properties.
 ///
 /// @note A given SFX device may not implement all properties.
+///not in use by openal yet if u are going to use ambient reverb zones its 
+///probably best to not have reverb on the sound effect itself.
 class SFXSoundReverbProperties
 {
-   public:
-   
-      typedef void Parent;
-   
-      S32   mDirect;
-      S32   mDirectHF;
-      S32   mRoom;
-      S32   mRoomHF;
-      S32   mObstruction;
-      F32   mObstructionLFRatio;
-      S32   mOcclusion;
-      F32   mOcclusionLFRatio;
-      F32   mOcclusionRoomRatio;
-      F32   mOcclusionDirectRatio;
-      S32   mExclusion;
-      F32   mExclusionLFRatio;
-      S32   mOutsideVolumeHF;
-      F32   mDopplerFactor;
-      F32   mRolloffFactor;
-      F32   mRoomRolloffFactor;
-      F32   mAirAbsorptionFactor;
-      S32   mFlags;
-      
-      SFXSoundReverbProperties()
-         : mDirect( 0 ),
-           mDirectHF( 0 ),
-           mRoom( 0 ),
-           mRoomHF( 0 ),
-           mObstruction( 0 ),
-           mObstructionLFRatio( 0.0f ),
-           mOcclusion( 0 ),
-           mOcclusionLFRatio( 0.25f ),
-           mOcclusionRoomRatio( 1.5f ),
-           mOcclusionDirectRatio( 1.0f ),
-           mExclusion( 0 ),
-           mExclusionLFRatio( 1.0f ),
-           mOutsideVolumeHF( 0 ),
-           mDopplerFactor( 0.0f ),
-           mRolloffFactor( 0.0f ),
-           mRoomRolloffFactor( 0.0f ),
-           mAirAbsorptionFactor( 1.0f ),
-           mFlags( 0 )
-      {
-      }
-      
-      void validate()
-      {
-         mDirect              = mClamp( mDirect,                -10000,  1000 );
-         mDirectHF            = mClamp( mDirectHF,              -10000,  0 );
-         mRoom                = mClamp( mRoom,                  -10000,  1000 );
-         mRoomHF              = mClamp( mRoomHF,                -10000,  0 );
-         mObstruction         = mClamp( mObstruction,           -10000,  0 );
-         mObstructionLFRatio  = mClampF( mObstructionLFRatio,   0.0f,     1.0f );
-         mOcclusion           = mClamp( mOcclusion,             -10000,  0 );
-         mOcclusionLFRatio    = mClampF( mOcclusionLFRatio,     0.0f,     1.0f );
-         mOcclusionRoomRatio  = mClampF( mOcclusionRoomRatio,   0.0f,     10.0f );
-         mOcclusionDirectRatio= mClampF( mOcclusionDirectRatio, 0.0f,     10.0f );
-         mExclusion           = mClamp( mExclusion,             -10000,  0 );
-         mExclusionLFRatio    = mClampF( mExclusionLFRatio,     0.0f,     1.0f );
-         mOutsideVolumeHF     = mClamp( mOutsideVolumeHF,       -10000,  0 );
-         mDopplerFactor       = mClampF( mDopplerFactor,        0.0f,     10.0f );
-         mRolloffFactor       = mClampF( mRolloffFactor,        0.0f,     10.0f );
-         mRoomRolloffFactor   = mClampF( mRoomRolloffFactor,    0.0f,     10.0f );
-         mAirAbsorptionFactor = mClampF( mAirAbsorptionFactor,  0.0f,     10.0f );
-      }
+public:
+
+   typedef void Parent;
+
+   float flDensity;
+   float flDiffusion;
+   float flGain;
+   float flGainHF;
+   float flGainLF;
+   float flDecayTime;
+   float flDecayHFRatio;
+   float flDecayLFRatio;
+   float flReflectionsGain;
+   float flReflectionsDelay;
+   float flReflectionsPan[3];
+   float flLateReverbGain;
+   float flLateReverbDelay;
+   float flLateReverbPan[3];
+   float flEchoTime;
+   float flEchoDepth;
+   float flModulationTime;
+   float flModulationDepth;
+   float flAirAbsorptionGainHF;
+   float flHFReference;
+   float flLFReference;
+   float flRoomRolloffFactor;
+   int   iDecayHFLimit;
+
+
+   ///Set our defaults to have no reverb
+   ///if you are going to use zone reverbs its
+   ///probably best not to use per-voice reverb
+   SFXSoundReverbProperties()
+   {
+      flDensity = 0.0f;
+      flDiffusion = 0.0f;
+      flGain = 0.0f;
+      flGainHF = 0.0f;
+      flGainLF = 0.0000f;
+      flDecayTime = 0.0f;
+      flDecayHFRatio = 0.0f;
+      flDecayLFRatio = 0.0f;
+      flReflectionsGain = 0.0f;
+      flReflectionsDelay = 0.0f;
+      flReflectionsPan[3] = 0.0f;
+      flLateReverbGain = 0.0f;
+      flLateReverbDelay = 0.0f;
+      flLateReverbPan[3] = 0.0f;
+      flEchoTime = 0.0f;
+      flEchoDepth = 0.0f;
+      flModulationTime = 0.0f;
+      flModulationDepth = 0.0f;
+      flAirAbsorptionGainHF = 0.0f;
+      flHFReference = 0.0f;
+      flLFReference = 0.0f;
+      flRoomRolloffFactor = 0.0f;
+      iDecayHFLimit = 0;
+   }
+
+   void validate()
+   {
+      flDensity = mClampF(flDensity, 0.0f, 1.0f);
+      flDiffusion = mClampF(flDiffusion, 0.0f, 1.0f);
+      flGain = mClampF(flGain, 0.0f, 1.0f);
+      flGainHF = mClampF(flGainHF, 0.0f, 1.0f);
+      flGainLF = mClampF(flGainLF, 0.0f, 1.0f);
+      flDecayTime = mClampF(flDecayTime, 0.1f, 20.0f);
+      flDecayHFRatio = mClampF(flDecayHFRatio, 0.1f, 2.0f);
+      flDecayLFRatio = mClampF(flDecayLFRatio, 0.1f, 2.0f);
+      flReflectionsGain = mClampF(flReflectionsGain, 0.0f, 3.16f);
+      flReflectionsDelay = mClampF(flReflectionsDelay, 0.0f, 0.3f);
+      flReflectionsPan[0] = mClampF(flReflectionsPan[0], -1.0f, 1.0f);
+      flReflectionsPan[1] = mClampF(flReflectionsPan[1], -1.0f, 1.0f);
+      flReflectionsPan[2] = mClampF(flReflectionsPan[2], -1.0f, 1.0f);
+      flLateReverbGain = mClampF(flLateReverbGain, 0.0f, 10.0f);
+      flLateReverbDelay = mClampF(flLateReverbDelay, 0.0f, 0.1f);
+      flLateReverbPan[0] = mClampF(flLateReverbPan[0], -1.0f, 1.0f);
+      flLateReverbPan[1] = mClampF(flLateReverbPan[1], -1.0f, 1.0f);
+      flLateReverbPan[2] = mClampF(flLateReverbPan[2], -1.0f, 1.0f);
+      flEchoTime = mClampF(flEchoTime, 0.075f, 0.25f);
+      flEchoDepth = mClampF(flEchoDepth, 0.0f, 1.0f);
+      flModulationTime = mClampF(flModulationTime, 0.04f, 4.0f);
+      flModulationDepth = mClampF(flModulationDepth, 0.0f, 1.0f);
+      flAirAbsorptionGainHF = mClampF(flAirAbsorptionGainHF, 0.892f, 1.0f);
+      flHFReference = mClampF(flHFReference, 1000.0f, 20000.0f);
+      flLFReference = mClampF(flLFReference, 20.0f, 1000.0f);
+      flRoomRolloffFactor = mClampF(flRoomRolloffFactor, 0.0f, 10.0f);
+      iDecayHFLimit = mClampF(iDecayHFLimit, 0, 1);
+   }
 };
 
 

+ 91 - 121
Engine/source/sfx/sfxDescription.cpp

@@ -389,91 +389,55 @@ void SFXDescription::initPersistFields()
 
    addGroup( "Reverb" );
    
-      addField( "useCustomReverb",     TypeBool,   Offset( mUseReverb, SFXDescription ),
-         "If true, use the reverb properties defined here on sounds.\n"
-         "By default, sounds will be assigned a generic reverb profile.  By setting this flag to true, "
-         "a custom reverb setup can be defined using the \"Reverb\" properties that will then be assigned "
-         "to sounds playing with the description.\n\n"
-         "@ref SFX_reverb" );
-      addField( "reverbDirect",              TypeS32,    Offset( mReverb.mDirect, SFXDescription ),
-         "Direct path level (at low and mid frequencies).\n"
-         "@note SUPPORTED: EAX/I3DL2/FMODSFX\n\n"
-         "@see http://www.atc.creative.com/algorithms/eax20.pdf" );
-      addField( "reverbDirectHF",            TypeS32,    Offset( mReverb.mDirectHF, SFXDescription ),
-         "Relative direct path level at high frequencies.\n"
-         "@note SUPPORTED: EAX/I3DL2\n\n"
-         "@see http://www.atc.creative.com/algorithms/eax20.pdf" );
-      addField( "reverbRoom",                TypeS32,    Offset( mReverb.mRoom, SFXDescription ),
-         "Room effect level (at low and mid frequencies).\n"
-         "@note SUPPORTED: EAX/I3DL2/FMODSFX\n\n"
-         "@see http://www.atc.creative.com/algorithms/eax20.pdf" );
-      addField( "reverbRoomHF",              TypeS32,    Offset( mReverb.mRoomHF, SFXDescription ),
-         "Relative room effect level at high frequencies.\n"
-         "@note SUPPORTED: EAX/I3DL2\n\n"
-         "@see http://www.atc.creative.com/algorithms/eax20.pdf" );
-      addField( "reverbObstruction",         TypeS32,    Offset( mReverb.mObstruction, SFXDescription ),
-         "Main obstruction control (attenuation at high frequencies).\n"
-         "@note SUPPORTED: EAX/I3DL2\n\n"
-         "@see http://www.atc.creative.com/algorithms/eax20.pdf" );
-      addField( "reverbObstructionLFRatio",  TypeF32,    Offset( mReverb.mObstructionLFRatio, SFXDescription ),
-         "Obstruction low-frequency level re. main control.\n"
-         "@note SUPPORTED: EAX/I3DL2\n\n"
-         "@see http://www.atc.creative.com/algorithms/eax20.pdf" );
-      addField( "reverbOcclusion",           TypeS32,    Offset( mReverb.mOcclusion, SFXDescription ),
-         "Main occlusion control (attenuation at high frequencies)."
-         "@note SUPPORTED: EAX/I3DL2\n\n"
-         "\n@see http://www.atc.creative.com/algorithms/eax20.pdf" );
-      addField( "reverbOcclusionLFRatio",    TypeF32,    Offset( mReverb.mOcclusionLFRatio, SFXDescription ),
-         "Occlusion low-frequency level re. main control.\n"
-         "@note SUPPORTED: EAX/I3DL2\n\n"
-         "@see http://www.atc.creative.com/algorithms/eax20.pdf" );
-      addField( "reverbOcclusionRoomRatio",  TypeF32,    Offset( mReverb.mOcclusionRoomRatio, SFXDescription ),
-         "Relative occlusion control for room effect.\n"
-         "@note SUPPORTED: EAX Only\n\n"
-         "@see http://www.atc.creative.com/algorithms/eax20.pdf" );
-      addField( "reverbOcclusionDirectRatio",TypeF32,    Offset( mReverb.mOcclusionDirectRatio, SFXDescription ),
-         "Relative occlusion control for direct path.\n"
-         "@note SUPPORTED: EAX Only\n\n"
-         "@see http://www.atc.creative.com/algorithms/eax20.pdf" );
-      addField( "reverbExclusion",           TypeS32,    Offset( mReverb.mExclusion, SFXDescription ),
-         "Main exclusion control (attenuation at high frequencies).\n"
-         "@note SUPPORTED: EAX Only\n\n"
-         "@see http://www.atc.creative.com/algorithms/eax20.pdf" );
-      addField( "reverbExclusionLFRatio",    TypeF32,    Offset( mReverb.mExclusionLFRatio, SFXDescription ),
-         "Exclusion low-frequency level re. main control.\n"
-         "@note SUPPORTED: EAX Only\n\n"
-         "@see http://www.atc.creative.com/algorithms/eax20.pdf" );
-      addField( "reverbOutsideVolumeHF",     TypeS32,    Offset( mReverb.mOutsideVolumeHF, SFXDescription ),
-         "Outside sound cone level at high frequencies.\n"
-         "@note SUPPORTED: EAX Only\n\n"
-         "@see http://www.atc.creative.com/algorithms/eax20.pdf" );
-      addField( "reverbDopplerFactor",       TypeF32,    Offset( mReverb.mDopplerFactor, SFXDescription ),
-         "Per-source doppler factor.\n"
-         "@note SUPPORTED: EAX Only\n\n"
-         "@see http://www.atc.creative.com/algorithms/eax20.pdf" );
-      addField( "reverbReverbRolloffFactor", TypeF32,    Offset( mReverb.mRolloffFactor, SFXDescription ),
-         "Per-source logarithmic falloff factor.\n"
-         "@note SUPPORTED: EAX Only\n\n"
-         "@see http://www.atc.creative.com/algorithms/eax20.pdf" );
-      addField( "reverbRoomRolloffFactor",   TypeF32,    Offset( mReverb.mRoomRolloffFactor, SFXDescription ),
-         "Room effect falloff factor.\n"
-         "@note SUPPORTED: EAX/I3DL2\n\n"
-         "@see http://www.atc.creative.com/algorithms/eax20.pdf" );
-      addField( "reverbAirAbsorptionFactor", TypeF32,    Offset( mReverb.mAirAbsorptionFactor, SFXDescription ),
-         "Multiplies SFXEnvironment::airAbsorptionHR.\n"
-         "@note SUPPORTED: EAX Only\n\n"
-         "@see http://www.atc.creative.com/algorithms/eax20.pdf" );
-      addField( "reverbFlags",         TypeS32,    Offset( mReverb.mFlags, SFXDescription ),
-         "Bitfield combination of per-sound reverb flags.\n"
-         "@see REVERB_DIRECTHFAUTO\n"
-         "@see REVERB_ROOMAUTO\n"
-         "@see REVERB_ROOMHFAUTO\n"
-         "@see REVERB_INSTANCE0\n"
-         "@see REVERB_INSTANCE1\n"
-         "@see REVERB_INSTANCE2\n"
-         "@see REVERB_INSTANCE3\n" );
-      
-   endGroup( "Reverb" );
+   addField("useCustomReverb", TypeBool, Offset(mUseReverb, SFXDescription),
+      "If true, use the reverb properties defined here on sounds.\n"
+      "By default, sounds will be assigned a generic reverb profile.  By setting this flag to true, "
+      "a custom reverb setup can be defined using the \"Reverb\" properties that will then be assigned "
+      "to sounds playing with the description.\n\n"
+      "@ref SFX_reverb");
+   addField("reverbDensity", TypeF32, Offset(mReverb.flDensity, SFXDescription),
+      "Density of reverb environment.");
+   addField("reverbDiffusion", TypeF32, Offset(mReverb.flDiffusion, SFXDescription),
+      "Environment diffusion.");
+   addField("reverbGain", TypeF32, Offset(mReverb.flGain, SFXDescription),
+      "Reverb Gain Level.");
+   addField("reverbGainHF", TypeF32, Offset(mReverb.flGainHF, SFXDescription),
+      "Reverb Gain to high frequencies");
+   addField("reverbGainLF", TypeF32, Offset(mReverb.flGainLF, SFXDescription),
+      "Reverb Gain to high frequencies");
+   addField("reverbDecayTime", TypeF32, Offset(mReverb.flDecayTime, SFXDescription),
+      "Decay time for the reverb.");
+   addField("reverbDecayHFRatio", TypeF32, Offset(mReverb.flDecayHFRatio, SFXDescription),
+      "High frequency decay time ratio.");
+   addField("reverbDecayLFRatio", TypeF32, Offset(mReverb.flDecayLFRatio, SFXDescription),
+      "High frequency decay time ratio.");
+   addField("reflectionsGain", TypeF32, Offset(mReverb.flReflectionsGain, SFXDescription),
+      "Reflection Gain.");
+   addField("reflectionDelay", TypeF32, Offset(mReverb.flReflectionsDelay, SFXDescription),
+      "How long to delay reflections.");
+   addField("lateReverbGain", TypeF32, Offset(mReverb.flLateReverbGain, SFXDescription),
+      "Late reverb gain amount.");
+   addField("lateReverbDelay", TypeF32, Offset(mReverb.flLateReverbDelay, SFXDescription),
+      "Late reverb delay time.");
+   addField("reverbEchoTime", TypeF32, Offset(mReverb.flEchoTime, SFXDescription),
+      "Reverb echo time.");
+   addField("reverbEchoDepth", TypeF32, Offset(mReverb.flEchoDepth, SFXDescription),
+      "Reverb echo depth.");
+   addField("reverbModTime", TypeF32, Offset(mReverb.flModulationTime, SFXDescription),
+      "Reverb Modulation time.");
+   addField("reverbModTime", TypeF32, Offset(mReverb.flModulationDepth, SFXDescription),
+      "Reverb Modulation time.");
+   addField("airAbsorbtionGainHF", TypeF32, Offset(mReverb.flAirAbsorptionGainHF, SFXDescription),
+      "High Frequency air absorbtion");
+   addField("reverbHFRef", TypeF32, Offset(mReverb.flHFReference, SFXDescription),
+      "Reverb High Frequency Reference.");
+   addField("reverbLFRef", TypeF32, Offset(mReverb.flLFReference, SFXDescription),
+      "Reverb Low Frequency Reference.");
+   addField("roomRolloffFactor", TypeF32, Offset(mReverb.flRoomRolloffFactor, SFXDescription),
+      "Rolloff factor for reverb.");
+   addField("decayHFLimit", TypeS32, Offset(mReverb.iDecayHFLimit, SFXDescription),
+      "High Frequency decay limit.");
+   endGroup("Reverb");
    
    Parent::initPersistFields();
 }
@@ -570,24 +534,27 @@ void SFXDescription::packData( BitStream *stream )
       
       if( mUseReverb )
       {
-         stream->writeRangedS32( mReverb.mDirect, -10000, 1000 );
-         stream->writeRangedS32( mReverb.mDirectHF, -10000, 0 );
-         stream->writeRangedS32( mReverb.mRoom, -10000, 1000 );
-         stream->writeRangedS32( mReverb.mRoomHF, -10000, 0 );
-         stream->writeRangedS32( mReverb.mObstruction, -10000, 0 );
-         stream->writeRangedF32( mReverb.mObstructionLFRatio, 0.0, 1.0, 7 );
-         stream->writeRangedS32( mReverb.mOcclusion, -10000, 0 );
-         stream->writeRangedF32( mReverb.mOcclusionLFRatio, 0.0, 1.0, 7 );
-         stream->writeRangedF32( mReverb.mOcclusionRoomRatio, 0.0, 10.0, 7 );
-         stream->writeRangedF32( mReverb.mOcclusionDirectRatio, 0.0, 10.0, 7 );
-         stream->writeRangedS32( mReverb.mExclusion, -10000, 0 );
-         stream->writeRangedF32( mReverb.mExclusionLFRatio, 0.0, 1.0, 7 );
-         stream->writeRangedS32( mReverb.mOutsideVolumeHF, -10000, 0 );
-         stream->writeRangedF32( mReverb.mDopplerFactor, 0.0, 10.0, 7 );
-         stream->writeRangedF32( mReverb.mRolloffFactor, 0.0, 10.0, 7 );
-         stream->writeRangedF32( mReverb.mRoomRolloffFactor, 0.0, 10.0, 7 );
-         stream->writeRangedF32( mReverb.mAirAbsorptionFactor, 0.0, 10.0, 7 );
-         stream->writeInt( mReverb.mFlags, 6 );
+         stream->write(mReverb.flDensity);
+         stream->write(mReverb.flDiffusion);
+         stream->write(mReverb.flGain);
+         stream->write(mReverb.flGainHF);
+         stream->write(mReverb.flGainLF);
+         stream->write(mReverb.flDecayTime);
+         stream->write(mReverb.flDecayHFRatio);
+         stream->write(mReverb.flDecayLFRatio);
+         stream->write(mReverb.flReflectionsGain);
+         stream->write(mReverb.flReflectionsDelay);
+         stream->write(mReverb.flLateReverbGain);
+         stream->write(mReverb.flLateReverbDelay);
+         stream->write(mReverb.flEchoTime);
+         stream->write(mReverb.flEchoDepth);
+         stream->write(mReverb.flModulationTime);
+         stream->write(mReverb.flModulationDepth);
+         stream->write(mReverb.flAirAbsorptionGainHF);
+         stream->write(mReverb.flHFReference);
+         stream->write(mReverb.flLFReference);
+         stream->write(mReverb.flRoomRolloffFactor);
+         stream->write(mReverb.iDecayHFLimit);
       }
    }
 
@@ -640,24 +607,27 @@ void SFXDescription::unpackData( BitStream *stream )
       
       if( mUseReverb )
       {
-         mReverb.mDirect               = stream->readRangedS32( -10000, 1000 );
-         mReverb.mDirectHF             = stream->readRangedS32( -10000, 0 );
-         mReverb.mRoom                 = stream->readRangedS32( -10000, 1000 );
-         mReverb.mRoomHF               = stream->readRangedS32( -10000, 0 );
-         mReverb.mObstruction          = stream->readRangedS32( -10000, 0 );
-         mReverb.mObstructionLFRatio   = stream->readRangedF32( 0.0, 1.0, 7 );
-         mReverb.mOcclusion            = stream->readRangedS32( -10000, 0 );
-         mReverb.mOcclusionLFRatio     = stream->readRangedF32( 0.0, 1.0, 7 );
-         mReverb.mOcclusionRoomRatio   = stream->readRangedF32( 0.0, 10.0, 7 );
-         mReverb.mOcclusionDirectRatio = stream->readRangedF32( 0.0, 10.0, 7 );
-         mReverb.mExclusion            = stream->readRangedS32( -10000, 0 );
-         mReverb.mExclusionLFRatio     = stream->readRangedF32( 0.0, 1.0, 7 );
-         mReverb.mOutsideVolumeHF      = stream->readRangedS32( -10000, 0 );
-         mReverb.mDopplerFactor        = stream->readRangedF32( 0.0, 10.0, 7 );
-         mReverb.mRolloffFactor        = stream->readRangedF32( 0.0, 10.0, 7 );
-         mReverb.mRoomRolloffFactor    = stream->readRangedF32( 0.0, 10.0, 7 );
-         mReverb.mAirAbsorptionFactor  = stream->readRangedF32( 0.0, 10.0, 7 );
-         mReverb.mFlags                = stream->readInt( 6 );
+         stream->read(&mReverb.flDensity);
+         stream->read(&mReverb.flDiffusion);
+         stream->read(&mReverb.flGain);
+         stream->read(&mReverb.flGainHF);
+         stream->read(&mReverb.flGainLF);
+         stream->read(&mReverb.flDecayTime);
+         stream->read(&mReverb.flDecayHFRatio);
+         stream->read(&mReverb.flDecayLFRatio);
+         stream->read(&mReverb.flReflectionsGain);
+         stream->read(&mReverb.flReflectionsDelay);
+         stream->read(&mReverb.flLateReverbGain);
+         stream->read(&mReverb.flLateReverbDelay);
+         stream->read(&mReverb.flEchoTime);
+         stream->read(&mReverb.flEchoDepth);
+         stream->read(&mReverb.flModulationTime);
+         stream->read(&mReverb.flModulationDepth);
+         stream->read(&mReverb.flAirAbsorptionGainHF);
+         stream->read(&mReverb.flHFReference);
+         stream->read(&mReverb.flLFReference);
+         stream->read(&mReverb.flRoomRolloffFactor);
+         stream->read(&mReverb.iDecayHFLimit);
       }
    }
 

+ 3 - 0
Engine/source/sfx/sfxDevice.h

@@ -178,6 +178,9 @@ public:
       
       /// Set the rolloff scale factor for distance attenuation of 3D sounds.
       virtual void setRolloffFactor( F32 factor ) {}
+
+      /// send empty function to all sfxdevices
+      virtual void openSlots() {}
       
       /// Set the global reverb environment.
       virtual void setReverb( const SFXReverbProperties& reverb ) {}

+ 89 - 122
Engine/source/sfx/sfxEnvironment.cpp

@@ -144,70 +144,53 @@ void SFXEnvironment::initPersistFields()
 {
    addGroup( "Reverb" );
    
-      addField( "envSize",             TypeF32,    Offset( mReverb.mEnvSize, SFXEnvironment ),
-         "Environment size in meters." );
-      addField( "envDiffusion",        TypeF32,    Offset( mReverb.mEnvDiffusion, SFXEnvironment ),
-         "Environment diffusion." );
-      addField( "room",                TypeS32,    Offset( mReverb.mRoom, SFXEnvironment ),
-         "Room effect level at mid-frequencies." );
-      addField( "roomHF",              TypeS32,    Offset( mReverb.mRoomHF, SFXEnvironment ),
-         "Relative room effect level at high frequencies." );
-      addField( "roomLF",              TypeS32,    Offset( mReverb.mRoomLF, SFXEnvironment ),
-         "Relative room effect level at low frequencies." );
-      addField( "decayTime",           TypeF32,    Offset( mReverb.mDecayTime, SFXEnvironment ),
-         "Reverberation decay time at mid frequencies." );
-      addField( "decayHFRatio",        TypeF32,    Offset( mReverb.mDecayHFRatio, SFXEnvironment ),
-         "High-frequency to mid-frequency decay time ratio." );
-      addField( "decayLFRatio",        TypeF32,    Offset( mReverb.mDecayLFRatio, SFXEnvironment ),
-         "Low-frequency to mid-frequency decay time ratio." );
-      addField( "reflections",         TypeS32,    Offset( mReverb.mReflections, SFXEnvironment ),
-         "Early reflections level relative to room effect." );
-      addField( "reflectionsDelay",    TypeF32,    Offset( mReverb.mReflectionsDelay, SFXEnvironment ),
-         "Initial reflection delay time." );
-      addField( "reflectionsPan",      TypeF32,    Offset( mReverb.mReflectionsPan, SFXEnvironment ), 3,
-         "Early reflections panning vector." );
-      addField( "reverb",              TypeS32,    Offset( mReverb.mReverb, SFXEnvironment ),
-         "Late reverberation level relative to room effect." );
-      addField( "reverbDelay",         TypeF32,    Offset( mReverb.mReverbDelay, SFXEnvironment ),
-         "Late reverberation delay time relative to initial reflection." );
-      addField( "reverbPan",           TypeF32,    Offset( mReverb.mReverbPan, SFXEnvironment ), 3,
-         "Late reverberation panning vector." );
-      addField( "echoTime",            TypeF32,    Offset( mReverb.mEchoTime, SFXEnvironment ),
-         "Echo time." );
-      addField( "echoDepth",           TypeF32,    Offset( mReverb.mEchoDepth, SFXEnvironment ),
-         "Echo depth." );
-      addField( "modulationTime",      TypeF32,    Offset( mReverb.mModulationTime, SFXEnvironment ),
-         "Modulation time." );
-      addField( "modulationDepth",     TypeF32,    Offset( mReverb.mModulationDepth, SFXEnvironment ),
-         "Modulation depth." );
-      addField( "airAbsorptionHF",     TypeF32,    Offset( mReverb.mAirAbsorptionHF, SFXEnvironment ),
-         "Change in level per meter at high frequencies." );
-      addField( "HFReference",         TypeF32,    Offset( mReverb.mHFReference, SFXEnvironment ),
-         "Reference high frequency in Hertz." );
-      addField( "LFReference",         TypeF32,    Offset( mReverb.mLFReference, SFXEnvironment ),
-         "Reference low frequency in Hertz." );
-      addField( "roomRolloffFactor",   TypeF32,    Offset( mReverb.mRoomRolloffFactor, SFXEnvironment ),
-         "Logarithmic distance attenuation rolloff scale factor for reverb room size effect." );
-      addField( "diffusion",           TypeF32,    Offset( mReverb.mDiffusion, SFXEnvironment ),
-         "Value that controls the echo density in the late reverberation decay." );
-      addField( "density",             TypeF32,    Offset( mReverb.mDensity, SFXEnvironment ),
-         "Value that controls the modal density in the late reverberation decay." );
-      addField( "flags",               TypeS32,    Offset( mReverb.mFlags, SFXEnvironment ),
-         "A bitfield of reverb flags.\n"
-         "@see REVERB_DECAYTIMESCALE\n"
-         "@see REVERB_REFLECTIONSSCALE\n"
-         "@see REVERB_REFLECTIONSDELAYSCALE\n"
-         "@see REVERB_REVERBSCALE\n"
-         "@see REVERB_REVERBDELAYSCALE\n"
-         "@see REVERB_DECAYHFLIMIT\n"
-         "@see REVERB_ECHOTIMESCALE\n"
-         "@see REVERB_MODULATIONTIMESCALE\n"
-         "@see REVERB_CORE0\n"
-         "@see REVERB_CORE1\n"
-         "@see REVERB_HIGHQUALITYREVERB\n"
-         "@see REVERB_HIGHQUALITYDPL2REVERB\n" );
-
-   endGroup( "Reverb" );
+   addField("reverbDensity", TypeF32, Offset(mReverb.flDensity, SFXEnvironment),
+      "Density of reverb environment.");
+   addField("reverbDiffusion", TypeF32, Offset(mReverb.flDiffusion, SFXEnvironment),
+      "Environment diffusion.");
+   addField("reverbGain", TypeF32, Offset(mReverb.flGain, SFXEnvironment),
+      "Reverb Gain Level.");
+   addField("reverbGainHF", TypeF32, Offset(mReverb.flGainHF, SFXEnvironment),
+      "Reverb Gain to high frequencies");
+   addField("reverbGainLF", TypeF32, Offset(mReverb.flGainLF, SFXEnvironment),
+      "Reverb Gain to high frequencies");
+   addField("reverbDecayTime", TypeF32, Offset(mReverb.flDecayTime, SFXEnvironment),
+      "Decay time for the reverb.");
+   addField("reverbDecayHFRatio", TypeF32, Offset(mReverb.flDecayHFRatio, SFXEnvironment),
+      "High frequency decay time ratio.");
+   addField("reverbDecayLFRatio", TypeF32, Offset(mReverb.flDecayLFRatio, SFXEnvironment),
+      "High frequency decay time ratio.");
+   addField("reflectionsGain", TypeF32, Offset(mReverb.flReflectionsGain, SFXEnvironment),
+      "Reflection Gain.");
+   addField("reflectionDelay", TypeF32, Offset(mReverb.flReflectionsDelay, SFXEnvironment),
+      "How long to delay reflections.");
+   addField("reflectionsPan", TypeF32, Offset(mReverb.flReflectionsPan, SFXEnvironment), 3,
+      "Reflection reverberation panning vector.");
+   addField("lateReverbGain", TypeF32, Offset(mReverb.flLateReverbGain, SFXEnvironment),
+      "Late reverb gain amount.");
+   addField("lateReverbDelay", TypeF32, Offset(mReverb.flLateReverbDelay, SFXEnvironment),
+      "Late reverb delay time.");
+   addField("lateReverbPan", TypeF32, Offset(mReverb.flLateReverbPan, SFXEnvironment), 3,
+      "Late reverberation panning vector.");
+   addField("reverbEchoTime", TypeF32, Offset(mReverb.flEchoTime, SFXEnvironment),
+      "Reverb echo time.");
+   addField("reverbEchoDepth", TypeF32, Offset(mReverb.flEchoDepth, SFXEnvironment),
+      "Reverb echo depth.");
+   addField("reverbModTime", TypeF32, Offset(mReverb.flModulationTime, SFXEnvironment),
+      "Reverb Modulation time.");
+   addField("reverbModDepth", TypeF32, Offset(mReverb.flModulationDepth, SFXEnvironment),
+      "Reverb Modulation time.");
+   addField("airAbsorbtionGainHF", TypeF32, Offset(mReverb.flAirAbsorptionGainHF, SFXEnvironment),
+      "High Frequency air absorbtion");
+   addField("reverbHFRef", TypeF32, Offset(mReverb.flHFReference, SFXEnvironment),
+      "Reverb High Frequency Reference.");
+   addField("reverbLFRef", TypeF32, Offset(mReverb.flLFReference, SFXEnvironment),
+      "Reverb Low Frequency Reference.");
+   addField("roomRolloffFactor", TypeF32, Offset(mReverb.flRoomRolloffFactor, SFXEnvironment),
+      "Rolloff factor for reverb.");
+   addField("decayHFLimit", TypeS32, Offset(mReverb.iDecayHFLimit, SFXEnvironment),
+      "High Frequency decay limit.");
+   endGroup("Reverb");
 
    Parent::initPersistFields();
 }
@@ -257,35 +240,27 @@ void SFXEnvironment::packData( BitStream* stream )
 {
    Parent::packData( stream );
 
-   stream->write( mReverb.mEnvSize );
-   stream->write( mReverb.mEnvDiffusion );
-   stream->write( mReverb.mRoom );
-   stream->write( mReverb.mRoomHF );
-   stream->write( mReverb.mRoomLF );
-   stream->write( mReverb.mDecayTime );
-   stream->write( mReverb.mDecayHFRatio );
-   stream->write( mReverb.mDecayLFRatio );
-   stream->write( mReverb.mReflections );
-   stream->write( mReverb.mReflectionsDelay );
-   stream->write( mReverb.mReflectionsPan[ 0 ] );
-   stream->write( mReverb.mReflectionsPan[ 1 ] );
-   stream->write( mReverb.mReflectionsPan[ 2 ] );
-   stream->write( mReverb.mReverb );
-   stream->write( mReverb.mReverbDelay );
-   stream->write( mReverb.mReverbPan[ 0 ] );
-   stream->write( mReverb.mReverbPan[ 1 ] );
-   stream->write( mReverb.mReverbPan[ 2 ] );
-   stream->write( mReverb.mEchoTime );
-   stream->write( mReverb.mEchoDepth );
-   stream->write( mReverb.mModulationTime );
-   stream->write( mReverb.mModulationDepth );
-   stream->write( mReverb.mAirAbsorptionHF );
-   stream->write( mReverb.mHFReference );
-   stream->write( mReverb.mLFReference );
-   stream->write( mReverb.mRoomRolloffFactor );
-   stream->write( mReverb.mDiffusion );
-   stream->write( mReverb.mDensity );
-   stream->write( mReverb.mFlags );
+   stream->write(mReverb.flDensity);
+   stream->write(mReverb.flDiffusion);
+   stream->write(mReverb.flGain);
+   stream->write(mReverb.flGainHF);
+   stream->write(mReverb.flGainLF);
+   stream->write(mReverb.flDecayTime);
+   stream->write(mReverb.flDecayHFRatio);
+   stream->write(mReverb.flDecayLFRatio);
+   stream->write(mReverb.flReflectionsGain);
+   stream->write(mReverb.flReflectionsDelay);
+   stream->write(mReverb.flLateReverbGain);
+   stream->write(mReverb.flLateReverbDelay);
+   stream->write(mReverb.flEchoTime);
+   stream->write(mReverb.flEchoDepth);
+   stream->write(mReverb.flModulationTime);
+   stream->write(mReverb.flModulationDepth);
+   stream->write(mReverb.flAirAbsorptionGainHF);
+   stream->write(mReverb.flHFReference);
+   stream->write(mReverb.flLFReference);
+   stream->write(mReverb.flRoomRolloffFactor);
+   stream->write(mReverb.iDecayHFLimit);
 }
 
 //-----------------------------------------------------------------------------
@@ -294,33 +269,25 @@ void SFXEnvironment::unpackData( BitStream* stream )
 {
    Parent::unpackData( stream );
    
-   stream->read( &mReverb.mEnvSize );
-   stream->read( &mReverb.mEnvDiffusion );
-   stream->read( &mReverb.mRoom );
-   stream->read( &mReverb.mRoomHF );
-   stream->read( &mReverb.mRoomLF );
-   stream->read( &mReverb.mDecayTime );
-   stream->read( &mReverb.mDecayHFRatio );
-   stream->read( &mReverb.mDecayLFRatio );
-   stream->read( &mReverb.mReflections );
-   stream->read( &mReverb.mReflectionsDelay );
-   stream->read( &mReverb.mReflectionsPan[ 0 ] );
-   stream->read( &mReverb.mReflectionsPan[ 1 ] );
-   stream->read( &mReverb.mReflectionsPan[ 2 ] );
-   stream->read( &mReverb.mReverb );
-   stream->read( &mReverb.mReverbDelay );
-   stream->read( &mReverb.mReverbPan[ 0 ] );
-   stream->read( &mReverb.mReverbPan[ 1 ] );
-   stream->read( &mReverb.mReverbPan[ 2 ] );
-   stream->read( &mReverb.mEchoTime );
-   stream->read( &mReverb.mEchoDepth );
-   stream->read( &mReverb.mModulationTime );
-   stream->read( &mReverb.mModulationDepth );
-   stream->read( &mReverb.mAirAbsorptionHF );
-   stream->read( &mReverb.mHFReference );
-   stream->read( &mReverb.mLFReference );
-   stream->read( &mReverb.mRoomRolloffFactor );
-   stream->read( &mReverb.mDiffusion );
-   stream->read( &mReverb.mDensity );
-   stream->read( &mReverb.mFlags );
+   stream->read(&mReverb.flDensity);
+   stream->read(&mReverb.flDiffusion);
+   stream->read(&mReverb.flGain);
+   stream->read(&mReverb.flGainHF);
+   stream->read(&mReverb.flGainLF);
+   stream->read(&mReverb.flDecayTime);
+   stream->read(&mReverb.flDecayHFRatio);
+   stream->read(&mReverb.flDecayLFRatio);
+   stream->read(&mReverb.flReflectionsGain);
+   stream->read(&mReverb.flReflectionsDelay);
+   stream->read(&mReverb.flLateReverbGain);
+   stream->read(&mReverb.flLateReverbDelay);
+   stream->read(&mReverb.flEchoTime);
+   stream->read(&mReverb.flEchoDepth);
+   stream->read(&mReverb.flModulationTime);
+   stream->read(&mReverb.flModulationDepth);
+   stream->read(&mReverb.flAirAbsorptionGainHF);
+   stream->read(&mReverb.flHFReference);
+   stream->read(&mReverb.flLFReference);
+   stream->read(&mReverb.flRoomRolloffFactor);
+   stream->read(&mReverb.iDecayHFLimit);
 }

+ 6 - 0
Engine/source/sfx/sfxSystem.cpp

@@ -94,6 +94,9 @@ ImplementEnumType( SFXDistanceModel,
    { SFXDistanceModelLogarithmic, "Logarithmic", 
       "Volume attenuates logarithmically starting from the reference distance and halving every reference distance step from there on. "
       "Attenuation stops at max distance but volume won't reach zero." },
+   { SFXDistanceModelExponent, "Exponential",
+   "Volume attenuates exponentially starting from the reference distance and attenuating every reference distance step by the rolloff factor. "
+   "Attenuation stops at max distance but volume won't reach zero." },
 EndImplementEnumType;
 
 ImplementEnumType( SFXChannel,
@@ -473,6 +476,9 @@ bool SFXSystem::createDevice( const String& providerName, const String& deviceNa
    mDevice->setDistanceModel( mDistanceModel );
    mDevice->setDopplerFactor( mDopplerFactor );
    mDevice->setRolloffFactor( mRolloffFactor );
+   //OpenAL requires slots for effects, this creates an empty function 
+   //that will run when a sfxdevice is created.
+   mDevice->openSlots();
    mDevice->setReverb( mReverb );
       
    // Signal system.

+ 1362 - 889
Templates/Full/game/core/scripts/client/audioEnvironments.cs

@@ -24,893 +24,1366 @@
 //
 // For customized presets, best derive from one of these presets.
 
-singleton SFXEnvironment( AudioEnvOff )
-{
-   envSize = "7.5";
-   envDiffusion = "1.0";
-   room = "-10000";
-   roomHF = "-10000";
-   roomLF = "0";
-   decayTime = "1.0";
-   decayHFRatio = "1.0";
-   decayLFRatio = "1.0";
-   reflections = "-2602";
-   reflectionsDelay = "0.007";
-   reflectionsPan[ 0 ] = "0.0";
-   reflectionsPan[ 1 ] = "0.0";
-   reflectionsPan[ 2 ] = "0.0";
-   reverb = "200";
-   reverbDelay = "0.011";
-   reverbPan[ 0 ] = "0.0";
-   reverbPan[ 1 ] = "0.0";
-   reverbPan[ 2 ] = "0.0";
-   echoTime = "0.25";
-   echoDepth = "0.0";
-   modulationTime = "0.25";
-   modulationDepth = "0.0";
-   airAbsorptionHF = "-5.0";
-   HFReference = "5000.0";
-   LFReference = "250.0";
-   roomRolloffFactor = "0.0";
-   diffusion = "0.0";
-   density = "0.0";
-   flags = 0x33;
-};
-
-singleton SFXEnvironment( AudioEnvGeneric )
-{
-   envSize = "7.5";
-   envDiffusion = "1.0";
-   room = "-1000";
-   roomHF = "-100";
-   roomLF = "0";
-   decayTime = "1.49";
-   decayHFRatio = "0.83";
-   decayLFRatio = "1.0";
-   reflections = "-2602";
-   reflectionsDelay = "0.007";
-   reflectionsPan[ 0 ] = "0.0";
-   reflectionsPan[ 1 ] = "0.0";
-   reflectionsPan[ 2 ] = "0.0";
-   reverb = "200";
-   reverbDelay = "0.011";
-   reverbPan[ 0 ] = "0.0";
-   reverbPan[ 1 ] = "0.0";
-   reverbPan[ 2 ] = "0.0";
-   echoTime = "0.25";
-   echoDepth = "0.0";
-   modulationTime = "0.25";
-   modulationDepth = "0.0";
-   airAbsorptionHF = "-5.0";
-   HFReference = "5000.0";
-   LFReference = "250.0";
-   roomRolloffFactor = "0.0";
-   diffusion = "100.0";
-   density = "100.0";
-   flags = 0x3f;
-};
-
-singleton SFXEnvironment( AudioEnvRoom )
-{
-   envSize = "1.9";
-   envDiffusion = "1.0";
-   room = "-1000";
-   roomHF = "-454";
-   roomLF = "0";
-   decayTime = "0.4";
-   decayHFRatio = "0.83";
-   decayLFRatio = "1.0";
-   reflections = "-1646";
-   reflectionsDelay = "0.002";
-   reflectionsPan[ 0 ] = "0.0";
-   reflectionsPan[ 1 ] = "0.0";
-   reflectionsPan[ 2 ] = "0.0";
-   reverb = "53";
-   reverbDelay = "0.003";
-   reverbPan[ 0 ] = "0.0";
-   reverbPan[ 1 ] = "0.0";
-   reverbPan[ 2 ] = "0.0";
-   echoTime = "0.25";
-   echoDepth = "0.0";
-   modulationTime = "0.25";
-   modulationDepth = "0.0";
-   airAbsorptionHF = "-5.0";
-   HFReference = "5000.0";
-   LFReference = "250.0";
-   roomRolloffFactor = "0.0";
-   diffusion = "100.0";
-   density = "100.0";
-   flags = 0x3f;
-};
-
-singleton SFXEnvironment( AudioEnvPaddedCell )
-{
-   envSize = "1.4";
-   envDiffusion = "1.0";
-   room = "-1000";
-   roomHF = "-6000";
-   roomLF = "0";
-   decayTime = "0.17";
-   decayHFRatio = "0.1";
-   decayLFRatio = "1.0";
-   reflections = "-1204";
-   reflectionsDelay = "0.001";
-   reflectionsPan[ 0 ] = "0.0";
-   reflectionsPan[ 1 ] = "0.0";
-   reflectionsPan[ 2 ] = "0.0";
-   reverb = "207";
-   reverbDelay = "0.002";
-   reverbPan[ 0 ] = "0.0";
-   reverbPan[ 1 ] = "0.0";
-   reverbPan[ 2 ] = "0.0";
-   echoTime = "0.25";
-   echoDepth = "0.0";
-   modulationTime = "0.25";
-   modulationDepth = "0.0";
-   airAbsorptionHF = "-5.0";
-   HFReference = "5000.0";
-   LFReference = "250.0";
-   roomRolloffFactor = "0.0";
-   diffusion = "100.0";
-   density = "100.0";
-   flags = 0x3f;
-};
-
-singleton SFXEnvironment( AudioEnvBathroom )
-{
-   envSize = "1.4";
-   envDiffusion = "1.0";
-   room = "-1000";
-   roomHF = "-1200";
-   roomLF = "0";
-   decayTime = "1.49";
-   decayHFRatio = "0.54";
-   decayLFRatio = "1.0";
-   reflections = "-370";
-   reflectionsDelay = "0.007";
-   reflectionsPan[ 0 ] = "0.0";
-   reflectionsPan[ 1 ] = "0.0";
-   reflectionsPan[ 2 ] = "0.0";
-   reverb = "1030";
-   reverbDelay = "0.011";
-   reverbPan[ 0 ] = "0.0";
-   reverbPan[ 1 ] = "0.0";
-   reverbPan[ 2 ] = "0.0";
-   echoTime = "0.25";
-   echoDepth = "0.0";
-   modulationTime = "0.25";
-   modulationDepth = "0.0";
-   airAbsorptionHF = "-5.0";
-   HFReference = "5000.0";
-   LFReference = "250.0";
-   roomRolloffFactor = "0.0";
-   diffusion = "100.0";
-   density = "60.0";
-   flags = 0x3f;
-};
-
-singleton SFXEnvironment( AudioEnvLivingRoom )
-{
-   envSize = "2.5";
-   envDiffusion = "1.0";
-   room = "-1000";
-   roomHF = "-6000";
-   roomLF = "0";
-   decayTime = "0.5";
-   decayHFRatio = "0.1";
-   decayLFRatio = "1.0";
-   reflections = "-1376";
-   reflectionsDelay = "0.003";
-   reflectionsPan[ 0 ] = "0.0";
-   reflectionsPan[ 1 ] = "0.0";
-   reflectionsPan[ 2 ] = "0.0";
-   reverb = "-1104";
-   reverbDelay = "0.004";
-   reverbPan[ 0 ] = "0.0";
-   reverbPan[ 1 ] = "0.0";
-   reverbPan[ 2 ] = "0.0";
-   echoTime = "0.25";
-   echoDepth = "0.0";
-   modulationTime = "0.25";
-   modulationDepth = "0.0";
-   airAbsorptionHF = "-5.0";
-   HFReference = "5000.0";
-   LFReference = "250.0";
-   roomRolloffFactor = "0.0";
-   diffusion = "100.0";
-   density = "100.0";
-   flags = 0x3f;
-};
-
-singleton SFXEnvironment( AudioEnvStoneRoom )
-{
-   envSize = "11.6";
-   envDiffusion = "1.0";
-   room = "-1000";
-   roomHF = "300";
-   roomLF = "0";
-   decayTime = "2.31";
-   decayHFRatio = "0.64";
-   decayLFRatio = "1.0";
-   reflections = "-711";
-   reflectionsDelay = "0.012";
-   reflectionsPan[ 0 ] = "0.0";
-   reflectionsPan[ 1 ] = "0.0";
-   reflectionsPan[ 2 ] = "0.0";
-   reverb = "83";
-   reverbDelay = "0.017";
-   reverbPan[ 0 ] = "0.0";
-   reverbPan[ 1 ] = "0.0";
-   reverbPan[ 2 ] = "0.0";
-   echoTime = "0.25";
-   echoDepth = "0.0";
-   modulationTime = "0.25";
-   modulationDepth = "0.0";
-   airAbsorptionHF = "-5.0";
-   HFReference = "-5000.0";
-   LFReference = "250.0";
-   roomRolloffFactor = "0.0";
-   diffusion = "100.0";
-   density = "100.0";
-   flags = 0x3f;
-};
-
-singleton SFXEnvironment( AudioEnvAuditorium )
-{
-   envSize = "21.6";
-   envDiffusion = "1.0";
-   room = "-1000";
-   roomHF = "-476";
-   roomLF = "0";
-   decayTime = "4.32";
-   decayHFRatio = "0.59";
-   decayLFRatio = "1.0";
-   reflections = "0.789";
-   reflectionsDelay = "0.02";
-   reflectionsPan[ 0 ] = "0.0";
-   reflectionsPan[ 1 ] = "0.0";
-   reflectionsPan[ 2 ] = "0.0";
-   reverb = "-289";
-   reverbDelay = "0.03";
-   reverbPan[ 0 ] = "0.0";
-   reverbPan[ 1 ] = "0.0";
-   reverbPan[ 2 ] = "0.0";
-   echoTime = "0.25";
-   echoDepth = "0.0";
-   modulationTime = "0.25";
-   modulationDepth = "0.0";
-   airAbsorptionHF = "-5.0";
-   HFReference = "5000.0";
-   LFReference = "250.0";
-   roomRolloffFactor = "0.0";
-   diffusion = "100.0";
-   density = "100.0";
-   flags = 0x3f;
-};
-
-singleton SFXEnvironment( AudioEnvConcertHall )
-{
-   envSize = "19.6";
-   envDiffusion = "1.0";
-   room = "-1000";
-   roomHF = "-500";
-   roomLF = "0";
-   decayTime = "3.92";
-   decayHFRatio = "0.7";
-   decayLFRatio = "1.0";
-   reflections = "-1230";
-   reflectionsDelay = "0.02";
-   reflectionsPan[ 0 ] = "0.0";
-   reflectionsPan[ 1 ] = "0.0";
-   reflectionsPan[ 2 ] = "0.0";
-   reverb = "-2";
-   reverbDelay = "0.029";
-   reverbPan[ 0 ] = "0.0";
-   reverbPan[ 1 ] = "0.0";
-   reverbPan[ 2 ] = "0.0";
-   echoTime = "0.25";
-   echoDepth = "0.0";
-   modulationTime = "0.25";
-   modulationDepth = "0.0";
-   airAbsorptionHF = "-5.0";
-   HFReference = "5000.0";
-   LFReference = "250.0";
-   roomRolloffFactor = "0.0";
-   diffusion = "100.0";
-   density = "100.0";
-   flags = 0x3f;
-};
-
-singleton SFXEnvironment( AudioEnvCave )
-{
-   envSize = "14.6";
-   envDiffusion = "1.0";
-   room = "-1000";
-   roomHF = "0";
-   roomLF = "0";
-   decayTime = "2.91";
-   decayHFRatio = "1.3";
-   decayLFRatio = "1.0";
-   reflections = "-602";
-   reflectionsDelay = "0.015";
-   reflectionsPan[ 0 ] = "0.0";
-   reflectionsPan[ 1 ] = "0.0";
-   reflectionsPan[ 2 ] = "0.0";
-   reverb = "-302";
-   reverbDelay = "0.022";
-   reverbPan[ 0 ] = "0.0";
-   reverbPan[ 1 ] = "0.0";
-   reverbPan[ 2 ] = "0.0";
-   echoTime = "0.25";
-   echoDepth = "0.0";
-   modulationTime = "0.25";
-   modulationDepth = "0.0";
-   airAbsorptionHF = "-5.0";
-   HFReference = "5000.0";
-   LFReference = "250.0";
-   roomRolloffFactor = "0.0";
-   diffusion = "100.0";
-   density = "100.0";
-   flags = 0x1f;
-};
-
-singleton SFXEnvironment( AudioEnvArena )
-{
-   envSize = "36.2f";
-   envDiffusion = "1.0";
-   room = "-1000";
-   roomHF = "-698";
-   roomLF = "0";
-   decayTime = "7.24";
-   decayHFRatio = "0.33";
-   decayLFRatio = "1.0";
-   reflections = "-1166";
-   reflectionsDelay = "0.02";
-   reflectionsPan[ 0 ] = "0.0";
-   reflectionsPan[ 1 ] = "0.0";
-   reflectionsPan[ 2 ] = "0.0";
-   reverb = "16";
-   reverbDelay = "0.03";
-   reverbPan[ 0 ] = "0.0";
-   reverbPan[ 1 ] = "0.0";
-   reverbPan[ 2 ] = "0.0";
-   echoTime = "0.25";
-   echoDepth = "0.0";
-   modulationTime = "0.25";
-   modulationDepth = "0.0";
-   airAbsorptionHF = "-5.0";
-   HFReference = "5000.0";
-   LFReference = "250.0";
-   roomRolloffFactor = "0.0";
-   diffusion = "100.0";
-   density = "100.0";
-   flags = 0x3f;
-};
-
-singleton SFXEnvironment( AudioEnvHangar )
-{
-   envSize = "50.3";
-   envDiffusion = "1.0";
-   room = "-1000";
-   roomHF = "-1000";
-   roomLF = "0";
-   decayTime = "10.05";
-   decayHFRatio = "0.23";
-   decayLFRatio = "1.0";
-   reflections = "-602";
-   reflectionsDelay = "0.02";
-   reflectionsPan[ 0 ] = "0.0";
-   reflectionsPan[ 1 ] = "0.0";
-   reflectionsPan[ 2 ] = "0.0";
-   reverb = "198";
-   reverbDelay = "0.03";
-   reverbPan[ 0 ] = "0.0";
-   reverbPan[ 1 ] = "0.0";
-   reverbPan[ 2 ] = "0.0";
-   echoTime = "0.25";
-   echoDepth = "0.0";
-   modulationTime = "0.25";
-   modulationDepth = "0.0";
-   airAbsorptionHF = "-5.0";
-   HFReference = "5000.0";
-   LFReference = "250.0";
-   roomRolloffFactor = "0.0";
-   diffusion = "100.0";
-   density = "100.0";
-   flags = 0x3f;
-};
-
-singleton SFXEnvironment( AudioEnvCarpettedHallway )
-{
-   envSize = "1.9";
-   envDiffusion = "1.0";
-   room = "-1000";
-   roomHF = "-4000";
-   roomLF = "0";
-   decayTime = "0.3";
-   decayHFRatio = "0.1";
-   decayLFRatio = "1.0";
-   reflections = "-1831";
-   reflectionsDelay = "0.002";
-   reflectionsPan[ 0 ] = "0.0";
-   reflectionsPan[ 1 ] = "0.0";
-   reflectionsPan[ 2 ] = "0.0";
-   reverb = "-1630";
-   reverbDelay = "0.03";
-   reverbPan[ 0 ] = "0.0";
-   reverbPan[ 1 ] = "0.0";
-   reverbPan[ 2 ] = "0.0";
-   echoTime = "0.25";
-   echoDepth = "0.0";
-   modulationTime = "0.25";
-   modulationDepth = "0.0";
-   airAbsorptionHF = "-5.0";
-   HFReference = "5000.0";
-   LFReference = "250.0";
-   roomRolloffFactor = "0.0";
-   diffusion = "100.0";
-   density = "100.0";
-   flags = 0x3f;
-};
-
-singleton SFXEnvironment( AudioEnvHallway )
-{
-   envSize = "1.8";
-   envDiffusion = "1.0";
-   room = "-1000";
-   roomHF = "-300";
-   roomLF = "0";
-   decayTime = "1.49";
-   decayHFRatio = "0.59";
-   decayLFRatio = "1.0";
-   reflections = "-1219";
-   reflectionsDelay = "0.007";
-   reflectionsPan[ 0 ] = "0.0";
-   reflectionsPan[ 1 ] = "0.0";
-   reflectionsPan[ 2 ] = "0.0";
-   reverb = "441";
-   reverbDelay = "0.011";
-   reverbPan[ 0 ] = "0.0";
-   reverbPan[ 1 ] = "0.0";
-   reverbPan[ 2 ] = "0.0";
-   echoTime = "0.25";
-   echoDepth = "0.0";
-   modulationTime = "0.25";
-   modulationDepth = "0.0";
-   airAbsorptionHF = "-5.0";
-   HFReference = "5000.0";
-   LFReference = "250.0";
-   roomRolloffFactor = "0.0";
-   diffusion = "100.0";
-   density = "100.0";
-   flags = 0x3f;
-};
-
-singleton SFXEnvironment( AudioEnvStoneCorridor )
-{
-   envSize = "13.5";
-   envDiffusion = "1.0";
-   room = "-1000";
-   roomHF = "-237";
-   roomLF = "0";
-   decayTime = "2.7";
-   decayHFRatio = "0.79";
-   decayLFRatio = "1.0";
-   reflections = "-1214";
-   reflectionsDelay = "0.013";
-   reflectionsPan[ 0 ] = "0.0";
-   reflectionsPan[ 1 ] = "0.0";
-   reflectionsPan[ 2 ] = "0.0";
-   reverb = "395";
-   reverbDelay = "0.02";
-   reverbPan[ 0 ] = "0.0";
-   reverbPan[ 1 ] = "0.0";
-   reverbPan[ 2 ] = "0.0";
-   echoTime = "0.25";
-   echoDepth = "0.0";
-   modulationTime = "0.25";
-   modulationDepth = "0.0";
-   airAbsorptionHF = "-5.0";
-   HFReference = "5000.0";
-   LFReference = "250.0";
-   roomRolloffFactor = "0.0";
-   diffusion = "100.0";
-   density = "100.0";
-   flags = 0x3f;
-};
-
-singleton SFXEnvironment( AudioEnvAlley )
-{
-   envSize = "7.5";
-   envDiffusion = "0.3";
-   room = "-1000";
-   roomHF = "-270";
-   roomLF = "0";
-   decayTime = "1.49";
-   decayHFRatio = "0.86";
-   decayLFRatio = "1.0";
-   reflections = "-1204";
-   reflectionsDelay = "0.007";
-   reflectionsPan[ 0 ] = "0.0";
-   reflectionsPan[ 1 ] = "0.0";
-   reflectionsPan[ 2 ] = "0.0";
-   reverb = "-4";
-   reverbDelay = "0.011";
-   reverbPan[ 0 ] = "0.0";
-   reverbPan[ 1 ] = "0.0";
-   reverbPan[ 2 ] = "0.0";
-   echoTime = "0.125";
-   echoDepth = "0.95";
-   modulationTime = "0.25";
-   modulationDepth = "0.0";
-   airAbsorptionHF = "-5.0";
-   HFReference = "5000.0";
-   LFReference = "250.0";
-   roomRolloffFactor = "0.0";
-   diffusion = "100.0";
-   density = "100.0";
-   flags = 0x3f;
-};
-
-singleton SFXEnvironment( AudioEnvForest )
-{
-   envSize = "38.0";
-   envDiffusion = "0.3";
-   room = "-1000";
-   roomHF = "-3300";
-   roomLF = "0";
-   decayTime = "1.49";
-   decayHFRatio = "0.54";
-   decayLFRatio = "1.0";
-   reflections = "-2560";
-   reflectionsDelay = "0.162";
-   reflectionsPan[ 0 ] = "0.0";
-   reflectionsPan[ 1 ] = "0.0";
-   reflectionsPan[ 2 ] = "0.0";
-   reverb = "-229";
-   reverbDelay = "0.088";
-   reverbPan[ 0 ] = "0.0";
-   reverbPan[ 1 ] = "0.0";
-   reverbPan[ 2 ] = "0.0";
-   echoTime = "0.125";
-   echoDepth = "1.0";
-   modulationTime = "0.25";
-   modulationDepth = "0.0";
-   airAbsorptionHF = "-5.0";
-   HFReference = "5000.0";
-   LFReference = "250.0";
-   roomRolloffFactor = "0.0";
-   diffusion = "79.0";
-   density = "100.0";
-   flags = 0x3f;
-};
-
-singleton SFXEnvironment( AudioEnvCity )
-{
-  envSize = "7.5";
-  envDiffusion = "0.5";
-  room = "-1000";
-  roomHF = "-800";
-  roomLF = "0";
-  decayTime = "1.49";
-  decayHFRatio = "0.67";
-  decayLFRatio = "1.0";
-  reflections = "-2273";
-  reflectionsDelay = "0.007";
-  reflectionsPan[ 0 ] = "0.0";
-  reflectionsPan[ 1 ] = "0.0";
-  reflectionsPan[ 2 ] = "0.0";
-  reverb = "-1691";
-  reverbDelay = "0.011";
-  reverbPan[ 0 ] = "0.0";
-  reverbPan[ 1 ] = "0.0";
-  reverbPan[ 2 ] = "0.0";
-  echoTime = "0.25";
-  echoDepth = "0.0";
-  modulationTime = "0.25";
-  modulationDepth = "0.0";
-  airAbsorptionHF = "-5.0";
-  HFReference = "5000.0";
-  LFReference = "250.0";
-  roomRolloffFactor = "0.0";
-  diffusion = "50.0";
-  density = "100.0";
-  flags = 0x3f;
-};
-
-singleton SFXEnvironment( AudioEnvMountains )
-{
-  envSize = "100.0";
-  envDiffusion = "0.27";
-  room = "-1000";
-  roomHF = "-2500";
-  roomLF = "0";
-  decayTime = "1.49";
-  decayHFRatio = "0.21";
-  decayLFRatio = "1.0";
-  reflections = "-2780";
-  reflectionsDelay = "0.3";
-  reflectionsPan[ 0 ] = "0.0";
-  reflectionsPan[ 1 ] = "0.0";
-  reflectionsPan[ 2 ] = "0.0";
-  reverb = "-1434";
-  reverbDelay = "0.1";
-  reverbPan[ 0 ] = "0.0";
-  reverbPan[ 1 ] = "0.0";
-  reverbPan[ 2 ] = "0.0";
-  echoTime = "0.25";
-  echoDepth = "1.0";
-  modulationTime = "0.25";
-  modulationDepth = "0.0";
-  airAbsorptionHF = "-5.0";
-  HFReference = "5000.0";
-  LFReference = "250.0";
-  roomRolloffFactor = "0.0";
-  diffusion = "27.0";
-  density = "100.0";
-  flags = 0x1f;
-};
-
-singleton SFXEnvironment( AudioEnvQuary )
-{
-  envSize = "17.5";
-  envDiffusion = "1.0";
-  room = "-1000";
-  roomHF = "-1000";
-  roomLF = "0";
-  decayTime = "1.49";
-  decayHFRatio = "0.83";
-  decayLFRatio = "1.0";
-  reflections = "-10000";
-  reflectionsDelay = "0.061";
-  reflectionsPan[ 0 ] = "0.0";
-  reflectionsPan[ 1 ] = "0.0";
-  reflectionsPan[ 2 ] = "0.0";
-  reverb = "500";
-  reverbDelay = "0.025";
-  reverbPan[ 0 ] = "0.0";
-  reverbPan[ 1 ] = "0.0";
-  reverbPan[ 2 ] = "0.0";
-  echoTime = "0.125";
-  echoDepth = "0.7";
-  modulationTime = "0.25";
-  modulationDepth = "0.0";
-  airAbsorptionHF = "-5.0";
-  HFReference = "5000.0";
-  LFReference = "250.0";
-  roomRolloffFactor = "0.0";
-  diffusion = "100.0";
-  density = "100.0";
-  flags = 0x3f;
-};
-
-singleton SFXEnvironment( AudioEnvPlain )
-{
-  envSize = "42.5";
-  envDiffusion = "0.21";
-  room = "-1000";
-  roomHF = "-2000";
-  roomLF = "0";
-  decayTime = "1.49";
-  decayHFRatio = "0.5";
-  decayLFRatio = "1.0";
-  reflections = "-2466";
-  reflectionsDelay = "0.179";
-  reflectionsPan[ 0 ] = "0.0";
-  reflectionsPan[ 1 ] = "0.0";
-  reflectionsPan[ 2 ] = "0.0";
-  reverb = "-1926";
-  reverbDelay = "0.1";
-  reverbPan[ 0 ] = "0.0";
-  reverbPan[ 1 ] = "0.0";
-  reverbPan[ 2 ] = "0.0";
-  echoTime = "0.25";
-  echoDepth = "1.0";
-  modulationTime = "0.25";
-  modulationDepth = "0.0";
-  airAbsorptionHF = "-5.0";
-  HFReference = "5000.0";
-  LFReference = "250.0";
-  roomRolloffFactor = "0.0";
-  diffusion = "21.0";
-  density = "100.0";
-  flags = 0x3f;
-};
-
-singleton SFXEnvironment( AudioEnvParkingLot )
-{
-  envSize = "8.3";
-  envDiffusion = "1.0";
-  room = "-1000";
-  roomHF = "0";
-  roomLF = "0";
-  decayTime = "1.65";
-  decayHFRatio = "1.5";
-  decayLFRatio = "1.0";
-  reflections = "-1363";
-  reflectionsDelay = "0.008";
-  reflectionsPan[ 0 ] = "0.0";
-  reflectionsPan[ 1 ] = "0.0";
-  reflectionsPan[ 2 ] = "0.0";
-  reverb = "-1153";
-  reverbDelay = "0.012";
-  reverbPan[ 0 ] = "0.0";
-  reverbPan[ 1 ] = "0.0";
-  reverbPan[ 2 ] = "0.0";
-  echoTime = "0.25";
-  echoDepth = "0.0";
-  modulationTime = "0.25";
-  modulationDepth = "0.0";
-  airAbsorptionHF = "-5.0";
-  HFReference = "5000.0";
-  LFReference = "250.0";
-  roomRolloffFactor = "0.0";
-  diffusion = "100.0";
-  density = "100.0";
-  flags = 0x1f;
-};
-
-singleton SFXEnvironment( AudioEnvSewerPipe )
-{
-  envSize = "1.7";
-  envDiffusion = "0.8";
-  room = "-1000";
-  roomHF = "-1000";
-  roomLF = "0";
-  decayTime = "2.81";
-  decayHFRatio = "0.14";
-  decayLFRatio = "1.0";
-  reflections = "429";
-  reflectionsDelay = "0.014";
-  reflectionsPan[ 0 ] = "0.0";
-  reflectionsPan[ 1 ] = "0.0";
-  reflectionsPan[ 2 ] = "0.0";
-  reverb = "1023";
-  reverbDelay = "0.21";
-  reverbPan[ 0 ] = "0.0";
-  reverbPan[ 1 ] = "0.0";
-  reverbPan[ 2 ] = "0.0";
-  echoTime = "0.25";
-  echoDepth = "0.0";
-  modulationTime = "0.25";
-  modulationDepth = "0.0";
-  airAbsorptionHF = "-5.0";
-  HFReference = "5000.0";
-  LFReference = "250.0";
-  roomRolloffFactor = "0.0";
-  diffusion = "80.0";
-  density = "60.0";
-  flags = 0x3f;
-};
-
-singleton SFXEnvironment( AudioEnvUnderwater )
-{
-  envSize = "1.8";
-  envDiffusion = "1.0";
-  room = "-1000";
-  roomHF = "-4000";
-  roomLF = "0";
-  decayTime = "1.49";
-  decayHFRatio = "0.1";
-  decayLFRatio = "1.0";
-  reflections = "-449";
-  reflectionsDelay = "0.007";
-  reflectionsPan[ 0 ] = "0.0";
-  reflectionsPan[ 1 ] = "0.0";
-  reflectionsPan[ 2 ] = "0.0";
-  reverb = "1700";
-  reverbDelay = "0.011";
-  reverbPan[ 0 ] = "0.0";
-  reverbPan[ 1 ] = "0.0";
-  reverbPan[ 2 ] = "0.0";
-  echoTime = "0.25";
-  echoDepth = "0.0";
-  modulationTime = "1.18";
-  modulationDepth = "0.348";
-  airAbsorptionHF = "-5.0";
-  HFReference = "5000.0";
-  LFReference = "250.0";
-  roomRolloffFactor = "0.0";
-  diffusion = "100.0";
-  density = "100.0";
-  flags = 0x3f;
-};
-
-singleton SFXEnvironment( AudioEnvDrugged )
-{
-  envSize = "1.9";
-  envDiffusion = "0.5";
-  room = "-1000";
-  roomHF = "0";
-  roomLF = "0";
-  decayTime = "8.39";
-  decayHFRatio = "1.39";
-  decayLFRatio = "1.0";
-  reflections = "-115";
-  reflectionsDelay = "0.002";
-  reflectionsPan[ 0 ] = "0.0";
-  reflectionsPan[ 1 ] = "0.0";
-  reflectionsPan[ 2 ] = "0.0";
-  reverb = "985";
-  reverbDelay = "0.03";
-  reverbPan[ 0 ] = "0.0";
-  reverbPan[ 1 ] = "0.0";
-  reverbPan[ 2 ] = "0.0";
-  echoTime = "0.25";
-  echoDepth = "0.0";
-  modulationTime = "0.25";
-  modulationDepth = "1.0";
-  airAbsorptionHF = "-5.0";
-  HFReference = "5000.0";
-  LFReference = "250.0";
-  roomRolloffFactor = "0.0";
-  diffusion = "100.0";
-  density = "100.0";
-  flags = 0x1f;
-};
-
-singleton SFXEnvironment( AudioEnvDizzy )
-{
-  envSize = "1.8";
-  envDiffusion = "0.6";
-  room = "-1000.0";
-  roomHF = "-400";
-  roomLF = "0";
-  decayTime = "17.23";
-  decayHFRatio = "0.56";
-  decayLFRatio = "1.0";
-  reflections = "-1713";
-  reflectionsDelay = "0.02";
-  reflectionsPan[ 0 ] = "0.0";
-  reflectionsPan[ 1 ] = "0.0";
-  reflectionsPan[ 2 ] = "0.0";
-  reverb = "-613";
-  reverbDelay = "0.03";
-  reverbPan[ 0 ] = "0.0";
-  reverbPan[ 1 ] = "0.0";
-  reverbPan[ 2 ] = "0.0";
-  echoTime = "0.25";
-  echoDepth = "1.0";
-  modulationTime = "0.81";
-  modulationDepth = "0.31";
-  airAbsorptionHF = "-5.0";
-  HFReference = "5000.0";
-  LFReference = "250.0";
-  roomRolloffFactor = "0.0";
-  diffusion = "100.0";
-  density = "100.0";
-  flags = 0x1f;
-};
-
-singleton SFXEnvironment( AudioEnvPsychotic )
-{
-  envSize = "1.0";
-  envDiffusion = "0.5";
-  room = "-1000";
-  roomHF = "-151";
-  roomLF = "0";
-  decayTime = "7.56";
-  decayHFRatio = "0.91";
-  decayLFRatio = "1.0";
-  reflections = "-626";
-  reflectionsDelay = "0.02";
-  reflectionsPan[ 0 ] = "0.0";
-  reflectionsPan[ 1 ] = "0.0";
-  reflectionsPan[ 2 ] = "0.0";
-  reverb = "774";
-  reverbDelay = "0.03";
-  reverbPan[ 0 ] = "0.0";
-  reverbPan[ 1 ] = "0.0";
-  reverbPan[ 2 ] = "0.0";
-  echoTime = "0.25";
-  echoDepth = "0.0";
-  modulationTime = "4.0";
-  modulationDepth = "1.0";
-  airAbsorptionHF = "-5.0";
-  HFReference = "5000.0";
-  LFReference = "250.0";
-  roomRolloffFactor = "0.0";
-  diffusion = "100.0";
-  density = "100.0";
-  flags = 0x1f;
+singleton SFXEnvironment(Generic) 
+{
+  reverbDensity = "1.000";
+  reverbDiffusion = "1.000";
+  reverbGain = "0.3162";
+  reverbGainHF = "0.8913";
+  reverbGainLF = "1.000";
+  reverbDecayTime = "1.4900";
+  reverbDecayHFRatio = "0.8300";
+  reverbDecayLFRatio = "1.0000";
+  reflectionsGain = "0.0500";
+  reflectionDelay = "0.0070";
+  reflectionsPan[ 0 ] = "0.0";
+  reflectionsPan[ 1 ] = "0.0";
+  reflectionsPan[ 2 ] = "0.0";
+  lateReverbGain = "1.2589";
+  lateReverbDelay = "0.0110";
+  lateReverbPan[ 0 ] = "0.0";
+  lateReverbPan[ 1 ] = "0.0";
+  lateReverbPan[ 2 ] = "0.0";
+  reverbEchoTime = "0.2500";
+  reverbEchoDepth = "0.0000";
+  reverbModTime = "0.2500";
+  reverbModDepth = "0.0000";
+  airAbsorbtionGainHF = "0.9943";
+  reverbHFRef = "5000.0000";
+  reverbLFRef = "250.0000";
+  roomRolloffFactor = "0.0000";
+  decayHFLimit = "1";
+};
+
+singleton SFXEnvironment(PaddedCell) 
+{
+  reverbDensity = "0.1715";
+  reverbDiffusion = "1.000";
+  reverbGain = "0.3162";
+  reverbGainHF = "0.0010";
+  reverbGainLF = "1.000";
+  reverbDecayTime = "0.1700";
+  reverbDecayHFRatio = "0.1000";
+  reverbDecayLFRatio = "1.0000";
+  reflectionsGain = "0.2500";
+  reflectionDelay = "0.0010";
+  reflectionsPan[ 0 ] = "0.0";
+  reflectionsPan[ 1 ] = "0.0";
+  reflectionsPan[ 2 ] = "0.0";
+  lateReverbGain = "1.2691";
+  lateReverbDelay = "0.0020";
+  lateReverbPan[ 0 ] = "0.0";
+  lateReverbPan[ 1 ] = "0.0";
+  lateReverbPan[ 2 ] = "0.0";
+  reverbEchoTime = "0.2500";
+  reverbEchoDepth = "0.0000";
+  reverbModTime = "0.2500";
+  reverbModDepth = "0.0000";
+  airAbsorbtionGainHF = "0.9943";
+  reverbHFRef = "5000.0000";
+  reverbLFRef = "250.0000";
+  roomRolloffFactor = "0.0000";
+  decayHFLimit = "1";
+};
+
+singleton SFXEnvironment(PresetRoom) 
+{
+  reverbDensity = "0.4287";
+  reverbDiffusion = "1.000";
+  reverbGain = "0.3162";
+  reverbGainHF = "0.5929";
+  reverbGainLF = "1.000";
+  reverbDecayTime = "0.4000";
+  reverbDecayHFRatio = "0.8300";
+  reverbDecayLFRatio = "1.0000";
+  reflectionsGain = "0.1503";
+  reflectionDelay = "0.0020";
+  reflectionsPan[ 0 ] = "0.0";
+  reflectionsPan[ 1 ] = "0.0";
+  reflectionsPan[ 2 ] = "0.0";
+  lateReverbGain = "1.0629";
+  lateReverbDelay = "0.0030";
+  lateReverbPan[ 0 ] = "0.0";
+  lateReverbPan[ 1 ] = "0.0";
+  lateReverbPan[ 2 ] = "0.0";
+  reverbEchoTime = "0.2500";
+  reverbEchoDepth = "0.0000";
+  reverbModTime = "0.2500";
+  reverbModDepth = "0.0000";
+  airAbsorbtionGainHF = "0.9943";
+  reverbHFRef = "5000.0000";
+  reverbLFRef = "250.0000";
+  roomRolloffFactor = "0.0000";
+  decayHFLimit = "1";
+};
+
+singleton SFXEnvironment(PresetBathroom) 
+{
+  reverbDensity = "0.1715";
+  reverbDiffusion = "1.000";
+  reverbGain = "0.3162";
+  reverbGainHF = "0.2512";
+  reverbGainLF = "1.000";
+  reverbDecayTime = "1.4900";
+  reverbDecayHFRatio = "0.5400";
+  reverbDecayLFRatio = "1.0000";
+  reflectionsGain = "0.6531";
+  reflectionDelay = "0.0070";
+  reflectionsPan[ 0 ] = "0.0";
+  reflectionsPan[ 1 ] = "0.0";
+  reflectionsPan[ 2 ] = "0.0";
+  lateReverbGain = "3.2734";
+  lateReverbDelay = "0.0110";
+  lateReverbPan[ 0 ] = "0.0";
+  lateReverbPan[ 1 ] = "0.0";
+  lateReverbPan[ 2 ] = "0.0";
+  reverbEchoTime = "0.2500";
+  reverbEchoDepth = "0.0000";
+  reverbModTime = "0.2500";
+  reverbModDepth = "0.0000";
+  airAbsorbtionGainHF = "0.9943";
+  reverbHFRef = "5000.0000";
+  reverbLFRef = "250.0000";
+  roomRolloffFactor = "0.0000";
+  decayHFLimit = "1";
+};
+
+singleton SFXEnvironment(PresetLivingroom) 
+{
+  reverbDensity = "0.9766";
+  reverbDiffusion = "1.000";
+  reverbGain = "0.3162";
+  reverbGainHF = "0.0010";
+  reverbGainLF = "1.0000";
+  reverbDecayTime = "0.0900";
+  reverbDecayHFRatio = "0.5000";
+  reverbDecayLFRatio = "1.0000";
+  reflectionsGain = "0.2051";
+  reflectionDelay = "0.0030";
+  reflectionsPan[ 0 ] = "0.0";
+  reflectionsPan[ 1 ] = "0.0";
+  reflectionsPan[ 2 ] = "0.0";
+  lateReverbGain = "0.2805";
+  lateReverbDelay = "0.0040";
+  lateReverbPan[ 0 ] = "0.0";
+  lateReverbPan[ 1 ] = "0.0";
+  lateReverbPan[ 2 ] = "0.0";
+  reverbEchoTime = "0.2500";
+  reverbEchoDepth = "0.0000";
+  reverbModTime = "0.2500";
+  reverbModDepth = "0.0000";
+  airAbsorbtionGainHF = "0.9943";
+  reverbHFRef = "5000.0000";
+  reverbLFRef = "250.0000";
+  roomRolloffFactor = "0.0000";
+  decayHFLimit = "1";
+};
+
+singleton SFXEnvironment(PresetStoneroom) 
+{
+  reverbDensity = "1.000";
+  reverbDiffusion = "1.000";
+  reverbGain = "0.3162";
+  reverbGainHF = "0.7079";
+  reverbGainLF = "1.0000";
+  reverbDecayTime = "2.3100";
+  reverbDecayHFRatio = "0.6400";
+  reverbDecayLFRatio = "1.0000";
+  reflectionsGain = "0.4411";
+  reflectionDelay = "0.0120";
+  reflectionsPan[ 0 ] = "0.0";
+  reflectionsPan[ 1 ] = "0.0";
+  reflectionsPan[ 2 ] = "0.0";
+  lateReverbGain = "1.1003";
+  lateReverbDelay = "0.0170";
+  lateReverbPan[ 0 ] = "0.0";
+  lateReverbPan[ 1 ] = "0.0";
+  lateReverbPan[ 2 ] = "0.0";
+  reverbEchoTime = "0.2500";
+  reverbEchoDepth = "0.0000";
+  reverbModTime = "0.2500";
+  reverbModDepth = "0.0000";
+  airAbsorbtionGainHF = "0.9943";
+  reverbHFRef = "5000.0000";
+  reverbLFRef = "250.0000";
+  roomRolloffFactor = "0.0000";
+  decayHFLimit = "1";
+};
+
+singleton SFXEnvironment(PresetAuditorium) 
+{
+  reverbDensity = "1.000";
+  reverbDiffusion = "1.000";
+  reverbGain = "0.3162";
+  reverbGainHF = "0.5781";
+  reverbGainLF = "1.0000";
+  reverbDecayTime = "4.3200";
+  reverbDecayHFRatio = "0.5900";
+  reverbDecayLFRatio = "1.0000";
+  reflectionsGain = "0.4032";
+  reflectionDelay = "0.0200";
+  reflectionsPan[ 0 ] = "0.0";
+  reflectionsPan[ 1 ] = "0.0";
+  reflectionsPan[ 2 ] = "0.0";
+  lateReverbGain = "0.7170";
+  lateReverbDelay = "0.0300";
+  lateReverbPan[ 0 ] = "0.0";
+  lateReverbPan[ 1 ] = "0.0";
+  lateReverbPan[ 2 ] = "0.0";
+  reverbEchoTime = "0.2500";
+  reverbEchoDepth = "0.0000";
+  reverbModTime = "0.2500";
+  reverbModDepth = "0.0000";
+  airAbsorbtionGainHF = "0.9943";
+  reverbHFRef = "5000.0000";
+  reverbLFRef = "250.0000";
+  roomRolloffFactor = "0.0000";
+  decayHFLimit = "1";
+};
+
+singleton SFXEnvironment(PresetConcerthall) 
+{
+  reverbDensity = "1.000";
+  reverbDiffusion = "1.000";
+  reverbGain = "0.3162";
+  reverbGainHF = "0.5632";
+  reverbGainLF = "1.0000";
+  reverbDecayTime = "3.9200";
+  reverbDecayHFRatio = "0.7000";
+  reverbDecayLFRatio = "1.0000";
+  reflectionsGain = "0.2427";
+  reflectionDelay = "0.0200";
+  reflectionsPan[ 0 ] = "0.0";
+  reflectionsPan[ 1 ] = "0.0";
+  reflectionsPan[ 2 ] = "0.0";
+  lateReverbGain = "0.9977";
+  lateReverbDelay = "0.0290";
+  lateReverbPan[ 0 ] = "0.0";
+  lateReverbPan[ 1 ] = "0.0";
+  lateReverbPan[ 2 ] = "0.0";
+  reverbEchoTime = "0.2500";
+  reverbEchoDepth = "0.0000";
+  reverbModTime = "0.2500";
+  reverbModDepth = "0.0000";
+  airAbsorbtionGainHF = "0.9943";
+  reverbHFRef = "5000.0000";
+  reverbLFRef = "250.0000";
+  roomRolloffFactor = "0.0000";
+  decayHFLimit = "1";
+};
+
+singleton SFXEnvironment(PresetCave) 
+{
+  reverbDensity = "1.000";
+  reverbDiffusion = "1.000";
+  reverbGain = "0.3162";
+  reverbGainHF = "1.000";
+  reverbGainLF = "1.0000";
+  reverbDecayTime = "2.9100";
+  reverbDecayHFRatio = "1.3000";
+  reverbDecayLFRatio = "1.0000";
+  reflectionsGain = "0.5000";
+  reflectionDelay = "0.0250";
+  reflectionsPan[ 0 ] = "0.0";
+  reflectionsPan[ 1 ] = "0.0";
+  reflectionsPan[ 2 ] = "0.0";
+  lateReverbGain = "0.7063";
+  lateReverbDelay = "0.0220";
+  lateReverbPan[ 0 ] = "0.0";
+  lateReverbPan[ 1 ] = "0.0";
+  lateReverbPan[ 2 ] = "0.0";
+  reverbEchoTime = "0.2500";
+  reverbEchoDepth = "0.0000";
+  reverbModTime = "0.2500";
+  reverbModDepth = "0.0000";
+  airAbsorbtionGainHF = "0.9943";
+  reverbHFRef = "5000.0000";
+  reverbLFRef = "250.0000";
+  roomRolloffFactor = "0.0000";
+  decayHFLimit = "0";
+};
+
+singleton SFXEnvironment(PresetArena) 
+{
+  reverbDensity = "1.000";
+  reverbDiffusion = "1.000";
+  reverbGain = "0.3162";
+  reverbGainHF = "0.4477";
+  reverbGainLF = "1.0000";
+  reverbDecayTime = "7.2400";
+  reverbDecayHFRatio = "0.3300";
+  reverbDecayLFRatio = "1.0000";
+  reflectionsGain = "0.2612";
+  reflectionDelay = "0.0200";
+  reflectionsPan[ 0 ] = "0.0";
+  reflectionsPan[ 1 ] = "0.0";
+  reflectionsPan[ 2 ] = "0.0";
+  lateReverbGain = "1.0186";
+  lateReverbDelay = "0.0300";
+  lateReverbPan[ 0 ] = "0.0";
+  lateReverbPan[ 1 ] = "0.0";
+  lateReverbPan[ 2 ] = "0.0";
+  reverbEchoTime = "0.2500";
+  reverbEchoDepth = "0.0000";
+  reverbModTime = "0.2500";
+  reverbModDepth = "0.0000";
+  airAbsorbtionGainHF = "0.9943";
+  reverbHFRef = "5000.0000";
+  reverbLFRef = "250.0000";
+  roomRolloffFactor = "0.0000";
+  decayHFLimit = "1";
+};
+
+singleton SFXEnvironment(PresetHangar) 
+{
+  reverbDensity = "1.000";
+  reverbDiffusion = "1.000";
+  reverbGain = "0.3162";
+  reverbGainHF = "0.3162";
+  reverbGainLF = "1.0000";
+  reverbDecayTime = "10.0500";
+  reverbDecayHFRatio = "0.2300";
+  reverbDecayLFRatio = "1.0000";
+  reflectionsGain = "0.5000";
+  reflectionDelay = "0.0200";
+  reflectionsPan[ 0 ] = "0.0";
+  reflectionsPan[ 1 ] = "0.0";
+  reflectionsPan[ 2 ] = "0.0";
+  lateReverbGain = "1.2560";
+  lateReverbDelay = "0.0300";
+  lateReverbPan[ 0 ] = "0.0";
+  lateReverbPan[ 1 ] = "0.0";
+  lateReverbPan[ 2 ] = "0.0";
+  reverbEchoTime = "0.2500";
+  reverbEchoDepth = "0.0000";
+  reverbModTime = "0.2500";
+  reverbModDepth = "0.0000";
+  airAbsorbtionGainHF = "0.9943";
+  reverbHFRef = "5000.0000";
+  reverbLFRef = "250.0000";
+  roomRolloffFactor = "0.0000";
+  decayHFLimit = "1";
+};
+
+singleton SFXEnvironment(PresetCarpetedHall) 
+{
+  reverbDensity = "0.4287";
+  reverbDiffusion = "1.000";
+  reverbGain = "0.3162";
+  reverbGainHF = "0.0100";
+  reverbGainLF = "1.0000";
+  reverbDecayTime = "0.3000";
+  reverbDecayHFRatio = "0.1000";
+  reverbDecayLFRatio = "1.0000";
+  reflectionsGain = "0.1215";
+  reflectionDelay = "0.0020";
+  reflectionsPan[ 0 ] = "0.0";
+  reflectionsPan[ 1 ] = "0.0";
+  reflectionsPan[ 2 ] = "0.0";
+  lateReverbGain = "0.1531";
+  lateReverbDelay = "0.0300";
+  lateReverbPan[ 0 ] = "0.0";
+  lateReverbPan[ 1 ] = "0.0";
+  lateReverbPan[ 2 ] = "0.0";
+  reverbEchoTime = "0.2500";
+  reverbEchoDepth = "0.0000";
+  reverbModTime = "0.2500";
+  reverbModDepth = "0.0000";
+  airAbsorbtionGainHF = "0.9943";
+  reverbHFRef = "5000.0000";
+  reverbLFRef = "250.0000";
+  roomRolloffFactor = "0.0000";
+  decayHFLimit = "1";
+};
+
+singleton SFXEnvironment(PresetHallway) 
+{
+  reverbDensity = "0.3645";
+  reverbDiffusion = "1.000";
+  reverbGain = "0.3162";
+  reverbGainHF = "0.7079";
+  reverbGainLF = "1.0000";
+  reverbDecayTime = "1.4900";
+  reverbDecayHFRatio = "0.5900";
+  reverbDecayLFRatio = "1.0000";
+  reflectionsGain = "0.2458";
+  reflectionDelay = "0.0070";
+  reflectionsPan[ 0 ] = "0.0";
+  reflectionsPan[ 1 ] = "0.0";
+  reflectionsPan[ 2 ] = "0.0";
+  lateReverbGain = "1.6615";
+  lateReverbDelay = "0.0110";
+  lateReverbPan[ 0 ] = "0.0";
+  lateReverbPan[ 1 ] = "0.0";
+  lateReverbPan[ 2 ] = "0.0";
+  reverbEchoTime = "0.2500";
+  reverbEchoDepth = "0.0000";
+  reverbModTime = "0.2500";
+  reverbModDepth = "0.0000";
+  airAbsorbtionGainHF = "0.9943";
+  reverbHFRef = "5000.0000";
+  reverbLFRef = "250.0000";
+  roomRolloffFactor = "0.0000";
+  decayHFLimit = "1";
+};
+
+singleton SFXEnvironment(PresetStoneCorridor) 
+{
+  reverbDensity = "1.000";
+  reverbDiffusion = "1.000";
+  reverbGain = "0.3162";
+  reverbGainHF = "0.7612";
+  reverbGainLF = "1.0000";
+  reverbDecayTime = "2.7000";
+  reverbDecayHFRatio = "0.7900";
+  reverbDecayLFRatio = "1.0000";
+  reflectionsGain = "0.2472";
+  reflectionDelay = "0.0130";
+  reflectionsPan[ 0 ] = "0.0";
+  reflectionsPan[ 1 ] = "0.0";
+  reflectionsPan[ 2 ] = "0.0";
+  lateReverbGain = "1.5758";
+  lateReverbDelay = "0.0200";
+  lateReverbPan[ 0 ] = "0.0";
+  lateReverbPan[ 1 ] = "0.0";
+  lateReverbPan[ 2 ] = "0.0";
+  reverbEchoTime = "0.2500";
+  reverbEchoDepth = "0.0000";
+  reverbModTime = "0.2500";
+  reverbModDepth = "0.0000";
+  airAbsorbtionGainHF = "0.9943";
+  reverbHFRef = "5000.0000";
+  reverbLFRef = "250.0000";
+  roomRolloffFactor = "0.0000";
+  decayHFLimit = "1";
+};
+
+singleton SFXEnvironment(PresetStoneAlley)
+{
+  reverbDensity = "1.000";
+  reverbDiffusion = "0.300";
+  reverbGain = "0.3162";
+  reverbGainHF = "0.7328";
+  reverbGainLF = "1.0000";
+  reverbDecayTime = "1.4900";
+  reverbDecayHFRatio = "0.8600";
+  reverbDecayLFRatio = "1.0000";
+  reflectionsGain = "0.2500";
+  reflectionDelay = "0.0070";
+  reflectionsPan[ 0 ] = "0.0";
+  reflectionsPan[ 1 ] = "0.0";
+  reflectionsPan[ 2 ] = "0.0";
+  lateReverbGain = "0.9954";
+  lateReverbDelay = "0.0110";
+  lateReverbPan[ 0 ] = "0.0";
+  lateReverbPan[ 1 ] = "0.0";
+  lateReverbPan[ 2 ] = "0.0";
+  reverbEchoTime = "0.1250";
+  reverbEchoDepth = "0.9500";
+  reverbModTime = "0.2500";
+  reverbModDepth = "0.0000";
+  airAbsorbtionGainHF = "0.9943";
+  reverbHFRef = "5000.0000";
+  reverbLFRef = "250.0000";
+  roomRolloffFactor = "0.0000";
+  decayHFLimit = "1";
+};
+
+singleton SFXEnvironment(PresetForest)
+{
+  reverbDensity = "1.000";
+  reverbDiffusion = "0.300";
+  reverbGain = "0.3162";
+  reverbGainHF = "0.0224";
+  reverbGainLF = "1.0000";
+  reverbDecayTime = "1.4900";
+  reverbDecayHFRatio = "0.5400";
+  reverbDecayLFRatio = "1.0000";
+  reflectionsGain = "0.0525";
+  reflectionDelay = "0.1620";
+  reflectionsPan[ 0 ] = "0.0";
+  reflectionsPan[ 1 ] = "0.0";
+  reflectionsPan[ 2 ] = "0.0";
+  lateReverbGain = "0.7682";
+  lateReverbDelay = "0.0880";
+  lateReverbPan[ 0 ] = "0.0";
+  lateReverbPan[ 1 ] = "0.0";
+  lateReverbPan[ 2 ] = "0.0";
+  reverbEchoTime = "0.1250";
+  reverbEchoDepth = "1.0000";
+  reverbModTime = "0.2500";
+  reverbModDepth = "0.0000";
+  airAbsorbtionGainHF = "0.9943";
+  reverbHFRef = "5000.0000";
+  reverbLFRef = "250.0000";
+  roomRolloffFactor = "0.0000";
+  decayHFLimit = "1";
+};
+
+singleton SFXEnvironment(PresetCity)
+{
+  reverbDensity = "1.000";
+  reverbDiffusion = "0.500";
+  reverbGain = "0.3162";
+  reverbGainHF = "0.3981";
+  reverbGainLF = "1.0000";
+  reverbDecayTime = "1.4900";
+  reverbDecayHFRatio = "0.6700";
+  reverbDecayLFRatio = "1.0000";
+  reflectionsGain = "0.0730";
+  reflectionDelay = "0.0070";
+  reflectionsPan[ 0 ] = "0.0";
+  reflectionsPan[ 1 ] = "0.0";
+  reflectionsPan[ 2 ] = "0.0";
+  lateReverbGain = "0.1427";
+  lateReverbDelay = "0.0110";
+  lateReverbPan[ 0 ] = "0.0";
+  lateReverbPan[ 1 ] = "0.0";
+  lateReverbPan[ 2 ] = "0.0";
+  reverbEchoTime = "0.1250";
+  reverbEchoDepth = "0.0000";
+  reverbModTime = "0.2500";
+  reverbModDepth = "0.0000";
+  airAbsorbtionGainHF = "0.9943";
+  reverbHFRef = "5000.0000";
+  reverbLFRef = "250.0000";
+  roomRolloffFactor = "0.0000";
+  decayHFLimit = "1";
+};
+
+singleton SFXEnvironment(PresetMountains)
+{
+  reverbDensity = "1.000";
+  reverbDiffusion = "0.2700";
+  reverbGain = "0.3162";
+  reverbGainHF = "0.0562";
+  reverbGainLF = "1.0000";
+  reverbDecayTime = "1.4900";
+  reverbDecayHFRatio = "0.2100";
+  reverbDecayLFRatio = "1.0000";
+  reflectionsGain = "0.0407";
+  reflectionDelay = "0.3000";
+  reflectionsPan[ 0 ] = "0.0";
+  reflectionsPan[ 1 ] = "0.0";
+  reflectionsPan[ 2 ] = "0.0";
+  lateReverbGain = "0.1919";
+  lateReverbDelay = "0.1000";
+  lateReverbPan[ 0 ] = "0.0";
+  lateReverbPan[ 1 ] = "0.0";
+  lateReverbPan[ 2 ] = "0.0";
+  reverbEchoTime = "0.1250";
+  reverbEchoDepth = "1.0000";
+  reverbModTime = "0.2500";
+  reverbModDepth = "0.0000";
+  airAbsorbtionGainHF = "0.9943";
+  reverbHFRef = "5000.0000";
+  reverbLFRef = "250.0000";
+  roomRolloffFactor = "0.0000";
+  decayHFLimit = "0";
+};
+
+singleton SFXEnvironment(PresetQuarry)
+{
+  reverbDensity = "1.000";
+  reverbDiffusion = "1.0000";
+  reverbGain = "0.3162";
+  reverbGainHF = "0.3162";
+  reverbGainLF = "1.0000";
+  reverbDecayTime = "1.4900";
+  reverbDecayHFRatio = "0.8300";
+  reverbDecayLFRatio = "1.0000";
+  reflectionsGain = "0.0000";
+  reflectionDelay = "0.0610";
+  reflectionsPan[ 0 ] = "0.0";
+  reflectionsPan[ 1 ] = "0.0";
+  reflectionsPan[ 2 ] = "0.0";
+  lateReverbGain = "1.7783";
+  lateReverbDelay = "0.0250";
+  lateReverbPan[ 0 ] = "0.0";
+  lateReverbPan[ 1 ] = "0.0";
+  lateReverbPan[ 2 ] = "0.0";
+  reverbEchoTime = "0.1250";
+  reverbEchoDepth = "0.7000";
+  reverbModTime = "0.2500";
+  reverbModDepth = "0.0000";
+  airAbsorbtionGainHF = "0.9943";
+  reverbHFRef = "5000.0000";
+  reverbLFRef = "250.0000";
+  roomRolloffFactor = "0.0000";
+  decayHFLimit = "1";
+};
+
+singleton SFXEnvironment(PresetPlain)
+{
+  reverbDensity = "1.000";
+  reverbDiffusion = "0.2100";
+  reverbGain = "0.3162";
+  reverbGainHF = "0.1000";
+  reverbGainLF = "1.0000";
+  reverbDecayTime = "1.4900";
+  reverbDecayHFRatio = "0.5000";
+  reverbDecayLFRatio = "1.0000";
+  reflectionsGain = "0.0585";
+  reflectionDelay = "0.1790";
+  reflectionsPan[ 0 ] = "0.0";
+  reflectionsPan[ 1 ] = "0.0";
+  reflectionsPan[ 2 ] = "0.0";
+  lateReverbGain = "0.1089";
+  lateReverbDelay = "0.1000";
+  lateReverbPan[ 0 ] = "0.0";
+  lateReverbPan[ 1 ] = "0.0";
+  lateReverbPan[ 2 ] = "0.0";
+  reverbEchoTime = "0.2500";
+  reverbEchoDepth = "1.0000";
+  reverbModTime = "0.2500";
+  reverbModDepth = "0.0000";
+  airAbsorbtionGainHF = "0.9943";
+  reverbHFRef = "5000.0000";
+  reverbLFRef = "250.0000";
+  roomRolloffFactor = "0.0000";
+  decayHFLimit = "1";
+};
+
+singleton SFXEnvironment(PresetParkinglot)
+{
+  reverbDensity = "1.000";
+  reverbDiffusion = "1.0000";
+  reverbGain = "0.3162";
+  reverbGainHF = "1.0000";
+  reverbGainLF = "1.0000";
+  reverbDecayTime = "1.6500";
+  reverbDecayHFRatio = "1.5000";
+  reverbDecayLFRatio = "1.0000";
+  reflectionsGain = "0.2082";
+  reflectionDelay = "0.0080";
+  reflectionsPan[ 0 ] = "0.0";
+  reflectionsPan[ 1 ] = "0.0";
+  reflectionsPan[ 2 ] = "0.0";
+  lateReverbGain = "0.2652";
+  lateReverbDelay = "0.0120";
+  lateReverbPan[ 0 ] = "0.0";
+  lateReverbPan[ 1 ] = "0.0";
+  lateReverbPan[ 2 ] = "0.0";
+  reverbEchoTime = "0.2500";
+  reverbEchoDepth = "0.0000";
+  reverbModTime = "0.2500";
+  reverbModDepth = "0.0000";
+  airAbsorbtionGainHF = "0.9943";
+  reverbHFRef = "5000.0000";
+  reverbLFRef = "250.0000";
+  roomRolloffFactor = "0.0000";
+  decayHFLimit = "0";
+};
+
+singleton SFXEnvironment(PresetSewerpipe)
+{
+  reverbDensity = "0.3071";
+  reverbDiffusion = "0.8000";
+  reverbGain = "0.3162";
+  reverbGainHF = "0.3162";
+  reverbGainLF = "1.0000";
+  reverbDecayTime = "2.8100";
+  reverbDecayHFRatio = "0.1400";
+  reverbDecayLFRatio = "1.0000";
+  reflectionsGain = "1.6387";
+  reflectionDelay = "0.0140";
+  reflectionsPan[ 0 ] = "0.0";
+  reflectionsPan[ 1 ] = "0.0";
+  reflectionsPan[ 2 ] = "0.0";
+  lateReverbGain = "3.2471";
+  lateReverbDelay = "0.0210";
+  lateReverbPan[ 0 ] = "0.0";
+  lateReverbPan[ 1 ] = "0.0";
+  lateReverbPan[ 2 ] = "0.0";
+  reverbEchoTime = "0.2500";
+  reverbEchoDepth = "0.0000";
+  reverbModTime = "0.2500";
+  reverbModDepth = "0.0000";
+  airAbsorbtionGainHF = "0.9943";
+  reverbHFRef = "5000.0000";
+  reverbLFRef = "250.0000";
+  roomRolloffFactor = "0.0000";
+  decayHFLimit = "1";
+};
+
+singleton SFXEnvironment(PresetUnderwater)
+{
+  reverbDensity = "0.3645";
+  reverbDiffusion = "1.0000";
+  reverbGain = "0.3162";
+  reverbGainHF = "0.0100";
+  reverbGainLF = "1.0000";
+  reverbDecayTime = "1.4900";
+  reverbDecayHFRatio = "0.1000";
+  reverbDecayLFRatio = "1.0000";
+  reflectionsGain = "0.5963";
+  reflectionDelay = "0.0070";
+  reflectionsPan[ 0 ] = "0.0";
+  reflectionsPan[ 1 ] = "0.0";
+  reflectionsPan[ 2 ] = "0.0";
+  lateReverbGain = "7.0795";
+  lateReverbDelay = "0.0110";
+  lateReverbPan[ 0 ] = "0.0";
+  lateReverbPan[ 1 ] = "0.0";
+  lateReverbPan[ 2 ] = "0.0";
+  reverbEchoTime = "0.2500";
+  reverbEchoDepth = "0.0000";
+  reverbModTime = "1.1800";
+  reverbModDepth = "0.3480";
+  airAbsorbtionGainHF = "0.9943";
+  reverbHFRef = "5000.0000";
+  reverbLFRef = "250.0000";
+  roomRolloffFactor = "0.0000";
+  decayHFLimit = "1";
+};
+
+singleton SFXEnvironment(PresetDrugged)
+{
+  reverbDensity = "0.4287";
+  reverbDiffusion = "0.5000";
+  reverbGain = "0.3162";
+  reverbGainHF = "1.0000";
+  reverbGainLF = "1.0000";
+  reverbDecayTime = "8.3900";
+  reverbDecayHFRatio = "1.3900";
+  reverbDecayLFRatio = "1.0000";
+  reflectionsGain = "0.8760";
+  reflectionDelay = "0.0020";
+  reflectionsPan[ 0 ] = "0.0";
+  reflectionsPan[ 1 ] = "0.0";
+  reflectionsPan[ 2 ] = "0.0";
+  lateReverbGain = "3.1081";
+  lateReverbDelay = "0.0300";
+  lateReverbPan[ 0 ] = "0.0";
+  lateReverbPan[ 1 ] = "0.0";
+  lateReverbPan[ 2 ] = "0.0";
+  reverbEchoTime = "0.2500";
+  reverbEchoDepth = "0.0000";
+  reverbModTime = "0.2500";
+  reverbModDepth = "1.0000";
+  airAbsorbtionGainHF = "0.9943";
+  reverbHFRef = "5000.0000";
+  reverbLFRef = "250.0000";
+  roomRolloffFactor = "0.0000";
+  decayHFLimit = "0";
+};
+
+singleton SFXEnvironment(PresetDizzy)
+{
+  reverbDensity = "0.3645";
+  reverbDiffusion = "0.6000";
+  reverbGain = "0.3162";
+  reverbGainHF = "0.6310";
+  reverbGainLF = "1.0000";
+  reverbDecayTime = "17.2300";
+  reverbDecayHFRatio = "0.5600";
+  reverbDecayLFRatio = "1.0000";
+  reflectionsGain = "0.1392";
+  reflectionDelay = "0.0200";
+  reflectionsPan[ 0 ] = "0.0";
+  reflectionsPan[ 1 ] = "0.0";
+  reflectionsPan[ 2 ] = "0.0";
+  lateReverbGain = "0.4937";
+  lateReverbDelay = "0.0300";
+  lateReverbPan[ 0 ] = "0.0";
+  lateReverbPan[ 1 ] = "0.0";
+  lateReverbPan[ 2 ] = "0.0";
+  reverbEchoTime = "0.2500";
+  reverbEchoDepth = "1.0000";
+  reverbModTime = "0.8100";
+  reverbModDepth = "0.3100";
+  airAbsorbtionGainHF = "0.9943";
+  reverbHFRef = "5000.0000";
+  reverbLFRef = "250.0000";
+  roomRolloffFactor = "0.0000";
+  decayHFLimit = "0";
+};
+
+singleton SFXEnvironment(PresetPsychotic)
+{
+  reverbDensity = "0.0625";
+  reverbDiffusion = "0.5000";
+  reverbGain = "0.3162";
+  reverbGainHF = "0.8404";
+  reverbGainLF = "1.0000";
+  reverbDecayTime = "7.5600";
+  reverbDecayHFRatio = "0.9100";
+  reverbDecayLFRatio = "1.0000";
+  reflectionsGain = "0.4864";
+  reflectionDelay = "0.0200";
+  reflectionsPan[ 0 ] = "0.0";
+  reflectionsPan[ 1 ] = "0.0";
+  reflectionsPan[ 2 ] = "0.0";
+  lateReverbGain = "2.4378";
+  lateReverbDelay = "0.0300";
+  lateReverbPan[ 0 ] = "0.0";
+  lateReverbPan[ 1 ] = "0.0";
+  lateReverbPan[ 2 ] = "0.0";
+  reverbEchoTime = "0.2500";
+  reverbEchoDepth = "0.0000";
+  reverbModTime = "4.0000";
+  reverbModDepth = "1.0000";
+  airAbsorbtionGainHF = "0.9943";
+  reverbHFRef = "5000.0000";
+  reverbLFRef = "250.0000";
+  roomRolloffFactor = "0.0000";
+  decayHFLimit = "0";
+};
+
+singleton SFXEnvironment(CastleSmallroom)
+{
+  reverbDensity = "1.0000";
+  reverbDiffusion = "0.8900";
+  reverbGain = "0.3162";
+  reverbGainHF = "0.3981";
+  reverbGainLF = "0.1000";
+  reverbDecayTime = "1.2200";
+  reverbDecayHFRatio = "0.8300";
+  reverbDecayLFRatio = "0.3100";
+  reflectionsGain = "0.8913";
+  reflectionDelay = "0.0220";
+  reflectionsPan[ 0 ] = "0.0";
+  reflectionsPan[ 1 ] = "0.0";
+  reflectionsPan[ 2 ] = "0.0";
+  lateReverbGain = "1.9953";
+  lateReverbDelay = "0.0110";
+  lateReverbPan[ 0 ] = "0.0";
+  lateReverbPan[ 1 ] = "0.0";
+  lateReverbPan[ 2 ] = "0.0";
+  reverbEchoTime = "0.1380";
+  reverbEchoDepth = "0.0800";
+  reverbModTime = "0.2500";
+  reverbModDepth = "0.0000";
+  airAbsorbtionGainHF = "0.9943";
+  reverbHFRef = "5000.0000";
+  reverbLFRef = "250.0000";
+  roomRolloffFactor = "0.0000";
+  decayHFLimit = "1";
+};
+
+singleton SFXEnvironment(CastleShortPassage)
+{
+  reverbDensity = "1.0000";
+  reverbDiffusion = "0.8900";
+  reverbGain = "0.3162";
+  reverbGainHF = "0.3162";
+  reverbGainLF = "0.1000";
+  reverbDecayTime = "2.3200";
+  reverbDecayHFRatio = "0.8300";
+  reverbDecayLFRatio = "0.3100";
+  reflectionsGain = "0.8913";
+  reflectionDelay = "0.0070";
+  reflectionsPan[ 0 ] = "0.0";
+  reflectionsPan[ 1 ] = "0.0";
+  reflectionsPan[ 2 ] = "0.0";
+  lateReverbGain = "1.2589";
+  lateReverbDelay = "0.0230";
+  lateReverbPan[ 0 ] = "0.0";
+  lateReverbPan[ 1 ] = "0.0";
+  lateReverbPan[ 2 ] = "0.0";
+  reverbEchoTime = "0.1380";
+  reverbEchoDepth = "0.0800";
+  reverbModTime = "0.2500";
+  reverbModDepth = "0.0000";
+  airAbsorbtionGainHF = "0.9943";
+  reverbHFRef = "5168.0001";
+  reverbLFRef = "139.5000";
+  roomRolloffFactor = "0.0000";
+  decayHFLimit = "1";
+};
+
+singleton SFXEnvironment(CastleMediumRoom)
+{
+  reverbDensity = "1.0000";
+  reverbDiffusion = "0.9300";
+  reverbGain = "0.3162";
+  reverbGainHF = "0.2818";
+  reverbGainLF = "0.1000";
+  reverbDecayTime = "2.0400";
+  reverbDecayHFRatio = "0.8300";
+  reverbDecayLFRatio = "0.4600";
+  reflectionsGain = "0.6310";
+  reflectionDelay = "0.0220";
+  reflectionsPan[ 0 ] = "0.0";
+  reflectionsPan[ 1 ] = "0.0";
+  reflectionsPan[ 2 ] = "0.0";
+  lateReverbGain = "1.5849";
+  lateReverbDelay = "0.0110";
+  lateReverbPan[ 0 ] = "0.0";
+  lateReverbPan[ 1 ] = "0.0";
+  lateReverbPan[ 2 ] = "0.0";
+  reverbEchoTime = "0.1550";
+  reverbEchoDepth = "0.0300";
+  reverbModTime = "0.2500";
+  reverbModDepth = "0.0000";
+  airAbsorbtionGainHF = "0.9943";
+  reverbHFRef = "5168.0001";
+  reverbLFRef = "139.5000";
+  roomRolloffFactor = "0.0000";
+  decayHFLimit = "1";
+};
+
+singleton SFXEnvironment(CastleLargeRoom)
+{
+  reverbDensity = "1.0000";
+  reverbDiffusion = "0.8200";
+  reverbGain = "0.3162";
+  reverbGainHF = "0.2818";
+  reverbGainLF = "0.1259";
+  reverbDecayTime = "2.5300";
+  reverbDecayHFRatio = "0.8300";
+  reverbDecayLFRatio = "0.5000";
+  reflectionsGain = "0.4467";
+  reflectionDelay = "0.0340";
+  reflectionsPan[ 0 ] = "0.0";
+  reflectionsPan[ 1 ] = "0.0";
+  reflectionsPan[ 2 ] = "0.0";
+  lateReverbGain = "1.2589";
+  lateReverbDelay = "0.0160";
+  lateReverbPan[ 0 ] = "0.0";
+  lateReverbPan[ 1 ] = "0.0";
+  lateReverbPan[ 2 ] = "0.0";
+  reverbEchoTime = "0.1850";
+  reverbEchoDepth = "0.0700";
+  reverbModTime = "0.2500";
+  reverbModDepth = "0.0000";
+  airAbsorbtionGainHF = "0.9943";
+  reverbHFRef = "5168.0001";
+  reverbLFRef = "139.5000";
+  roomRolloffFactor = "0.0000";
+  decayHFLimit = "1";
+};
+
+singleton SFXEnvironment(CastleLongPassage)
+{
+  reverbDensity = "1.0000";
+  reverbDiffusion = "0.8900";
+  reverbGain = "0.3162";
+  reverbGainHF = "0.3981";
+  reverbGainLF = "0.1000";
+  reverbDecayTime = "3.4200";
+  reverbDecayHFRatio = "0.8300";
+  reverbDecayLFRatio = "0.3100";
+  reflectionsGain = "0.8913";
+  reflectionDelay = "0.0070";
+  reflectionsPan[ 0 ] = "0.0";
+  reflectionsPan[ 1 ] = "0.0";
+  reflectionsPan[ 2 ] = "0.0";
+  lateReverbGain = "1.4125";
+  lateReverbDelay = "0.0230";
+  lateReverbPan[ 0 ] = "0.0";
+  lateReverbPan[ 1 ] = "0.0";
+  lateReverbPan[ 2 ] = "0.0";
+  reverbEchoTime = "0.1380";
+  reverbEchoDepth = "0.0800";
+  reverbModTime = "0.2500";
+  reverbModDepth = "0.0000";
+  airAbsorbtionGainHF = "0.9943";
+  reverbHFRef = "5168.0001";
+  reverbLFRef = "139.5000";
+  roomRolloffFactor = "0.0000";
+  decayHFLimit = "1";
+};
+
+singleton SFXEnvironment(CastleHall)
+{
+  reverbDensity = "1.0000";
+  reverbDiffusion = "0.8100";
+  reverbGain = "0.3162";
+  reverbGainHF = "0.2818";
+  reverbGainLF = "0.1778";
+  reverbDecayTime = "3.1400";
+  reverbDecayHFRatio = "0.7900";
+  reverbDecayLFRatio = "0.6200";
+  reflectionsGain = "0.1778";
+  reflectionDelay = "0.0560";
+  reflectionsPan[ 0 ] = "0.0";
+  reflectionsPan[ 1 ] = "0.0";
+  reflectionsPan[ 2 ] = "0.0";
+  lateReverbGain = "1.1220";
+  lateReverbDelay = "0.0240";
+  lateReverbPan[ 0 ] = "0.0";
+  lateReverbPan[ 1 ] = "0.0";
+  lateReverbPan[ 2 ] = "0.0";
+  reverbEchoTime = "0.2500";
+  reverbEchoDepth = "0.0000";
+  reverbModTime = "0.2500";
+  reverbModDepth = "0.0000";
+  airAbsorbtionGainHF = "0.9943";
+  reverbHFRef = "5168.0001";
+  reverbLFRef = "139.5000";
+  roomRolloffFactor = "0.0000";
+  decayHFLimit = "1";
+};
+
+singleton SFXEnvironment(CastleCupboard)
+{
+  reverbDensity = "1.0000";
+  reverbDiffusion = "0.8900";
+  reverbGain = "0.3162";
+  reverbGainHF = "0.2818";
+  reverbGainLF = "0.1000";
+  reverbDecayTime = "0.6700";
+  reverbDecayHFRatio = "0.8700";
+  reverbDecayLFRatio = "0.3100";
+  reflectionsGain = "1.4125";
+  reflectionDelay = "0.0100";
+  reflectionsPan[ 0 ] = "0.0";
+  reflectionsPan[ 1 ] = "0.0";
+  reflectionsPan[ 2 ] = "0.0";
+  lateReverbGain = "3.5481";
+  lateReverbDelay = "0.0070";
+  lateReverbPan[ 0 ] = "0.0";
+  lateReverbPan[ 1 ] = "0.0";
+  lateReverbPan[ 2 ] = "0.0";
+  reverbEchoTime = "0.1380";
+  reverbEchoDepth = "0.0800";
+  reverbModTime = "0.2500";
+  reverbModDepth = "0.0000";
+  airAbsorbtionGainHF = "0.9943";
+  reverbHFRef = "5168.0001";
+  reverbLFRef = "139.5000";
+  roomRolloffFactor = "0.0000";
+  decayHFLimit = "1";
+};
+
+singleton SFXEnvironment(CastleCourtyard)
+{
+  reverbDensity = "1.0000";
+  reverbDiffusion = "0.4200";
+  reverbGain = "0.3162";
+  reverbGainHF = "0.4467";
+  reverbGainLF = "0.1995";
+  reverbDecayTime = "2.1300";
+  reverbDecayHFRatio = "0.6100";
+  reverbDecayLFRatio = "0.2300";
+  reflectionsGain = "0.2239";
+  reflectionDelay = "0.1600";
+  reflectionsPan[ 0 ] = "0.0";
+  reflectionsPan[ 1 ] = "0.0";
+  reflectionsPan[ 2 ] = "0.0";
+  lateReverbGain = "0.7079";
+  lateReverbDelay = "0.0360";
+  lateReverbPan[ 0 ] = "0.0";
+  lateReverbPan[ 1 ] = "0.0";
+  lateReverbPan[ 2 ] = "0.0";
+  reverbEchoTime = "0.2500";
+  reverbEchoDepth = "0.3700";
+  reverbModTime = "0.2500";
+  reverbModDepth = "0.0000";
+  airAbsorbtionGainHF = "0.9943";
+  reverbHFRef = "5000.0000";
+  reverbLFRef = "250.0000";
+  roomRolloffFactor = "0.0000";
+  decayHFLimit = "0";
+};
+
+singleton SFXEnvironment(CastleAlcove)
+{
+  reverbDensity = "1.0000";
+  reverbDiffusion = "0.8900";
+  reverbGain = "0.3162";
+  reverbGainHF = "0.5012";
+  reverbGainLF = "0.1000";
+  reverbDecayTime = "1.6400";
+  reverbDecayHFRatio = "0.8700";
+  reverbDecayLFRatio = "0.3100";
+  reflectionsGain = "1.0000";
+  reflectionDelay = "0.0070";
+  reflectionsPan[ 0 ] = "0.0";
+  reflectionsPan[ 1 ] = "0.0";
+  reflectionsPan[ 2 ] = "0.0";
+  lateReverbGain = "1.4125";
+  lateReverbDelay = "0.0340";
+  lateReverbPan[ 0 ] = "0.0";
+  lateReverbPan[ 1 ] = "0.0";
+  lateReverbPan[ 2 ] = "0.0";
+  reverbEchoTime = "0.1380";
+  reverbEchoDepth = "0.0800";
+  reverbModTime = "0.2500";
+  reverbModDepth = "0.0000";
+  airAbsorbtionGainHF = "0.9943";
+  reverbHFRef = "5168.0001";
+  reverbLFRef = "139.5000";
+  roomRolloffFactor = "0.0000";
+  decayHFLimit = "1";
+};
+
+singleton SFXEnvironment(FactorySmallRoom)
+{
+  reverbDensity = "0.3645";
+  reverbDiffusion = "0.8200";
+  reverbGain = "0.3162";
+  reverbGainHF = "0.7943";
+  reverbGainLF = "0.5012";
+  reverbDecayTime = "1.7200";
+  reverbDecayHFRatio = "0.6500";
+  reverbDecayLFRatio = "1.3100";
+  reflectionsGain = "0.7079";
+  reflectionDelay = "0.0100";
+  reflectionsPan[ 0 ] = "0.0";
+  reflectionsPan[ 1 ] = "0.0";
+  reflectionsPan[ 2 ] = "0.0";
+  lateReverbGain = "1.7783";
+  lateReverbDelay = "0.0240";
+  lateReverbPan[ 0 ] = "0.0";
+  lateReverbPan[ 1 ] = "0.0";
+  lateReverbPan[ 2 ] = "0.0";
+  reverbEchoTime = "0.1190";
+  reverbEchoDepth = "0.0700";
+  reverbModTime = "0.2500";
+  reverbModDepth = "0.0000";
+  airAbsorbtionGainHF = "0.9943";
+  reverbHFRef = "3762.6001";
+  reverbLFRef = "362.5000";
+  roomRolloffFactor = "0.0000";
+  decayHFLimit = "1";
+};
+
+singleton SFXEnvironment(FactoryShortPassage)
+{
+  reverbDensity = "0.3645";
+  reverbDiffusion = "0.6400";
+  reverbGain = "0.2512";
+  reverbGainHF = "0.7943";
+  reverbGainLF = "0.5012";
+  reverbDecayTime = "2.5300";
+  reverbDecayHFRatio = "0.6500";
+  reverbDecayLFRatio = "1.3100";
+  reflectionsGain = "1.0000";
+  reflectionDelay = "0.0100";
+  reflectionsPan[ 0 ] = "0.0";
+  reflectionsPan[ 1 ] = "0.0";
+  reflectionsPan[ 2 ] = "0.0";
+  lateReverbGain = "1.2589";
+  lateReverbDelay = "0.0380";
+  lateReverbPan[ 0 ] = "0.0";
+  lateReverbPan[ 1 ] = "0.0";
+  lateReverbPan[ 2 ] = "0.0";
+  reverbEchoTime = "0.1350";
+  reverbEchoDepth = "0.2300";
+  reverbModTime = "0.2500";
+  reverbModDepth = "0.0000";
+  airAbsorbtionGainHF = "0.9943";
+  reverbHFRef = "3762.6001";
+  reverbLFRef = "362.5000";
+  roomRolloffFactor = "0.0000";
+  decayHFLimit = "1";
+};
+
+singleton SFXEnvironment(FactoryMediumRoom)
+{
+  reverbDensity = "0.4287";
+  reverbDiffusion = "0.8200";
+  reverbGain = "0.2512";
+  reverbGainHF = "0.7943";
+  reverbGainLF = "0.5012";
+  reverbDecayTime = "2.7600";
+  reverbDecayHFRatio = "0.6500";
+  reverbDecayLFRatio = "1.3100";
+  reflectionsGain = "0.2818";
+  reflectionDelay = "0.0220";
+  reflectionsPan[ 0 ] = "0.0";
+  reflectionsPan[ 1 ] = "0.0";
+  reflectionsPan[ 2 ] = "0.0";
+  lateReverbGain = "1.4125";
+  lateReverbDelay = "0.0230";
+  lateReverbPan[ 0 ] = "0.0";
+  lateReverbPan[ 1 ] = "0.0";
+  lateReverbPan[ 2 ] = "0.0";
+  reverbEchoTime = "0.1740";
+  reverbEchoDepth = "0.0700";
+  reverbModTime = "0.2500";
+  reverbModDepth = "0.0000";
+  airAbsorbtionGainHF = "0.9943";
+  reverbHFRef = "3762.6001";
+  reverbLFRef = "362.5000";
+  roomRolloffFactor = "0.0000";
+  decayHFLimit = "1";
+};
+
+singleton SFXEnvironment(FactoryLargeRoom)
+{
+  reverbDensity = "0.4287";
+  reverbDiffusion = "0.7500";
+  reverbGain = "0.2512";
+  reverbGainHF = "0.7079";
+  reverbGainLF = "0.6310";
+  reverbDecayTime = "4.2400";
+  reverbDecayHFRatio = "0.5100";
+  reverbDecayLFRatio = "1.3100";
+  reflectionsGain = "0.1778";
+  reflectionDelay = "0.0390";
+  reflectionsPan[ 0 ] = "0.0";
+  reflectionsPan[ 1 ] = "0.0";
+  reflectionsPan[ 2 ] = "0.0";
+  lateReverbGain = "1.1220";
+  lateReverbDelay = "0.0230";
+  lateReverbPan[ 0 ] = "0.0";
+  lateReverbPan[ 1 ] = "0.0";
+  lateReverbPan[ 2 ] = "0.0";
+  reverbEchoTime = "0.2310";
+  reverbEchoDepth = "0.0700";
+  reverbModTime = "0.2500";
+  reverbModDepth = "0.0000";
+  airAbsorbtionGainHF = "0.9943";
+  reverbHFRef = "3762.6001";
+  reverbLFRef = "362.5000";
+  roomRolloffFactor = "0.0000";
+  decayHFLimit = "1";
+};
+
+singleton SFXEnvironment(FactoryLongPassage)
+{
+  reverbDensity = "0.3645";
+  reverbDiffusion = "0.6400";
+  reverbGain = "0.2512";
+  reverbGainHF = "0.7943";
+  reverbGainLF = "0.5012";
+  reverbDecayTime = "4.0000";
+  reverbDecayHFRatio = "0.6500";
+  reverbDecayLFRatio = "1.3100";
+  reflectionsGain = "1.0000";
+  reflectionDelay = "0.0200";
+  reflectionsPan[ 0 ] = "0.0";
+  reflectionsPan[ 1 ] = "0.0";
+  reflectionsPan[ 2 ] = "0.0";
+  lateReverbGain = "1.2589";
+  lateReverbDelay = "0.0370";
+  lateReverbPan[ 0 ] = "0.0";
+  lateReverbPan[ 1 ] = "0.0";
+  lateReverbPan[ 2 ] = "0.0";
+  reverbEchoTime = "0.1350";
+  reverbEchoDepth = "0.2300";
+  reverbModTime = "0.2500";
+  reverbModDepth = "0.0000";
+  airAbsorbtionGainHF = "0.9943";
+  reverbHFRef = "3762.6001";
+  reverbLFRef = "362.5000";
+  roomRolloffFactor = "0.0000";
+  decayHFLimit = "1";
+};
+
+singleton SFXEnvironment(FactoryHall)
+{
+  reverbDensity = "0.4287";
+  reverbDiffusion = "0.7500";
+  reverbGain = "0.3162";
+  reverbGainHF = "0.7079";
+  reverbGainLF = "0.6310";
+  reverbDecayTime = "7.4300";
+  reverbDecayHFRatio = "0.5100";
+  reverbDecayLFRatio = "1.3100";
+  reflectionsGain = "0.0631";
+  reflectionDelay = "0.0730";
+  reflectionsPan[ 0 ] = "0.0";
+  reflectionsPan[ 1 ] = "0.0";
+  reflectionsPan[ 2 ] = "0.0";
+  lateReverbGain = "0.8913";
+  lateReverbDelay = "0.0270";
+  lateReverbPan[ 0 ] = "0.0";
+  lateReverbPan[ 1 ] = "0.0";
+  lateReverbPan[ 2 ] = "0.0";
+  reverbEchoTime = "0.2500";
+  reverbEchoDepth = "0.0700";
+  reverbModTime = "0.2500";
+  reverbModDepth = "0.0000";
+  airAbsorbtionGainHF = "0.9943";
+  reverbHFRef = "3762.6001";
+  reverbLFRef = "362.5000";
+  roomRolloffFactor = "0.0000";
+  decayHFLimit = "1";
+};
+
+singleton SFXEnvironment(FactoryCupboard)
+{
+  reverbDensity = "0.3071";
+  reverbDiffusion = "0.6300";
+  reverbGain = "0.2512";
+  reverbGainHF = "0.7943";
+  reverbGainLF = "0.5012";
+  reverbDecayTime = "0.4900";
+  reverbDecayHFRatio = "0.6500";
+  reverbDecayLFRatio = "1.3100";
+  reflectionsGain = "1.2589";
+  reflectionDelay = "0.0100";
+  reflectionsPan[ 0 ] = "0.0";
+  reflectionsPan[ 1 ] = "0.0";
+  reflectionsPan[ 2 ] = "0.0";
+  lateReverbGain = "1.9953";
+  lateReverbDelay = "0.0320";
+  lateReverbPan[ 0 ] = "0.0";
+  lateReverbPan[ 1 ] = "0.0";
+  lateReverbPan[ 2 ] = "0.0";
+  reverbEchoTime = "0.1070";
+  reverbEchoDepth = "0.0700";
+  reverbModTime = "0.2500";
+  reverbModDepth = "0.0000";
+  airAbsorbtionGainHF = "0.9943";
+  reverbHFRef = "3762.6001";
+  reverbLFRef = "362.5000";
+  roomRolloffFactor = "0.0000";
+  decayHFLimit = "1";
+};
+
+singleton SFXEnvironment(FactoryCourtyard)
+{
+  reverbDensity = "0.3071";
+  reverbDiffusion = "0.5700";
+  reverbGain = "0.3162";
+  reverbGainHF = "0.3162";
+  reverbGainLF = "0.6310";
+  reverbDecayTime = "2.3200";
+  reverbDecayHFRatio = "0.2900";
+  reverbDecayLFRatio = "0.5600";
+  reflectionsGain = "0.2239";
+  reflectionDelay = "0.1400";
+  reflectionsPan[ 0 ] = "0.0";
+  reflectionsPan[ 1 ] = "0.0";
+  reflectionsPan[ 2 ] = "0.0";
+  lateReverbGain = "0.3981";
+  lateReverbDelay = "0.0390";
+  lateReverbPan[ 0 ] = "0.0";
+  lateReverbPan[ 1 ] = "0.0";
+  lateReverbPan[ 2 ] = "0.0";
+  reverbEchoTime = "0.2500";
+  reverbEchoDepth = "0.2900";
+  reverbModTime = "0.2500";
+  reverbModDepth = "0.0000";
+  airAbsorbtionGainHF = "0.9943";
+  reverbHFRef = "3762.6001";
+  reverbLFRef = "362.5000";
+  roomRolloffFactor = "0.0000";
+  decayHFLimit = "1";
+};
+
+singleton SFXEnvironment(FactoryAlcove)
+{
+  reverbDensity = "0.3645";
+  reverbDiffusion = "0.5900";
+  reverbGain = "0.2512";
+  reverbGainHF = "0.7943";
+  reverbGainLF = "0.5012";
+  reverbDecayTime = "3.1400";
+  reverbDecayHFRatio = "0.6500";
+  reverbDecayLFRatio = "1.3100";
+  reflectionsGain = "1.4125";
+  reflectionDelay = "0.0100";
+  reflectionsPan[ 0 ] = "0.0";
+  reflectionsPan[ 1 ] = "0.0";
+  reflectionsPan[ 2 ] = "0.0";
+  lateReverbGain = "1.0000";
+  lateReverbDelay = "0.0380";
+  lateReverbPan[ 0 ] = "0.0";
+  lateReverbPan[ 1 ] = "0.0";
+  lateReverbPan[ 2 ] = "0.0";
+  reverbEchoTime = "0.1140";
+  reverbEchoDepth = "0.1000";
+  reverbModTime = "0.2500";
+  reverbModDepth = "0.0000";
+  airAbsorbtionGainHF = "0.9943";
+  reverbHFRef = "3762.6001";
+  reverbLFRef = "362.5000";
+  roomRolloffFactor = "0.0000";
+  decayHFLimit = "1";
 };