@@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
// increment this value if you've made a change to the c extesion
|
// increment this value if you've made a change to the c extesion
|
||||||
// and want to force users to rebuild
|
// and want to force users to rebuild
|
||||||
#define OVERVIEWER_EXTENSION_VERSION 29
|
#define OVERVIEWER_EXTENSION_VERSION 30
|
||||||
|
|
||||||
/* Python PIL, and numpy headers */
|
/* Python PIL, and numpy headers */
|
||||||
#include <Python.h>
|
#include <Python.h>
|
||||||
@@ -35,11 +35,11 @@
|
|||||||
|
|
||||||
/* macro for getting a value out of various numpy arrays the 3D arrays have
|
/* macro for getting a value out of various numpy arrays the 3D arrays have
|
||||||
interesting, swizzled coordinates because minecraft (anvil) stores blocks
|
interesting, swizzled coordinates because minecraft (anvil) stores blocks
|
||||||
in y/z/x order */
|
in y/z/x order for 3D, z/x order for 2D */
|
||||||
#define getArrayByte3D(array, x,y,z) (*(unsigned char *)(PyArray_GETPTR3((array), (y), (z), (x))))
|
#define getArrayByte3D(array, x,y,z) (*(unsigned char *)(PyArray_GETPTR3((array), (y), (z), (x))))
|
||||||
#define getArrayShort3D(array, x,y,z) (*(unsigned short *)(PyArray_GETPTR3((array), (y), (z), (x))))
|
#define getArrayShort3D(array, x,y,z) (*(unsigned short *)(PyArray_GETPTR3((array), (y), (z), (x))))
|
||||||
#define getArrayByte2D(array, x,y) (*(unsigned char *)(PyArray_GETPTR2((array), (x), (y))))
|
#define getArrayByte2D(array, x,y) (*(unsigned char *)(PyArray_GETPTR2((array), (y), (x))))
|
||||||
#define getArrayShort2D(array, x,y) (*(unsigned short *)(PyArray_GETPTR2((array), (x), (y))))
|
|
||||||
|
|
||||||
/* generally useful MAX / MIN macros */
|
/* generally useful MAX / MIN macros */
|
||||||
#define MAX(a, b) ((a) > (b) ? (a) : (b))
|
#define MAX(a, b) ((a) > (b) ? (a) : (b))
|
||||||
|
|||||||
@@ -214,7 +214,7 @@ base_draw(void *data, RenderState *state, PyObject *src, PyObject *mask, PyObjec
|
|||||||
if (self->use_biomes) {
|
if (self->use_biomes) {
|
||||||
/* average over all neighbors */
|
/* average over all neighbors */
|
||||||
for (dx = -1; dx <= 1; dx++) {
|
for (dx = -1; dx <= 1; dx++) {
|
||||||
for (dz = -1; dz <= 1; dz += (dx == 0 ? 2 : 1)) {
|
for (dz = -1; dz <= 1; dz++) {
|
||||||
unsigned char biome = get_data(state, BIOMES, state->x + dx, state->y, state->z + dz);
|
unsigned char biome = get_data(state, BIOMES, state->x + dx, state->y, state->z + dz);
|
||||||
if (biome >= NUM_BIOMES) {
|
if (biome >= NUM_BIOMES) {
|
||||||
/* note -- biome 255 shows up on map borders.
|
/* note -- biome 255 shows up on map borders.
|
||||||
@@ -227,8 +227,8 @@ base_draw(void *data, RenderState *state, PyObject *src, PyObject *mask, PyObjec
|
|||||||
rain += biome_table[biome].rainfall;
|
rain += biome_table[biome].rainfall;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
temp /= 8.0;
|
temp /= 9.0;
|
||||||
rain /= 8.0;
|
rain /= 9.0;
|
||||||
} else {
|
} else {
|
||||||
/* don't use biomes, just use the default */
|
/* don't use biomes, just use the default */
|
||||||
temp = biome_table[DEFAULT_BIOME].temperature;
|
temp = biome_table[DEFAULT_BIOME].temperature;
|
||||||
|
|||||||
Reference in New Issue
Block a user