[Scummvm-cvs-logs] SF.net SVN: scummvm:[51544] scummvm/trunk/engines/sci/graphics/animate.cpp
m_kiewitz at users.sourceforge.net
m_kiewitz at users.sourceforge.net
Sat Jul 31 18:41:42 CEST 2010
Revision: 51544
http://scummvm.svn.sourceforge.net/scummvm/?rev=51544&view=rev
Author: m_kiewitz
Date: 2010-07-31 16:41:42 +0000 (Sat, 31 Jul 2010)
Log Message:
-----------
SCI: adding detection for benchmark views
and enable speed throttler when just one regular cel was drawn, fixes eco quest 2 ego getting light-speed fast in village (bug #3036805)
=this could cause regressions like disabled animations in games=
Modified Paths:
--------------
scummvm/trunk/engines/sci/graphics/animate.cpp
Modified: scummvm/trunk/engines/sci/graphics/animate.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/animate.cpp 2010-07-31 16:20:16 UTC (rev 51543)
+++ scummvm/trunk/engines/sci/graphics/animate.cpp 2010-07-31 16:41:42 UTC (rev 51544)
@@ -618,14 +618,42 @@
updateScreen(old_picNotValid);
restoreAndDelete(argc, argv);
- if (_lastCastData.size() > 1)
- _s->_throttleTrigger = true;
-
// We update the screen here as well, some scenes like EQ1 credits run w/o calling kGetEvent thus we wouldn't update
// screen at all
g_sci->getEventManager()->updateScreen();
_ports->setPort(oldPort);
+
+ // Now trigger speed throttler
+ switch (_lastCastData.size()) {
+ case 0:
+ // No entries drawn -> no speed throttler triggering
+ break;
+ case 1: {
+ // One entry drawn -> check if that entry was a speed benchmark view, if not enable speed throttler
+ AnimateEntry *onlyCast = &_lastCastData[0];
+ // first loop and first cel used?
+ if ((onlyCast->loopNo == 0) && (onlyCast->celNo == 0)) {
+ // and that cel has a known speed benchmark resolution
+ int16 onlyHeight = onlyCast->celRect.height();
+ int16 onlyWidth = onlyCast->celRect.width();
+ if (((onlyWidth == 12) && (onlyHeight == 35)) || // regular benchmark view ("fred", "Speedy", "ego")
+ ((onlyWidth == 29) && (onlyHeight == 45)) || // King's Quest 5 french "fred"
+ ((onlyWidth == 1) && (onlyHeight == 1))) { // Laura Bow 2 Talkie
+ // check further that there is only one cel in that view
+ GfxView *onlyView = _cache->getView(onlyCast->viewId);
+ if ((onlyView->getLoopCount() == 1) && (onlyView->getCelCount(0)))
+ return;
+ }
+ }
+ _s->_throttleTrigger = true;
+ break;
+ }
+ default:
+ // More than 1 entry drawn -> time for speed throttling
+ _s->_throttleTrigger = true;
+ break;
+ }
}
void GfxAnimate::addToPicSetPicNotValid() {
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