summaryrefslogtreecommitdiffstats
path: root/src/audio/sampman_oal.cpp
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2020-07-17 12:48:25 +0200
committerSergeanur <s.anureev@yandex.ua>2020-07-17 12:48:25 +0200
commit949d0c8853d31ae88fdf3427bae05ec337ab4b0b (patch)
treea755d2e6f03c9794196f3b0b3f6c7499b67a94a3 /src/audio/sampman_oal.cpp
parentFix wheel water splash with PC_PARTICLE (diff)
downloadre3-949d0c8853d31ae88fdf3427bae05ec337ab4b0b.tar
re3-949d0c8853d31ae88fdf3427bae05ec337ab4b0b.tar.gz
re3-949d0c8853d31ae88fdf3427bae05ec337ab4b0b.tar.bz2
re3-949d0c8853d31ae88fdf3427bae05ec337ab4b0b.tar.lz
re3-949d0c8853d31ae88fdf3427bae05ec337ab4b0b.tar.xz
re3-949d0c8853d31ae88fdf3427bae05ec337ab4b0b.tar.zst
re3-949d0c8853d31ae88fdf3427bae05ec337ab4b0b.zip
Diffstat (limited to 'src/audio/sampman_oal.cpp')
-rw-r--r--src/audio/sampman_oal.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/audio/sampman_oal.cpp b/src/audio/sampman_oal.cpp
index 1952f370..49ce5230 100644
--- a/src/audio/sampman_oal.cpp
+++ b/src/audio/sampman_oal.cpp
@@ -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);