From d64d9145d1d84caaf21a906d5924c3855988fa33 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Sat, 29 Mar 2014 22:56:16 +0100 Subject: cPrefab now uses a struct for block type definition in CharMap. As suggested by worktycho in 7b585290fccd3dc074b1f9feef0af754ab3dd632, instead of packing the two values into a single int, they're packed into a struct. Also added a test code for the prefab parsing in SELF_TEST. --- src/Generating/Prefab.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/Generating/Prefab.h') diff --git a/src/Generating/Prefab.h b/src/Generating/Prefab.h index 0b254c03b..04c4f09da 100644 --- a/src/Generating/Prefab.h +++ b/src/Generating/Prefab.h @@ -53,8 +53,15 @@ public: bool HasConnectorType(int a_ConnectorType) const; protected: + /** Packs complete definition of a single block, for per-letter assignment. */ + struct sBlockTypeDef + { + BLOCKTYPE m_BlockType; + NIBBLETYPE m_BlockMeta; + }; + /** Maps letters in the sDef::m_Image onto a number, BlockType * 16 | BlockMeta */ - typedef int CharMap[256]; + typedef sBlockTypeDef CharMap[256]; /** The cBlockArea that contains the block definitions for the prefab. -- cgit v1.2.3