Subversion Repositories eduke32

Compare Revisions

Regard whitespace Rev 5017 → Rev 5016

/polymer/eduke32/build/src/engine.c
64,7 → 64,6
 
#if !defined EDUKE32_TOUCH_DEVICES && !defined GEKKO && !defined __OPENDINGUX__
// Handle absolute z difference of floor/ceiling to camera >= 1<<24.
// Also: higher precision view-relative x and y for drawvox().
# define CLASSIC_Z_DIFF_64
#endif
 
3358,12 → 3357,6
#ifdef CLASSIC_Z_DIFF_64
typedef int64_t zint_t;
 
// For drawvox()
static inline zint_t mulscale16z(int32_t a, int32_t d)
{
return ((zint_t)a * d)>>16;
}
 
static inline zint_t mulscale20z(int32_t a, int32_t d)
{
return ((zint_t)a * d)>>20;
3375,7 → 3368,6
}
#else
typedef int32_t zint_t;
# define mulscale16z mulscale16
# define mulscale20z mulscale20
# define dmulscale24z dmulscale24
#endif
5400,8 → 5392,6
}
}
 
// High-precision integer type for view-relative x and y in drawvox().
typedef zint_t voxint_t;
 
//
// drawvox
5476,8 → 5466,8
cosang = mulscale16(cosang, dayscalerecip);
sinang = mulscale16(sinang, dayscalerecip);
 
const voxint_t gxstart = (voxint_t)y*cosang - (voxint_t)x*sinang;
const voxint_t gystart = (voxint_t)x*cosang + (voxint_t)y*sinang;
const int32_t gxstart = y*cosang - x*sinang;
const int32_t gystart = x*cosang + y*sinang;
const int32_t gxinc = dmulscale10(sprsinang,cosang, sprcosang,-sinang);
const int32_t gyinc = dmulscale10(sprcosang,cosang, sprsinang,sinang);
 
5587,8 → 5577,8
const int32_t nxoff = mulscale16(x2-x1,viewingrangerecip);
x1 = mulscale16(x1, viewingrangerecip);
 
const voxint_t ggxstart = gxstart + ggyinc[ys];
const voxint_t ggystart = gystart - ggxinc[ys];
const int32_t ggxstart = gxstart + ggyinc[ys];
const int32_t ggystart = gystart - ggxinc[ys];
 
for (x=xs; x!=xe; x+=xi)
{
5595,8 → 5585,8
const intptr_t slabxoffs = (intptr_t)&davoxptr[B_LITTLE32(longptr[x])];
int16_t *const shortptr = (int16_t *)&davoxptr[((x*(daysiz+1))<<1) + xyvoxoffs];
 
voxint_t nx = mulscale16z(ggxstart+ggxinc[x], viewingrangerecip) + x1;
voxint_t ny = ggystart + ggyinc[x];
int32_t nx = mulscale16(ggxstart+ggxinc[x], viewingrangerecip) + x1;
int32_t ny = ggystart + ggyinc[x];
 
for (y=ys; y!=ye; y+=yi,nx+=dagyinc,ny-=dagxinc)
{
5788,11 → 5778,6
return blendidx;
}
 
static inline int32_t mulscale_triple30(int32_t a, int32_t b, int32_t c)
{
return ((int64_t)a * b * c)>>30;
}
 
static void drawsprite_classic(int32_t snum)
{
int32_t x1, y1, x2, y2, i, j, k, x;
6803,8 → 6788,8
const int32_t xspan = ((B_LITTLE32(longptr[0])+B_LITTLE32(longptr[1]))>>1);
const int32_t yspan = B_LITTLE32(longptr[2]);
 
const int32_t xsiz = mulscale_triple30(siz, xv, xspan);
const int32_t ysiz = mulscale_triple30(siz, nyrepeat, yspan);
const int32_t xsiz = mulscale30(siz,xv*xspan);
const int32_t ysiz = mulscale30(siz,nyrepeat*yspan);
 
//Watch out for divscale overflow
if (((xspan>>11) < xsiz) && (yspan < (ysiz>>1)))