aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/sword25/kernel/kernel.h12
-rw-r--r--engines/sword25/math/walkregion.cpp11
2 files changed, 11 insertions, 12 deletions
diff --git a/engines/sword25/kernel/kernel.h b/engines/sword25/kernel/kernel.h
index aaf4d2bb16..9a115db908 100644
--- a/engines/sword25/kernel/kernel.h
+++ b/engines/sword25/kernel/kernel.h
@@ -349,18 +349,6 @@ public:
Service*(*CreateMethod)(Kernel *);
};
-template<class T>
-void ReverseArray(Common::Array<T> &Arr) {
- if (Arr.size() < 2)
- return;
-
- for (uint i = 0; i <= (Arr.size() / 2 - 1); ++i) {
- T temp = Arr[i];
- Arr[i] = Arr[Arr.size() - i - 1];
- Arr[Arr.size() - i - 1] = temp;
- }
-}
-
} // End of namespace Sword25
#endif
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