[Scummvm-cvs-logs] SF.net SVN: scummvm:[47343] scummvm/trunk/engines/sci
m_kiewitz at users.sourceforge.net
m_kiewitz at users.sourceforge.net
Sun Jan 17 19:41:28 CET 2010
Revision: 47343
http://scummvm.svn.sourceforge.net/scummvm/?rev=47343&view=rev
Author: m_kiewitz
Date: 2010-01-17 18:41:28 +0000 (Sun, 17 Jan 2010)
Log Message:
-----------
SCI: speed throttler changed, now gets triggered by kAnimate, removed initial no-delay, i'm still getting animation now in iceman and sq3, slow palette animation in longbow fixed
Modified Paths:
--------------
scummvm/trunk/engines/sci/engine/kmisc.cpp
scummvm/trunk/engines/sci/engine/state.cpp
scummvm/trunk/engines/sci/engine/state.h
scummvm/trunk/engines/sci/graphics/animate.h
scummvm/trunk/engines/sci/graphics/gui.cpp
Modified: scummvm/trunk/engines/sci/engine/kmisc.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kmisc.cpp 2010-01-17 18:27:57 UTC (rev 47342)
+++ scummvm/trunk/engines/sci/engine/kmisc.cpp 2010-01-17 18:41:28 UTC (rev 47343)
@@ -58,20 +58,23 @@
// Some games seem to get the duration of main loop initially and then switch of animations for the whole game
// based on that (qfg2, iceman). We are now running full speed initially to avoid that.
- if (s->_lastAnimateCounter < 50) {
- s->_lastAnimateCounter++;
- return s->r_acc;
- }
+ if (s->_throttleTrigger) {
+ //if (s->_throttleCounter < 50) {
+ // s->_throttleCounter++;
+ // return s->r_acc;
+ //}
- uint32 curTime = g_system->getMillis();
- uint32 duration = curTime - s->_lastAnimateTime;
- uint32 neededSleep = 30;
+ uint32 curTime = g_system->getMillis();
+ uint32 duration = curTime - s->_throttleLastTime;
+ uint32 neededSleep = 30;
- if (duration < neededSleep) {
- kernel_sleep(s->_event, neededSleep - duration);
- s->_lastAnimateTime = g_system->getMillis();
- } else {
- s->_lastAnimateTime = curTime;
+ if (duration < neededSleep) {
+ kernel_sleep(s->_event, neededSleep - duration);
+ s->_throttleLastTime = g_system->getMillis();
+ } else {
+ s->_throttleLastTime = curTime;
+ }
+ s->_throttleTrigger = false;
}
return s->r_acc;
Modified: scummvm/trunk/engines/sci/engine/state.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/state.cpp 2010-01-17 18:27:57 UTC (rev 47342)
+++ scummvm/trunk/engines/sci/engine/state.cpp 2010-01-17 18:41:28 UTC (rev 47343)
@@ -71,8 +71,9 @@
successor = 0;
- _lastAnimateCounter = 0;
- _lastAnimateTime = 0;
+ _throttleCounter = 0;
+ _throttleLastTime = 0;
+ _throttleTrigger = false;
_setCursorType = SCI_VERSION_NONE;
_doSoundType = SCI_VERSION_NONE;
Modified: scummvm/trunk/engines/sci/engine/state.h
===================================================================
--- scummvm/trunk/engines/sci/engine/state.h 2010-01-17 18:27:57 UTC (rev 47342)
+++ scummvm/trunk/engines/sci/engine/state.h 2010-01-17 18:41:28 UTC (rev 47343)
@@ -158,8 +158,9 @@
uint32 game_start_time; /**< The time at which the interpreter was started */
uint32 last_wait_time; /**< The last time the game invoked Wait() */
- uint32 _lastAnimateCounter; /**< total times kAnimate was invoked */
- uint32 _lastAnimateTime; /**< last time kAnimate was invoked */
+ uint32 _throttleCounter; /**< total times kAnimate was invoked */
+ uint32 _throttleLastTime; /**< last time kAnimate was invoked */
+ bool _throttleTrigger;
/* Kernel File IO stuff */
Modified: scummvm/trunk/engines/sci/graphics/animate.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/animate.h 2010-01-17 18:27:57 UTC (rev 47342)
+++ scummvm/trunk/engines/sci/graphics/animate.h 2010-01-17 18:41:28 UTC (rev 47343)
@@ -80,6 +80,8 @@
void addToPicDrawCels();
void addToPicDrawView(GuiResourceId viewId, int16 loopNo, int16 celNo, int16 leftPos, int16 topPos, int16 priority, int16 control);
+ uint16 getLastCastCount() { return _lastCastCount; };
+
private:
void init();
Modified: scummvm/trunk/engines/sci/graphics/gui.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/gui.cpp 2010-01-17 18:27:57 UTC (rev 47342)
+++ scummvm/trunk/engines/sci/graphics/gui.cpp 2010-01-17 18:41:28 UTC (rev 47343)
@@ -675,6 +675,9 @@
_animate->updateScreen(old_picNotValid);
_animate->restoreAndDelete(argc, argv);
+ if (_animate->getLastCastCount() > 1)
+ _s->_throttleTrigger = true;
+
_gfx->SetPort(oldPort);
}
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