diff options
Diffstat (limited to 'src/client/mapblock_mesh.h')
-rw-r--r-- | src/client/mapblock_mesh.h | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/src/client/mapblock_mesh.h b/src/client/mapblock_mesh.h index 7f6185c3a..82e9a0f22 100644 --- a/src/client/mapblock_mesh.h +++ b/src/client/mapblock_mesh.h @@ -24,6 +24,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "voxel.h" #include <array> #include <map> +#include <unordered_map> class Client; class IShaderSource; @@ -42,6 +43,7 @@ struct MeshMakeData v3s16 m_blockpos = v3s16(-1337,-1337,-1337); v3s16 m_crack_pos_relative = v3s16(-1337,-1337,-1337); bool m_smooth_lighting = false; + u16 side_length = MAP_BLOCKSIZE; Client *m_client; bool m_use_shaders; @@ -55,12 +57,6 @@ struct MeshMakeData void fillBlockData(const v3s16 &block_offset, MapNode *data); /* - Copy central data directly from block, and other data from - parent of block. - */ - void fill(MapBlock *block); - - /* Set the (node) position of a crack */ void setCrack(int crack_level, v3s16 crack_pos); @@ -108,7 +104,7 @@ class MapBlockBspTree public: MapBlockBspTree() {} - void buildTree(const std::vector<MeshTriangle> *triangles); + void buildTree(const std::vector<MeshTriangle> *triangles, u16 side_lingth); void traverse(v3f viewpoint, std::vector<s32> &output) const { @@ -203,11 +199,11 @@ public: return m_mesh[layer]; } - MinimapMapblock *moveMinimapMapblock() + std::vector<MinimapMapblock*> moveMinimapMapblocks() { - MinimapMapblock *p = m_minimap_mapblock; - m_minimap_mapblock = NULL; - return p; + std::vector<MinimapMapblock*> minimap_mapblocks; + minimap_mapblocks.swap(m_minimap_mapblocks); + return minimap_mapblocks; } bool isAnimationForced() const @@ -245,7 +241,7 @@ private: }; scene::IMesh *m_mesh[MAX_TILE_LAYERS]; - MinimapMapblock *m_minimap_mapblock; + std::vector<MinimapMapblock*> m_minimap_mapblocks; ITextureSource *m_tsrc; IShaderSource *m_shdrsrc; @@ -344,4 +340,4 @@ void getNodeTile(MapNode mn, const v3s16 &p, const v3s16 &dir, MeshMakeData *dat /// Return bitset of the sides of the mapblock that consist of solid nodes only /// Bits: /// 0 0 -Z +Z -X +X -Y +Y -u8 get_solid_sides(MeshMakeData *data); +std::unordered_map<v3s16, u8> get_solid_sides(MeshMakeData *data); |