Tools/MeshExtractor: Code cleanup and fix threading issue
Remove GenericCache:Insert() as no longer needed. Mark BuilderThread as not free anymore as soon as they are assigned to a Tile. Fix signed/unsigned comparison mismatch.
This commit is contained in:
1 parent
58912635a7
commit
e7b93044fb
3 files changed
+2
-12
No files matched your search
@@ -14,16 +14,6 @@ class GenericCache
|
||||
public:
|
||||
GenericCache() {}
|
||||
|
||||
static const uint32 FlushLimit = 300;
|
||||
|
||||
void Insert(K key, T* val)
|
||||
{
|
||||
ACE_GUARD(ACE_Thread_Mutex, g, mutex);
|
||||
if (_items.find(key) != _items.end()) // Make sure that the object isn't in the cache already
|
||||
delete _items[key]; // Delete the previous item
|
||||
_items[key] = val; // Reassign it
|
||||
}
|
||||
|
||||
T* Get(K key)
|
||||
{
|
||||
ACE_GUARD_RETURN(ACE_Thread_Mutex, g, mutex, NULL);
|
||||
|
||||
@@ -24,11 +24,11 @@ public:
|
||||
Y = y;
|
||||
MapId = map;
|
||||
Continent = cont;
|
||||
Free = false;
|
||||
}
|
||||
|
||||
int svc()
|
||||
{
|
||||
Free = false;
|
||||
printf("[%02i,%02i] Building tile\n", X, Y);
|
||||
TileBuilder builder(cBuilder, Continent, X, Y, MapId);
|
||||
char buff[100];
|
||||
|
||||
@@ -462,7 +462,7 @@ int main(int argc, char* argv[])
|
||||
status = navMeshQuery->findStraightPath(m_spos, m_epos, hopBuffer, hops, straightPath, pathFlags, pathRefs, &resultHopCount, 2048);
|
||||
std::vector<Vector3> FinalPath;
|
||||
FinalPath.reserve(resultHopCount);
|
||||
for (uint32 i = 0; i < resultHopCount; ++i)
|
||||
for (int i = 0; i < resultHopCount; ++i)
|
||||
{
|
||||
Vector3 finalV = Utils::ToWoWCoords(Vector3(straightPath[i * 3 + 0], straightPath[i * 3 + 1], straightPath[i * 3 + 2]));
|
||||
FinalPath.push_back(finalV);
|
||||
|
||||
Reference in new issue
Block a user