mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-10 23:02:03 +00:00
- Exhumed: Fully initialize the sfxinfo struct for newly added sounds
This was using its own incomplete code instead of calling AddSoundLump for it.
This commit is contained in:
parent
46a1fe3826
commit
dd5c3eee91
1 changed files with 6 additions and 12 deletions
|
@ -191,23 +191,17 @@ int LoadSound(const char* name)
|
|||
auto lump = S_LookupSound(filename);
|
||||
if (lump > 0)
|
||||
{
|
||||
auto &S_sfx = soundEngine->GetSounds();
|
||||
S_sfx.Reserve(1);
|
||||
int retval = S_sfx.Size() - 2;
|
||||
auto check = fileSystem.GetFileData(lump);
|
||||
bool loops = false;
|
||||
if (check.Size() > 26 && check[26] == 6 && !memcmp("Creative Voice File", check.Data(), 19))
|
||||
{
|
||||
// This game uses the actual loop point information in the sound data as its only means to check if a sound is looped.
|
||||
looped[retval] = true;
|
||||
loops = true;
|
||||
}
|
||||
auto& newsfx = S_sfx.Last();
|
||||
newsfx.Clear();
|
||||
newsfx.name = nname;
|
||||
newsfx.lumpnum = lump;
|
||||
newsfx.NearLimit = 6;
|
||||
newsfx.bTentative = false;
|
||||
soundEngine->CacheSound(retval + 1);
|
||||
return retval;
|
||||
int retval = soundEngine->AddSoundLump(nname, lump, -1, 6);
|
||||
soundEngine->CacheSound(retval);
|
||||
looped[retval-1] = loops;
|
||||
return retval - 1;
|
||||
}
|
||||
else if (!ISDEMOVER) // demo tries to load sound files it doesn't have
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue