0

edge-lines and nether primitives in working order

This commit is contained in:
Aaron Griffith
2012-02-21 15:05:00 -05:00
parent a8c298fe4e
commit c5f2077d51
2 changed files with 36 additions and 37 deletions

View File

@@ -19,15 +19,31 @@
static int
nether_hidden(void *data, RenderState *state, int x, int y, int z) {
/* hide all blocks above all air blocks */
while (z < 128)
/* hide all blocks above all air blocks
due to how the nether is currently generated, this will also count
empty sections as 'solid'
*/
unsigned char missing_section = 0;
while (y < (SECTIONS_PER_CHUNK - state->chunky) * 16)
{
if (getArrayByte3D(state->blocks, x, y, z) == 0)
{
return 0;
break;
if (state->chunks[1][1].sections[state->chunky + (y / 16)].blocks == NULL) {
missing_section = 1;
y += 16;
continue;
} else {
/* if we passed through a missing section, but now are back in,
that counts as air */
if (missing_section)
return 0;
missing_section = 0;
}
z++;
if (!missing_section && get_data(state, BLOCKS, x, y, z) == 0)
{
return 0;
}
y++;
}
return 1;
}