Added Foliage and Grass Color tinting, Started Basic Work on restoring ravines, New Option to Toggle Tinting.

This commit is contained in:
Shredder
2026-04-03 14:55:33 +05:00
parent eac71a93d1
commit ff5c57f6ba
27 changed files with 241 additions and 57 deletions

View File

@@ -149,13 +149,7 @@ Feature* Biome::getGrassFeature( Random* random ) {
return new TallgrassFeature(Tile::tallgrass->id, TallGrass::TALL_GRASS);
}
Feature* Biome::getBasicTreeFeature( Random* random )
{
if (random->nextInt(10) == 0) {
return new BasicTree(false);
}
}
Biome* Biome::getBiome( float temperature, float downfall )

View File

@@ -71,7 +71,6 @@ public:
virtual Feature* getTreeFeature(Random* random);
virtual Feature* getGrassFeature(Random* random);
virtual Feature* getBasicTreeFeature(Random* random);
static Biome* getBiome(float temperature, float downfall);
static Biome* _getBiome(float temperature, float downfall);

View File

@@ -69,11 +69,11 @@ Biome* BiomeSource::getBiome( int x, int z )
return getBiomeBlock(x, z, 1, 1)[0];
}
//float BiomeSource::getTemperature( int x, int z )
//{
// temperatures = temperatureMap->getRegion(temperatures, x, z, 1, 1, tempScale, tempScale, 0.5f);
// return temperatures[0];
//}
float BiomeSource::getTemperature( int x, int z )
{
temperatures = temperatureMap->getRegion(temperatures, x, z, 1, 1, tempScale, tempScale, 0.5f);
return temperatures[0];
}
Biome** BiomeSource::getBiomeBlock( int x, int z, int w, int h )
{
@@ -123,7 +123,7 @@ Biome** BiomeSource::getBiomeBlock( Biome** biomes__, int x, int z, int w, int h
return biomes;
}
float* BiomeSource::getTemperatureBlock( /*float* temperatures__, */int x, int z, int w, int h )
float* BiomeSource::getTemperatureBlock( float* temperatures__, int x, int z, int w, int h )
{
//LOGI("gTempBlock: 1\n");
//const int size = w * h;
@@ -164,8 +164,8 @@ float* BiomeSource::getTemperatureBlock( /*float* temperatures__, */int x, int z
return temperatures;
}
//float* BiomeSource::getDownfallBlock( /*float* downfalls__,*/ int x, int z, int w, int h )
//{
float* BiomeSource::getDownfallBlock( float* downfalls__, int x, int z, int w, int h )
{
// //const int size = w * h;
// //if (lenDownfalls < size) {
// // delete[] downfalls;
@@ -173,6 +173,6 @@ float* BiomeSource::getTemperatureBlock( /*float* temperatures__, */int x, int z
// // lenDownfalls = size;
// //}
//
// downfalls = downfallMap->getRegion(downfalls, x, z, w, w, downfallScale, downfallScale, 0.5f);
// return downfalls;
//}
downfalls = downfallMap->getRegion(downfalls, x, z, w, w, downfallScale, downfallScale, 0.5f);
return downfalls;
}

View File

@@ -31,13 +31,13 @@ public:
virtual Biome* getBiome(const ChunkPos& chunk);
virtual Biome* getBiome(int x, int z);
//virtual float getTemperature(int x, int z);
virtual float getTemperature(int x, int z);
// Note: The arrays returned here are temporary in the meaning that their
// contents might change in the future. If you need to SAVE the
// values, do a shallow copy to an array of your own.
virtual float* getTemperatureBlock(/*float* temperatures, */ int x, int z, int w, int h);
//virtual float* getDownfallBlock(/*float* downfalls, */int x, int z, int w, int h);
virtual float* getTemperatureBlock(float* temperatures, int x, int z, int w, int h);
virtual float* getDownfallBlock(float* downfalls, int x, int z, int w, int h);
virtual Biome** getBiomeBlock(int x, int z, int w, int h);
private: