Overhaul and enable cache for openal build
This commit is contained in:
parent
c9a7fd9435
commit
b3581bc0b4
@ -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
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
|
debug("Cannot load audio cache\n");
|
||||||
for ( int32 i = 0; i < TOTAL_STREAMED_SOUNDS; i++ )
|
#endif
|
||||||
{
|
|
||||||
|
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");
|
||||||
fwrite(nStreamLength, sizeof(uint32), TOTAL_STREAMED_SOUNDS, cacheFile);
|
if(cacheFile) {
|
||||||
fclose(cacheFile);
|
debug("Saving audio cache\n");
|
||||||
#endif
|
fwrite(nStreamLength, sizeof(uint32), TOTAL_STREAMED_SOUNDS, cacheFile);
|
||||||
|
fclose(cacheFile);
|
||||||
|
} 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