0

Merge branch '19prep'

Conflicts:
	overviewer_core/src/overviewer.h
	overviewer_core/textures.py
This commit is contained in:
Aaron Griffith
2011-11-18 17:25:01 -05:00
8 changed files with 2526 additions and 2114 deletions

View File

@@ -26,7 +26,7 @@
// increment this value if you've made a change to the c extesion
// and want to force users to rebuild
#define OVERVIEWER_EXTENSION_VERSION 12
#define OVERVIEWER_EXTENSION_VERSION 13
/* Python PIL, and numpy headers */
#include <Python.h>
@@ -94,8 +94,32 @@ typedef struct {
PyObject *right_blocks;
} RenderState;
PyObject *init_chunk_render(PyObject *self, PyObject *args);
int is_transparent(unsigned char b);
PyObject *chunk_render(PyObject *self, PyObject *args);
typedef enum
{
KNOWN,
TRANSPARENT,
SOLID,
FLUID,
NOSPAWN,
} BlockProperty;
/* globals set in init_chunk_render, here because they're used
in block_has_property */
extern unsigned int max_blockid;
extern unsigned int max_data;
extern unsigned char *block_properties;
static inline int
block_has_property(unsigned char b, BlockProperty prop) {
if (b >= max_blockid || !(block_properties[b] & (1 << KNOWN))) {
/* block is unknown, return defaults */
if (prop == TRANSPARENT)
return 1;
return 0;
}
return block_properties[b] & (1 << prop);
}
#define is_transparent(b) block_has_property((b), TRANSPARENT)
/* pull in the rendermode info */
#include "rendermodes.h"