From d30eecf4e4b7766b7f46b9ca3f0c6741b08d79af Mon Sep 17 00:00:00 2001 From: Subv Date: Sun, 29 Dec 2013 15:47:23 -0500 Subject: Updated some code to use the STL --- src/tools/mesh_extractor/Utils.cpp | 10 ++-------- src/tools/mesh_extractor/Utils.h | 2 +- 2 files changed, 3 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/tools/mesh_extractor/Utils.cpp b/src/tools/mesh_extractor/Utils.cpp index c2a7577937a..0591c121895 100644 --- a/src/tools/mesh_extractor/Utils.cpp +++ b/src/tools/mesh_extractor/Utils.cpp @@ -54,15 +54,9 @@ void Utils::CreateDir( const std::string& Path ) #endif } -void Utils::Reverse(char word[]) +void Utils::Reverse(std::string& str) { - int len = strlen(word); - for (int i = 0;i < len / 2; i++) - { - word[i] ^= word[len-i-1]; - word[len-i-1] ^= word[i]; - word[i] ^= word[len-i-1]; - } + std::reverse(str.begin(), str.end()); } Vector3 Utils::ToRecast(const Vector3& val ) diff --git a/src/tools/mesh_extractor/Utils.h b/src/tools/mesh_extractor/Utils.h index ad521852271..87b6a40582a 100644 --- a/src/tools/mesh_extractor/Utils.h +++ b/src/tools/mesh_extractor/Utils.h @@ -367,7 +367,7 @@ struct MmapTileHeader class Utils { public: - static void Reverse(char word[]); + static void Reverse(std::string& str); static Vector3 ToRecast(const Vector3& val ); static std::string GetAdtPath(const std::string& world, int x, int y); static std::string FixModelPath(const std::string& path); -- cgit v1.2.3