@@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user