mirror of
https://github.com/neocturne/MinedMap.git
synced 2025-07-04 22:59:07 +02:00
Add biome color computation
Rather than using fixed values for all biomes, generate grass and foliage colors based on (height-dependent) temperature and rainfall parameters. This changes a lot of colors; in general, the new colors should be closer to the actual Minecraft rendering. It also fixes a few colors that were completely off (like in the badlands biomes) and adds the MC 1.13 biomes (which were rendered in black). Some of the newer biomes (warm/cold/... oceans) don't have proper parameters yet, and we do not derive the water color from the biome yet. Fixes #1.
This commit is contained in:
parent
4ffa28dd63
commit
0bdf249307
7 changed files with 382 additions and 219 deletions
|
@ -27,6 +27,7 @@
|
|||
#pragma once
|
||||
|
||||
#include "../NBT/CompoundTag.hpp"
|
||||
#include "../Resource/Biome.hpp"
|
||||
#include "../Resource/BlockType.hpp"
|
||||
|
||||
|
||||
|
@ -34,17 +35,18 @@ namespace MinedMap {
|
|||
namespace World {
|
||||
|
||||
struct Block {
|
||||
struct Color {
|
||||
uint8_t r, g, b, a;
|
||||
};
|
||||
|
||||
const Resource::BlockType *type;
|
||||
unsigned height;
|
||||
uint8_t blockLight;
|
||||
uint8_t biome;
|
||||
|
||||
|
||||
Color getColor() const;
|
||||
Resource::Color getColor() const {
|
||||
if (!type || !type->opaque)
|
||||
return Resource::Color {};
|
||||
|
||||
return (Resource::BIOMES[biome] ?: Resource::BIOME_DEFAULT)->getBlockColor(type, height);
|
||||
}
|
||||
|
||||
operator bool() const {
|
||||
return type;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue