mirror of
https://github.com/neocturne/MinedMap.git
synced 2025-07-05 15:19:07 +02:00
Biome: return FloatColor for block colors
This commit is contained in:
parent
50f798f89e
commit
19ef022a67
5 changed files with 53 additions and 49 deletions
|
@ -39,10 +39,13 @@ struct Block {
|
|||
unsigned depth;
|
||||
uint8_t blockLight;
|
||||
|
||||
bool isVisible() const {
|
||||
return type && (type->flags & BLOCK_OPAQUE);
|
||||
}
|
||||
|
||||
Resource::Color getColor(uint8_t biome) const {
|
||||
if (!type || !(type->flags & BLOCK_OPAQUE))
|
||||
return Resource::Color {};
|
||||
Resource::FloatColor getColor(uint8_t biome) const {
|
||||
if (!isVisible())
|
||||
return Resource::FloatColor {};
|
||||
|
||||
return (Resource::BIOMES[biome] ?: Resource::BIOME_DEFAULT)->getBlockColor(type, depth);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue