Vmap: Introduce skipping of antiportals and unreachable mogp (#26331)

* Vmap: Introduce skipping of antiportals and unreachable mogp

* Reduce differences with master branch

* Update VMAP and MMAP versions

* Update MMAPs version

Co-authored-by: jackpoz <giacomopoz@gmail.com>
(cherry picked from commit d5f1fefe7f)
This commit is contained in:
killerwife
2021-04-24 14:58:16 +02:00
committed by Shauren
parent 2467f799bb
commit dbb7f65723
4 changed files with 13 additions and 8 deletions

View File

@@ -22,7 +22,7 @@
#include "DetourNavMesh.h"
const uint32 MMAP_MAGIC = 0x4d4d4150; // 'MMAP'
#define MMAP_VERSION 14
#define MMAP_VERSION 15
struct MmapTileHeader
{

View File

@@ -24,8 +24,8 @@
namespace VMAP
{
const char VMAP_MAGIC[] = "VMAP_4.A";
const char RAW_VMAP_MAGIC[] = "VMAP04A"; // used in extracted vmap files with raw data
const char VMAP_MAGIC[] = "VMAP_4.B";
const char RAW_VMAP_MAGIC[] = "VMAP04B"; // used in extracted vmap files with raw data
const char GAMEOBJECT_MODELS[] = "GameObjectModels.dtree";
// defined in VMapManager2.cpp currently...

View File

@@ -230,6 +230,7 @@ bool ExtractSingleWmo(std::string& fname)
fseek(output, 8, SEEK_SET); // store the correct no of vertices
fwrite(&Wmo_nVertices, sizeof(int), 1, output);
// store the correct no of groups
fwrite(&groupCount, sizeof(uint32), 1, output);
fclose(output);

View File

@@ -76,11 +76,6 @@ bool WMORoot::open()
f.read(&flags, 2);
f.read(&numLod, 2);
}
else if (!strcmp(fourcc, "MOGN"))
{
GroupNames.resize(size);
f.read(GroupNames.data(), size);
}
else if (!strcmp(fourcc, "MODS"))
{
DoodadData.Sets.resize(size / sizeof(WMO::MODS));
@@ -130,6 +125,11 @@ bool WMORoot::open()
DoodadData.Spawns.resize(size / sizeof(WMO::MODD));
f.read(DoodadData.Spawns.data(), size);
}
else if (!strcmp(fourcc, "MOGN"))
{
GroupNames.resize(size);
f.read(GroupNames.data(), size);
}
else if (!strcmp(fourcc, "GFID"))
{
// full LOD reading code for reference
@@ -546,6 +546,10 @@ uint32 WMOGroup::GetLiquidTypeId(uint32 liquidTypeId)
bool WMOGroup::ShouldSkip(WMORoot const* root) const
{
// skip unreachable
if (mogpFlags & 0x80)
return true;
// skip antiportals
if (mogpFlags & 0x4000000)
return true;