chunks,blocks/nodes/...

gh-pages
Brian Jack 2015-01-14 06:19:09 -08:00
parent c5118895dc
commit 5624a72b9a
3 changed files with 69 additions and 1 deletions

26
blockiverse/chunk.cpp Normal file
View File

@ -0,0 +1,26 @@
/*
**
** Minetest-Blockiverse
**
** Incorporates portions of code from minetest 0.4.10-dev
**
** Blockiverse
** Copyright (C) 2014 Brian Jack <gau_veldt@hotmail.com>
** 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
}

40
blockiverse/chunk.hpp Normal file
View File

@ -0,0 +1,40 @@
/*
**
** Minetest-Blockiverse
**
** Incorporates portions of code from minetest 0.4.10-dev
**
** Blockiverse
** Copyright (C) 2014 Brian Jack <gau_veldt@hotmail.com>
** 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 <inttypes.h>
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

View File

@ -21,6 +21,7 @@
#include "common.hpp"
#include "protocol.hpp"
#include "chunk.hpp"
#include <string>
#include <irrlicht.h>
#include <map>
@ -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<Chunk> chunkPtr;
typedef std::map<std::string,chunkPtr> chunkMap;
typedef std::map<std::string,int> userMap;