SLICELEN = 1
};
-static unsigned char *vox_height;
+static unsigned char *vox_hmap;
static unsigned char *vox_color;
/* framebuffer */
static uint16_t *vox_fb;
{
assert(xsz == XSZ && ysz == YSZ);
- vox_height = himg;
+ vox_hmap = himg;
vox_color = cimg;
vox_fb = 0;
}
#define H(x, y) \
- vox_height[((((y) >> 16) & YMASK) << XSHIFT) + (((x) >> 16) & XMASK)]
+ vox_hmap[((((y) >> 16) & YMASK) << XSHIFT) + (((x) >> 16) & XMASK)]
#define C(x, y) \
vox_color[((((y) >> 16) & YMASK) << XSHIFT) + (((x) >> 16) & XMASK)]
vox_horizon = horizon >= 0 ? horizon : (FBHEIGHT >> 1);
}
-void vox_view(int32_t x, int32_t y, int h, int32_t angle)
+int vox_view(int32_t x, int32_t y, int h, int32_t angle)
{
if(h < 0) {
h = H(x, y) - h;
vox_angle = angle;
vox_valid &= ~SLICELEN;
+
+ return h;
}
void vox_proj(int fov, int znear, int zfar)
hval = last_hval;
color = last_col;
} else {
- hval = vox_height[offs] - vox_vheight;
+ hval = vox_hmap[offs] - vox_vheight;
hval = ((hval * projlut[n]) >> 8) + vox_horizon;
if(hval > FBHEIGHT) hval = FBHEIGHT;
color = vox_color[offs];
}
}
+int vox_height(int x, int y)
+{
+ return H(x, y);
+}
+
int vox_check_vis(int32_t x0, int32_t y0, int32_t x1, int32_t y1)
{
/* TODO */