SCUMM: Rename function to tryLoadAudioOverride

(cherry picked from commit cad20a1c90)
This commit is contained in:
YYxsCnnPP 2022-06-26 14:41:39 -03:00 committed by Thunderforge
parent a79eea3ab5
commit 12d6915ad0
2 changed files with 7 additions and 7 deletions

View file

@ -581,7 +581,7 @@ void SoundHE::playHESound(int soundID, int heOffset, int heChannel, int heFlags,
if (_vm->_game.heversion == 70) { if (_vm->_game.heversion == 70) {
// Try to load high quality audio file if found // Try to load high quality audio file if found
stream = maybeLoadSoundOverride(soundID); stream = tryLoadAudioOverride(soundID);
if (!stream) { if (!stream) {
stream = Audio::makeRawStream(spoolPtr, size, 11025, flags, DisposeAfterUse::NO); stream = Audio::makeRawStream(spoolPtr, size, 11025, flags, DisposeAfterUse::NO);
@ -727,7 +727,7 @@ void SoundHE::playHESound(int soundID, int heOffset, int heChannel, int heFlags,
// Try to load high quality audio file if found // Try to load high quality audio file if found
int newDuration; int newDuration;
stream = maybeLoadSoundOverride(soundID, &newDuration); stream = tryLoadAudioOverride(soundID, &newDuration);
if (stream != nullptr && soundID == 1) { if (stream != nullptr && soundID == 1) {
// Disable lip sync if the speech audio was overriden // Disable lip sync if the speech audio was overriden
codeOffs = -1; codeOffs = -1;
@ -796,7 +796,7 @@ void SoundHE::playHESound(int soundID, int heOffset, int heChannel, int heFlags,
} }
} }
Audio::RewindableAudioStream *SoundHE::maybeLoadSoundOverride(int soundID, int *duration) { Audio::RewindableAudioStream *SoundHE::tryLoadAudioOverride(int soundID, int *duration) {
if (!_vm->_enableAudioOverride) { if (!_vm->_enableAudioOverride) {
return nullptr; return nullptr;
} }
@ -848,7 +848,7 @@ Audio::RewindableAudioStream *SoundHE::maybeLoadSoundOverride(int soundID, int *
Common::Path pathDir(Common::String::format("%s%d.%s", type, soundID, formats[i])); Common::Path pathDir(Common::String::format("%s%d.%s", type, soundID, formats[i]));
Common::Path pathSub(Common::String::format("%s/%d.%s", type, soundID, formats[i])); Common::Path pathSub(Common::String::format("%s/%d.%s", type, soundID, formats[i]));
debug(5, "tryLoadSoundOverride: %s or %s", pathSub.toString().c_str(), pathDir.toString().c_str()); debug(5, "tryLoadAudioOverride: %s or %s", pathSub.toString().c_str(), pathDir.toString().c_str());
// First check if the file exists before opening it to // First check if the file exists before opening it to
// reduce the amount of "opening %s failed" in the console. // reduce the amount of "opening %s failed" in the console.
@ -866,13 +866,13 @@ Audio::RewindableAudioStream *SoundHE::maybeLoadSoundOverride(int soundID, int *
*duration = seekStream->getLength().msecs(); *duration = seekStream->getLength().msecs();
} }
debug(5, "tryLoadSoundOverride: %s loaded from %s", formats[i], soundFileOverride.getName()); debug(5, "tryLoadAudioOverride: %s loaded from %s", formats[i], soundFileOverride.getName());
return seekStream; return seekStream;
} }
} }
debug(5, "tryLoadSoundOverride: file not found"); debug(5, "tryLoadAudioOverride: file not found");
return nullptr; return nullptr;
} }

View file

@ -89,7 +89,7 @@ protected:
private: private:
int _heTalkOffset; int _heTalkOffset;
Audio::RewindableAudioStream *maybeLoadSoundOverride(int soundID, int *duration = nullptr); Audio::RewindableAudioStream *tryLoadSoundOverride(int soundID, int *duration = nullptr);
}; };