Revert WMO changes (#976)

This commit is contained in:
Stoabrogga
2018-07-17 15:27:42 +02:00
committed by Lee
parent 8255f78f8a
commit 8e9faf8488
2 changed files with 23 additions and 39 deletions

View File

@@ -338,11 +338,9 @@ int WMOGroup::ConvertToVMAPGroupWmo(FILE *output, WMORoot *rootWMO, bool precise
for (int i=0; i<nTriangles; ++i) for (int i=0; i<nTriangles; ++i)
{ {
// Skip no collision triangles // Skip no collision triangles
bool isRenderFace = (MOPY[2 * i] & WMO_MATERIAL_RENDER) && !(MOPY[2 * i] & WMO_MATERIAL_DETAIL); if (MOPY[2*i]&WMO_MATERIAL_NO_COLLISION ||
bool isCollision = MOPY[2 * i] & WMO_MATERIAL_COLLISION || isRenderFace; !(MOPY[2*i]&(WMO_MATERIAL_HINT|WMO_MATERIAL_COLLIDE_HIT)) )
if (!isCollision)
continue; continue;
// Use this triangle // Use this triangle
for (int j=0; j<3; ++j) for (int j=0; j<3; ++j)
{ {
@@ -474,33 +472,23 @@ WMOGroup::~WMOGroup()
} }
WMOInstance::WMOInstance(MPQFile& f, char const* WmoInstName, uint32 mapID, uint32 tileX, uint32 tileY, FILE* pDirfile) 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) : currx(0), curry(0), wmo(NULL), doodadset(0), pos(), indx(0), id(0), d2(0), d3(0)
{ {
float ff[3]; float ff[3];
f.read(&id, 4); f.read(&id, 4);
f.read(ff, 12); f.read(ff,12);
pos = Vec3D(ff[0], ff[1], ff[2]); pos = Vec3D(ff[0],ff[1],ff[2]);
f.read(ff, 12); f.read(ff,12);
rot = Vec3D(ff[0], ff[1], ff[2]); rot = Vec3D(ff[0],ff[1],ff[2]);
f.read(ff, 12); f.read(ff,12);
pos2 = Vec3D(ff[0], ff[1], ff[2]); // bounding box corners pos2 = Vec3D(ff[0],ff[1],ff[2]);
f.read(ff, 12); f.read(ff,12);
pos3 = Vec3D(ff[0], ff[1], ff[2]); // bounding box corners pos3 = Vec3D(ff[0],ff[1],ff[2]);
f.read(&d2,4);
uint16 fflags; uint16 trash,adtId;
f.read(&fflags, 2); f.read(&adtId,2);
f.read(&trash,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---------------- //-----------add_in _dir_file----------------

View File

@@ -15,17 +15,13 @@
#include "loadlib/loadlib.h" #include "loadlib/loadlib.h"
// MOPY flags // MOPY flags
enum MopyFlags #define WMO_MATERIAL_NOCAMCOLLIDE 0x01
{ #define WMO_MATERIAL_DETAIL 0x02
WMO_MATERIAL_UNK01 = 0x01, #define WMO_MATERIAL_NO_COLLISION 0x04
WMO_MATERIAL_NOCAMCOLLIDE = 0x02, #define WMO_MATERIAL_HINT 0x08
WMO_MATERIAL_DETAIL = 0x04, #define WMO_MATERIAL_RENDER 0x10
WMO_MATERIAL_COLLISION = 0x08, #define WMO_MATERIAL_COLLIDE_HIT 0x20
WMO_MATERIAL_HINT = 0x10, #define WMO_MATERIAL_WALL_SURFACE 0x40
WMO_MATERIAL_RENDER = 0x20,
WMO_MATERIAL_WALL_SURFACE = 0x40, // Guessed
WMO_MATERIAL_COLLIDE_HIT = 0x80
};
class WMOInstance; class WMOInstance;
class WMOManager; class WMOManager;
@@ -116,7 +112,7 @@ public:
int doodadset; int doodadset;
Vec3D pos; Vec3D pos;
Vec3D pos2, pos3, rot; Vec3D pos2, pos3, rot;
uint32 indx, id; uint32 indx, id, d2, d3;
WMOInstance(MPQFile&f , char const* WmoInstName, uint32 mapID, uint32 tileX, uint32 tileY, FILE* pDirfile); WMOInstance(MPQFile&f , char const* WmoInstName, uint32 mapID, uint32 tileX, uint32 tileY, FILE* pDirfile);