#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 is the main thread entrypoint. 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.
cLightingThread::cLightingThread |
( |
cWorld & |
a_World | ) |
|
cLightingThread::~cLightingThread |
( |
| ) |
|
|
overridevirtual |
void cLightingThread::CalcLight |
( |
NIBBLETYPE * |
a_Light | ) |
|
|
protected |
Calculates light in the light array specified, using stored seeds.
Definition at line 447 of file LightingThread.cpp.
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 472 of file LightingThread.cpp.
Compresses from 1-block-per-byte (faster calc) into 2-blocks-per-byte (MC storage):
Definition at line 519 of file LightingThread.cpp.
void cLightingThread::Execute |
( |
void |
| ) |
|
|
overrideprotectedvirtual |
This is the main thread entrypoint.
This function, overloaded by the descendants, is called in the new thread.
Implements cIsThread.
Definition at line 189 of file LightingThread.cpp.
size_t cLightingThread::GetQueueLength |
( |
void |
| ) |
|
Lights the entire chunk.
If neighbor chunks don't exist, touches them and re-queues the chunk
Definition at line 233 of file LightingThread.cpp.
void cLightingThread::PrepareBlockLight |
( |
void |
| ) |
|
|
protected |
Uses m_BlockTypes to initialize the m_BlockLight[] data; fills in seeds for the blocklight.
Definition at line 418 of file LightingThread.cpp.
void cLightingThread::PrepareSkyLight |
( |
void |
| ) |
|
|
protected |
Uses m_HeightMap to initialize the m_SkyLight[] data; fills in seeds for the skylight.
Definition at line 352 of file LightingThread.cpp.
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 |
|
) |
| |
|
inlineprotected |
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 149 of file LightingThread.cpp.
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 329 of file LightingThread.cpp.
void cLightingThread::Stop |
( |
void |
| ) |
|
void cLightingThread::WaitForQueueEmpty |
( |
void |
| ) |
|
Blocks until the queue is empty or the thread is terminated.
Definition at line 165 of file LightingThread.cpp.
The mutex to protect m_Queue and m_PendingQueue.
Definition at line 98 of file LightingThread.h.
cEvent cLightingThread::m_evtItemAdded |
|
protected |
cEvent cLightingThread::m_evtQueueEmpty |
|
protected |
The highest block in the current 3x3 chunk data.
Definition at line 110 of file LightingThread.h.
size_t cLightingThread::m_NumSeeds |
|
protected |
The ChunkStays that are waiting for load.
Used for stopping the thread.
Definition at line 104 of file LightingThread.h.
The ChunkStays that are loaded and are waiting to be lit.
Definition at line 101 of file LightingThread.h.
cWorld& cLightingThread::m_World |
|
protected |
The documentation for this class was generated from the following files: