[Scummvm-cvs-logs] scummvm master -> 4a38e2618dc94df70342db7a25c0d6f87267984e

bluegr bluegr at gmail.com
Thu Oct 22 10:11:12 CEST 2015


This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
0f3e7531c1 NEVERHOOD: Possible fix for bad car behaviour
42bf369d68 NEVERHOOD: Pass NPoint as position instead of X in two more cases
4a38e2618d Merge pull request #621 from eriktorbjorn/neverhood-car


Commit: 0f3e7531c1999da4c424481afd42c5380ec10103
    https://github.com/scummvm/scummvm/commit/0f3e7531c1999da4c424481afd42c5380ec10103
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2015-10-11T08:00:23+02:00

Commit Message:
NEVERHOOD: Possible fix for bad car behaviour

This is something I found when trying the savegame from bug #6932,
but I still don't know if it actually is that bug.

>From what I understand, there are two different cases in the
moveCarToPoint() method: One where you click on a different
section on a track than you're on, and one where you click on the
same section on the track that you're on.

In the latter case, it sends message 0x2004 to the car, which is
then handled by AsCommonCar::handleMessage(). That one will assume
that the parameter is a point, but this can also be encoded as an
integer with 16 bits for the X coordinate and 16 bits for the Y
coordinate. See MessageParam::asPoint().

If we only pass an X coordinate to the message, the Y coordinate
is assumed to be 0, and we do this in a couple of places. I do not
know the exact implications of that, but in the two cases I've
changed here, it meant that clicking on the track below the car
would still make it go up, because it thought you were travelling
towards the top of the screen.

So I think this is the appropriate fix, but even if it is, I do
not know if it's enough or if it should be changed in other places
as well.

Changed paths:
    engines/neverhood/modules/module2700.cpp



diff --git a/engines/neverhood/modules/module2700.cpp b/engines/neverhood/modules/module2700.cpp
index a510c02..8b8bb5c 100644
--- a/engines/neverhood/modules/module2700.cpp
+++ b/engines/neverhood/modules/module2700.cpp
@@ -773,7 +773,7 @@ void Scene2702::moveCarToPoint(NPoint pt) {
 			sendMessage(_asCar, 0x2003, _trackPoints->size() - 1);
 	} else {
 		_newTrackIndex = -1;
-		sendMessage(_asCar, 0x2004, pt.x);
+		sendMessage(_asCar, 0x2004, pt);
 	}
 }
 
@@ -1099,7 +1099,7 @@ void Scene2706::moveCarToPoint(NPoint pt) {
 			sendMessage(_asCar, 0x2003, 0);
 	} else {
 		_newTrackIndex = -1;
-		sendMessage(_asCar, 0x2004, pt.x);
+		sendMessage(_asCar, 0x2004, pt);
 	}
 }
 


Commit: 42bf369d689545b8a221635ab9d7522c259c5edd
    https://github.com/scummvm/scummvm/commit/42bf369d689545b8a221635ab9d7522c259c5edd
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2015-10-18T11:37:40+02:00

Commit Message:
NEVERHOOD: Pass NPoint as position instead of X in two more cases

According to johndoe it's correct to pass the entire coordinate,
rather than just X, to the car in these cases as well. I can't
tell any difference at all in the behavior, but I guess it doesn't
hurt either. After all, we can easily zero the Y coordinate, if we
ever want to.

Changed paths:
    engines/neverhood/modules/module2700.cpp
    engines/neverhood/modules/module2700.h



diff --git a/engines/neverhood/modules/module2700.cpp b/engines/neverhood/modules/module2700.cpp
index 8b8bb5c..e0c6509 100644
--- a/engines/neverhood/modules/module2700.cpp
+++ b/engines/neverhood/modules/module2700.cpp
@@ -761,7 +761,7 @@ void Scene2702::moveCarToPoint(NPoint pt) {
 	_tracks.findTrackPoint(pt, minMatchTrackIndex, minMatchDistance, _dataResource);
 	if (minMatchTrackIndex >= 0 && minMatchTrackIndex != _currTrackIndex) {
 		_newTrackIndex = minMatchTrackIndex;
-		_newTrackDestX = pt.x;
+		_newTrackDest = pt;
 		if (_isUpperTrack) {
 			if (_currTrackIndex == 0)
 				sendMessage(_asCar, 0x2003, _trackPoints->size() - 1);
@@ -790,7 +790,7 @@ void Scene2702::changeTrack() {
 		sendMessage(_asCar, NM_POSITION_CHANGE, 0);
 	else
 		sendMessage(_asCar, NM_POSITION_CHANGE, _trackPoints->size() - 1);
-	sendMessage(_asCar, 0x2004, _newTrackDestX);
+	sendMessage(_asCar, 0x2004, _newTrackDest);
 	_newTrackIndex = -1;
 }
 
@@ -1092,7 +1092,7 @@ void Scene2706::moveCarToPoint(NPoint pt) {
 	_tracks.findTrackPoint(pt, minMatchTrackIndex, minMatchDistance, _dataResource);
 	if (minMatchTrackIndex >= 0 && minMatchTrackIndex != _currTrackIndex) {
 		_newTrackIndex = minMatchTrackIndex;
-		_newTrackDestX = pt.x;
+		_newTrackDest = pt;
 		if (_currTrackIndex == 0)
 			sendMessage(_asCar, 0x2003, _trackPoints->size() - 1);
 		else
@@ -1111,7 +1111,7 @@ void Scene2706::changeTrack() {
 		sendMessage(_asCar, NM_POSITION_CHANGE, _trackPoints->size() - 1);
 	else
 		sendMessage(_asCar, NM_POSITION_CHANGE, 0);
-	sendMessage(_asCar, 0x2004, _newTrackDestX);
+	sendMessage(_asCar, 0x2004, _newTrackDest);
 	_newTrackIndex = -1;
 }
 
diff --git a/engines/neverhood/modules/module2700.h b/engines/neverhood/modules/module2700.h
index 9ac2159..ece8866 100644
--- a/engines/neverhood/modules/module2700.h
+++ b/engines/neverhood/modules/module2700.h
@@ -76,7 +76,7 @@ protected:
 	Sprite *_asCarShadow;
 	Sprite *_asCarTrackShadow;
 	Sprite *_asCarConnectorShadow;
-	int16 _newTrackDestX;
+	NPoint _newTrackDest;
 	bool _isInLight;
 	int _currTrackIndex, _newTrackIndex;
 	bool _isUpperTrack;
@@ -132,7 +132,7 @@ protected:
 	Sprite *_asCarConnector;
 	Sprite *_asCarTrackShadow;
 	Sprite *_asCarConnectorShadow;
-	int16 _newTrackDestX;
+	NPoint _newTrackDest;
 	int _currTrackIndex, _newTrackIndex;
 	Tracks _tracks;
 	NPointArray *_trackPoints;


Commit: 4a38e2618dc94df70342db7a25c0d6f87267984e
    https://github.com/scummvm/scummvm/commit/4a38e2618dc94df70342db7a25c0d6f87267984e
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2015-10-22T11:10:42+03:00

Commit Message:
Merge pull request #621 from eriktorbjorn/neverhood-car

NEVERHOOD: Possible fix for bad car behaviour

Changed paths:
    engines/neverhood/modules/module2700.cpp
    engines/neverhood/modules/module2700.h









More information about the Scummvm-git-logs mailing list