0

Merge branch 'master' into rendermode-options

This commit is contained in:
Aaron Griffith
2011-06-12 22:25:59 -04:00
2 changed files with 21 additions and 18 deletions

View File

@@ -165,6 +165,7 @@ static void
rendermode_normal_draw(void *data, RenderState *state, PyObject *src, PyObject *mask, PyObject *mask_light) {
RenderModeNormal *self = (RenderModeNormal *)data;
int randx = 0,randy = 0;
unsigned char data_byte;
/* first, check to see if we should use biome-compatible src, mask */
if (self->biome_data) {
@@ -176,10 +177,10 @@ rendermode_normal_draw(void *data, RenderState *state, PyObject *src, PyObject *
randy = rand() % 6 + 1 - 3;
state->imgx = state->imgx + randx;
state->imgy = state->imgy + randy;
unsigned char data = getArrayByte3D(state->blockdata_expanded, state->x, state->y, state->z);
if (data == 1) {
data_byte = getArrayByte3D(state->blockdata_expanded, state->x, state->y, state->z);
if (data_byte == 1) {
src = mask = self->tall_grass_texture;
} else if (data == 2) {
} else if (data_byte == 2) {
src = mask = self->tall_fern_texture;
}
}

View File

@@ -208,23 +208,25 @@ class World(object):
## The filename of this chunk
chunkFile = self.get_region_path(chunkX, chunkY)
data=nbt.load_from_region(chunkFile, chunkX, chunkY)[1]
level = data['Level']
blockArray = numpy.frombuffer(level['Blocks'], dtype=numpy.uint8).reshape((16,16,128))
## The block for spawn *within* the chunk
inChunkX = spawnX - (chunkX*16)
inChunkZ = spawnZ - (chunkY*16)
## find the first air block
while (blockArray[inChunkX, inChunkZ, spawnY] != 0):
spawnY += 1
if spawnY == 128:
break
if chunkFile is not None:
data = nbt.load_from_region(chunkFile, chunkX, chunkY)[1]
if data is not None:
level = data['Level']
blockArray = numpy.frombuffer(level['Blocks'], dtype=numpy.uint8).reshape((16,16,128))
## The block for spawn *within* the chunk
inChunkX = spawnX - (chunkX*16)
inChunkZ = spawnZ - (chunkY*16)
## find the first air block
while (blockArray[inChunkX, inChunkZ, spawnY] != 0):
spawnY += 1
if spawnY == 128:
break
self.POI.append( dict(x=spawnX, y=spawnY, z=spawnZ,
msg="Spawn", type="spawn", chunk=(inChunkX,inChunkZ)))
msg="Spawn", type="spawn", chunk=(chunkX, chunkY)))
self.spawn = (spawnX, spawnY, spawnZ)
def go(self, procs):