summaryrefslogtreecommitdiff
path: root/src/farmesh.cpp
Commit message (Expand)AuthorAge
* Remove texture atlas / AtlasPointer, rename getTextureRaw to getTextureKahrl2013-07-02
* Migrate to STL containers/algorithms.Ilya Zhuravlev2013-03-11
* Update Copyright YearsSfan52013-02-24
* Change Minetest-c55 to MinetestPilzAdam2013-02-24
* The new mapgen, noise functions, et al.kwolekr2013-01-21
* Switch the license to be LGPLv2/later, with small parts still remaining as GP...Perttu Ahola2012-06-05
* Generate beachesPerttu Ahola2012-03-29
* Move ClientMap to clientmap.{h,cpp}Perttu Ahola2012-03-16
* Clean mapnode.h and fix other files accordinglyPerttu Ahola2011-11-29
* Fixed farmesh to such that it was a long time ago.Perttu Ahola2011-08-03
* Merge branch 'upstream/master'Nils Dagsson Moskopp2011-07-14
|\
| * changed water color in farmeshPerttu Ahola2011-06-26
* | + farmesh config optionsJiří Procházka2011-07-11
|/
* moved map generator to separate source filesPerttu Ahola2011-06-25
* New map generator added (and SQLite, messed up the commits at that time...) (...Perttu Ahola2011-06-25
* farmesh render range is now dynamicPerttu Ahola2011-06-18
* fixed tree placement in farmeshPerttu Ahola2011-06-18
* farmesh is now usable.Perttu Ahola2011-06-18
* Added an experimental "far view" thing. Doesn't work exactly like it should a...Perttu Ahola2011-06-07
he Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef MG_DECORATION_HEADER #define MG_DECORATION_HEADER #include <set> #include "objdef.h" #include "noise.h" #include "nodedef.h" class Mapgen; class MMVManip; class PseudoRandom; class Schematic; enum DecorationType { DECO_SIMPLE, DECO_SCHEMATIC, DECO_LSYSTEM }; #define DECO_PLACE_CENTER_X 0x01 #define DECO_PLACE_CENTER_Y 0x02 #define DECO_PLACE_CENTER_Z 0x04 #define DECO_USE_NOISE 0x08 #define DECO_FORCE_PLACEMENT 0x10 #define DECO_LIQUID_SURFACE 0x20 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(); virtual ~Decoration(); virtual void resolveNodeNames(); size_t placeDeco(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax); //size_t placeCutoffs(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax); virtual size_t generate(MMVManip *vm, PseudoRandom *pr, v3s16 p) = 0; virtual int getHeight() = 0; u32 flags; int mapseed; std::vector<content_t> c_place_on; s16 sidelen; s16 y_min; s16 y_max; float fill_ratio; NoiseParams np; std::set<u8> biomes; //std::list<CutoffData> cutoffs; //Mutex cutoff_mutex; }; class DecoSimple : public Decoration { public: virtual size_t generate(MMVManip *vm, PseudoRandom *pr, v3s16 p); bool canPlaceDecoration(MMVManip *vm, v3s16 p); virtual int getHeight(); virtual void resolveNodeNames(); std::vector<content_t> c_decos; std::vector<content_t> c_spawnby; s16 deco_height; s16 deco_height_max; s16 nspawnby; }; class DecoSchematic : public Decoration { public: DecoSchematic(); virtual size_t generate(MMVManip *vm, PseudoRandom *pr, v3s16 p); virtual int getHeight(); Rotation rotation; Schematic *schematic; }; /* class DecoLSystem : public Decoration { public: virtual void generate(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax); }; */ class DecorationManager : public ObjDefManager { public: DecorationManager(IGameDef *gamedef); virtual ~DecorationManager() {} const char *getObjectTitle() const { return "decoration"; } static Decoration *create(DecorationType type) { switch (type) { case DECO_SIMPLE: return new DecoSimple; case DECO_SCHEMATIC: return new DecoSchematic; //case DECO_LSYSTEM: // return new DecoLSystem; default: return NULL; } } size_t placeAllDecos(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax); }; #endif