Permalink
Browse files

Fixed silent sounds on first play, stereo and precached only

  • Loading branch information...
alexey-lysiuk committed Apr 29, 2017
1 parent 79654fa commit be496a89d9dfb8f1ad6b214c9e13262c11d59ac1
Showing with 5 additions and 4 deletions.
  1. +5 −4 src/s_sound.cpp
@@ -1488,9 +1488,11 @@ static void S_LoadSound3D(sfxinfo_t *sfx, FSoundLoadBuffer *pBuffer)
DPrintf(DMSG_NOTIFY, "Loading monoized sound \"%s\" (%td)\n", sfx->name.GetChars(), sfx - &S_sfx[0]);
std::pair<SoundHandle, bool> snd;
if (pBuffer->mBuffer.Size() > 0)
{
GSnd->LoadSoundBuffered(pBuffer, true);
snd = GSnd->LoadSoundBuffered(pBuffer, true);
}
else
{
@@ -1501,7 +1503,6 @@ static void S_LoadSound3D(sfxinfo_t *sfx, FSoundLoadBuffer *pBuffer)
uint8_t *sfxdata = new uint8_t[size];
wlump.Read(sfxdata, size);
int32_t dmxlen = LittleLong(((int32_t *)sfxdata)[1]);
std::pair<SoundHandle, bool> snd;
// If the sound is voc, use the custom loader.
if (strncmp((const char *)sfxdata, "Creative Voice File", 19) == 0)
@@ -1526,9 +1527,9 @@ static void S_LoadSound3D(sfxinfo_t *sfx, FSoundLoadBuffer *pBuffer)
snd = GSnd->LoadSound(sfxdata, size, true, pBuffer);
}
delete[] sfxdata;
sfx->data3d = snd.first;
}
sfx->data3d = snd.first;
}
//==========================================================================

0 comments on commit be496a8

Please sign in to comment.