summaryrefslogtreecommitdiffstats
path: root/src/audio/sampman_oal.cpp
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2021-01-16 16:17:42 +0100
committerNikolay Korolev <nickvnuk@gmail.com>2021-01-16 16:17:42 +0100
commitef97134f50639d3e5494a3de243c1d7069e40952 (patch)
tree80211acc1eadaa62e3ae51e51cde5d9e2b049f13 /src/audio/sampman_oal.cpp
parentscript6 (diff)
parentMerge branch 'miami' into lcs (diff)
downloadre3-ef97134f50639d3e5494a3de243c1d7069e40952.tar
re3-ef97134f50639d3e5494a3de243c1d7069e40952.tar.gz
re3-ef97134f50639d3e5494a3de243c1d7069e40952.tar.bz2
re3-ef97134f50639d3e5494a3de243c1d7069e40952.tar.lz
re3-ef97134f50639d3e5494a3de243c1d7069e40952.tar.xz
re3-ef97134f50639d3e5494a3de243c1d7069e40952.tar.zst
re3-ef97134f50639d3e5494a3de243c1d7069e40952.zip
Diffstat (limited to '')
-rw-r--r--src/audio/sampman_oal.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/audio/sampman_oal.cpp b/src/audio/sampman_oal.cpp
index ef070825..ec85fc43 100644
--- a/src/audio/sampman_oal.cpp
+++ b/src/audio/sampman_oal.cpp
@@ -38,7 +38,7 @@
//TODO: max channels
//TODO: loop count
-#ifdef _WIN32
+#if defined _MSC_VER && !defined CMAKE_NO_AUTOLINK
#pragma comment( lib, "OpenAL32.lib" )
#endif
@@ -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() )