summaryrefslogtreecommitdiffstats
path: root/src/NBT
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2015-02-01 14:02:04 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2015-02-01 14:02:04 +0100
commit8b09f6f4eccf72e0604ef912a3f18cdf08dd2d5d (patch)
treecfad74a21138d9fb7e908e9941bad871fe3c00ea /src/NBT
parentd26fe3d9f8c3b298f628aa3f08edbd3656febb08 (diff)
downloadMinedMap-8b09f6f4eccf72e0604ef912a3f18cdf08dd2d5d.tar
MinedMap-8b09f6f4eccf72e0604ef912a3f18cdf08dd2d5d.zip
Handle lighting and depth
Diffstat (limited to 'src/NBT')
-rw-r--r--src/NBT/ByteArrayTag.hpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/NBT/ByteArrayTag.hpp b/src/NBT/ByteArrayTag.hpp
index 2081759..4f2d331 100644
--- a/src/NBT/ByteArrayTag.hpp
+++ b/src/NBT/ByteArrayTag.hpp
@@ -55,9 +55,16 @@ public:
return len;
}
- const uint8_t & operator[](size_t i) const {
+ const uint8_t & get(size_t i) const {
return value[i];
}
+
+ uint8_t getHalf(size_t i) const {
+ if (i % 2)
+ return (value[i/2] >> 4);
+ else
+ return (value[i/2] & 0xf);
+ }
};
}