mirror of
https://github.com/GTAmodding/re3.git
synced 2025-07-17 17:24:08 +00:00
Add audio cache for faster initialization
This commit is contained in:
parent
693a5e0c2a
commit
949d0c8853
5 changed files with 35 additions and 2 deletions
|
@ -604,7 +604,13 @@ cSampleManager::Initialise(void)
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef AUDIO_CACHE
|
||||
FILE *cacheFile = fopen("audio\\sound.cache", "rb");
|
||||
if (cacheFile) {
|
||||
fread(nStreamLength, sizeof(uint32), TOTAL_STREAMED_SOUNDS, cacheFile);
|
||||
fclose(cacheFile);
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
|
||||
for ( int32 i = 0; i < TOTAL_STREAMED_SOUNDS; i++ )
|
||||
|
@ -622,6 +628,11 @@ cSampleManager::Initialise(void)
|
|||
else
|
||||
USERERROR("Can't open '%s'\n", StreamedNameTable[i]);
|
||||
}
|
||||
#ifdef AUDIO_CACHE
|
||||
cacheFile = fopen("audio\\sound.cache", "wb");
|
||||
fwrite(nStreamLength, sizeof(uint32), TOTAL_STREAMED_SOUNDS, cacheFile);
|
||||
fclose(cacheFile);
|
||||
#endif
|
||||
}
|
||||
|
||||
LoadSampleBank(SAMPLEBANK_MAIN);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue