1
This commit is contained in:
parent
5d3979e30c
commit
07a6288cf0
@ -59,10 +59,16 @@ void MapInstance::Init()
|
|||||||
if (current_uniid_ >= FIXED_OBJECT_MAXID) {
|
if (current_uniid_ >= FIXED_OBJECT_MAXID) {
|
||||||
A8_ABORT();
|
A8_ABORT();
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
navmesh_ = dtAllocNavMesh();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MapInstance::UnInit()
|
void MapInstance::UnInit()
|
||||||
{
|
{
|
||||||
|
dtFreeNavMesh(navmesh_);
|
||||||
|
navmesh_ = nullptr;
|
||||||
|
|
||||||
map_service_->UnInit();
|
map_service_->UnInit();
|
||||||
grid_service_->UnInit();
|
grid_service_->UnInit();
|
||||||
A8_SAFE_DELETE(map_service_);
|
A8_SAFE_DELETE(map_service_);
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "DetourNavMesh.h"
|
||||||
|
|
||||||
namespace MetaData
|
namespace MetaData
|
||||||
{
|
{
|
||||||
struct Map;
|
struct Map;
|
||||||
@ -31,6 +33,7 @@ class MapInstance
|
|||||||
MetaData::Map* GetMapMeta() { return map_meta_; }
|
MetaData::Map* GetMapMeta() { return map_meta_; }
|
||||||
Entity* GetEntityByUniId(int uniid);
|
Entity* GetEntityByUniId(int uniid);
|
||||||
a8::Vec2* GetSpawnPoint(const std::string& name);
|
a8::Vec2* GetSpawnPoint(const std::string& name);
|
||||||
|
dtNavMesh* GetNavMesh() { return navmesh_; };
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void CreateThings();
|
void CreateThings();
|
||||||
@ -48,6 +51,8 @@ class MapInstance
|
|||||||
int AllocUniid();
|
int AllocUniid();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
dtNavMesh* navmesh_ = nullptr;
|
||||||
|
|
||||||
int current_uniid_ = 0;
|
int current_uniid_ = 0;
|
||||||
int current_map_block_uniid_ = 0;
|
int current_map_block_uniid_ = 0;
|
||||||
std::map<int, Entity*> uniid_hash_;
|
std::map<int, Entity*> uniid_hash_;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user