summaryrefslogtreecommitdiffstats
path: root/src/world/Section.cpp
diff options
context:
space:
mode:
authorLaG1924 <12997935+LaG1924@users.noreply.github.com>2017-06-21 16:26:25 +0200
committerLaG1924 <12997935+LaG1924@users.noreply.github.com>2017-06-21 16:26:25 +0200
commitf5aa7827af55342a1ec714d366944b3e3f3129b2 (patch)
tree4f4885d2ae0f46004a22e7d4dc34f80c11ecee0c /src/world/Section.cpp
parent2017-06-20 (diff)
downloadAltCraft-f5aa7827af55342a1ec714d366944b3e3f3129b2.tar
AltCraft-f5aa7827af55342a1ec714d366944b3e3f3129b2.tar.gz
AltCraft-f5aa7827af55342a1ec714d366944b3e3f3129b2.tar.bz2
AltCraft-f5aa7827af55342a1ec714d366944b3e3f3129b2.tar.lz
AltCraft-f5aa7827af55342a1ec714d366944b3e3f3129b2.tar.xz
AltCraft-f5aa7827af55342a1ec714d366944b3e3f3129b2.tar.zst
AltCraft-f5aa7827af55342a1ec714d366944b3e3f3129b2.zip
Diffstat (limited to '')
-rw-r--r--src/world/Section.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/world/Section.cpp b/src/world/Section.cpp
index 8f94ad7..a338e49 100644
--- a/src/world/Section.cpp
+++ b/src/world/Section.cpp
@@ -1,8 +1,11 @@
-#include "Section.hpp"
+#include <world/Section.hpp>
-Section::Section(byte *dataBlocks, size_t dataBlocksLength, byte *dataLight, byte *dataSky, byte bitsPerBlock,
+Section::Section(Vector position, byte *dataBlocks, size_t dataBlocksLength, byte *dataLight, byte *dataSky,
+ byte bitsPerBlock,
std::vector<unsigned short> palette) {
+ worldPosition = position;
+
m_dataBlocksLen = dataBlocksLength;
m_dataBlocks = new byte[m_dataBlocksLen];
std::copy(dataBlocks, dataBlocks + m_dataBlocksLen, m_dataBlocks);
@@ -97,7 +100,7 @@ void Section::Parse() {
}
Section &Section::operator=(Section other) {
- std::swap(*this,other);
+ std::swap(*this, other);
return *this;
}
@@ -113,6 +116,7 @@ void swap(Section &a, Section &b) {
}
Section::Section(const Section &other) {
+ worldPosition = other.worldPosition;
m_dataBlocksLen = other.m_dataBlocksLen;
m_dataBlocks = new byte[m_dataBlocksLen];
std::copy(other.m_dataBlocks, other.m_dataBlocks + m_dataBlocksLen, m_dataBlocks);
@@ -127,4 +131,8 @@ Section::Section(const Section &other) {
m_palette = other.m_palette;
m_bitsPerBlock = other.m_bitsPerBlock;
-} \ No newline at end of file
+}
+
+Vector Section::GetPosition() {
+ return worldPosition;
+}