diff options
| author | Paul Gilbert | 2015-06-14 12:10:26 -0400 | 
|---|---|---|
| committer | Paul Gilbert | 2015-06-14 12:10:26 -0400 | 
| commit | 724fe7e4f68b796bd0e5b79cd28c873ba32cdff4 (patch) | |
| tree | 0ab82e2629db4f1c2d0b2c70479730edb8a7e5ba /engines/sherlock/people.cpp | |
| parent | 275064ad23a46d5c034c75201249511e6026556d (diff) | |
| download | scummvm-rg350-724fe7e4f68b796bd0e5b79cd28c873ba32cdff4.tar.gz scummvm-rg350-724fe7e4f68b796bd0e5b79cd28c873ba32cdff4.tar.bz2 scummvm-rg350-724fe7e4f68b796bd0e5b79cd28c873ba32cdff4.zip  | |
SHERLOCK: Move _walkDest from People to Person
Diffstat (limited to 'engines/sherlock/people.cpp')
| -rw-r--r-- | engines/sherlock/people.cpp | 19 | 
1 files changed, 9 insertions, 10 deletions
diff --git a/engines/sherlock/people.cpp b/engines/sherlock/people.cpp index 0db687c556..7306ae96d0 100644 --- a/engines/sherlock/people.cpp +++ b/engines/sherlock/people.cpp @@ -71,7 +71,6 @@ Person::Person() : Sprite() {  }  void Person::goAllTheWay() { -	People &people = *_vm->_people;  	Scene &scene = *_vm->_scene;  	Common::Point srcPt = getSourcePoint(); @@ -81,20 +80,20 @@ void Person::goAllTheWay() {  		_srcZone = scene.closestZone(srcPt);  	// Get the zone of the destination -	_destZone = scene.whichZone(people._walkDest); +	_destZone = scene.whichZone(_walkDest);  	if (_destZone == -1) { -		_destZone = scene.closestZone(people._walkDest); +		_destZone = scene.closestZone(_walkDest);  		// The destination isn't in a zone -		if (people._walkDest.x >= (SHERLOCK_SCREEN_WIDTH - 1)) -			people._walkDest.x = SHERLOCK_SCREEN_WIDTH - 2; +		if (_walkDest.x >= (SHERLOCK_SCREEN_WIDTH - 1)) +			_walkDest.x = SHERLOCK_SCREEN_WIDTH - 2;  		// Trace a line between the centroid of the found closest zone to  		// the destination, to find the point at which the zone will be left  		const Common::Rect &destRect = scene._zones[_destZone];  		const Common::Point destCenter((destRect.left + destRect.right) / 2,  			(destRect.top + destRect.bottom) / 2); -		const Common::Point delta = people._walkDest - destCenter; +		const Common::Point delta = _walkDest - destCenter;  		Point32 pt(destCenter.x * FIXED_INT_MULTIPLIER, destCenter.y * FIXED_INT_MULTIPLIER);  		// Move along the line until the zone is left @@ -104,7 +103,7 @@ void Person::goAllTheWay() {  		// Set the new walk destination to the last point that was in the  		// zone just before it was left -		people._walkDest = Common::Point((pt.x - delta.x * 2) / FIXED_INT_MULTIPLIER, +		_walkDest = Common::Point((pt.x - delta.x * 2) / FIXED_INT_MULTIPLIER,  			(pt.y - delta.y * 2) / FIXED_INT_MULTIPLIER);  	} @@ -144,10 +143,10 @@ void Person::goAllTheWay() {  			}  			// Final position -			_walkTo.push(people._walkDest); +			_walkTo.push(_walkDest);  			// Start walking -			people._walkDest = _walkTo.pop(); +			_walkDest = _walkTo.pop();  			setWalking();  		}  	} @@ -162,7 +161,7 @@ void Person::walkToCoords(const Point32 &destPos, int destDir) {  	CursorId oldCursor = events.getCursor();  	events.setCursor(WAIT); -	people._walkDest = Common::Point(destPos.x / FIXED_INT_MULTIPLIER + 10, destPos.y / FIXED_INT_MULTIPLIER); +	_walkDest = Common::Point(destPos.x / FIXED_INT_MULTIPLIER + 10, destPos.y / FIXED_INT_MULTIPLIER);  	people._allowWalkAbort = true;  	goAllTheWay();  | 
