| 474 | |
| 475 | |
| 476 | void cBlockArea::CopyTo(cBlockArea & a_Into) const |
| 477 | { |
| 478 | if (&a_Into == this) |
| 479 | { |
| 480 | LOGWARNING("Trying to copy a cBlockArea into self, ignoring."); |
| 481 | return; |
| 482 | } |
| 483 | |
| 484 | a_Into.Clear(); |
| 485 | a_Into.SetSize(m_Size.x, m_Size.y, m_Size.z, GetDataTypes()); |
| 486 | a_Into.m_Origin = m_Origin; |
| 487 | int BlockCount = GetBlockCount(); |
| 488 | if (HasBlockTypes()) |
| 489 | { |
| 490 | memcpy(a_Into.m_BlockTypes, m_BlockTypes, BlockCount * sizeof(BLOCKTYPE)); |
| 491 | } |
| 492 | if (HasBlockMetas()) |
| 493 | { |
| 494 | memcpy(a_Into.m_BlockMetas, m_BlockMetas, BlockCount * sizeof(NIBBLETYPE)); |
| 495 | } |
| 496 | if (HasBlockLights()) |
| 497 | { |
| 498 | memcpy(a_Into.m_BlockLight, m_BlockLight, BlockCount * sizeof(NIBBLETYPE)); |
| 499 | } |
| 500 | if (HasBlockSkyLights()) |
| 501 | { |
| 502 | memcpy(a_Into.m_BlockSkyLight, m_BlockSkyLight, BlockCount * sizeof(NIBBLETYPE)); |
| 503 | } |
| 504 | } |
| 505 | |
| 506 | |
| 507 | |