From 0e4c5ef4634fa291632a2397989a2b19853fe20f Mon Sep 17 00:00:00 2001 From: Lord_Cambion Date: Tue, 19 May 2026 17:07:26 +0200 Subject: [PATCH] fix: matching constructors to wii u i noticed constructor are different. still nothing changed :( --- Minecraft.World/AddEdgeLayer.cpp | 4 +- Minecraft.World/AddEdgeLayer.h | 2 +- Minecraft.World/AddIslandLayer.cpp | 2 +- Minecraft.World/AddIslandLayer.h | 2 +- Minecraft.World/AddMushroomIslandLayer.cpp | 2 +- Minecraft.World/AddMushroomIslandLayer.h | 2 +- Minecraft.World/AddSnowLayer.cpp | 2 +- Minecraft.World/AddSnowLayer.h | 2 +- Minecraft.World/BiomeEdgeLayer.cpp | 38 +++- Minecraft.World/BiomeEdgeLayer.h | 4 +- Minecraft.World/BiomeInitLayer.cpp | 2 +- Minecraft.World/BiomeInitLayer.h | 2 +- Minecraft.World/BiomeOverrideLayer.cpp | 2 +- Minecraft.World/BiomeOverrideLayer.h | 4 +- Minecraft.World/DeepOceanLayer.cpp | 2 +- Minecraft.World/DeepOceanLayer.h | 2 +- Minecraft.World/DownfallLayer.cpp | 2 +- Minecraft.World/DownfallMixerLayer.cpp | 2 +- Minecraft.World/FlatLayer.cpp | 2 +- Minecraft.World/FuzzyZoomLayer.cpp | 20 +- Minecraft.World/FuzzyZoomLayer.h | 8 +- Minecraft.World/GrowMushroomIslandLayer.cpp | 2 +- Minecraft.World/GrowMushroomIslandLayer.h | 2 +- Minecraft.World/ImposeContinentsLayer.cpp | 2 +- Minecraft.World/ImposeContinentsLayer.h | 2 +- Minecraft.World/IslandLayer.cpp | 2 +- Minecraft.World/IslandLayer.h | 2 +- Minecraft.World/Layer.cpp | 192 +++++++++++--------- Minecraft.World/Layer.h | 2 +- Minecraft.World/RareBiomeLayer.cpp | 2 +- Minecraft.World/RareBiomeLayer.h | 2 +- Minecraft.World/RareBiomeSpotLayer.cpp | 2 +- Minecraft.World/RareBiomeSpotLayer.h | 2 +- Minecraft.World/RegionHillsLayer.cpp | 15 +- Minecraft.World/RegionHillsLayer.h | 6 +- Minecraft.World/RemoveTooMuchOceanLayer.cpp | 2 +- Minecraft.World/RemoveTooMuchOceanLayer.h | 2 +- Minecraft.World/RiverInitLayer.cpp | 2 +- Minecraft.World/RiverInitLayer.h | 2 +- Minecraft.World/RiverLayer.cpp | 2 +- Minecraft.World/RiverLayer.h | 2 +- Minecraft.World/RiverMixerLayer.cpp | 7 +- Minecraft.World/RiverMixerLayer.h | 2 +- Minecraft.World/ShoreLayer.cpp | 2 +- Minecraft.World/ShoreLayer.h | 2 +- Minecraft.World/SmoothLayer.cpp | 2 +- Minecraft.World/SmoothLayer.h | 2 +- Minecraft.World/SmoothZoomLayer.cpp | 20 +- Minecraft.World/SmoothZoomLayer.h | 5 +- Minecraft.World/SwampRiversLayer.cpp | 2 +- Minecraft.World/SwampRiversLayer.h | 2 +- Minecraft.World/TemperatureLayer.cpp | 2 +- Minecraft.World/TemperatureMixerLayer.cpp | 2 +- Minecraft.World/VoronoiZoom.cpp | 2 +- Minecraft.World/VoronoiZoom.h | 2 +- Minecraft.World/ZoomLayer.cpp | 20 +- Minecraft.World/ZoomLayer.h | 5 +- 57 files changed, 246 insertions(+), 188 deletions(-) diff --git a/Minecraft.World/AddEdgeLayer.cpp b/Minecraft.World/AddEdgeLayer.cpp index d6233f87..9f495d21 100644 --- a/Minecraft.World/AddEdgeLayer.cpp +++ b/Minecraft.World/AddEdgeLayer.cpp @@ -3,8 +3,8 @@ #include "net.minecraft.world.level.biome.h" #include "IntCache.h" -AddEdgeLayer::AddEdgeLayer(int64_t seed, std::shared_ptr parent, int64_t seedMixup, int mode) - : Layer(seedMixup) +AddEdgeLayer::AddEdgeLayer(int32_t seed, int64_t seedMixup,std::shared_ptr parent, int mode) + : Layer(seed,seedMixup) { this->parent = parent; this->mode = mode; diff --git a/Minecraft.World/AddEdgeLayer.h b/Minecraft.World/AddEdgeLayer.h index f55975fc..afed4872 100644 --- a/Minecraft.World/AddEdgeLayer.h +++ b/Minecraft.World/AddEdgeLayer.h @@ -14,7 +14,7 @@ private: public: - AddEdgeLayer(int64_t seed, std::shared_ptr parent, int64_t seedMixup, int mode); + AddEdgeLayer(int32_t seed, int64_t seedMixup, std::shared_ptr parent,int mode); virtual ~AddEdgeLayer() {} intArray getArea(int xo, int yo, int w, int h) override; }; \ No newline at end of file diff --git a/Minecraft.World/AddIslandLayer.cpp b/Minecraft.World/AddIslandLayer.cpp index 37e05822..0f0a0ae4 100644 --- a/Minecraft.World/AddIslandLayer.cpp +++ b/Minecraft.World/AddIslandLayer.cpp @@ -2,7 +2,7 @@ #include "net.minecraft.world.level.newbiome.layer.h" #include "net.minecraft.world.level.biome.h" -AddIslandLayer::AddIslandLayer(int64_t seed, shared_ptr parent, int64_t seedMixup) : Layer(seedMixup) +AddIslandLayer::AddIslandLayer(int32_t seed, int64_t seedMixup,std::shared_ptr parent) : Layer(seed,seedMixup) { this->parent = parent; } diff --git a/Minecraft.World/AddIslandLayer.h b/Minecraft.World/AddIslandLayer.h index 12df1c23..87f15988 100644 --- a/Minecraft.World/AddIslandLayer.h +++ b/Minecraft.World/AddIslandLayer.h @@ -5,7 +5,7 @@ class AddIslandLayer : public Layer { public: - AddIslandLayer(int64_t seed, shared_ptr parent, int64_t seedMixup); + AddIslandLayer(int32_t seed, int64_t seedMixup,std::shared_ptr parent); intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/Minecraft.World/AddMushroomIslandLayer.cpp b/Minecraft.World/AddMushroomIslandLayer.cpp index 49e00396..280197e3 100644 --- a/Minecraft.World/AddMushroomIslandLayer.cpp +++ b/Minecraft.World/AddMushroomIslandLayer.cpp @@ -3,7 +3,7 @@ #include "net.minecraft.world.level.biome.h" -AddMushroomIslandLayer::AddMushroomIslandLayer(int64_t seed, shared_ptr parent, int64_t seedMixup) : Layer(seedMixup) +AddMushroomIslandLayer::AddMushroomIslandLayer(int32_t seed,int64_t seedMixup, shared_ptr parent) : Layer(seed,seedMixup) { this->parent = parent; } diff --git a/Minecraft.World/AddMushroomIslandLayer.h b/Minecraft.World/AddMushroomIslandLayer.h index 6de9e960..6c7ec601 100644 --- a/Minecraft.World/AddMushroomIslandLayer.h +++ b/Minecraft.World/AddMushroomIslandLayer.h @@ -4,6 +4,6 @@ class AddMushroomIslandLayer : public Layer { public: - AddMushroomIslandLayer(int64_t seed, shared_ptr parent,int64_t seedMixup); + AddMushroomIslandLayer(int32_t seed,int64_t seedMixup,shared_ptr parent); virtual intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/Minecraft.World/AddSnowLayer.cpp b/Minecraft.World/AddSnowLayer.cpp index 6b41b8ae..c68b142e 100644 --- a/Minecraft.World/AddSnowLayer.cpp +++ b/Minecraft.World/AddSnowLayer.cpp @@ -2,7 +2,7 @@ #include "net.minecraft.world.level.newbiome.layer.h" #include "net.minecraft.world.level.biome.h" -AddSnowLayer::AddSnowLayer(int64_t seed, shared_ptr parent, int64_t seedMixup) : Layer(seedMixup) +AddSnowLayer::AddSnowLayer(int32_t seed, int64_t seedMixup, shared_ptr parent) : Layer(seed,seedMixup) { this->parent = parent; } diff --git a/Minecraft.World/AddSnowLayer.h b/Minecraft.World/AddSnowLayer.h index 3c50096a..3d35383c 100644 --- a/Minecraft.World/AddSnowLayer.h +++ b/Minecraft.World/AddSnowLayer.h @@ -4,6 +4,6 @@ class AddSnowLayer : public Layer { public: - AddSnowLayer(int64_t seed, shared_ptr parent, int64_t seedMixup); + AddSnowLayer(int32_t seed, int64_t seedMixup, shared_ptr parent); virtual intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/Minecraft.World/BiomeEdgeLayer.cpp b/Minecraft.World/BiomeEdgeLayer.cpp index a33ab977..cafb074f 100644 --- a/Minecraft.World/BiomeEdgeLayer.cpp +++ b/Minecraft.World/BiomeEdgeLayer.cpp @@ -3,7 +3,7 @@ #include "net.minecraft.world.level.biome.h" #include "IntCache.h" -BiomeEdgeLayer::BiomeEdgeLayer(int64_t seed, shared_ptr parent, int64_t seedMixup) : Layer(seedMixup) +BiomeEdgeLayer::BiomeEdgeLayer(int32_t seed, int64_t seedMixup, shared_ptr parent) : Layer(seed,seedMixup) { this->parent = parent; } @@ -92,3 +92,39 @@ bool BiomeEdgeLayer::isValidTemperatureEdge(int a1biome, int a2biome) return true; } +bool BiomeEdgeLayer::checkEdgeStrict(intArray& srcArray, intArray& destArray, int x, int z, int width, int centerBiome, unsigned int targetBiome, int replacementBiome) +{ + + if ((unsigned int)centerBiome != targetBiome) + { + return false; + } + + + int northIndex = x + (z * (width + 2) + 1); + int southIndex = x + ((z + 2) * (width + 2) + 1); + int westIndex = (x + (z + 1) * (width + 2)); + int eastIndex = (x + 2 + (z + 1) * (width + 2)); + + int biomeNorth = srcArray[northIndex]; + int biomeSouth = srcArray[southIndex]; + int biomeWest = srcArray[westIndex]; + int biomeEast = srcArray[eastIndex]; + + + if (Layer::isSame(biomeNorth, targetBiome) && + Layer::isSame(biomeEast, targetBiome) && + Layer::isSame(biomeWest, targetBiome) && + Layer::isSame(biomeSouth, targetBiome)) + { + + destArray[x + z * width] = centerBiome; + return true; + } + else + { + + destArray[x + z * width] = replacementBiome; + return true; + } +} \ No newline at end of file diff --git a/Minecraft.World/BiomeEdgeLayer.h b/Minecraft.World/BiomeEdgeLayer.h index d8ee324a..e3cf5bbe 100644 --- a/Minecraft.World/BiomeEdgeLayer.h +++ b/Minecraft.World/BiomeEdgeLayer.h @@ -4,12 +4,12 @@ class BiomeEdgeLayer : public Layer { public: - BiomeEdgeLayer(int64_t seed, shared_ptr parent, int64_t seedMixup); + BiomeEdgeLayer(int32_t seed, int64_t seedMixup, shared_ptr parent); virtual ~BiomeEdgeLayer() {} virtual intArray getArea(int xo, int yo, int w, int h) override; private: static bool isValidTemperatureEdge(int a1biome, int a2biome); bool checkEdge(intArray& b, intArray& result, int x, int y, int w, int biome, int target, int replacement); - bool checkEdgeStrict(intArray& b, intArray& result, int x, int y, int w, int biome, int target, int replacement); + bool checkEdgeStrict(intArray& srcArray, intArray& destArray, int x, int z, int width, int centerBiome, unsigned int targetBiome, int replacementBiome); }; \ No newline at end of file diff --git a/Minecraft.World/BiomeInitLayer.cpp b/Minecraft.World/BiomeInitLayer.cpp index c9389419..5db591d8 100644 --- a/Minecraft.World/BiomeInitLayer.cpp +++ b/Minecraft.World/BiomeInitLayer.cpp @@ -10,7 +10,7 @@ struct CustomizableSourceSettings { int biome; }; -BiomeInitLayer::BiomeInitLayer(int64_t seed, shared_ptr parent, int64_t seedMixup, LevelType *levelType, void* superflatConfig) : Layer(seedMixup) +BiomeInitLayer::BiomeInitLayer(int32_t seed, int64_t seedMixup, shared_ptr parent, LevelType *levelType, void* superflatConfig) : Layer(seed,seedMixup) { this->parent = parent; this->customSettings = nullptr; diff --git a/Minecraft.World/BiomeInitLayer.h b/Minecraft.World/BiomeInitLayer.h index 289da3d5..52954b1d 100644 --- a/Minecraft.World/BiomeInitLayer.h +++ b/Minecraft.World/BiomeInitLayer.h @@ -18,7 +18,7 @@ private: CustomizableSourceSettings* customSettings; public: - BiomeInitLayer(int64_t seed, shared_ptr parent, int64_t seedMixup, LevelType *levelType, void* superflatConfig); + BiomeInitLayer(int32_t seed, int64_t seedMixup, shared_ptr parent, LevelType *levelType, void* superflatConfig); virtual ~BiomeInitLayer(); intArray getArea(int xo, int yo, int w, int h) override; }; \ No newline at end of file diff --git a/Minecraft.World/BiomeOverrideLayer.cpp b/Minecraft.World/BiomeOverrideLayer.cpp index 39747bc0..e6ce65f4 100644 --- a/Minecraft.World/BiomeOverrideLayer.cpp +++ b/Minecraft.World/BiomeOverrideLayer.cpp @@ -5,7 +5,7 @@ #include "BiomeOverrideLayer.h" -BiomeOverrideLayer::BiomeOverrideLayer(int seedMixup) : Layer(seedMixup) +BiomeOverrideLayer::BiomeOverrideLayer(int32_t seed, int64_t seedMixup) :Layer(seed, seedMixup) { m_biomeOverride = byteArray( width * height ); diff --git a/Minecraft.World/BiomeOverrideLayer.h b/Minecraft.World/BiomeOverrideLayer.h index cfa689ef..cbd3f03c 100644 --- a/Minecraft.World/BiomeOverrideLayer.h +++ b/Minecraft.World/BiomeOverrideLayer.h @@ -13,6 +13,6 @@ private: byteArray m_biomeOverride; public: - BiomeOverrideLayer(int seedMixup); - intArray getArea(int xo, int yo, int w, int h); + BiomeOverrideLayer(int32_t seed, int64_t seedMixup); + intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/Minecraft.World/DeepOceanLayer.cpp b/Minecraft.World/DeepOceanLayer.cpp index 782baf27..0fe53781 100644 --- a/Minecraft.World/DeepOceanLayer.cpp +++ b/Minecraft.World/DeepOceanLayer.cpp @@ -3,7 +3,7 @@ #include "IntCache.h" #include "DeepOceanLayer.h" -DeepOceanLayer::DeepOceanLayer(int64_t seed, shared_ptr parent, int64_t seedMixup) : Layer(seedMixup) +DeepOceanLayer::DeepOceanLayer(int32_t seed, int64_t seedMixup, shared_ptr parent) : Layer(seed,seedMixup) { this->parent = parent; } diff --git a/Minecraft.World/DeepOceanLayer.h b/Minecraft.World/DeepOceanLayer.h index 7c8eb9cb..0d1b9015 100644 --- a/Minecraft.World/DeepOceanLayer.h +++ b/Minecraft.World/DeepOceanLayer.h @@ -5,7 +5,7 @@ class DeepOceanLayer : public Layer { public: - DeepOceanLayer(int64_t seed, shared_ptr parent, int64_t seedMixup); + DeepOceanLayer(int32_t seed, int64_t seedMixup, shared_ptr parent); virtual ~DeepOceanLayer() {} virtual intArray getArea(int xo, int yo, int w, int h) override; }; diff --git a/Minecraft.World/DownfallLayer.cpp b/Minecraft.World/DownfallLayer.cpp index 30775218..b231146a 100644 --- a/Minecraft.World/DownfallLayer.cpp +++ b/Minecraft.World/DownfallLayer.cpp @@ -2,7 +2,7 @@ #include "net.minecraft.world.level.biome.h" #include "net.minecraft.world.level.newbiome.layer.h" -DownfallLayer::DownfallLayer(shared_ptrparent) : Layer(0) +DownfallLayer::DownfallLayer(shared_ptrparent) : Layer(0,0) { this->parent = parent; } diff --git a/Minecraft.World/DownfallMixerLayer.cpp b/Minecraft.World/DownfallMixerLayer.cpp index fcca5bdd..74408a28 100644 --- a/Minecraft.World/DownfallMixerLayer.cpp +++ b/Minecraft.World/DownfallMixerLayer.cpp @@ -2,7 +2,7 @@ #include "net.minecraft.world.level.biome.h" #include "net.minecraft.world.level.newbiome.layer.h" -DownfallMixerLayer::DownfallMixerLayer(shared_ptrdownfall, shared_ptrparent, int layer) : Layer(0) +DownfallMixerLayer::DownfallMixerLayer(shared_ptrdownfall, shared_ptrparent, int layer) : Layer(0,0) { this->parent = parent; this->downfall = downfall; diff --git a/Minecraft.World/FlatLayer.cpp b/Minecraft.World/FlatLayer.cpp index 3d19dc4d..4ddb8a04 100644 --- a/Minecraft.World/FlatLayer.cpp +++ b/Minecraft.World/FlatLayer.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "net.minecraft.world.level.newbiome.layer.h" -FlatLayer::FlatLayer(int val) : Layer(0) +FlatLayer::FlatLayer(int val) : Layer(0,0) { this->val = val; } diff --git a/Minecraft.World/FuzzyZoomLayer.cpp b/Minecraft.World/FuzzyZoomLayer.cpp index 3ffa1d3d..770808b0 100644 --- a/Minecraft.World/FuzzyZoomLayer.cpp +++ b/Minecraft.World/FuzzyZoomLayer.cpp @@ -2,9 +2,11 @@ #include "System.h" #include "net.minecraft.world.level.newbiome.layer.h" -FuzzyZoomLayer::FuzzyZoomLayer(int64_t seed, shared_ptr parent, int64_t seedMixup) : Layer(seedMixup) +FuzzyZoomLayer::FuzzyZoomLayer(int32_t seed, int64_t seedMixup, shared_ptr parent) + : ZoomLayer(seed, seedMixup,parent) { - this->parent = parent; + + this->parent = parent; } intArray FuzzyZoomLayer::getArea(int xo, int yo, int w, int h) @@ -61,12 +63,12 @@ int FuzzyZoomLayer::random(int a, int b, int c, int d) return d; } -shared_ptrFuzzyZoomLayer::zoom(int64_t seed, shared_ptrsup, int count) +shared_ptr FuzzyZoomLayer::zoom(int32_t seed, int64_t seedMixup, shared_ptr sup, int count) { - shared_ptr result = sup; - for (int i = 0; i < count; i++) - { - result = std::make_shared(seed, result, 0x7D0 + i); - } - return result; + shared_ptr result = sup; + for (int i = 0; i < count; i++) + { + result = std::make_shared(seed, seedMixup + i, result); + } + return result; } \ No newline at end of file diff --git a/Minecraft.World/FuzzyZoomLayer.h b/Minecraft.World/FuzzyZoomLayer.h index 5e490cf9..6b56e4d6 100644 --- a/Minecraft.World/FuzzyZoomLayer.h +++ b/Minecraft.World/FuzzyZoomLayer.h @@ -1,11 +1,11 @@ #pragma once -#include "Layer.h" +#include "ZoomLayer.h" -class FuzzyZoomLayer : public Layer +class FuzzyZoomLayer : public ZoomLayer { public: - FuzzyZoomLayer(int64_t seed, shared_ptr parent, int64_t seedMixup); + FuzzyZoomLayer(int32_t seed, int64_t seedMixup, shared_ptr parent); intArray getArea(int xo, int yo, int w, int h); protected: @@ -13,5 +13,5 @@ protected: int random(int a, int b, int c, int d); public: - static shared_ptrzoom(int64_t seed, shared_ptrsup, int count); + static std::shared_ptr zoom(int32_t seed, int64_t seedMixup, std::shared_ptr sup, int count); }; \ No newline at end of file diff --git a/Minecraft.World/GrowMushroomIslandLayer.cpp b/Minecraft.World/GrowMushroomIslandLayer.cpp index c0f5e19c..d61386c0 100644 --- a/Minecraft.World/GrowMushroomIslandLayer.cpp +++ b/Minecraft.World/GrowMushroomIslandLayer.cpp @@ -3,7 +3,7 @@ #include "net.minecraft.world.level.biome.h" -GrowMushroomIslandLayer::GrowMushroomIslandLayer(int64_t seed, shared_ptr parent, int64_t seedMixup) : Layer(seedMixup) +GrowMushroomIslandLayer::GrowMushroomIslandLayer(int32_t seed, int64_t seedMixup, shared_ptr parent) : Layer(seed,seedMixup) { this->parent = parent; } diff --git a/Minecraft.World/GrowMushroomIslandLayer.h b/Minecraft.World/GrowMushroomIslandLayer.h index a2c1affb..8ad18115 100644 --- a/Minecraft.World/GrowMushroomIslandLayer.h +++ b/Minecraft.World/GrowMushroomIslandLayer.h @@ -4,6 +4,6 @@ class GrowMushroomIslandLayer : public Layer { public: - GrowMushroomIslandLayer(int64_t seed, shared_ptr parent, int64_t seedMixup); + GrowMushroomIslandLayer(int32_t seed, int64_t seedMixup, shared_ptr parent); virtual intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/Minecraft.World/ImposeContinentsLayer.cpp b/Minecraft.World/ImposeContinentsLayer.cpp index 6fc755eb..9ca2c33e 100644 --- a/Minecraft.World/ImposeContinentsLayer.cpp +++ b/Minecraft.World/ImposeContinentsLayer.cpp @@ -15,7 +15,7 @@ bool dword_10073FD8[100] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -ImposeContinentsLayer::ImposeContinentsLayer(int64_t seed, shared_ptr parent) : Layer(seed) +ImposeContinentsLayer::ImposeContinentsLayer(int32_t seed, int64_t seedMixup, shared_ptr parent) : Layer(seed,seedMixup) { this->parent = parent; } diff --git a/Minecraft.World/ImposeContinentsLayer.h b/Minecraft.World/ImposeContinentsLayer.h index 8bd48fc4..f1800b12 100644 --- a/Minecraft.World/ImposeContinentsLayer.h +++ b/Minecraft.World/ImposeContinentsLayer.h @@ -5,7 +5,7 @@ class ImposeContinentsLayer : public Layer { public: - ImposeContinentsLayer(int64_t seed, shared_ptr parent); + ImposeContinentsLayer(int32_t seed, int64_t seedMixup, shared_ptr parent); virtual ~ImposeContinentsLayer(); virtual intArray getArea(int xo, int yo, int w, int h) override; diff --git a/Minecraft.World/IslandLayer.cpp b/Minecraft.World/IslandLayer.cpp index 0b1e882e..dc17ce0e 100644 --- a/Minecraft.World/IslandLayer.cpp +++ b/Minecraft.World/IslandLayer.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "net.minecraft.world.level.newbiome.layer.h" -IslandLayer::IslandLayer(int64_t seed, int64_t seedMixup) : Layer(seedMixup) +IslandLayer::IslandLayer(int32_t seed, int64_t seedMixup) : Layer(seed, seedMixup) { } diff --git a/Minecraft.World/IslandLayer.h b/Minecraft.World/IslandLayer.h index 9791ec12..972846ee 100644 --- a/Minecraft.World/IslandLayer.h +++ b/Minecraft.World/IslandLayer.h @@ -5,7 +5,7 @@ class IslandLayer : public Layer { public: - IslandLayer(int64_t seed, int64_t seedMixup); + IslandLayer::IslandLayer(int32_t seed, int64_t seedMixup); intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/Minecraft.World/Layer.cpp b/Minecraft.World/Layer.cpp index a0192492..6756b96d 100644 --- a/Minecraft.World/Layer.cpp +++ b/Minecraft.World/Layer.cpp @@ -22,25 +22,30 @@ LayerArray Layer::getDefaultLayers(int64_t seed, LevelType* levelType, void* sup { int32_t seed32 = (int32_t)seed; - shared_ptr islandLayer = make_shared(seed32, 1); - islandLayer = make_shared(seed32, islandLayer, 0x7D0); - islandLayer = make_shared(seed32, islandLayer, 1); - islandLayer = make_shared(seed32, islandLayer, 0x7D1); - islandLayer = make_shared(seed32, islandLayer, 2); - islandLayer = make_shared(seed32, islandLayer, 0x32); - islandLayer = make_shared(seed32, islandLayer, 0x46); - islandLayer = make_shared(seed32, islandLayer, 2); - islandLayer = make_shared(seed32, islandLayer, 2); - islandLayer = make_shared(seed32, islandLayer, 3); - islandLayer = make_shared(seed32, islandLayer, 2, 0); - islandLayer = make_shared(seed32, islandLayer, 2, 1); - islandLayer = make_shared(seed32, islandLayer, 3, 2); - islandLayer = make_shared(seed32, islandLayer, 0x7D2); - islandLayer = make_shared(seed32, islandLayer, 0x7D3); - islandLayer = make_shared(seed32, islandLayer, 4); - islandLayer = make_shared(seed32, islandLayer, 4); - shared_ptr baseLayer = ZoomLayer::zoom(seed32, islandLayer, 0x3E8, 0); + shared_ptr islandLayer = make_shared(seed32, 1LL); + islandLayer = make_shared(seed32, 0x7D0LL, islandLayer); + islandLayer = make_shared(seed32, 1LL, islandLayer); + islandLayer = make_shared(seed32, 0x7D1LL, islandLayer); + islandLayer = make_shared(seed32, 2LL, islandLayer); + islandLayer = make_shared(seed32, 0x32LL, islandLayer); + islandLayer = make_shared(seed32, 0x46LL, islandLayer); + islandLayer = make_shared(seed32, 2LL, islandLayer); + islandLayer = make_shared(seed32, 2LL, islandLayer); + islandLayer = make_shared(seed32, 3LL, islandLayer); + + + islandLayer = make_shared(seed32, 2LL, islandLayer, 0); + islandLayer = make_shared(seed32, 2LL, islandLayer, 1); + islandLayer = make_shared(seed32, 3LL, islandLayer, 2); + + islandLayer = make_shared(seed32, 0x7D2LL, islandLayer); + islandLayer = make_shared(seed32, 0x7D3LL, islandLayer); + islandLayer = make_shared(seed32, 4LL, islandLayer); + islandLayer = make_shared(seed32, 4LL, islandLayer); + + + shared_ptr baseLayer = ZoomLayer::zoom(seed32, 0x3E8LL, islandLayer, 0); int zoomLevel = 4; int riverZoomCount = 4; @@ -55,111 +60,126 @@ LayerArray Layer::getDefaultLayers(int64_t seed, LevelType* levelType, void* sup if (levelType == LevelType::lvl_largeBiomes) zoomLevel = 6; - shared_ptr riverInit = make_shared(seed32, baseLayer, 0x64); - shared_ptr hillsNoise = ZoomLayer::zoom(seed32, riverInit, 0x3E8, 2); - shared_ptr riverLayerFinal = ZoomLayer::zoom(seed32, riverInit, 0x3E8, 2); - riverLayerFinal = ZoomLayer::zoom(seed32, riverLayerFinal, 0x3E8, riverZoomCount); - riverLayerFinal = make_shared(seed32, riverLayerFinal, 1); - riverLayerFinal = make_shared(seed32, riverLayerFinal, 0x3E8); + shared_ptr riverInit = make_shared(seed32, 0x64LL, baseLayer); + shared_ptr hillsNoise = ZoomLayer::zoom(seed32, 0x3E8LL, riverInit, 2); - shared_ptr biomeLayer = make_shared(seed32, baseLayer, 0xC8, levelType, superflatConfig); + shared_ptr riverLayerFinal = ZoomLayer::zoom(seed32, 0x3E8LL, riverInit, 2); + riverLayerFinal = ZoomLayer::zoom(seed32, 0x3E8LL, riverLayerFinal, riverZoomCount); + riverLayerFinal = make_shared(seed32, 1LL, riverLayerFinal); + riverLayerFinal = make_shared(seed32, 0x3E8LL, riverLayerFinal); + + + shared_ptr biomeLayer = make_shared(seed32, 0xC8LL, baseLayer, levelType, superflatConfig); { - auto testBiome = make_shared(seed32, baseLayer, 0xC8, levelType, superflatConfig); - testBiome->init((uint32_t)seed); - IntCache::releaseAll(); - intArray testArea = testBiome->getArea(0, 0, 20, 20); - app.DebugPrintf("BiomeInitLayer only seed=%d:\n", seed32); - for (int z = 0; z < 20; z++) { - for (int x = 0; x < 20; x++) - app.DebugPrintf("%3d ", testArea[x + z*20]); - app.DebugPrintf("\n"); + auto testBiome = make_shared(seed32, 0xC8LL, baseLayer, levelType, superflatConfig); + testBiome->init((uint32_t)seed); + IntCache::releaseAll(); + intArray testArea = testBiome->getArea(0, 0, 20, 20); + app.DebugPrintf("BiomeInitLayer only seed=%d:\n", seed32); + for (int z = 0; z < 20; z++) { + for (int x = 0; x < 20; x++) + app.DebugPrintf("%3d ", testArea[x + z*20]); + app.DebugPrintf("\n"); + } + IntCache::releaseAll(); } - IntCache::releaseAll(); -} - biomeLayer = make_shared(seed32, biomeLayer, 0x3E8); - biomeLayer = make_shared(seed32, biomeLayer, hillsNoise, 0x3E8); + biomeLayer = make_shared(seed32, 0x3E8LL, biomeLayer); + + + biomeLayer = make_shared(seed32, 0x3E8LL, biomeLayer, hillsNoise); + { - auto testLayer = biomeLayer; - testLayer->init((uint32_t)seed); - IntCache::releaseAll(); - intArray testArea = testLayer->getArea(0, 0, 20, 20); - app.DebugPrintf("After RegionHillsLayer seed=%d:\n", seed32); - for (int z = 0; z < 20; z++) { - for (int x = 0; x < 20; x++) - app.DebugPrintf("%3d ", testArea[x + z*20]); - app.DebugPrintf("\n"); + auto testLayer = biomeLayer; + testLayer->init((uint32_t)seed); + IntCache::releaseAll(); + intArray testArea = testLayer->getArea(0, 0, 20, 20); + app.DebugPrintf("After RegionHillsLayer seed=%d:\n", seed32); + for (int z = 0; z < 20; z++) { + for (int x = 0; x < 20; x++) + app.DebugPrintf("%3d ", testArea[x + z*20]); + app.DebugPrintf("\n"); + } + IntCache::releaseAll(); } - IntCache::releaseAll(); -} - biomeLayer = make_shared(seed32, biomeLayer, 0x3E9); + biomeLayer = make_shared(seed32, 0x3E9LL, biomeLayer); + for (int i = 0; i < zoomLevel; ++i) { - biomeLayer = make_shared(seed32, biomeLayer, 0x3E8 + i); + + biomeLayer = make_shared(seed32, (int64_t)(0x3E8 + i), biomeLayer); if (i == 0) { - biomeLayer = make_shared(seed32, biomeLayer, 3); - biomeLayer = make_shared(seed32, biomeLayer, 5); + biomeLayer = make_shared(seed32, 3LL, biomeLayer); + biomeLayer = make_shared(seed32, 5LL, biomeLayer); } if (zoomLevel == 1 || i == 1) { - biomeLayer = make_shared(seed32, biomeLayer, 5); - biomeLayer = make_shared(seed32, biomeLayer, 0x3E8); + biomeLayer = make_shared(seed32, 5LL, biomeLayer); + biomeLayer = make_shared(seed32, 0x3E8LL, biomeLayer); } } - biomeLayer = make_shared(seed32, biomeLayer, 0x3E8); + biomeLayer = make_shared(seed32, 0x3E8LL, biomeLayer); + { - auto testLayer = biomeLayer; - testLayer->init((uint32_t)seed); - IntCache::releaseAll(); - intArray testArea = testLayer->getArea(60, 240, 20, 20); - app.DebugPrintf("After zoom loop seed=%d:\n", seed32); - for (int z = 0; z < 20; z++) { - for (int x = 0; x < 20; x++) - app.DebugPrintf("%3d ", testArea[x + z*20]); - app.DebugPrintf("\n"); + auto testLayer = biomeLayer; + testLayer->init((uint32_t)seed); + IntCache::releaseAll(); + intArray testArea = testLayer->getArea(60, 240, 20, 20); + app.DebugPrintf("After zoom loop seed=%d:\n", seed32); + for (int z = 0; z < 20; z++) { + for (int x = 0; x < 20; x++) + app.DebugPrintf("%3d ", testArea[x + z*20]); + app.DebugPrintf("\n"); + } + IntCache::releaseAll(); } - IntCache::releaseAll(); -} - shared_ptr mixed = make_shared(seed32, biomeLayer, riverLayerFinal, 0x64); - shared_ptr voronoi = make_shared(seed32, mixed, 0xA); + + + shared_ptr mixed = make_shared(seed32, 0x64LL, biomeLayer, riverLayerFinal); + shared_ptr voronoi = make_shared(seed32, 0xALL, mixed); mixed->init((uint32_t)seed); voronoi->init((uint32_t)seed); -IntCache::releaseAll(); -mixed->init((uint32_t)seed); -intArray testArea = mixed->getArea(0, 200, 60, 60); -app.DebugPrintf("Biomes 0-60, 200-260 seed=%d:\n", seed32); -for (int z = 0; z < 60; z++) { - for (int x = 0; x < 60; x++) - app.DebugPrintf("%3d ", testArea[x + z*60]); - app.DebugPrintf("\n"); -} -IntCache::releaseAll(); + IntCache::releaseAll(); + mixed->init((uint32_t)seed); + intArray testArea = mixed->getArea(0, 200, 60, 60); + app.DebugPrintf("Biomes 0-60, 200-260 seed=%d:\n", seed32); + for (int z = 0; z < 60; z++) { + for (int x = 0; x < 60; x++) + app.DebugPrintf("%3d ", testArea[x + z*60]); + app.DebugPrintf("\n"); + } + IntCache::releaseAll(); LayerArray result(3, false); result[0] = mixed; result[1] = voronoi; result[2] = mixed; - return result; } -Layer::Layer(int64_t s) + +Layer::Layer(int32_t seed, int64_t seedMixup) { - int64_t sm = (int64_t)(int32_t)s; - int64_t a = sm * (0x5851F42D4C957F2DLL * sm + 0x14057B7EF767814FLL) + sm; - int64_t b = (0x5851F42D4C957F2DLL * a + 0x14057B7EF767814FLL) * a + sm; - this->seedMixup = b * (0x5851F42D4C957F2DLL * b + 0x14057B7EF767814FLL) + sm; - this->parent = nullptr; + this->seed = 0; + + this->parent = nullptr; + this->rval = 0; + + + int64_t a = seedMixup * (0x5851F42D4C957F2DLL * seedMixup + 0x14057B7EF767814FLL) + seedMixup; + int64_t b = (0x5851F42D4C957F2DLL * a + 0x14057B7EF767814FLL) * a + seedMixup; + + this->seedMixup = b * (0x5851F42D4C957F2DLL * b + 0x14057B7EF767814FLL) + seedMixup; } void Layer::initRandom(int64_t x, int64_t y) diff --git a/Minecraft.World/Layer.h b/Minecraft.World/Layer.h index 4896e9fe..c767b39b 100644 --- a/Minecraft.World/Layer.h +++ b/Minecraft.World/Layer.h @@ -14,7 +14,7 @@ public: public: static LayerArray getDefaultLayers(int64_t seed, LevelType *levelType, void* superflatConfig = nullptr); - Layer(int64_t seedMixup); + Layer(int32_t seed, int64_t seedMixup); virtual void init(int64_t seed); bool isOcean(int biomeId); bool isSame(int biomeIdA, int biomeIdB); diff --git a/Minecraft.World/RareBiomeLayer.cpp b/Minecraft.World/RareBiomeLayer.cpp index 2efdb10d..b16807a8 100644 --- a/Minecraft.World/RareBiomeLayer.cpp +++ b/Minecraft.World/RareBiomeLayer.cpp @@ -3,7 +3,7 @@ #include "IntCache.h" #include "RareBiomeLayer.h" -RareBiomeLayer::RareBiomeLayer(int64_t seed, shared_ptr parent) : Layer(seed) +RareBiomeLayer::RareBiomeLayer(int32_t seed, shared_ptr parent) : Layer(seed,seedMixup) { this->parent = parent; } diff --git a/Minecraft.World/RareBiomeLayer.h b/Minecraft.World/RareBiomeLayer.h index b3f1b523..646f0b93 100644 --- a/Minecraft.World/RareBiomeLayer.h +++ b/Minecraft.World/RareBiomeLayer.h @@ -5,7 +5,7 @@ class RareBiomeLayer : public Layer { public: - RareBiomeLayer(int64_t seed, shared_ptr parent); + RareBiomeLayer(int32_t seed, shared_ptr parent); virtual ~RareBiomeLayer() {} virtual intArray getArea(int xo, int yo, int w, int h) override; }; diff --git a/Minecraft.World/RareBiomeSpotLayer.cpp b/Minecraft.World/RareBiomeSpotLayer.cpp index fbbc0113..64b209b5 100644 --- a/Minecraft.World/RareBiomeSpotLayer.cpp +++ b/Minecraft.World/RareBiomeSpotLayer.cpp @@ -3,7 +3,7 @@ #include "IntCache.h" #include "net.minecraft.world.level.biome.h" -RareBiomeSpotLayer::RareBiomeSpotLayer(int64_t seed, std::shared_ptr parent, int64_t seedMixup) : Layer(seedMixup) +RareBiomeSpotLayer::RareBiomeSpotLayer(int32_t seed, int64_t seedMixup, shared_ptr parent) : Layer(seed,seedMixup) { this->parent = parent; } diff --git a/Minecraft.World/RareBiomeSpotLayer.h b/Minecraft.World/RareBiomeSpotLayer.h index 2b449eef..f81fc178 100644 --- a/Minecraft.World/RareBiomeSpotLayer.h +++ b/Minecraft.World/RareBiomeSpotLayer.h @@ -5,6 +5,6 @@ class RareBiomeSpotLayer : public Layer { public: - RareBiomeSpotLayer(int64_t seed, std::shared_ptr parent, int64_t seedMixup); + RareBiomeSpotLayer(int32_t seed, int64_t seedMixup, shared_ptr parent); virtual intArray getArea(int xo, int yo, int w, int h) override; }; diff --git a/Minecraft.World/RegionHillsLayer.cpp b/Minecraft.World/RegionHillsLayer.cpp index 2bcee02a..ffe057e3 100644 --- a/Minecraft.World/RegionHillsLayer.cpp +++ b/Minecraft.World/RegionHillsLayer.cpp @@ -5,16 +5,11 @@ -RegionHillsLayer::RegionHillsLayer(int64_t seed, shared_ptr parent) : Layer(seed) +RegionHillsLayer::RegionHillsLayer(int32_t seed, int64_t seedMixup, shared_ptr parent, shared_ptr riverNoise) + : Layer(seed, seedMixup) { - this->parent = parent; - this->riverNoise = nullptr; -} - -RegionHillsLayer::RegionHillsLayer(int64_t seed, shared_ptr parent, shared_ptr riverNoise, int64_t seedMixup) : Layer(seedMixup) -{ - this->parent = parent; - this->riverNoise = riverNoise; + this->parent = parent; + this->riverNoise = riverNoise; } void RegionHillsLayer::init(int64_t seed) @@ -84,7 +79,7 @@ intArray RegionHillsLayer::getArea(int xo, int yo, int w, int h) } else if (k == Biome::roofedForest->id) { - // Java: roofedForest -> plains + i1 = Biome::plains->id; } else if (k == Biome::taiga->id) diff --git a/Minecraft.World/RegionHillsLayer.h b/Minecraft.World/RegionHillsLayer.h index 31afaaf6..01796eef 100644 --- a/Minecraft.World/RegionHillsLayer.h +++ b/Minecraft.World/RegionHillsLayer.h @@ -5,11 +5,11 @@ class RegionHillsLayer : public Layer { private: - shared_ptr riverNoise; // second parent: zoomed river init layer used as noise source + shared_ptr riverNoise; public: - RegionHillsLayer(int64_t seed, shared_ptr parent); - RegionHillsLayer(int64_t seed, shared_ptr parent, shared_ptr riverNoise, int64_t seedMixup); + + RegionHillsLayer(int32_t seed, int64_t seedMixup, shared_ptr parent, shared_ptr riverNoise); virtual void init(int64_t seed) override; virtual intArray getArea(int xo, int yo, int w, int h) override; diff --git a/Minecraft.World/RemoveTooMuchOceanLayer.cpp b/Minecraft.World/RemoveTooMuchOceanLayer.cpp index 5500ee17..23b81470 100644 --- a/Minecraft.World/RemoveTooMuchOceanLayer.cpp +++ b/Minecraft.World/RemoveTooMuchOceanLayer.cpp @@ -3,7 +3,7 @@ #include "IntCache.h" #include "RemoveTooMuchOceanLayer.h" -RemoveTooMuchOceanLayer::RemoveTooMuchOceanLayer(int64_t seed, shared_ptr parent, int64_t seedMixup) : Layer(seedMixup) +RemoveTooMuchOceanLayer::RemoveTooMuchOceanLayer(int32_t seed, int64_t seedMixup, shared_ptr parent) : Layer(seed,seedMixup) { this->parent = parent; } diff --git a/Minecraft.World/RemoveTooMuchOceanLayer.h b/Minecraft.World/RemoveTooMuchOceanLayer.h index 76b88cb6..f70ba31b 100644 --- a/Minecraft.World/RemoveTooMuchOceanLayer.h +++ b/Minecraft.World/RemoveTooMuchOceanLayer.h @@ -5,7 +5,7 @@ class RemoveTooMuchOceanLayer : public Layer { public: - RemoveTooMuchOceanLayer(int64_t seed, shared_ptr parent, int64_t seedMixup); + RemoveTooMuchOceanLayer(int32_t seed, int64_t seedMixup, shared_ptr parent); virtual ~RemoveTooMuchOceanLayer() {} virtual intArray getArea(int xo, int yo, int w, int h) override; }; diff --git a/Minecraft.World/RiverInitLayer.cpp b/Minecraft.World/RiverInitLayer.cpp index 2a4a964f..7b1d5a11 100644 --- a/Minecraft.World/RiverInitLayer.cpp +++ b/Minecraft.World/RiverInitLayer.cpp @@ -2,7 +2,7 @@ #include "RiverInitLayer.h" #include "net.minecraft.world.level.newbiome.layer.h" -RiverInitLayer::RiverInitLayer(int64_t seed, std::shared_ptr parent, int64_t seedMixup) : Layer(seedMixup) +RiverInitLayer::RiverInitLayer(int32_t seed, int64_t seedMixup, shared_ptr parent) : Layer(seed,seedMixup) { this->parent = parent; } diff --git a/Minecraft.World/RiverInitLayer.h b/Minecraft.World/RiverInitLayer.h index 7bcdd0ed..54f5c8a6 100644 --- a/Minecraft.World/RiverInitLayer.h +++ b/Minecraft.World/RiverInitLayer.h @@ -5,7 +5,7 @@ class RiverInitLayer : public Layer { public: - RiverInitLayer(int64_t seed, std::shared_ptr parent, int64_t seedMixup); + RiverInitLayer(int32_t seed, int64_t seedMixup, shared_ptr parent); intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/Minecraft.World/RiverLayer.cpp b/Minecraft.World/RiverLayer.cpp index 7ffd3433..c160f349 100644 --- a/Minecraft.World/RiverLayer.cpp +++ b/Minecraft.World/RiverLayer.cpp @@ -2,7 +2,7 @@ #include "net.minecraft.world.level.biome.h" #include "net.minecraft.world.level.newbiome.layer.h" -RiverLayer::RiverLayer(int64_t seed, shared_ptr parent, int64_t seedMixup) : Layer(seedMixup) +RiverLayer::RiverLayer(int32_t seed, int64_t seedMixup, shared_ptr parent) : Layer(seed,seedMixup) { this->parent = parent; } diff --git a/Minecraft.World/RiverLayer.h b/Minecraft.World/RiverLayer.h index 3f8a8361..e3512c5b 100644 --- a/Minecraft.World/RiverLayer.h +++ b/Minecraft.World/RiverLayer.h @@ -5,6 +5,6 @@ class RiverLayer : public Layer { public: - RiverLayer(int64_t seed, shared_ptr parent, int64_t seedMixup); + RiverLayer(int32_t seed, int64_t seedMixup, shared_ptr parent); intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/Minecraft.World/RiverMixerLayer.cpp b/Minecraft.World/RiverMixerLayer.cpp index a6dda05c..3d9a028a 100644 --- a/Minecraft.World/RiverMixerLayer.cpp +++ b/Minecraft.World/RiverMixerLayer.cpp @@ -2,10 +2,11 @@ #include "net.minecraft.world.level.biome.h" #include "net.minecraft.world.level.newbiome.layer.h" -RiverMixerLayer::RiverMixerLayer(int64_t seed, shared_ptr biomes, shared_ptr rivers, int64_t seedMixup) : Layer(seedMixup) +RiverMixerLayer::RiverMixerLayer(int32_t seed, int64_t seedMixup, std::shared_ptr biomes, std::shared_ptr rivers) + : Layer(seed, seedMixup) { - this->biomes = biomes; - this->rivers = rivers; + this->biomes = biomes; + this->rivers = rivers; } void RiverMixerLayer::init(int64_t seed) diff --git a/Minecraft.World/RiverMixerLayer.h b/Minecraft.World/RiverMixerLayer.h index 4b559482..20d1b428 100644 --- a/Minecraft.World/RiverMixerLayer.h +++ b/Minecraft.World/RiverMixerLayer.h @@ -9,7 +9,7 @@ private: shared_ptrrivers; public: - RiverMixerLayer(int64_t seed, shared_ptr biomes, shared_ptr rivers, int64_t seedMixup); + RiverMixerLayer(int32_t seed, int64_t seedMixup, std::shared_ptr biomes, std::shared_ptr rivers) ; virtual void init(int64_t seed); virtual intArray getArea(int xo, int yo, int w, int h); diff --git a/Minecraft.World/ShoreLayer.cpp b/Minecraft.World/ShoreLayer.cpp index 8aee931d..d4fb9dcc 100644 --- a/Minecraft.World/ShoreLayer.cpp +++ b/Minecraft.World/ShoreLayer.cpp @@ -3,7 +3,7 @@ #include "net.minecraft.world.level.biome.h" #include "IntCache.h" -ShoreLayer::ShoreLayer(int64_t seed, shared_ptr parent, int64_t seedMixup) : Layer(seedMixup) +ShoreLayer::ShoreLayer(int32_t seed, int64_t seedMixup, shared_ptr parent) : Layer(seed,seedMixup) { this->parent = parent; } diff --git a/Minecraft.World/ShoreLayer.h b/Minecraft.World/ShoreLayer.h index af3d1771..631c3ae9 100644 --- a/Minecraft.World/ShoreLayer.h +++ b/Minecraft.World/ShoreLayer.h @@ -4,7 +4,7 @@ class ShoreLayer : public Layer { public: - ShoreLayer(int64_t seed, shared_ptr parent, int64_t seedMixup); + ShoreLayer(int32_t seed,int64_t seedMixup, shared_ptr parent ); virtual intArray getArea(int xo, int yo, int w, int h); private: void replaceIfNeighborOcean(intArray& b, intArray& result, int x, int y, int w, int old, int replacement); diff --git a/Minecraft.World/SmoothLayer.cpp b/Minecraft.World/SmoothLayer.cpp index 24c5edee..f855678d 100644 --- a/Minecraft.World/SmoothLayer.cpp +++ b/Minecraft.World/SmoothLayer.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "net.minecraft.world.level.newbiome.layer.h" -SmoothLayer::SmoothLayer(int64_t seed, shared_ptr parent, int64_t seedMixup) : Layer(seedMixup) +SmoothLayer::SmoothLayer(int32_t seed, int64_t seedMixup,shared_ptr parent) : Layer(seed,seedMixup) { this->parent = parent; } diff --git a/Minecraft.World/SmoothLayer.h b/Minecraft.World/SmoothLayer.h index bc015c74..e510bfd3 100644 --- a/Minecraft.World/SmoothLayer.h +++ b/Minecraft.World/SmoothLayer.h @@ -5,7 +5,7 @@ class SmoothLayer : public Layer { public: - SmoothLayer(int64_t seed, shared_ptr parent, int64_t seedMixup); + SmoothLayer(int32_t seed, int64_t seedMixup,shared_ptr parent); virtual intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/Minecraft.World/SmoothZoomLayer.cpp b/Minecraft.World/SmoothZoomLayer.cpp index 60fd2664..27ff0e3b 100644 --- a/Minecraft.World/SmoothZoomLayer.cpp +++ b/Minecraft.World/SmoothZoomLayer.cpp @@ -2,9 +2,10 @@ #include "net.minecraft.world.level.newbiome.layer.h" #include "System.h" -SmoothZoomLayer::SmoothZoomLayer(int64_t seedMixup, shared_ptrparent) : Layer(seedMixup) +SmoothZoomLayer::SmoothZoomLayer(int32_t seed, int64_t seedMixup, shared_ptr parent) + : Layer(seed, seedMixup) { - this->parent = parent; + this->parent = parent; } intArray SmoothZoomLayer::getArea(int xo, int yo, int w, int h) @@ -50,12 +51,13 @@ intArray SmoothZoomLayer::getArea(int xo, int yo, int w, int h) return result; } -shared_ptrSmoothZoomLayer::zoom(int64_t seed, shared_ptrsup, int count) +shared_ptr SmoothZoomLayer::zoom(int32_t seed, int64_t seedMixup, shared_ptr sup, int count) { - shared_ptrresult = sup; - for (int i = 0; i < count; i++) - { - result = std::make_shared(seed + i, result); - } - return result; + shared_ptr result = sup; + for (int i = 0; i < count; i++) + { + + result = std::make_shared(seed, seedMixup + i, result); + } + return result; } \ No newline at end of file diff --git a/Minecraft.World/SmoothZoomLayer.h b/Minecraft.World/SmoothZoomLayer.h index 90cc292e..5797fbb2 100644 --- a/Minecraft.World/SmoothZoomLayer.h +++ b/Minecraft.World/SmoothZoomLayer.h @@ -5,8 +5,9 @@ class SmoothZoomLayer : public Layer { public: - SmoothZoomLayer(int64_t seedMixup, shared_ptrparent); + public: + SmoothZoomLayer(int32_t seed, int64_t seedMixup, std::shared_ptr parent); virtual intArray getArea(int xo, int yo, int w, int h); - static shared_ptrzoom(int64_t seed, shared_ptrsup, int count); + static shared_ptrzoom(int32_t seed, int64_t seedMixup, shared_ptr sup, int count); }; \ No newline at end of file diff --git a/Minecraft.World/SwampRiversLayer.cpp b/Minecraft.World/SwampRiversLayer.cpp index cd22cae8..6edd5e72 100644 --- a/Minecraft.World/SwampRiversLayer.cpp +++ b/Minecraft.World/SwampRiversLayer.cpp @@ -3,7 +3,7 @@ #include "IntCache.h" #include "SwampRiversLayer.h" -SwampRiversLayer::SwampRiversLayer(int64_t seed, shared_ptr parent) : Layer(seed) +SwampRiversLayer::SwampRiversLayer(int32_t seed, shared_ptr parent) : Layer(seed,seedMixup) { this->parent = parent; } diff --git a/Minecraft.World/SwampRiversLayer.h b/Minecraft.World/SwampRiversLayer.h index 97bab0f4..ec8d7d9d 100644 --- a/Minecraft.World/SwampRiversLayer.h +++ b/Minecraft.World/SwampRiversLayer.h @@ -5,7 +5,7 @@ class SwampRiversLayer : public Layer { public: - SwampRiversLayer(int64_t seed, shared_ptr parent); + SwampRiversLayer(int32_t seed, shared_ptr parent); intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/Minecraft.World/TemperatureLayer.cpp b/Minecraft.World/TemperatureLayer.cpp index b4963925..ab33822f 100644 --- a/Minecraft.World/TemperatureLayer.cpp +++ b/Minecraft.World/TemperatureLayer.cpp @@ -2,7 +2,7 @@ #include "net.minecraft.world.level.biome.h" #include "net.minecraft.world.level.newbiome.layer.h" -TemperatureLayer::TemperatureLayer(shared_ptr parent) : Layer(0) +TemperatureLayer::TemperatureLayer(shared_ptr parent) : Layer(0,0) { this->parent = parent; } diff --git a/Minecraft.World/TemperatureMixerLayer.cpp b/Minecraft.World/TemperatureMixerLayer.cpp index 27fbdf68..4c277ed0 100644 --- a/Minecraft.World/TemperatureMixerLayer.cpp +++ b/Minecraft.World/TemperatureMixerLayer.cpp @@ -2,7 +2,7 @@ #include "net.minecraft.world.level.biome.h" #include "net.minecraft.world.level.newbiome.layer.h" -TemperatureMixerLayer::TemperatureMixerLayer(shared_ptrtemp, shared_ptrparent, int layer) : Layer(0) +TemperatureMixerLayer::TemperatureMixerLayer(shared_ptrtemp, shared_ptrparent, int layer) : Layer(0,0) { this->parent = parent; this->temp = temp; diff --git a/Minecraft.World/VoronoiZoom.cpp b/Minecraft.World/VoronoiZoom.cpp index 1b403e96..3500f50f 100644 --- a/Minecraft.World/VoronoiZoom.cpp +++ b/Minecraft.World/VoronoiZoom.cpp @@ -2,7 +2,7 @@ #include "net.minecraft.world.level.newbiome.layer.h" #include "System.h" -VoronoiZoom::VoronoiZoom(int64_t seed, shared_ptr parent, int64_t seedMixup) : Layer(seedMixup) +VoronoiZoom::VoronoiZoom(int32_t seed, int64_t seedMixup, shared_ptr parent) : Layer(seed,seedMixup) { this->parent = parent; } diff --git a/Minecraft.World/VoronoiZoom.h b/Minecraft.World/VoronoiZoom.h index fad7c791..febdd47b 100644 --- a/Minecraft.World/VoronoiZoom.h +++ b/Minecraft.World/VoronoiZoom.h @@ -5,7 +5,7 @@ class VoronoiZoom : public Layer { public: - VoronoiZoom(int64_t seed, shared_ptr parent, int64_t seedMixup); + VoronoiZoom(int32_t seed, int64_t seedMixup, shared_ptr parent); virtual intArray getArea(int xo, int yo, int w, int h); diff --git a/Minecraft.World/ZoomLayer.cpp b/Minecraft.World/ZoomLayer.cpp index d1dd7799..544ecea4 100644 --- a/Minecraft.World/ZoomLayer.cpp +++ b/Minecraft.World/ZoomLayer.cpp @@ -2,9 +2,10 @@ #include "net.minecraft.world.level.newbiome.layer.h" #include "System.h" -ZoomLayer::ZoomLayer(int64_t seed, shared_ptr parent, int64_t seedMixup) : Layer(seedMixup) +ZoomLayer::ZoomLayer(int32_t seed, int64_t seedMixup, shared_ptr parent) + : Layer(seed, seedMixup) { - this->parent = parent; + this->parent = parent; } intArray ZoomLayer::getArea(int xo, int yo, int w, int h) @@ -70,12 +71,13 @@ int ZoomLayer::random(int a, int b, int c, int d) return d; } -shared_ptrZoomLayer::zoom(int64_t seed, shared_ptr sup, int64_t seedMixup, int count) +shared_ptr ZoomLayer::zoom(int32_t seed, int64_t seedMixup, shared_ptr sup, int count) { - shared_ptrresult = sup; - for (int i = 0; i < count; i++) - { - result = std::make_shared(seed, result, seedMixup + i); - } - return result; + shared_ptr result = sup; + for (int i = 0; i < count; i++) + { + + result = std::make_shared(seed, seedMixup + i, result); + } + return result; } \ No newline at end of file diff --git a/Minecraft.World/ZoomLayer.h b/Minecraft.World/ZoomLayer.h index 52c98358..061f37b3 100644 --- a/Minecraft.World/ZoomLayer.h +++ b/Minecraft.World/ZoomLayer.h @@ -5,8 +5,7 @@ class ZoomLayer : public Layer { public: - ZoomLayer(int64_t seed, shared_ptr parent,int64_t seedMixup); - + ZoomLayer::ZoomLayer(int32_t seed, int64_t seedMixup, shared_ptr parent); virtual intArray getArea(int xo, int yo, int w, int h); protected: @@ -14,5 +13,5 @@ protected: int random(int a, int b, int c, int d); public: - static shared_ptr zoom(int64_t seed, shared_ptr sup, int64_t seedMixup, int count); + static shared_ptr zoom(int32_t seed, int64_t seedMixup, shared_ptr sup, int count); }; \ No newline at end of file