mapgen_v5.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. Minetest
  3. Copyright (C) 2014-2017 paramat
  4. Copyright (C) 2014-2016 kwolekr, Ryan Kwolek <kwolekr@minetest.net>
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU Lesser General Public License as published by
  7. the Free Software Foundation; either version 2.1 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU Lesser General Public License for more details.
  13. You should have received a copy of the GNU Lesser General Public License along
  14. with this program; if not, write to the Free Software Foundation, Inc.,
  15. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  16. */
  17. #ifndef MAPGEN_V5_HEADER
  18. #define MAPGEN_V5_HEADER
  19. #include "mapgen.h"
  20. #define MGV5_LARGE_CAVE_DEPTH -256
  21. ///////// Mapgen V5 flags
  22. #define MGV5_CAVERNS 0x01
  23. class BiomeManager;
  24. extern FlagDesc flagdesc_mapgen_v5[];
  25. struct MapgenV5Params : public MapgenParams
  26. {
  27. u32 spflags = MGV5_CAVERNS;
  28. float cave_width = 0.125f;
  29. s16 cavern_limit = -256;
  30. s16 cavern_taper = 256;
  31. float cavern_threshold = 0.7f;
  32. NoiseParams np_filler_depth;
  33. NoiseParams np_factor;
  34. NoiseParams np_height;
  35. NoiseParams np_ground;
  36. NoiseParams np_cave1;
  37. NoiseParams np_cave2;
  38. NoiseParams np_cavern;
  39. MapgenV5Params();
  40. ~MapgenV5Params() {}
  41. void readParams(const Settings *settings);
  42. void writeParams(Settings *settings) const;
  43. };
  44. class MapgenV5 : public MapgenBasic
  45. {
  46. public:
  47. MapgenV5(int mapgenid, MapgenV5Params *params, EmergeManager *emerge);
  48. ~MapgenV5();
  49. virtual MapgenType getType() const { return MAPGEN_V5; }
  50. virtual void makeChunk(BlockMakeData *data);
  51. int getSpawnLevelAtPoint(v2s16 p);
  52. int generateBaseTerrain();
  53. private:
  54. Noise *noise_factor;
  55. Noise *noise_height;
  56. Noise *noise_ground;
  57. };
  58. #endif