Skip to content

Commit

Permalink
- fixed the real issue for the sound problems and reverted the last c…
Browse files Browse the repository at this point in the history
…ommit.

It was far more serious than a botched merge.
  • Loading branch information
coelckers committed Oct 11, 2020
1 parent 5973391 commit 47e452f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
1 change: 1 addition & 0 deletions source/common/audio/sound/s_sound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1536,6 +1536,7 @@ int SoundEngine::AddSoundLump(const char* logicalname, int lump, int CurrentPitc
newsfx.PitchMask = CurrentPitchMask;
newsfx.NearLimit = nearlimit;
newsfx.ResourceId = resid;
newsfx.bTentative = false;

if (resid >= 0) ResIdMap[resid] = S_sfx.Size() - 1;
return (int)S_sfx.Size()-1;
Expand Down
2 changes: 1 addition & 1 deletion source/common/thirdparty/m_crc32.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
**---------------------------------------------------------------------------
**
*/

#pragma once
#include <zlib.h>
#include <stdint.h>

Expand Down
17 changes: 6 additions & 11 deletions source/exhumed/src/sound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,22 +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.name = nname;
newsfx.lumpnum = lump;
newsfx.NearLimit = 6;
newsfx.bTentative = false;
soundEngine->CacheSound(retval + 1);
return retval;
int retval = soundEngine->AddSoundLump(nname, lump, 0, -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
{
Expand Down

0 comments on commit 47e452f

Please sign in to comment.