[Scummvm-cvs-logs] SF.net SVN: scummvm:[45094] scummvm/trunk/engines/sci
m_kiewitz at users.sourceforge.net
m_kiewitz at users.sourceforge.net
Wed Oct 14 23:48:52 CEST 2009
Revision: 45094
http://scummvm.svn.sourceforge.net/scummvm/?rev=45094&view=rev
Author: m_kiewitz
Date: 2009-10-14 21:48:52 +0000 (Wed, 14 Oct 2009)
Log Message:
-----------
SCI: removed speed throttler (cause of kAnimate change)
Modified Paths:
--------------
scummvm/trunk/engines/sci/engine/kgraphics.cpp
scummvm/trunk/engines/sci/engine/state.cpp
scummvm/trunk/engines/sci/engine/state.h
scummvm/trunk/engines/sci/engine/vm.cpp
scummvm/trunk/engines/sci/gui/gui.cpp
scummvm/trunk/engines/sci/gui32/gui32.cpp
Modified: scummvm/trunk/engines/sci/engine/kgraphics.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kgraphics.cpp 2009-10-14 21:45:16 UTC (rev 45093)
+++ scummvm/trunk/engines/sci/engine/kgraphics.cpp 2009-10-14 21:48:52 UTC (rev 45094)
@@ -354,9 +354,6 @@
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
Modified: scummvm/trunk/engines/sci/engine/state.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/state.cpp 2009-10-14 21:45:16 UTC (rev 45093)
+++ scummvm/trunk/engines/sci/engine/state.cpp 2009-10-14 21:48:52 UTC (rev 45094)
@@ -106,7 +106,7 @@
successor = 0;
- speedThrottler = new SpeedThrottler(getSciVersion());
+ _lastAnimateTime = 0;
_setCursorType = SCI_VERSION_AUTODETECT;
_doSoundType = SCI_VERSION_AUTODETECT;
@@ -116,7 +116,6 @@
}
EngineState::~EngineState() {
- delete speedThrottler;
delete _msgState;
}
Modified: scummvm/trunk/engines/sci/engine/state.h
===================================================================
--- scummvm/trunk/engines/sci/engine/state.h 2009-10-14 21:45:16 UTC (rev 45093)
+++ scummvm/trunk/engines/sci/engine/state.h 2009-10-14 21:48:52 UTC (rev 45094)
@@ -113,46 +113,6 @@
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 @@
MessageState *_msgState;
- SpeedThrottler *speedThrottler;
-
EngineState *successor; /**< Successor of this state: Used for restoring */
Common::String getLanguageString(const char *str, kLanguage lang) const;
Modified: scummvm/trunk/engines/sci/engine/vm.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/vm.cpp 2009-10-14 21:45:16 UTC (rev 45093)
+++ scummvm/trunk/engines/sci/engine/vm.cpp 2009-10-14 21:48:52 UTC (rev 45094)
@@ -1404,8 +1404,6 @@
}
//#endif
++script_step_counter;
-
- s->speedThrottler->postInstruction();
}
}
Modified: scummvm/trunk/engines/sci/gui/gui.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui.cpp 2009-10-14 21:45:16 UTC (rev 45093)
+++ scummvm/trunk/engines/sci/gui/gui.cpp 2009-10-14 21:48:52 UTC (rev 45094)
@@ -96,11 +96,6 @@
ticks *= g_debug_sleeptime_factor;
gfxop_sleep(_s->gfx_state, ticks * 1000 / 60);
-
-
- // Reset speed throttler: Game is playing along nicely anyway
- if (ticks > 0)
- _s->speedThrottler->reset();
}
void SciGui::setPort(uint16 portPtr) {
Modified: scummvm/trunk/engines/sci/gui32/gui32.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui32/gui32.cpp 2009-10-14 21:45:16 UTC (rev 45093)
+++ scummvm/trunk/engines/sci/gui32/gui32.cpp 2009-10-14 21:48:52 UTC (rev 45094)
@@ -461,11 +461,6 @@
ticks *= g_debug_sleeptime_factor;
gfxop_sleep(_s->gfx_state, ticks * 1000 / 60);
-
-
- // Reset speed throttler: Game is playing along nicely anyway
- if (ticks > 0)
- _s->speedThrottler->reset();
}
void SciGui32::setPort(uint16 portPtr) {
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