summaryrefslogtreecommitdiffstats
path: root/source/LightingThread.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-02-17 19:24:34 +0100
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-02-17 19:24:34 +0100
commit7a9925f982e43fcc1d798318905d83b5805b12cc (patch)
tree2bd2a78cedb2d9ddf1ce5f09be102786994f9dd7 /source/LightingThread.cpp
parentChunk coords mostly "upgraded" to include the Y coord for future compatibility (diff)
downloadcuberite-7a9925f982e43fcc1d798318905d83b5805b12cc.tar
cuberite-7a9925f982e43fcc1d798318905d83b5805b12cc.tar.gz
cuberite-7a9925f982e43fcc1d798318905d83b5805b12cc.tar.bz2
cuberite-7a9925f982e43fcc1d798318905d83b5805b12cc.tar.lz
cuberite-7a9925f982e43fcc1d798318905d83b5805b12cc.tar.xz
cuberite-7a9925f982e43fcc1d798318905d83b5805b12cc.tar.zst
cuberite-7a9925f982e43fcc1d798318905d83b5805b12cc.zip
Diffstat (limited to '')
-rw-r--r--source/LightingThread.cpp114
1 files changed, 114 insertions, 0 deletions
diff --git a/source/LightingThread.cpp b/source/LightingThread.cpp
new file mode 100644
index 000000000..e70dc252e
--- /dev/null
+++ b/source/LightingThread.cpp
@@ -0,0 +1,114 @@
+
+// LightingThread.cpp
+
+// Implements the cLightingThread class representing the thread that processes requests for lighting
+
+#include "Globals.h"
+#include "LightingThread.h"
+
+
+
+
+
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+// cLightingThread:
+
+cLightingThread::cLightingThread(void) :
+ super("cLightingThread")
+{
+}
+
+
+
+
+
+cLightingThread::~cLightingThread()
+{
+ Stop();
+}
+
+
+
+
+
+void cLightingThread::Stop(void)
+{
+ {
+ cCSLock Lock(m_CS);
+ for (cLightingBufferQueue::iterator itr = m_Queue.begin(); itr != m_Queue.end(); ++itr)
+ {
+ delete *itr;
+ } // for itr - m_Queue[]
+ }
+ mShouldTerminate = true;
+ m_Event.Set();
+
+ Wait();
+}
+
+
+
+
+
+void cLightingThread::QueueLighting(cWorld * a_World, int a_MinX, int a_MaxX, int a_MinY, int a_MaxY, int a_MinZ, int a_MaxZ)
+{
+ // TODO
+}
+
+
+
+
+
+void cLightingThread::Execute(void)
+{
+ // TODO
+}
+
+
+
+
+
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+// cLightingThread::cLightingBuffer:
+
+cLightingThread::cLightingBuffer::cLightingBuffer(int a_MinX, int a_MaxX, int a_MinY, int a_MaxY, int a_MinZ, int a_MaxZ) :
+ m_MinX(a_MinX),
+ m_MaxX(a_MaxX),
+ m_MinY(a_MinY),
+ m_MaxY(a_MaxY),
+ m_MinZ(a_MinZ),
+ m_MaxZ(a_MaxZ)
+{
+ // TODO: initialize strides
+}
+
+
+
+
+
+void cLightingThread::cLightingBuffer::GetFromWorld(cWorld * a_World)
+{
+ // TODO: Set m_BlockData, m_SkyLight and m_BlockLight from the world's chunks
+}
+
+
+
+
+
+void cLightingThread::cLightingBuffer::SetToWorld (cWorld * a_World)
+{
+ // TODO: Set world's chunks from m_BlockData, m_SkyLight and m_BlockLight
+}
+
+
+
+
+
+void cLightingThread::cLightingBuffer::Process(void)
+{
+ // TODO: Does the actual lighting on this buffer
+}
+
+
+
+