diff options
author | Torbjörn Andersson | 2008-12-07 17:32:25 +0000 |
---|---|---|
committer | Torbjörn Andersson | 2008-12-07 17:32:25 +0000 |
commit | c2424b04a5964e4763a7d7c123317dec925c8214 (patch) | |
tree | a5824d1fab21e921b5d45399df37ba1b1ea4a9a1 | |
parent | 15dad27d79601af93139f395671d404053c770cb (diff) | |
download | scummvm-rg350-c2424b04a5964e4763a7d7c123317dec925c8214.tar.gz scummvm-rg350-c2424b04a5964e4763a7d7c123317dec925c8214.tar.bz2 scummvm-rg350-c2424b04a5964e4763a7d7c123317dec925c8214.zip |
Fixed bug #2394861 ("BASS: artifacts if skipping intro on wrong screen"). As an
added bonus, the Intro class is now freed as soon as the intro is over, rather
than at the end of the game.
svn-id: r35280
-rw-r--r-- | engines/sky/intro.cpp | 11 | ||||
-rw-r--r-- | engines/sky/sky.cpp | 10 | ||||
-rw-r--r-- | engines/sky/sky.h | 3 |
3 files changed, 9 insertions, 15 deletions
diff --git a/engines/sky/intro.cpp b/engines/sky/intro.cpp index 86e26309c9..40c53a3686 100644 --- a/engines/sky/intro.cpp +++ b/engines/sky/intro.cpp @@ -640,12 +640,11 @@ Intro::Intro(Disk *disk, Screen *screen, MusicBase *music, Sound *sound, Text *t } Intro::~Intro(void) { - if (_textBuf) - free(_textBuf); - if (_saveBuf) - free(_saveBuf); - if (_bgBuf) - free(_bgBuf); + if (_skyScreen->sequenceRunning()) + _skyScreen->stopSequence(); + free(_textBuf); + free(_saveBuf); + free(_bgBuf); } bool Intro::doIntro(bool floppyIntro) { diff --git a/engines/sky/sky.cpp b/engines/sky/sky.cpp index b1ea5ac3f9..4adce2ebaf 100644 --- a/engines/sky/sky.cpp +++ b/engines/sky/sky.cpp @@ -93,8 +93,6 @@ SkyEngine::~SkyEngine() { delete _skyDisk; delete _skyControl; delete _skyCompact; - if (_skyIntro) - delete _skyIntro; for (int i = 0; i < 300; i++) if (_itemList[i]) @@ -169,8 +167,10 @@ Common::Error SkyEngine::go() { if (result != GAME_RESTORED) { bool introSkipped = false; if (_systemVars.gameVersion > 267) { // don't do intro for floppydemos - _skyIntro = new Intro(_skyDisk, _skyScreen, _skyMusic, _skySound, _skyText, _mixer, _system); - introSkipped = !_skyIntro->doIntro(_floppyIntro); + Intro *skyIntro = new Intro(_skyDisk, _skyScreen, _skyMusic, _skySound, _skyText, _mixer, _system); + bool floppyIntro = ConfMan.getBool("alt_intro"); + introSkipped = !skyIntro->doIntro(floppyIntro); + delete skyIntro; } if (!shouldQuit()) { @@ -249,7 +249,6 @@ Common::Error SkyEngine::init() { _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, ConfMan.getInt("sfx_volume")); _mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, ConfMan.getInt("speech_volume")); _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, ConfMan.getInt("music_volume")); - _floppyIntro = ConfMan.getBool("alt_intro"); _skyDisk = new Disk(); _skySound = new Sound(_mixer, _skyDisk, Audio::Mixer::kMaxChannelVolume); @@ -287,7 +286,6 @@ Common::Error SkyEngine::init() { _systemVars.systemFlags |= SF_PLAY_VOCS; _systemVars.gameSpeed = 50; - _skyIntro = 0; _skyCompact = new SkyCompact(); _skyText = new Text(_skyDisk, _skyCompact); _skyMouse = new Mouse(_system, _skyDisk, _skyCompact); diff --git a/engines/sky/sky.h b/engines/sky/sky.h index aee8d7aff3..4e92563401 100644 --- a/engines/sky/sky.h +++ b/engines/sky/sky.h @@ -53,14 +53,12 @@ class Mouse; class Screen; class Control; class MusicBase; -class Intro; class Debugger; class SkyCompact; class SkyEngine : public Engine { protected: Common::KeyState _keyPressed; - bool _floppyIntro; Sound *_skySound; Disk *_skyDisk; @@ -73,7 +71,6 @@ protected: Debugger *_debugger; MusicBase *_skyMusic; - Intro *_skyIntro; public: SkyEngine(OSystem *syst); |