This commit is contained in:
aozhiwei 2020-08-10 09:56:31 +08:00
parent e40397fa60
commit d0ee13ac0a
2 changed files with 11 additions and 0 deletions

View File

@ -3,6 +3,11 @@
#include <math.h>
#include <memory.h>
#include "DetourNavMeshBuilder.h"
#include "DetourNavMeshQuery.h"
#include "DetourCommon.h"
#include "DetourNavMesh.h"
#include "mapservice.h"
#include "collider.h"
#include "entity.h"
@ -33,6 +38,10 @@ MapService::~MapService()
free(map_cells_);
map_cells_ = nullptr;
}
if (navmesh_) {
dtFreeNavMesh(navmesh_);
navmesh_ = nullptr;
}
}
void MapService::Init(int width, int height, int cell_width)

View File

@ -54,6 +54,7 @@ struct FindPathStatus
};
class Room;
class dtNavMesh;
class MapService
{
public:
@ -87,6 +88,7 @@ class MapService
bool IsValidPos(int x, int y);
private:
dtNavMesh* navmesh_ = nullptr;
list_head* map_cells_ = nullptr;
int map_width_ = 0;
int map_height_ = 0;