aboutsummaryrefslogtreecommitdiff
path: root/engines/wintermute/base/sound/base_sound_manager.cpp
diff options
context:
space:
mode:
authorEinar Johan Trøan Sømåen2012-07-29 00:27:50 +0200
committerEinar Johan Trøan Sømåen2012-07-29 00:27:50 +0200
commit6dc1e09da93c0ba0507fd0ceadbbb504469deccc (patch)
treedae477f4ed7c6b9be7a5dd38174d81cdbae48c58 /engines/wintermute/base/sound/base_sound_manager.cpp
parente841bf16d6b955f779e5e30535848bd650d22352 (diff)
downloadscummvm-rg350-6dc1e09da93c0ba0507fd0ceadbbb504469deccc.tar.gz
scummvm-rg350-6dc1e09da93c0ba0507fd0ceadbbb504469deccc.tar.bz2
scummvm-rg350-6dc1e09da93c0ba0507fd0ceadbbb504469deccc.zip
WINTERMUTE: Replace const char* with const Common::String & in fonts, gfx, particles, sound and files.
Diffstat (limited to 'engines/wintermute/base/sound/base_sound_manager.cpp')
-rw-r--r--engines/wintermute/base/sound/base_sound_manager.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/engines/wintermute/base/sound/base_sound_manager.cpp b/engines/wintermute/base/sound/base_sound_manager.cpp
index 4659c35ff7..8df9f299ef 100644
--- a/engines/wintermute/base/sound/base_sound_manager.cpp
+++ b/engines/wintermute/base/sound/base_sound_manager.cpp
@@ -89,13 +89,14 @@ bool BaseSoundMgr::initialize() {
}
//////////////////////////////////////////////////////////////////////////
-BaseSoundBuffer *BaseSoundMgr::addSound(const char *filename, Audio::Mixer::SoundType type, bool streamed) {
+BaseSoundBuffer *BaseSoundMgr::addSound(const Common::String &filename, Audio::Mixer::SoundType type, bool streamed) {
if (!_soundAvailable) {
return NULL;
}
BaseSoundBuffer *sound;
+ Common::String useFilename = filename;
// try to switch WAV to OGG file (if available)
AnsiString ext = PathUtil::getExtension(filename);
if (StringUtil::compareNoCase(ext, "wav")) {
@@ -104,7 +105,7 @@ BaseSoundBuffer *BaseSoundMgr::addSound(const char *filename, Audio::Mixer::Soun
AnsiString newFile = PathUtil::combine(path, name + "ogg");
if (_gameRef->_fileManager->hasFile(newFile)) {
- filename = newFile.c_str();
+ useFilename = newFile;
}
}
@@ -117,9 +118,9 @@ BaseSoundBuffer *BaseSoundMgr::addSound(const char *filename, Audio::Mixer::Soun
sound->setType(type);
- bool res = sound->loadFromFile(filename);
+ bool res = sound->loadFromFile(useFilename);
if (DID_FAIL(res)) {
- _gameRef->LOG(res, "Error loading sound '%s'", filename);
+ _gameRef->LOG(res, "Error loading sound '%s'", useFilename.c_str());
delete sound;
return NULL;
}