From 3a089f894c5c2f490e81761cef4b8392e78f1696 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Sun, 30 Oct 2011 19:48:46 +0000 Subject: [PATCH] Increase MAXSOUNDS to 4096, making the maximum valid sound ID be 4093. Keep in mind that MUSICANDSFXs with ambient sounds must still have lotags less than 999 because values >=1000 are used for the amount of reverb. (999 can't be used because the original code reads '< 999' and I'm not sure whether it has any special significance... probably not though) git-svn-id: https://svn.eduke32.com/eduke32@2093 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/sounds.c | 9 +++++---- polymer/eduke32/source/sounds.h | 2 +- polymer/eduke32/source/sounds_mapster32.h | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/polymer/eduke32/source/sounds.c b/polymer/eduke32/source/sounds.c index 7ea578f85..1a87d6236 100644 --- a/polymer/eduke32/source/sounds.c +++ b/polymer/eduke32/source/sounds.c @@ -312,10 +312,11 @@ void S_Cleanup(void) continue; } - // num + 65536 is a sound played globally for which there was no open slot to keep track of the voice - if (num >= 65536) + // num + (MAXSOUNDS*MAXSOUNDINSTANCES) is a sound played globally + // for which there was no open slot to keep track of the voice + if (num >= (MAXSOUNDS*MAXSOUNDINSTANCES)) { - g_soundlocks[num-65536]--; + g_soundlocks[num-(MAXSOUNDS*MAXSOUNDINSTANCES)]--; continue; } @@ -601,7 +602,7 @@ int32_t S_PlaySound(int32_t num) if (j >= MAXSOUNDINSTANCES) // still no slots available { - FX_SetVoiceCallback(voice, num + 65536); + FX_SetVoiceCallback(voice, num + (MAXSOUNDS*MAXSOUNDINSTANCES)); return voice; } diff --git a/polymer/eduke32/source/sounds.h b/polymer/eduke32/source/sounds.h index 78fd30d42..1dcc1c52e 100644 --- a/polymer/eduke32/source/sounds.h +++ b/polymer/eduke32/source/sounds.h @@ -29,7 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef _sounds_public_ #define _sounds_public_ -#define MAXSOUNDS 2560 +#define MAXSOUNDS 4096 #define MAXSOUNDINSTANCES 8 #define LOUDESTVOLUME 150 #define MUSIC_ID -65536 diff --git a/polymer/eduke32/source/sounds_mapster32.h b/polymer/eduke32/source/sounds_mapster32.h index 416bc7f61..b393dcda5 100644 --- a/polymer/eduke32/source/sounds_mapster32.h +++ b/polymer/eduke32/source/sounds_mapster32.h @@ -43,7 +43,7 @@ typedef struct { char *definedname; // new } sound_t; -#define MAXSOUNDS 2560 +#define MAXSOUNDS 4096 extern sound_t g_sounds[MAXSOUNDS]; int32_t S_SoundStartup(void);