Moved the sound initialisation to the Sword2Sound constructor to avoid

warning messages about uninitialised sound handles.

svn-id: r9972
This commit is contained in:
Torbjörn Andersson 2003-09-02 15:55:55 +00:00
parent 907485c1a2
commit 145f17c4a9
2 changed files with 10 additions and 18 deletions

View File

@ -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);
}
// --------------------------------------------------------------------------

View File

@ -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())
{