Fix use of vmap3extractor on 64-bit *nix-systems
--HG-- branch : trunk
This commit is contained in:
Regular → Executable
+10
-3
@@ -11,19 +11,26 @@
|
||||
|
||||
file(GLOB sources *.cpp)
|
||||
|
||||
include_directories (${CMAKE_SOURCE_DIR}/externals/libmpq)
|
||||
# uncomment next line to disable debug mode
|
||||
add_definitions("-DIOMAP_DEBUG")
|
||||
|
||||
# build setup currently only supports libmpq 0.4.x
|
||||
add_definitions("-DUSE_LIBMPQ04")
|
||||
add_definitions("-Wall")
|
||||
add_definitions("-ggdb")
|
||||
add_definitions("-O3")
|
||||
|
||||
add_executable(vmap3extractor ${sources})
|
||||
|
||||
if(WIN32)
|
||||
target_link_libraries(vmap3extractor
|
||||
libmpq
|
||||
mpq
|
||||
bzip2
|
||||
zlib
|
||||
)
|
||||
else()
|
||||
target_link_libraries(vmap3extractor
|
||||
libmpq
|
||||
mpq
|
||||
${BZIP2_LIBRARIES}
|
||||
${ZLIB_LIBRARIES}
|
||||
)
|
||||
|
||||
@@ -3,26 +3,28 @@
|
||||
|
||||
#ifdef WIN32
|
||||
typedef __int64 int64;
|
||||
typedef long int32;
|
||||
typedef short int16;
|
||||
typedef char int8;
|
||||
typedef __int32 int32;
|
||||
typedef __int16 int16;
|
||||
typedef __int8 int8;
|
||||
typedef unsigned __int64 uint64;
|
||||
typedef unsigned long uint32;
|
||||
typedef unsigned short uint16;
|
||||
typedef unsigned char uint8;
|
||||
typedef unsigned __int32 uint32;
|
||||
typedef unsigned __int16 uint16;
|
||||
typedef unsigned __int8 uint8;
|
||||
#else
|
||||
#include <stdint.h>
|
||||
#ifndef uint64_t
|
||||
#ifdef __linux__
|
||||
#include <linux/types.h>
|
||||
#endif
|
||||
#endif
|
||||
typedef int64_t int64;
|
||||
typedef long int32;
|
||||
typedef short int16;
|
||||
typedef char int8;
|
||||
typedef int32_t int32;
|
||||
typedef int16_t int16;
|
||||
typedef int8_t int8;
|
||||
typedef uint64_t uint64;
|
||||
typedef unsigned long uint32;
|
||||
typedef unsigned short uint16;
|
||||
typedef unsigned char uint8;
|
||||
typedef uint32_t uint32;
|
||||
typedef uint16_t uint16;
|
||||
typedef uint8_t uint8;
|
||||
#endif
|
||||
|
||||
#define FILE_FORMAT_VERSION 18
|
||||
|
||||
@@ -50,7 +50,7 @@ MPQFile::MPQFile(const char* filename):
|
||||
{
|
||||
mpq_archive *mpq_a = (*i)->mpq_a;
|
||||
|
||||
uint32_t filenum;
|
||||
uint32 filenum;
|
||||
if(libmpq__file_number(mpq_a, filename, &filenum)) continue;
|
||||
libmpq__off_t transferred;
|
||||
libmpq__file_unpacked_size(mpq_a, filenum, &size);
|
||||
|
||||
@@ -24,7 +24,7 @@ public:
|
||||
void close();
|
||||
|
||||
void GetFileListTo(vector<string>& filelist) {
|
||||
uint32_t filenum;
|
||||
uint32 filenum;
|
||||
if(libmpq__file_number(mpq_a, "(listfile)", &filenum)) return;
|
||||
libmpq__off_t size, transferred;
|
||||
libmpq__file_unpacked_size(mpq_a, filenum, &size);
|
||||
|
||||
@@ -56,6 +56,7 @@ bool preciseVectorData = false;
|
||||
|
||||
//static const char * szWorkDirMaps = ".\\Maps";
|
||||
const char * szWorkDirWmo = "./Buildings";
|
||||
|
||||
// Local testing functions
|
||||
|
||||
static void clreol()
|
||||
@@ -103,7 +104,7 @@ void ReadLiquidTypeTableDBC()
|
||||
printf("Done! (%u LiqTypes loaded)\n", (unsigned int)LiqType_count);
|
||||
}
|
||||
|
||||
bool ExtractWmo()
|
||||
int ExtractWmo()
|
||||
{
|
||||
char szLocalFile[1024] = "";
|
||||
bool success=true;
|
||||
@@ -234,10 +235,10 @@ void ParsMapFiles()
|
||||
delete ADT;
|
||||
}
|
||||
}
|
||||
printf("#");
|
||||
fflush(stdout);
|
||||
printf("#");
|
||||
fflush(stdout);
|
||||
}
|
||||
printf("]\n");
|
||||
printf("]\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -250,9 +251,8 @@ void getGamePath()
|
||||
LONG l;
|
||||
s = sizeof(input_path);
|
||||
memset(input_path,0,s);
|
||||
l = RegOpenKeyExA(HKEY_LOCAL_MACHINE,"SOFTWARE\\Blizzard Entertainment\\World of Warcraft",0,KEY_QUERY_VALUE,&key);
|
||||
//l = RegOpenKeyEx(HKEY_LOCAL_MACHINE,"SOFTWARE\\Blizzard Entertainment\\Burning Crusade Closed Beta",0,KEY_QUERY_VALUE,&key);
|
||||
l = RegQueryValueExA(key,"InstallPath",0,&t,(LPBYTE)input_path,&s);
|
||||
l = RegOpenKeyEx(HKEY_LOCAL_MACHINE,"SOFTWARE\\Blizzard Entertainment\\World of Warcraft",0,KEY_QUERY_VALUE,&key);
|
||||
l = RegQueryValueEx(key,"InstallPath",0,&t,(LPBYTE)input_path,&s);
|
||||
RegCloseKey(key);
|
||||
if (strlen(input_path) > 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user