diff options
author | paramat <paramat@users.noreply.github.com> | 2017-10-11 01:06:40 +0100 |
---|---|---|
committer | paramat <mat.gregory@virginmedia.com> | 2017-10-29 12:02:55 +0000 |
commit | 241fe649f7357271d5c02c3d5f7a987ad7811d6d (patch) | |
tree | 59ec80835fa44387a3ae4acffc0dc3ef4c712ac1 /src/mg_decoration.h | |
parent | a637107a4e81be88938d68df4deae50e68cf2cd8 (diff) | |
download | minetest-241fe649f7357271d5c02c3d5f7a987ad7811d6d.tar.gz minetest-241fe649f7357271d5c02c3d5f7a987ad7811d6d.tar.bz2 minetest-241fe649f7357271d5c02c3d5f7a987ad7811d6d.zip |
Biome API: Add decoration flags for underground decorations
Add "all_floors" and "all_ceilings" flags for simple and schematic
decorations. Decorations are placed on all floor and/or ceiling surfaces.
Decorations are placed before dungeon generation so placement in dungeons
is not possible.
Add 'getSurfaces()' function to mapgen.cpp that returns 2 arrays of y
coordinates for all floor and ceiling surfaces in a specified node column.
Move 'getHeight()' checks into DecoSimple and DecoSchematic. Delete
'getHeight()' functions.
Diffstat (limited to 'src/mg_decoration.h')
-rw-r--r-- | src/mg_decoration.h | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/mg_decoration.h b/src/mg_decoration.h index 9295d1a20..1ca632f25 100644 --- a/src/mg_decoration.h +++ b/src/mg_decoration.h @@ -42,6 +42,8 @@ enum DecorationType { #define DECO_USE_NOISE 0x08 #define DECO_FORCE_PLACEMENT 0x10 #define DECO_LIQUID_SURFACE 0x20 +#define DECO_ALL_FLOORS 0x40 +#define DECO_ALL_CEILINGS 0x80 extern FlagDesc flagdesc_deco[]; @@ -56,8 +58,7 @@ public: bool canPlaceDecoration(MMVManip *vm, v3s16 p); size_t placeDeco(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax); - virtual size_t generate(MMVManip *vm, PcgRandom *pr, v3s16 p) = 0; - virtual int getHeight() = 0; + virtual size_t generate(MMVManip *vm, PcgRandom *pr, v3s16 p, bool ceiling) = 0; u32 flags = 0; int mapseed = 0; @@ -78,8 +79,7 @@ public: class DecoSimple : public Decoration { public: virtual void resolveNodeNames(); - virtual size_t generate(MMVManip *vm, PcgRandom *pr, v3s16 p); - virtual int getHeight(); + virtual size_t generate(MMVManip *vm, PcgRandom *pr, v3s16 p, bool ceiling); std::vector<content_t> c_decos; s16 deco_height; @@ -93,8 +93,7 @@ class DecoSchematic : public Decoration { public: DecoSchematic() = default; - virtual size_t generate(MMVManip *vm, PcgRandom *pr, v3s16 p); - virtual int getHeight(); + virtual size_t generate(MMVManip *vm, PcgRandom *pr, v3s16 p, bool ceiling); Rotation rotation; Schematic *schematic = nullptr; |