- int32_t u, v;
- int h00, h01, h10, h11, h0, h1;
-
- if(!vox->hfilt) {
- return H(x, y);
- }
-
- h00 = H(x, y);
- h01 = H(x, y + 0x10000);
- h10 = H(x + 0x10000, y);
- h11 = H(x + 0x10000, y + 0x10000);
-
- u = x & 0xffff;
- v = y & 0xffff;
-
- h0 = XLERP(h00, h01, v, 16);
- h1 = XLERP(h10, h11, v, 16);
- return XLERP(h0, h1, u, 16);
-}
-
-int vox_color(struct voxscape *vox, int32_t x, int32_t y)
-{
- int32_t u, v;
- int c00, c01, c10, c11, c0, c1;
-
- if(!vox->cfilt) {
- return C(x, y);
- }
-
- c00 = C(x, y);
- c01 = C(x, y + 0x10000);
- c10 = C(x + 0x10000, y);
- c11 = C(x + 0x10000, y + 0x10000);
-
- u = x & 0xffff;
- v = y & 0xffff;
-
- c0 = XLERP(c00, c01, v, 16);
- c1 = XLERP(c10, c11, v, 16);
- return XLERP(c0, c1, u, 16);
-}
-
-
-void vox_filter(struct voxscape *vox, int hfilt, int cfilt)
-{
- vox->hfilt = hfilt;
- vox->cfilt = cfilt;
-}
-
-void vox_framebuf(struct voxscape *vox, int xres, int yres, void *fb, int horizon)
-{
- if(xres != vox->fbwidth) {
- free(vox->coltop);
- if(!(vox->coltop = malloc(xres * sizeof *vox->coltop))) {
- fprintf(stderr, "vox_framebuf: failed to allocate column table (%d)\n", xres);
- return;