From 69c109fc05ff1cd2da02b817ec8244d1c9c591c0 Mon Sep 17 00:00:00 2001 From: Aaron Griffith Date: Mon, 31 Oct 2011 13:28:28 -0400 Subject: [PATCH] moved trasparent_blocks, etc. into textures.py (Issue #516) --- overviewer_core/chunk.py | 19 ------------------- overviewer_core/src/iterate.c | 2 +- overviewer_core/src/rendermode-overlay.c | 4 ++-- overviewer_core/src/rendermode-spawn.c | 2 +- overviewer_core/textures.py | 19 +++++++++++++++++++ 5 files changed, 23 insertions(+), 23 deletions(-) diff --git a/overviewer_core/chunk.py b/overviewer_core/chunk.py index b8af17a..e638350 100644 --- a/overviewer_core/chunk.py +++ b/overviewer_core/chunk.py @@ -125,25 +125,6 @@ def get_tileentity_data(level): data = level['TileEntities'] return data -# This set holds blocks ids that can be seen through, for occlusion calculations -transparent_blocks = set([ 0, 6, 8, 9, 18, 20, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 37, 38, 39, 40, 44, 50, 51, 52, 53, 55, 59, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 74, 75, 76, 77, 78, 79, - 81, 83, 85, 90, 92, 93, 94, 96, 101, 102, 104, 105, - 106, 107, 108, 109]) - -# This set holds block ids that are solid blocks -solid_blocks = set([1, 2, 3, 4, 5, 7, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 35, 41, 42, 43, 44, 45, 46, 47, 48, 49, 53, 54, 56, 57, 58, 60, - 61, 62, 67, 73, 74, 78, 79, 80, 81, 82, 84, 86, 87, 88, 89, 91]) - -# This set holds block ids that are fluid blocks -fluid_blocks = set([8,9,10,11]) - -# This set holds block ids that are not candidates for spawning mobs on -# (glass, slabs, stairs, fluids, ice, pistons, webs,TNT, wheat, cactus, iron bars, glass planes, fences, fence gate, cake, bed, repeaters, trapdoor) -nospawn_blocks = set([20,26, 29, 30, 33, 34, 44, 46, 53, 59, 67, 79, 81, 85, 92, 93, 94, 96, 107, 109, 101, 102]).union(fluid_blocks) - class ChunkCorrupt(Exception): pass diff --git a/overviewer_core/src/iterate.c b/overviewer_core/src/iterate.c index 44f30f8..618c3aa 100644 --- a/overviewer_core/src/iterate.c +++ b/overviewer_core/src/iterate.c @@ -53,7 +53,7 @@ PyObject *init_chunk_render(PyObject *self, PyObject *args) { specialblockmap = PyObject_GetAttrString(textures, "specialblockmap"); if (!specialblockmap) return NULL; - transparent_blocks = PyObject_GetAttrString(chunk_mod, "transparent_blocks"); + transparent_blocks = PyObject_GetAttrString(textures, "transparent_blocks"); if (!transparent_blocks) return NULL; diff --git a/overviewer_core/src/rendermode-overlay.c b/overviewer_core/src/rendermode-overlay.c index 17b760b..72e58ff 100644 --- a/overviewer_core/src/rendermode-overlay.c +++ b/overviewer_core/src/rendermode-overlay.c @@ -38,8 +38,8 @@ rendermode_overlay_start(void *data, RenderState *state, PyObject *options) { self->white_color = PyObject_GetAttrString(state->chunk, "white_color"); - self->solid_blocks = PyObject_GetAttrString(state->chunk, "solid_blocks"); - self->fluid_blocks = PyObject_GetAttrString(state->chunk, "fluid_blocks"); + self->solid_blocks = PyObject_GetAttrString(state->textures, "solid_blocks"); + self->fluid_blocks = PyObject_GetAttrString(state->textures, "fluid_blocks"); self->get_color = get_color; diff --git a/overviewer_core/src/rendermode-spawn.c b/overviewer_core/src/rendermode-spawn.c index a5c0a27..c303f23 100644 --- a/overviewer_core/src/rendermode-spawn.c +++ b/overviewer_core/src/rendermode-spawn.c @@ -72,7 +72,7 @@ rendermode_spawn_start(void *data, RenderState *state, PyObject *options) { /* now do custom initializations */ self = (RenderModeSpawn *)data; - self->nospawn_blocks = PyObject_GetAttrString(state->chunk, "nospawn_blocks"); + self->nospawn_blocks = PyObject_GetAttrString(state->textures, "nospawn_blocks"); self->blocklight = PyObject_GetAttrString(state->self, "blocklight"); self->skylight = PyObject_GetAttrString(state->self, "skylight"); diff --git a/overviewer_core/textures.py b/overviewer_core/textures.py index c7e58d8..f4416db 100644 --- a/overviewer_core/textures.py +++ b/overviewer_core/textures.py @@ -2321,6 +2321,25 @@ def loadLightColor(): lightcolor = None return lightcolor +# This set holds blocks ids that can be seen through, for occlusion calculations +transparent_blocks = set([ 0, 6, 8, 9, 18, 20, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 37, 38, 39, 40, 44, 50, 51, 52, 53, 55, 59, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 74, 75, 76, 77, 78, 79, + 81, 83, 85, 90, 92, 93, 94, 96, 101, 102, 104, 105, + 106, 107, 108, 109]) + +# This set holds block ids that are solid blocks +solid_blocks = set([1, 2, 3, 4, 5, 7, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 35, 41, 42, 43, 44, 45, 46, 47, 48, 49, 53, 54, 56, 57, 58, 60, + 61, 62, 67, 73, 74, 78, 79, 80, 81, 82, 84, 86, 87, 88, 89, 91]) + +# This set holds block ids that are fluid blocks +fluid_blocks = set([8,9,10,11]) + +# This set holds block ids that are not candidates for spawning mobs on +# (glass, slabs, stairs, fluids, ice, pistons, webs,TNT, wheat, cactus, iron bars, glass planes, fences, fence gate, cake, bed, repeaters, trapdoor) +nospawn_blocks = set([20,26, 29, 30, 33, 34, 44, 46, 53, 59, 67, 79, 81, 85, 92, 93, 94, 96, 107, 109, 101, 102]).union(fluid_blocks) + # This set holds block ids that require special pre-computing. These are typically # things that require ancillary data to render properly (i.e. ladder plus orientation) # A good source of information is: