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

kirben at users.sourceforge.net kirben at users.sourceforge.net
Sat Apr 22 19:45:06 CEST 2006


Revision: 22089
Author:   kirben
Date:     2006-04-22 19:44:46 -0700 (Sat, 22 Apr 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=22089&view=rev

Log Message:
-----------
Read and use frame rate setting for videos

Modified Paths:
--------------
    scummvm/trunk/engines/simon/animation.cpp
    scummvm/trunk/engines/simon/animation.h
Modified: scummvm/trunk/engines/simon/animation.cpp
===================================================================
--- scummvm/trunk/engines/simon/animation.cpp	2006-04-23 02:11:49 UTC (rev 22088)
+++ scummvm/trunk/engines/simon/animation.cpp	2006-04-23 02:44:46 UTC (rev 22089)
@@ -65,13 +65,16 @@
 
 	_fd.readByte();
 	_framesCount = _fd.readUint16BE();
-	_frameTicks = _fd.readUint32BE();
-	if (_frameTicks > 100) {
+	_frameRate = _frameTicks = _fd.readUint32BE();
+
+        if (_frameRate >= 0x80000000)
+                _frameRate = -_frameRate / 1000;
+	if (_frameTicks > 100)
 		_frameTicks = 100;
-	}
+
 	_width = _fd.readUint16BE();
 	_height = _fd.readUint16BE();
-	debug(0, "frames_count %d width %d height %d ticks %d", _framesCount, _width, _height, _frameTicks);
+	debug(0, "frames_count %d width %d height %d rate %d ticks %d", _framesCount, _width, _height, _frameRate, _frameTicks);
 	_frameSize = _width * _height;
 	_frameBuffer1 = (uint8 *)malloc(_frameSize);
 	_frameBuffer2 = (uint8 *)malloc(_frameSize);
@@ -243,16 +246,15 @@
 	else
 		g_system->copyRectToScreen(_frameBuffer1, _width, 128, 100, _width, _height);
 
-	// TODO Remove set frame rate, were video files use different rate.
-	if ((_bgSoundStream == NULL) || ((_mixer->getSoundElapsedTime(_bgSound) * 10) / 1000 < _frameNum + 1) ||
-		_frameSkipped > 10) {
-		if (_frameSkipped > 10) {
+	if ((_bgSoundStream == NULL) || ((_mixer->getSoundElapsedTime(_bgSound) * _frameRate) / 1000 < _frameNum + 1) ||
+		_frameSkipped > _frameRate) {
+		if (_frameSkipped > _frameRate) {
 			warning("force frame %i redraw", _frameNum);
 			_frameSkipped = 0;
 		}
 
 		if (_bgSoundStream && _mixer->isSoundHandleActive(_bgSound)) {
-			while (_mixer->isSoundHandleActive(_bgSound) && (_mixer->getSoundElapsedTime(_bgSound) * 10) / 1000 < _frameNum) {
+			while (_mixer->isSoundHandleActive(_bgSound) && (_mixer->getSoundElapsedTime(_bgSound) * _frameRate) / 1000 < _frameNum) {
 				g_system->delayMillis(10);
 			}
 			// In case the background sound ends prematurely, update

Modified: scummvm/trunk/engines/simon/animation.h
===================================================================
--- scummvm/trunk/engines/simon/animation.h	2006-04-23 02:11:49 UTC (rev 22088)
+++ scummvm/trunk/engines/simon/animation.h	2006-04-23 02:44:46 UTC (rev 22089)
@@ -51,6 +51,7 @@
 	uint32 _frameSize;
 	uint16 _framesCount;
 	uint16 _frameNum;
+	uint32 _frameRate;
 	uint32 _frameTicks;
 	uint _frameSkipped;
 	uint32 _ticks;


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