[Scummvm-cvs-logs] CVS: scummvm/sword2 function.cpp,1.49,1.50 sword2.cpp,1.101,1.102 sword2.h,1.48,1.49

Torbj?rn Andersson eriktorbjorn at users.sourceforge.net
Thu Jan 8 05:04:04 CET 2004


Update of /cvsroot/scummvm/scummvm/sword2
In directory sc8-pr-cvs1:/tmp/cvs-serv24146

Modified Files:
	function.cpp sword2.cpp sword2.h 
Log Message:
Allow quitting during cutscenes and credits again. This is getting a bit
hackish...


Index: function.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/function.cpp,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -d -r1.49 -r1.50
--- function.cpp	6 Jan 2004 13:44:17 -0000	1.49
+++ function.cpp	8 Jan 2004 13:03:50 -0000	1.50
@@ -617,7 +617,7 @@
 	int startLine = 0;
 	int scrollPos = 0;
 
-	while (scrollPos < lineTop + CREDITS_FONT_HEIGHT) {
+	while (scrollPos < lineTop + CREDITS_FONT_HEIGHT && !_vm->_quit) {
 		bool foundStartLine = false;
 
 		_vm->_graphics->clearScene();
@@ -685,6 +685,7 @@
 			fnStopMusic(NULL);
 			break;
 		}
+	  
 
 		_vm->_system->delay_msecs(30);
 
@@ -704,14 +705,19 @@
 	if (logoData)
 		free(logoData);
 
+	if (_vm->_quit)
+		return IR_CONT;
+
 	_vm->_graphics->fadeDown();
 	_vm->_graphics->waitForFade();
 
 	// The music should have stopped by now, but I suppose there is a
 	// slim chance it hasn't on a really, really fast computer.
 
-	while (_vm->_sound->musicTimeRemaining())
+	while (_vm->_sound->musicTimeRemaining()) {
+		_vm->_graphics->updateDisplay(false);
 		_vm->_system->delay_msecs(100);
+	}
 
 	_vm->_sound->restoreMusicState();
 	_vm->_sound->muteFx(false);

Index: sword2.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/sword2.cpp,v
retrieving revision 1.101
retrieving revision 1.102
diff -u -d -r1.101 -r1.102
--- sword2.cpp	6 Jan 2004 16:49:04 -0000	1.101
+++ sword2.cpp	8 Jan 2004 13:03:50 -0000	1.102
@@ -293,6 +293,8 @@
 void Sword2Engine::go() {
 	KeyboardEvent ke;
 
+	_quit = false;
+
 	debug(5, "CALLING: readOptionSettings");
 	_gui->readOptionSettings();
 
@@ -318,7 +320,6 @@
 					// 1 in 4 frames, to speed up game
 
 	_gameCycle = 0;
-	_quit = false;
 
 	while (1) {
 		if (_debugger->isAttached())

Index: sword2.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/sword2.h,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -d -r1.48 -r1.49
--- sword2.h	6 Jan 2004 13:44:17 -0000	1.48
+++ sword2.h	8 Jan 2004 13:03:50 -0000	1.49
@@ -48,7 +48,6 @@
 
 class Sword2Engine : public Engine {
 private:
-	bool _quit;
 	uint32 _bootParam;
 	int32 _saveSlot;
 
@@ -130,6 +129,9 @@
 	~Sword2Engine();
 	void go(void);
 	int32 initialiseGame(void);
+
+	bool _quit;
+
 	uint32 _features;
 	char *_targetName; // target name for saves
 





More information about the Scummvm-git-logs mailing list