From 32880153ab76830311d8a1db3a157cd5ac6e5d9c Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Wed, 8 Feb 2012 12:36:54 +0000 Subject: MTRand class is not created in each tick, therefore much improving tick-thread time (now uses ~5 % CPU instead of one full core) git-svn-id: http://mc-server.googlecode.com/svn/trunk@245 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cChunkMap.h | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'source/cChunkMap.h') diff --git a/source/cChunkMap.h b/source/cChunkMap.h index f2d1f4468..9cab98221 100644 --- a/source/cChunkMap.h +++ b/source/cChunkMap.h @@ -1,8 +1,19 @@ + #pragma once + + + + class cWorld; class cEntity; class cChunk; +class MTRand; + + + + + class cChunkMap { public: @@ -15,7 +26,7 @@ public: cChunk* GetChunk( int a_X, int a_Y, int a_Z ); void RemoveChunk( cChunk* a_Chunk ); - void Tick( float a_Dt ); + void Tick( float a_Dt, MTRand & a_TickRand ); void UnloadUnusedChunks(); bool RemoveEntityFromChunk( cEntity & a_Entity, cChunk* a_CalledFrom = 0 ); @@ -24,7 +35,9 @@ public: cWorld* GetWorld() { return m_World; } int GetNumChunks(); + private: + class cChunkData { public: @@ -75,3 +88,7 @@ private: cWorld* m_World; }; + + + + -- cgit v1.2.3