1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-01 17:38:41 +00:00

Decouple MeshMakeData from Client

This commit is contained in:
numzero 2023-06-18 18:37:31 +03:00 committed by rubenwardy
parent 2f35b121a4
commit bf2098c07f
6 changed files with 36 additions and 34 deletions

View file

@ -27,6 +27,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include <unordered_map>
class Client;
class NodeDefManager;
class IShaderSource;
/*
@ -43,13 +44,12 @@ struct MeshMakeData
v3s16 m_blockpos = v3s16(-1337,-1337,-1337);
v3s16 m_crack_pos_relative = v3s16(-1337,-1337,-1337);
bool m_smooth_lighting = false;
MeshGrid m_mesh_grid;
u16 side_length;
Client *m_client;
const NodeDefManager *nodedef;
bool m_use_shaders;
MeshMakeData(Client *client, bool use_shaders);
MeshMakeData(const NodeDefManager *ndef, u16 side_length, bool use_shaders);
/*
Copy block data manually (to allow optimizations by the caller)
@ -179,7 +179,7 @@ class MapBlockMesh
{
public:
// Builds the mesh given
MapBlockMesh(MeshMakeData *data, v3s16 camera_offset);
MapBlockMesh(Client *client, MeshMakeData *data, v3s16 camera_offset);
~MapBlockMesh();
// Main animation function, parameters: