diff --git a/blockiverse/chunk.cpp b/blockiverse/chunk.cpp new file mode 100644 index 0000000..9895eac --- /dev/null +++ b/blockiverse/chunk.cpp @@ -0,0 +1,26 @@ +/* +** +** Minetest-Blockiverse +** +** Incorporates portions of code from minetest 0.4.10-dev +** +** Blockiverse +** Copyright (C) 2014 Brian Jack +** Distributed as free software using the copyleft +** LGPL Version 3 license: +** https://www.gnu.org/licenses/lgpl-3.0.en.html +** See file LICENSE in ../ +** +** Implementation file chunk.cpp +** +** Blocks and chunks +** +*/ + +#include "chunk.hpp" + +namespace bvmap { + +// code here + +} diff --git a/blockiverse/chunk.hpp b/blockiverse/chunk.hpp new file mode 100644 index 0000000..e0ce574 --- /dev/null +++ b/blockiverse/chunk.hpp @@ -0,0 +1,40 @@ +/* +** +** Minetest-Blockiverse +** +** Incorporates portions of code from minetest 0.4.10-dev +** +** Blockiverse +** Copyright (C) 2014 Brian Jack +** Distributed as free software using the copyleft +** LGPL Version 3 license: +** https://www.gnu.org/licenses/lgpl-3.0.en.html +** See file LICENSE in ../ +** +** Declaration (header) file chunk.hpp +** +** Declarations for chunks and blocks +** +*/ +#ifndef BV_CHUNK_HPP_INCLUDED +#define BV_CHUNK_HPP_INCLUDED + +#include + +namespace bvmap { + + + class Node { + public: + uint16_t blockId; // 0=air/space + uint8_t blkLight; + uint8_t flags; + }; + + class Chunk { + Node cells[16*16*16]; + }; + +} + +#endif // BV_CHUNK_HPP_INCLUDED diff --git a/blockiverse/client.hpp b/blockiverse/client.hpp index 31f0b1f..a696b4a 100644 --- a/blockiverse/client.hpp +++ b/blockiverse/client.hpp @@ -21,6 +21,7 @@ #include "common.hpp" #include "protocol.hpp" +#include "chunk.hpp" #include #include #include @@ -34,7 +35,8 @@ namespace bvclient { using namespace io; using namespace gui; - class Chunk; + typedef bvmap::Chunk Chunk; + typedef bvmap::Node Node; typedef std::shared_ptr chunkPtr; typedef std::map chunkMap; typedef std::map userMap;