- hval = vox_height(vox, x, y) - vox->vheight;
- hval = hval * 40 / (vox->znear + n) + vox->horizon;
- if(hval > FBHEIGHT) hval = FBHEIGHT;
+ offs = (((y >> 16) & YMASK) << XSHIFT) + ((x >> 16) & XMASK);
+ if(offs == last_offs) {
+ hval = last_hval;
+ color = last_col;
+ } else {
+ hval = vox->height[offs] - vox->vheight;
+ hval = hval * 40 / (vox->znear + n) + vox->horizon;
+ if(hval > FBHEIGHT) hval = FBHEIGHT;
+ color = vox->color[offs];
+ last_offs = offs;
+ last_hval = hval;
+ last_col = color;
+ }