aboutsummaryrefslogtreecommitdiff
path: root/engines/tinsel/tinsel.cpp
diff options
context:
space:
mode:
authorMax Horn2009-03-01 04:42:46 +0000
committerMax Horn2009-03-01 04:42:46 +0000
commitdd98126423d915c19baf43184ba40fb0d9a68b64 (patch)
treedc6c65d5ca3d7c5c69f54e9dc980067980a2ae9a /engines/tinsel/tinsel.cpp
parent3fcbda829a2aa17cbaf6423d34f69214b91b0e6c (diff)
downloadscummvm-rg350-dd98126423d915c19baf43184ba40fb0d9a68b64.tar.gz
scummvm-rg350-dd98126423d915c19baf43184ba40fb0d9a68b64.tar.bz2
scummvm-rg350-dd98126423d915c19baf43184ba40fb0d9a68b64.zip
Engines: Fused several init&go methods into a single run method
svn-id: r39003
Diffstat (limited to 'engines/tinsel/tinsel.cpp')
-rw-r--r--engines/tinsel/tinsel.cpp44
1 files changed, 19 insertions, 25 deletions
diff --git a/engines/tinsel/tinsel.cpp b/engines/tinsel/tinsel.cpp
index b5a745cf81..80c71a70c5 100644
--- a/engines/tinsel/tinsel.cpp
+++ b/engines/tinsel/tinsel.cpp
@@ -916,7 +916,24 @@ TinselEngine::~TinselEngine() {
delete _scheduler;
}
-Common::Error TinselEngine::init() {
+void TinselEngine::syncSoundSettings() {
+ // Sync the engine with the config manager
+ int soundVolumeMusic = ConfMan.getInt("music_volume");
+ int soundVolumeSFX = ConfMan.getInt("sfx_volume");
+ int soundVolumeSpeech = ConfMan.getInt("speech_volume");
+
+ _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, soundVolumeMusic);
+ _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, soundVolumeSFX);
+ _mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, soundVolumeSpeech);
+}
+
+Common::String TinselEngine::getSavegameFilename(int16 saveNum) const {
+ char filename[256];
+ snprintf(filename, 256, "%s.%03d", getTargetName().c_str(), saveNum);
+ return filename;
+}
+
+Common::Error TinselEngine::run() {
// Initialize backend
if (getGameID() == GID_DW2) {
#ifndef DW2_EXACT_SIZE
@@ -971,29 +988,6 @@ Common::Error TinselEngine::init() {
// Actors, globals and inventory icons
LoadBasicChunks();
- return Common::kNoError;
-}
-
-void TinselEngine::syncSoundSettings() {
- // Sync the engine with the config manager
- int soundVolumeMusic = ConfMan.getInt("music_volume");
- int soundVolumeSFX = ConfMan.getInt("sfx_volume");
- int soundVolumeSpeech = ConfMan.getInt("speech_volume");
-
- _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, soundVolumeMusic);
- _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, soundVolumeSFX);
- _mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, soundVolumeSpeech);
-}
-
-Common::String TinselEngine::getSavegameFilename(int16 saveNum) const {
- char filename[256];
- snprintf(filename, 256, "%s.%03d", getTargetName().c_str(), saveNum);
- return filename;
-}
-
-Common::Error TinselEngine::go() {
- uint32 timerVal = 0;
-
// Continuous game processes
CreateConstProcesses();
@@ -1013,7 +1007,7 @@ Common::Error TinselEngine::go() {
}
// Foreground loop
-
+ uint32 timerVal = 0;
while (!shouldQuit()) {
assert(_console);
if (_console->isAttached())