mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-03 20:45:33 +00:00
Remove some duplicate code
This commit is contained in:
parent
45628316f8
commit
8a69f676ec
1 changed files with 3 additions and 18 deletions
|
@ -244,24 +244,6 @@ namespace MWSound
|
|||
|
||||
DecoderPtr SoundManager::loadVoice(const std::string &voicefile)
|
||||
{
|
||||
NameLoudnessMap::iterator lipiter = mVoiceLipBuffers.find(voicefile);
|
||||
if(lipiter != mVoiceLipBuffers.end())
|
||||
{
|
||||
DecoderPtr decoder = getDecoder();
|
||||
// Workaround: Bethesda at some point converted some of the files to mp3, but the references were kept as .wav.
|
||||
if(decoder->mResourceMgr->exists(voicefile))
|
||||
decoder->open(voicefile);
|
||||
else
|
||||
{
|
||||
std::string file = voicefile;
|
||||
std::string::size_type pos = file.rfind('.');
|
||||
if(pos != std::string::npos)
|
||||
file = file.substr(0, pos)+".mp3";
|
||||
decoder->open(file);
|
||||
}
|
||||
return decoder;
|
||||
}
|
||||
|
||||
DecoderPtr decoder = getDecoder();
|
||||
// Workaround: Bethesda at some point converted some of the files to mp3, but the references were kept as .wav.
|
||||
if(decoder->mResourceMgr->exists(voicefile))
|
||||
|
@ -275,6 +257,9 @@ namespace MWSound
|
|||
decoder->open(file);
|
||||
}
|
||||
|
||||
NameLoudnessMap::iterator lipiter = mVoiceLipBuffers.find(voicefile);
|
||||
if(lipiter != mVoiceLipBuffers.end()) return decoder;
|
||||
|
||||
ChannelConfig chans;
|
||||
SampleType type;
|
||||
int srate;
|
||||
|
|
Loading…
Reference in a new issue