35 #ifndef PROT_INT_BUFFER_SIZE
36 #define PROT_INT_BUFFER_SIZE 900
62 virtual void GetInts(
int a_MinX,
int a_MinZ,
size_t a_SizeX,
size_t a_SizeZ,
int *a_Values) = 0;
89 return ((rnd & 1) == 0) ? a_Val1 : a_Val2;
93 int chooseRandomOne(
int a_RndX,
int a_RndZ,
int a_Val1,
int a_Val2,
int a_Val3,
int a_Val4)
98 case 0:
return a_Val1;
99 case 1:
return a_Val2;
100 case 2:
return a_Val3;
101 default:
return a_Val4;
125 virtual void GetInts(
int a_MinX,
int a_MinZ,
size_t a_SizeX,
size_t a_SizeZ,
int *a_Values)
override
127 for (
size_t z = 0; z < a_SizeZ; z++)
129 int BaseZ = a_MinZ +
static_cast<int>(z);
130 for (
size_t x = 0; x < a_SizeX; x++)
162 virtual void GetInts(
int a_MinX,
int a_MinZ,
size_t a_SizeX,
size_t a_SizeZ,
int *a_Values)
override
164 for (
size_t z = 0; z < a_SizeZ; z++)
166 int BaseZ = a_MinZ +
static_cast<int>(z);
167 for (
size_t x = 0; x < a_SizeX; x++)
175 if ((a_MinX <= 0) && (a_MinZ <= 0) && (a_MinX + static_cast<int>(a_SizeX) > 0) && (a_MinZ +
static_cast<int>(a_SizeZ) > 0))
177 a_Values[
static_cast<size_t>(-a_MinX) -
static_cast<size_t>(a_MinZ) * a_SizeX] =
bgTemperate;
206 virtual void GetInts(
int a_MinX,
int a_MinZ,
size_t a_SizeX,
size_t a_SizeZ,
int *a_Values)
override
209 int lowerMinX = a_MinX >> 1;
210 int lowerMinZ = a_MinZ >> 1;
211 size_t lowerSizeX = a_SizeX / 2 + 2;
212 size_t lowerSizeZ = a_SizeZ / 2 + 2;
219 m_UnderlyingGen->GetInts(lowerMinX, lowerMinZ, lowerSizeX, lowerSizeZ, lowerData);
220 const size_t lowStepX = (lowerSizeX - 1) * 2;
224 for (
size_t z = 0; z < lowerSizeZ - 1; ++z)
226 size_t idx = (z * 2) * lowStepX;
227 int PrevZ0 = lowerData[z * lowerSizeX];
228 int PrevZ1 = lowerData[(z + 1) * lowerSizeX];
230 for (
size_t x = 0; x < lowerSizeX - 1; ++x)
232 int ValX1Z0 = lowerData[x + 1 + z * lowerSizeX];
233 int ValX1Z1 = lowerData[x + 1 + (z + 1) * lowerSizeX];
234 int RndX = (
static_cast<int>(x) + lowerMinX) * 2;
235 int RndZ = (
static_cast<int>(z) + lowerMinZ) * 2;
247 for (
size_t z = 0; z < a_SizeZ; ++z)
249 memcpy(a_Values + z * a_SizeX, cache + (z + (a_MinZ & 1)) * lowStepX + (a_MinX & 1), a_SizeX *
sizeof(
int));
277 virtual void GetInts(
int a_MinX,
int a_MinZ,
size_t a_SizeX,
size_t a_SizeZ,
int *a_Values)
override
280 size_t lowerSizeX = a_SizeX + 2;
281 size_t lowerSizeZ = a_SizeZ + 2;
284 m_Underlying->GetInts(a_MinX - 1, a_MinZ - 1, lowerSizeX, lowerSizeZ, lowerData);
288 for (
size_t z = 0; z < a_SizeZ; z++)
290 int NoiseZ = a_MinZ +
static_cast<int>(z);
291 for (
size_t x = 0; x < a_SizeX; x++)
293 int val = lowerData[x + 1 + (z + 1) * lowerSizeX];
294 int above = lowerData[x + 1 + z * lowerSizeX];
295 int below = lowerData[x + 1 + (z + 2) * lowerSizeX];
296 int left = lowerData[x + (z + 1) * lowerSizeX];
297 int right = lowerData[x + 2 + (z + 1) * lowerSizeX];
299 if ((left == right) && (above == below))
301 if (((
Super::m_Noise.IntNoise2DInt(a_MinX +
static_cast<int>(x), NoiseZ) / 7) % 2) == 0)
323 a_Values[x + z * a_SizeX] = val;
350 virtual void GetInts(
int a_MinX,
int a_MinZ,
size_t a_SizeX,
size_t a_SizeZ,
int *a_Values)
override
353 size_t lowerSizeX = a_SizeX + 1;
354 size_t lowerSizeZ = a_SizeZ + 1;
357 m_Underlying->GetInts(a_MinX, a_MinZ, lowerSizeX, lowerSizeZ, lowerData);
360 for (
size_t z = 0; z < a_SizeZ; z++)
362 for (
size_t x = 0; x < a_SizeX; x++)
364 size_t idxLower = x + lowerSizeX * z;
365 a_Values[x + a_SizeX * z] = (
366 lowerData[idxLower] + lowerData[idxLower + 1] +
367 lowerData[idxLower + lowerSizeX] + lowerData[idxLower + lowerSizeX + 1]
395 virtual void GetInts(
int a_MinX,
int a_MinZ,
size_t a_SizeX,
size_t a_SizeZ,
int *a_Values)
override
398 size_t lowerSizeX = a_SizeX + 4;
399 size_t lowerSizeZ = a_SizeZ + 4;
402 m_Underlying->GetInts(a_MinX - 1, a_MinZ - 1, lowerSizeX, lowerSizeZ, lowerData);
405 for (
size_t z = 0; z < a_SizeZ; z++)
407 for (
size_t x = 0; x < a_SizeX; x++)
409 size_t idxLower1 = x + lowerSizeX * z;
410 size_t idxLower2 = idxLower1 + lowerSizeX;
411 size_t idxLower3 = idxLower1 + 2 * lowerSizeX;
412 size_t idxLower4 = idxLower1 + 3 * lowerSizeX;
413 a_Values[x + a_SizeX * z] = (
414 1 * lowerData[idxLower1] + 2 * lowerData[idxLower1 + 1] + 2 * lowerData[idxLower1 + 2] + 1 * lowerData[idxLower1 + 3] +
415 2 * lowerData[idxLower2] + 32 * lowerData[idxLower2 + 1] + 32 * lowerData[idxLower2 + 2] + 2 * lowerData[idxLower2 + 3] +
416 2 * lowerData[idxLower3] + 32 * lowerData[idxLower3 + 1] + 32 * lowerData[idxLower3 + 2] + 2 * lowerData[idxLower3 + 3] +
417 1 * lowerData[idxLower4] + 2 * lowerData[idxLower4 + 1] + 2 * lowerData[idxLower4 + 2] + 1 * lowerData[idxLower4 + 3]
432 template <
int WeightCenter,
int WeightCardinal,
int WeightDiagonal>
446 virtual void GetInts(
int a_MinX,
int a_MinZ,
size_t a_SizeX,
size_t a_SizeZ,
int *a_Values)
override
449 size_t lowerSizeX = a_SizeX + 3;
450 size_t lowerSizeZ = a_SizeZ + 3;
453 m_Underlying->GetInts(a_MinX, a_MinZ, lowerSizeX, lowerSizeZ, lowerData);
456 for (
size_t z = 0; z < a_SizeZ; z++)
458 for (
size_t x = 0; x < a_SizeX; x++)
460 size_t idxLower1 = x + lowerSizeX * z;
461 size_t idxLower2 = idxLower1 + lowerSizeX;
462 size_t idxLower3 = idxLower1 + 2 * lowerSizeX;
463 a_Values[x + a_SizeX * z] = (
464 WeightDiagonal * lowerData[idxLower1] + WeightCardinal * lowerData[idxLower1 + 1] + WeightDiagonal * lowerData[idxLower1 + 2] +
465 WeightCardinal * lowerData[idxLower2] + WeightCenter * lowerData[idxLower2 + 1] + WeightCardinal * lowerData[idxLower2 + 2] +
466 WeightDiagonal * lowerData[idxLower3] + WeightCardinal * lowerData[idxLower3 + 1] + WeightDiagonal * lowerData[idxLower3 + 2]
467 ) / (4 * WeightDiagonal + 4 * WeightCardinal + WeightCenter);
498 virtual void GetInts(
int a_MinX,
int a_MinZ,
size_t a_SizeX,
size_t a_SizeZ,
int *a_Values)
override
501 m_Underlying->GetInts(a_MinX, a_MinZ, a_SizeX, a_SizeZ, a_Values);
504 for (
size_t z = 0; z < a_SizeZ; z++)
506 int BaseZ = a_MinZ +
static_cast<int>(z);
507 for (
size_t x = 0; x < a_SizeX; x++)
545 virtual void GetInts(
int a_MinX,
int a_MinZ,
size_t a_SizeX,
size_t a_SizeZ,
int *a_Values)
override
548 m_Underlying->GetInts(a_MinX, a_MinZ, a_SizeX, a_SizeZ, a_Values);
551 for (
size_t z = 0; z < a_SizeZ; z++)
553 int NoiseZ = a_MinZ +
static_cast<int>(z);
554 for (
size_t x = 0; x < a_SizeX; x++)
557 a_Values[x + z * a_SizeX] += noiseVal;
588 virtual void GetInts(
int a_MinX,
int a_MinZ,
size_t a_SizeX,
size_t a_SizeZ,
int *a_Values)
override
591 size_t lowerSizeX = a_SizeX + 2;
592 size_t lowerSizeZ = a_SizeZ + 2;
595 m_Underlying->GetInts(a_MinX - 1, a_MinZ - 1, lowerSizeX, lowerSizeZ, lowerData);
598 for (
size_t z = 0; z < a_SizeZ; z++)
600 int NoiseZ = a_MinZ +
static_cast<int>(z);
601 for (
size_t x = 0; x < a_SizeX; x++)
603 size_t idxLower = x + 1 + lowerSizeX * (z + 1);
607 a_Values[x + z * a_SizeX] = (
608 lowerData[idxLower - 1] + lowerData[idxLower + 1] +
609 lowerData[idxLower - lowerSizeX] + lowerData[idxLower + lowerSizeX]
615 a_Values[x + z * a_SizeX] = lowerData[idxLower];
646 virtual void GetInts(
int a_MinX,
int a_MinZ,
size_t a_SizeX,
size_t a_SizeZ,
int *a_Values)
override
649 size_t lowerSizeX = a_SizeX + 2;
650 size_t lowerSizeZ = a_SizeZ + 2;
653 m_Underlying->GetInts(a_MinX - 1, a_MinZ - 1, lowerSizeX, lowerSizeZ, lowerData);
656 for (
size_t z = 0; z < a_SizeZ; z++)
658 int NoiseZ = a_MinZ +
static_cast<int>(z);
659 for (
size_t x = 0; x < a_SizeX; x++)
661 size_t idxLower = x + 1 + lowerSizeX * (z + 1);
665 int min = std::min(std::min(lowerData[idxLower - 1], lowerData[idxLower + 1]), std::min(lowerData[idxLower - lowerSizeX], lowerData[idxLower + lowerSizeX]));
666 int max = std::max(std::max(lowerData[idxLower - 1], lowerData[idxLower + 1]), std::max(lowerData[idxLower - lowerSizeX], lowerData[idxLower + lowerSizeX]));
667 a_Values[x + z * a_SizeX] = min + ((
Super::m_Noise.
IntNoise2DInt(a_MinX +
static_cast<int>(x), NoiseZ + 10) / 7) % (max - min + 1));
672 a_Values[x + z * a_SizeX] = lowerData[idxLower];
701 virtual void GetInts(
int a_MinX,
int a_MinZ,
size_t a_SizeX,
size_t a_SizeZ,
int *a_Values)
override
704 static const int ToBeach[] =
749 size_t lowerSizeX = a_SizeX + 2;
750 size_t lowerSizeZ = a_SizeZ + 2;
753 m_Underlying->GetInts(a_MinX - 1, a_MinZ - 1, lowerSizeX, lowerSizeZ, lowerValues);
756 for (
size_t z = 0; z < a_SizeZ; z++)
758 for (
size_t x = 0; x < a_SizeX; x++)
760 int val = lowerValues[x + 1 + (z + 1) * lowerSizeX];
761 int above = lowerValues[x + 1 + z * lowerSizeX];
762 int below = lowerValues[x + 1 + (z + 2) * lowerSizeX];
763 int left = lowerValues[x + (z + 1) * lowerSizeX];
764 int right = lowerValues[x + 2 + (z + 1) * lowerSizeX];
770 val = ToBeach[
static_cast<size_t>(val % 128) %
ARRAYCOUNT(ToBeach)];
773 a_Values[x + z * a_SizeX] = val;
806 virtual void GetInts(
int a_MinX,
int a_MinZ,
size_t a_SizeX,
size_t a_SizeZ,
int *a_Values)
override
808 m_Underlying->GetInts(a_MinX, a_MinZ, a_SizeX, a_SizeZ, a_Values);
809 for (
size_t z = 0; z < a_SizeZ; z++)
811 for (
size_t x = 0; x < a_SizeX; x++)
813 if (a_Values[x + z * a_SizeX] ==
bgOcean)
850 virtual void GetInts(
int a_MinX,
int a_MinZ,
size_t a_SizeX,
size_t a_SizeZ,
int * a_Values)
override
853 size_t lowerSizeX = a_SizeX + 2;
854 size_t lowerSizeZ = a_SizeZ + 2;
857 m_Underlying->GetInts(a_MinX, a_MinZ, lowerSizeX, lowerSizeZ, lowerValues);
860 for (
size_t z = 0; z < a_SizeZ; z++)
862 for (
size_t x = 0; x < a_SizeX; x++)
864 int val = lowerValues[x + 1 + (z + 1) * lowerSizeX];
865 int Above = lowerValues[x + 1 + z * lowerSizeX];
866 int Below = lowerValues[x + 1 + (z + 2) * lowerSizeX];
867 int Left = lowerValues[x + (z + 1) * lowerSizeX];
868 int Right = lowerValues[x + 2 + (z + 1) * lowerSizeX];
901 a_Values[x + z * a_SizeX] = val;
912 switch (a_BiomeGroup)
949 virtual void GetInts(
int a_MinX,
int a_MinZ,
size_t a_SizeX,
size_t a_SizeZ,
int *a_Values)
override
952 static const int oceanBiomes[] =
958 static const int rareOceanBiomes[] =
963 static const int desertBiomes[] =
968 static const int rareDesertBiomes[] =
973 static const int temperateBiomes[] =
978 static const int rareTemperateBiomes[] =
983 static const int mountainBiomes[] =
988 static const int rareMountainBiomes[] =
993 static const int iceBiomes[] =
999 static const int rareIceBiomes[] =
1006 {
static_cast<int>(
ARRAYCOUNT(oceanBiomes)), oceanBiomes},
1007 {
static_cast<int>(
ARRAYCOUNT(desertBiomes)), desertBiomes},
1008 {
static_cast<int>(
ARRAYCOUNT(temperateBiomes)), temperateBiomes},
1009 {
static_cast<int>(
ARRAYCOUNT(mountainBiomes)), mountainBiomes},
1010 {
static_cast<int>(
ARRAYCOUNT(iceBiomes)), iceBiomes},
1015 {
static_cast<int>(
ARRAYCOUNT(rareOceanBiomes)), rareOceanBiomes},
1016 {
static_cast<int>(
ARRAYCOUNT(rareDesertBiomes)), rareDesertBiomes},
1017 {
static_cast<int>(
ARRAYCOUNT(rareTemperateBiomes)), rareTemperateBiomes},
1018 {
static_cast<int>(
ARRAYCOUNT(rareMountainBiomes)), rareMountainBiomes},
1019 {
static_cast<int>(
ARRAYCOUNT(rareIceBiomes)), rareIceBiomes},
1023 m_Underlying->GetInts(a_MinX, a_MinZ, a_SizeX, a_SizeZ, a_Values);
1027 for (
size_t z = 0; z < a_SizeZ; z++)
1029 size_t IdxZ = z * a_SizeX;
1030 for (
size_t x = 0; x < a_SizeX; x++)
1032 int val = a_Values[x + IdxZ];
1035 biomesInGroups[
static_cast<size_t>(val) %
ARRAYCOUNT(biomesInGroups)];
1037 a_Values[x + IdxZ] = Biomes.
Biomes[rnd % Biomes.
Count];
1080 virtual void GetInts(
int a_MinX,
int a_MinZ,
size_t a_SizeX,
size_t a_SizeZ,
int *a_Values)
override
1083 m_Underlying->GetInts(a_MinX, a_MinZ, a_SizeX, a_SizeZ, a_Values);
1086 for (
size_t z = 0; z < a_SizeZ; z++)
1088 size_t idxZ = z * a_SizeX;
1089 for (
size_t x = 0; x < a_SizeX; x++)
1091 size_t idx = x + idxZ;
1092 if (a_Values[idx] ==
m_From)
1097 a_Values[idx] =
m_To;
1140 virtual void GetInts(
int a_MinX,
int a_MinZ,
size_t a_SizeX,
size_t a_SizeZ,
int *a_Values)
override
1144 m_Biomes->GetInts(a_MinX, a_MinZ, a_SizeX, a_SizeZ, a_Values);
1146 m_Rivers->GetInts(a_MinX, a_MinZ, a_SizeX, a_SizeZ, riverData);
1149 for (
size_t z = 0; z < a_SizeZ; z++)
1151 size_t idxZ = z * a_SizeX;
1152 for (
size_t x = 0; x < a_SizeX; x++)
1154 size_t idx = x + idxZ;
1160 if (riverData[idx] !=
biRiver)
1205 virtual void GetInts(
int a_MinX,
int a_MinZ,
size_t a_SizeX,
size_t a_SizeZ,
int *a_Values)
override
1208 size_t lowerSizeX = a_SizeX + 2;
1209 size_t lowerSizeZ = a_SizeZ + 2;
1212 m_Underlying->GetInts(a_MinX - 1, a_MinZ - 1, lowerSizeX, lowerSizeZ, lowerValues);
1215 for (
size_t z = 0; z < a_SizeZ; z++)
1217 for (
size_t x = 0; x < a_SizeX; x++)
1219 int Above = lowerValues[x + 1 + z * lowerSizeX];
1220 int Below = lowerValues[x + 1 + (z + 2) * lowerSizeX];
1221 int Left = lowerValues[x + (z + 1) * lowerSizeX];
1222 int Right = lowerValues[x + 2 + (z + 1) * lowerSizeX];
1223 int val = lowerValues[x + 1 + (z + 1) * lowerSizeX];
1225 if ((val == Above) && (val == Below) && (val == Left) && (val == Right))
1233 a_Values[x + z * a_SizeX] = val;
1264 virtual void GetInts(
int a_MinX,
int a_MinZ,
size_t a_SizeX,
size_t a_SizeZ,
int *a_Values)
override
1267 size_t lowerSizeX = a_SizeX + 2;
1268 size_t lowerSizeZ = a_SizeZ + 2;
1271 m_Underlying->GetInts(a_MinX - 1, a_MinZ - 1, lowerSizeX, lowerSizeZ, lowerValues);
1274 for (
size_t z = 0; z < a_SizeZ; z++)
1276 for (
size_t x = 0; x < a_SizeX; x++)
1278 int val = lowerValues[x + 1 + (z + 1) * lowerSizeX];
1281 a_Values[x + z * a_SizeX] = val;
1286 int Above = lowerValues[x + 1 + z * lowerSizeX];
1287 int Below = lowerValues[x + 1 + (z + 2) * lowerSizeX];
1288 int Left = lowerValues[x + (z + 1) * lowerSizeX];
1289 int Right = lowerValues[x + 2 + (z + 1) * lowerSizeX];
1290 int NumOceanNeighbors = 0;
1293 NumOceanNeighbors += 1;
1297 NumOceanNeighbors += 1;
1301 NumOceanNeighbors += 1;
1305 NumOceanNeighbors += 1;
1310 (NumOceanNeighbors >= 3) &&
1318 a_Values[x + z * a_SizeX] = val;
1355 virtual void GetInts(
int a_MinX,
int a_MinZ,
size_t a_SizeX,
size_t a_SizeZ,
int *a_Values)
override
1358 m_Underlying->GetInts(a_MinX, a_MinZ, a_SizeX, a_SizeZ, a_Values);
1361 for (
size_t z = 0; z < a_SizeZ; z++)
1363 for (
size_t x = 0; x < a_SizeX; x++)
1404 virtual void GetInts(
int a_MinX,
int a_MinZ,
size_t a_SizeX,
size_t a_SizeZ,
int *a_Values)
override
1407 m_Underlying->GetInts(a_MinX, a_MinZ, a_SizeX, a_SizeZ, a_Values);
1410 for (
size_t z = 0; z < a_SizeZ; z++)
1412 for (
size_t x = 0; x < a_SizeX; x++)
1417 size_t idx = x + a_SizeX * z;
1418 a_Values[idx] = a_Values[idx] |
bgfRare;
1453 virtual void GetInts(
int a_MinX,
int a_MinZ,
size_t a_SizeX,
size_t a_SizeZ,
int *a_Values)
override
1456 m_BaseBiomes->GetInts(a_MinX, a_MinZ, a_SizeX, a_SizeZ, a_Values);
1458 m_Alterations->GetInts(a_MinX, a_MinZ, a_SizeX, a_SizeZ, alterations);
1461 size_t len = a_SizeX * a_SizeZ;
1462 for (
size_t idx = 0; idx < len; ++idx)
1464 if (alterations[idx] == 0)
1471 int val = a_Values[idx];
1490 a_Values[idx] = val;
1518 virtual void GetInts(
int a_MinX,
int a_MinZ,
size_t a_SizeX,
size_t a_SizeZ,
int *a_Values)
override
1521 size_t lowerSizeX = a_SizeX + 2;
1522 size_t lowerSizeZ = a_SizeZ + 2;
1525 m_Underlying->GetInts(a_MinX - 1, a_MinZ - 1, lowerSizeX, lowerSizeZ, lowerValues);
1528 for (
size_t z = 0; z < a_SizeZ; z++)
1530 for (
size_t x = 0; x < a_SizeX; x++)
1532 int biome = lowerValues[x + 1 + (z + 1) * lowerSizeX];
1533 int above = lowerValues[x + 1 + z * lowerSizeX];
1534 int below = lowerValues[x + 1 + (z + 2) * lowerSizeX];
1535 int left = lowerValues[x + (z + 1) * lowerSizeX];
1536 int right = lowerValues[x + 2 + (z + 1) * lowerSizeX];
1604 a_Values[x + z * a_SizeX] = biome;
1679 virtual void GetInts(
int a_MinX,
int a_MinZ,
size_t a_SizeX,
size_t a_SizeZ,
int *a_Values)
override
1682 m_Underlying->GetInts(a_MinX, a_MinZ, a_SizeX, a_SizeZ, a_Values);
1684 m_Alteration->GetInts(a_MinX, a_MinZ, a_SizeX, a_SizeZ, alterations);
1687 size_t len = a_SizeX * a_SizeZ;
1688 for (
size_t idx = 0; idx < len; ++idx)
1690 if (alterations[idx] == 0)
1696 switch (a_Values[idx])
bool IsBiomeNoDownfall(EMCSBiome a_Biome)
Returns true if the biome has no downfall - deserts and savannas.
bool IsBiomeVeryCold(EMCSBiome a_Biome)
Returns true if the biome is very cold (has snow on ground everywhere, turns top water to ice,...
bool IsBiomeOcean(int a_Biome)
Returns true if the biome is an ocean biome.
EMCSBiome
Biome IDs The first batch corresponds to the clientside biomes, used by MineCraft.
const int bgOcean
Constants representing the biome group designators.
#define PROT_INT_BUFFER_SIZE
Maximum size of the generated area.
#define ARRAYCOUNT(X)
Evaluates to the number of elements in an array (compile-time!)
Interface that all the generator classes provide.
virtual ~cProtIntGen()
Force a virtual destructor in all descendants.
virtual void GetInts(int a_MinX, int a_MinZ, size_t a_SizeX, size_t a_SizeZ, int *a_Values)=0
Generates the array of specified size into a_Values, based on given min coords.
std::shared_ptr< cProtIntGen > Underlying
Type of the generic interface used for storing links to the underlying generators.
static const int m_BufferSize
Maximum size of the generated area.
Provides additional cNoise member and its helper functions.
int chooseRandomOne(int a_RndX, int a_RndZ, int a_Val1, int a_Val2)
Chooses one of a_Val1 or a_Val2, based on m_Noise and the coordinates for querying the noise.
cProtIntGenWithNoise(int a_Seed)
int chooseRandomOne(int a_RndX, int a_RndZ, int a_Val1, int a_Val2, int a_Val3, int a_Val4)
Chooses one of a_ValN, based on m_Noise and the coordinates for querying the noise.
Generates a 2D array of random integers in the specified range [0 .
virtual void GetInts(int a_MinX, int a_MinZ, size_t a_SizeX, size_t a_SizeZ, int *a_Values) override
Generates the array of specified size into a_Values, based on given min coords.
cProtIntGenChoice(int a_Seed, int a_Range)
Decides between the ocean and landmass biomes.
virtual void GetInts(int a_MinX, int a_MinZ, size_t a_SizeX, size_t a_SizeZ, int *a_Values) override
Generates the array of specified size into a_Values, based on given min coords.
cProtIntGenLandOcean(int a_Seed, int a_Threshold)
Zooms the underlying value array to twice the size.
Underlying m_UnderlyingGen
cProtIntGenZoom(int a_Seed, Underlying a_UnderlyingGen)
virtual void GetInts(int a_MinX, int a_MinZ, size_t a_SizeX, size_t a_SizeZ, int *a_Values) override
Generates the array of specified size into a_Values, based on given min coords.
Smoothes out some artifacts generated by the zooming - mostly single-pixel values.
virtual void GetInts(int a_MinX, int a_MinZ, size_t a_SizeX, size_t a_SizeZ, int *a_Values) override
Generates the array of specified size into a_Values, based on given min coords.
cProtIntGenSmooth(int a_Seed, Underlying a_Underlying)
Averages the values of the underlying 2 * 2 neighbors.
virtual void GetInts(int a_MinX, int a_MinZ, size_t a_SizeX, size_t a_SizeZ, int *a_Values) override
Generates the array of specified size into a_Values, based on given min coords.
cProtIntGenAvgValues(Underlying a_Underlying)
Averages the values of the underlying 4 * 4 neighbors.
virtual void GetInts(int a_MinX, int a_MinZ, size_t a_SizeX, size_t a_SizeZ, int *a_Values) override
Generates the array of specified size into a_Values, based on given min coords.
cProtIntGenAvg4Values(Underlying a_Underlying)
Averages the values of the underlying 3 * 3 neighbors with custom weight.
cProtIntGenWeightAvg(Underlying a_Underlying)
virtual void GetInts(int a_MinX, int a_MinZ, size_t a_SizeX, size_t a_SizeZ, int *a_Values) override
Generates the array of specified size into a_Values, based on given min coords.
Replaces random values of the underlying data with random integers in the specified range [Min .
virtual void GetInts(int a_MinX, int a_MinZ, size_t a_SizeX, size_t a_SizeZ, int *a_Values) override
Generates the array of specified size into a_Values, based on given min coords.
cProtIntGenRndChoice(int a_Seed, int a_ChancePct, int a_Min, int a_Range, Underlying a_Underlying)
Adds a random value in range [-a_HalfRange, +a_HalfRange] to each of the underlying values.
virtual void GetInts(int a_MinX, int a_MinZ, size_t a_SizeX, size_t a_SizeZ, int *a_Values) override
Generates the array of specified size into a_Values, based on given min coords.
cProtIntGenAddRnd(int a_Seed, int a_HalfRange, Underlying a_Underlying)
Replaces random underlying values with the average of the neighbors.
cProtIntGenRndAvg(int a_Seed, int a_AvgChancePct, Underlying a_Underlying)
virtual void GetInts(int a_MinX, int a_MinZ, size_t a_SizeX, size_t a_SizeZ, int *a_Values) override
Generates the array of specified size into a_Values, based on given min coords.
Replaces random underlying values with a random value in between the max and min of the neighbors.
cProtIntGenRndBetween(int a_Seed, int a_AvgChancePct, Underlying a_Underlying)
virtual void GetInts(int a_MinX, int a_MinZ, size_t a_SizeX, size_t a_SizeZ, int *a_Values) override
Generates the array of specified size into a_Values, based on given min coords.
Converts land biomes at the edge of an ocean into the respective beach biome.
virtual void GetInts(int a_MinX, int a_MinZ, size_t a_SizeX, size_t a_SizeZ, int *a_Values) override
Generates the array of specified size into a_Values, based on given min coords.
cProtIntGenBeaches(Underlying a_Underlying)
Generates the underlying numbers and then randomly changes some ocean group pixels into random land b...
virtual void GetInts(int a_MinX, int a_MinZ, size_t a_SizeX, size_t a_SizeZ, int *a_Values) override
Generates the array of specified size into a_Values, based on given min coords.
int m_Chance
Chance of each ocean pixel being converted, in permille.
cProtIntGenAddIslands(int a_Seed, int a_Chance, Underlying a_Underlying)
A filter that adds an edge biome group between two biome groups that need an edge between them.
cProtIntGenBiomeGroupEdges(Underlying a_Underlying)
virtual void GetInts(int a_MinX, int a_MinZ, size_t a_SizeX, size_t a_SizeZ, int *a_Values) override
Generates the array of specified size into a_Values, based on given min coords.
bool isDesertCompatible(int a_BiomeGroup)
Turns biome group indices into real biomes.
virtual void GetInts(int a_MinX, int a_MinZ, size_t a_SizeX, size_t a_SizeZ, int *a_Values) override
Generates the array of specified size into a_Values, based on given min coords.
Underlying m_Underlying
The underlying int generator.
cProtIntGenBiomes(int a_Seed, Underlying a_Underlying)
Randomly replaces pixels of one value to another value, using the given chance.
int m_To
The destination value to which to replace.
cProtIntGenReplaceRandomly(int a_Seed, int a_From, int a_To, int a_Chance, Underlying a_Underlying)
int m_Chance
Chance, in permille, of replacing the value.
int m_From
The original value to be replaced.
virtual void GetInts(int a_MinX, int a_MinZ, size_t a_SizeX, size_t a_SizeZ, int *a_Values) override
Generates the array of specified size into a_Values, based on given min coords.
Mixer that joins together finalized biomes and rivers.
cProtIntGenMixRivers(Underlying a_Biomes, Underlying a_Rivers)
virtual void GetInts(int a_MinX, int a_MinZ, size_t a_SizeX, size_t a_SizeZ, int *a_Values) override
Generates the array of specified size into a_Values, based on given min coords.
Generates a river based on the underlying data.
virtual void GetInts(int a_MinX, int a_MinZ, size_t a_SizeX, size_t a_SizeZ, int *a_Values) override
Generates the array of specified size into a_Values, based on given min coords.
cProtIntGenRiver(int a_Seed, Underlying a_Underlying)
Turns some of the oceans into the specified biome.
cProtIntGenAddToOcean(int a_Seed, int a_Chance, int a_ToValue, Underlying a_Underlying)
virtual void GetInts(int a_MinX, int a_MinZ, size_t a_SizeX, size_t a_SizeZ, int *a_Values) override
Generates the array of specified size into a_Values, based on given min coords.
int m_Chance
Chance, in permille, of changing the biome.
int m_ToValue
The value to change the ocean into.
Changes random pixels of the underlying data to the specified value.
cProtIntGenSetRandomly(int a_Seed, int a_Chance, int a_ToValue, Underlying a_Underlying)
virtual void GetInts(int a_MinX, int a_MinZ, size_t a_SizeX, size_t a_SizeZ, int *a_Values) override
Generates the array of specified size into a_Values, based on given min coords.
int m_ToValue
The value to which to set the pixel.
int m_Chance
Chance, in permille, of changing each pixel.
Adds a "rare" flag to random biome groups, based on the given chance.
int m_Chance
Chance, in permille, of changing each pixel into the rare biome group.
Underlying m_Underlying
The underlying generator.
cProtIntGenRareBiomeGroups(int a_Seed, int a_Chance, Underlying a_Underlying)
virtual void GetInts(int a_MinX, int a_MinZ, size_t a_SizeX, size_t a_SizeZ, int *a_Values) override
Generates the array of specified size into a_Values, based on given min coords.
Changes biomes in the parent data into an alternate versions (usually "hill" variants),...
cProtIntGenAlternateBiomes(int a_Seed, Underlying a_Alterations, Underlying a_BaseBiomes)
virtual void GetInts(int a_MinX, int a_MinZ, size_t a_SizeX, size_t a_SizeZ, int *a_Values) override
Generates the array of specified size into a_Values, based on given min coords.
Adds an edge between two specifically incompatible biomes, such as mesa and forest.
bool isMesaCompatible(int a_Biome)
virtual void GetInts(int a_MinX, int a_MinZ, size_t a_SizeX, size_t a_SizeZ, int *a_Values) override
Generates the array of specified size into a_Values, based on given min coords.
bool isJungleCompatible(int a_Biome)
cProtIntGenBiomeEdges(int a_Seed, Underlying a_Underlying)
Changes biomes in the parent data into their alternate versions ("M" variants), in such places that h...
virtual void GetInts(int a_MinX, int a_MinZ, size_t a_SizeX, size_t a_SizeZ, int *a_Values) override
Generates the array of specified size into a_Values, based on given min coords.
cProtIntGenMBiomes(int a_Seed, Underlying a_Alteration, Underlying a_Underlying)
int IntNoise2DInt(int a_X, int a_Y) const