X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Fmapblock_mesh.h;h=7f52317383a02435930a98983e7525299f7667c4;hb=dec8c43de3afdbd2e257a031f5e053e7f1e74aa0;hp=5b33990c602fd6ce863bfda4b63173f413267a96;hpb=6d0ea26c2d62c3774ff384cf1bfc2a3372b49a3b;p=oweals%2Fminetest.git diff --git a/src/mapblock_mesh.h b/src/mapblock_mesh.h index 5b33990c6..7f5231738 100644 --- a/src/mapblock_mesh.h +++ b/src/mapblock_mesh.h @@ -81,7 +81,7 @@ class MapBlockMesh { public: // Builds the mesh given - MapBlockMesh(MeshMakeData *data); + MapBlockMesh(MeshMakeData *data, v3s16 camera_offset); ~MapBlockMesh(); // Main animation function, parameters: @@ -107,6 +107,8 @@ public: if(m_animation_force_timer > 0) m_animation_force_timer--; } + + void updateCameraOffset(v3s16 camera_offset); private: scene::SMesh *m_mesh; @@ -133,6 +135,9 @@ private: u32 m_last_daynight_ratio; // For each meshbuffer, maps vertex indices to (day,night) pairs std::map > > m_daynight_diffs; + + // Camera offset info -> do we have to translate the mesh? + v3s16 m_camera_offset; }; @@ -143,13 +148,13 @@ private: struct PreMeshBuffer { TileSpec tile; - core::array indices; - core::array vertices; + std::vector indices; + std::vector vertices; }; struct MeshCollector { - core::array prebuffers; + std::vector prebuffers; void append(const TileSpec &material, const video::S3DVertex *vertices, u32 numVertices, @@ -167,8 +172,8 @@ inline video::SColor MapBlock_LightColor(u8 alpha, u16 light, u8 light_source=0) } // Compute light at node -u16 getInteriorLight(MapNode n, s32 increment, MeshMakeData *data); -u16 getFaceLight(MapNode n, MapNode n2, v3s16 face_dir, MeshMakeData *data); +u16 getInteriorLight(MapNode n, s32 increment, INodeDefManager *ndef); +u16 getFaceLight(MapNode n, MapNode n2, v3s16 face_dir, INodeDefManager *ndef); u16 getSmoothLight(v3s16 p, v3s16 corner, MeshMakeData *data); // Retrieves the TileSpec of a face of a node