Core/Maps: Allow multi-threaded updates for all instances of a map, should increase performance
This commit is contained in:
@@ -64,6 +64,9 @@ void MapInstanced::Update(const uint32& t)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// update only here, because it may schedule some bad things before delete
|
// update only here, because it may schedule some bad things before delete
|
||||||
|
if (sMapMgr->GetMapUpdater()->activated())
|
||||||
|
sMapMgr->GetMapUpdater()->schedule_update(*i->second, t);
|
||||||
|
else
|
||||||
i->second->Update(t);
|
i->second->Update(t);
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -148,6 +148,8 @@ class MapManager
|
|||||||
uint32 GetNextInstanceId() { return _nextInstanceId; };
|
uint32 GetNextInstanceId() { return _nextInstanceId; };
|
||||||
void SetNextInstanceId(uint32 nextInstanceId) { _nextInstanceId = nextInstanceId; };
|
void SetNextInstanceId(uint32 nextInstanceId) { _nextInstanceId = nextInstanceId; };
|
||||||
|
|
||||||
|
MapUpdater * GetMapUpdater() { return &m_updater; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// debugging code, should be deleted some day
|
// debugging code, should be deleted some day
|
||||||
void checkAndCorrectGridStatesArray(); // just for debugging to find some memory overwrites
|
void checkAndCorrectGridStatesArray(); // just for debugging to find some memory overwrites
|
||||||
|
|||||||
Reference in New Issue
Block a user