Skip to content

Commit

Permalink
Fixed silent sounds on first play, stereo and precached only
Browse files Browse the repository at this point in the history
  • Loading branch information
alexey-lysiuk committed Apr 29, 2017
1 parent 79654fa commit be496a8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/s_sound.cpp
Expand Up @@ -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
{
Expand All @@ -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)
Expand All @@ -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;
}

//==========================================================================
Expand Down

0 comments on commit be496a8

Please sign in to comment.