aboutsummaryrefslogtreecommitdiff
path: root/engines/sky/sky.cpp
diff options
context:
space:
mode:
authorTorbjörn Andersson2008-12-07 17:32:25 +0000
committerTorbjörn Andersson2008-12-07 17:32:25 +0000
commitc2424b04a5964e4763a7d7c123317dec925c8214 (patch)
treea5824d1fab21e921b5d45399df37ba1b1ea4a9a1 /engines/sky/sky.cpp
parent15dad27d79601af93139f395671d404053c770cb (diff)
downloadscummvm-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
Diffstat (limited to 'engines/sky/sky.cpp')
-rw-r--r--engines/sky/sky.cpp10
1 files changed, 4 insertions, 6 deletions
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);