aboutsummaryrefslogtreecommitdiff
path: root/engines/wintermute/base/sound
diff options
context:
space:
mode:
authorEinar Johan Trøan Sømåen2012-07-29 02:30:26 +0200
committerEinar Johan Trøan Sømåen2012-07-29 02:34:44 +0200
commit9b5cf8f1bafd5aa0dba9194a8f04e58724652891 (patch)
tree6a205943845259a213532476d4dc9ee49a898cf7 /engines/wintermute/base/sound
parentb214041539559e65b89b3270439970fd7173dcbe (diff)
downloadscummvm-rg350-9b5cf8f1bafd5aa0dba9194a8f04e58724652891.tar.gz
scummvm-rg350-9b5cf8f1bafd5aa0dba9194a8f04e58724652891.tar.bz2
scummvm-rg350-9b5cf8f1bafd5aa0dba9194a8f04e58724652891.zip
WINTERMUTE: Introduce a Singleton-class for holding registry/filemanager.
Diffstat (limited to 'engines/wintermute/base/sound')
-rw-r--r--engines/wintermute/base/sound/base_sound_buffer.cpp2
-rw-r--r--engines/wintermute/base/sound/base_sound_manager.cpp7
2 files changed, 5 insertions, 4 deletions
diff --git a/engines/wintermute/base/sound/base_sound_buffer.cpp b/engines/wintermute/base/sound/base_sound_buffer.cpp
index 5f36eb96d4..ac329704bc 100644
--- a/engines/wintermute/base/sound/base_sound_buffer.cpp
+++ b/engines/wintermute/base/sound/base_sound_buffer.cpp
@@ -96,7 +96,7 @@ bool BaseSoundBuffer::loadFromFile(const Common::String &filename, bool forceRel
debugC(kWinterMuteDebugAudio, "BSoundBuffer::LoadFromFile(%s,%d)", filename.c_str(), forceReload);
// Load a file, but avoid having the File-manager handle the disposal of it.
- _file = _gameRef->_fileManager->openFile(filename, true, false);
+ _file = BaseFileManager::getEngineInstance()->openFile(filename, true, false);
if (!_file) {
_gameRef->LOG(0, "Error opening sound file '%s'", filename.c_str());
return STATUS_FAILED;
diff --git a/engines/wintermute/base/sound/base_sound_manager.cpp b/engines/wintermute/base/sound/base_sound_manager.cpp
index 8df9f299ef..61c7376c79 100644
--- a/engines/wintermute/base/sound/base_sound_manager.cpp
+++ b/engines/wintermute/base/sound/base_sound_manager.cpp
@@ -28,6 +28,7 @@
#include "engines/wintermute/base/sound/base_sound_manager.h"
#include "engines/wintermute/base/base_registry.h"
+#include "engines/wintermute/base/base_engine.h"
#include "engines/wintermute/utils/path_util.h"
#include "engines/wintermute/utils/string_util.h"
#include "engines/wintermute/base/base_game.h"
@@ -71,7 +72,7 @@ bool BaseSoundMgr::cleanup() {
//////////////////////////////////////////////////////////////////////////
void BaseSoundMgr::saveSettings() {
if (_soundAvailable) {
- _gameRef->_registry->writeInt("Audio", "MasterVolume", _volumeMaster);
+ BaseEngine::getInstance()->getRegistry()->writeInt("Audio", "MasterVolume", _volumeMaster);
}
}
@@ -82,7 +83,7 @@ bool BaseSoundMgr::initialize() {
if (!g_system->getMixer()->isReady()) {
return STATUS_FAILED;
}
- _volumeMaster = _gameRef->_registry->readInt("Audio", "MasterVolume", 255);
+ _volumeMaster = BaseEngine::getInstance()->getRegistry()->readInt("Audio", "MasterVolume", 255);
_soundAvailable = true;
return STATUS_OK;
@@ -104,7 +105,7 @@ BaseSoundBuffer *BaseSoundMgr::addSound(const Common::String &filename, Audio::M
AnsiString name = PathUtil::getFileNameWithoutExtension(filename);
AnsiString newFile = PathUtil::combine(path, name + "ogg");
- if (_gameRef->_fileManager->hasFile(newFile)) {
+ if (BaseFileManager::getEngineInstance()->hasFile(newFile)) {
useFilename = newFile;
}
}