fork download
  1.  
  2. struct MapgenParams {
  3. int mg_version;
  4. int seed;
  5. int water_level;
  6. int chunksize;
  7. u32 flags;
  8.  
  9. MapgenParams() {
  10. seed = 0;
  11. water_level = 1;
  12. chunksize = 5;
  13. flags = MG_TREES | MG_CAVES | MGV6_BIOME_BLEND;
  14. }
  15.  
  16. static MapgenParams *createMapgenParams(int mgver) {
  17. switch (mgver) {
  18. case 6:
  19. return new MapgenV6Params();
  20. case 7:
  21. return new MapgenV7Params();
  22. default: //instead of complaining, default to 6
  23. return new MapgenV6Params();
  24. }
  25. }
  26.  
  27. };
  28.  
  29. struct MapgenV6Params : public MapgenParams {
  30. float freq_desert;
  31. float freq_beach;
  32. NoiseParams *np_terrain_base;
  33. NoiseParams *np_terrain_higher;
  34. NoiseParams *np_steepness;
  35. NoiseParams *np_height_select;
  36. NoiseParams *np_trees;
  37. NoiseParams *np_mud;
  38. NoiseParams *np_beach;
  39. NoiseParams *np_biome;
  40. NoiseParams *np_cave;
  41.  
  42. MapgenV6Params() {
  43. freq_desert = 0.45;
  44. freq_beach = 0.15;
  45. np_terrain_base = &nparams_v6_def_terrain_base;
  46. np_terrain_higher = &nparams_v6_def_terrain_higher;
  47. np_steepness = &nparams_v6_def_steepness;
  48. np_height_select = &nparams_v6_def_height_select;
  49. np_trees = &nparams_v6_def_trees;
  50. np_mud = &nparams_v6_def_mud;
  51. np_beach = &nparams_v6_def_beach;
  52. np_biome = &nparams_v6_def_biome;
  53. np_cave = &nparams_v6_def_cave;
  54. }
  55. };
  56.  
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty