Fixed edge-lines and side rendering for snow layers
This commit is contained in:
parent
86b241a5f7
commit
38762b9ff7
|
@ -45,8 +45,13 @@ edge_lines_draw(void* data, RenderState* state, PyObject* src, PyObject* mask, P
|
|||
int32_t increment = 0;
|
||||
if (block_class_is_subset(state->block, (mc_block_t[]){block_wooden_slab, block_stone_slab}, 2) && ((state->block_data & 0x8) == 0)) // half-steps BUT no upsidown half-steps
|
||||
increment = 6;
|
||||
else if (block_class_is_subset(state->block, (mc_block_t[]){block_snow_layer, block_unpowered_repeater, block_powered_repeater}, 3)) // snow, redstone repeaters (on and off)
|
||||
else if (block_class_is_subset(state->block, (mc_block_t[]){block_unpowered_repeater, block_powered_repeater}, 2)) // redstone repeaters (on and off)
|
||||
increment = 9;
|
||||
else if (state->block == block_snow_layer) {
|
||||
uint32_t block_data = get_data(state, DATA, x, y, z);
|
||||
// height calculation from textures.py -> def snow
|
||||
increment = (int)((12.0f - (12.0f / 8.0f * (float)block_data)));
|
||||
}
|
||||
|
||||
/* +X side */
|
||||
side_block = get_data(state, BLOCKS, x + 1, y, z);
|
||||
|
|
|
@ -3601,8 +3601,6 @@ def end_rod(self, blockid, data):
|
|||
# snow
|
||||
@material(blockid=78, data=list(range(1, 9)), transparent=True, solid=True)
|
||||
def snow(self, blockid, data):
|
||||
# still not rendered correctly: data other than 0
|
||||
|
||||
tex = self.load_image_texture("assets/minecraft/textures/block/snow.png")
|
||||
|
||||
y = 16 - (data * 2)
|
||||
|
@ -3616,6 +3614,13 @@ def snow(self, blockid, data):
|
|||
side = self.transform_image_side(sidetex)
|
||||
otherside = side.transpose(Image.FLIP_LEFT_RIGHT)
|
||||
|
||||
sidealpha = side.split()[3]
|
||||
side = ImageEnhance.Brightness(side).enhance(0.9)
|
||||
side.putalpha(sidealpha)
|
||||
othersidealpha = otherside.split()[3]
|
||||
otherside = ImageEnhance.Brightness(otherside).enhance(0.8)
|
||||
otherside.putalpha(othersidealpha)
|
||||
|
||||
alpha_over(img, side, (0, 6), side)
|
||||
alpha_over(img, otherside, (12, 6), otherside)
|
||||
alpha_over(img, top, (0, 12 - int(12 / 8 * data)), top)
|
||||
|
|
Loading…
Reference in New Issue