Renamed the current nether to netherold, and made the new nether2 the default
This commit is contained in:
@@ -47,12 +47,12 @@ class Base(RenderPrimitive):
|
|||||||
"biomes": ("whether or not to use biomes", True),
|
"biomes": ("whether or not to use biomes", True),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class NetherOld(RenderPrimitive):
|
||||||
|
name = "netherold"
|
||||||
|
|
||||||
class Nether(RenderPrimitive):
|
class Nether(RenderPrimitive):
|
||||||
name = "nether"
|
name = "nether"
|
||||||
|
|
||||||
class NetherAlt(RenderPrimitive):
|
|
||||||
name = "nether2"
|
|
||||||
|
|
||||||
class HeightFading(RenderPrimitive):
|
class HeightFading(RenderPrimitive):
|
||||||
name = "height-fading"
|
name = "height-fading"
|
||||||
options = {
|
options = {
|
||||||
@@ -230,10 +230,10 @@ lighting = [Base(), EdgeLines(), Lighting()]
|
|||||||
smooth_lighting = [Base(), EdgeLines(), SmoothLighting()]
|
smooth_lighting = [Base(), EdgeLines(), SmoothLighting()]
|
||||||
night = [Base(), EdgeLines(), Lighting(night=True)]
|
night = [Base(), EdgeLines(), Lighting(night=True)]
|
||||||
smooth_night = [Base(), EdgeLines(), SmoothLighting(night=True)]
|
smooth_night = [Base(), EdgeLines(), SmoothLighting(night=True)]
|
||||||
|
netherold = [Base(), EdgeLines(), NetherOld()]
|
||||||
|
netherold_lighting = [Base(), EdgeLines(), NetherOld(), Lighting()]
|
||||||
|
netherold_smooth_lighting = [Base(), EdgeLines(), NetherOld(), SmoothLighting()]
|
||||||
nether = [Base(), EdgeLines(), Nether()]
|
nether = [Base(), EdgeLines(), Nether()]
|
||||||
nether_lighting = [Base(), EdgeLines(), Nether(), Lighting()]
|
nether_lighting = [Base(), EdgeLines(), Nether(), Lighting()]
|
||||||
nether_smooth_lighting = [Base(), EdgeLines(), Nether(), SmoothLighting()]
|
nether_smooth_lighting = [Base(), EdgeLines(), Nether(), SmoothLighting()]
|
||||||
netheralt = [Base(), EdgeLines(), NetherAlt()]
|
|
||||||
netheralt_lighting = [Base(), EdgeLines(), NetherAlt(), Lighting()]
|
|
||||||
netheralt_smooth_lighting = [Base(), EdgeLines(), NetherAlt(), SmoothLighting()]
|
|
||||||
cave = [Base(), EdgeLines(), Cave(), DepthTinting()]
|
cave = [Base(), EdgeLines(), Cave(), DepthTinting()]
|
||||||
|
|||||||
@@ -16,40 +16,51 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "../overviewer.h"
|
#include "../overviewer.h"
|
||||||
|
#include "nether.h"
|
||||||
|
|
||||||
|
static void
|
||||||
|
walk_chunk(RenderState *state, RenderPrimitiveNether *data) {
|
||||||
|
int x, y, z;
|
||||||
|
int id;
|
||||||
|
|
||||||
|
for (x = 0; x < WIDTH; x++) {
|
||||||
|
for (z = 0; z < DEPTH; z++) {
|
||||||
|
id = get_data(state, BLOCKS, x, NETHER_ROOF - (state->chunky * 16), z);
|
||||||
|
if (id == 7) {
|
||||||
|
data->remove_block[x][NETHER_ROOF][z] = 1;
|
||||||
|
id = get_data(state, BLOCKS, x, (NETHER_ROOF + 1) - (state->chunky * 16), z);
|
||||||
|
if (id == 39 || id == 40)
|
||||||
|
data->remove_block[x][NETHER_ROOF + 1][z] = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (y = NETHER_ROOF-1; y>=0; y--) {
|
||||||
|
id = get_data(state, BLOCKS, x, y - (state->chunky * 16), z);
|
||||||
|
if (id == 7 || id == 87)
|
||||||
|
data->remove_block[x][y][z] = 1;
|
||||||
|
else
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
data->walked_chunk = 1;
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
nether_hidden(void *data, RenderState *state, int x, int y, int z) {
|
nether_hidden(void *data, RenderState *state, int x, int y, int z) {
|
||||||
/* hide all blocks above all air blocks
|
RenderPrimitiveNether* self;
|
||||||
|
int real_y;
|
||||||
|
|
||||||
due to how the nether is currently generated, this will also count
|
self = (RenderPrimitiveNether *)data;
|
||||||
empty sections as 'solid'
|
|
||||||
*/
|
|
||||||
unsigned char missing_section = 0;
|
|
||||||
while (y < (SECTIONS_PER_CHUNK - state->chunky) * 16)
|
|
||||||
{
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!missing_section && get_data(state, BLOCKS, x, y, z) == 0)
|
if (!(self->walked_chunk))
|
||||||
{
|
walk_chunk(state, self);
|
||||||
return 0;
|
|
||||||
}
|
real_y = y + (state->chunky * 16);
|
||||||
y++;
|
return self->remove_block[x][real_y][z];
|
||||||
}
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RenderPrimitiveInterface primitive_nether = {
|
RenderPrimitiveInterface primitive_nether = {
|
||||||
"nether", 0,
|
"nether", sizeof(RenderPrimitiveNether),
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
|
|||||||
@@ -27,4 +27,4 @@ typedef struct {
|
|||||||
|
|
||||||
int remove_block[WIDTH][HEIGHT][DEPTH];
|
int remove_block[WIDTH][HEIGHT][DEPTH];
|
||||||
|
|
||||||
} RenderPrimitiveNether2;
|
} RenderPrimitiveNether;
|
||||||
@@ -1,69 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is part of the Minecraft Overviewer.
|
|
||||||
*
|
|
||||||
* Minecraft Overviewer is free software: you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU General Public License as published
|
|
||||||
* by the Free Software Foundation, either version 3 of the License, or (at
|
|
||||||
* your option) any later version.
|
|
||||||
*
|
|
||||||
* Minecraft Overviewer is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
|
||||||
* Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License along
|
|
||||||
* with the Overviewer. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "../overviewer.h"
|
|
||||||
#include "nether2.h"
|
|
||||||
|
|
||||||
static void
|
|
||||||
walk_chunk(RenderState *state, RenderPrimitiveNether2 *data) {
|
|
||||||
int x, y, z;
|
|
||||||
int id;
|
|
||||||
|
|
||||||
for (x = 0; x < WIDTH; x++) {
|
|
||||||
for (z = 0; z < DEPTH; z++) {
|
|
||||||
id = get_data(state, BLOCKS, x, NETHER_ROOF - (state->chunky * 16), z);
|
|
||||||
if (id == 7) {
|
|
||||||
data->remove_block[x][NETHER_ROOF][z] = 1;
|
|
||||||
id = get_data(state, BLOCKS, x, (NETHER_ROOF + 1) - (state->chunky * 16), z);
|
|
||||||
if (id == 39 || id == 40)
|
|
||||||
data->remove_block[x][NETHER_ROOF + 1][z] = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (y = NETHER_ROOF-1; y>=0; y--) {
|
|
||||||
id = get_data(state, BLOCKS, x, y - (state->chunky * 16), z);
|
|
||||||
if (id == 7 || id == 87)
|
|
||||||
data->remove_block[x][y][z] = 1;
|
|
||||||
else
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
data->walked_chunk = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
|
||||||
nether2_hidden(void *data, RenderState *state, int x, int y, int z) {
|
|
||||||
RenderPrimitiveNether2* self;
|
|
||||||
int real_y;
|
|
||||||
|
|
||||||
self = (RenderPrimitiveNether2 *)data;
|
|
||||||
|
|
||||||
if (!(self->walked_chunk))
|
|
||||||
walk_chunk(state, self);
|
|
||||||
|
|
||||||
real_y = y + (state->chunky * 16);
|
|
||||||
return self->remove_block[x][real_y][z];
|
|
||||||
}
|
|
||||||
|
|
||||||
RenderPrimitiveInterface primitive_nether2 = {
|
|
||||||
"nether2", sizeof(RenderPrimitiveNether2),
|
|
||||||
NULL,
|
|
||||||
NULL,
|
|
||||||
NULL,
|
|
||||||
nether2_hidden,
|
|
||||||
NULL,
|
|
||||||
};
|
|
||||||
58
overviewer_core/src/primitives/nether_old.c
Normal file
58
overviewer_core/src/primitives/nether_old.c
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the Minecraft Overviewer.
|
||||||
|
*
|
||||||
|
* Minecraft Overviewer is free software: you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License as published
|
||||||
|
* by the Free Software Foundation, either version 3 of the License, or (at
|
||||||
|
* your option) any later version.
|
||||||
|
*
|
||||||
|
* Minecraft Overviewer is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||||
|
* Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along
|
||||||
|
* with the Overviewer. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "../overviewer.h"
|
||||||
|
|
||||||
|
static int
|
||||||
|
netherold_hidden(void *data, RenderState *state, int x, int y, int z) {
|
||||||
|
/* 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 (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;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!missing_section && get_data(state, BLOCKS, x, y, z) == 0)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
y++;
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
RenderPrimitiveInterface primitive_nether_old = {
|
||||||
|
"netherold", 0,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
netherold_hidden,
|
||||||
|
NULL,
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user