0

moved rendermode_normal into a separate file, like rendermode_lighting

This commit is contained in:
Aaron Griffith
2011-03-22 23:09:12 -04:00
parent a885568d4e
commit 24950f6024
3 changed files with 59 additions and 40 deletions

View File

@@ -17,45 +17,7 @@
#include "overviewer.h"
static int
rendermode_normal_start(void *data, RenderState *state) {
/* do nothing */
return 0;
}
static void
rendermode_normal_finish(void *data, RenderState *state) {
/* do nothing */
}
static int
rendermode_normal_occluded(void *data, RenderState *state) {
int x = state->x, y = state->y, z = state->z;
if ( (x != 0) && (y != 15) && (z != 127) &&
!is_transparent(getArrayByte3D(state->blocks, x-1, y, z)) &&
!is_transparent(getArrayByte3D(state->blocks, x, y, z+1)) &&
!is_transparent(getArrayByte3D(state->blocks, x, y+1, z))) {
return 1;
}
return 0;
}
static void
rendermode_normal_draw(void *data, RenderState *state, PyObject *src, PyObject *mask) {
alpha_over(state->img, src, mask, state->imgx, state->imgy, 0, 0);
}
RenderModeInterface rendermode_normal = {
sizeof(RenderModeNormal),
rendermode_normal_start,
rendermode_normal_finish,
rendermode_normal_occluded,
rendermode_normal_draw,
};
/* putting it all together */
/* decides which render mode to use */
RenderModeInterface *get_render_mode(RenderState *state) {
/* default: normal */
RenderModeInterface *iface = &rendermode_normal;