diff options
| -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 | ||||
| -rw-r--r-- | engines/sci/gui/gui.cpp | 5 | ||||
| -rw-r--r-- | engines/sci/gui32/gui32.cpp | 5 | 
6 files changed, 1 insertions, 59 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();  	}  } diff --git a/engines/sci/gui/gui.cpp b/engines/sci/gui/gui.cpp index dcf3d5f706..348c596f06 100644 --- a/engines/sci/gui/gui.cpp +++ b/engines/sci/gui/gui.cpp @@ -96,11 +96,6 @@ void SciGui::wait(int16 ticks) {  	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) { diff --git a/engines/sci/gui32/gui32.cpp b/engines/sci/gui32/gui32.cpp index 261d4fca98..66b8bc696a 100644 --- a/engines/sci/gui32/gui32.cpp +++ b/engines/sci/gui32/gui32.cpp @@ -461,11 +461,6 @@ void SciGui32::wait(int16 ticks) {  	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) { | 
