0

added endianness helper functions, and reading biome data directly

This commit is contained in:
Aaron Griffith
2011-03-27 06:07:43 -04:00
parent fc176206ff
commit e0e571971a
5 changed files with 49 additions and 8 deletions

View File

@@ -128,16 +128,11 @@ rendermode_normal_draw(void *data, RenderState *state, PyObject *src, PyObject *
if (self->biome_data) {
/* do the biome stuff! */
unsigned int index;
PyObject *index_py, *color = NULL, *facemask = NULL;
PyObject *color = NULL, *facemask = NULL;
unsigned char r, g, b;
index = ((self->chunk_y * 16) + state->y) * 16 * 32 + (self->chunk_x * 16) + state->x;
/* TODO for some reason, this one doesn't work:
* index = getArrayShort1D(self->biome_data, index);
*/
index_py = PySequence_GetItem(self->biome_data, index);
index = PyInt_AsLong(index_py);
Py_DECREF(index_py);
index = big_endian_ushort(getArrayShort1D(self->biome_data, index));
switch (state->block) {
case 2: