From 8a8a41a800dfe9bdcab934d6b53d9c6defd4a457 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 1 Feb 2015 04:14:42 +0100 Subject: Parse chunk data on demand --- src/World/Chunk.cpp | 1 - src/World/Chunk.hpp | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'src/World') diff --git a/src/World/Chunk.cpp b/src/World/Chunk.cpp index fb46466..db286ee 100644 --- a/src/World/Chunk.cpp +++ b/src/World/Chunk.cpp @@ -82,7 +82,6 @@ Chunk::Chunk(uint8_t *buffer, size_t buflen) { if (format != 2) throw std::invalid_argument("unknown chunk format"); - UniqueCPtr data; size_t len; std::tie(data, len) = inflateChunk(buffer+5, size-1); diff --git a/src/World/Chunk.hpp b/src/World/Chunk.hpp index 3ed6cf4..5b0ecdb 100644 --- a/src/World/Chunk.hpp +++ b/src/World/Chunk.hpp @@ -43,6 +43,8 @@ public: static const size_t SIZE = 16; private: + UniqueCPtr data; + static std::pair, size_t> inflateChunk(uint8_t *data, size_t len); std::shared_ptr> sections; -- cgit v1.2.3