Merge branch 'ripple2' into 'master'
Tilted ripple See merge request STJr/SRB2!524
This commit is contained in:
commit
4daf9666a2
|
@ -107,7 +107,8 @@ UINT8 *ds_transmap; // one of the translucency tables
|
||||||
|
|
||||||
#ifdef ESLOPE
|
#ifdef ESLOPE
|
||||||
pslope_t *ds_slope; // Current slope being used
|
pslope_t *ds_slope; // Current slope being used
|
||||||
floatv3_t ds_su, ds_sv, ds_sz; // Vectors for... stuff?
|
floatv3_t ds_su[MAXVIDHEIGHT], ds_sv[MAXVIDHEIGHT], ds_sz[MAXVIDHEIGHT]; // Vectors for... stuff?
|
||||||
|
floatv3_t *ds_sup, *ds_svp, *ds_szp;
|
||||||
float focallengthf, zeroheight;
|
float focallengthf, zeroheight;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -68,7 +68,8 @@ typedef struct {
|
||||||
} floatv3_t;
|
} floatv3_t;
|
||||||
|
|
||||||
extern pslope_t *ds_slope; // Current slope being used
|
extern pslope_t *ds_slope; // Current slope being used
|
||||||
extern floatv3_t ds_su, ds_sv, ds_sz; // Vectors for... stuff?
|
extern floatv3_t ds_su[MAXVIDHEIGHT], ds_sv[MAXVIDHEIGHT], ds_sz[MAXVIDHEIGHT]; // Vectors for... stuff?
|
||||||
|
extern floatv3_t *ds_sup, *ds_svp, *ds_szp;
|
||||||
extern float focallengthf, zeroheight;
|
extern float focallengthf, zeroheight;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -154,6 +155,9 @@ void R_DrawTranslucentSplat_8(void);
|
||||||
#ifdef ESLOPE
|
#ifdef ESLOPE
|
||||||
void R_DrawTiltedSpan_8(void);
|
void R_DrawTiltedSpan_8(void);
|
||||||
void R_DrawTiltedTranslucentSpan_8(void);
|
void R_DrawTiltedTranslucentSpan_8(void);
|
||||||
|
#ifndef NOWATER
|
||||||
|
void R_DrawTiltedTranslucentWaterSpan_8(void);
|
||||||
|
#endif
|
||||||
void R_DrawTiltedSplat_8(void);
|
void R_DrawTiltedSplat_8(void);
|
||||||
void R_CalcTiltedLighting(fixed_t start, fixed_t end);
|
void R_CalcTiltedLighting(fixed_t start, fixed_t end);
|
||||||
extern INT32 tiltlighting[MAXVIDWIDTH];
|
extern INT32 tiltlighting[MAXVIDWIDTH];
|
||||||
|
@ -173,6 +177,9 @@ void R_DrawTranslucentSplat_NPO2_8(void);
|
||||||
#ifdef ESLOPE
|
#ifdef ESLOPE
|
||||||
void R_DrawTiltedSpan_NPO2_8(void);
|
void R_DrawTiltedSpan_NPO2_8(void);
|
||||||
void R_DrawTiltedTranslucentSpan_NPO2_8(void);
|
void R_DrawTiltedTranslucentSpan_NPO2_8(void);
|
||||||
|
#ifndef NOWATER
|
||||||
|
void R_DrawTiltedTranslucentWaterSpan_NPO2_8(void);
|
||||||
|
#endif
|
||||||
void R_DrawTiltedSplat_NPO2_8(void);
|
void R_DrawTiltedSplat_NPO2_8(void);
|
||||||
#endif
|
#endif
|
||||||
#ifndef NOWATER
|
#ifndef NOWATER
|
||||||
|
|
217
src/r_draw8.c
217
src/r_draw8.c
|
@ -665,22 +665,22 @@ void R_DrawTiltedSpan_8(void)
|
||||||
double endz, endu, endv;
|
double endz, endu, endv;
|
||||||
UINT32 stepu, stepv;
|
UINT32 stepu, stepv;
|
||||||
|
|
||||||
iz = ds_sz.z + ds_sz.y*(centery-ds_y) + ds_sz.x*(ds_x1-centerx);
|
iz = ds_szp->z + ds_szp->y*(centery-ds_y) + ds_szp->x*(ds_x1-centerx);
|
||||||
|
|
||||||
// Lighting is simple. It's just linear interpolation from start to end
|
// Lighting is simple. It's just linear interpolation from start to end
|
||||||
{
|
{
|
||||||
float planelightfloat = BASEVIDWIDTH*BASEVIDWIDTH/vid.width / (zeroheight - FIXED_TO_FLOAT(viewz)) / 21.0f;
|
float planelightfloat = BASEVIDWIDTH*BASEVIDWIDTH/vid.width / (zeroheight - FIXED_TO_FLOAT(viewz)) / 21.0f;
|
||||||
float lightstart, lightend;
|
float lightstart, lightend;
|
||||||
|
|
||||||
lightend = (iz + ds_sz.x*width) * planelightfloat;
|
lightend = (iz + ds_szp->x*width) * planelightfloat;
|
||||||
lightstart = iz * planelightfloat;
|
lightstart = iz * planelightfloat;
|
||||||
|
|
||||||
R_CalcTiltedLighting(FLOAT_TO_FIXED(lightstart), FLOAT_TO_FIXED(lightend));
|
R_CalcTiltedLighting(FLOAT_TO_FIXED(lightstart), FLOAT_TO_FIXED(lightend));
|
||||||
//CONS_Printf("tilted lighting %f to %f (foc %f)\n", lightstart, lightend, focallengthf);
|
//CONS_Printf("tilted lighting %f to %f (foc %f)\n", lightstart, lightend, focallengthf);
|
||||||
}
|
}
|
||||||
|
|
||||||
uz = ds_su.z + ds_su.y*(centery-ds_y) + ds_su.x*(ds_x1-centerx);
|
uz = ds_sup->z + ds_sup->y*(centery-ds_y) + ds_sup->x*(ds_x1-centerx);
|
||||||
vz = ds_sv.z + ds_sv.y*(centery-ds_y) + ds_sv.x*(ds_x1-centerx);
|
vz = ds_svp->z + ds_svp->y*(centery-ds_y) + ds_svp->x*(ds_x1-centerx);
|
||||||
|
|
||||||
dest = ylookup[ds_y] + columnofs[ds_x1];
|
dest = ylookup[ds_y] + columnofs[ds_x1];
|
||||||
source = ds_source;
|
source = ds_source;
|
||||||
|
@ -699,9 +699,9 @@ void R_DrawTiltedSpan_8(void)
|
||||||
|
|
||||||
*dest = colormap[source[((v >> nflatyshift) & nflatmask) | (u >> nflatxshift)]];
|
*dest = colormap[source[((v >> nflatyshift) & nflatmask) | (u >> nflatxshift)]];
|
||||||
dest++;
|
dest++;
|
||||||
iz += ds_sz.x;
|
iz += ds_szp->x;
|
||||||
uz += ds_su.x;
|
uz += ds_sup->x;
|
||||||
vz += ds_sv.x;
|
vz += ds_svp->x;
|
||||||
} while (--width >= 0);
|
} while (--width >= 0);
|
||||||
#else
|
#else
|
||||||
#define SPANSIZE 16
|
#define SPANSIZE 16
|
||||||
|
@ -711,9 +711,9 @@ void R_DrawTiltedSpan_8(void)
|
||||||
startu = uz*startz;
|
startu = uz*startz;
|
||||||
startv = vz*startz;
|
startv = vz*startz;
|
||||||
|
|
||||||
izstep = ds_sz.x * SPANSIZE;
|
izstep = ds_szp->x * SPANSIZE;
|
||||||
uzstep = ds_su.x * SPANSIZE;
|
uzstep = ds_sup->x * SPANSIZE;
|
||||||
vzstep = ds_sv.x * SPANSIZE;
|
vzstep = ds_svp->x * SPANSIZE;
|
||||||
//x1 = 0;
|
//x1 = 0;
|
||||||
width++;
|
width++;
|
||||||
|
|
||||||
|
@ -755,9 +755,9 @@ void R_DrawTiltedSpan_8(void)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
double left = width;
|
double left = width;
|
||||||
iz += ds_sz.x * left;
|
iz += ds_szp->x * left;
|
||||||
uz += ds_su.x * left;
|
uz += ds_sup->x * left;
|
||||||
vz += ds_sv.x * left;
|
vz += ds_svp->x * left;
|
||||||
|
|
||||||
endz = 1.f/iz;
|
endz = 1.f/iz;
|
||||||
endu = uz*endz;
|
endu = uz*endz;
|
||||||
|
@ -801,22 +801,22 @@ void R_DrawTiltedTranslucentSpan_8(void)
|
||||||
double endz, endu, endv;
|
double endz, endu, endv;
|
||||||
UINT32 stepu, stepv;
|
UINT32 stepu, stepv;
|
||||||
|
|
||||||
iz = ds_sz.z + ds_sz.y*(centery-ds_y) + ds_sz.x*(ds_x1-centerx);
|
iz = ds_szp->z + ds_szp->y*(centery-ds_y) + ds_szp->x*(ds_x1-centerx);
|
||||||
|
|
||||||
// Lighting is simple. It's just linear interpolation from start to end
|
// Lighting is simple. It's just linear interpolation from start to end
|
||||||
{
|
{
|
||||||
float planelightfloat = BASEVIDWIDTH*BASEVIDWIDTH/vid.width / (zeroheight - FIXED_TO_FLOAT(viewz)) / 21.0f;
|
float planelightfloat = BASEVIDWIDTH*BASEVIDWIDTH/vid.width / (zeroheight - FIXED_TO_FLOAT(viewz)) / 21.0f;
|
||||||
float lightstart, lightend;
|
float lightstart, lightend;
|
||||||
|
|
||||||
lightend = (iz + ds_sz.x*width) * planelightfloat;
|
lightend = (iz + ds_szp->x*width) * planelightfloat;
|
||||||
lightstart = iz * planelightfloat;
|
lightstart = iz * planelightfloat;
|
||||||
|
|
||||||
R_CalcTiltedLighting(FLOAT_TO_FIXED(lightstart), FLOAT_TO_FIXED(lightend));
|
R_CalcTiltedLighting(FLOAT_TO_FIXED(lightstart), FLOAT_TO_FIXED(lightend));
|
||||||
//CONS_Printf("tilted lighting %f to %f (foc %f)\n", lightstart, lightend, focallengthf);
|
//CONS_Printf("tilted lighting %f to %f (foc %f)\n", lightstart, lightend, focallengthf);
|
||||||
}
|
}
|
||||||
|
|
||||||
uz = ds_su.z + ds_su.y*(centery-ds_y) + ds_su.x*(ds_x1-centerx);
|
uz = ds_sup->z + ds_sup->y*(centery-ds_y) + ds_sup->x*(ds_x1-centerx);
|
||||||
vz = ds_sv.z + ds_sv.y*(centery-ds_y) + ds_sv.x*(ds_x1-centerx);
|
vz = ds_svp->z + ds_svp->y*(centery-ds_y) + ds_svp->x*(ds_x1-centerx);
|
||||||
|
|
||||||
dest = ylookup[ds_y] + columnofs[ds_x1];
|
dest = ylookup[ds_y] + columnofs[ds_x1];
|
||||||
source = ds_source;
|
source = ds_source;
|
||||||
|
@ -834,9 +834,9 @@ void R_DrawTiltedTranslucentSpan_8(void)
|
||||||
colormap = planezlight[tiltlighting[ds_x1++]] + (ds_colormap - colormaps);
|
colormap = planezlight[tiltlighting[ds_x1++]] + (ds_colormap - colormaps);
|
||||||
*dest = *(ds_transmap + (colormap[source[((v >> nflatyshift) & nflatmask) | (u >> nflatxshift)]] << 8) + *dest);
|
*dest = *(ds_transmap + (colormap[source[((v >> nflatyshift) & nflatmask) | (u >> nflatxshift)]] << 8) + *dest);
|
||||||
dest++;
|
dest++;
|
||||||
iz += ds_sz.x;
|
iz += ds_szp->x;
|
||||||
uz += ds_su.x;
|
uz += ds_sup->x;
|
||||||
vz += ds_sv.x;
|
vz += ds_svp->x;
|
||||||
} while (--width >= 0);
|
} while (--width >= 0);
|
||||||
#else
|
#else
|
||||||
#define SPANSIZE 16
|
#define SPANSIZE 16
|
||||||
|
@ -846,9 +846,9 @@ void R_DrawTiltedTranslucentSpan_8(void)
|
||||||
startu = uz*startz;
|
startu = uz*startz;
|
||||||
startv = vz*startz;
|
startv = vz*startz;
|
||||||
|
|
||||||
izstep = ds_sz.x * SPANSIZE;
|
izstep = ds_szp->x * SPANSIZE;
|
||||||
uzstep = ds_su.x * SPANSIZE;
|
uzstep = ds_sup->x * SPANSIZE;
|
||||||
vzstep = ds_sv.x * SPANSIZE;
|
vzstep = ds_svp->x * SPANSIZE;
|
||||||
//x1 = 0;
|
//x1 = 0;
|
||||||
width++;
|
width++;
|
||||||
|
|
||||||
|
@ -890,9 +890,9 @@ void R_DrawTiltedTranslucentSpan_8(void)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
double left = width;
|
double left = width;
|
||||||
iz += ds_sz.x * left;
|
iz += ds_szp->x * left;
|
||||||
uz += ds_su.x * left;
|
uz += ds_sup->x * left;
|
||||||
vz += ds_sv.x * left;
|
vz += ds_svp->x * left;
|
||||||
|
|
||||||
endz = 1.f/iz;
|
endz = 1.f/iz;
|
||||||
endu = uz*endz;
|
endu = uz*endz;
|
||||||
|
@ -916,6 +916,145 @@ void R_DrawTiltedTranslucentSpan_8(void)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef NOWATER
|
||||||
|
/** \brief The R_DrawTiltedTranslucentWaterSpan_8 function
|
||||||
|
Like DrawTiltedTranslucentSpan, but for water
|
||||||
|
*/
|
||||||
|
void R_DrawTiltedTranslucentWaterSpan_8(void)
|
||||||
|
{
|
||||||
|
// x1, x2 = ds_x1, ds_x2
|
||||||
|
int width = ds_x2 - ds_x1;
|
||||||
|
double iz, uz, vz;
|
||||||
|
UINT32 u, v;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
UINT8 *source;
|
||||||
|
UINT8 *colormap;
|
||||||
|
UINT8 *dest;
|
||||||
|
UINT8 *dsrc;
|
||||||
|
|
||||||
|
double startz, startu, startv;
|
||||||
|
double izstep, uzstep, vzstep;
|
||||||
|
double endz, endu, endv;
|
||||||
|
UINT32 stepu, stepv;
|
||||||
|
|
||||||
|
iz = ds_szp->z + ds_szp->y*(centery-ds_y) + ds_szp->x*(ds_x1-centerx);
|
||||||
|
|
||||||
|
// Lighting is simple. It's just linear interpolation from start to end
|
||||||
|
{
|
||||||
|
float planelightfloat = BASEVIDWIDTH*BASEVIDWIDTH/vid.width / (zeroheight - FIXED_TO_FLOAT(viewz)) / 21.0f;
|
||||||
|
float lightstart, lightend;
|
||||||
|
|
||||||
|
lightend = (iz + ds_szp->x*width) * planelightfloat;
|
||||||
|
lightstart = iz * planelightfloat;
|
||||||
|
|
||||||
|
R_CalcTiltedLighting(FLOAT_TO_FIXED(lightstart), FLOAT_TO_FIXED(lightend));
|
||||||
|
//CONS_Printf("tilted lighting %f to %f (foc %f)\n", lightstart, lightend, focallengthf);
|
||||||
|
}
|
||||||
|
|
||||||
|
uz = ds_sup->z + ds_sup->y*(centery-ds_y) + ds_sup->x*(ds_x1-centerx);
|
||||||
|
vz = ds_svp->z + ds_svp->y*(centery-ds_y) + ds_svp->x*(ds_x1-centerx);
|
||||||
|
|
||||||
|
dest = ylookup[ds_y] + columnofs[ds_x1];
|
||||||
|
dsrc = screens[1] + (ds_y+ds_bgofs)*vid.width + ds_x1;
|
||||||
|
source = ds_source;
|
||||||
|
//colormap = ds_colormap;
|
||||||
|
|
||||||
|
#if 0 // The "perfect" reference version of this routine. Pretty slow.
|
||||||
|
// Use it only to see how things are supposed to look.
|
||||||
|
i = 0;
|
||||||
|
do
|
||||||
|
{
|
||||||
|
double z = 1.f/iz;
|
||||||
|
u = (INT64)(uz*z) + viewx;
|
||||||
|
v = (INT64)(vz*z) + viewy;
|
||||||
|
|
||||||
|
colormap = planezlight[tiltlighting[ds_x1++]] + (ds_colormap - colormaps);
|
||||||
|
*dest = *(ds_transmap + (colormap[source[((v >> nflatyshift) & nflatmask) | (u >> nflatxshift)]] << 8) + *dsrc++);
|
||||||
|
dest++;
|
||||||
|
iz += ds_szp->x;
|
||||||
|
uz += ds_sup->x;
|
||||||
|
vz += ds_svp->x;
|
||||||
|
} while (--width >= 0);
|
||||||
|
#else
|
||||||
|
#define SPANSIZE 16
|
||||||
|
#define INVSPAN 0.0625f
|
||||||
|
|
||||||
|
startz = 1.f/iz;
|
||||||
|
startu = uz*startz;
|
||||||
|
startv = vz*startz;
|
||||||
|
|
||||||
|
izstep = ds_szp->x * SPANSIZE;
|
||||||
|
uzstep = ds_sup->x * SPANSIZE;
|
||||||
|
vzstep = ds_svp->x * SPANSIZE;
|
||||||
|
//x1 = 0;
|
||||||
|
width++;
|
||||||
|
|
||||||
|
while (width >= SPANSIZE)
|
||||||
|
{
|
||||||
|
iz += izstep;
|
||||||
|
uz += uzstep;
|
||||||
|
vz += vzstep;
|
||||||
|
|
||||||
|
endz = 1.f/iz;
|
||||||
|
endu = uz*endz;
|
||||||
|
endv = vz*endz;
|
||||||
|
stepu = (INT64)((endu - startu) * INVSPAN);
|
||||||
|
stepv = (INT64)((endv - startv) * INVSPAN);
|
||||||
|
u = (INT64)(startu) + viewx;
|
||||||
|
v = (INT64)(startv) + viewy;
|
||||||
|
|
||||||
|
for (i = SPANSIZE-1; i >= 0; i--)
|
||||||
|
{
|
||||||
|
colormap = planezlight[tiltlighting[ds_x1++]] + (ds_colormap - colormaps);
|
||||||
|
*dest = *(ds_transmap + (colormap[source[((v >> nflatyshift) & nflatmask) | (u >> nflatxshift)]] << 8) + *dsrc++);
|
||||||
|
dest++;
|
||||||
|
u += stepu;
|
||||||
|
v += stepv;
|
||||||
|
}
|
||||||
|
startu = endu;
|
||||||
|
startv = endv;
|
||||||
|
width -= SPANSIZE;
|
||||||
|
}
|
||||||
|
if (width > 0)
|
||||||
|
{
|
||||||
|
if (width == 1)
|
||||||
|
{
|
||||||
|
u = (INT64)(startu);
|
||||||
|
v = (INT64)(startv);
|
||||||
|
colormap = planezlight[tiltlighting[ds_x1++]] + (ds_colormap - colormaps);
|
||||||
|
*dest = *(ds_transmap + (colormap[source[((v >> nflatyshift) & nflatmask) | (u >> nflatxshift)]] << 8) + *dsrc++);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
double left = width;
|
||||||
|
iz += ds_szp->x * left;
|
||||||
|
uz += ds_sup->x * left;
|
||||||
|
vz += ds_svp->x * left;
|
||||||
|
|
||||||
|
endz = 1.f/iz;
|
||||||
|
endu = uz*endz;
|
||||||
|
endv = vz*endz;
|
||||||
|
left = 1.f/left;
|
||||||
|
stepu = (INT64)((endu - startu) * left);
|
||||||
|
stepv = (INT64)((endv - startv) * left);
|
||||||
|
u = (INT64)(startu) + viewx;
|
||||||
|
v = (INT64)(startv) + viewy;
|
||||||
|
|
||||||
|
for (; width != 0; width--)
|
||||||
|
{
|
||||||
|
colormap = planezlight[tiltlighting[ds_x1++]] + (ds_colormap - colormaps);
|
||||||
|
*dest = *(ds_transmap + (colormap[source[((v >> nflatyshift) & nflatmask) | (u >> nflatxshift)]] << 8) + *dsrc++);
|
||||||
|
dest++;
|
||||||
|
u += stepu;
|
||||||
|
v += stepv;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
#endif // NOWATER
|
||||||
|
|
||||||
void R_DrawTiltedSplat_8(void)
|
void R_DrawTiltedSplat_8(void)
|
||||||
{
|
{
|
||||||
// x1, x2 = ds_x1, ds_x2
|
// x1, x2 = ds_x1, ds_x2
|
||||||
|
@ -935,22 +1074,22 @@ void R_DrawTiltedSplat_8(void)
|
||||||
double endz, endu, endv;
|
double endz, endu, endv;
|
||||||
UINT32 stepu, stepv;
|
UINT32 stepu, stepv;
|
||||||
|
|
||||||
iz = ds_sz.z + ds_sz.y*(centery-ds_y) + ds_sz.x*(ds_x1-centerx);
|
iz = ds_szp->z + ds_szp->y*(centery-ds_y) + ds_szp->x*(ds_x1-centerx);
|
||||||
|
|
||||||
// Lighting is simple. It's just linear interpolation from start to end
|
// Lighting is simple. It's just linear interpolation from start to end
|
||||||
{
|
{
|
||||||
float planelightfloat = BASEVIDWIDTH*BASEVIDWIDTH/vid.width / (zeroheight - FIXED_TO_FLOAT(viewz)) / 21.0f;
|
float planelightfloat = BASEVIDWIDTH*BASEVIDWIDTH/vid.width / (zeroheight - FIXED_TO_FLOAT(viewz)) / 21.0f;
|
||||||
float lightstart, lightend;
|
float lightstart, lightend;
|
||||||
|
|
||||||
lightend = (iz + ds_sz.x*width) * planelightfloat;
|
lightend = (iz + ds_szp->x*width) * planelightfloat;
|
||||||
lightstart = iz * planelightfloat;
|
lightstart = iz * planelightfloat;
|
||||||
|
|
||||||
R_CalcTiltedLighting(FLOAT_TO_FIXED(lightstart), FLOAT_TO_FIXED(lightend));
|
R_CalcTiltedLighting(FLOAT_TO_FIXED(lightstart), FLOAT_TO_FIXED(lightend));
|
||||||
//CONS_Printf("tilted lighting %f to %f (foc %f)\n", lightstart, lightend, focallengthf);
|
//CONS_Printf("tilted lighting %f to %f (foc %f)\n", lightstart, lightend, focallengthf);
|
||||||
}
|
}
|
||||||
|
|
||||||
uz = ds_su.z + ds_su.y*(centery-ds_y) + ds_su.x*(ds_x1-centerx);
|
uz = ds_sup->z + ds_sup->y*(centery-ds_y) + ds_sup->x*(ds_x1-centerx);
|
||||||
vz = ds_sv.z + ds_sv.y*(centery-ds_y) + ds_sv.x*(ds_x1-centerx);
|
vz = ds_svp->z + ds_svp->y*(centery-ds_y) + ds_svp->x*(ds_x1-centerx);
|
||||||
|
|
||||||
dest = ylookup[ds_y] + columnofs[ds_x1];
|
dest = ylookup[ds_y] + columnofs[ds_x1];
|
||||||
source = ds_source;
|
source = ds_source;
|
||||||
|
@ -972,9 +1111,9 @@ void R_DrawTiltedSplat_8(void)
|
||||||
*dest = colormap[val];
|
*dest = colormap[val];
|
||||||
|
|
||||||
dest++;
|
dest++;
|
||||||
iz += ds_sz.x;
|
iz += ds_szp->x;
|
||||||
uz += ds_su.x;
|
uz += ds_sup->x;
|
||||||
vz += ds_sv.x;
|
vz += ds_svp->x;
|
||||||
} while (--width >= 0);
|
} while (--width >= 0);
|
||||||
#else
|
#else
|
||||||
#define SPANSIZE 16
|
#define SPANSIZE 16
|
||||||
|
@ -984,9 +1123,9 @@ void R_DrawTiltedSplat_8(void)
|
||||||
startu = uz*startz;
|
startu = uz*startz;
|
||||||
startv = vz*startz;
|
startv = vz*startz;
|
||||||
|
|
||||||
izstep = ds_sz.x * SPANSIZE;
|
izstep = ds_szp->x * SPANSIZE;
|
||||||
uzstep = ds_su.x * SPANSIZE;
|
uzstep = ds_sup->x * SPANSIZE;
|
||||||
vzstep = ds_sv.x * SPANSIZE;
|
vzstep = ds_svp->x * SPANSIZE;
|
||||||
//x1 = 0;
|
//x1 = 0;
|
||||||
width++;
|
width++;
|
||||||
|
|
||||||
|
@ -1032,9 +1171,9 @@ void R_DrawTiltedSplat_8(void)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
double left = width;
|
double left = width;
|
||||||
iz += ds_sz.x * left;
|
iz += ds_szp->x * left;
|
||||||
uz += ds_su.x * left;
|
uz += ds_sup->x * left;
|
||||||
vz += ds_sv.x * left;
|
vz += ds_svp->x * left;
|
||||||
|
|
||||||
endz = 1.f/iz;
|
endz = 1.f/iz;
|
||||||
endu = uz*endz;
|
endu = uz*endz;
|
||||||
|
|
|
@ -82,22 +82,22 @@ void R_DrawTiltedSpan_NPO2_8(void)
|
||||||
double endz, endu, endv;
|
double endz, endu, endv;
|
||||||
UINT32 stepu, stepv;
|
UINT32 stepu, stepv;
|
||||||
|
|
||||||
iz = ds_sz.z + ds_sz.y*(centery-ds_y) + ds_sz.x*(ds_x1-centerx);
|
iz = ds_szp->z + ds_szp->y*(centery-ds_y) + ds_szp->x*(ds_x1-centerx);
|
||||||
|
|
||||||
// Lighting is simple. It's just linear interpolation from start to end
|
// Lighting is simple. It's just linear interpolation from start to end
|
||||||
{
|
{
|
||||||
float planelightfloat = BASEVIDWIDTH*BASEVIDWIDTH/vid.width / (zeroheight - FIXED_TO_FLOAT(viewz)) / 21.0f;
|
float planelightfloat = BASEVIDWIDTH*BASEVIDWIDTH/vid.width / (zeroheight - FIXED_TO_FLOAT(viewz)) / 21.0f;
|
||||||
float lightstart, lightend;
|
float lightstart, lightend;
|
||||||
|
|
||||||
lightend = (iz + ds_sz.x*width) * planelightfloat;
|
lightend = (iz + ds_szp->x*width) * planelightfloat;
|
||||||
lightstart = iz * planelightfloat;
|
lightstart = iz * planelightfloat;
|
||||||
|
|
||||||
R_CalcTiltedLighting(FLOAT_TO_FIXED(lightstart), FLOAT_TO_FIXED(lightend));
|
R_CalcTiltedLighting(FLOAT_TO_FIXED(lightstart), FLOAT_TO_FIXED(lightend));
|
||||||
//CONS_Printf("tilted lighting %f to %f (foc %f)\n", lightstart, lightend, focallengthf);
|
//CONS_Printf("tilted lighting %f to %f (foc %f)\n", lightstart, lightend, focallengthf);
|
||||||
}
|
}
|
||||||
|
|
||||||
uz = ds_su.z + ds_su.y*(centery-ds_y) + ds_su.x*(ds_x1-centerx);
|
uz = ds_sup->z + ds_sup->y*(centery-ds_y) + ds_sup->x*(ds_x1-centerx);
|
||||||
vz = ds_sv.z + ds_sv.y*(centery-ds_y) + ds_sv.x*(ds_x1-centerx);
|
vz = ds_svp->z + ds_svp->y*(centery-ds_y) + ds_svp->x*(ds_x1-centerx);
|
||||||
|
|
||||||
dest = ylookup[ds_y] + columnofs[ds_x1];
|
dest = ylookup[ds_y] + columnofs[ds_x1];
|
||||||
source = ds_source;
|
source = ds_source;
|
||||||
|
@ -131,9 +131,9 @@ void R_DrawTiltedSpan_NPO2_8(void)
|
||||||
*dest = colormap[source[((y * ds_flatwidth) + x)]];
|
*dest = colormap[source[((y * ds_flatwidth) + x)]];
|
||||||
}
|
}
|
||||||
dest++;
|
dest++;
|
||||||
iz += ds_sz.x;
|
iz += ds_szp->x;
|
||||||
uz += ds_su.x;
|
uz += ds_sup->x;
|
||||||
vz += ds_sv.x;
|
vz += ds_svp->x;
|
||||||
} while (--width >= 0);
|
} while (--width >= 0);
|
||||||
#else
|
#else
|
||||||
#define SPANSIZE 16
|
#define SPANSIZE 16
|
||||||
|
@ -143,9 +143,9 @@ void R_DrawTiltedSpan_NPO2_8(void)
|
||||||
startu = uz*startz;
|
startu = uz*startz;
|
||||||
startv = vz*startz;
|
startv = vz*startz;
|
||||||
|
|
||||||
izstep = ds_sz.x * SPANSIZE;
|
izstep = ds_szp->x * SPANSIZE;
|
||||||
uzstep = ds_su.x * SPANSIZE;
|
uzstep = ds_sup->x * SPANSIZE;
|
||||||
vzstep = ds_sv.x * SPANSIZE;
|
vzstep = ds_svp->x * SPANSIZE;
|
||||||
//x1 = 0;
|
//x1 = 0;
|
||||||
width++;
|
width++;
|
||||||
|
|
||||||
|
@ -217,9 +217,9 @@ void R_DrawTiltedSpan_NPO2_8(void)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
double left = width;
|
double left = width;
|
||||||
iz += ds_sz.x * left;
|
iz += ds_szp->x * left;
|
||||||
uz += ds_su.x * left;
|
uz += ds_sup->x * left;
|
||||||
vz += ds_sv.x * left;
|
vz += ds_svp->x * left;
|
||||||
|
|
||||||
endz = 1.f/iz;
|
endz = 1.f/iz;
|
||||||
endu = uz*endz;
|
endu = uz*endz;
|
||||||
|
@ -278,22 +278,22 @@ void R_DrawTiltedTranslucentSpan_NPO2_8(void)
|
||||||
double endz, endu, endv;
|
double endz, endu, endv;
|
||||||
UINT32 stepu, stepv;
|
UINT32 stepu, stepv;
|
||||||
|
|
||||||
iz = ds_sz.z + ds_sz.y*(centery-ds_y) + ds_sz.x*(ds_x1-centerx);
|
iz = ds_szp->z + ds_szp->y*(centery-ds_y) + ds_szp->x*(ds_x1-centerx);
|
||||||
|
|
||||||
// Lighting is simple. It's just linear interpolation from start to end
|
// Lighting is simple. It's just linear interpolation from start to end
|
||||||
{
|
{
|
||||||
float planelightfloat = BASEVIDWIDTH*BASEVIDWIDTH/vid.width / (zeroheight - FIXED_TO_FLOAT(viewz)) / 21.0f;
|
float planelightfloat = BASEVIDWIDTH*BASEVIDWIDTH/vid.width / (zeroheight - FIXED_TO_FLOAT(viewz)) / 21.0f;
|
||||||
float lightstart, lightend;
|
float lightstart, lightend;
|
||||||
|
|
||||||
lightend = (iz + ds_sz.x*width) * planelightfloat;
|
lightend = (iz + ds_szp->x*width) * planelightfloat;
|
||||||
lightstart = iz * planelightfloat;
|
lightstart = iz * planelightfloat;
|
||||||
|
|
||||||
R_CalcTiltedLighting(FLOAT_TO_FIXED(lightstart), FLOAT_TO_FIXED(lightend));
|
R_CalcTiltedLighting(FLOAT_TO_FIXED(lightstart), FLOAT_TO_FIXED(lightend));
|
||||||
//CONS_Printf("tilted lighting %f to %f (foc %f)\n", lightstart, lightend, focallengthf);
|
//CONS_Printf("tilted lighting %f to %f (foc %f)\n", lightstart, lightend, focallengthf);
|
||||||
}
|
}
|
||||||
|
|
||||||
uz = ds_su.z + ds_su.y*(centery-ds_y) + ds_su.x*(ds_x1-centerx);
|
uz = ds_sup->z + ds_sup->y*(centery-ds_y) + ds_sup->x*(ds_x1-centerx);
|
||||||
vz = ds_sv.z + ds_sv.y*(centery-ds_y) + ds_sv.x*(ds_x1-centerx);
|
vz = ds_svp->z + ds_svp->y*(centery-ds_y) + ds_svp->x*(ds_x1-centerx);
|
||||||
|
|
||||||
dest = ylookup[ds_y] + columnofs[ds_x1];
|
dest = ylookup[ds_y] + columnofs[ds_x1];
|
||||||
source = ds_source;
|
source = ds_source;
|
||||||
|
@ -326,9 +326,9 @@ void R_DrawTiltedTranslucentSpan_NPO2_8(void)
|
||||||
*dest = *(ds_transmap + (colormap[source[((y * ds_flatwidth) + x)]] << 8) + *dest);
|
*dest = *(ds_transmap + (colormap[source[((y * ds_flatwidth) + x)]] << 8) + *dest);
|
||||||
}
|
}
|
||||||
dest++;
|
dest++;
|
||||||
iz += ds_sz.x;
|
iz += ds_szp->x;
|
||||||
uz += ds_su.x;
|
uz += ds_sup->x;
|
||||||
vz += ds_sv.x;
|
vz += ds_svp->x;
|
||||||
} while (--width >= 0);
|
} while (--width >= 0);
|
||||||
#else
|
#else
|
||||||
#define SPANSIZE 16
|
#define SPANSIZE 16
|
||||||
|
@ -338,9 +338,9 @@ void R_DrawTiltedTranslucentSpan_NPO2_8(void)
|
||||||
startu = uz*startz;
|
startu = uz*startz;
|
||||||
startv = vz*startz;
|
startv = vz*startz;
|
||||||
|
|
||||||
izstep = ds_sz.x * SPANSIZE;
|
izstep = ds_szp->x * SPANSIZE;
|
||||||
uzstep = ds_su.x * SPANSIZE;
|
uzstep = ds_sup->x * SPANSIZE;
|
||||||
vzstep = ds_sv.x * SPANSIZE;
|
vzstep = ds_svp->x * SPANSIZE;
|
||||||
//x1 = 0;
|
//x1 = 0;
|
||||||
width++;
|
width++;
|
||||||
|
|
||||||
|
@ -412,9 +412,9 @@ void R_DrawTiltedTranslucentSpan_NPO2_8(void)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
double left = width;
|
double left = width;
|
||||||
iz += ds_sz.x * left;
|
iz += ds_szp->x * left;
|
||||||
uz += ds_su.x * left;
|
uz += ds_sup->x * left;
|
||||||
vz += ds_sv.x * left;
|
vz += ds_svp->x * left;
|
||||||
|
|
||||||
endz = 1.f/iz;
|
endz = 1.f/iz;
|
||||||
endu = uz*endz;
|
endu = uz*endz;
|
||||||
|
@ -472,22 +472,22 @@ void R_DrawTiltedSplat_NPO2_8(void)
|
||||||
double endz, endu, endv;
|
double endz, endu, endv;
|
||||||
UINT32 stepu, stepv;
|
UINT32 stepu, stepv;
|
||||||
|
|
||||||
iz = ds_sz.z + ds_sz.y*(centery-ds_y) + ds_sz.x*(ds_x1-centerx);
|
iz = ds_szp->z + ds_szp->y*(centery-ds_y) + ds_szp->x*(ds_x1-centerx);
|
||||||
|
|
||||||
// Lighting is simple. It's just linear interpolation from start to end
|
// Lighting is simple. It's just linear interpolation from start to end
|
||||||
{
|
{
|
||||||
float planelightfloat = BASEVIDWIDTH*BASEVIDWIDTH/vid.width / (zeroheight - FIXED_TO_FLOAT(viewz)) / 21.0f;
|
float planelightfloat = BASEVIDWIDTH*BASEVIDWIDTH/vid.width / (zeroheight - FIXED_TO_FLOAT(viewz)) / 21.0f;
|
||||||
float lightstart, lightend;
|
float lightstart, lightend;
|
||||||
|
|
||||||
lightend = (iz + ds_sz.x*width) * planelightfloat;
|
lightend = (iz + ds_szp->x*width) * planelightfloat;
|
||||||
lightstart = iz * planelightfloat;
|
lightstart = iz * planelightfloat;
|
||||||
|
|
||||||
R_CalcTiltedLighting(FLOAT_TO_FIXED(lightstart), FLOAT_TO_FIXED(lightend));
|
R_CalcTiltedLighting(FLOAT_TO_FIXED(lightstart), FLOAT_TO_FIXED(lightend));
|
||||||
//CONS_Printf("tilted lighting %f to %f (foc %f)\n", lightstart, lightend, focallengthf);
|
//CONS_Printf("tilted lighting %f to %f (foc %f)\n", lightstart, lightend, focallengthf);
|
||||||
}
|
}
|
||||||
|
|
||||||
uz = ds_su.z + ds_su.y*(centery-ds_y) + ds_su.x*(ds_x1-centerx);
|
uz = ds_sup->z + ds_sup->y*(centery-ds_y) + ds_sup->x*(ds_x1-centerx);
|
||||||
vz = ds_sv.z + ds_sv.y*(centery-ds_y) + ds_sv.x*(ds_x1-centerx);
|
vz = ds_svp->z + ds_svp->y*(centery-ds_y) + ds_svp->x*(ds_x1-centerx);
|
||||||
|
|
||||||
dest = ylookup[ds_y] + columnofs[ds_x1];
|
dest = ylookup[ds_y] + columnofs[ds_x1];
|
||||||
source = ds_source;
|
source = ds_source;
|
||||||
|
@ -525,9 +525,9 @@ void R_DrawTiltedSplat_NPO2_8(void)
|
||||||
*dest = colormap[val];
|
*dest = colormap[val];
|
||||||
|
|
||||||
dest++;
|
dest++;
|
||||||
iz += ds_sz.x;
|
iz += ds_szp->x;
|
||||||
uz += ds_su.x;
|
uz += ds_sup->x;
|
||||||
vz += ds_sv.x;
|
vz += ds_svp->x;
|
||||||
} while (--width >= 0);
|
} while (--width >= 0);
|
||||||
#else
|
#else
|
||||||
#define SPANSIZE 16
|
#define SPANSIZE 16
|
||||||
|
@ -537,9 +537,9 @@ void R_DrawTiltedSplat_NPO2_8(void)
|
||||||
startu = uz*startz;
|
startu = uz*startz;
|
||||||
startv = vz*startz;
|
startv = vz*startz;
|
||||||
|
|
||||||
izstep = ds_sz.x * SPANSIZE;
|
izstep = ds_szp->x * SPANSIZE;
|
||||||
uzstep = ds_su.x * SPANSIZE;
|
uzstep = ds_sup->x * SPANSIZE;
|
||||||
vzstep = ds_sv.x * SPANSIZE;
|
vzstep = ds_svp->x * SPANSIZE;
|
||||||
//x1 = 0;
|
//x1 = 0;
|
||||||
width++;
|
width++;
|
||||||
|
|
||||||
|
@ -615,9 +615,9 @@ void R_DrawTiltedSplat_NPO2_8(void)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
double left = width;
|
double left = width;
|
||||||
iz += ds_sz.x * left;
|
iz += ds_szp->x * left;
|
||||||
uz += ds_su.x * left;
|
uz += ds_sup->x * left;
|
||||||
vz += ds_sv.x * left;
|
vz += ds_svp->x * left;
|
||||||
|
|
||||||
endz = 1.f/iz;
|
endz = 1.f/iz;
|
||||||
endu = uz*endz;
|
endu = uz*endz;
|
||||||
|
@ -842,4 +842,203 @@ void R_DrawTranslucentWaterSpan_NPO2_8(void)
|
||||||
yposition += ystep;
|
yposition += ystep;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef ESLOPE
|
||||||
|
/** \brief The R_DrawTiltedTranslucentWaterSpan_NPO2_8 function
|
||||||
|
Like DrawTiltedTranslucentSpan_NPO2, but for water
|
||||||
|
*/
|
||||||
|
void R_DrawTiltedTranslucentWaterSpan_NPO2_8(void)
|
||||||
|
{
|
||||||
|
// x1, x2 = ds_x1, ds_x2
|
||||||
|
int width = ds_x2 - ds_x1;
|
||||||
|
double iz, uz, vz;
|
||||||
|
UINT32 u, v;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
UINT8 *source;
|
||||||
|
UINT8 *colormap;
|
||||||
|
UINT8 *dest;
|
||||||
|
UINT8 *dsrc;
|
||||||
|
|
||||||
|
double startz, startu, startv;
|
||||||
|
double izstep, uzstep, vzstep;
|
||||||
|
double endz, endu, endv;
|
||||||
|
UINT32 stepu, stepv;
|
||||||
|
|
||||||
|
iz = ds_szp->z + ds_szp->y*(centery-ds_y) + ds_szp->x*(ds_x1-centerx);
|
||||||
|
|
||||||
|
// Lighting is simple. It's just linear interpolation from start to end
|
||||||
|
{
|
||||||
|
float planelightfloat = BASEVIDWIDTH*BASEVIDWIDTH/vid.width / (zeroheight - FIXED_TO_FLOAT(viewz)) / 21.0f;
|
||||||
|
float lightstart, lightend;
|
||||||
|
|
||||||
|
lightend = (iz + ds_szp->x*width) * planelightfloat;
|
||||||
|
lightstart = iz * planelightfloat;
|
||||||
|
|
||||||
|
R_CalcTiltedLighting(FLOAT_TO_FIXED(lightstart), FLOAT_TO_FIXED(lightend));
|
||||||
|
//CONS_Printf("tilted lighting %f to %f (foc %f)\n", lightstart, lightend, focallengthf);
|
||||||
|
}
|
||||||
|
|
||||||
|
uz = ds_sup->z + ds_sup->y*(centery-ds_y) + ds_sup->x*(ds_x1-centerx);
|
||||||
|
vz = ds_svp->z + ds_svp->y*(centery-ds_y) + ds_svp->x*(ds_x1-centerx);
|
||||||
|
|
||||||
|
dest = ylookup[ds_y] + columnofs[ds_x1];
|
||||||
|
dsrc = screens[1] + (ds_y+ds_bgofs)*vid.width + ds_x1;
|
||||||
|
source = ds_source;
|
||||||
|
//colormap = ds_colormap;
|
||||||
|
|
||||||
|
#if 0 // The "perfect" reference version of this routine. Pretty slow.
|
||||||
|
// Use it only to see how things are supposed to look.
|
||||||
|
i = 0;
|
||||||
|
do
|
||||||
|
{
|
||||||
|
double z = 1.f/iz;
|
||||||
|
u = (INT64)(uz*z) + viewx;
|
||||||
|
v = (INT64)(vz*z) + viewy;
|
||||||
|
|
||||||
|
colormap = planezlight[tiltlighting[ds_x1++]] + (ds_colormap - colormaps);
|
||||||
|
// Lactozilla: Non-powers-of-two
|
||||||
|
{
|
||||||
|
fixed_t x = (((fixed_t)u-viewx) >> FRACBITS);
|
||||||
|
fixed_t y = (((fixed_t)v-viewy) >> FRACBITS);
|
||||||
|
|
||||||
|
// Carefully align all of my Friends.
|
||||||
|
if (x < 0)
|
||||||
|
x = ds_flatwidth - ((UINT32)(ds_flatwidth - x) % ds_flatwidth);
|
||||||
|
if (y < 0)
|
||||||
|
y = ds_flatheight - ((UINT32)(ds_flatheight - y) % ds_flatheight);
|
||||||
|
|
||||||
|
x %= ds_flatwidth;
|
||||||
|
y %= ds_flatheight;
|
||||||
|
|
||||||
|
*dest = *(ds_transmap + (colormap[source[((y * ds_flatwidth) + x)]] << 8) + *dsrc++);
|
||||||
|
}
|
||||||
|
dest++;
|
||||||
|
iz += ds_szp->x;
|
||||||
|
uz += ds_sup->x;
|
||||||
|
vz += ds_svp->x;
|
||||||
|
} while (--width >= 0);
|
||||||
|
#else
|
||||||
|
#define SPANSIZE 16
|
||||||
|
#define INVSPAN 0.0625f
|
||||||
|
|
||||||
|
startz = 1.f/iz;
|
||||||
|
startu = uz*startz;
|
||||||
|
startv = vz*startz;
|
||||||
|
|
||||||
|
izstep = ds_szp->x * SPANSIZE;
|
||||||
|
uzstep = ds_sup->x * SPANSIZE;
|
||||||
|
vzstep = ds_svp->x * SPANSIZE;
|
||||||
|
//x1 = 0;
|
||||||
|
width++;
|
||||||
|
|
||||||
|
while (width >= SPANSIZE)
|
||||||
|
{
|
||||||
|
iz += izstep;
|
||||||
|
uz += uzstep;
|
||||||
|
vz += vzstep;
|
||||||
|
|
||||||
|
endz = 1.f/iz;
|
||||||
|
endu = uz*endz;
|
||||||
|
endv = vz*endz;
|
||||||
|
stepu = (INT64)((endu - startu) * INVSPAN);
|
||||||
|
stepv = (INT64)((endv - startv) * INVSPAN);
|
||||||
|
u = (INT64)(startu) + viewx;
|
||||||
|
v = (INT64)(startv) + viewy;
|
||||||
|
|
||||||
|
for (i = SPANSIZE-1; i >= 0; i--)
|
||||||
|
{
|
||||||
|
colormap = planezlight[tiltlighting[ds_x1++]] + (ds_colormap - colormaps);
|
||||||
|
// Lactozilla: Non-powers-of-two
|
||||||
|
{
|
||||||
|
fixed_t x = (((fixed_t)u-viewx) >> FRACBITS);
|
||||||
|
fixed_t y = (((fixed_t)v-viewy) >> FRACBITS);
|
||||||
|
|
||||||
|
// Carefully align all of my Friends.
|
||||||
|
if (x < 0)
|
||||||
|
x = ds_flatwidth - ((UINT32)(ds_flatwidth - x) % ds_flatwidth);
|
||||||
|
if (y < 0)
|
||||||
|
y = ds_flatheight - ((UINT32)(ds_flatheight - y) % ds_flatheight);
|
||||||
|
|
||||||
|
x %= ds_flatwidth;
|
||||||
|
y %= ds_flatheight;
|
||||||
|
|
||||||
|
*dest = *(ds_transmap + (colormap[source[((y * ds_flatwidth) + x)]] << 8) + *dsrc++);
|
||||||
|
}
|
||||||
|
dest++;
|
||||||
|
u += stepu;
|
||||||
|
v += stepv;
|
||||||
|
}
|
||||||
|
startu = endu;
|
||||||
|
startv = endv;
|
||||||
|
width -= SPANSIZE;
|
||||||
|
}
|
||||||
|
if (width > 0)
|
||||||
|
{
|
||||||
|
if (width == 1)
|
||||||
|
{
|
||||||
|
u = (INT64)(startu);
|
||||||
|
v = (INT64)(startv);
|
||||||
|
colormap = planezlight[tiltlighting[ds_x1++]] + (ds_colormap - colormaps);
|
||||||
|
// Lactozilla: Non-powers-of-two
|
||||||
|
{
|
||||||
|
fixed_t x = (((fixed_t)u-viewx) >> FRACBITS);
|
||||||
|
fixed_t y = (((fixed_t)v-viewy) >> FRACBITS);
|
||||||
|
|
||||||
|
// Carefully align all of my Friends.
|
||||||
|
if (x < 0)
|
||||||
|
x = ds_flatwidth - ((UINT32)(ds_flatwidth - x) % ds_flatwidth);
|
||||||
|
if (y < 0)
|
||||||
|
y = ds_flatheight - ((UINT32)(ds_flatheight - y) % ds_flatheight);
|
||||||
|
|
||||||
|
x %= ds_flatwidth;
|
||||||
|
y %= ds_flatheight;
|
||||||
|
|
||||||
|
*dest = *(ds_transmap + (colormap[source[((y * ds_flatwidth) + x)]] << 8) + *dsrc++);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
double left = width;
|
||||||
|
iz += ds_szp->x * left;
|
||||||
|
uz += ds_sup->x * left;
|
||||||
|
vz += ds_svp->x * left;
|
||||||
|
|
||||||
|
endz = 1.f/iz;
|
||||||
|
endu = uz*endz;
|
||||||
|
endv = vz*endz;
|
||||||
|
left = 1.f/left;
|
||||||
|
stepu = (INT64)((endu - startu) * left);
|
||||||
|
stepv = (INT64)((endv - startv) * left);
|
||||||
|
u = (INT64)(startu) + viewx;
|
||||||
|
v = (INT64)(startv) + viewy;
|
||||||
|
|
||||||
|
for (; width != 0; width--)
|
||||||
|
{
|
||||||
|
colormap = planezlight[tiltlighting[ds_x1++]] + (ds_colormap - colormaps);
|
||||||
|
// Lactozilla: Non-powers-of-two
|
||||||
|
{
|
||||||
|
fixed_t x = (((fixed_t)u-viewx) >> FRACBITS);
|
||||||
|
fixed_t y = (((fixed_t)v-viewy) >> FRACBITS);
|
||||||
|
|
||||||
|
// Carefully align all of my Friends.
|
||||||
|
if (x < 0)
|
||||||
|
x = ds_flatwidth - ((UINT32)(ds_flatwidth - x) % ds_flatwidth);
|
||||||
|
if (y < 0)
|
||||||
|
y = ds_flatheight - ((UINT32)(ds_flatheight - y) % ds_flatheight);
|
||||||
|
|
||||||
|
x %= ds_flatwidth;
|
||||||
|
y %= ds_flatheight;
|
||||||
|
|
||||||
|
*dest = *(ds_transmap + (colormap[source[((y * ds_flatwidth) + x)]] << 8) + *dsrc++);
|
||||||
|
}
|
||||||
|
dest++;
|
||||||
|
u += stepu;
|
||||||
|
v += stepv;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
#endif // ESLOPE
|
||||||
|
#endif // NOWATER
|
||||||
|
|
276
src/r_plane.c
276
src/r_plane.c
|
@ -116,6 +116,35 @@ void R_InitPlanes(void)
|
||||||
// FIXME: unused
|
// FIXME: unused
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Water ripple effect!!
|
||||||
|
// Needs the height of the plane, and the vertical position of the span.
|
||||||
|
// Sets ripple_xfrac and ripple_yfrac, added to ds_xfrac and ds_yfrac, if the span is not tilted.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef NOWATER
|
||||||
|
INT32 ds_bgofs;
|
||||||
|
INT32 ds_waterofs;
|
||||||
|
|
||||||
|
static INT32 wtofs=0;
|
||||||
|
static boolean itswater;
|
||||||
|
static fixed_t ripple_xfrac;
|
||||||
|
static fixed_t ripple_yfrac;
|
||||||
|
|
||||||
|
static void R_PlaneRipple(visplane_t *plane, INT32 y, fixed_t plheight)
|
||||||
|
{
|
||||||
|
fixed_t distance = FixedMul(plheight, yslope[y]);
|
||||||
|
const INT32 yay = (wtofs + (distance>>9) ) & 8191;
|
||||||
|
// ripples da water texture
|
||||||
|
angle_t angle = (plane->viewangle + plane->plangle)>>ANGLETOFINESHIFT;
|
||||||
|
ds_bgofs = FixedDiv(FINESINE(yay), (1<<12) + (distance>>11))>>FRACBITS;
|
||||||
|
|
||||||
|
angle = (angle + 2048) & 8191; // 90 degrees
|
||||||
|
ripple_xfrac = FixedMul(FINECOSINE(angle), (ds_bgofs<<FRACBITS));
|
||||||
|
ripple_yfrac = FixedMul(FINESINE(angle), (ds_bgofs<<FRACBITS));
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
//
|
//
|
||||||
// R_MapPlane
|
// R_MapPlane
|
||||||
//
|
//
|
||||||
|
@ -129,14 +158,6 @@ void R_InitPlanes(void)
|
||||||
// viewcos
|
// viewcos
|
||||||
// viewheight
|
// viewheight
|
||||||
|
|
||||||
#ifndef NOWATER
|
|
||||||
INT32 ds_bgofs;
|
|
||||||
INT32 ds_waterofs;
|
|
||||||
|
|
||||||
static INT32 wtofs=0;
|
|
||||||
static boolean itswater;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void R_MapPlane(INT32 y, INT32 x1, INT32 x2)
|
void R_MapPlane(INT32 y, INT32 x1, INT32 x2)
|
||||||
{
|
{
|
||||||
angle_t angle, planecos, planesin;
|
angle_t angle, planecos, planesin;
|
||||||
|
@ -181,14 +202,22 @@ void R_MapPlane(INT32 y, INT32 x1, INT32 x2)
|
||||||
#ifndef NOWATER
|
#ifndef NOWATER
|
||||||
if (itswater)
|
if (itswater)
|
||||||
{
|
{
|
||||||
const INT32 yay = (wtofs + (distance>>9) ) & 8191;
|
// Needed for ds_bgofs
|
||||||
// ripples da water texture
|
R_PlaneRipple(currentplane, y, planeheight);
|
||||||
ds_bgofs = FixedDiv(FINESINE(yay), (1<<12) + (distance>>11))>>FRACBITS;
|
|
||||||
angle = (currentplane->viewangle + currentplane->plangle + xtoviewangle[x1])>>ANGLETOFINESHIFT;
|
|
||||||
|
|
||||||
angle = (angle + 2048) & 8191; // 90 degrees
|
#ifdef ESLOPE
|
||||||
ds_xfrac += FixedMul(FINECOSINE(angle), (ds_bgofs<<FRACBITS));
|
if (currentplane->slope)
|
||||||
ds_yfrac += FixedMul(FINESINE(angle), (ds_bgofs<<FRACBITS));
|
{
|
||||||
|
ds_sup = &ds_su[y];
|
||||||
|
ds_svp = &ds_sv[y];
|
||||||
|
ds_szp = &ds_sz[y];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
ds_xfrac += ripple_xfrac;
|
||||||
|
ds_yfrac += ripple_yfrac;
|
||||||
|
}
|
||||||
|
|
||||||
if (y+ds_bgofs>=viewheight)
|
if (y+ds_bgofs>=viewheight)
|
||||||
ds_bgofs = viewheight-y-1;
|
ds_bgofs = viewheight-y-1;
|
||||||
|
@ -832,6 +861,99 @@ static UINT8 *R_GetTextureFlat(levelflat_t *levelflat, boolean leveltexture, boo
|
||||||
return flat;
|
return flat;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef ESLOPE
|
||||||
|
static void R_SlopeVectors(visplane_t *pl, INT32 i, float fudge)
|
||||||
|
{
|
||||||
|
// Potentially override other stuff for now cus we're mean. :< But draw a slope plane!
|
||||||
|
// I copied ZDoom's code and adapted it to SRB2... -Red
|
||||||
|
floatv3_t p, m, n;
|
||||||
|
float ang;
|
||||||
|
float vx, vy, vz;
|
||||||
|
// compiler complains when P_GetZAt is used in FLOAT_TO_FIXED directly
|
||||||
|
// use this as a temp var to store P_GetZAt's return value each time
|
||||||
|
fixed_t temp;
|
||||||
|
|
||||||
|
vx = FIXED_TO_FLOAT(pl->viewx+xoffs);
|
||||||
|
vy = FIXED_TO_FLOAT(pl->viewy-yoffs);
|
||||||
|
vz = FIXED_TO_FLOAT(pl->viewz);
|
||||||
|
|
||||||
|
temp = P_GetZAt(pl->slope, pl->viewx, pl->viewy);
|
||||||
|
zeroheight = FIXED_TO_FLOAT(temp);
|
||||||
|
|
||||||
|
// p is the texture origin in view space
|
||||||
|
// Don't add in the offsets at this stage, because doing so can result in
|
||||||
|
// errors if the flat is rotated.
|
||||||
|
ang = ANG2RAD(ANGLE_270 - pl->viewangle);
|
||||||
|
p.x = vx * cos(ang) - vy * sin(ang);
|
||||||
|
p.z = vx * sin(ang) + vy * cos(ang);
|
||||||
|
temp = P_GetZAt(pl->slope, -xoffs, yoffs);
|
||||||
|
p.y = FIXED_TO_FLOAT(temp) - vz;
|
||||||
|
|
||||||
|
// m is the v direction vector in view space
|
||||||
|
ang = ANG2RAD(ANGLE_180 - (pl->viewangle + pl->plangle));
|
||||||
|
m.x = cos(ang);
|
||||||
|
m.z = sin(ang);
|
||||||
|
|
||||||
|
// n is the u direction vector in view space
|
||||||
|
n.x = sin(ang);
|
||||||
|
n.z = -cos(ang);
|
||||||
|
|
||||||
|
ang = ANG2RAD(pl->plangle);
|
||||||
|
temp = P_GetZAt(pl->slope, pl->viewx + FLOAT_TO_FIXED(sin(ang)), pl->viewy + FLOAT_TO_FIXED(cos(ang)));
|
||||||
|
m.y = FIXED_TO_FLOAT(temp) - zeroheight;
|
||||||
|
temp = P_GetZAt(pl->slope, pl->viewx + FLOAT_TO_FIXED(cos(ang)), pl->viewy - FLOAT_TO_FIXED(sin(ang)));
|
||||||
|
n.y = FIXED_TO_FLOAT(temp) - zeroheight;
|
||||||
|
|
||||||
|
if (ds_powersoftwo)
|
||||||
|
{
|
||||||
|
m.x /= fudge;
|
||||||
|
m.y /= fudge;
|
||||||
|
m.z /= fudge;
|
||||||
|
|
||||||
|
n.x *= fudge;
|
||||||
|
n.y *= fudge;
|
||||||
|
n.z *= fudge;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Eh. I tried making this stuff fixed-point and it exploded on me. Here's a macro for the only floating-point vector function I recall using.
|
||||||
|
#define CROSS(d, v1, v2) \
|
||||||
|
d.x = (v1.y * v2.z) - (v1.z * v2.y);\
|
||||||
|
d.y = (v1.z * v2.x) - (v1.x * v2.z);\
|
||||||
|
d.z = (v1.x * v2.y) - (v1.y * v2.x)
|
||||||
|
CROSS(ds_su[i], p, m);
|
||||||
|
CROSS(ds_sv[i], p, n);
|
||||||
|
CROSS(ds_sz[i], m, n);
|
||||||
|
#undef CROSS
|
||||||
|
|
||||||
|
ds_su[i].z *= focallengthf;
|
||||||
|
ds_sv[i].z *= focallengthf;
|
||||||
|
ds_sz[i].z *= focallengthf;
|
||||||
|
|
||||||
|
// Premultiply the texture vectors with the scale factors
|
||||||
|
#define SFMULT 65536.f
|
||||||
|
if (ds_powersoftwo)
|
||||||
|
{
|
||||||
|
ds_su[i].x *= (SFMULT * (1<<nflatshiftup));
|
||||||
|
ds_su[i].y *= (SFMULT * (1<<nflatshiftup));
|
||||||
|
ds_su[i].z *= (SFMULT * (1<<nflatshiftup));
|
||||||
|
ds_sv[i].x *= (SFMULT * (1<<nflatshiftup));
|
||||||
|
ds_sv[i].y *= (SFMULT * (1<<nflatshiftup));
|
||||||
|
ds_sv[i].z *= (SFMULT * (1<<nflatshiftup));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Lactozilla: I'm essentially multiplying the vectors by FRACUNIT...
|
||||||
|
ds_su[i].x *= SFMULT;
|
||||||
|
ds_su[i].y *= SFMULT;
|
||||||
|
ds_su[i].z *= SFMULT;
|
||||||
|
ds_sv[i].x *= SFMULT;
|
||||||
|
ds_sv[i].y *= SFMULT;
|
||||||
|
ds_sv[i].z *= SFMULT;
|
||||||
|
}
|
||||||
|
#undef SFMULT
|
||||||
|
}
|
||||||
|
#endif // ESLOPE
|
||||||
|
|
||||||
void R_DrawSinglePlane(visplane_t *pl)
|
void R_DrawSinglePlane(visplane_t *pl)
|
||||||
{
|
{
|
||||||
UINT8 *flat;
|
UINT8 *flat;
|
||||||
|
@ -946,11 +1068,7 @@ void R_DrawSinglePlane(visplane_t *pl)
|
||||||
else light = (pl->lightlevel >> LIGHTSEGSHIFT);
|
else light = (pl->lightlevel >> LIGHTSEGSHIFT);
|
||||||
|
|
||||||
#ifndef NOWATER
|
#ifndef NOWATER
|
||||||
if (pl->ffloor->flags & FF_RIPPLE
|
if (pl->ffloor->flags & FF_RIPPLE)
|
||||||
#ifdef ESLOPE
|
|
||||||
&& !pl->slope
|
|
||||||
#endif
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
INT32 top, bottom;
|
INT32 top, bottom;
|
||||||
|
|
||||||
|
@ -1040,25 +1158,18 @@ void R_DrawSinglePlane(visplane_t *pl)
|
||||||
light = 0;
|
light = 0;
|
||||||
|
|
||||||
#ifdef ESLOPE
|
#ifdef ESLOPE
|
||||||
if (pl->slope) {
|
if (pl->slope)
|
||||||
// Potentially override other stuff for now cus we're mean. :< But draw a slope plane!
|
{
|
||||||
// I copied ZDoom's code and adapted it to SRB2... -Red
|
float fudgecanyon = 0;
|
||||||
floatv3_t p, m, n;
|
|
||||||
float ang;
|
|
||||||
float vx, vy, vz;
|
|
||||||
float fudge = 0;
|
|
||||||
// compiler complains when P_GetZAt is used in FLOAT_TO_FIXED directly
|
|
||||||
// use this as a temp var to store P_GetZAt's return value each time
|
|
||||||
fixed_t temp;
|
|
||||||
|
|
||||||
angle_t hack = (pl->plangle & (ANGLE_90-1));
|
angle_t hack = (pl->plangle & (ANGLE_90-1));
|
||||||
|
|
||||||
yoffs *= 1;
|
yoffs *= 1;
|
||||||
|
|
||||||
if (ds_powersoftwo)
|
if (ds_powersoftwo)
|
||||||
{
|
{
|
||||||
|
fixed_t temp;
|
||||||
// Okay, look, don't ask me why this works, but without this setup there's a disgusting-looking misalignment with the textures. -Red
|
// Okay, look, don't ask me why this works, but without this setup there's a disgusting-looking misalignment with the textures. -Red
|
||||||
fudge = ((1<<nflatshiftup)+1.0f)/(1<<nflatshiftup);
|
fudgecanyon = ((1<<nflatshiftup)+1.0f)/(1<<nflatshiftup);
|
||||||
if (hack)
|
if (hack)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
|
@ -1100,89 +1211,44 @@ void R_DrawSinglePlane(visplane_t *pl)
|
||||||
xoffs -= (pl->slope->o.x + (1 << (31-nflatshiftup))) & ~((1 << (32-nflatshiftup))-1);
|
xoffs -= (pl->slope->o.x + (1 << (31-nflatshiftup))) & ~((1 << (32-nflatshiftup))-1);
|
||||||
yoffs += (pl->slope->o.y + (1 << (31-nflatshiftup))) & ~((1 << (32-nflatshiftup))-1);
|
yoffs += (pl->slope->o.y + (1 << (31-nflatshiftup))) & ~((1 << (32-nflatshiftup))-1);
|
||||||
}
|
}
|
||||||
xoffs = (fixed_t)(xoffs*fudge);
|
xoffs = (fixed_t)(xoffs*fudgecanyon);
|
||||||
yoffs = (fixed_t)(yoffs/fudge);
|
yoffs = (fixed_t)(yoffs/fudgecanyon);
|
||||||
}
|
}
|
||||||
|
|
||||||
vx = FIXED_TO_FLOAT(pl->viewx+xoffs);
|
ds_sup = &ds_su[0];
|
||||||
vy = FIXED_TO_FLOAT(pl->viewy-yoffs);
|
ds_svp = &ds_sv[0];
|
||||||
vz = FIXED_TO_FLOAT(pl->viewz);
|
ds_szp = &ds_sz[0];
|
||||||
|
|
||||||
temp = P_GetZAt(pl->slope, pl->viewx, pl->viewy);
|
#ifndef NOWATER
|
||||||
zeroheight = FIXED_TO_FLOAT(temp);
|
if (itswater)
|
||||||
|
|
||||||
// p is the texture origin in view space
|
|
||||||
// Don't add in the offsets at this stage, because doing so can result in
|
|
||||||
// errors if the flat is rotated.
|
|
||||||
ang = ANG2RAD(ANGLE_270 - pl->viewangle);
|
|
||||||
p.x = vx * cos(ang) - vy * sin(ang);
|
|
||||||
p.z = vx * sin(ang) + vy * cos(ang);
|
|
||||||
temp = P_GetZAt(pl->slope, -xoffs, yoffs);
|
|
||||||
p.y = FIXED_TO_FLOAT(temp) - vz;
|
|
||||||
|
|
||||||
// m is the v direction vector in view space
|
|
||||||
ang = ANG2RAD(ANGLE_180 - (pl->viewangle + pl->plangle));
|
|
||||||
m.x = cos(ang);
|
|
||||||
m.z = sin(ang);
|
|
||||||
|
|
||||||
// n is the u direction vector in view space
|
|
||||||
n.x = sin(ang);
|
|
||||||
n.z = -cos(ang);
|
|
||||||
|
|
||||||
ang = ANG2RAD(pl->plangle);
|
|
||||||
temp = P_GetZAt(pl->slope, pl->viewx + FLOAT_TO_FIXED(sin(ang)), pl->viewy + FLOAT_TO_FIXED(cos(ang)));
|
|
||||||
m.y = FIXED_TO_FLOAT(temp) - zeroheight;
|
|
||||||
temp = P_GetZAt(pl->slope, pl->viewx + FLOAT_TO_FIXED(cos(ang)), pl->viewy - FLOAT_TO_FIXED(sin(ang)));
|
|
||||||
n.y = FIXED_TO_FLOAT(temp) - zeroheight;
|
|
||||||
|
|
||||||
if (ds_powersoftwo)
|
|
||||||
{
|
{
|
||||||
m.x /= fudge;
|
INT32 i;
|
||||||
m.y /= fudge;
|
fixed_t plheight = abs(P_GetZAt(pl->slope, pl->viewx, pl->viewy) - pl->viewz);
|
||||||
m.z /= fudge;
|
fixed_t rxoffs = xoffs;
|
||||||
|
fixed_t ryoffs = yoffs;
|
||||||
|
|
||||||
n.x *= fudge;
|
R_PlaneBounds(pl);
|
||||||
n.y *= fudge;
|
|
||||||
n.z *= fudge;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Eh. I tried making this stuff fixed-point and it exploded on me. Here's a macro for the only floating-point vector function I recall using.
|
for (i = pl->high; i < pl->low; i++)
|
||||||
#define CROSS(d, v1, v2) \
|
{
|
||||||
d.x = (v1.y * v2.z) - (v1.z * v2.y);\
|
R_PlaneRipple(pl, i, plheight);
|
||||||
d.y = (v1.z * v2.x) - (v1.x * v2.z);\
|
xoffs = rxoffs + ripple_xfrac;
|
||||||
d.z = (v1.x * v2.y) - (v1.y * v2.x)
|
yoffs = ryoffs + ripple_yfrac;
|
||||||
CROSS(ds_su, p, m);
|
R_SlopeVectors(pl, i, fudgecanyon);
|
||||||
CROSS(ds_sv, p, n);
|
}
|
||||||
CROSS(ds_sz, m, n);
|
|
||||||
#undef CROSS
|
|
||||||
|
|
||||||
ds_su.z *= focallengthf;
|
xoffs = rxoffs;
|
||||||
ds_sv.z *= focallengthf;
|
yoffs = ryoffs;
|
||||||
ds_sz.z *= focallengthf;
|
|
||||||
|
|
||||||
// Premultiply the texture vectors with the scale factors
|
|
||||||
#define SFMULT 65536.f
|
|
||||||
if (ds_powersoftwo)
|
|
||||||
{
|
|
||||||
ds_su.x *= (SFMULT * (1<<nflatshiftup));
|
|
||||||
ds_su.y *= (SFMULT * (1<<nflatshiftup));
|
|
||||||
ds_su.z *= (SFMULT * (1<<nflatshiftup));
|
|
||||||
ds_sv.x *= (SFMULT * (1<<nflatshiftup));
|
|
||||||
ds_sv.y *= (SFMULT * (1<<nflatshiftup));
|
|
||||||
ds_sv.z *= (SFMULT * (1<<nflatshiftup));
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
#endif
|
||||||
// I'm essentially multiplying the vectors by FRACUNIT...
|
R_SlopeVectors(pl, 0, fudgecanyon);
|
||||||
ds_su.x *= SFMULT;
|
|
||||||
ds_su.y *= SFMULT;
|
|
||||||
ds_su.z *= SFMULT;
|
|
||||||
ds_sv.x *= SFMULT;
|
|
||||||
ds_sv.y *= SFMULT;
|
|
||||||
ds_sv.z *= SFMULT;
|
|
||||||
}
|
|
||||||
#undef SFMULT
|
|
||||||
|
|
||||||
|
#ifndef NOWATER
|
||||||
|
if (itswater && (spanfunctype == SPANDRAWFUNC_WATER))
|
||||||
|
spanfunctype = SPANDRAWFUNC_TILTEDWATER;
|
||||||
|
else
|
||||||
|
#endif
|
||||||
if (spanfunctype == SPANDRAWFUNC_TRANS)
|
if (spanfunctype == SPANDRAWFUNC_TRANS)
|
||||||
spanfunctype = SPANDRAWFUNC_TILTEDTRANS;
|
spanfunctype = SPANDRAWFUNC_TILTEDTRANS;
|
||||||
else if (spanfunctype == SPANDRAWFUNC_SPLAT)
|
else if (spanfunctype == SPANDRAWFUNC_SPLAT)
|
||||||
|
|
|
@ -130,6 +130,9 @@ void SCR_SetMode(void)
|
||||||
#ifdef ESLOPE
|
#ifdef ESLOPE
|
||||||
spanfuncs[SPANDRAWFUNC_TILTED] = R_DrawTiltedSpan_8;
|
spanfuncs[SPANDRAWFUNC_TILTED] = R_DrawTiltedSpan_8;
|
||||||
spanfuncs[SPANDRAWFUNC_TILTEDTRANS] = R_DrawTiltedTranslucentSpan_8;
|
spanfuncs[SPANDRAWFUNC_TILTEDTRANS] = R_DrawTiltedTranslucentSpan_8;
|
||||||
|
#ifndef NOWATER
|
||||||
|
spanfuncs[SPANDRAWFUNC_TILTEDWATER] = R_DrawTiltedTranslucentWaterSpan_8;
|
||||||
|
#endif
|
||||||
spanfuncs[SPANDRAWFUNC_TILTEDSPLAT] = R_DrawTiltedSplat_8;
|
spanfuncs[SPANDRAWFUNC_TILTEDSPLAT] = R_DrawTiltedSplat_8;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -145,6 +148,9 @@ void SCR_SetMode(void)
|
||||||
#ifdef ESLOPE
|
#ifdef ESLOPE
|
||||||
spanfuncs_npo2[SPANDRAWFUNC_TILTED] = R_DrawTiltedSpan_NPO2_8;
|
spanfuncs_npo2[SPANDRAWFUNC_TILTED] = R_DrawTiltedSpan_NPO2_8;
|
||||||
spanfuncs_npo2[SPANDRAWFUNC_TILTEDTRANS] = R_DrawTiltedTranslucentSpan_NPO2_8;
|
spanfuncs_npo2[SPANDRAWFUNC_TILTEDTRANS] = R_DrawTiltedTranslucentSpan_NPO2_8;
|
||||||
|
#ifndef NOWATER
|
||||||
|
spanfuncs_npo2[SPANDRAWFUNC_TILTEDWATER] = R_DrawTiltedTranslucentWaterSpan_NPO2_8;
|
||||||
|
#endif
|
||||||
spanfuncs_npo2[SPANDRAWFUNC_TILTEDSPLAT] = R_DrawTiltedSplat_NPO2_8;
|
spanfuncs_npo2[SPANDRAWFUNC_TILTEDSPLAT] = R_DrawTiltedSplat_NPO2_8;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -144,6 +144,9 @@ enum
|
||||||
SPANDRAWFUNC_TILTED,
|
SPANDRAWFUNC_TILTED,
|
||||||
SPANDRAWFUNC_TILTEDTRANS,
|
SPANDRAWFUNC_TILTEDTRANS,
|
||||||
SPANDRAWFUNC_TILTEDSPLAT,
|
SPANDRAWFUNC_TILTEDSPLAT,
|
||||||
|
#ifndef NOWATER
|
||||||
|
SPANDRAWFUNC_TILTEDWATER,
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
SPANDRAWFUNC_MAX
|
SPANDRAWFUNC_MAX
|
||||||
|
|
Loading…
Reference in New Issue