#include <LightingThread.h>
|
void | CalcLight (NIBBLETYPE *a_Light) |
| Calculates light in the light array specified, using stored seeds. More...
|
|
void | CalcLightStep (NIBBLETYPE *a_Light, size_t a_NumSeedsIn, unsigned char *a_IsSeedIn, unsigned int *a_SeedIdxIn, size_t &a_NumSeedsOut, unsigned char *a_IsSeedOut, unsigned int *a_SeedIdxOut) |
| Does one step in the light calculation - one seed propagation and seed recalculation. More...
|
|
void | CompressLight (NIBBLETYPE *a_LightArray, NIBBLETYPE *a_ChunkLight) |
| Compresses from 1-block-per-byte (faster calc) into 2-blocks-per-byte (MC storage): More...
|
|
virtual void | Execute (void) override |
| This function, overloaded by the descendants, is called in the new thread. More...
|
|
void | LightChunk (cLightingChunkStay &a_Item) |
| Lights the entire chunk. More...
|
|
void | PrepareBlockLight (void) |
| Uses m_BlockTypes to initialize the m_BlockLight[] data; fills in seeds for the blocklight. More...
|
|
void | PrepareSkyLight (void) |
| Uses m_HeightMap to initialize the m_SkyLight[] data; fills in seeds for the skylight. More...
|
|
void | PropagateLight (NIBBLETYPE *a_Light, unsigned int a_SrcIdx, unsigned int a_DstIdx, size_t &a_NumSeedsOut, unsigned char *a_IsSeedOut, unsigned int *a_SeedIdxOut) |
|
void | QueueChunkStay (cLightingChunkStay &a_ChunkStay) |
| Queues a chunkstay that has all of its chunks loaded. More...
|
|
void | ReadChunks (int a_ChunkX, int a_ChunkZ) |
| Prepares m_BlockTypes and m_HeightMap data; zeroes out the light arrays. More...
|
|
Definition at line 48 of file LightingThread.h.
◆ cChunkStays
◆ Super
◆ cLightingThread()
cLightingThread::cLightingThread |
( |
cWorld & |
a_World | ) |
|
◆ ~cLightingThread()
cLightingThread::~cLightingThread |
( |
| ) |
|
|
overridevirtual |
◆ CalcLight()
void cLightingThread::CalcLight |
( |
NIBBLETYPE * |
a_Light | ) |
|
|
protected |
Calculates light in the light array specified, using stored seeds.
Definition at line 448 of file LightingThread.cpp.
◆ CalcLightStep()
void cLightingThread::CalcLightStep |
( |
NIBBLETYPE * |
a_Light, |
|
|
size_t |
a_NumSeedsIn, |
|
|
unsigned char * |
a_IsSeedIn, |
|
|
unsigned int * |
a_SeedIdxIn, |
|
|
size_t & |
a_NumSeedsOut, |
|
|
unsigned char * |
a_IsSeedOut, |
|
|
unsigned int * |
a_SeedIdxOut |
|
) |
| |
|
protected |
Does one step in the light calculation - one seed propagation and seed recalculation.
Definition at line 473 of file LightingThread.cpp.
◆ CompressLight()
Compresses from 1-block-per-byte (faster calc) into 2-blocks-per-byte (MC storage):
Definition at line 520 of file LightingThread.cpp.
◆ Execute()
void cLightingThread::Execute |
( |
void |
| ) |
|
|
overrideprotectedvirtual |
◆ GetQueueLength()
size_t cLightingThread::GetQueueLength |
( |
void |
| ) |
|
◆ LightChunk()
Lights the entire chunk.
If neighbor chunks don't exist, touches them and re-queues the chunk
Definition at line 234 of file LightingThread.cpp.
◆ PrepareBlockLight()
void cLightingThread::PrepareBlockLight |
( |
void |
| ) |
|
|
protected |
Uses m_BlockTypes to initialize the m_BlockLight[] data; fills in seeds for the blocklight.
Definition at line 419 of file LightingThread.cpp.
◆ PrepareSkyLight()
void cLightingThread::PrepareSkyLight |
( |
void |
| ) |
|
|
protected |
Uses m_HeightMap to initialize the m_SkyLight[] data; fills in seeds for the skylight.
Definition at line 353 of file LightingThread.cpp.
◆ PropagateLight()
void cLightingThread::PropagateLight |
( |
NIBBLETYPE * |
a_Light, |
|
|
unsigned int |
a_SrcIdx, |
|
|
unsigned int |
a_DstIdx, |
|
|
size_t & |
a_NumSeedsOut, |
|
|
unsigned char * |
a_IsSeedOut, |
|
|
unsigned int * |
a_SeedIdxOut |
|
) |
| |
|
protected |
◆ QueueChunk()
void cLightingThread::QueueChunk |
( |
int |
a_ChunkX, |
|
|
int |
a_ChunkZ, |
|
|
std::unique_ptr< cChunkCoordCallback > |
a_CallbackAfter |
|
) |
| |
Queues the entire chunk for lighting.
The callback, if specified, is called after the lighting has been processed.
Definition at line 150 of file LightingThread.cpp.
◆ QueueChunkStay()
◆ ReadChunks()
void cLightingThread::ReadChunks |
( |
int |
a_ChunkX, |
|
|
int |
a_ChunkZ |
|
) |
| |
|
protected |
Prepares m_BlockTypes and m_HeightMap data; zeroes out the light arrays.
Definition at line 330 of file LightingThread.cpp.
◆ Stop()
void cLightingThread::Stop |
( |
void |
| ) |
|
◆ WaitForQueueEmpty()
void cLightingThread::WaitForQueueEmpty |
( |
void |
| ) |
|
Blocks until the queue is empty or the thread is terminated.
Definition at line 166 of file LightingThread.cpp.
◆ BlocksPerYLayer
◆ m_BlockLight
◆ m_BlockTypes
◆ m_CS
The mutex to protect m_Queue and m_PendingQueue.
Definition at line 98 of file LightingThread.h.
◆ m_evtItemAdded
cEvent cLightingThread::m_evtItemAdded |
|
protected |
◆ m_evtQueueEmpty
cEvent cLightingThread::m_evtQueueEmpty |
|
protected |
◆ m_HeightMap
◆ m_IsSeed1
◆ m_IsSeed2
◆ m_MaxHeight
The highest block in the current 3x3 chunk data.
Definition at line 110 of file LightingThread.h.
◆ m_NumSeeds
size_t cLightingThread::m_NumSeeds |
|
protected |
◆ m_PendingQueue
The ChunkStays that are waiting for load.
Used for stopping the thread.
Definition at line 104 of file LightingThread.h.
◆ m_Queue
The ChunkStays that are loaded and are waiting to be lit.
Definition at line 101 of file LightingThread.h.
◆ m_SeedIdx1
◆ m_SeedIdx2
◆ m_SkyLight
◆ m_World
cWorld& cLightingThread::m_World |
|
protected |
The documentation for this class was generated from the following files: