Restore mmaps gen build

Closes #12631
This commit is contained in:
leak
2014-07-24 21:55:37 +02:00
parent b5f0b85b48
commit 90bc6f1e39
2 changed files with 8 additions and 6 deletions
+7 -5
View File
@@ -171,14 +171,16 @@ namespace MMAP
{ {
while (1) while (1)
{ {
uint32 mapId; uint32* mapId;
_queue.WaitAndPop(mapId); _queue.WaitAndPop(mapId);
if (_cancelationToken) if (_cancelationToken)
return; return;
buildMap(mapId); buildMap(*mapId);
delete mapId;
} }
} }
@@ -196,13 +198,13 @@ namespace MMAP
for (TileList::iterator it = m_tiles.begin(); it != m_tiles.end(); ++it) for (TileList::iterator it = m_tiles.begin(); it != m_tiles.end(); ++it)
{ {
uint32 mapID = it->m_mapId; uint32* mapID = new uint32(it->m_mapId);
if (!shouldSkipMap(mapID)) if (!shouldSkipMap(*mapID))
{ {
if (threads > 0) if (threads > 0)
_queue.Push(mapID); _queue.Push(mapID);
else else
buildMap(mapID); buildMap(*mapID);
} }
} }
+1 -1
View File
@@ -143,7 +143,7 @@ namespace MMAP
rcContext* m_rcContext; rcContext* m_rcContext;
std::vector<std::thread> _workerThreads; std::vector<std::thread> _workerThreads;
ProducerConsumerQueue<uint32> _queue; ProducerConsumerQueue<uint32*> _queue;
std::atomic<bool> _cancelationToken; std::atomic<bool> _cancelationToken;
}; };
} }