mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-04-28 15:57:59 +03:00
Fixed #1574
This commit is contained in:
parent
a64825b6f1
commit
562637f599
2 changed files with 10 additions and 9 deletions
|
@ -19,6 +19,7 @@ TombEngine releases are located in this repository (alongside with Tomb Editor):
|
|||
* Fixed flickering rat emitter.
|
||||
* Fixed player model submerging into the floor while swimming underwater.
|
||||
* Fixed custom shatter sounds with custom sound IDs not playing correctly.
|
||||
* Fixed crashes with sound samples larger than 2 megabytes.
|
||||
|
||||
### New Features
|
||||
* Added multithreading and an option for it to flow system settings.
|
||||
|
|
|
@ -1459,19 +1459,19 @@ void LoadSamples()
|
|||
|
||||
TENLog("Sample count: " + std::to_string(sampleCount), LogLevel::Info);
|
||||
|
||||
int uncompressedSize = 0;
|
||||
int compressedSize = 0;
|
||||
char* buffer = (char*)malloc(2 * 1024 * 1024);
|
||||
std::vector<char> buffer;
|
||||
buffer.reserve(2 * 1024 * 1024);
|
||||
|
||||
for (int i = 0; i < sampleCount; i++)
|
||||
{
|
||||
uncompressedSize = ReadInt32();
|
||||
compressedSize = ReadInt32();
|
||||
ReadBytes(buffer, compressedSize);
|
||||
LoadSample(buffer, compressedSize, uncompressedSize, i);
|
||||
}
|
||||
int uncompressedSize = ReadInt32();
|
||||
int compressedSize = ReadInt32();
|
||||
|
||||
free(buffer);
|
||||
buffer.resize(compressedSize);
|
||||
|
||||
ReadBytes(buffer.data(), compressedSize);
|
||||
LoadSample(buffer.data(), compressedSize, uncompressedSize, i);
|
||||
}
|
||||
}
|
||||
|
||||
void LoadBoxes()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue