mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 17:01:51 +00:00
- Blood: add a dummy sound entry at index 0.
Parts of the sound system treat entry 0 as "no sound" so nothing placed there would play. This made the one custom sound in "The Way of Ira" not play because as the last sound being defined it ended up in the first, invalid slot.
This commit is contained in:
parent
d25838fe15
commit
f87e40131f
4 changed files with 54 additions and 48 deletions
|
@ -208,10 +208,10 @@ void S_SerializeSounds(FSerializer& arc)
|
||||||
{
|
{
|
||||||
FSoundChan* chan;
|
FSoundChan* chan;
|
||||||
|
|
||||||
GSnd->Sync(true);
|
GSnd->Sync(true);
|
||||||
|
|
||||||
if (arc.isWriting())
|
if (arc.isWriting())
|
||||||
{
|
{
|
||||||
// Count channels and accumulate them so we can store them in
|
// Count channels and accumulate them so we can store them in
|
||||||
// reverse order. That way, they will be in the same order when
|
// reverse order. That way, they will be in the same order when
|
||||||
// reloaded later as they are now.
|
// reloaded later as they are now.
|
||||||
|
@ -229,9 +229,9 @@ void S_SerializeSounds(FSerializer& arc)
|
||||||
}
|
}
|
||||||
arc.EndArray();
|
arc.EndArray();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
unsigned int count;
|
unsigned int count;
|
||||||
|
|
||||||
soundEngine->StopAllChannels();
|
soundEngine->StopAllChannels();
|
||||||
|
@ -249,9 +249,9 @@ void S_SerializeSounds(FSerializer& arc)
|
||||||
}
|
}
|
||||||
// Add a small delay so that eviction only runs once the game is up and runnnig.
|
// Add a small delay so that eviction only runs once the game is up and runnnig.
|
||||||
soundEngine->SetRestartTime(I_GetTime() + 2);
|
soundEngine->SetRestartTime(I_GetTime() + 2);
|
||||||
}
|
}
|
||||||
GSnd->Sync(false);
|
GSnd->Sync(false);
|
||||||
GSnd->UpdateSounds();
|
GSnd->UpdateSounds();
|
||||||
}
|
}
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
@ -297,3 +297,18 @@ CCMD(playsoundid)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//==========================================================================
|
||||||
|
//
|
||||||
|
// CCMD listsounds
|
||||||
|
//
|
||||||
|
//==========================================================================
|
||||||
|
|
||||||
|
CCMD(listsounds)
|
||||||
|
{
|
||||||
|
auto& S_sfx = soundEngine->GetSounds();
|
||||||
|
for (unsigned i = 0; i < S_sfx.Size(); i++)
|
||||||
|
{
|
||||||
|
Printf("%4d: name = %s, resId = %d, lumpnum = %d\n", i, S_sfx[i].name.GetChars(), S_sfx[i].ResourceId, S_sfx[i].lumpnum);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -58,15 +58,6 @@ public:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
void sfxInit(void)
|
|
||||||
{
|
|
||||||
soundEngine = new BloodSoundEngine;
|
|
||||||
}
|
|
||||||
|
|
||||||
void sfxTerm()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
|
|
|
@ -106,7 +106,8 @@ static void S_AddBloodSFX(int lumpnum)
|
||||||
|
|
||||||
void sndInit(void)
|
void sndInit(void)
|
||||||
{
|
{
|
||||||
sfxInit();
|
soundEngine = new BloodSoundEngine;
|
||||||
|
soundEngine->AddSoundLump("", 0, 0, -1, 6); // add a dummy entry at index #0
|
||||||
for (int i = fileSystem.GetNumEntries() - 1; i >= 0; i--)
|
for (int i = fileSystem.GetNumEntries() - 1; i >= 0; i--)
|
||||||
{
|
{
|
||||||
auto type = fileSystem.GetResourceType(i);
|
auto type = fileSystem.GetResourceType(i);
|
||||||
|
@ -117,6 +118,7 @@ void sndInit(void)
|
||||||
}
|
}
|
||||||
else if (!stricmp(type, "WAV") || !stricmp(type, "OGG") || !stricmp(type, "FLAC") || !stricmp(type, "VOC"))
|
else if (!stricmp(type, "WAV") || !stricmp(type, "OGG") || !stricmp(type, "FLAC") || !stricmp(type, "VOC"))
|
||||||
{
|
{
|
||||||
|
if (fileSystem.GetFileNamespace(i) != ns_music)
|
||||||
soundEngine->AddSoundLump(fileSystem.GetFileFullName(i), i, 0, fileSystem.GetResourceId(i)| 0x40000000, 6); // mark the resource ID as special.
|
soundEngine->AddSoundLump(fileSystem.GetFileFullName(i), i, 0, fileSystem.GetResourceId(i)| 0x40000000, 6); // mark the resource ID as special.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,8 +50,6 @@ void sndProcess(void);
|
||||||
void sndTerm(void);
|
void sndTerm(void);
|
||||||
void sndInit(void);
|
void sndInit(void);
|
||||||
|
|
||||||
void sfxInit(void);
|
|
||||||
void sfxTerm(void);
|
|
||||||
void sfxPlay3DSound(int x, int y, int z, int soundId, int nSector);
|
void sfxPlay3DSound(int x, int y, int z, int soundId, int nSector);
|
||||||
void sfxPlay3DSound(spritetype *pSprite, int soundId, int a3 = -1, int a4 = 0);
|
void sfxPlay3DSound(spritetype *pSprite, int soundId, int a3 = -1, int a4 = 0);
|
||||||
void sfxPlay3DSoundCP(spritetype* pSprite, int soundId, int a3 = -1, int a4 = 0, int pitch = 0, int volume = 0);
|
void sfxPlay3DSoundCP(spritetype* pSprite, int soundId, int a3 = -1, int a4 = 0, int pitch = 0, int volume = 0);
|
||||||
|
|
Loading…
Reference in a new issue