diff options
| -rw-r--r-- | src/tools/map_extractor/CMakeLists.txt | 4 | ||||
| -rw-r--r-- | src/tools/map_extractor/System.cpp | 22 |
2 files changed, 20 insertions, 6 deletions
diff --git a/src/tools/map_extractor/CMakeLists.txt b/src/tools/map_extractor/CMakeLists.txt index 23177d0bf68..a2ceff1fa73 100644 --- a/src/tools/map_extractor/CMakeLists.txt +++ b/src/tools/map_extractor/CMakeLists.txt @@ -9,12 +9,10 @@ # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -cmake_minimum_required (VERSION 2.6) -project (TRINITY_MAP_EXTRACTOR) - file(GLOB sources *.cpp) file(GLOB loadlib_sources loadlib/*.cpp) +include_directories (${CMAKE_SOURCE_DIR}/src/server/shared) include_directories (${CMAKE_SOURCE_DIR}/externals/libmpq) include_directories (${CMAKE_SOURCE_DIR}/src/tools/map_extractor) include_directories (${CMAKE_SOURCE_DIR}/src/tools/map_extractor/loadlib) diff --git a/src/tools/map_extractor/System.cpp b/src/tools/map_extractor/System.cpp index 683f89ac11e..d5822c8d914 100644 --- a/src/tools/map_extractor/System.cpp +++ b/src/tools/map_extractor/System.cpp @@ -17,6 +17,8 @@ #include "loadlib/adt.h" #include "loadlib/wdt.h" #include <fcntl.h> +#include "revision.h" +#define _MAP_EXTRACTOR_VERSION 2 #if defined( __GNUC__ ) #define _open open @@ -33,6 +35,7 @@ #else #define OPEN_FLAGS (O_RDONLY | O_BINARY) #endif + extern ArchiveSet gOpenArchives; typedef struct @@ -120,6 +123,13 @@ void Usage(char* prg) exit(1); } +void Version(char* prg) +{ + printf("TrinityCore Rev: " _REVISION " " _BUILD_DIRECTIVE " Hash: " _HASH "\n"\ + "%s Ver: " _MAP_EXTRACTOR_VERSION, prg); + exit(0); +} + void HandleArgs(int argc, char * arg[]) { for(int c = 1; c < argc; ++c) @@ -135,13 +145,13 @@ void HandleArgs(int argc, char * arg[]) switch(arg[c][1]) { case 'i': - if(c + 1 < argc) // all ok + if (c + 1 < argc) // all ok strcpy(input_path, arg[(c++) + 1]); else Usage(arg[0]); break; case 'o': - if(c + 1 < argc) // all ok + if (c + 1 < argc) // all ok strcpy(output_path, arg[(c++) + 1]); else Usage(arg[0]); @@ -153,7 +163,7 @@ void HandleArgs(int argc, char * arg[]) Usage(arg[0]); break; case 'e': - if(c + 1 < argc) // all ok + if (c + 1 < argc) // all ok { CONF_extract=atoi(arg[(c++) + 1]); if(!(CONF_extract > 0 && CONF_extract < 4)) @@ -162,6 +172,12 @@ void HandleArgs(int argc, char * arg[]) else Usage(arg[0]); break; + case 'v': + if (c + 1 < argc) // all ok + Version(arg[0]); + else + Usage(arg[0]); + break; } } } |
