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

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Fri Jul 6 15:21:43 CEST 2007


Revision: 27939
          http://scummvm.svn.sourceforge.net/scummvm/?rev=27939&view=rev
Author:   thebluegr
Date:     2007-07-06 06:21:43 -0700 (Fri, 06 Jul 2007)

Log Message:
-----------
Modified ticksToMSec in IHNM, so that it waits for the correct amount of time. Many animations which were not displayed quite right are fixed now, including some small syncing issues with video and sound in some places

Modified Paths:
--------------
    scummvm/trunk/engines/saga/actor.cpp
    scummvm/trunk/engines/saga/saga.h
    scummvm/trunk/engines/saga/sfuncs.cpp

Modified: scummvm/trunk/engines/saga/actor.cpp
===================================================================
--- scummvm/trunk/engines/saga/actor.cpp	2007-07-06 12:53:58 UTC (rev 27938)
+++ scummvm/trunk/engines/saga/actor.cpp	2007-07-06 13:21:43 UTC (rev 27939)
@@ -1130,7 +1130,7 @@
 		}
 
 		if (_activeSpeech.stringsCount == 0) {
-			_vm->_script->wakeUpThreadsDelayed(kWaitTypeSpeech, ticksToMSec(kScriptTimeTicksPerSecond / 3));
+			_vm->_script->wakeUpThreadsDelayed(kWaitTypeSpeech, _vm->ticksToMSec(kScriptTimeTicksPerSecond / 3));
 		}
 
 		return;

Modified: scummvm/trunk/engines/saga/saga.h
===================================================================
--- scummvm/trunk/engines/saga/saga.h	2007-07-06 12:53:58 UTC (rev 27938)
+++ scummvm/trunk/engines/saga/saga.h	2007-07-06 13:21:43 UTC (rev 27939)
@@ -339,6 +339,7 @@
 
 enum ScriptTimings {
 	kScriptTimeTicksPerSecond = (728L/10L),
+	kScriptTimeTicksPerSecondIHNM = 72,
 	kRepeatSpeedTicks = (728L/10L)/3,
 	kNormalFadeDuration = 320, // 64 steps, 5 msec each
 	kQuickFadeDuration = 64,  // 64 steps, 1 msec each
@@ -459,10 +460,6 @@
 	char name[SAVE_TITLE_SIZE];
 };
 
-inline int ticksToMSec(int tick) {
-	return tick * 1000 / kScriptTimeTicksPerSecond;
-}
-
 inline int clamp(int minValue, int value, int maxValue) {
 	if (value <= minValue) {
 		return minValue;
@@ -595,6 +592,13 @@
 		return _leftMouseButtonPressed || _rightMouseButtonPressed;
 	}
 
+	inline int ticksToMSec(int tick) {
+		if (getGameType() == GType_ITE)
+			return tick * 1000 / kScriptTimeTicksPerSecond;
+		else
+			return tick * 1000 / kScriptTimeTicksPerSecondIHNM;
+	}
+
  private:
 	uint _saveFilesMaxCount;
 	uint _saveFilesCount;

Modified: scummvm/trunk/engines/saga/sfuncs.cpp
===================================================================
--- scummvm/trunk/engines/saga/sfuncs.cpp	2007-07-06 12:53:58 UTC (rev 27938)
+++ scummvm/trunk/engines/saga/sfuncs.cpp	2007-07-06 13:21:43 UTC (rev 27939)
@@ -266,7 +266,7 @@
 	time = thread->pop();
 
 	if (!_skipSpeeches) {
-		thread->waitDelay(ticksToMSec(time)); // put thread to sleep
+		thread->waitDelay(_vm->ticksToMSec(time)); // put thread to sleep
 	}
 }
 
@@ -437,7 +437,7 @@
 	int16 cycles = thread->pop();
 
 	_vm->_anim->setCycles(animId, cycles);
-	_vm->_anim->setFrameTime(animId, ticksToMSec(kRepeatSpeedTicks));
+	_vm->_anim->setFrameTime(animId, _vm->ticksToMSec(kRepeatSpeedTicks));
 	_vm->_anim->play(animId, 0);
 
 	debug(1, "sfStartBgdAnim(%d, %d)", animId, cycles);
@@ -695,7 +695,7 @@
 	int16 animId = thread->pop();
 	int16 speed = thread->pop();
 
-	_vm->_anim->setFrameTime(animId, ticksToMSec(speed));
+	_vm->_anim->setFrameTime(animId, _vm->ticksToMSec(speed));
 	debug(1, "sfSetBgdAnimSpeed(%d, %d)", animId, speed);
 }
 
@@ -723,7 +723,7 @@
 	int16 speed = thread->pop();
 
 	_vm->_anim->setCycles(animId, cycles);
-	_vm->_anim->setFrameTime(animId, ticksToMSec(speed));
+	_vm->_anim->setFrameTime(animId, _vm->ticksToMSec(speed));
 	_vm->_anim->play(animId, 0);
 
 	debug(1, "sfStartBgdAnimSpeed(%d, %d, %d)", animId, cycles, speed);
@@ -1086,7 +1086,7 @@
 	if (speed >= 0) {
 		_vm->_anim->setCycles(animId, cycles);
 		_vm->_anim->stop(animId);
-		_vm->_anim->setFrameTime(animId, ticksToMSec(speed));
+		_vm->_anim->setFrameTime(animId, _vm->ticksToMSec(speed));
 	}
 
 	_vm->_anim->link(animId1, animId);
@@ -2138,8 +2138,11 @@
 		event.param = _vm->_music->_songTable[param1];
 		event.param2 = param2 ? MUSIC_LOOP : MUSIC_NORMAL;
 		event.op = kEventPlay;
-		event.time = 5 * 1000;	// we wait for 5x the duration here, to let the previous music track end
-								// TODO: original waits for 1000ms here, why is the 5x duration needed?
+		event.time = _vm->ticksToMSec(500);		// I find the delay in the original to be too long, so I've set it to
+												// wait for half the time, which sounds better when chapter points
+												// change
+												// FIXME: If this is too short for other cases apart from chapter
+												// point change, set it back to 1000
 
 		_vm->_events->queue(&event);
 


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