[Scummvm-cvs-logs] SF.net SVN: scummvm:[47038] scummvm/trunk/engines/teenagent
megath at users.sourceforge.net
megath at users.sourceforge.net
Tue Jan 5 21:15:29 CET 2010
Revision: 47038
http://scummvm.svn.sourceforge.net/scummvm/?rev=47038&view=rev
Author: megath
Date: 2010-01-05 20:15:29 +0000 (Tue, 05 Jan 2010)
Log Message:
-----------
added subtitle speed option
fixed bug when idle animation could be displayed in a middle of the dialogue
Modified Paths:
--------------
scummvm/trunk/engines/teenagent/scene.cpp
scummvm/trunk/engines/teenagent/teenagent.cpp
Modified: scummvm/trunk/engines/teenagent/scene.cpp
===================================================================
--- scummvm/trunk/engines/teenagent/scene.cpp 2010-01-05 20:14:28 UTC (rev 47037)
+++ scummvm/trunk/engines/teenagent/scene.cpp 2010-01-05 20:15:29 UTC (rev 47038)
@@ -22,11 +22,12 @@
* $Id$
*/
+#include "common/config-manager.h"
+#include "common/debug.h"
+#include "common/algorithm.h"
#include "teenagent/scene.h"
#include "teenagent/resources.h"
#include "teenagent/surface.h"
-#include "common/debug.h"
-#include "common/algorithm.h"
#include "teenagent/objects.h"
#include "teenagent/teenagent.h"
#include "teenagent/dialog.h"
@@ -810,6 +811,11 @@
nextEvent();
restart = true;
}
+
+ if (busy) {
+ _idle_timer = 0;
+ teenagent_idle.resetIndex();
+ }
} while (restart);
for (Sounds::iterator i = sounds.begin(); i != sounds.end();) {
@@ -1124,11 +1130,18 @@
}
uint Scene::messageDuration(const Common::String &str) {
- uint chars = str.size();
- //to be discovered
- if (chars < 10)
- chars = 10;
- return chars;
+ //original game uses static delays: 100-slow, 50, 20 and 1 tick - crazy speed.
+ //total delay = total message length * delay / 8 + 60.
+ uint total_width = str.size();
+
+ int speed = Common::ConfigManager::instance().getInt("talkspeed");
+ if (speed < 0)
+ speed = 60;
+ uint delay_delta = 1 + (255 - speed) * 99 / 255;
+
+ uint delay = 60 + (total_width * delay_delta) / 8;
+ //debug(0, "delay = %u, delta: %u", delay, delay_delta);
+ return delay / 10;
}
Modified: scummvm/trunk/engines/teenagent/teenagent.cpp
===================================================================
--- scummvm/trunk/engines/teenagent/teenagent.cpp 2010-01-05 20:14:28 UTC (rev 47037)
+++ scummvm/trunk/engines/teenagent/teenagent.cpp 2010-01-05 20:15:29 UTC (rev 47038)
@@ -894,6 +894,7 @@
case kSupportsRTL:
case kSupportsLoadingDuringRuntime:
case kSupportsSavingDuringRuntime:
+ case kSupportsSubtitleOptions:
return true;
default:
return false;
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