mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 07:34:45 +00:00
Merge pull request #1474 from Azaezel/navMess
mDirtyTiles changed from std::queue to a vector
This commit is contained in:
commit
32ec7f0ef6
2 changed files with 9 additions and 9 deletions
|
|
@ -637,7 +637,7 @@ DefineEngineMethod(NavMesh, build, bool, (bool background, bool save), (true, fa
|
||||||
|
|
||||||
void NavMesh::cancelBuild()
|
void NavMesh::cancelBuild()
|
||||||
{
|
{
|
||||||
while(!mDirtyTiles.empty()) mDirtyTiles.pop();
|
mDirtyTiles.clear();
|
||||||
ctx->stopTimer(RC_TIMER_TOTAL);
|
ctx->stopTimer(RC_TIMER_TOTAL);
|
||||||
mBuilding = false;
|
mBuilding = false;
|
||||||
}
|
}
|
||||||
|
|
@ -707,7 +707,7 @@ void NavMesh::updateTiles(bool dirty)
|
||||||
|
|
||||||
mTiles.clear();
|
mTiles.clear();
|
||||||
mTileData.clear();
|
mTileData.clear();
|
||||||
while(!mDirtyTiles.empty()) mDirtyTiles.pop();
|
mDirtyTiles.clear();
|
||||||
|
|
||||||
const Box3F &box = DTStoRC(getWorldBox());
|
const Box3F &box = DTStoRC(getWorldBox());
|
||||||
if(box.isEmpty())
|
if(box.isEmpty())
|
||||||
|
|
@ -741,7 +741,7 @@ void NavMesh::updateTiles(bool dirty)
|
||||||
tileBmin, tileBmax));
|
tileBmin, tileBmax));
|
||||||
|
|
||||||
if(dirty)
|
if(dirty)
|
||||||
mDirtyTiles.push(mTiles.size() - 1);
|
mDirtyTiles.push_back_unique(mTiles.size() - 1);
|
||||||
|
|
||||||
if(mSaveIntermediates)
|
if(mSaveIntermediates)
|
||||||
mTileData.increment();
|
mTileData.increment();
|
||||||
|
|
@ -760,7 +760,7 @@ void NavMesh::buildNextTile()
|
||||||
{
|
{
|
||||||
// Pop a single dirty tile and process it.
|
// Pop a single dirty tile and process it.
|
||||||
U32 i = mDirtyTiles.front();
|
U32 i = mDirtyTiles.front();
|
||||||
mDirtyTiles.pop();
|
mDirtyTiles.pop_front();
|
||||||
const Tile &tile = mTiles[i];
|
const Tile &tile = mTiles[i];
|
||||||
// Intermediate data for tile build.
|
// Intermediate data for tile build.
|
||||||
TileData tempdata;
|
TileData tempdata;
|
||||||
|
|
@ -844,7 +844,7 @@ unsigned char *NavMesh::buildTileData(const Tile &tile, TileData &data, U32 &dat
|
||||||
|
|
||||||
// Check for no geometry.
|
// Check for no geometry.
|
||||||
if(!data.geom.getVertCount())
|
if(!data.geom.getVertCount())
|
||||||
return false;
|
return NULL;
|
||||||
|
|
||||||
// Figure out voxel dimensions of this tile.
|
// Figure out voxel dimensions of this tile.
|
||||||
U32 width = 0, height = 0;
|
U32 width = 0, height = 0;
|
||||||
|
|
@ -1066,7 +1066,7 @@ void NavMesh::buildTiles(const Box3F &box)
|
||||||
if(!tile.box.isOverlapped(box))
|
if(!tile.box.isOverlapped(box))
|
||||||
continue;
|
continue;
|
||||||
// Mark as dirty.
|
// Mark as dirty.
|
||||||
mDirtyTiles.push(i);
|
mDirtyTiles.push_back_unique(i);
|
||||||
}
|
}
|
||||||
if(mDirtyTiles.size())
|
if(mDirtyTiles.size())
|
||||||
ctx->startTimer(RC_TIMER_TOTAL);
|
ctx->startTimer(RC_TIMER_TOTAL);
|
||||||
|
|
@ -1082,7 +1082,7 @@ void NavMesh::buildTile(const U32 &tile)
|
||||||
{
|
{
|
||||||
if(tile < mTiles.size())
|
if(tile < mTiles.size())
|
||||||
{
|
{
|
||||||
mDirtyTiles.push(tile);
|
mDirtyTiles.push_back_unique(tile);
|
||||||
ctx->startTimer(RC_TIMER_TOTAL);
|
ctx->startTimer(RC_TIMER_TOTAL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1104,7 +1104,7 @@ void NavMesh::buildLinks()
|
||||||
mLinksUnsynced[j])
|
mLinksUnsynced[j])
|
||||||
{
|
{
|
||||||
// Mark tile for build.
|
// Mark tile for build.
|
||||||
mDirtyTiles.push(i);
|
mDirtyTiles.push_back_unique(i);
|
||||||
// Delete link if necessary
|
// Delete link if necessary
|
||||||
if(mDeleteLinks[j])
|
if(mDeleteLinks[j])
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -325,7 +325,7 @@ private:
|
||||||
Vector<TileData> mTileData;
|
Vector<TileData> mTileData;
|
||||||
|
|
||||||
/// List of indices to the tile array which are dirty.
|
/// List of indices to the tile array which are dirty.
|
||||||
std::queue<U32> mDirtyTiles;
|
Vector<U32> mDirtyTiles;
|
||||||
|
|
||||||
/// Update tile dimensions.
|
/// Update tile dimensions.
|
||||||
void updateTiles(bool dirty = false);
|
void updateTiles(bool dirty = false);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue