[12771] Fixed possible path mismatch on UNIX system in vmap extractor

also initialized work for clang compiler
This commit is contained in:
sanctum32 2013-12-30 23:15:54 +02:00 committed by Antz
parent 5b69c5ba98
commit 6dbe82b20a
4 changed files with 12 additions and 15 deletions

View file

@ -113,7 +113,7 @@ bool LoadLocaleMPQFile(int locale)
{ {
TCHAR buff[512]; TCHAR buff[512];
memset(buff, 0, sizeof(buff)); memset(buff, 0, sizeof(buff));
_stprintf(buff, _T("%s%s/locale-%s.MPQ"), input_path, LocalesT[locale], LocalesT[locale]); _stprintf(buff, _T("%s/Data/%s/locale-%s.MPQ"), input_path, LocalesT[locale], LocalesT[locale]);
if (!SFileOpenArchive(buff, 0, MPQ_OPEN_READ_ONLY, &LocaleMpq)) if (!SFileOpenArchive(buff, 0, MPQ_OPEN_READ_ONLY, &LocaleMpq))
{ {
if (GetLastError() != ERROR_FILE_NOT_FOUND) if (GetLastError() != ERROR_FILE_NOT_FOUND)
@ -128,12 +128,12 @@ bool LoadLocaleMPQFile(int locale)
if (Builds[i] > LAST_DBC_IN_DATA_BUILD) if (Builds[i] > LAST_DBC_IN_DATA_BUILD)
{ {
prefix = ""; prefix = "";
_stprintf(buff, _T("%s%s/wow-update-%s-%u.MPQ"), input_path, LocalesT[locale], LocalesT[locale], Builds[i]); _stprintf(buff, _T("%s/Data/%s/wow-update-%s-%u.MPQ"), input_path, LocalesT[locale], LocalesT[locale], Builds[i]);
} }
else else
{ {
prefix = Locales[locale]; prefix = Locales[locale];
_stprintf(buff, _T("%swow-update-%u.MPQ"), input_path, Builds[i]); _stprintf(buff, _T("%s/Data/wow-update-%u.MPQ"), input_path, Builds[i]);
} }
if (!SFileOpenPatchArchive(LocaleMpq, buff, prefix, 0)) if (!SFileOpenPatchArchive(LocaleMpq, buff, prefix, 0))
@ -150,7 +150,7 @@ bool LoadLocaleMPQFile(int locale)
void LoadCommonMPQFiles(uint32 build) void LoadCommonMPQFiles(uint32 build)
{ {
TCHAR filename[512]; TCHAR filename[512];
_stprintf(filename, _T("%sworld.MPQ"), input_path); _stprintf(filename, _T("%s/Data/world.MPQ"), input_path);
if (!SFileOpenArchive(filename, 0, MPQ_OPEN_READ_ONLY, &WorldMpq)) if (!SFileOpenArchive(filename, 0, MPQ_OPEN_READ_ONLY, &WorldMpq))
{ {
if (GetLastError() != ERROR_FILE_NOT_FOUND) if (GetLastError() != ERROR_FILE_NOT_FOUND)
@ -164,7 +164,7 @@ void LoadCommonMPQFiles(uint32 build)
if (build < 15211 && !strcmp("world2.MPQ", CONF_mpq_list[i])) // 4.3.2 and higher MPQ if (build < 15211 && !strcmp("world2.MPQ", CONF_mpq_list[i])) // 4.3.2 and higher MPQ
continue; continue;
_stprintf(filename, _T("%s%s"), input_path, CONF_mpq_list[i]); _stprintf(filename, _T("%s/Data/%s"), input_path, CONF_mpq_list[i]);
if (!SFileOpenPatchArchive(WorldMpq, filename, "", 0)) if (!SFileOpenPatchArchive(WorldMpq, filename, "", 0))
{ {
if (GetLastError() != ERROR_FILE_NOT_FOUND) if (GetLastError() != ERROR_FILE_NOT_FOUND)
@ -205,12 +205,12 @@ void LoadCommonMPQFiles(uint32 build)
if (Builds[i] > LAST_DBC_IN_DATA_BUILD) if (Builds[i] > LAST_DBC_IN_DATA_BUILD)
{ {
prefix = ""; prefix = "";
_stprintf(filename, _T("%swow-update-base-%u.MPQ"), input_path, Builds[i]); _stprintf(filename, _T("%s/Data/wow-update-base-%u.MPQ"), input_path, Builds[i]);
} }
else else
{ {
prefix = "base"; prefix = "base";
_stprintf(filename, _T("%swow-update-%u.MPQ"), input_path, Builds[i]); _stprintf(filename, _T("%s/Data/wow-update-%u.MPQ"), input_path, Builds[i]);
} }
if (!SFileOpenPatchArchive(WorldMpq, filename, prefix, 0)) if (!SFileOpenPatchArchive(WorldMpq, filename, prefix, 0))
@ -247,7 +247,6 @@ void LoadCommonMPQFiles(uint32 build)
printf("Scanned %d files, found patch = %d\n", count, found); printf("Scanned %d files, found patch = %d\n", count, found);
} }
} }
} }
@ -277,7 +276,7 @@ void ReadLiquidTypeTableDBC()
{ {
printf("Read LiquidType.dbc file..."); printf("Read LiquidType.dbc file...");
DBCFile dbc(LocaleMpq, "DBFilesClient\\LiquidType.dbc"); DBCFile dbc(LocaleMpq, "DBFilesClient/LiquidType.dbc");
if (!dbc.open()) if (!dbc.open())
{ {
printf("Fatal error: Invalid LiquidType.dbc file format!\n"); printf("Fatal error: Invalid LiquidType.dbc file format!\n");
@ -411,7 +410,7 @@ void ParsMapFiles()
for (unsigned int i = 0; i < map_count; ++i) for (unsigned int i = 0; i < map_count; ++i)
{ {
sprintf(id, "%03u", map_ids[i].id); sprintf(id, "%03u", map_ids[i].id);
sprintf(fn, "World\\Maps\\%s\\%s.wdt", map_ids[i].name, map_ids[i].name); sprintf(fn, "World/Maps/%s/%s.wdt", map_ids[i].name, map_ids[i].name);
WDTFile WDT(fn, map_ids[i].name); WDTFile WDT(fn, map_ids[i].name);
if (WDT.init(id, map_ids[i].id)) if (WDT.init(id, map_ids[i].id))
{ {
@ -539,9 +538,6 @@ bool processArgv(int argc, char** argv)
printf(" -? : This message.\n"); printf(" -? : This message.\n");
} }
if (!hasInputPathParam)
getGamePath();
return result; return result;
} }

@ -1 +1 @@
Subproject commit c0b82a9b0637a9f510c0164df3c6173420ef73b9 Subproject commit d6f85bdd312ca4704c7ad45dd35ebecfef54c313

View file

@ -42,6 +42,7 @@
#define COMPILER_GNU 1 #define COMPILER_GNU 1
#define COMPILER_BORLAND 2 #define COMPILER_BORLAND 2
#define COMPILER_INTEL 3 #define COMPILER_INTEL 3
#define COMPILER_CLANG 4
#ifdef _MSC_VER #ifdef _MSC_VER
# define COMPILER COMPILER_MICROSOFT # define COMPILER COMPILER_MICROSOFT

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "12770" #define REVISION_NR "12771"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__