[Scummvm-cvs-logs] CVS: scummvm/sword1 animation.cpp,1.7,1.8

Travis Howell kirben at users.sourceforge.net
Sun Feb 8 06:15:01 CET 2004


Update of /cvsroot/scummvm/scummvm/sword1
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22314/sword1

Modified Files:
	animation.cpp 
Log Message:

More cutscene fixes from roever


Index: animation.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword1/animation.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- animation.cpp	30 Jan 2004 20:57:23 -0000	1.7
+++ animation.cpp	8 Feb 2004 14:11:11 -0000	1.8
@@ -40,8 +40,10 @@
 	delete sndfile;
 #ifndef BACKEND_8BIT
 	_sys->hide_overlay();
-	delete overlay;
+	free(overlay);
 #endif
+	if (bgSoundStream)
+		delete bgSoundStream;
 #endif
 }
 
@@ -137,7 +139,7 @@
 	sprintf(tempFile, "%s.ogg", basename);
 	if (sndfile->open(tempFile)) {
 		bgSoundStream = makeVorbisStream(sndfile, sndfile->size());
-		_snd->playInputStream(&bgSound, bgSoundStream, false, 255, 0, -1);
+		_snd->playInputStream(&bgSound, bgSoundStream, false, 255, 0, -1, false);
 	}
 
 #endif
@@ -315,8 +317,6 @@
 				 * events are processed.
 				 */
 
-				OSystem::Event event;
-
 #ifdef BACKEND_8BIT
 				if (checkPaletteSwitch() || (bgSoundStream == NULL) ||
                                     (bgSoundStream->getSamplesPlayed()*12/bgSoundStream->getRate()) < (framenum+3)){
@@ -330,7 +330,6 @@
 						while (_sys->get_msecs() < ticks)
 							_sys->delay_msecs(10);
 					}
-					_sys->poll_event(&event);
 
 				} else
 					warning("dropped frame %i", framenum);
@@ -350,7 +349,6 @@
 						while (_sys->get_msecs() < ticks)
 							_sys->delay_msecs(10);
 					}
-					_sys->poll_event(&event);
 
 				} else
 					warning("dropped frame %i", framenum);
@@ -388,6 +386,16 @@
 			_sys->update_screen();
 #endif
 			// FIXME: check for ESC and abbort animation be just returning from the function
+			OSystem::Event event;
+			while (_sys->poll_event(&event)) {
+				if ((event.event_code == OSystem::EVENT_KEYDOWN) &&
+				    (event.kbd.keycode == 27)) {
+					delete anim;
+					return;
+				}
+				if (event.event_code == OSystem::EVENT_QUIT)
+					_sys->quit();
+			}
 		}
 	}
 





More information about the Scummvm-git-logs mailing list