diff options
author | Sergeanur <s.anureev@yandex.ua> | 2020-07-17 12:48:25 +0200 |
---|---|---|
committer | Sergeanur <s.anureev@yandex.ua> | 2020-07-17 12:48:25 +0200 |
commit | 949d0c8853d31ae88fdf3427bae05ec337ab4b0b (patch) | |
tree | a755d2e6f03c9794196f3b0b3f6c7499b67a94a3 /src | |
parent | Fix wheel water splash with PC_PARTICLE (diff) | |
download | re3-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')
-rw-r--r-- | src/audio/sampman_miles.cpp | 17 | ||||
-rw-r--r-- | src/audio/sampman_oal.cpp | 13 | ||||
-rw-r--r-- | src/control/Record.cpp | 2 | ||||
-rw-r--r-- | src/core/FileLoader.cpp | 2 | ||||
-rw-r--r-- | src/core/config.h | 3 |
5 files changed, 35 insertions, 2 deletions
diff --git a/src/audio/sampman_miles.cpp b/src/audio/sampman_miles.cpp index d625ac35..098b6efa 100644 --- a/src/audio/sampman_miles.cpp +++ b/src/audio/sampman_miles.cpp @@ -959,6 +959,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; @@ -1115,7 +1124,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++ ) 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); diff --git a/src/control/Record.cpp b/src/control/Record.cpp index 30bca2f3..8dc0028a 100644 --- a/src/control/Record.cpp +++ b/src/control/Record.cpp @@ -439,8 +439,10 @@ void CRecordDataForChase::StartChaseScene(float startTime) Status = STATE_PLAYBACK; AnimTime = startTime; AnimStartTime = CTimer::GetTimeInMilliseconds(); +#ifndef NO_ISLAND_LOADING RemoveUnusedCollision(); CStreaming::RemoveIslandsNotUsed(LEVEL_SUBURBAN); +#endif CGame::TidyUpMemory(true, true); CStreaming::ImGonnaUseStreamingMemory(); CFileMgr::SetDir("data\\paths"); diff --git a/src/core/FileLoader.cpp b/src/core/FileLoader.cpp index 3c4ed040..63be2e7b 100644 --- a/src/core/FileLoader.cpp +++ b/src/core/FileLoader.cpp @@ -104,7 +104,9 @@ CFileLoader::LoadLevel(const char *filename) LoadingScreenLoadingFile(line + 8); LoadMapZones(line + 8); }else if(strncmp(line, "SPLASH", 6) == 0){ +#ifndef DISABLE_LOADING_SCREEN LoadSplash(GetRandomSplashScreen()); +#endif }else if(strncmp(line, "CDIMAGE", 7) == 0){ CdStreamAddImage(line + 8); } diff --git a/src/core/config.h b/src/core/config.h index 2ba7a021..9dd25064 100644 --- a/src/core/config.h +++ b/src/core/config.h @@ -275,3 +275,6 @@ enum Config { //#define PS2_CAM_TRANSITION // old way of transitioning between cam modes #define IMPROVED_CAMERA // Better Debug cam, and maybe more in the future #define FREE_CAM // Rotating cam + +// Audio +#define AUDIO_CACHE // cache sound lengths to speed up the cold boot |