From 2892a844d43d4c0e8209ad1efc0b135a957a4b8d Mon Sep 17 00:00:00 2001 From: faketruth Date: Sat, 24 Dec 2011 23:34:30 +0000 Subject: Chunks are generated in a separate thread allowing players to keep on playing and chatting while chunks are generated. This means, however, that cWorld::GetChunk() does not always return a chunk and is something you need to be aware of. I am not entirely sure if all this is completely stable, but I think so :O Chunks are now generated before the player is able to see them. This is done because after a chunks is done generating, some blocks might still need to be set (parts of trees from neighboring chunk), causing more bandwidth to be used (each changed block needs to be sent to clients again) and (fps) lagging the clients when changing a lot of blocks. Calculating ahead fixes these issues. Separated the placing of foliage (trees and stuff) when generated chunks into a new function GenerateFoliage() Cleaned up the VS2010 project, now using some VS2010 specific functions like dependencies on projects (no need for setting library dependencies manually). VS2010 project now compiles way faster in Release by using multi threading. git-svn-id: http://mc-server.googlecode.com/svn/trunk@103 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cChunkMap.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source/cChunkMap.cpp') diff --git a/source/cChunkMap.cpp b/source/cChunkMap.cpp index 855318159..2f8339176 100644 --- a/source/cChunkMap.cpp +++ b/source/cChunkMap.cpp @@ -208,6 +208,8 @@ void cChunkMap::AddChunk( cChunk* a_Chunk ) const int LocalZ = a_Chunk->GetPosZ() - LayerZ * LAYER_SIZE; if( FoundLayer->m_Chunks[ LocalX + LocalZ * LAYER_SIZE ].m_LiveChunk ) LOGWARN("WARNING: Added chunk to layer while it was already loaded!"); + if( FoundLayer->m_Chunks[ LocalX + LocalZ * LAYER_SIZE ].m_Compressed ) + LOGWARN("WARNING: Added chunk to layer while a compressed version exists!"); FoundLayer->m_Chunks[ LocalX + LocalZ * LAYER_SIZE ].m_LiveChunk = a_Chunk; FoundLayer->m_NumChunksLoaded++; } -- cgit v1.2.3