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
This commit is contained in:
helixhorned 2011-10-30 19:48:46 +00:00
parent 4d40d32014
commit 3a089f894c
3 changed files with 7 additions and 6 deletions

View file

@ -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;
}

View file

@ -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

View file

@ -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);