diff options
author | Martin Kiewitz | 2009-10-14 21:48:52 +0000 |
---|---|---|
committer | Martin Kiewitz | 2009-10-14 21:48:52 +0000 |
commit | a7e6f50ede79a0f7f1ca89ae6900d838cf4fe334 (patch) | |
tree | ed1d2b9cbb309a376576efd8e2f30f28f136aa14 /engines/sci/engine | |
parent | a7e51b8276df7123c6471c1bf212729e181b4642 (diff) | |
download | scummvm-rg350-a7e6f50ede79a0f7f1ca89ae6900d838cf4fe334.tar.gz scummvm-rg350-a7e6f50ede79a0f7f1ca89ae6900d838cf4fe334.tar.bz2 scummvm-rg350-a7e6f50ede79a0f7f1ca89ae6900d838cf4fe334.zip |
SCI: removed speed throttler (cause of kAnimate change)
svn-id: r45094
Diffstat (limited to 'engines/sci/engine')
-rw-r--r-- | engines/sci/engine/kgraphics.cpp | 3 | ||||
-rw-r--r-- | engines/sci/engine/state.cpp | 3 | ||||
-rw-r--r-- | engines/sci/engine/state.h | 42 | ||||
-rw-r--r-- | engines/sci/engine/vm.cpp | 2 |
4 files changed, 1 insertions, 49 deletions
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp index 8d26eda207..4f667d4fc5 100644 --- a/engines/sci/engine/kgraphics.cpp +++ b/engines/sci/engine/kgraphics.cpp @@ -354,9 +354,6 @@ reg_t kWait(EngineState *s, int argc, reg_t *argv) { sleep_time *= g_debug_sleeptime_factor; gfxop_sleep(s->gfx_state, sleep_time * 1000 / 60); - // Reset speed throttler: Game is playing along nicely anyway - if (sleep_time > 0) - s->speedThrottler->reset(); #endif // FIXME: we should not be asking from the GUI to wait. The kernel sounds diff --git a/engines/sci/engine/state.cpp b/engines/sci/engine/state.cpp index 3848c512b6..3f8eae5e49 100644 --- a/engines/sci/engine/state.cpp +++ b/engines/sci/engine/state.cpp @@ -106,7 +106,7 @@ EngineState::EngineState(ResourceManager *res, Kernel *kernel, Vocabulary *voc, successor = 0; - speedThrottler = new SpeedThrottler(getSciVersion()); + _lastAnimateTime = 0; _setCursorType = SCI_VERSION_AUTODETECT; _doSoundType = SCI_VERSION_AUTODETECT; @@ -116,7 +116,6 @@ EngineState::EngineState(ResourceManager *res, Kernel *kernel, Vocabulary *voc, } EngineState::~EngineState() { - delete speedThrottler; delete _msgState; } diff --git a/engines/sci/engine/state.h b/engines/sci/engine/state.h index 6b0aeb6028..204867b714 100644 --- a/engines/sci/engine/state.h +++ b/engines/sci/engine/state.h @@ -113,46 +113,6 @@ public: bool isOpen() const; }; - -class SpeedThrottler { -public: - enum { - kSegmentLength = 20 /**< Time segment length in ms */ - }; - - SpeedThrottler(SciVersion version) { - if (version >= SCI_VERSION_1_1) - _maxInstructions = 3300; - else if (version >= SCI_VERSION_1_EARLY) - _maxInstructions = 2200; - else - _maxInstructions = 1100; - reset(); - } - - void postInstruction() { - if (++_curInstructions >= _maxInstructions) { - uint32 time = g_system->getMillis(); - uint32 elapsed = time - _timestamp; - - if (elapsed < kSegmentLength) - g_system->delayMillis(kSegmentLength - elapsed); - - reset(); - } - } - - void reset() { - _timestamp = g_system->getMillis(); - _curInstructions = 0; - } - -private: - uint32 _timestamp; /**< Timestamp of current time segment */ - uint32 _maxInstructions; /**< Maximum amount of instructions per time segment */ - uint32 _curInstructions; /**< Amount of instructions executed in current time segment */ -}; - struct EngineState : public Common::Serializable { public: EngineState(ResourceManager *res, Kernel *kernel, Vocabulary *voc, SciGui *gui, SciGuiCursor *cursor); @@ -319,8 +279,6 @@ public: MessageState *_msgState; - SpeedThrottler *speedThrottler; - EngineState *successor; /**< Successor of this state: Used for restoring */ Common::String getLanguageString(const char *str, kLanguage lang) const; diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp index c70fbbb764..2fd81b4b40 100644 --- a/engines/sci/engine/vm.cpp +++ b/engines/sci/engine/vm.cpp @@ -1404,8 +1404,6 @@ void run_vm(EngineState *s, int restoring) { } //#endif ++script_step_counter; - - s->speedThrottler->postInstruction(); } } |