aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/teenagent/scene.cpp27
-rw-r--r--engines/teenagent/teenagent.cpp1
2 files changed, 21 insertions, 7 deletions
diff --git a/engines/teenagent/scene.cpp b/engines/teenagent/scene.cpp
index 976a1770b8..61a99c3732 100644
--- a/engines/teenagent/scene.cpp
+++ b/engines/teenagent/scene.cpp
@@ -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 @@ bool Scene::render() {
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 @@ Common::Point Scene::messagePosition(const Common::String &str, Common::Point po
}
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;
}
diff --git a/engines/teenagent/teenagent.cpp b/engines/teenagent/teenagent.cpp
index 3bed225028..8c83695a7a 100644
--- a/engines/teenagent/teenagent.cpp
+++ b/engines/teenagent/teenagent.cpp
@@ -894,6 +894,7 @@ bool TeenAgentEngine::hasFeature(EngineFeature f) const {
case kSupportsRTL:
case kSupportsLoadingDuringRuntime:
case kSupportsSavingDuringRuntime:
+ case kSupportsSubtitleOptions:
return true;
default:
return false;