From c35db25269ea9549b996cd18c65b05a9f8d43387 Mon Sep 17 00:00:00 2001 From: faketruth Date: Mon, 26 Dec 2011 02:13:40 +0000 Subject: Made some functions in cChunk and cNoise inline, this should significantly increase chunk generation speed git-svn-id: http://mc-server.googlecode.com/svn/trunk@115 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cChunk.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'source/cChunk.h') diff --git a/source/cChunk.h b/source/cChunk.h index 0145908f5..b18a763b2 100644 --- a/source/cChunk.h +++ b/source/cChunk.h @@ -111,7 +111,12 @@ private: void CreateBlockEntities(); - unsigned int MakeIndex(int x, int y, int z ); + inline unsigned int cChunk::MakeIndex(int x, int y, int z ) + { + if( x < 16 && x > -1 && y < 128 && y > -1 && z < 16 && z > -1 ) + return y + (z * 128) + (x * 128 * 16); + return 0; + } bool m_bCalculateLighting; bool m_bCalculateHeightmap; -- cgit v1.2.3