summaryrefslogtreecommitdiff
path: root/src/mapgen/mg_ore.h
diff options
context:
space:
mode:
authorParamat <paramat@users.noreply.github.com>2020-05-20 22:16:14 +0100
committerGitHub <noreply@github.com>2020-05-20 22:16:14 +0100
commit42fcfb75e85523a2fa5d99a453c2fabc2c04c0f6 (patch)
tree5a76856ca96330263cce9fae1985172b671c8324 /src/mapgen/mg_ore.h
parentc47a680db7f3c2f241cc444a1257607492872412 (diff)
downloadminetest-42fcfb75e85523a2fa5d99a453c2fabc2c04c0f6.tar.gz
minetest-42fcfb75e85523a2fa5d99a453c2fabc2c04c0f6.tar.bz2
minetest-42fcfb75e85523a2fa5d99a453c2fabc2c04c0f6.zip
Allow more than 255 biomes, document new maximum (#9855)
Change biomemap data type from u8 to u16. New technical (not practical) maximum is 65535 biomes.
Diffstat (limited to 'src/mapgen/mg_ore.h')
-rw-r--r--src/mapgen/mg_ore.h22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/mapgen/mg_ore.h b/src/mapgen/mg_ore.h
index 213bdc964..76420fab4 100644
--- a/src/mapgen/mg_ore.h
+++ b/src/mapgen/mg_ore.h
@@ -1,7 +1,7 @@
/*
Minetest
-Copyright (C) 2014-2018 kwolekr, Ryan Kwolek <kwolekr@minetest.net>
-Copyright (C) 2015-2018 paramat
+Copyright (C) 2015-2020 paramat
+Copyright (C) 2014-2016 kwolekr, Ryan Kwolek <kwolekr@minetest.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@@ -25,6 +25,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "noise.h"
#include "nodedef.h"
+typedef u16 biome_t; // copy from mg_biome.h to avoid an unnecessary include
+
class Noise;
class Mapgen;
class MMVManip;
@@ -64,7 +66,7 @@ public:
float nthresh; // threshold for noise at which an ore is placed
NoiseParams np; // noise for distribution of clusters (NULL for uniform scattering)
Noise *noise = nullptr;
- std::unordered_set<u8> biomes;
+ std::unordered_set<biome_t> biomes;
Ore() = default;;
virtual ~Ore();
@@ -73,7 +75,7 @@ public:
size_t placeOre(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax);
virtual void generate(MMVManip *vm, int mapseed, u32 blockseed,
- v3s16 nmin, v3s16 nmax, u8 *biomemap) = 0;
+ v3s16 nmin, v3s16 nmax, biome_t *biomemap) = 0;
protected:
void cloneTo(Ore *def) const;
@@ -86,7 +88,7 @@ public:
ObjDef *clone() const;
virtual void generate(MMVManip *vm, int mapseed, u32 blockseed,
- v3s16 nmin, v3s16 nmax, u8 *biomemap);
+ v3s16 nmin, v3s16 nmax, biome_t *biomemap);
};
class OreSheet : public Ore {
@@ -100,7 +102,7 @@ public:
float column_midpoint_factor;
virtual void generate(MMVManip *vm, int mapseed, u32 blockseed,
- v3s16 nmin, v3s16 nmax, u8 *biomemap);
+ v3s16 nmin, v3s16 nmax, biome_t *biomemap);
};
class OrePuff : public Ore {
@@ -118,7 +120,7 @@ public:
virtual ~OrePuff();
virtual void generate(MMVManip *vm, int mapseed, u32 blockseed,
- v3s16 nmin, v3s16 nmax, u8 *biomemap);
+ v3s16 nmin, v3s16 nmax, biome_t *biomemap);
};
class OreBlob : public Ore {
@@ -128,7 +130,7 @@ public:
ObjDef *clone() const;
virtual void generate(MMVManip *vm, int mapseed, u32 blockseed,
- v3s16 nmin, v3s16 nmax, u8 *biomemap);
+ v3s16 nmin, v3s16 nmax, biome_t *biomemap);
};
class OreVein : public Ore {
@@ -145,7 +147,7 @@ public:
virtual ~OreVein();
virtual void generate(MMVManip *vm, int mapseed, u32 blockseed,
- v3s16 nmin, v3s16 nmax, u8 *biomemap);
+ v3s16 nmin, v3s16 nmax, biome_t *biomemap);
};
class OreStratum : public Ore {
@@ -162,7 +164,7 @@ public:
virtual ~OreStratum();
virtual void generate(MMVManip *vm, int mapseed, u32 blockseed,
- v3s16 nmin, v3s16 nmax, u8 *biomemap);
+ v3s16 nmin, v3s16 nmax, biome_t *biomemap);
};
class OreManager : public ObjDefManager {