From 3a8d2aa421fcfa11a84a911aaaa6b5aa4e16cab3 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Sat, 18 Feb 2012 20:10:57 +0000 Subject: Substantial cWorld::FastSetBlock() speed up by queueing all such calls and processing them later chunk-wise (makes growing trees in the generator fast again) git-svn-id: http://mc-server.googlecode.com/svn/trunk@295 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cChunk.h | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'source/cChunk.h') diff --git a/source/cChunk.h b/source/cChunk.h index 2576e2412..4453ed16a 100644 --- a/source/cChunk.h +++ b/source/cChunk.h @@ -70,6 +70,21 @@ public: +struct sSetBlock +{ + int x, y, z; + int ChunkX, ChunkZ; + char BlockType, BlockMeta; + + sSetBlock( int a_X, int a_Y, int a_Z, char a_BlockType, char a_BlockMeta ); // absolute block position +}; + +typedef std::list< sSetBlock > sSetBlockList; + + + + + class cChunk { public: @@ -118,7 +133,7 @@ public: void AsyncUnload( cClientHandle* a_Client ); void SetBlock( int a_X, int a_Y, int a_Z, char a_BlockType, char a_BlockMeta ); - void FastSetBlock( int a_X, int a_Y, int a_Z, char a_BlockType, char a_BlockMeta ); // Doesn't force block updates on neighbors, use for simple changes such as grass growing etc. + void FastSetBlock(int a_RelX, int a_RelY, int a_RelZ, char a_BlockType, char a_BlockMeta ); // Doesn't force block updates on neighbors, use for simple changes such as grass growing etc. char GetBlock( int a_X, int a_Y, int a_Z ); char GetBlock( int a_BlockIdx ); -- cgit v1.2.3