0

Implement some mossy blocks

This adds:
- mossy stone brick stairs
- mossy cobblestone stairs
- mossy stone brick walls

We also add another block class for walls, and while we're at it,
clean up the stairs texture function to not have a huge sprawling
elif mess for loading textures, but instead to a cheeky dictionary
lookup.

In case you're wondering, yes I am just as disgusted by this code as
you are.
This commit is contained in:
Nicolas F
2019-07-15 17:23:25 +02:00
parent 634e13c92c
commit 7e2cb56c1b
7 changed files with 56 additions and 43 deletions

View File

@@ -75,7 +75,9 @@ const mc_block_t block_class_stair[] = {
block_purpur_stairs,
block_prismarine_stairs,
block_dark_prismarine_stairs,
block_prismarine_brick_stairs};
block_prismarine_brick_stairs,
block_mossy_cobblestone_stairs,
block_mossy_stone_brick_stairs};
const size_t block_class_stair_len = COUNT_OF(block_class_stair);
const mc_block_t block_class_door[] = {
@@ -132,6 +134,8 @@ const mc_block_t block_class_ancil[] = {
block_prismarine_stairs,
block_dark_prismarine_stairs,
block_prismarine_brick_stairs,
block_mossy_cobblestone_stairs,
block_mossy_stone_brick_stairs,
block_grass,
block_flowing_water,
block_water,
@@ -146,6 +150,7 @@ const mc_block_t block_class_ancil[] = {
block_waterlily,
block_nether_brick_fence,
block_cobblestone_wall,
block_mossy_stone_brick_wall,
block_double_plant,
block_stained_glass_pane,
block_stained_glass,
@@ -175,6 +180,8 @@ const mc_block_t block_class_alt_height[] = {
block_prismarine_stairs,
block_dark_prismarine_stairs,
block_prismarine_brick_stairs,
block_mossy_cobblestone_stairs,
block_mossy_stone_brick_stairs,
block_prismarine_slab,
block_dark_prismarine_slab,
block_prismarine_brick_slab,
@@ -199,3 +206,8 @@ const mc_block_t block_class_alt_height[] = {
block_purpur_slab,
block_wooden_slab};
const size_t block_class_alt_height_len = COUNT_OF(block_class_alt_height);
const mc_block_t block_class_wall[] = {
block_cobblestone_wall,
block_mossy_stone_brick_wall};
const size_t block_class_wall_len = COUNT_OF(block_class_wall);

View File

@@ -46,4 +46,7 @@ extern const size_t block_class_ancil_len;
extern const mc_block_t block_class_alt_height[];
extern const size_t block_class_alt_height_len;
extern const mc_block_t block_class_wall[];
extern const size_t block_class_wall_len;
#endif

View File

@@ -390,7 +390,7 @@ generate_pseudo_data(RenderState* state, uint16_t ancilData) {
}
}
return data;
} else if (state->block == block_cobblestone_wall) {
} else if (block_class_is_subset(state->block, block_class_wall, block_class_wall_len)) {
/* check for walls and add one bit with the type of wall (mossy or cobblestone)*/
if (ancilData == 0x1) {
return check_adjacent_blocks(state, x, y, z, state->block) | 0x10;

View File

@@ -290,6 +290,9 @@ enum mc_block_id {
block_loom = 11367,
block_stonecutter = 11368,
block_grindstone = 11369,
block_mossy_stone_brick_stairs = 11370,
block_mossy_cobblestone_stairs = 11371,
block_mossy_stone_brick_wall = 11372,
};
typedef uint16_t mc_block_t;

View File

@@ -31,7 +31,7 @@
// increment this value if you've made a change to the c extesion
// and want to force users to rebuild
#define OVERVIEWER_EXTENSION_VERSION 69
#define OVERVIEWER_EXTENSION_VERSION 70
#include <stdbool.h>
#include <stdint.h>