AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
MMAP::TileBuilder Class Reference

#include "MapBuilder.h"

Public Member Functions

 TileBuilder (MapBuilder *mapBuilder, bool skipLiquid, bool bigBaseUnit, bool debugOutput)
 
 TileBuilder (TileBuilder &&)=default
 
 ~TileBuilder ()
 
void WorkerThread ()
 
void WaitCompletion ()
 
void buildTile (uint32 mapID, uint32 tileX, uint32 tileY, dtNavMesh *navMesh)
 
void buildMoveMapTile (uint32 mapID, uint32 tileX, uint32 tileY, MeshData &meshData, float bmin[3], float bmax[3], dtNavMesh *navMesh)
 
bool shouldSkipTile (uint32 mapID, uint32 tileX, uint32 tileY) const
 

Private Attributes

bool m_bigBaseUnit
 
bool m_debugOutput
 
MapBuilderm_mapBuilder
 
TerrainBuilderm_terrainBuilder
 
std::thread m_workerThread
 
rcContext * m_rcContext
 

Detailed Description

Constructor & Destructor Documentation

◆ TileBuilder() [1/2]

MMAP::TileBuilder::TileBuilder ( MapBuilder mapBuilder,
bool  skipLiquid,
bool  bigBaseUnit,
bool  debugOutput 
)
33 :
34 m_bigBaseUnit(bigBaseUnit),
35 m_debugOutput(debugOutput),
36 m_mapBuilder(mapBuilder),
37 m_terrainBuilder(nullptr),
39 m_rcContext(nullptr)
40 {
41 m_terrainBuilder = new TerrainBuilder(skipLiquid);
42 m_rcContext = new rcContext(false);
43 }
rcContext * m_rcContext
Definition: MapBuilder.h:143
void WorkerThread()
Definition: MapBuilder.cpp:398
bool m_debugOutput
Definition: MapBuilder.h:137
std::thread m_workerThread
Definition: MapBuilder.h:141
bool m_bigBaseUnit
Definition: MapBuilder.h:136
MapBuilder * m_mapBuilder
Definition: MapBuilder.h:139
TerrainBuilder * m_terrainBuilder
Definition: MapBuilder.h:140

References m_rcContext, and m_terrainBuilder.

◆ TileBuilder() [2/2]

MMAP::TileBuilder::TileBuilder ( TileBuilder &&  )
default

◆ ~TileBuilder()

MMAP::TileBuilder::~TileBuilder ( )
46 {
48
49 delete m_terrainBuilder;
50 delete m_rcContext;
51 }
void WaitCompletion()
Definition: MapBuilder.cpp:53

References m_rcContext, m_terrainBuilder, and WaitCompletion().

Member Function Documentation

◆ buildMoveMapTile()

void MMAP::TileBuilder::buildMoveMapTile ( uint32  mapID,
uint32  tileX,
uint32  tileY,
MeshData meshData,
float  bmin[3],
float  bmax[3],
dtNavMesh *  navMesh 
)
Todo:
: special flags for DYNAMIC polygons, ie surfaces that can be turned on and off
593 {
594 // console output
595 char tileString[20];
596 sprintf(tileString, "[Map %03i] [%02i,%02i]: ", mapID, tileX, tileY);
597 printf("%s Building movemap tiles...\n", tileString);
598
599 IntermediateValues iv;
600
601 float* tVerts = meshData.solidVerts.getCArray();
602 int tVertCount = meshData.solidVerts.size() / 3;
603 int* tTris = meshData.solidTris.getCArray();
604 int tTriCount = meshData.solidTris.size() / 3;
605
606 float* lVerts = meshData.liquidVerts.getCArray();
607 int lVertCount = meshData.liquidVerts.size() / 3;
608 int* lTris = meshData.liquidTris.getCArray();
609 int lTriCount = meshData.liquidTris.size() / 3;
610 uint8* lTriFlags = meshData.liquidType.getCArray();
611
612 const TileConfig tileConfig = TileConfig(m_bigBaseUnit);
613 int TILES_PER_MAP = tileConfig.TILES_PER_MAP;
614 float BASE_UNIT_DIM = tileConfig.BASE_UNIT_DIM;
615 rcConfig config = m_mapBuilder->GetMapSpecificConfig(mapID, bmin, bmax, tileConfig);
616
617 // this sets the dimensions of the heightfield - should maybe happen before border padding
618 rcCalcGridSize(config.bmin, config.bmax, config.cs, &config.width, &config.height);
619
620 // allocate subregions : tiles
621 Tile* tiles = new Tile[TILES_PER_MAP * TILES_PER_MAP];
622
623 // Initialize per tile config.
624 rcConfig tileCfg = config;
625 tileCfg.width = config.tileSize + config.borderSize * 2;
626 tileCfg.height = config.tileSize + config.borderSize * 2;
627
628 // merge per tile poly and detail meshes
629 rcPolyMesh** pmmerge = new rcPolyMesh*[TILES_PER_MAP * TILES_PER_MAP];
630 rcPolyMeshDetail** dmmerge = new rcPolyMeshDetail*[TILES_PER_MAP * TILES_PER_MAP];
631 int nmerge = 0;
632 // build all tiles
633 for (int y = 0; y < TILES_PER_MAP; ++y)
634 {
635 for (int x = 0; x < TILES_PER_MAP; ++x)
636 {
637 Tile& tile = tiles[x + y * TILES_PER_MAP];
638
639 // Calculate the per tile bounding box.
640 tileCfg.bmin[0] = config.bmin[0] + x * float(config.tileSize * config.cs);
641 tileCfg.bmin[2] = config.bmin[2] + y * float(config.tileSize * config.cs);
642 tileCfg.bmax[0] = config.bmin[0] + (x + 1) * float(config.tileSize * config.cs);
643 tileCfg.bmax[2] = config.bmin[2] + (y + 1) * float(config.tileSize * config.cs);
644
645 tileCfg.bmin[0] -= tileCfg.borderSize * tileCfg.cs;
646 tileCfg.bmin[2] -= tileCfg.borderSize * tileCfg.cs;
647 tileCfg.bmax[0] += tileCfg.borderSize * tileCfg.cs;
648 tileCfg.bmax[2] += tileCfg.borderSize * tileCfg.cs;
649
650 // build heightfield
651 tile.solid = rcAllocHeightfield();
652 if (!tile.solid || !rcCreateHeightfield(m_rcContext, *tile.solid, tileCfg.width, tileCfg.height, tileCfg.bmin, tileCfg.bmax, tileCfg.cs, tileCfg.ch))
653 {
654 printf("%s Failed building heightfield! \n", tileString);
655 continue;
656 }
657
658 // mark all walkable tiles, both liquids and solids
659
660 unsigned char* triFlags = new unsigned char[tTriCount];
661 memset(triFlags, NAV_GROUND, tTriCount * sizeof(unsigned char));
662 rcClearUnwalkableTriangles(m_rcContext, tileCfg.walkableSlopeAngle, tVerts, tVertCount, tTris, tTriCount, triFlags);
663 rcRasterizeTriangles(m_rcContext, tVerts, tVertCount, tTris, triFlags, tTriCount, *tile.solid, config.walkableClimb);
664 delete[] triFlags;
665
666 rcFilterLowHangingWalkableObstacles(m_rcContext, config.walkableClimb, *tile.solid);
667 rcFilterLedgeSpans(m_rcContext, tileCfg.walkableHeight, tileCfg.walkableClimb, *tile.solid);
668 rcFilterWalkableLowHeightSpans(m_rcContext, tileCfg.walkableHeight, *tile.solid);
669
670 // add liquid triangles
671 rcRasterizeTriangles(m_rcContext, lVerts, lVertCount, lTris, lTriFlags, lTriCount, *tile.solid, config.walkableClimb);
672
673 // compact heightfield spans
674 tile.chf = rcAllocCompactHeightfield();
675 if (!tile.chf || !rcBuildCompactHeightfield(m_rcContext, tileCfg.walkableHeight, tileCfg.walkableClimb, *tile.solid, *tile.chf))
676 {
677 printf("%s Failed compacting heightfield! \n", tileString);
678 continue;
679 }
680
681 // build polymesh intermediates
682 if (!rcErodeWalkableArea(m_rcContext, config.walkableRadius, *tile.chf))
683 {
684 printf("%s Failed eroding area! \n", tileString);
685 continue;
686 }
687
688 if (!rcBuildDistanceField(m_rcContext, *tile.chf))
689 {
690 printf("%s Failed building distance field! \n", tileString);
691 continue;
692 }
693
694 if (!rcBuildRegions(m_rcContext, *tile.chf, tileCfg.borderSize, tileCfg.minRegionArea, tileCfg.mergeRegionArea))
695 {
696 printf("%s Failed building regions! \n", tileString);
697 continue;
698 }
699
700 tile.cset = rcAllocContourSet();
701 if (!tile.cset || !rcBuildContours(m_rcContext, *tile.chf, tileCfg.maxSimplificationError, tileCfg.maxEdgeLen, *tile.cset))
702 {
703 printf("%s Failed building contours! \n", tileString);
704 continue;
705 }
706
707 // build polymesh
708 tile.pmesh = rcAllocPolyMesh();
709 if (!tile.pmesh || !rcBuildPolyMesh(m_rcContext, *tile.cset, tileCfg.maxVertsPerPoly, *tile.pmesh))
710 {
711 printf("%s Failed building polymesh! \n", tileString);
712 continue;
713 }
714
715 tile.dmesh = rcAllocPolyMeshDetail();
716 if (!tile.dmesh || !rcBuildPolyMeshDetail(m_rcContext, *tile.pmesh, *tile.chf, tileCfg.detailSampleDist, tileCfg.detailSampleMaxError, *tile.dmesh))
717 {
718 printf("%s Failed building polymesh detail! \n", tileString);
719 continue;
720 }
721
722 // free those up
723 // we may want to keep them in the future for debug
724 // but right now, we don't have the code to merge them
725 rcFreeHeightField(tile.solid);
726 tile.solid = nullptr;
727 rcFreeCompactHeightfield(tile.chf);
728 tile.chf = nullptr;
729 rcFreeContourSet(tile.cset);
730 tile.cset = nullptr;
731
732 pmmerge[nmerge] = tile.pmesh;
733 dmmerge[nmerge] = tile.dmesh;
734 nmerge++;
735 }
736 }
737
738 iv.polyMesh = rcAllocPolyMesh();
739 if (!iv.polyMesh)
740 {
741 printf("%s alloc iv.polyMesh FAILED!\n", tileString);
742 delete[] pmmerge;
743 delete[] dmmerge;
744 delete[] tiles;
745 return;
746 }
747 rcMergePolyMeshes(m_rcContext, pmmerge, nmerge, *iv.polyMesh);
748
749 iv.polyMeshDetail = rcAllocPolyMeshDetail();
750 if (!iv.polyMeshDetail)
751 {
752 printf("%s alloc m_dmesh FAILED!\n", tileString);
753 delete[] pmmerge;
754 delete[] dmmerge;
755 delete[] tiles;
756 return;
757 }
758 rcMergePolyMeshDetails(m_rcContext, dmmerge, nmerge, *iv.polyMeshDetail);
759
760 // free things up
761 delete[] pmmerge;
762 delete[] dmmerge;
763 delete[] tiles;
764
765 // set polygons as walkable
767 for (int i = 0; i < iv.polyMesh->npolys; ++i)
768 if (iv.polyMesh->areas[i] & RC_WALKABLE_AREA)
769 iv.polyMesh->flags[i] = iv.polyMesh->areas[i];
770
771 // setup mesh parameters
772 dtNavMeshCreateParams params;
773 memset(&params, 0, sizeof(params));
774 params.verts = iv.polyMesh->verts;
775 params.vertCount = iv.polyMesh->nverts;
776 params.polys = iv.polyMesh->polys;
777 params.polyAreas = iv.polyMesh->areas;
778 params.polyFlags = iv.polyMesh->flags;
779 params.polyCount = iv.polyMesh->npolys;
780 params.nvp = iv.polyMesh->nvp;
781 params.detailMeshes = iv.polyMeshDetail->meshes;
782 params.detailVerts = iv.polyMeshDetail->verts;
783 params.detailVertsCount = iv.polyMeshDetail->nverts;
784 params.detailTris = iv.polyMeshDetail->tris;
785 params.detailTriCount = iv.polyMeshDetail->ntris;
786
787 params.offMeshConVerts = meshData.offMeshConnections.getCArray();
788 params.offMeshConCount = meshData.offMeshConnections.size() / 6;
789 params.offMeshConRad = meshData.offMeshConnectionRads.getCArray();
790 params.offMeshConDir = meshData.offMeshConnectionDirs.getCArray();
791 params.offMeshConAreas = meshData.offMeshConnectionsAreas.getCArray();
792 params.offMeshConFlags = meshData.offMeshConnectionsFlags.getCArray();
793
794 params.walkableHeight = BASE_UNIT_DIM * config.walkableHeight; // agent height
795 params.walkableRadius = BASE_UNIT_DIM * config.walkableRadius; // agent radius
796 params.walkableClimb = BASE_UNIT_DIM * config.walkableClimb; // keep less that walkableHeight (aka agent height)!
797 params.tileX = (((bmin[0] + bmax[0]) / 2) - navMesh->getParams()->orig[0]) / GRID_SIZE;
798 params.tileY = (((bmin[2] + bmax[2]) / 2) - navMesh->getParams()->orig[2]) / GRID_SIZE;
799 rcVcopy(params.bmin, bmin);
800 rcVcopy(params.bmax, bmax);
801 params.cs = config.cs;
802 params.ch = config.ch;
803 params.tileLayer = 0;
804 params.buildBvTree = true;
805
806 // will hold final navmesh
807 unsigned char* navData = nullptr;
808 int navDataSize = 0;
809
810 do
811 {
812 // these values are checked within dtCreateNavMeshData - handle them here
813 // so we have a clear error message
814 if (params.nvp > DT_VERTS_PER_POLYGON)
815 {
816 printf("%s Invalid verts-per-polygon value! \n", tileString);
817 break;
818 }
819 if (params.vertCount >= 0xffff)
820 {
821 printf("%s Too many vertices! \n", tileString);
822 break;
823 }
824 if (!params.vertCount || !params.verts)
825 {
826 // occurs mostly when adjacent tiles have models
827 // loaded but those models don't span into this tile
828
829 // message is an annoyance
830 printf("%sNo vertices to build tile! \n", tileString);
831 break;
832 }
833 if (!params.polyCount || !params.polys)
834 {
835 // we have flat tiles with no actual geometry - don't build those, its useless
836 // keep in mind that we do output those into debug info
837 printf("%s No polygons to build on tile! \n", tileString);
838 break;
839 }
840 if (!params.detailMeshes || !params.detailVerts || !params.detailTris)
841 {
842 printf("%s No detail mesh to build tile! \n", tileString);
843 break;
844 }
845
846 printf("%s Building navmesh tile...\n", tileString);
847 if (!dtCreateNavMeshData(&params, &navData, &navDataSize))
848 {
849 printf("%s Failed building navmesh tile! \n", tileString);
850 break;
851 }
852
853 dtTileRef tileRef = 0;
854 printf("%s Adding tile to navmesh...\n", tileString);
855 // DT_TILE_FREE_DATA tells detour to unallocate memory when the tile
856 // is removed via removeTile()
857 dtStatus dtResult = navMesh->addTile(navData, navDataSize, DT_TILE_FREE_DATA, 0, &tileRef);
858 if (!tileRef || dtResult != DT_SUCCESS)
859 {
860 printf("%s Failed adding tile to navmesh! \n", tileString);
861 break;
862 }
863
864 // file output
865 char fileName[255];
866 sprintf(fileName, "mmaps/%03u%02i%02i.mmtile", mapID, tileY, tileX);
867 FILE* file = fopen(fileName, "wb");
868 if (!file)
869 {
870 char message[1024];
871 sprintf(message, "[Map %03i] Failed to open %s for writing!\n", mapID, fileName);
872 perror(message);
873 navMesh->removeTile(tileRef, nullptr, nullptr);
874 break;
875 }
876
877 printf("%s Writing to file...\n", tileString);
878
879 // write header
880 MmapTileHeader header;
882 header.size = uint32(navDataSize);
883 fwrite(&header, sizeof(MmapTileHeader), 1, file);
884
885 // write data
886 fwrite(navData, sizeof(unsigned char), navDataSize, file);
887 fclose(file);
888
889 // now that tile is written to disk, we can unload it
890 navMesh->removeTile(tileRef, nullptr, nullptr);
891 } while (false);
892
893 if (m_debugOutput)
894 {
895 // restore padding so that the debug visualization is correct
896 for (int i = 0; i < iv.polyMesh->nverts; ++i)
897 {
898 unsigned short* v = &iv.polyMesh->verts[i * 3];
899 v[0] += (unsigned short)config.borderSize;
900 v[2] += (unsigned short)config.borderSize;
901 }
902
903 iv.generateObjFile(mapID, tileX, tileY, meshData);
904 iv.writeIV(mapID, tileX, tileY);
905 }
906 }
@ NAV_GROUND
Definition: MapDefines.h:42
std::uint8_t uint8
Definition: Define.h:110
std::uint32_t uint32
Definition: Define.h:108
static const float GRID_SIZE
Definition: TerrainBuilder.h:49
Definition: MapDefines.h:19
uint32 size
Definition: MapDefines.h:23
char usesLiquids
Definition: MapDefines.h:24
rcConfig GetMapSpecificConfig(uint32 mapID, float bmin[3], float bmax[3], const TileConfig &tileConfig) const
Definition: MapBuilder.cpp:1053
bool usesLiquids() const
Definition: TerrainBuilder.h:89

References MMAP::TileConfig::BASE_UNIT_DIM, MMAP::Tile::chf, MMAP::Tile::cset, MMAP::Tile::dmesh, MMAP::IntermediateValues::generateObjFile(), MMAP::MapBuilder::GetMapSpecificConfig(), MMAP::GRID_SIZE, MMAP::MeshData::liquidTris, MMAP::MeshData::liquidType, MMAP::MeshData::liquidVerts, m_bigBaseUnit, m_debugOutput, m_mapBuilder, m_rcContext, m_terrainBuilder, NAV_GROUND, MMAP::MeshData::offMeshConnectionDirs, MMAP::MeshData::offMeshConnectionRads, MMAP::MeshData::offMeshConnections, MMAP::MeshData::offMeshConnectionsAreas, MMAP::MeshData::offMeshConnectionsFlags, MMAP::Tile::pmesh, MMAP::IntermediateValues::polyMesh, MMAP::IntermediateValues::polyMeshDetail, MmapTileHeader::size, MMAP::Tile::solid, MMAP::MeshData::solidTris, MMAP::MeshData::solidVerts, MMAP::TileConfig::TILES_PER_MAP, MmapTileHeader::usesLiquids, MMAP::TerrainBuilder::usesLiquids(), and MMAP::IntermediateValues::writeIV().

Referenced by MMAP::MapBuilder::buildMeshFromFile(), and buildTile().

◆ buildTile()

void MMAP::TileBuilder::buildTile ( uint32  mapID,
uint32  tileX,
uint32  tileY,
dtNavMesh *  navMesh 
)
463 {
464 if(shouldSkipTile(mapID, tileX, tileY))
465 {
467 return;
468 }
469
470 printf("%u%% [Map %04i] Building tile [%02u,%02u]\n", m_mapBuilder->currentPercentageDone(), mapID, tileX, tileY);
471
472 MeshData meshData;
473
474 // get heightmap data
475 m_terrainBuilder->loadMap(mapID, tileX, tileY, meshData);
476
477 // get model data
478 m_terrainBuilder->loadVMap(mapID, tileY, tileX, meshData);
479
480 // if there is no data, give up now
481 if (!meshData.solidVerts.size() && !meshData.liquidVerts.size())
482 {
484 return;
485 }
486
487 // remove unused vertices
488 TerrainBuilder::cleanVertices(meshData.solidVerts, meshData.solidTris);
489 TerrainBuilder::cleanVertices(meshData.liquidVerts, meshData.liquidTris);
490
491 // gather all mesh data for final data check, and bounds calculation
492 G3D::Array<float> allVerts;
493 allVerts.append(meshData.liquidVerts);
494 allVerts.append(meshData.solidVerts);
495
496 if (!allVerts.size())
497 {
499 return;
500 }
501
502 // get bounds of current tile
503 float bmin[3], bmax[3];
504 m_mapBuilder->getTileBounds(tileX, tileY, allVerts.getCArray(), allVerts.size() / 3, bmin, bmax);
505
507
508 // build navmesh tile
509 buildMoveMapTile(mapID, tileX, tileY, meshData, bmin, bmax, navMesh);
510
512 }
bool shouldSkipTile(uint32 mapID, uint32 tileX, uint32 tileY) const
Definition: MapBuilder.cpp:1030
void buildMoveMapTile(uint32 mapID, uint32 tileX, uint32 tileY, MeshData &meshData, float bmin[3], float bmax[3], dtNavMesh *navMesh)
Definition: MapBuilder.cpp:590
const char * m_offMeshFilePath
Definition: MapBuilder.h:199
uint32 currentPercentageDone() const
Definition: MapBuilder.cpp:1107
void getTileBounds(uint32 tileX, uint32 tileY, float *verts, int vertCount, float *bmin, float *bmax) const
Definition: MapBuilder.cpp:909
std::atomic< uint32 > m_totalTilesProcessed
Definition: MapBuilder.h:211
static void cleanVertices(G3D::Array< float > &verts, G3D::Array< int > &tris)
Definition: TerrainBuilder.cpp:881
void loadOffMeshConnections(uint32 mapID, uint32 tileX, uint32 tileY, MeshData &meshData, const char *offMeshFilePath)
Definition: TerrainBuilder.cpp:924
void loadMap(uint32 mapID, uint32 tileX, uint32 tileY, MeshData &meshData)
Definition: TerrainBuilder.cpp:122
bool loadVMap(uint32 mapID, uint32 tileX, uint32 tileY, MeshData &meshData)
Definition: TerrainBuilder.cpp:664

References buildMoveMapTile(), MMAP::TerrainBuilder::cleanVertices(), MMAP::MapBuilder::currentPercentageDone(), MMAP::MapBuilder::getTileBounds(), MMAP::MeshData::liquidTris, MMAP::MeshData::liquidVerts, MMAP::TerrainBuilder::loadMap(), MMAP::TerrainBuilder::loadOffMeshConnections(), MMAP::TerrainBuilder::loadVMap(), m_mapBuilder, MMAP::MapBuilder::m_offMeshFilePath, m_terrainBuilder, MMAP::MapBuilder::m_totalTilesProcessed, shouldSkipTile(), MMAP::MeshData::solidTris, and MMAP::MeshData::solidVerts.

Referenced by MMAP::MapBuilder::buildSingleTile(), and WorkerThread().

◆ shouldSkipTile()

bool MMAP::TileBuilder::shouldSkipTile ( uint32  mapID,
uint32  tileX,
uint32  tileY 
) const
1031 {
1032 char fileName[255];
1033 sprintf(fileName, "mmaps/%03u%02i%02i.mmtile", mapID, tileY, tileX);
1034 FILE* file = fopen(fileName, "rb");
1035 if (!file)
1036 return false;
1037
1038 MmapTileHeader header;
1039 int count = fread(&header, sizeof(MmapTileHeader), 1, file);
1040 fclose(file);
1041 if (count != 1)
1042 return false;
1043
1044 if (header.mmapMagic != MMAP_MAGIC || header.dtVersion != uint32(DT_NAVMESH_VERSION))
1045 return false;
1046
1047 if (header.mmapVersion != MMAP_VERSION)
1048 return false;
1049
1050 return true;
1051 }
#define MMAP_VERSION
Definition: MapDefines.h:16
#define MMAP_MAGIC
Definition: MapDefines.h:15
uint32 dtVersion
Definition: MapDefines.h:21
uint32 mmapVersion
Definition: MapDefines.h:22
uint32 mmapMagic
Definition: MapDefines.h:20

References MmapTileHeader::dtVersion, MMAP_MAGIC, MMAP_VERSION, MmapTileHeader::mmapMagic, and MmapTileHeader::mmapVersion.

Referenced by buildTile().

◆ WaitCompletion()

void MMAP::TileBuilder::WaitCompletion ( )
54 {
55 if (m_workerThread.joinable())
56 m_workerThread.join();
57 }

References m_workerThread.

Referenced by ~TileBuilder().

◆ WorkerThread()

void MMAP::TileBuilder::WorkerThread ( )
399 {
400 while (true)
401 {
402 TileInfo tileInfo;
403
404 m_mapBuilder->_queue.WaitAndPop(tileInfo);
405
407 return;
408
409 dtNavMesh* navMesh = dtAllocNavMesh();
410 if (!navMesh->init(&tileInfo.m_navMeshParams))
411 {
412 printf("[Map %04i] Failed creating navmesh for tile %i,%i !\n", tileInfo.m_mapId, tileInfo.m_tileX, tileInfo.m_tileY);
413 dtFreeNavMesh(navMesh);
414 return;
415 }
416
417 buildTile(tileInfo.m_mapId, tileInfo.m_tileX, tileInfo.m_tileY, navMesh);
418
419 dtFreeNavMesh(navMesh);
420 }
421 }
void buildTile(uint32 mapID, uint32 tileX, uint32 tileY, dtNavMesh *navMesh)
Definition: MapBuilder.cpp:462
ProducerConsumerQueue< TileInfo > _queue
Definition: MapBuilder.h:217
std::atomic< bool > _cancelationToken
Definition: MapBuilder.h:218

References MMAP::MapBuilder::_cancelationToken, MMAP::MapBuilder::_queue, buildTile(), m_mapBuilder, MMAP::TileInfo::m_mapId, MMAP::TileInfo::m_navMeshParams, MMAP::TileInfo::m_tileX, and MMAP::TileInfo::m_tileY.

Member Data Documentation

◆ m_bigBaseUnit

bool MMAP::TileBuilder::m_bigBaseUnit
private

Referenced by buildMoveMapTile().

◆ m_debugOutput

bool MMAP::TileBuilder::m_debugOutput
private

Referenced by buildMoveMapTile().

◆ m_mapBuilder

MapBuilder* MMAP::TileBuilder::m_mapBuilder
private

◆ m_rcContext

rcContext* MMAP::TileBuilder::m_rcContext
private

◆ m_terrainBuilder

TerrainBuilder* MMAP::TileBuilder::m_terrainBuilder
private

◆ m_workerThread

std::thread MMAP::TileBuilder::m_workerThread
private

Referenced by WaitCompletion().