mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-08 07:48:02 +00:00
tools improvement (#926)
* tools improvement * added "Source/DetourAssert.cpp" to recastnavigation/Detour/CMakeLists.txt * increased MMAP and VMAP version numbers * Will need to re extract MMAPS and VMAPS
This commit is contained in:
@@ -12,8 +12,8 @@
|
||||
|
||||
namespace VMAP
|
||||
{
|
||||
const char VMAP_MAGIC[] = "VMAP_4.1";
|
||||
const char RAW_VMAP_MAGIC[] = "VMAP041"; // used in extracted vmap files with raw data
|
||||
const char VMAP_MAGIC[] = "VMAP_4.2";
|
||||
const char RAW_VMAP_MAGIC[] = "VMAP042"; // used in extracted vmap files with raw data
|
||||
const char GAMEOBJECT_MODELS[] = "GameObjectModels.dtree";
|
||||
|
||||
// defined in TileAssembler.cpp currently...
|
||||
|
||||
@@ -3531,7 +3531,7 @@ enum PartyResult
|
||||
};
|
||||
|
||||
#define MMAP_MAGIC 0x4d4d4150 // 'MMAP'
|
||||
#define MMAP_VERSION 8
|
||||
#define MMAP_VERSION 9
|
||||
|
||||
struct MmapTileHeader
|
||||
{
|
||||
|
||||
@@ -26,7 +26,7 @@ const float Constants::UnitSize = Constants::ChunkSize / 8.0f;
|
||||
const float Constants::Origin[] = { -Constants::MaxXY, 0.0f, -Constants::MaxXY };
|
||||
const float Constants::PI = 3.1415926f;
|
||||
const float Constants::MaxStandableHeight = 1.5f;
|
||||
const char* Constants::VMAPMagic = "VMAP041";
|
||||
const char* Constants::VMAPMagic = "VMAP042";
|
||||
bool Constants::ToWoWCoords = false;
|
||||
bool Constants::Debug = false;
|
||||
const float Constants::BaseUnitDim = 0.533333f;
|
||||
|
||||
@@ -341,7 +341,7 @@ public:
|
||||
};
|
||||
|
||||
#define MMAP_MAGIC 0x4d4d4150 // 'MMAP'
|
||||
#define MMAP_VERSION 8
|
||||
#define MMAP_VERSION 9
|
||||
|
||||
struct MmapTileHeader
|
||||
{
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace DisableMgr
|
||||
}
|
||||
|
||||
#define MMAP_MAGIC 0x4d4d4150 // 'MMAP'
|
||||
#define MMAP_VERSION 8
|
||||
#define MMAP_VERSION 9
|
||||
|
||||
struct MmapTileHeader
|
||||
{
|
||||
@@ -577,8 +577,8 @@ namespace MMAP
|
||||
config.minRegionArea = rcSqr(60);
|
||||
config.mergeRegionArea = rcSqr(50);
|
||||
config.maxSimplificationError = 1.8f; // eliminates most jagged edges (tiny polygons)
|
||||
config.detailSampleDist = config.cs * 64;
|
||||
config.detailSampleMaxError = config.ch * 2;
|
||||
config.detailSampleDist = config.cs * 16;
|
||||
config.detailSampleMaxError = config.ch * 1;
|
||||
|
||||
// this sets the dimensions of the heightfield - should maybe happen before border padding
|
||||
rcCalcGridSize(config.bmin, config.bmax, config.cs, &config.width, &config.height);
|
||||
|
||||
@@ -64,7 +64,7 @@ bool preciseVectorData = false;
|
||||
|
||||
//static const char * szWorkDirMaps = ".\\Maps";
|
||||
const char* szWorkDirWmo = "./Buildings";
|
||||
const char* szRawVMAPMagic = "VMAP041";
|
||||
const char* szRawVMAPMagic = "VMAP042";
|
||||
|
||||
// Local testing functions
|
||||
|
||||
|
||||
@@ -338,9 +338,11 @@ int WMOGroup::ConvertToVMAPGroupWmo(FILE *output, WMORoot *rootWMO, bool precise
|
||||
for (int i=0; i<nTriangles; ++i)
|
||||
{
|
||||
// Skip no collision triangles
|
||||
if (MOPY[2*i]&WMO_MATERIAL_NO_COLLISION ||
|
||||
!(MOPY[2*i]&(WMO_MATERIAL_HINT|WMO_MATERIAL_COLLIDE_HIT)) )
|
||||
bool isRenderFace = (MOPY[2 * i] & WMO_MATERIAL_RENDER) && !(MOPY[2 * i] & WMO_MATERIAL_DETAIL);
|
||||
bool isCollision = MOPY[2 * i] & WMO_MATERIAL_COLLISION || isRenderFace;
|
||||
if (!isCollision)
|
||||
continue;
|
||||
|
||||
// Use this triangle
|
||||
for (int j=0; j<3; ++j)
|
||||
{
|
||||
@@ -472,23 +474,33 @@ WMOGroup::~WMOGroup()
|
||||
}
|
||||
|
||||
WMOInstance::WMOInstance(MPQFile& f, char const* WmoInstName, uint32 mapID, uint32 tileX, uint32 tileY, FILE* pDirfile)
|
||||
: currx(0), curry(0), wmo(NULL), doodadset(0), pos(), indx(0), id(0), d2(0), d3(0)
|
||||
: currx(0), curry(0), wmo(NULL), doodadset(0), pos(), indx(0), id(0)
|
||||
{
|
||||
float ff[3];
|
||||
f.read(&id, 4);
|
||||
f.read(ff,12);
|
||||
pos = Vec3D(ff[0],ff[1],ff[2]);
|
||||
f.read(ff,12);
|
||||
rot = Vec3D(ff[0],ff[1],ff[2]);
|
||||
f.read(ff,12);
|
||||
pos2 = Vec3D(ff[0],ff[1],ff[2]);
|
||||
f.read(ff,12);
|
||||
pos3 = Vec3D(ff[0],ff[1],ff[2]);
|
||||
f.read(&d2,4);
|
||||
f.read(ff, 12);
|
||||
pos = Vec3D(ff[0], ff[1], ff[2]);
|
||||
f.read(ff, 12);
|
||||
rot = Vec3D(ff[0], ff[1], ff[2]);
|
||||
f.read(ff, 12);
|
||||
pos2 = Vec3D(ff[0], ff[1], ff[2]); // bounding box corners
|
||||
f.read(ff, 12);
|
||||
pos3 = Vec3D(ff[0], ff[1], ff[2]); // bounding box corners
|
||||
|
||||
uint16 trash,adtId;
|
||||
f.read(&adtId,2);
|
||||
f.read(&trash,2);
|
||||
uint16 fflags;
|
||||
f.read(&fflags, 2);
|
||||
|
||||
uint16 doodadSet;
|
||||
f.read(&doodadSet, 2);
|
||||
|
||||
uint16 trash, adtId;
|
||||
f.read(&adtId, 2);
|
||||
f.read(&trash, 2);
|
||||
|
||||
// destructible wmo, do not dump. we can handle the vmap for these
|
||||
// in dynamic tree (gameobject vmaps)
|
||||
if ((fflags & 0x01) != 0)
|
||||
return;
|
||||
|
||||
//-----------add_in _dir_file----------------
|
||||
|
||||
|
||||
@@ -15,13 +15,17 @@
|
||||
#include "loadlib/loadlib.h"
|
||||
|
||||
// MOPY flags
|
||||
#define WMO_MATERIAL_NOCAMCOLLIDE 0x01
|
||||
#define WMO_MATERIAL_DETAIL 0x02
|
||||
#define WMO_MATERIAL_NO_COLLISION 0x04
|
||||
#define WMO_MATERIAL_HINT 0x08
|
||||
#define WMO_MATERIAL_RENDER 0x10
|
||||
#define WMO_MATERIAL_COLLIDE_HIT 0x20
|
||||
#define WMO_MATERIAL_WALL_SURFACE 0x40
|
||||
enum MopyFlags
|
||||
{
|
||||
WMO_MATERIAL_UNK01 = 0x01,
|
||||
WMO_MATERIAL_NOCAMCOLLIDE = 0x02,
|
||||
WMO_MATERIAL_DETAIL = 0x04,
|
||||
WMO_MATERIAL_COLLISION = 0x08,
|
||||
WMO_MATERIAL_HINT = 0x10,
|
||||
WMO_MATERIAL_RENDER = 0x20,
|
||||
WMO_MATERIAL_WALL_SURFACE = 0x40, // Guessed
|
||||
WMO_MATERIAL_COLLIDE_HIT = 0x80
|
||||
};
|
||||
|
||||
class WMOInstance;
|
||||
class WMOManager;
|
||||
@@ -112,7 +116,7 @@ public:
|
||||
int doodadset;
|
||||
Vec3D pos;
|
||||
Vec3D pos2, pos3, rot;
|
||||
uint32 indx, id, d2, d3;
|
||||
uint32 indx, id;
|
||||
|
||||
WMOInstance(MPQFile&f , char const* WmoInstName, uint32 mapID, uint32 tileX, uint32 tileY, FILE* pDirfile);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user