aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/tools/map_extractor/System.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/tools/map_extractor/System.cpp b/src/tools/map_extractor/System.cpp
index 8e557095c45..6876b58a7cc 100644
--- a/src/tools/map_extractor/System.cpp
+++ b/src/tools/map_extractor/System.cpp
@@ -36,6 +36,11 @@
#include <unordered_map>
#include <cstdlib>
#include <cstring>
+#if TRINITY_PLATFORM == TRINITY_PLATFORM_WINDOWS
+#include <io.h>
+#else
+#include <unistd.h>
+#endif
std::shared_ptr<CASC::Storage> CascStorage;
@@ -68,6 +73,7 @@ std::unordered_map<uint32, LiquidMaterialEntry> LiquidMaterials;
std::unordered_map<uint32, LiquidObjectEntry> LiquidObjects;
std::unordered_map<uint32, LiquidTypeEntry> LiquidTypes;
std::set<uint32> CameraFileDataIds;
+bool PrintProgress = true;
boost::filesystem::path input_path;
boost::filesystem::path output_path;
@@ -1149,7 +1155,8 @@ void ExtractMaps(uint32 build)
}
// draw progress bar
- printf("Processing........................%d%%\r", (100 * (y + 1)) / WDT_MAP_SIZE);
+ if (PrintProgress)
+ printf("Processing........................%d%%\r", (100 * (y + 1)) / WDT_MAP_SIZE);
}
}
@@ -1483,6 +1490,7 @@ int main(int argc, char * arg[])
{
Trinity::Banner::Show("Map & DBC Extractor", [](char const* text) { printf("%s\n", text); }, nullptr);
+ PrintProgress = isatty(fileno(stdout));
input_path = boost::filesystem::current_path();
output_path = boost::filesystem::current_path();