From 2eb6bba7bd5240f0e97a03f55da96967ef2ac4f1 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Tue, 15 Jan 2019 01:28:07 +0100 Subject: BLADERUNNER: Disable pathfinding by default. So, peterkohaut could continue his debugging sessions. --- engines/bladerunner/obstacles.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'engines/bladerunner/obstacles.cpp') diff --git a/engines/bladerunner/obstacles.cpp b/engines/bladerunner/obstacles.cpp index 73b3681209..9a8792e361 100644 --- a/engines/bladerunner/obstacles.cpp +++ b/engines/bladerunner/obstacles.cpp @@ -32,6 +32,8 @@ #include "common/debug.h" +#define DISABLE_PATHFINDING 1 + #define WITHIN_TOLERANCE(a, b) (((a) - 0.009) < (b) && ((a) + 0.009) > (b)) namespace BladeRunner { @@ -315,6 +317,14 @@ float Obstacles::getLength(float x0, float z0, float x1, float z1) { return fabs(x1 - x0); } +#if DISABLE_PATHFINDING +bool Obstacles::findNextWaypoint(const Vector3 &from, const Vector3 &to, Vector3 *next) { + *next = to; + + return true; +} +#else + bool Obstacles::findNextWaypoint(const Vector3 &from, const Vector3 &to, Vector3 *next) { static int recursionLevel = 0; static bool polygonVisited[kPolygonCount]; @@ -426,6 +436,7 @@ bool Obstacles::findNextWaypoint(const Vector3 &from, const Vector3 &to, Vector3 *next = Vector3(_path[0].x, from.y, _path[0].y); return true; } +#endif bool Obstacles::findIntersectionNearest(int polygonIndex, Vector2 from, Vector2 to, int *outVertexIndex, float *outDistance, Vector2 *out) const -- cgit v1.2.3