diff options
Diffstat (limited to 'engines/sword25/math')
-rw-r--r-- | engines/sword25/math/walkregion.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/engines/sword25/math/walkregion.cpp b/engines/sword25/math/walkregion.cpp index d47ed3d11f..3f4ad3c030 100644 --- a/engines/sword25/math/walkregion.cpp +++ b/engines/sword25/math/walkregion.cpp @@ -164,6 +164,17 @@ static void relaxEndPoint(const Vertex &curNodePos, } } +template<class T> +void ReverseArray(Common::Array<T> &arr) { + const uint size = arr.size(); + if (size < 2) + return; + + for (uint i = 0; i <= (size / 2 - 1); ++i) { + SWAP(arr[i], arr[size - i - 1]); + } +} + bool WalkRegion::findPath(const Vertex &start, const Vertex &end, BS_Path &path) const { // This is an implementation of Dijkstra's algorithm |