From f897b1a1a29f24f91d7838bdf2d6a889ce70bc7e Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Sun, 24 Jun 2012 03:56:53 +0000 Subject: [PATCH] - Make voxels slightly larger so that the size of one 3D "texel" is the same as one 2D texel at the same location. SVN r3708 (trunk) --- src/r_things.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/r_things.cpp b/src/r_things.cpp index 71bce068a..026da247a 100644 --- a/src/r_things.cpp +++ b/src/r_things.cpp @@ -2245,8 +2245,11 @@ void R_DrawVoxel(fixed_t dasprx, fixed_t daspry, fixed_t dasprz, angle_t daspran dasprx = dasprx >> 12; daspry = -daspry >> 12; dasprz = -dasprz >> 8; - daxscale >>= 10; - dayscale >>= 10; + + // Shift the scales from 16 bits of fractional precision to 6. + // Also do some magic voodoo scaling to make them the right size. + daxscale = daxscale / (0xD000 >> 6); + dayscale = dayscale / (0xD000 >> 6); cosang = viewcos >> 2; sinang = -viewsin >> 2;