Add correct foliage colors for birch and spruce

This commit is contained in:
Matthias Schiffer 2020-06-18 23:53:08 +02:00
parent ef4b6eac02
commit 685a4959f1
Signed by: neocturne
GPG key ID: 16EF3F64CB201D9C
6 changed files with 19 additions and 5 deletions

View file

@ -96,7 +96,7 @@
"texture": "birch_planks"
},
"birch_leaves": {
"foliage": true
"birch": true
},
"birch_log": {
"texture": "birch_log_top"
@ -1251,7 +1251,7 @@
"texture": "spruce_planks"
},
"spruce_leaves": {
"foliage": true
"spruce": true
},
"spruce_log": {
"texture": "spruce_log_top"

View file

@ -42,6 +42,8 @@ for name, info in blocks.items():
'opaque': False,
'grass': False,
'foliage': False,
'birch': False,
'spruce': False,
'water': False,
}
@ -54,6 +56,8 @@ for name, info in blocks.items():
output[id]['opaque'] = True
output[id]['grass'] = info.get('grass', False)
output[id]['foliage'] = info.get('foliage', False)
output[id]['birch'] = info.get('birch', False)
output[id]['spruce'] = info.get('spruce', False)
output[id]['water'] = info.get('water', False)
with open(sys.argv[3], 'w') as f:

View file

@ -22,6 +22,10 @@ with open(sys.argv[2], 'w') as f:
flags.append('BLOCK_GRASS')
if info['foliage']:
flags.append('BLOCK_FOLIAGE')
if info['birch']:
flags.append('BLOCK_BIRCH')
if info['spruce']:
flags.append('BLOCK_SPRUCE')
if info['water']:
flags.append('BLOCK_WATER')
if flags:

View file

@ -103,6 +103,10 @@ Color Biome::getBlockColor(const BlockType *type, unsigned height) const {
c *= getGrassColor(t, r);
if (type->flags & BLOCK_FOLIAGE)
c *= getFoliageColor(t, r);
if (type->flags & BLOCK_BIRCH)
c *= FloatColor {0.380f, 0.600f, 0.380f};
if (type->flags & BLOCK_SPRUCE)
c *= FloatColor {0.502f, 0.655f, 0.333f};
if (type->flags & BLOCK_WATER)
c *= getWaterColor(t, r);

View file

@ -36,7 +36,9 @@ namespace Resource {
#define BLOCK_OPAQUE (1u << 0)
#define BLOCK_GRASS (1u << 1)
#define BLOCK_FOLIAGE (1u << 2)
#define BLOCK_WATER (1u << 3)
#define BLOCK_BIRCH (1u << 3)
#define BLOCK_SPRUCE (1u << 4)
#define BLOCK_WATER (1u << 5)
struct BlockType {
private:

View file

@ -40,7 +40,7 @@
{"minecraft:birch_door", {BLOCK_OPAQUE, {220, 209, 176}}},
{"minecraft:birch_fence", {BLOCK_OPAQUE, {192, 175, 121}}},
{"minecraft:birch_fence_gate", {BLOCK_OPAQUE, {192, 175, 121}}},
{"minecraft:birch_leaves", {BLOCK_OPAQUE|BLOCK_FOLIAGE, {130, 129, 130}}},
{"minecraft:birch_leaves", {BLOCK_OPAQUE|BLOCK_BIRCH, {130, 129, 130}}},
{"minecraft:birch_log", {BLOCK_OPAQUE, {193, 179, 135}}},
{"minecraft:birch_planks", {BLOCK_OPAQUE, {192, 175, 121}}},
{"minecraft:birch_pressure_plate", {BLOCK_OPAQUE, {192, 175, 121}}},
@ -649,7 +649,7 @@
{"minecraft:spruce_door", {BLOCK_OPAQUE, {106, 80, 48}}},
{"minecraft:spruce_fence", {BLOCK_OPAQUE, {114, 84, 48}}},
{"minecraft:spruce_fence_gate", {BLOCK_OPAQUE, {114, 84, 48}}},
{"minecraft:spruce_leaves", {BLOCK_OPAQUE|BLOCK_FOLIAGE, {126, 126, 126}}},
{"minecraft:spruce_leaves", {BLOCK_OPAQUE|BLOCK_SPRUCE, {126, 126, 126}}},
{"minecraft:spruce_log", {BLOCK_OPAQUE, {108, 80, 46}}},
{"minecraft:spruce_planks", {BLOCK_OPAQUE, {114, 84, 48}}},
{"minecraft:spruce_pressure_plate", {BLOCK_OPAQUE, {114, 84, 48}}},