mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-13 07:58:04 +00:00
Engine cleanup continued, no functional changes.
git-svn-id: https://svn.eduke32.com/eduke32@3472 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
05c920cf92
commit
ed2ebdb29a
2 changed files with 51 additions and 44 deletions
|
@ -2651,10 +2651,12 @@ skipitaddwall:
|
||||||
//
|
//
|
||||||
// maskwallscan (internal)
|
// maskwallscan (internal)
|
||||||
//
|
//
|
||||||
static void maskwallscan(int32_t x1, int32_t x2, int16_t *uwal, int16_t *dwal, int32_t *swal, int32_t *lwal)
|
static void maskwallscan(int32_t x1, int32_t x2,
|
||||||
|
const int16_t *uwal, const int16_t *dwal,
|
||||||
|
const int32_t *swal, const int32_t *lwal)
|
||||||
{
|
{
|
||||||
int32_t x,/* startx,*/ xnice, ynice;
|
int32_t x, xnice, ynice;
|
||||||
intptr_t startx, p, fpalookup;
|
intptr_t p, fpalookup;
|
||||||
int32_t y1ve[4], y2ve[4], tsizx, tsizy;
|
int32_t y1ve[4], y2ve[4], tsizx, tsizy;
|
||||||
#ifdef MULTI_COLUMN_VLINE
|
#ifdef MULTI_COLUMN_VLINE
|
||||||
char bad;
|
char bad;
|
||||||
|
@ -2672,8 +2674,6 @@ static void maskwallscan(int32_t x1, int32_t x2, int16_t *uwal, int16_t *dwal, i
|
||||||
|
|
||||||
if (waloff[globalpicnum] == 0) loadtile(globalpicnum);
|
if (waloff[globalpicnum] == 0) loadtile(globalpicnum);
|
||||||
|
|
||||||
startx = x1;
|
|
||||||
|
|
||||||
xnice = (pow2long[picsiz[globalpicnum]&15] == tsizx);
|
xnice = (pow2long[picsiz[globalpicnum]&15] == tsizx);
|
||||||
if (xnice) tsizx = (tsizx-1);
|
if (xnice) tsizx = (tsizx-1);
|
||||||
ynice = (pow2long[picsiz[globalpicnum]>>4] == tsizy);
|
ynice = (pow2long[picsiz[globalpicnum]>>4] == tsizy);
|
||||||
|
@ -2687,8 +2687,9 @@ static void maskwallscan(int32_t x1, int32_t x2, int16_t *uwal, int16_t *dwal, i
|
||||||
setupmvlineasm(globalshiftval);
|
setupmvlineasm(globalshiftval);
|
||||||
|
|
||||||
|
|
||||||
x = startx;
|
x = x1;
|
||||||
while ((startumost[x+windowx1] > startdmost[x+windowx1]) && (x <= x2)) x++;
|
while ((startumost[x+windowx1] > startdmost[x+windowx1]) && (x <= x2))
|
||||||
|
x++;
|
||||||
|
|
||||||
p = x+frameoffset;
|
p = x+frameoffset;
|
||||||
|
|
||||||
|
@ -5689,6 +5690,7 @@ draw_as_face_sprite:
|
||||||
{
|
{
|
||||||
int32_t swapped, top, bot, topinc, botinc;
|
int32_t swapped, top, bot, topinc, botinc;
|
||||||
int32_t xv, yv, hplc, hinc;
|
int32_t xv, yv, hplc, hinc;
|
||||||
|
int32_t sx1, sx2, sy1, sy2;
|
||||||
|
|
||||||
if ((cstat&4) > 0) xoff = -xoff;
|
if ((cstat&4) > 0) xoff = -xoff;
|
||||||
if ((cstat&8) > 0) yoff = -yoff;
|
if ((cstat&8) > 0) yoff = -yoff;
|
||||||
|
@ -5725,51 +5727,51 @@ draw_as_face_sprite:
|
||||||
if (xp1 > yp1) return;
|
if (xp1 > yp1) return;
|
||||||
|
|
||||||
if (yp1 == 0) return;
|
if (yp1 == 0) return;
|
||||||
xb1[MAXWALLSB-1] = halfxdimen + scale(xp1,halfxdimen,yp1);
|
sx1 = halfxdimen + scale(xp1,halfxdimen,yp1);
|
||||||
if (xp1 >= 0) xb1[MAXWALLSB-1]++; //Fix for SIGNED divide
|
if (xp1 >= 0) sx1++; //Fix for SIGNED divide
|
||||||
if (xb1[MAXWALLSB-1] >= xdimen) xb1[MAXWALLSB-1] = xdimen-1;
|
if (sx1 >= xdimen) sx1 = xdimen-1;
|
||||||
yb1[MAXWALLSB-1] = yp1;
|
sy1 = yp1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (xp2 < -yp2) return;
|
if (xp2 < -yp2) return;
|
||||||
xb1[MAXWALLSB-1] = 0;
|
sx1 = 0;
|
||||||
i = yp1-yp2+xp1-xp2;
|
i = yp1-yp2+xp1-xp2;
|
||||||
if (i == 0) return;
|
if (i == 0) return;
|
||||||
yb1[MAXWALLSB-1] = yp1 + scale(yp2-yp1,xp1+yp1,i);
|
sy1 = yp1 + scale(yp2-yp1,xp1+yp1,i);
|
||||||
}
|
}
|
||||||
if (xp2 <= yp2)
|
if (xp2 <= yp2)
|
||||||
{
|
{
|
||||||
if (xp2 < -yp2) return;
|
if (xp2 < -yp2) return;
|
||||||
|
|
||||||
if (yp2 == 0) return;
|
if (yp2 == 0) return;
|
||||||
xb2[MAXWALLSB-1] = halfxdimen + scale(xp2,halfxdimen,yp2) - 1;
|
sx2 = halfxdimen + scale(xp2,halfxdimen,yp2) - 1;
|
||||||
if (xp2 >= 0) xb2[MAXWALLSB-1]++; //Fix for SIGNED divide
|
if (xp2 >= 0) sx2++; //Fix for SIGNED divide
|
||||||
if (xb2[MAXWALLSB-1] >= xdimen) xb2[MAXWALLSB-1] = xdimen-1;
|
if (sx2 >= xdimen) sx2 = xdimen-1;
|
||||||
yb2[MAXWALLSB-1] = yp2;
|
sy2 = yp2;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (xp1 > yp1) return;
|
if (xp1 > yp1) return;
|
||||||
|
|
||||||
xb2[MAXWALLSB-1] = xdimen-1;
|
sx2 = xdimen-1;
|
||||||
i = xp2-xp1+yp1-yp2;
|
i = xp2-xp1+yp1-yp2;
|
||||||
if (i == 0) return;
|
if (i == 0) return;
|
||||||
yb2[MAXWALLSB-1] = yp1 + scale(yp2-yp1,yp1-xp1,i);
|
sy2 = yp1 + scale(yp2-yp1,yp1-xp1,i);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((yb1[MAXWALLSB-1] < 256) || (yb2[MAXWALLSB-1] < 256) || (xb1[MAXWALLSB-1] > xb2[MAXWALLSB-1]))
|
if ((sy1 < 256) || (sy2 < 256) || (sx1 > sx2))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
topinc = -mulscale10(yp1,xspan);
|
topinc = -mulscale10(yp1,xspan);
|
||||||
top = (((mulscale10(xp1,xdimen) - mulscale9(xb1[MAXWALLSB-1]-halfxdimen,yp1))*xspan)>>3);
|
top = (((mulscale10(xp1,xdimen) - mulscale9(sx1-halfxdimen,yp1))*xspan)>>3);
|
||||||
botinc = ((yp2-yp1)>>8);
|
botinc = ((yp2-yp1)>>8);
|
||||||
bot = mulscale11(xp1-xp2,xdimen) + mulscale2(xb1[MAXWALLSB-1]-halfxdimen,botinc);
|
bot = mulscale11(xp1-xp2,xdimen) + mulscale2(sx1-halfxdimen,botinc);
|
||||||
|
|
||||||
j = xb2[MAXWALLSB-1]+3;
|
j = sx2+3;
|
||||||
z = mulscale20(top,krecipasm(bot));
|
z = mulscale20(top,krecipasm(bot));
|
||||||
lwall[xb1[MAXWALLSB-1]] = (z>>8);
|
lwall[sx1] = (z>>8);
|
||||||
for (x=xb1[MAXWALLSB-1]+4; x<=j; x+=4)
|
for (x=sx1+4; x<=j; x+=4)
|
||||||
{
|
{
|
||||||
top += topinc; bot += botinc;
|
top += topinc; bot += botinc;
|
||||||
zz = z; z = mulscale20(top,krecipasm(bot));
|
zz = z; z = mulscale20(top,krecipasm(bot));
|
||||||
|
@ -5780,22 +5782,23 @@ draw_as_face_sprite:
|
||||||
lwall[x-1] = ((i+z)>>9);
|
lwall[x-1] = ((i+z)>>9);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lwall[xb1[MAXWALLSB-1]] < 0) lwall[xb1[MAXWALLSB-1]] = 0;
|
if (lwall[sx1] < 0) lwall[sx1] = 0;
|
||||||
if (lwall[xb2[MAXWALLSB-1]] >= xspan) lwall[xb2[MAXWALLSB-1]] = xspan-1;
|
if (lwall[sx2] >= xspan) lwall[sx2] = xspan-1;
|
||||||
|
|
||||||
if ((swapped^((cstat&4)>0)) > 0)
|
if ((swapped^((cstat&4)>0)) > 0)
|
||||||
{
|
{
|
||||||
j = xspan-1;
|
j = xspan-1;
|
||||||
for (x=xb1[MAXWALLSB-1]; x<=xb2[MAXWALLSB-1]; x++)
|
for (x=sx1; x<=sx2; x++)
|
||||||
lwall[x] = j-lwall[x];
|
lwall[x] = j-lwall[x];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// XXX: UNUSED?
|
||||||
rx1[MAXWALLSB-1] = xp1; ry1[MAXWALLSB-1] = yp1;
|
rx1[MAXWALLSB-1] = xp1; ry1[MAXWALLSB-1] = yp1;
|
||||||
rx2[MAXWALLSB-1] = xp2; ry2[MAXWALLSB-1] = yp2;
|
rx2[MAXWALLSB-1] = xp2; ry2[MAXWALLSB-1] = yp2;
|
||||||
|
|
||||||
hplc = divscale19(xdimenscale,yb1[MAXWALLSB-1]);
|
hplc = divscale19(xdimenscale,sy1);
|
||||||
hinc = divscale19(xdimenscale,yb2[MAXWALLSB-1]);
|
hinc = divscale19(xdimenscale,sy2);
|
||||||
hinc = (hinc-hplc)/(xb2[MAXWALLSB-1]-xb1[MAXWALLSB-1]+1);
|
hinc = (hinc-hplc)/(sx2-sx1+1);
|
||||||
|
|
||||||
setup_globals_sprite1(tspr, sec, yspan, yoff, tilenum, cstat, &z1, &z2);
|
setup_globals_sprite1(tspr, sec, yspan, yoff, tilenum, cstat, &z1, &z2);
|
||||||
|
|
||||||
|
@ -5804,21 +5807,25 @@ draw_as_face_sprite:
|
||||||
if (((sec->floorstat&1) == 0) && (z2 > sec->floorz))
|
if (((sec->floorstat&1) == 0) && (z2 > sec->floorz))
|
||||||
z2 = sec->floorz;
|
z2 = sec->floorz;
|
||||||
|
|
||||||
owallmost(uwall,(int32_t)(MAXWALLSB-1),z1-globalposz);
|
xb1[MAXWALLSB-1] = sx1;
|
||||||
owallmost(dwall,(int32_t)(MAXWALLSB-1),z2-globalposz);
|
xb2[MAXWALLSB-1] = sx2;
|
||||||
for (i=xb1[MAXWALLSB-1]; i<=xb2[MAXWALLSB-1]; i++)
|
yb1[MAXWALLSB-1] = sy1;
|
||||||
|
yb2[MAXWALLSB-1] = sy2;
|
||||||
|
owallmost(uwall, MAXWALLSB-1, z1-globalposz);
|
||||||
|
owallmost(dwall, MAXWALLSB-1, z2-globalposz);
|
||||||
|
for (i=sx1; i<=sx2; i++)
|
||||||
{ swall[i] = (krecipasm(hplc)<<2); hplc += hinc; }
|
{ swall[i] = (krecipasm(hplc)<<2); hplc += hinc; }
|
||||||
|
|
||||||
for (i=smostwallcnt-1; i>=0; i--)
|
for (i=smostwallcnt-1; i>=0; i--)
|
||||||
{
|
{
|
||||||
j = smostwall[i];
|
j = smostwall[i];
|
||||||
|
|
||||||
if ((xb1[j] > xb2[MAXWALLSB-1]) || (xb2[j] < xb1[MAXWALLSB-1])) continue;
|
if ((xb1[j] > sx2) || (xb2[j] < sx1)) continue;
|
||||||
|
|
||||||
dalx2 = xb1[j]; darx2 = xb2[j];
|
dalx2 = xb1[j]; darx2 = xb2[j];
|
||||||
if (max(yb1[MAXWALLSB-1],yb2[MAXWALLSB-1]) > min(yb1[j],yb2[j]))
|
if (max(sy1,sy2) > min(yb1[j],yb2[j]))
|
||||||
{
|
{
|
||||||
if (min(yb1[MAXWALLSB-1],yb2[MAXWALLSB-1]) > max(yb1[j],yb2[j]))
|
if (min(sy1,sy2) > max(yb1[j],yb2[j]))
|
||||||
{
|
{
|
||||||
x = INT32_MIN;
|
x = INT32_MIN;
|
||||||
}
|
}
|
||||||
|
@ -5877,15 +5884,15 @@ draw_as_face_sprite:
|
||||||
|
|
||||||
if (x < 0)
|
if (x < 0)
|
||||||
{
|
{
|
||||||
if (dalx2 < xb1[MAXWALLSB-1]) dalx2 = xb1[MAXWALLSB-1];
|
if (dalx2 < sx1) dalx2 = sx1;
|
||||||
if (darx2 > xb2[MAXWALLSB-1]) darx2 = xb2[MAXWALLSB-1];
|
if (darx2 > sx2) darx2 = sx2;
|
||||||
|
|
||||||
switch (smostwalltype[i])
|
switch (smostwalltype[i])
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
if (dalx2 <= darx2)
|
if (dalx2 <= darx2)
|
||||||
{
|
{
|
||||||
if ((dalx2 == xb1[MAXWALLSB-1]) && (darx2 == xb2[MAXWALLSB-1])) return;
|
if ((dalx2 == sx1) && (darx2 == sx2)) return;
|
||||||
//clearbufbyte(&dwall[dalx2],(darx2-dalx2+1)*sizeof(dwall[0]),0L);
|
//clearbufbyte(&dwall[dalx2],(darx2-dalx2+1)*sizeof(dwall[0]),0L);
|
||||||
for (k=dalx2; k<=darx2; k++) dwall[k] = 0;
|
for (k=dalx2; k<=darx2; k++) dwall[k] = 0;
|
||||||
}
|
}
|
||||||
|
@ -5909,7 +5916,7 @@ draw_as_face_sprite:
|
||||||
#ifdef YAX_ENABLE
|
#ifdef YAX_ENABLE
|
||||||
if (yax_globallev==YAX_MAXDRAWS || searchit==2)
|
if (yax_globallev==YAX_MAXDRAWS || searchit==2)
|
||||||
#endif
|
#endif
|
||||||
if ((searchit >= 1) && (searchx >= xb1[MAXWALLSB-1]) && (searchx <= xb2[MAXWALLSB-1]))
|
if ((searchit >= 1) && (searchx >= sx1) && (searchx <= sx2))
|
||||||
if ((searchy >= uwall[searchx]) && (searchy <= dwall[searchx]))
|
if ((searchy >= uwall[searchx]) && (searchy <= dwall[searchx]))
|
||||||
{
|
{
|
||||||
searchsector = sectnum; searchwall = spritenum;
|
searchsector = sectnum; searchwall = spritenum;
|
||||||
|
@ -5918,11 +5925,11 @@ draw_as_face_sprite:
|
||||||
|
|
||||||
if ((cstat&2) == 0)
|
if ((cstat&2) == 0)
|
||||||
{
|
{
|
||||||
maskwallscan(xb1[MAXWALLSB-1],xb2[MAXWALLSB-1],uwall,dwall,swall,lwall);
|
maskwallscan(sx1,sx2,uwall,dwall,swall,lwall);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
transmaskwallscan(xb1[MAXWALLSB-1],xb2[MAXWALLSB-1]);
|
transmaskwallscan(sx1,sx2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ((cstat&48) == 32)
|
else if ((cstat&48) == 32)
|
||||||
|
|
|
@ -5785,7 +5785,7 @@ static void drawtrap(float x0, float x1, float y0, float x2, float x3, float y1)
|
||||||
bglEnd();
|
bglEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void tessectrap(float *px, float *py, int32_t *point2, int32_t numpoints)
|
static void tessectrap(const float *px, const float *py, const int32_t *point2, int32_t numpoints)
|
||||||
{
|
{
|
||||||
float x0, x1, m0, m1;
|
float x0, x1, m0, m1;
|
||||||
int32_t i, j, k, z, i0, i1, i2, i3, npoints, gap, numrst;
|
int32_t i, j, k, z, i0, i1, i2, i3, npoints, gap, numrst;
|
||||||
|
|
Loading…
Reference in a new issue