diff options
author | Sergeanur <s.anureev@yandex.ua> | 2020-07-17 12:53:11 +0200 |
---|---|---|
committer | Sergeanur <s.anureev@yandex.ua> | 2020-07-17 12:53:11 +0200 |
commit | de8759eabde158d345dea3aed80a1a50ab319fcb (patch) | |
tree | e448200e4ac1045c8951296c8f90ce9974c72cd5 /src/audio/sampman_miles.cpp | |
parent | Merge branch 'master' into miami (diff) | |
parent | Add audio cache for faster initialization (diff) | |
download | re3-de8759eabde158d345dea3aed80a1a50ab319fcb.tar re3-de8759eabde158d345dea3aed80a1a50ab319fcb.tar.gz re3-de8759eabde158d345dea3aed80a1a50ab319fcb.tar.bz2 re3-de8759eabde158d345dea3aed80a1a50ab319fcb.tar.lz re3-de8759eabde158d345dea3aed80a1a50ab319fcb.tar.xz re3-de8759eabde158d345dea3aed80a1a50ab319fcb.tar.zst re3-de8759eabde158d345dea3aed80a1a50ab319fcb.zip |
Diffstat (limited to 'src/audio/sampman_miles.cpp')
-rw-r--r-- | src/audio/sampman_miles.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/audio/sampman_miles.cpp b/src/audio/sampman_miles.cpp index 5893ea64..d6bb1975 100644 --- a/src/audio/sampman_miles.cpp +++ b/src/audio/sampman_miles.cpp @@ -1012,6 +1012,15 @@ cSampleManager::Initialise(void) } +#ifdef AUDIO_CACHE + TRACE("cache"); + FILE *cacheFile = fopen("audio\\sound.cache", "rb"); + if (cacheFile) { + fread(nStreamLength, sizeof(uint32), TOTAL_STREAMED_SOUNDS, cacheFile); + fclose(cacheFile); + m_bInitialised = true; + }else { +#endif TRACE("cdrom"); S32 tatalms; @@ -1168,7 +1177,13 @@ cSampleManager::Initialise(void) _bUseHDDAudio = false; } #endif - +#ifdef AUDIO_CACHE + cacheFile = fopen("audio\\sound.cache", "wb"); + fwrite(nStreamLength, sizeof(uint32), TOTAL_STREAMED_SOUNDS, cacheFile); + fclose(cacheFile); + } +#endif + TRACE("stream"); { for ( int32 i = 0; i < MAX_STREAMS; i++ ) |