[Scummvm-cvs-logs] SF.net SVN: scummvm:[35280] scummvm/trunk/engines/sky

eriktorbjorn at users.sourceforge.net eriktorbjorn at users.sourceforge.net
Sun Dec 7 18:32:25 CET 2008


Revision: 35280
          http://scummvm.svn.sourceforge.net/scummvm/?rev=35280&view=rev
Author:   eriktorbjorn
Date:     2008-12-07 17:32:25 +0000 (Sun, 07 Dec 2008)

Log Message:
-----------
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.

Modified Paths:
--------------
    scummvm/trunk/engines/sky/intro.cpp
    scummvm/trunk/engines/sky/sky.cpp
    scummvm/trunk/engines/sky/sky.h

Modified: scummvm/trunk/engines/sky/intro.cpp
===================================================================
--- scummvm/trunk/engines/sky/intro.cpp	2008-12-07 17:17:37 UTC (rev 35279)
+++ scummvm/trunk/engines/sky/intro.cpp	2008-12-07 17:32:25 UTC (rev 35280)
@@ -640,12 +640,11 @@
 }
 
 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) {

Modified: scummvm/trunk/engines/sky/sky.cpp
===================================================================
--- scummvm/trunk/engines/sky/sky.cpp	2008-12-07 17:17:37 UTC (rev 35279)
+++ scummvm/trunk/engines/sky/sky.cpp	2008-12-07 17:32:25 UTC (rev 35280)
@@ -93,8 +93,6 @@
 	delete _skyDisk;
 	delete _skyControl;
 	delete _skyCompact;
-	if (_skyIntro)
-		delete _skyIntro;
 
 	for (int i = 0; i < 300; i++)
 		if (_itemList[i])
@@ -169,8 +167,10 @@
 	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 @@
 	 _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 @@
 	_systemVars.systemFlags |= SF_PLAY_VOCS;
 	_systemVars.gameSpeed = 50;
 
-	_skyIntro = 0;
 	_skyCompact = new SkyCompact();
 	_skyText = new Text(_skyDisk, _skyCompact);
 	_skyMouse = new Mouse(_system, _skyDisk, _skyCompact);

Modified: scummvm/trunk/engines/sky/sky.h
===================================================================
--- scummvm/trunk/engines/sky/sky.h	2008-12-07 17:17:37 UTC (rev 35279)
+++ scummvm/trunk/engines/sky/sky.h	2008-12-07 17:32:25 UTC (rev 35280)
@@ -53,14 +53,12 @@
 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 @@
 	Debugger *_debugger;
 
 	MusicBase *_skyMusic;
-	Intro *_skyIntro;
 
 public:
 	SkyEngine(OSystem *syst);


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list