mirror of
https://gitlab.com/GaryOderNichts/re3-wiiu.git
synced 2024-12-23 16:21:50 +01:00
Merge pull request #913 from ShFil119/oal_cache
Overhaul and enable cache for openal build
This commit is contained in:
commit
e6914355dd
@ -956,33 +956,37 @@ cSampleManager::Initialise(void)
|
|||||||
#ifdef AUDIO_CACHE
|
#ifdef AUDIO_CACHE
|
||||||
FILE *cacheFile = fcaseopen("audio\\sound.cache", "rb");
|
FILE *cacheFile = fcaseopen("audio\\sound.cache", "rb");
|
||||||
if (cacheFile) {
|
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);
|
fread(nStreamLength, sizeof(uint32), TOTAL_STREAMED_SOUNDS, cacheFile);
|
||||||
fclose(cacheFile);
|
fclose(cacheFile);
|
||||||
} else
|
} else
|
||||||
|
{
|
||||||
|
debug("Cannot load audio cache\n");
|
||||||
#endif
|
#endif
|
||||||
{
|
|
||||||
|
|
||||||
for ( int32 i = 0; i < TOTAL_STREAMED_SOUNDS; i++ )
|
for(int32 i = 0; i < TOTAL_STREAMED_SOUNDS; i++) {
|
||||||
{
|
|
||||||
aStream[0] = new CStream(StreamedNameTable[i], ALStreamSources[0], ALStreamBuffers[0]);
|
aStream[0] = new CStream(StreamedNameTable[i], ALStreamSources[0], ALStreamBuffers[0]);
|
||||||
|
|
||||||
if ( aStream[0] && aStream[0]->IsOpened() )
|
if(aStream[0] && aStream[0]->IsOpened()) {
|
||||||
{
|
|
||||||
uint32 tatalms = aStream[0]->GetLengthMS();
|
uint32 tatalms = aStream[0]->GetLengthMS();
|
||||||
delete aStream[0];
|
delete aStream[0];
|
||||||
aStream[0] = NULL;
|
aStream[0] = NULL;
|
||||||
|
|
||||||
nStreamLength[i] = tatalms;
|
nStreamLength[i] = tatalms;
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
USERERROR("Can't open '%s'\n", StreamedNameTable[i]);
|
USERERROR("Can't open '%s'\n", StreamedNameTable[i]);
|
||||||
}
|
}
|
||||||
#ifdef AUDIO_CACHE
|
#ifdef AUDIO_CACHE
|
||||||
cacheFile = fcaseopen("audio\\sound.cache", "wb");
|
cacheFile = fcaseopen("audio\\sound.cache", "wb");
|
||||||
|
if(cacheFile) {
|
||||||
|
debug("Saving audio cache\n");
|
||||||
fwrite(nStreamLength, sizeof(uint32), TOTAL_STREAMED_SOUNDS, cacheFile);
|
fwrite(nStreamLength, sizeof(uint32), TOTAL_STREAMED_SOUNDS, cacheFile);
|
||||||
fclose(cacheFile);
|
fclose(cacheFile);
|
||||||
#endif
|
} else {
|
||||||
|
debug("Cannot save audio cache\n");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
{
|
{
|
||||||
if ( !InitialiseSampleBanks() )
|
if ( !InitialiseSampleBanks() )
|
||||||
|
@ -349,9 +349,7 @@ enum Config {
|
|||||||
|
|
||||||
// Audio
|
// Audio
|
||||||
#define RADIO_SCROLL_TO_PREV_STATION
|
#define RADIO_SCROLL_TO_PREV_STATION
|
||||||
#ifndef AUDIO_OAL // is not working yet for openal
|
#define AUDIO_CACHE
|
||||||
#define AUDIO_CACHE // cache sound lengths to speed up the cold boot
|
|
||||||
#endif
|
|
||||||
//#define PS2_AUDIO // changes audio paths for cutscenes and radio to PS2 paths, needs vbdec to support VB with MSS
|
//#define PS2_AUDIO // changes audio paths for cutscenes and radio to PS2 paths, needs vbdec to support VB with MSS
|
||||||
|
|
||||||
// IMG
|
// IMG
|
||||||
|
Loading…
Reference in New Issue
Block a user