| 246 | |
| 247 | |
| 248 | void cBlockArea::Create(int a_SizeX, int a_SizeY, int a_SizeZ, int a_DataTypes) |
| 249 | { |
| 250 | Clear(); |
| 251 | int BlockCount = a_SizeX * a_SizeY * a_SizeZ; |
| 252 | if ((a_DataTypes & baTypes) != 0) |
| 253 | { |
| 254 | m_BlockTypes = new BLOCKTYPE[BlockCount]; |
| 255 | for (int i = 0; i < BlockCount; i++) |
| 256 | { |
| 257 | m_BlockTypes[i] = E_BLOCK_AIR; |
| 258 | } |
| 259 | } |
| 260 | if ((a_DataTypes & baMetas) != 0) |
| 261 | { |
| 262 | m_BlockMetas = new NIBBLETYPE[BlockCount]; |
| 263 | for (int i = 0; i < BlockCount; i++) |
| 264 | { |
| 265 | m_BlockMetas[i] = 0; |
| 266 | } |
| 267 | } |
| 268 | if ((a_DataTypes & baLight) != 0) |
| 269 | { |
| 270 | m_BlockLight = new NIBBLETYPE[BlockCount]; |
| 271 | for (int i = 0; i < BlockCount; i++) |
| 272 | { |
| 273 | m_BlockLight[i] = 0; |
| 274 | } |
| 275 | } |
| 276 | if ((a_DataTypes & baSkyLight) != 0) |
| 277 | { |
| 278 | m_BlockSkyLight = new NIBBLETYPE[BlockCount]; |
| 279 | for (int i = 0; i < BlockCount; i++) |
| 280 | { |
| 281 | m_BlockSkyLight[i] = 0x0f; |
| 282 | } |
| 283 | } |
| 284 | m_Size.Set(a_SizeX, a_SizeY, a_SizeZ); |
| 285 | m_Origin.Set(0, 0, 0); |
| 286 | } |
| 287 | |
| 288 | |
| 289 | |