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