1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-09-15 18:57:08 +00:00

Add L-system trees as decorations (#14355)

This commit is contained in:
cx384 2024-03-12 20:10:28 +01:00 committed by GitHub
parent f07e1026ac
commit 60810c2d37
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 125 additions and 46 deletions

View file

@ -31,6 +31,7 @@ class Mapgen;
class MMVManip;
class PcgRandom;
class Schematic;
namespace treegen { struct TreeDef; }
enum DecorationType {
DECO_SIMPLE,
@ -112,12 +113,15 @@ public:
};
/*
class DecoLSystem : public Decoration {
public:
virtual void generate(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax);
ObjDef *clone() const;
virtual size_t generate(MMVManip *vm, PcgRandom *pr, v3s16 p, bool ceiling);
// In case it gets cloned it uses the same tree def.
std::shared_ptr<treegen::TreeDef> tree_def;
};
*/
class DecorationManager : public ObjDefManager {
@ -139,8 +143,8 @@ public:
return new DecoSimple;
case DECO_SCHEMATIC:
return new DecoSchematic;
//case DECO_LSYSTEM:
// return new DecoLSystem;
case DECO_LSYSTEM:
return new DecoLSystem;
default:
return NULL;
}