mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-23 04:45:24 +02:00
Schematic decorations: Add 'place_offset_y' placement parameter
For precise control of schematic vertical position relative to the 'place_on' node. Avoids workarounds that add empty nodes to a schematic and therefore reduce performance. Also remove long-unused decoration cutoff code.
This commit is contained in:
@@ -46,21 +46,6 @@ enum DecorationType {
|
||||
extern FlagDesc flagdesc_deco[];
|
||||
|
||||
|
||||
#if 0
|
||||
struct CutoffData {
|
||||
VoxelArea a;
|
||||
Decoration *deco;
|
||||
//v3s16 p;
|
||||
//v3s16 size;
|
||||
//s16 height;
|
||||
|
||||
CutoffData(s16 x, s16 y, s16 z, s16 h) {
|
||||
p = v3s16(x, y, z);
|
||||
height = h;
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
class Decoration : public ObjDef, public NodeResolver {
|
||||
public:
|
||||
Decoration() = default;
|
||||
@@ -71,7 +56,6 @@ public:
|
||||
bool canPlaceDecoration(MMVManip *vm, v3s16 p);
|
||||
size_t placeDeco(Mapgen *mg, u32 blockseed,
|
||||
v3s16 nmin, v3s16 nmax, s16 deco_zero_level);
|
||||
//size_t placeCutoffs(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax);
|
||||
|
||||
virtual size_t generate(MMVManip *vm, PcgRandom *pr, v3s16 p) = 0;
|
||||
virtual int getHeight() = 0;
|
||||
@@ -90,6 +74,7 @@ public:
|
||||
std::unordered_set<u8> biomes;
|
||||
};
|
||||
|
||||
|
||||
class DecoSimple : public Decoration {
|
||||
public:
|
||||
virtual void resolveNodeNames();
|
||||
@@ -102,6 +87,7 @@ public:
|
||||
u8 deco_param2;
|
||||
};
|
||||
|
||||
|
||||
class DecoSchematic : public Decoration {
|
||||
public:
|
||||
DecoSchematic() = default;
|
||||
@@ -110,6 +96,7 @@ public:
|
||||
virtual int getHeight();
|
||||
|
||||
Rotation rotation;
|
||||
s16 place_offset_y = 0;
|
||||
Schematic *schematic = nullptr;
|
||||
};
|
||||
|
||||
@@ -121,6 +108,7 @@ public:
|
||||
};
|
||||
*/
|
||||
|
||||
|
||||
class DecorationManager : public ObjDefManager {
|
||||
public:
|
||||
DecorationManager(IGameDef *gamedef);
|
||||
|
Reference in New Issue
Block a user