feat(Core/Common): delete lib game-interface inherited (#5333)

Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com>
This commit is contained in:
Kargatum
2021-05-07 02:16:44 +07:00
committed by GitHub
parent 6947789622
commit db7d754f3f
45 changed files with 428 additions and 475 deletions

View File

@@ -6,6 +6,7 @@
#ifndef UTILS_H
#define UTILS_H
#include <cstdio>
#include <string>
#include <sstream>
@@ -337,9 +338,6 @@ public:
virtual float Scale() const { return 1.0f; };
};
#define MMAP_MAGIC 0x4d4d4150 // 'MMAP'
#define MMAP_VERSION 10
struct MmapTileHeader
{
uint32 mmapMagic;

View File

@@ -5,45 +5,14 @@
*/
#include "MapBuilder.h"
#include "MapDefines.h"
#include "MapTree.h"
#include "ModelInstance.h"
#include "PathCommon.h"
#include <DetourCommon.h>
#include <DetourNavMesh.h>
#include <DetourNavMeshBuilder.h>
#include "DisableMgr.h"
namespace DisableMgr
{
bool IsDisabledFor(DisableType /*type*/, uint32 /*entry*/, Unit const* /*unit*/, uint8 /*flags*/ /*= 0*/) { return false; }
}
#define MMAP_MAGIC 0x4d4d4150 // 'MMAP'
#define MMAP_VERSION 11
struct MmapTileHeader
{
uint32 mmapMagic{MMAP_MAGIC};
uint32 dtVersion;
uint32 mmapVersion{MMAP_VERSION};
uint32 size{0};
char usesLiquids{true};
char padding[3]{};
MmapTileHeader() : dtVersion(DT_NAVMESH_VERSION) {}
};
// All padding fields must be handled and initialized to ensure mmaps_generator will produce binary-identical *.mmtile files
static_assert(sizeof(MmapTileHeader) == 20, "MmapTileHeader size is not correct, adjust the padding field size");
static_assert(sizeof(MmapTileHeader) == (sizeof(MmapTileHeader::mmapMagic) +
sizeof(MmapTileHeader::dtVersion) +
sizeof(MmapTileHeader::mmapVersion) +
sizeof(MmapTileHeader::size) +
sizeof(MmapTileHeader::usesLiquids) +
sizeof(MmapTileHeader::padding)), "MmapTileHeader has uninitialized padding fields");
namespace MMAP
{
MapBuilder::MapBuilder(float maxWalkableAngle, bool skipLiquid,

View File

@@ -20,20 +20,6 @@
#include <errno.h>
#endif
enum NavTerrain
{
NAV_EMPTY = 0x00,
NAV_GROUND = 0x01,
NAV_MAGMA = 0x02,
NAV_SLIME = 0x04,
NAV_WATER = 0x08,
NAV_UNUSED1 = 0x10,
NAV_UNUSED2 = 0x20,
NAV_UNUSED3 = 0x40,
NAV_UNUSED4 = 0x80
// we only have 8 bits
};
namespace MMAP
{
inline bool matchWildcardFilter(const char* filter, const char* str)

View File

@@ -5,10 +5,9 @@
*/
#include "TerrainBuilder.h"
#include "PathCommon.h"
#include "MapBuilder.h"
#include "MapDefines.h"
#include "VMapManager2.h"
#include "MapTree.h"
#include "ModelInstance.h"

View File

@@ -1,58 +0,0 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license: http://github.com/azerothcore/azerothcore-wotlk/LICENSE-GPL2
* Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*/
#include <vector>
#include "MapTree.h"
#include "VMapManager2.h"
#include "WorldModel.h"
#include "ModelInstance.h"
namespace VMAP
{
// Need direct access to encapsulated VMAP data, so we add functions for MMAP generator
// maybe add MapBuilder as friend to all of the below classes would be better?
// declared in src/common/vmap/MapTree.h
void StaticMapTree::getModelInstances(ModelInstance*& models, uint32& count)
{
models = iTreeValues;
count = iNTreeValues;
}
// declared in src/common/vmap/VMapManager2.h
void VMapManager2::getInstanceMapTree(InstanceTreeMap& instanceMapTree)
{
instanceMapTree = iInstanceMapTrees;
}
// declared in src/common/vmap/WorldModel.h
void WorldModel::getGroupModels(std::vector<GroupModel>& groupModels)
{
groupModels = this->groupModels;
}
// declared in src/common/vmap/WorldModel.h
void GroupModel::getMeshData(std::vector<G3D::Vector3>& vertices, std::vector<MeshTriangle>& triangles, WmoLiquid*& liquid)
{
vertices = this->vertices;
triangles = this->triangles;
liquid = iLiquid;
}
// declared in src/common/vmap/ModelInstance.h
WorldModel* ModelInstance::getWorldModel()
{
return iModel;
}
// declared in src/common/vmap/WorldModel.h
void WmoLiquid::getPosInfo(uint32& tilesX, uint32& tilesY, G3D::Vector3& corner) const
{
tilesX = iTilesX;
tilesY = iTilesY;
corner = iCorner;
}
}