summaryrefslogtreecommitdiff
path: root/src/mg_decoration.h
diff options
context:
space:
mode:
authorparamat <paramat@users.noreply.github.com>2017-09-06 22:20:09 +0100
committerparamat <mat.gregory@virginmedia.com>2017-09-10 01:31:30 +0100
commit51002b1629c69adb0053bc36d3667d2b790e5c21 (patch)
tree1b92288c9c9403e3385371b2bc2589bfc70f711f /src/mg_decoration.h
parent557bbc670451f82c384032383df80a1a92ffe724 (diff)
downloadminetest-51002b1629c69adb0053bc36d3667d2b790e5c21.tar.gz
minetest-51002b1629c69adb0053bc36d3667d2b790e5c21.tar.bz2
minetest-51002b1629c69adb0053bc36d3667d2b790e5c21.zip
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.
Diffstat (limited to 'src/mg_decoration.h')
-rw-r--r--src/mg_decoration.h20
1 files changed, 4 insertions, 16 deletions
diff --git a/src/mg_decoration.h b/src/mg_decoration.h
index fd6e89e79..01e063ca2 100644
--- a/src/mg_decoration.h
+++ b/src/mg_decoration.h
@@ -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);