summaryrefslogtreecommitdiffstats
path: root/src/audio/sampman_oal.cpp
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2021-01-18 14:01:17 +0100
committerSergeanur <s.anureev@yandex.ua>2021-01-18 14:01:17 +0100
commit8d2aa61f9b93a83c7a89a1ed180f3953f4638a8b (patch)
tree7b351a0f43b5f1b3135feadfcdeb52d0b64648bc /src/audio/sampman_oal.cpp
parentUse of sized bool types for CFont (diff)
parentsync milessdk with re3mss (diff)
downloadre3-8d2aa61f9b93a83c7a89a1ed180f3953f4638a8b.tar
re3-8d2aa61f9b93a83c7a89a1ed180f3953f4638a8b.tar.gz
re3-8d2aa61f9b93a83c7a89a1ed180f3953f4638a8b.tar.bz2
re3-8d2aa61f9b93a83c7a89a1ed180f3953f4638a8b.tar.lz
re3-8d2aa61f9b93a83c7a89a1ed180f3953f4638a8b.tar.xz
re3-8d2aa61f9b93a83c7a89a1ed180f3953f4638a8b.tar.zst
re3-8d2aa61f9b93a83c7a89a1ed180f3953f4638a8b.zip
Diffstat (limited to 'src/audio/sampman_oal.cpp')
-rw-r--r--src/audio/sampman_oal.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/audio/sampman_oal.cpp b/src/audio/sampman_oal.cpp
index f53b1362..ec85fc43 100644
--- a/src/audio/sampman_oal.cpp
+++ b/src/audio/sampman_oal.cpp
@@ -996,12 +996,14 @@ cSampleManager::Initialise(void)
#ifdef AUDIO_CACHE
FILE *cacheFile = fcaseopen("audio\\sound.cache", "rb");
if (cacheFile) {
+ debug("Loadind audio cache (If game crashes around here, then your cache is corrupted, remove audio/sound.cache)\n");
fread(nStreamLength, sizeof(uint32), TOTAL_STREAMED_SOUNDS, cacheFile);
fclose(cacheFile);
} else
-#endif
{
-
+ debug("Cannot load audio cache\n");
+#endif
+
for ( int32 i = 0; i < TOTAL_STREAMED_SOUNDS; i++ )
{
aStream[0] = new CStream(StreamedNameTable[i], ALStreamSources[0], ALStreamBuffers[0], IsThisTrackAt16KHz(i) ? 16000 : 32000);
@@ -1019,10 +1021,15 @@ cSampleManager::Initialise(void)
}
#ifdef AUDIO_CACHE
cacheFile = fcaseopen("audio\\sound.cache", "wb");
- fwrite(nStreamLength, sizeof(uint32), TOTAL_STREAMED_SOUNDS, cacheFile);
- fclose(cacheFile);
-#endif
+ if(cacheFile) {
+ debug("Saving audio cache\n");
+ fwrite(nStreamLength, sizeof(uint32), TOTAL_STREAMED_SOUNDS, cacheFile);
+ fclose(cacheFile);
+ } else {
+ debug("Cannot save audio cache\n");
+ }
}
+#endif
{
if ( !InitialiseSampleBanks() )