do NOT change how sound freeslotting works
reasons
This commit is contained in:
1 parent
d6702be08b
commit
0fc3d9d4d6
3 files changed
+20
-32
No files matched your search
+2
-3
@@ -5347,14 +5347,13 @@ static void Gravity_OnChange(void)
|
||||
|
||||
static void SoundTest_OnChange(void)
|
||||
{
|
||||
INT32 sfxfreeint = (INT32)sfxfree;
|
||||
if (cv_soundtest.value < 0)
|
||||
{
|
||||
CV_SetValue(&cv_soundtest, sfxfreeint-1);
|
||||
CV_SetValue(&cv_soundtest, NUMSFX-1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (cv_soundtest.value >= sfxfreeint)
|
||||
if (cv_soundtest.value >= NUMSFX)
|
||||
{
|
||||
CV_SetValue(&cv_soundtest, 0);
|
||||
return;
|
||||
|
||||
+18
-28
@@ -1007,44 +1007,34 @@ void S_InitRuntimeSounds (void)
|
||||
}
|
||||
}
|
||||
|
||||
sfxenum_t sfxfree = sfx_freeslot0;
|
||||
|
||||
// Add a new sound fx into a free sfx slot.
|
||||
//
|
||||
sfxenum_t S_AddSoundFx(const char *name, boolean singular, INT32 flags, boolean skinsound)
|
||||
{
|
||||
sfxenum_t i;
|
||||
sfxenum_t i, slot;
|
||||
|
||||
if (skinsound)
|
||||
{
|
||||
for (i = sfx_skinsoundslot0; i < NUMSFX; i++)
|
||||
{
|
||||
if (S_sfx[i].priority)
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
}
|
||||
slot = sfx_skinsoundslot0;
|
||||
else
|
||||
i = sfxfree;
|
||||
slot = sfx_freeslot0;
|
||||
|
||||
if (i < NUMSFX)
|
||||
for (i = slot; i < NUMSFX; i++)
|
||||
{
|
||||
strncpy(freeslotnames[i-sfx_freeslot0], name, 6);
|
||||
S_sfx[i].singularity = singular;
|
||||
S_sfx[i].priority = 60;
|
||||
S_sfx[i].pitch = flags;
|
||||
S_sfx[i].volume = -1;
|
||||
S_sfx[i].lumpnum = LUMPERROR;
|
||||
S_sfx[i].skinsound = -1;
|
||||
S_sfx[i].usefulness = -1;
|
||||
if (!S_sfx[i].priority)
|
||||
{
|
||||
strncpy(freeslotnames[i-sfx_freeslot0], name, 6);
|
||||
S_sfx[i].singularity = singular;
|
||||
S_sfx[i].priority = 60;
|
||||
S_sfx[i].pitch = flags;
|
||||
S_sfx[i].volume = -1;
|
||||
S_sfx[i].lumpnum = LUMPERROR;
|
||||
S_sfx[i].skinsound = -1;
|
||||
S_sfx[i].usefulness = -1;
|
||||
|
||||
/// \todo if precached load it here
|
||||
S_sfx[i].data = NULL;
|
||||
|
||||
if (!skinsound)
|
||||
sfxfree++;
|
||||
|
||||
return i;
|
||||
/// \todo if precached load it here
|
||||
S_sfx[i].data = NULL;
|
||||
return i;
|
||||
}
|
||||
}
|
||||
I_Error("Out of Sound Freeslots while allocating \"%s\"\nLoad less addons to fix this.", name);
|
||||
return 0;
|
||||
|
||||
@@ -1057,7 +1057,6 @@ typedef enum
|
||||
|
||||
void S_InitRuntimeSounds(void);
|
||||
sfxenum_t S_AddSoundFx(const char *name, boolean singular, INT32 flags, boolean skinsound);
|
||||
extern sfxenum_t sfxfree; // sound test and slotting
|
||||
void S_RemoveSoundFx(sfxenum_t id);
|
||||
|
||||
#endif
|
||||
Reference in new issue
Block a user