[Scummvm-cvs-logs] SF.net SVN: scummvm:[55668] scummvm/trunk/engines/mohawk
fuzzie at users.sourceforge.net
fuzzie at users.sourceforge.net
Sun Jan 30 23:42:37 CET 2011
Revision: 55668
http://scummvm.svn.sourceforge.net/scummvm/?rev=55668&view=rev
Author: fuzzie
Date: 2011-01-30 22:42:37 +0000 (Sun, 30 Jan 2011)
Log Message:
-----------
MOHAWK: Handle kLBAnimOpSetTempoDiv better.
Modified Paths:
--------------
scummvm/trunk/engines/mohawk/livingbooks.cpp
scummvm/trunk/engines/mohawk/livingbooks.h
Modified: scummvm/trunk/engines/mohawk/livingbooks.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/livingbooks.cpp 2011-01-30 21:00:23 UTC (rev 55667)
+++ scummvm/trunk/engines/mohawk/livingbooks.cpp 2011-01-30 22:42:37 UTC (rev 55668)
@@ -1258,17 +1258,23 @@
break;
case kLBAnimOpSetTempo:
- case kLBAnimOpUnknownE: // TODO: complete guesswork, not in 1.x
+ case kLBAnimOpSetTempoDiv:
{
assert(entry.size == 2);
uint16 tempo = (int16)READ_BE_UINT16(entry.data);
- debug(4, "3: SetTempo(%d)", tempo);
- if (entry.opcode == kLBAnimOpUnknownE) {
- debug(4, "(beware, stupid OpUnknownE guesswork)");
+ // TODO: LB 3 uses fixed-point here.
+ if (entry.opcode == kLBAnimOpSetTempo) {
+ debug(4, "3: SetTempo(%d)", tempo);
+ // TODO: LB 3 uses (tempo * 1000) / 60, while
+ // the original divides the system time by 16.
+ _parent->setTempo(tempo * 16);
+ } else {
+ // LB 3.0+ only.
+ debug(4, "E: SetTempoDiv(%d)", tempo);
+ _parent->setTempo(1000 / tempo);
}
- _parent->setTempo(tempo);
}
break;
@@ -1516,12 +1522,12 @@
if (!_running)
return false;
- if (_vm->_system->getMillis() / 16 <= _lastTime + (uint32)_tempo)
+ if (_vm->_system->getMillis() <= _lastTime + (uint32)_tempo)
return false;
// the second check is to try 'catching up' with lagged animations, might be crazy
- if (_lastTime == 0 || (_vm->_system->getMillis() / 16) > _lastTime + (uint32)(_tempo * 2))
- _lastTime = _vm->_system->getMillis() / 16;
+ if (_lastTime == 0 || (_vm->_system->getMillis()) > _lastTime + (uint32)(_tempo * 2))
+ _lastTime = _vm->_system->getMillis();
else
_lastTime += _tempo;
Modified: scummvm/trunk/engines/mohawk/livingbooks.h
===================================================================
--- scummvm/trunk/engines/mohawk/livingbooks.h 2011-01-30 21:00:23 UTC (rev 55667)
+++ scummvm/trunk/engines/mohawk/livingbooks.h 2011-01-30 22:42:37 UTC (rev 55668)
@@ -106,7 +106,7 @@
kLBAnimOpWaitForSound = 0xb,
kLBAnimOpReleaseSound = 0xc,
kLBAnimOpResetSound = 0xd,
- kLBAnimOpUnknownE = 0xe,
+ kLBAnimOpSetTempoDiv = 0xe,
kLBAnimOpDelay = 0xf
};
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