[Scummvm-git-logs] scummvm master -> 6d97288dced102611caeb960f982c8aafdcd7782

antoniou79 noreply at scummvm.org
Fri Mar 24 17:21:51 UTC 2023


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

Summary:
6d97288dce BLADERUNNER: avoid writing two times XYZ waypoints


Commit: 6d97288dced102611caeb960f982c8aafdcd7782
    https://github.com/scummvm/scummvm/commit/6d97288dced102611caeb960f982c8aafdcd7782
Author: Carlo Bramini (30959007+carlo-bramini at users.noreply.github.com)
Date: 2023-03-24T19:21:46+02:00

Commit Message:
BLADERUNNER: avoid writing two times XYZ waypoints

In my opinion, there is no need to write values into X/Y/Z pointers two times, it can be more efficient to write only once the value that we need.

Changed paths:
    engines/bladerunner/waypoints.cpp


diff --git a/engines/bladerunner/waypoints.cpp b/engines/bladerunner/waypoints.cpp
index d105c5ed0d5..d2d041ee743 100644
--- a/engines/bladerunner/waypoints.cpp
+++ b/engines/bladerunner/waypoints.cpp
@@ -32,17 +32,15 @@ Waypoints::Waypoints(BladeRunnerEngine *vm, int count) {
 }
 
 void Waypoints::getXYZ(int waypointId, float *x, float *y, float *z) const {
-	*x = 0;
-	*y = 0;
-	*z = 0;
-
 	if (waypointId < 0 || waypointId >= _count || !_waypoints[waypointId].present) {
-		return;
+		*x = 0;
+		*y = 0;
+		*z = 0;
+	} else {
+		*x = _waypoints[waypointId].position.x;
+		*y = _waypoints[waypointId].position.y;
+		*z = _waypoints[waypointId].position.z;
 	}
-
-	*x = _waypoints[waypointId].position.x;
-	*y = _waypoints[waypointId].position.y;
-	*z = _waypoints[waypointId].position.z;
 }
 
 int Waypoints::getSetId(int waypointId) const {




More information about the Scummvm-git-logs mailing list