|
|
|
@ -1,3 +1,25 @@ |
|
|
|
/* |
|
|
|
Copyright (C) 1996-2001 Id Software, Inc. |
|
|
|
Copyright (C) 2010-2011 O. Sezer <sezero@users.sourceforge.net> |
|
|
|
Copyright (C) 2021 Nico de Poel <ndepoel@gmail.com> |
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or |
|
|
|
modify it under the terms of the GNU General Public License |
|
|
|
as published by the Free Software Foundation; either version 2 |
|
|
|
of the License, or (at your option) any later version. |
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful, |
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
|
|
|
|
|
|
See the GNU General Public License for more details. |
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License |
|
|
|
along with this program; if not, write to the Free Software |
|
|
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
#include "quakedef.h" |
|
|
|
|
|
|
|
#ifdef USE_FMOD |
|
|
|
@ -20,7 +42,7 @@ static FMOD_CHANNELGROUP *sfx_channelGroup = NULL; |
|
|
|
vec3_t listener_origin; |
|
|
|
|
|
|
|
static const char *FMOD_SpeakerModeString(FMOD_SPEAKERMODE speakermode); |
|
|
|
static float SND_FMOD_Attenuation(FMOD_CHANNELCONTROL *channelControl, float distance); |
|
|
|
static float F_CALL SND_FMOD_Attenuation(FMOD_CHANNELCONTROL *channelControl, float distance); |
|
|
|
static void SND_StartAmbientSounds(); |
|
|
|
|
|
|
|
// Copy and convert coordinate system |
|
|
|
@ -186,7 +208,7 @@ Custom rolloff callback that mimics Quake's attenuation algorithm, |
|
|
|
whereby sounds can have varying degrees of distance rolloff. |
|
|
|
==================== |
|
|
|
*/ |
|
|
|
static float SND_FMOD_Attenuation(FMOD_CHANNELCONTROL *channelcontrol, float distance) |
|
|
|
static float F_CALL SND_FMOD_Attenuation(FMOD_CHANNELCONTROL *channelcontrol, float distance) |
|
|
|
{ |
|
|
|
FMOD_RESULT result; |
|
|
|
soundslot_t *userdata; |
|
|
|
@ -214,7 +236,7 @@ Channel control callback that ensures a channel's associated userdata |
|
|
|
is properly cleared when the channel stops playing. |
|
|
|
================= |
|
|
|
*/ |
|
|
|
static FMOD_RESULT SND_FMOD_Callback(FMOD_CHANNELCONTROL *channelcontrol, FMOD_CHANNELCONTROL_TYPE controltype, FMOD_CHANNELCONTROL_CALLBACK_TYPE callbacktype, void *commanddata1, void *commanddata2) |
|
|
|
static FMOD_RESULT F_CALL SND_FMOD_Callback(FMOD_CHANNELCONTROL *channelcontrol, FMOD_CHANNELCONTROL_TYPE controltype, FMOD_CHANNELCONTROL_CALLBACK_TYPE callbacktype, void *commanddata1, void *commanddata2) |
|
|
|
{ |
|
|
|
FMOD_RESULT result; |
|
|
|
soundslot_t *userdata; |
|
|
|
|