mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-05-04 10:47:59 +03:00
Refactor and fix sound code
This commit is contained in:
parent
feae212cef
commit
d470cdcf01
11 changed files with 240 additions and 238 deletions
|
@ -1112,7 +1112,7 @@ void LoadSamples()
|
|||
if (numSamplesInfos)
|
||||
{
|
||||
g_Level.SoundDetails.resize(numSamplesInfos);
|
||||
ReadBytes(g_Level.SoundDetails.data(), numSamplesInfos * sizeof(SAMPLE_INFO));
|
||||
ReadBytes(g_Level.SoundDetails.data(), numSamplesInfos * sizeof(SampleInfo));
|
||||
|
||||
int numSamples = ReadInt32();
|
||||
if (numSamples <= 0)
|
||||
|
@ -1127,7 +1127,7 @@ void LoadSamples()
|
|||
uncompressedSize = ReadInt32();
|
||||
compressedSize = ReadInt32();
|
||||
ReadBytes(buffer, compressedSize);
|
||||
Sound_LoadSample(buffer, compressedSize, uncompressedSize, i);
|
||||
LoadSample(buffer, compressedSize, uncompressedSize, i);
|
||||
}
|
||||
|
||||
free(buffer);
|
||||
|
@ -1179,8 +1179,8 @@ int LoadLevelFile(int levelIndex)
|
|||
{
|
||||
logD("Loading level file...");
|
||||
|
||||
Sound_Stop();
|
||||
Sound_FreeSamples();
|
||||
StopAllSounds();
|
||||
FreeSamples();
|
||||
if (!g_FirstLevel)
|
||||
FreeLevel();
|
||||
g_FirstLevel = false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue