summaryrefslogtreecommitdiffstats
path: root/source/cLuaChunk.h
blob: 5e1395a4cae043cfb981595eaf11bba56d1befdc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#pragma once

#include "ChunkDef.h"

class cLuaChunk			//tolua_export
{						//tolua_export
public:
	cLuaChunk( cChunkDef::BlockTypes   & a_BlockTypes
	         , cChunkDef::BlockNibbles & a_BlockNibbles 
			 , cChunkDef::HeightMap    & a_HeightMap
			 , cChunkDef::BiomeMap     & a_BiomeMap
			 )
		: m_BiomeMap( a_BiomeMap )
		, m_BlockTypes( a_BlockTypes )
		, m_BlockMeta( a_BlockNibbles )
		, m_HeightMap( a_HeightMap )
	{}
	~cLuaChunk()
	{}

	void SetBlock( const Vector3i & a_Pos, char a_BlockID, unsigned char a_BlockMeta )	//tolua_export
	{	//tolua_export
	}	//tolua_export

	void FillBlocks( char a_BlockID, unsigned char a_BlockMeta )	//tolua_export
	{	//tolua_export
		const NIBBLETYPE CompressedMeta = a_BlockMeta | a_BlockMeta << 4;
		memset( m_BlockTypes, a_BlockID, sizeof( cChunkDef::BlockTypes ) );
		memset( m_BlockMeta, CompressedMeta, sizeof( cChunkDef::BlockNibbles ) );

		memset( m_BiomeMap, 0, sizeof( cChunkDef::BiomeMap ) );
		memset( m_HeightMap, 0, sizeof( cChunkDef::HeightMap ) );
	}	//tolua_export
private:
	EMCSBiome  * m_BiomeMap;
	BLOCKTYPE  * m_BlockTypes;
	NIBBLETYPE * m_BlockMeta;
	HEIGHTTYPE * m_HeightMap;
};	//tolua_export