aboutsummaryrefslogtreecommitdiff
path: root/src/tools/vmap3_extractor
diff options
context:
space:
mode:
authorXanadu <none@none>2010-07-20 02:49:28 +0200
committerXanadu <none@none>2010-07-20 02:49:28 +0200
commit79622802f397258ee0f34327ba3ae6977ca3e7ff (patch)
tree1868946c234ab9ee256a6b7766a15713eae94235 /src/tools/vmap3_extractor
parent7dd2dc91816ab8b3bc3b99a1b1c99c7ea314d5a8 (diff)
parentf906976837502fa5aa81b982b901d1509f5aa0c4 (diff)
Merge. Revision history for source files should be all back now.
--HG-- branch : trunk rename : sql/CMakeLists.txt => sql/tools/CMakeLists.txt rename : src/server/game/Pools/PoolHandler.cpp => src/server/game/Pools/PoolMgr.cpp rename : src/server/game/Pools/PoolHandler.h => src/server/game/Pools/PoolMgr.h rename : src/server/game/PrecompiledHeaders/NixCorePCH.cpp => src/server/game/PrecompiledHeaders/gamePCH.cpp rename : src/server/game/PrecompiledHeaders/NixCorePCH.h => src/server/game/PrecompiledHeaders/gamePCH.h
Diffstat (limited to 'src/tools/vmap3_extractor')
-rw-r--r--src/tools/vmap3_extractor/CMakeLists.txt35
-rw-r--r--src/tools/vmap3_extractor/VC90/VC90_vmap3extractor.vcproj276
-rw-r--r--src/tools/vmap3_extractor/adtfile.cpp11
-rw-r--r--src/tools/vmap3_extractor/dbcfile.h22
-rw-r--r--src/tools/vmap3_extractor/loadlib/loadlib.h2
-rw-r--r--src/tools/vmap3_extractor/model.cpp2
-rw-r--r--src/tools/vmap3_extractor/mpq_libmpq.cpp2
-rw-r--r--src/tools/vmap3_extractor/mpq_libmpq04.h3
-rw-r--r--src/tools/vmap3_extractor/vmapexport.cpp55
-rw-r--r--src/tools/vmap3_extractor/vmapexport.h2
-rw-r--r--src/tools/vmap3_extractor/wdtfile.cpp9
-rw-r--r--src/tools/vmap3_extractor/win/vmapExtractor3_VC90.sln19
-rw-r--r--src/tools/vmap3_extractor/wmo.cpp5
13 files changed, 374 insertions, 69 deletions
diff --git a/src/tools/vmap3_extractor/CMakeLists.txt b/src/tools/vmap3_extractor/CMakeLists.txt
index 51e867ec07e..62604f7ad3d 100644
--- a/src/tools/vmap3_extractor/CMakeLists.txt
+++ b/src/tools/vmap3_extractor/CMakeLists.txt
@@ -1,4 +1,5 @@
# Copyright (C) 2005-2009 MaNGOS project <http://getmangos.com/>
+# Copyright (C) 2008-2010 Trinity <http://www.trinitycore.org/>
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
@@ -8,9 +9,33 @@
# 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 (MANGOS_IOMAP_EXTRACTOR)
+file(GLOB sources *.cpp)
-LINK_DIRECTORIES( ${LINK_DIRECTORIES} ../../libmpq/libmpq/.libs/ )
-add_executable(vmapextractor adtfile.cpp dbcfile.cpp model.cpp mpq_libmpq.cpp vmapexport.cpp wdtfile.cpp wmo.cpp)
-target_link_libraries(vmapextractor mpq)
+# 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
+ mpq
+ bzip2
+ zlib
+ )
+else()
+ target_link_libraries(vmap3extractor
+ mpq
+ ${BZIP2_LIBRARIES}
+ ${ZLIB_LIBRARIES}
+ )
+endif()
+
+if( UNIX )
+ install(TARGETS vmap3extractor DESTINATION bin)
+endif()
diff --git a/src/tools/vmap3_extractor/VC90/VC90_vmap3extractor.vcproj b/src/tools/vmap3_extractor/VC90/VC90_vmap3extractor.vcproj
new file mode 100644
index 00000000000..3dd343f3845
--- /dev/null
+++ b/src/tools/vmap3_extractor/VC90/VC90_vmap3extractor.vcproj
@@ -0,0 +1,276 @@
+<?xml version="1.0" encoding="windows-1250"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9,00"
+ Name="vmap3extractor"
+ ProjectGUID="{502602CC-98EA-4335-B922-C5C1DBF37604}"
+ RootNamespace="vmap3_extractor"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="196613"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(ProjectName)__$(PlatformName)_$(ConfigurationName)"
+ IntermediateDirectory="$(ProjectName)__$(PlatformName)_$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\;..\..\..\..\externals\libmpq;..\..\..\..\externals\libmpq\win"
+ PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS"
+ MinimalRebuild="false"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ ObjectFile=".\$(ProjectName)__$(PlatformName)_$(ConfigurationName)\"
+ ProgramDataBaseFileName=".\$(ProjectName)__$(PlatformName)_$(ConfigurationName)\"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="..\..\bin\$(PlatformName)_$(ConfigurationName)\$(ProjectName)_d.exe"
+ LinkIncremental="2"
+ AdditionalLibraryDirectories=""
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(IntDir)\$(TargetName).pdb"
+ SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(ProjectName)__$(PlatformName)_$(ConfigurationName)"
+ IntermediateDirectory="$(ProjectName)__$(PlatformName)_$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="1"
+ WholeProgramOptimization="0"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ EnableIntrinsicFunctions="false"
+ WholeProgramOptimization="false"
+ AdditionalIncludeDirectories="..\;..\..\..\..\externals\libmpq;..\..\..\..\externals\libmpq\win"
+ PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ EnableEnhancedInstructionSet="1"
+ UsePrecompiledHeader="0"
+ ObjectFile=".\$(ProjectName)__$(PlatformName)_$(ConfigurationName)\"
+ ProgramDataBaseFileName=".\$(ProjectName)__$(PlatformName)_$(ConfigurationName)\"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="..\..\bin\$(PlatformName)_$(ConfigurationName)\$(ProjectName).exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories=""
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(IntDir)\$(TargetName).pdb"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ LinkTimeCodeGeneration="0"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath="..\adtfile.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\dbcfile.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\model.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\mpq_libmpq.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\vmapexport.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\wdtfile.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\wmo.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath="..\adtfile.h"
+ >
+ </File>
+ <File
+ RelativePath="..\dbcfile.h"
+ >
+ </File>
+ <File
+ RelativePath="..\model.h"
+ >
+ </File>
+ <File
+ RelativePath="..\modelheaders.h"
+ >
+ </File>
+ <File
+ RelativePath="..\mpq_libmpq04.h"
+ >
+ </File>
+ <File
+ RelativePath="..\vec3d.h"
+ >
+ </File>
+ <File
+ RelativePath="..\vmapexport.h"
+ >
+ </File>
+ <File
+ RelativePath="..\wdtfile.h"
+ >
+ </File>
+ <File
+ RelativePath="..\wmo.h"
+ >
+ </File>
+ <Filter
+ Name="loadlib"
+ >
+ <File
+ RelativePath="..\loadlib\loadlib.h"
+ >
+ </File>
+ </Filter>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/src/tools/vmap3_extractor/adtfile.cpp b/src/tools/vmap3_extractor/adtfile.cpp
index 055408edca6..58c1bb94b1c 100644
--- a/src/tools/vmap3_extractor/adtfile.cpp
+++ b/src/tools/vmap3_extractor/adtfile.cpp
@@ -1,9 +1,10 @@
+#include "vmapexport.h"
#include "adtfile.h"
#include <algorithm>
#include <cstdio>
-#ifdef WIN32
+#ifdef _WIN32
#define snprintf _snprintf
#endif
@@ -69,12 +70,12 @@ bool ADTFile::init(uint32 map_num, uint32 tileX, uint32 tileY)
//printf("xMap = %s\n", xMap.c_str());
//printf("yMap = %s\n", yMap.c_str());
- const char dirname[] = "Buildings/dir_bin";
+ std::string dirname = std::string(szWorkDirWmo) + "/dir_bin";
FILE *dirfile;
- dirfile = fopen(dirname, "ab");
+ dirfile = fopen(dirname.c_str(), "ab");
if(!dirfile)
{
- printf("Can't open dirfile!'%s'\n", dirname);
+ printf("Can't open dirfile!'%s'\n", dirname.c_str());
return false;
}
@@ -125,7 +126,7 @@ bool ADTFile::init(uint32 map_num, uint32 tileX, uint32 tileY)
// nothing do
char szLocalFile[1024];
- snprintf(szLocalFile, 1024, "./Buildings/%s", s);
+ snprintf(szLocalFile, 1024, "%s/%s", szWorkDirWmo, s);
FILE * output = fopen(szLocalFile,"rb");
if(!output)
{
diff --git a/src/tools/vmap3_extractor/dbcfile.h b/src/tools/vmap3_extractor/dbcfile.h
index 7381ab9f668..d405d6ffd60 100644
--- a/src/tools/vmap3_extractor/dbcfile.h
+++ b/src/tools/vmap3_extractor/dbcfile.h
@@ -1,13 +1,27 @@
+/*
+ * Copyright (C) 2008-2010 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
#ifndef DBCFILE_H
#define DBCFILE_H
-#define __STORMLIB_SELF__
#include <cassert>
#include <string>
-//#include "StormLib.h"
-#undef min
-#undef max
class DBCFile
{
public:
diff --git a/src/tools/vmap3_extractor/loadlib/loadlib.h b/src/tools/vmap3_extractor/loadlib/loadlib.h
index 53731753425..49d5f590744 100644
--- a/src/tools/vmap3_extractor/loadlib/loadlib.h
+++ b/src/tools/vmap3_extractor/loadlib/loadlib.h
@@ -1,7 +1,7 @@
#ifndef LOAD_LIB_H
#define LOAD_LIB_H
-#ifdef WIN32
+#ifdef _WIN32
typedef __int64 int64;
typedef __int32 int32;
typedef __int16 int16;
diff --git a/src/tools/vmap3_extractor/model.cpp b/src/tools/vmap3_extractor/model.cpp
index b914ed96406..a2493f7e571 100644
--- a/src/tools/vmap3_extractor/model.cpp
+++ b/src/tools/vmap3_extractor/model.cpp
@@ -134,7 +134,7 @@ ModelInstance::ModelInstance(MPQFile &f,const char* ModelInstName, uint32 mapID,
sc = scale / 1024.0f;
char tempname[512];
- sprintf(tempname, "./Buildings/%s", ModelInstName);
+ sprintf(tempname, "%s/%s", szWorkDirWmo, ModelInstName);
FILE *input;
input = fopen(tempname, "r+b");
diff --git a/src/tools/vmap3_extractor/mpq_libmpq.cpp b/src/tools/vmap3_extractor/mpq_libmpq.cpp
index 4aa59417f81..528b9679a58 100644
--- a/src/tools/vmap3_extractor/mpq_libmpq.cpp
+++ b/src/tools/vmap3_extractor/mpq_libmpq.cpp
@@ -57,7 +57,7 @@ MPQFile::MPQFile(const char* filename):
// HACK: in patch.mpq some files don't want to open and give 1 for filesize
if (size<=1) {
- printf("warning: file %s has size %d; cannot read.\n", filename, size);
+ // printf("info: file %s has size %d; considered dummy file.\n", filename, size);
eof = true;
buffer = 0;
return;
diff --git a/src/tools/vmap3_extractor/mpq_libmpq04.h b/src/tools/vmap3_extractor/mpq_libmpq04.h
index ccbfe37cba7..4fe80f2759c 100644
--- a/src/tools/vmap3_extractor/mpq_libmpq04.h
+++ b/src/tools/vmap3_extractor/mpq_libmpq04.h
@@ -1,6 +1,3 @@
-#define _CRT_SECURE_NO_DEPRECATE
-#define _CRT_SECURE_NO_WARNINGS
-
#ifndef MPQ_H
#define MPQ_H
diff --git a/src/tools/vmap3_extractor/vmapexport.cpp b/src/tools/vmap3_extractor/vmapexport.cpp
index 07d5d31d418..2be03d85d97 100644
--- a/src/tools/vmap3_extractor/vmapexport.cpp
+++ b/src/tools/vmap3_extractor/vmapexport.cpp
@@ -1,16 +1,3 @@
-/*****************************************************************************/
-/* StormLibTest.cpp Copyright (c) Ladislav Zezula 2003 */
-/*---------------------------------------------------------------------------*/
-/* This module uses very brutal test methods for StormLib. It extracts all */
-/* files from the archive with Storm.dll and with stormlib and compares them,*/
-/* then tries to build a copy of the entire archive, then removes a few files*/
-/* from the archive and adds them back, then compares the two archives, ... */
-/*---------------------------------------------------------------------------*/
-/* Date Ver Who Comment */
-/* -------- ---- --- ------- */
-/* 25.03.03 1.00 Lad The first version of StormLibTest.cpp */
-/*****************************************************************************/
-
#define _CRT_SECURE_NO_DEPRECATE
#include <cstdio>
#include <iostream>
@@ -18,7 +5,7 @@
#include <list>
#include <errno.h>
-#ifdef WIN32
+#ifdef _WIN32
#include <Windows.h>
#include <sys/stat.h>
#include <direct.h>
@@ -68,7 +55,7 @@ bool preciseVectorData = false;
// Constants
//static const char * szWorkDirMaps = ".\\Maps";
-static const char * szWorkDirWmo = "./Buildings";
+const char * szWorkDirWmo = "./Buildings";
// Local testing functions
@@ -114,7 +101,7 @@ void ReadLiquidTypeTableDBC()
for(uint32 x = 0; x < LiqType_count; ++x)
LiqType[dbc.getRecord(x).getUInt(0)] = dbc.getRecord(x).getUInt(3);
- printf("Done! (%u LiqTypes loaded)\n", LiqType_count);
+ printf("Done! (%u LiqTypes loaded)\n", (unsigned int)LiqType_count);
}
int ExtractWmo()
@@ -236,18 +223,22 @@ void ParsMapFiles()
WDTFile WDT(fn,map_ids[i].name);
if(WDT.init(id, map_ids[i].id))
{
+ printf("Processing Map %u\n[", map_ids[i].id);
for (int x=0; x<64; ++x)
{
for (int y=0; y<64; ++y)
{
- if (ADTFile*ADT = WDT.GetMap(x,y))
+ if (ADTFile *ADT = WDT.GetMap(x,y))
{
//sprintf(id_filename,"%02u %02u %03u",x,y,map_ids[i].id);//!!!!!!!!!
ADT->init(map_ids[i].id, x, y);
delete ADT;
}
}
+ printf("#");
+ fflush(stdout);
}
+ printf("]\n");
}
}
}
@@ -260,9 +251,8 @@ void getGamePath()
LONG l;
s = sizeof(input_path);
memset(input_path,0,s);
- l = RegOpenKeyEx(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 = RegQueryValueEx(key,"InstallPath",0,&t,(LPBYTE)input_path,&s);
+ l = RegOpenKeyExA(HKEY_LOCAL_MACHINE,"SOFTWARE\\Blizzard Entertainment\\World of Warcraft",0,KEY_QUERY_VALUE,&key);
+ l = RegQueryValueExA(key,"InstallPath",0,&t,(LPBYTE)input_path,&s);
RegCloseKey(key);
if (strlen(input_path) > 0)
{
@@ -321,6 +311,11 @@ bool fillArchiveNameVector(std::vector<std::string>& pArchiveNames)
searchLocales.push_back("esES");
searchLocales.push_back("frFR");
searchLocales.push_back("koKR");
+ searchLocales.push_back("zhCN");
+ searchLocales.push_back("zhTW");
+ searchLocales.push_back("enCN");
+ searchLocales.push_back("enTW");
+ searchLocales.push_back("esMX");
searchLocales.push_back("ruRU");
for (std::vector<std::string>::iterator i = searchLocales.begin(); i != searchLocales.end(); ++i)
@@ -445,17 +440,33 @@ bool processArgv(int argc, char ** argv, const char *versionString)
int main(int argc, char ** argv)
{
bool success=true;
- const char *versionString = "V2.90 2010_05";
+ const char *versionString = "V3.00 2010_07";
// Use command line arguments, when some
if(!processArgv(argc, argv, versionString))
return 1;
+ // some simple check if working dir is dirty
+ else
+ {
+ std::string sdir = std::string(szWorkDirWmo) + "/dir";
+ std::string sdir_bin = std::string(szWorkDirWmo) + "/dir_bin";
+ struct stat status;
+ if (!stat(sdir.c_str(), &status) || !stat(sdir_bin.c_str(), &status))
+ {
+ printf("Your output directory seems to be polluted, please use an empty directory!\n");
+ printf("<press return to exit>");
+ char garbage[2];
+ scanf("%c", garbage);
+ return 1;
+ }
+ }
+
printf("Extract %s. Beginning work ....\n",versionString);
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
// Create the working directory
if(mkdir(szWorkDirWmo
-#ifdef __linux__
+#ifdef _XOPEN_UNIX
, 0711
#endif
))
diff --git a/src/tools/vmap3_extractor/vmapexport.h b/src/tools/vmap3_extractor/vmapexport.h
index 625bc930882..fa9a609abf5 100644
--- a/src/tools/vmap3_extractor/vmapexport.h
+++ b/src/tools/vmap3_extractor/vmapexport.h
@@ -8,4 +8,6 @@ enum ModelFlags
MOD_HAS_BOUND = 1<<2
};
+extern const char * szWorkDirWmo;
+
#endif
diff --git a/src/tools/vmap3_extractor/wdtfile.cpp b/src/tools/vmap3_extractor/wdtfile.cpp
index 7f81af72931..cd24ef0346c 100644
--- a/src/tools/vmap3_extractor/wdtfile.cpp
+++ b/src/tools/vmap3_extractor/wdtfile.cpp
@@ -1,5 +1,4 @@
-#define __STORMLIB_SELF__
-
+#include "vmapexport.h"
#include "wdtfile.h"
#include "adtfile.h"
#include <cstdio>
@@ -29,12 +28,12 @@ bool WDTFile::init(char *map_id, unsigned int mapID)
char fourcc[5];
uint32 size;
- const char dirname[] = "Buildings/dir_bin";
+ std::string dirname = std::string(szWorkDirWmo) + "/dir_bin";
FILE *dirfile;
- dirfile = fopen(dirname, "ab");
+ dirfile = fopen(dirname.c_str(), "ab");
if(!dirfile)
{
- printf("Can't open dirfile!'%s'\n", dirname);
+ printf("Can't open dirfile!'%s'\n", dirname.c_str());
return false;
}
diff --git a/src/tools/vmap3_extractor/win/vmapExtractor3_VC90.sln b/src/tools/vmap3_extractor/win/vmapExtractor3_VC90.sln
deleted file mode 100644
index 0c42d1e90f0..00000000000
--- a/src/tools/vmap3_extractor/win/vmapExtractor3_VC90.sln
+++ /dev/null
@@ -1,19 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 10.00
-# Visual Studio 2008
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vmapExtractor3", "VC90\vmapExtractor3.vcproj", "{D4624B20-AC1E-4EE9-8C9C-0FB65EEE3393}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Win32 = Debug|Win32
- Release|Win32 = Release|Win32
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {D4624B20-AC1E-4EE9-8C9C-0FB65EEE3393}.Debug|Win32.ActiveCfg = Debug|Win32
- {D4624B20-AC1E-4EE9-8C9C-0FB65EEE3393}.Debug|Win32.Build.0 = Debug|Win32
- {D4624B20-AC1E-4EE9-8C9C-0FB65EEE3393}.Release|Win32.ActiveCfg = Release|Win32
- {D4624B20-AC1E-4EE9-8C9C-0FB65EEE3393}.Release|Win32.Build.0 = Release|Win32
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/src/tools/vmap3_extractor/wmo.cpp b/src/tools/vmap3_extractor/wmo.cpp
index 508391be675..216a2248953 100644
--- a/src/tools/vmap3_extractor/wmo.cpp
+++ b/src/tools/vmap3_extractor/wmo.cpp
@@ -1,4 +1,3 @@
-
#include "vmapexport.h"
#include "wmo.h"
#include "vec3d.h"
@@ -387,7 +386,7 @@ int WMOGroup::ConvertToVMAPGroupWmo(FILE *output, WMORoot *rootWMO, bool pPrecis
if (rootWMO->liquidType & 4)
liquidEntry = liquidType;
else if (liquidType == 15)
- liquidEntry = 0;
+ liquidEntry = 1; // first entry, generic "Water"
else
liquidEntry = liquidType + 1;
// overwrite material type in header...
@@ -443,7 +442,7 @@ WMOInstance::WMOInstance(MPQFile &f,const char* WmoInstName, uint32 mapID, uint3
//-----------add_in _dir_file----------------
char tempname[512];
- sprintf(tempname, "Buildings/%s", WmoInstName);
+ sprintf(tempname, "%s/%s", szWorkDirWmo, WmoInstName);
FILE *input;
input = fopen(tempname, "r+b");