1
0

Lighting thread: skip chunks that are already lit.

This commit is contained in:
Mattes D 2014-12-10 22:27:48 +01:00
parent 2ab8d2bd98
commit 563f41af65

View File

@ -236,6 +236,16 @@ void cLightingThread::Execute(void)
void cLightingThread::LightChunk(cLightingChunkStay & a_Item) void cLightingThread::LightChunk(cLightingChunkStay & a_Item)
{ {
// If the chunk is already lit, skip it:
if (m_World->IsChunkLighted(a_Item.m_ChunkX, a_Item.m_ChunkZ))
{
if (a_Item.m_CallbackAfter != nullptr)
{
a_Item.m_CallbackAfter->Call(a_Item.m_ChunkX, a_Item.m_ChunkZ);
}
return;
}
cChunkDef::BlockNibbles BlockLight, SkyLight; cChunkDef::BlockNibbles BlockLight, SkyLight;
ReadChunks(a_Item.m_ChunkX, a_Item.m_ChunkZ); ReadChunks(a_Item.m_ChunkX, a_Item.m_ChunkZ);