aboutsummaryrefslogtreecommitdiff
path: root/sword2
diff options
context:
space:
mode:
authorTorbjörn Andersson2003-09-02 15:55:55 +0000
committerTorbjörn Andersson2003-09-02 15:55:55 +0000
commit145f17c4a97a1203e9588ebea2e0507468cb535f (patch)
tree717591a56099a717fecd0760f9c9da557d15dcf7 /sword2
parent907485c1a2681cf2609eddc51f970bb5dabd7a58 (diff)
downloadscummvm-rg350-145f17c4a97a1203e9588ebea2e0507468cb535f.tar.gz
scummvm-rg350-145f17c4a97a1203e9588ebea2e0507468cb535f.tar.bz2
scummvm-rg350-145f17c4a97a1203e9588ebea2e0507468cb535f.zip
Moved the sound initialisation to the Sword2Sound constructor to avoid
warning messages about uninitialised sound handles. svn-id: r9972
Diffstat (limited to 'sword2')
-rw-r--r--sword2/driver/d_sound.cpp10
-rw-r--r--sword2/sword2.cpp18
2 files changed, 10 insertions, 18 deletions
diff --git a/sword2/driver/d_sound.cpp b/sword2/driver/d_sound.cpp
index 3b5ac17463..395dff60cc 100644
--- a/sword2/driver/d_sound.cpp
+++ b/sword2/driver/d_sound.cpp
@@ -169,6 +169,7 @@
#include "rdwin.h" // for hwnd.
#include "d_sound.h"
#include "../sword2.h"
+#include "common/timer.h"
#include "sound/mixer.h"
// Decompression macros
@@ -235,6 +236,15 @@ Sword2Sound::Sword2Sound(SoundMixer *mixer) {
musicMuted = 0;
bufferSizeMusic = 44100;
_mixer = mixer;
+
+ // Don't care if this fails, because it should still work without
+ // sound cards but it should set a global system flag so that we can
+ // avoid loading sound fx & streaming music because they won't be
+ // heard anyway
+
+ InitialiseSound(22050, 2, 16);
+
+ g_engine->_timer->installProcedure(sword2_sound_handler, 1000000);
}
// --------------------------------------------------------------------------
diff --git a/sword2/sword2.cpp b/sword2/sword2.cpp
index 60bda82d43..d7cfcde395 100644
--- a/sword2/sword2.cpp
+++ b/sword2/sword2.cpp
@@ -23,7 +23,6 @@
#include "driver/palette.h"
#include "common/gameDetector.h"
#include "common/config-file.h"
-#include "common/timer.h"
#include "build_display.h"
#include "console.h"
#include "controls.h"
@@ -300,23 +299,6 @@ void Sword2State::go()
Zdebug("CALLING: ReadOptionSettings");
ReadOptionSettings(); //restore the menu settings
Zdebug("RETURNED.");
-
- Zdebug("CALLING: InitialiseSound");
- rv = _sound->InitialiseSound(22050, 2, 16);
- Zdebug("RETURNED with rv = %.8x", rv);
- // don't care if this fails, because it should still work without sound cards
- // but it should set a global system flag so that we can avoid loading sound fx & streaming music
- // because they won't be heard anyway
-/*
- if (rv != RD_OK)
- {
- ReportDriverError(rv);
- CloseAppWindow();
- return(0);
- }
-*/
-
- g_engine->_timer->installProcedure(sword2_sound_handler, 1000000);
Zdebug("CALLING: InitialiseGame");
if (InitialiseGame())
{