Merge branch 'master' of https://github.com/guitarfreak/stb into working
This commit is contained in:
commit
98537b7091
@ -2900,6 +2900,8 @@ static void stbvox_make_mesh_for_block(stbvox_mesh_maker *mm, stbvox_pos pos, in
|
|||||||
|
|
||||||
if (mm->input.selector)
|
if (mm->input.selector)
|
||||||
mesh = mm->input.selector[v_off];
|
mesh = mm->input.selector[v_off];
|
||||||
|
else if (mm->input.block_selector)
|
||||||
|
mesh = mm->input.block_selector[mm->input.blocktype[v_off]];
|
||||||
|
|
||||||
// check if we're going off the end
|
// check if we're going off the end
|
||||||
if (mm->output_cur[mesh][0] + mm->output_size[mesh][0]*6 > mm->output_end[mesh][0]) {
|
if (mm->output_cur[mesh][0] + mm->output_size[mesh][0]*6 > mm->output_end[mesh][0]) {
|
||||||
@ -3109,6 +3111,8 @@ static void stbvox_make_mesh_for_block_with_geo(stbvox_mesh_maker *mm, stbvox_po
|
|||||||
mesh = mm->default_mesh;
|
mesh = mm->default_mesh;
|
||||||
if (mm->input.selector)
|
if (mm->input.selector)
|
||||||
mesh = mm->input.selector[v_off];
|
mesh = mm->input.selector[v_off];
|
||||||
|
else if (mm->input.block_selector)
|
||||||
|
mesh = mm->input.block_selector[bt];
|
||||||
|
|
||||||
if (geo <= STBVOX_GEOM_ceil_slope_north_is_bottom) {
|
if (geo <= STBVOX_GEOM_ceil_slope_north_is_bottom) {
|
||||||
// this is the simple case, we can just use regular block gen with special vmesh calculated with vheight
|
// this is the simple case, we can just use regular block gen with special vmesh calculated with vheight
|
||||||
@ -3130,7 +3134,9 @@ static void stbvox_make_mesh_for_block_with_geo(stbvox_mesh_maker *mm, stbvox_po
|
|||||||
basevert = stbvox_vertex_encode(pos.x, pos.y, pos.z << STBVOX_CONFIG_PRECISION_Z, 0,0);
|
basevert = stbvox_vertex_encode(pos.x, pos.y, pos.z << STBVOX_CONFIG_PRECISION_Z, 0,0);
|
||||||
if (mm->input.selector) {
|
if (mm->input.selector) {
|
||||||
mesh = mm->input.selector[v_off];
|
mesh = mm->input.selector[v_off];
|
||||||
}
|
} else if (mm->input.block_selector)
|
||||||
|
mesh = mm->input.block_selector[bt];
|
||||||
|
|
||||||
|
|
||||||
// check if we're going off the end
|
// check if we're going off the end
|
||||||
if (mm->output_cur[mesh][0] + mm->output_size[mesh][0]*6 > mm->output_end[mesh][0]) {
|
if (mm->output_cur[mesh][0] + mm->output_size[mesh][0]*6 > mm->output_end[mesh][0]) {
|
||||||
@ -3351,6 +3357,9 @@ static void stbvox_make_mesh_for_block_with_geo(stbvox_mesh_maker *mm, stbvox_po
|
|||||||
simple_rot = mesh >> 4;
|
simple_rot = mesh >> 4;
|
||||||
mesh &= 15;
|
mesh &= 15;
|
||||||
}
|
}
|
||||||
|
if (mm->input.block_selector) {
|
||||||
|
mesh = mm->input.block_selector[bt];
|
||||||
|
}
|
||||||
|
|
||||||
// check if we're going off the end
|
// check if we're going off the end
|
||||||
if (mm->output_cur[mesh][0] + mm->output_size[mesh][0]*4 > mm->output_end[mesh][0]) {
|
if (mm->output_cur[mesh][0] + mm->output_size[mesh][0]*4 > mm->output_end[mesh][0]) {
|
||||||
|
Loading…
Reference in New Issue
Block a user