From ccaf57ec02f26a3e03048a83941924a34f1b92e1 Mon Sep 17 00:00:00 2001 From: Nico de Poel Date: Fri, 16 Apr 2021 11:41:30 +0200 Subject: [PATCH] Added some legal text and fixed FMOD callbacks for 32-bit compiles --- engine/Quake/bgmusic.c | 5 +++-- engine/Quake/snd_fmod.c | 28 +++++++++++++++++++++++++--- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/engine/Quake/bgmusic.c b/engine/Quake/bgmusic.c index 412f749..def4313 100644 --- a/engine/Quake/bgmusic.c +++ b/engine/Quake/bgmusic.c @@ -1,9 +1,10 @@ /* - * Background music handling for Quakespasm (adapted from uHexen2) - * Handles streaming music as raw sound samples and runs the midi driver + * Background music handling for Quakespasm (reimplemented with FMOD) + * Handles streaming music directly from the file system * * Copyright (C) 1999-2005 Id Software, Inc. * Copyright (C) 2010-2018 O.Sezer + * Copyright (C) 2021 Nico de Poel * * 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 diff --git a/engine/Quake/snd_fmod.c b/engine/Quake/snd_fmod.c index bde15f2..5fb9ca1 100644 --- a/engine/Quake/snd_fmod.c +++ b/engine/Quake/snd_fmod.c @@ -1,3 +1,25 @@ +/* +Copyright (C) 1996-2001 Id Software, Inc. +Copyright (C) 2010-2011 O. Sezer +Copyright (C) 2021 Nico de Poel + +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;