From 0b24efeb005e293a026f2ac8666020cea8316578 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Wed, 14 Mar 2012 20:56:09 +0000 Subject: Split chunk data into separate arrays; decoupled most sources from cChunk.h dependency git-svn-id: http://mc-server.googlecode.com/svn/trunk@411 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/ChunkSender.h | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'source/ChunkSender.h') diff --git a/source/ChunkSender.h b/source/ChunkSender.h index 3c77c4210..b5b58b854 100644 --- a/source/ChunkSender.h +++ b/source/ChunkSender.h @@ -26,7 +26,7 @@ Note that it may be called by world's BroadcastToChunk() if the client is still #pragma once #include "cIsThread.h" -#include "cChunk.h" +#include "ChunkDef.h" #include "packets/cPacket.h" @@ -42,7 +42,7 @@ class cClientHandle; class cChunkSender: public cIsThread, - public cChunkDataCallback + public cChunkDataCollector { typedef cIsThread super; public: @@ -101,18 +101,17 @@ protected: cEvent m_evtRemoved; // Set when removed clients are safe to be deleted // Data about the chunk that is being sent: - char m_BlockData[cChunk::c_BlockDataSize]; - char m_BiomeData[cChunk::c_ChunkWidth * cChunk::c_ChunkWidth]; + // NOTE that m_BlockData[] is inherited from the cChunkDataCollector + BLOCKTYPE m_BiomeData[cChunkDef::Width * cChunkDef::Width]; PacketList m_Packets; // Accumulator for the entity-packets to send // cIsThread override: virtual void Execute(void) override; - // cChunkDataCallback overrides: + // cChunkDataCollector overrides: // (Note that they are called while the ChunkMap's CS is locked - don't do heavy calculations here!) - virtual void BlockData(const char * a_Data) override; - virtual void Entity(cEntity * a_Entity) override; - virtual void BlockEntity(cBlockEntity * a_Entity) override; + virtual void Entity (cEntity * a_Entity) override; + virtual void BlockEntity (cBlockEntity * a_Entity) override; /// Sends the specified chunk to a_Client, or to all chunk clients if a_Client == NULL void SendChunk(int a_ChunkX, int a_ChunkY, int a_ChunkZ, cClientHandle * a_Client); -- cgit v1.2.3