From 28058407c1377722fc8f3956504689d05b949914 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sun, 18 Aug 2002 18:15:15 +0000 Subject: fixed simon crasher svn-id: r4760 --- simon/simon.cpp | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/simon/simon.cpp b/simon/simon.cpp index 67ea4d9092..a379006052 100644 --- a/simon/simon.cpp +++ b/simon/simon.cpp @@ -126,8 +126,13 @@ SimonState::SimonState(GameDetector *detector, OSystem *syst) midi.set_driver(driver); _game = detector->_gameId; - set_volume(detector->_sfx_volume); _game_path = detector->_gameDataPath; + + /* Setup mixer */ + if (!_mixer->bind_to_system(syst)) + warning("Sound initialization failed. " + "Features of the game that depend on sound synchronization will most likely break"); + set_volume(detector->_sfx_volume); } SimonState::~SimonState() @@ -141,15 +146,7 @@ SimonState::~SimonState() SimonState *SimonState::createFromDetector(GameDetector *detector, OSystem *syst) { - SimonState *s = new SimonState(detector, syst); - - /* Setup mixer */ - if (!s->_mixer->bind_to_system(syst)) - warning("Sound initialization failed. " - "Features of the game that depend on sound synchronization will most likely break"); - - return s; - + return new SimonState(detector, syst); } void palette_fadeout(uint32 *pal_values, uint num) @@ -4948,7 +4945,7 @@ void SimonState::dx_unlock_attached() void SimonState::set_volume(byte volume) { - _mixer->set_volume(volume * 256 / 100); + _mixer->set_volume(volume); } -- cgit v1.2.3