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

eriktorbjorn at users.sourceforge.net eriktorbjorn at users.sourceforge.net
Sat Apr 14 16:07:12 CEST 2007


Revision: 26469
          http://scummvm.svn.sourceforge.net/scummvm/?rev=26469&view=rev
Author:   eriktorbjorn
Date:     2007-04-14 07:07:11 -0700 (Sat, 14 Apr 2007)

Log Message:
-----------
I must have accidentally broken frame skipping when I added DXA playback. Made
frame skipping actually skip the updateScreen() call.

Modified Paths:
--------------
    scummvm/trunk/engines/sword1/animation.cpp
    scummvm/trunk/engines/sword1/animation.h
    scummvm/trunk/engines/sword2/animation.cpp
    scummvm/trunk/engines/sword2/animation.h

Modified: scummvm/trunk/engines/sword1/animation.cpp
===================================================================
--- scummvm/trunk/engines/sword1/animation.cpp	2007-04-14 12:03:46 UTC (rev 26468)
+++ scummvm/trunk/engines/sword1/animation.cpp	2007-04-14 14:07:11 UTC (rev 26469)
@@ -119,11 +119,11 @@
 	return true;
 }
 
-void MoviePlayer::syncFrame(void) {
+bool MoviePlayer::syncFrame(void) {
 	_ticks += 83;
 	if (checkSkipFrame()) {
 		warning("Skipped frame %d", _currentFrame);
-		return;
+		return false;
 	}
 	if (_bgSoundStream) {
 		while (_snd->isSoundHandleActive(_bgSoundHandle) && (_snd->getSoundElapsedTime(_bgSoundHandle) * 12) / 1000 < _currentFrame) {
@@ -140,6 +140,7 @@
 			_system->delayMillis(10);
 		}
 	}
+	return true;
 }
 
 /**
@@ -197,8 +198,8 @@
 	Common::EventManager *eventMan = _system->getEventManager();
 	while (!terminated && decodeFrame()) {
 		processFrame();
-		syncFrame();
-		updateScreen();
+		if (syncFrame())
+			updateScreen();
 		_currentFrame++;
 		Common::Event event;
 		while (eventMan->pollEvent(event)) {

Modified: scummvm/trunk/engines/sword1/animation.h
===================================================================
--- scummvm/trunk/engines/sword1/animation.h	2007-04-14 12:03:46 UTC (rev 26468)
+++ scummvm/trunk/engines/sword1/animation.h	2007-04-14 14:07:11 UTC (rev 26469)
@@ -90,7 +90,7 @@
 	virtual bool initOverlays(uint32 id);
 	virtual bool decodeFrame(void) = 0;
 	virtual void processFrame(void) = 0;
-	virtual void syncFrame(void);
+	virtual bool syncFrame(void);
 	virtual void updateScreen(void) = 0;
 };
 

Modified: scummvm/trunk/engines/sword2/animation.cpp
===================================================================
--- scummvm/trunk/engines/sword2/animation.cpp	2007-04-14 12:03:46 UTC (rev 26468)
+++ scummvm/trunk/engines/sword2/animation.cpp	2007-04-14 14:07:11 UTC (rev 26469)
@@ -169,12 +169,12 @@
 	return true;
 }
 
-void MoviePlayer::syncFrame() {
+bool MoviePlayer::syncFrame() {
 	_ticks += 83;
 
 	if (checkSkipFrame()) {
 		warning("Skipped frame %d", _currentFrame);
-		return;
+		return false;
 	}
 
 	if (_bgSoundStream) {
@@ -192,6 +192,8 @@
 			_system->delayMillis(10);
 		}
 	}
+
+	return true;
 }
 
 void MoviePlayer::drawFrame() {
@@ -403,9 +405,10 @@
 			_vm->_sound->playMovieSound(leadOut, kLeadOutSound);
 		}
 
-		syncFrame();
-		drawFrame();
-		updateScreen();
+		if (syncFrame()) {
+			drawFrame();
+			updateScreen();
+		}
 
 		Common::Event event;
 
@@ -809,13 +812,13 @@
 	return true;
 }
 
-void MoviePlayerDummy::syncFrame() {
+bool MoviePlayerDummy::syncFrame() {
 	if (_numSpeechLines == 0 || _currentFrame < _firstSpeechFrame) {
 		_ticks = _system->getMillis();
-		return;
+		return false;
 	}
 
-	MoviePlayer::syncFrame();
+	return MoviePlayer::syncFrame();
 }
 
 void MoviePlayerDummy::drawFrame() {

Modified: scummvm/trunk/engines/sword2/animation.h
===================================================================
--- scummvm/trunk/engines/sword2/animation.h	2007-04-14 12:03:46 UTC (rev 26468)
+++ scummvm/trunk/engines/sword2/animation.h	2007-04-14 14:07:11 UTC (rev 26469)
@@ -106,7 +106,7 @@
 	virtual void clearFrame();
 	virtual void updateScreen();
 	virtual bool decodeFrame() = 0;
-	virtual void syncFrame();
+	virtual bool syncFrame();
 	virtual void drawFrame();
 	virtual void drawTextObject();
 	virtual void undrawTextObject();
@@ -123,7 +123,7 @@
 class MoviePlayerDummy : public MoviePlayer {
 protected:
 	bool decodeFrame();
-	void syncFrame();
+	bool syncFrame();
 	void drawFrame();
 	void drawTextObject();
 	void undrawTextObject();


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