diff options
author | Mattes D <github@xoft.cz> | 2014-05-31 10:12:54 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-05-31 10:12:54 +0200 |
commit | 0b758946ace41563a1763f557298879c894e56c2 (patch) | |
tree | 8ba9e2a3703c34ae317bd157f559bc72813805d9 /src/LightingThread.cpp | |
parent | Fixed bindings for cCompositeChat:SetMessageType(). (diff) | |
parent | Reduced the number of cChunkData::CopyBlockTypes() tests, added progress. (diff) | |
download | cuberite-0b758946ace41563a1763f557298879c894e56c2.tar cuberite-0b758946ace41563a1763f557298879c894e56c2.tar.gz cuberite-0b758946ace41563a1763f557298879c894e56c2.tar.bz2 cuberite-0b758946ace41563a1763f557298879c894e56c2.tar.lz cuberite-0b758946ace41563a1763f557298879c894e56c2.tar.xz cuberite-0b758946ace41563a1763f557298879c894e56c2.tar.zst cuberite-0b758946ace41563a1763f557298879c894e56c2.zip |
Diffstat (limited to '')
-rw-r--r-- | src/LightingThread.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/LightingThread.cpp b/src/LightingThread.cpp index 5459644af..dc19bf500 100644 --- a/src/LightingThread.cpp +++ b/src/LightingThread.cpp @@ -18,20 +18,17 @@ class cReader : public cChunkDataCallback { - virtual void BlockTypes(const BLOCKTYPE * a_Type) override + virtual void ChunkData(const cChunkData & a_ChunkBuffer) override { - // ROW is a block of 16 Blocks, one whole row is copied at a time (hopefully the compiler will optimize that) - // C++ doesn't permit copying arrays, but arrays as a part of a struct is ok :) - typedef struct {BLOCKTYPE m_Row[16]; } ROW; - ROW * InputRows = (ROW *)a_Type; - ROW * OutputRows = (ROW *)m_BlockTypes; + BLOCKTYPE * OutputRows = m_BlockTypes; int InputIdx = 0; int OutputIdx = m_ReadingChunkX + m_ReadingChunkZ * cChunkDef::Width * 3; for (int y = 0; y < cChunkDef::Height; y++) { for (int z = 0; z < cChunkDef::Width; z++) { - OutputRows[OutputIdx] = InputRows[InputIdx++]; + a_ChunkBuffer.CopyBlockTypes(OutputRows + OutputIdx * 16, InputIdx * 16, 16); + InputIdx++; OutputIdx += 3; } // for z // Skip into the next y-level in the 3x3 chunk blob; each level has cChunkDef::Width * 9 rows |