diff options
author | Vladimir Menshakov | 2010-01-05 20:15:29 +0000 |
---|---|---|
committer | Vladimir Menshakov | 2010-01-05 20:15:29 +0000 |
commit | e4a6b1c455e57d24595db27e0239e01fb8bd5bf9 (patch) | |
tree | 92d5dfacc4b0d57e52584c07a7d8df224f20ff3c | |
parent | 920dac2f9d271889ffdc6c05313c89a6077ec2d2 (diff) | |
download | scummvm-rg350-e4a6b1c455e57d24595db27e0239e01fb8bd5bf9.tar.gz scummvm-rg350-e4a6b1c455e57d24595db27e0239e01fb8bd5bf9.tar.bz2 scummvm-rg350-e4a6b1c455e57d24595db27e0239e01fb8bd5bf9.zip |
added subtitle speed option
fixed bug when idle animation could be displayed in a middle of the dialogue
svn-id: r47038
-rw-r--r-- | engines/teenagent/scene.cpp | 27 | ||||
-rw-r--r-- | engines/teenagent/teenagent.cpp | 1 |
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; |