MapblockMeshGenerator: Use more verbose member names (#13244)

This commit is contained in:
DS 2023-10-04 00:28:43 +02:00 committed by GitHub
parent 5a5697273b
commit 8db4381304
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 287 additions and 266 deletions

File diff suppressed because it is too large Load Diff

View File

@ -61,26 +61,35 @@ struct LightFrame {
class MapblockMeshGenerator
{
public:
MeshMakeData *data;
MeshCollector *collector;
MapblockMeshGenerator(MeshMakeData *input, MeshCollector *output,
scene::IMeshManipulator *mm);
void generate();
void renderSingle(content_t node, u8 param2 = 0x00);
const NodeDefManager *nodedef;
scene::IMeshManipulator *meshmanip;
private:
MeshMakeData *const data;
MeshCollector *const collector;
const NodeDefManager *const nodedef;
scene::IMeshManipulator *const meshmanip;
const v3s16 blockpos_nodes;
// options
bool enable_mesh_cache;
const bool enable_mesh_cache;
// current node
v3s16 blockpos_nodes;
v3s16 p;
v3f origin;
MapNode n;
const ContentFeatures *f;
LightPair light;
LightFrame frame;
video::SColor color;
TileSpec tile;
float scale;
struct {
v3s16 p;
v3f origin;
MapNode n;
const ContentFeatures *f;
LightPair light;
LightFrame frame;
video::SColor color;
TileSpec tile;
f32 scale;
} cur_node;
// lighting
void getSmoothLightFrame();
@ -106,21 +115,25 @@ public:
u8 getNodeBoxMask(aabb3f box, u8 solid_neighbors, u8 sametype_neighbors) const;
// liquid-specific
bool top_is_same_liquid;
bool draw_liquid_bottom;
TileSpec tile_liquid;
TileSpec tile_liquid_top;
content_t c_flowing;
content_t c_source;
video::SColor color_liquid_top;
struct NeighborData {
f32 level;
content_t content;
bool is_same_liquid;
struct LiquidData {
struct NeighborData {
f32 level;
content_t content;
bool is_same_liquid;
bool top_is_same_liquid;
};
bool top_is_same_liquid;
bool draw_bottom;
TileSpec tile;
TileSpec tile_top;
content_t c_flowing;
content_t c_source;
video::SColor color_top;
NeighborData neighbors[3][3];
f32 corner_levels[2][2];
};
NeighborData liquid_neighbors[3][3];
f32 corner_levels[2][2];
LiquidData cur_liquid;
void prepareLiquidNodeDrawing();
void getLiquidNeighborhood();
@ -133,16 +146,22 @@ public:
// raillike-specific
// name of the group that enables connecting to raillike nodes of different kind
static const std::string raillike_groupname;
int raillike_group;
struct RaillikeData {
int raillike_group;
};
RaillikeData cur_rail;
bool isSameRail(v3s16 dir);
// plantlike-specific
PlantlikeStyle draw_style;
v3f offset;
float rotate_degree;
bool random_offset_Y;
int face_num;
float plant_height;
struct PlantlikeData {
PlantlikeStyle draw_style;
v3f offset;
float rotate_degree;
bool random_offset_Y;
int face_num;
float plant_height;
};
PlantlikeData cur_plant;
void drawPlantlikeQuad(float rotation, float quad_offset = 0,
bool offset_top_only = false);
@ -171,10 +190,4 @@ public:
// common
void errorUnknownDrawtype();
void drawNode();
public:
MapblockMeshGenerator(MeshMakeData *input, MeshCollector *output,
scene::IMeshManipulator *mm);
void generate();
void renderSingle(content_t node, u8 param2 = 0x00);
};