diff options
| author | richiesams | 2013-08-16 10:44:35 -0500 | 
|---|---|---|
| committer | richiesams | 2013-08-16 10:44:35 -0500 | 
| commit | e6aa2d15ca75788065012ea64e881277ef4e5565 (patch) | |
| tree | e43ac0dacc028f012fcba3b4ed39658942fcd735 | |
| parent | bdd9b18292105b2cd8d894d2e042accecd001913 (diff) | |
| download | scummvm-rg350-e6aa2d15ca75788065012ea64e881277ef4e5565.tar.gz scummvm-rg350-e6aa2d15ca75788065012ea64e881277ef4e5565.tar.bz2 scummvm-rg350-e6aa2d15ca75788065012ea64e881277ef4e5565.zip  | |
ZVISION: Only skip the background moving if velocity is 0 instead of returning and skipping everything
| -rw-r--r-- | engines/zvision/render_manager.cpp | 21 | 
1 files changed, 10 insertions, 11 deletions
diff --git a/engines/zvision/render_manager.cpp b/engines/zvision/render_manager.cpp index a2ae7e8b28..31b54b4a15 100644 --- a/engines/zvision/render_manager.cpp +++ b/engines/zvision/render_manager.cpp @@ -60,22 +60,21 @@ RenderManager::~RenderManager() {  void RenderManager::update(uint deltaTimeInMillis) {  	// An inverse velocity of 0 would be infinitely fast, so we'll let 0 mean no velocity. -	if (_backgroundInverseVelocity == 0) -		return; +	if (_backgroundInverseVelocity != 0) { +		_accumulatedVelocityMilliseconds += deltaTimeInMillis; -	_accumulatedVelocityMilliseconds += deltaTimeInMillis; +		int absVelocity = abs(_backgroundInverseVelocity); -	int absVelocity = abs(_backgroundInverseVelocity); +		int numberOfSteps = 0; +		while (_accumulatedVelocityMilliseconds >= absVelocity) { +			_accumulatedVelocityMilliseconds -= absVelocity; +			numberOfSteps++; +		} -	int numberOfSteps = 0; -	while (_accumulatedVelocityMilliseconds >= absVelocity) { -		_accumulatedVelocityMilliseconds -= absVelocity; -		numberOfSteps++; +		// Choose the direction of movement using the sign of the velocity +		moveBackground(_backgroundInverseVelocity < 0 ? -numberOfSteps : numberOfSteps);  	} -	// Choose the direction of movement using the sign of the velocity -	moveBackground(_backgroundInverseVelocity < 0 ? -numberOfSteps : numberOfSteps); -  	// Warp the entire backbuffer  	_renderTable.mutateImage((uint16 *)_backbuffer.getBasePtr(0, 0), _warpedBackbuffer, _workingWidth, _workingHeight);  | 
