mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-26 12:01:47 +00:00
Merge branch 'drip' into 'master'
Ripple on regular ass sectors See merge request KartKrew/Kart!351
This commit is contained in:
commit
b19c8a43c7
7 changed files with 112 additions and 80 deletions
|
|
@ -2955,6 +2955,11 @@ static void HWR_AddPolyObjectPlanes(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static FBITFIELD HWR_RippleBlend(sector_t *sector, ffloor_t *rover, boolean ceiling)
|
||||||
|
{
|
||||||
|
return R_IsRipplePlane(sector, rover, ceiling) ? PF_Ripple : 0;
|
||||||
|
}
|
||||||
|
|
||||||
// -----------------+
|
// -----------------+
|
||||||
// HWR_Subsector : Determine floor/ceiling planes.
|
// HWR_Subsector : Determine floor/ceiling planes.
|
||||||
// : Add sprites of things in sector.
|
// : Add sprites of things in sector.
|
||||||
|
|
@ -3067,7 +3072,8 @@ static void HWR_Subsector(size_t num)
|
||||||
// Hack to make things continue to work around slopes.
|
// Hack to make things continue to work around slopes.
|
||||||
locFloorHeight == cullFloorHeight ? locFloorHeight : gl_frontsector->floorheight,
|
locFloorHeight == cullFloorHeight ? locFloorHeight : gl_frontsector->floorheight,
|
||||||
// We now return you to your regularly scheduled rendering.
|
// We now return you to your regularly scheduled rendering.
|
||||||
PF_Occlude, floorlightlevel, &levelflats[gl_frontsector->floorpic], NULL, 255, floorcolormap);
|
PF_Occlude | HWR_RippleBlend(gl_frontsector, NULL, false),
|
||||||
|
floorlightlevel, &levelflats[gl_frontsector->floorpic], NULL, 255, floorcolormap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -3089,7 +3095,8 @@ static void HWR_Subsector(size_t num)
|
||||||
// Hack to make things continue to work around slopes.
|
// Hack to make things continue to work around slopes.
|
||||||
locCeilingHeight == cullCeilingHeight ? locCeilingHeight : gl_frontsector->ceilingheight,
|
locCeilingHeight == cullCeilingHeight ? locCeilingHeight : gl_frontsector->ceilingheight,
|
||||||
// We now return you to your regularly scheduled rendering.
|
// We now return you to your regularly scheduled rendering.
|
||||||
PF_Occlude, ceilinglightlevel, &levelflats[gl_frontsector->ceilingpic], NULL, 255, ceilingcolormap);
|
PF_Occlude | HWR_RippleBlend(gl_frontsector, NULL, true),
|
||||||
|
ceilinglightlevel, &levelflats[gl_frontsector->ceilingpic], NULL, 255, ceilingcolormap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -3149,7 +3156,7 @@ static void HWR_Subsector(size_t num)
|
||||||
&& (rover->alpha < 256
|
&& (rover->alpha < 256
|
||||||
|| rover->alpha == FFLOOR_ALPHA_SPECIAL_ADDITIVE || rover->alpha == FFLOOR_ALPHA_SPECIAL_SUBTRACTIVE)) // SoM: Flags are more efficient
|
|| rover->alpha == FFLOOR_ALPHA_SPECIAL_ADDITIVE || rover->alpha == FFLOOR_ALPHA_SPECIAL_SUBTRACTIVE)) // SoM: Flags are more efficient
|
||||||
{
|
{
|
||||||
FBITFIELD blendmode = PF_Translucent;
|
FBITFIELD blendmode = PF_Translucent | HWR_RippleBlend(gl_frontsector, rover, false);
|
||||||
if (rover->alpha == FFLOOR_ALPHA_SPECIAL_ADDITIVE)
|
if (rover->alpha == FFLOOR_ALPHA_SPECIAL_ADDITIVE)
|
||||||
blendmode = PF_Additive;
|
blendmode = PF_Additive;
|
||||||
else if (rover->alpha == FFLOOR_ALPHA_SPECIAL_SUBTRACTIVE)
|
else if (rover->alpha == FFLOOR_ALPHA_SPECIAL_SUBTRACTIVE)
|
||||||
|
|
@ -3162,14 +3169,14 @@ static void HWR_Subsector(size_t num)
|
||||||
false,
|
false,
|
||||||
*rover->bottomheight,
|
*rover->bottomheight,
|
||||||
*gl_frontsector->lightlist[light].lightlevel,
|
*gl_frontsector->lightlist[light].lightlevel,
|
||||||
rover->alpha-1 > 255 ? 255 : rover->alpha-1, rover->master->frontsector, (rover->flags & FF_RIPPLE ? PF_Ripple : 0)|blendmode,
|
rover->alpha-1 > 255 ? 255 : rover->alpha-1, rover->master->frontsector, blendmode,
|
||||||
false, *gl_frontsector->lightlist[light].extra_colormap);
|
false, *gl_frontsector->lightlist[light].extra_colormap);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
HWR_GetLevelFlat(&levelflats[*rover->bottompic], R_NoEncore(gl_frontsector, false));
|
HWR_GetLevelFlat(&levelflats[*rover->bottompic], R_NoEncore(gl_frontsector, false));
|
||||||
light = R_GetPlaneLight(gl_frontsector, centerHeight, dup_viewz < cullHeight ? true : false);
|
light = R_GetPlaneLight(gl_frontsector, centerHeight, dup_viewz < cullHeight ? true : false);
|
||||||
HWR_RenderPlane(sub, &extrasubsectors[num], false, *rover->bottomheight, (rover->flags & FF_RIPPLE ? PF_Ripple : 0)|PF_Occlude, *gl_frontsector->lightlist[light].lightlevel, &levelflats[*rover->bottompic],
|
HWR_RenderPlane(sub, &extrasubsectors[num], false, *rover->bottomheight, HWR_RippleBlend(gl_frontsector, rover, false) | PF_Occlude, *gl_frontsector->lightlist[light].lightlevel, &levelflats[*rover->bottompic],
|
||||||
rover->master->frontsector, 255, *gl_frontsector->lightlist[light].extra_colormap);
|
rover->master->frontsector, 255, *gl_frontsector->lightlist[light].extra_colormap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -3202,7 +3209,7 @@ static void HWR_Subsector(size_t num)
|
||||||
&& (rover->alpha < 256
|
&& (rover->alpha < 256
|
||||||
|| rover->alpha == FFLOOR_ALPHA_SPECIAL_ADDITIVE || rover->alpha == FFLOOR_ALPHA_SPECIAL_SUBTRACTIVE)) // SoM: Flags are more efficient
|
|| rover->alpha == FFLOOR_ALPHA_SPECIAL_ADDITIVE || rover->alpha == FFLOOR_ALPHA_SPECIAL_SUBTRACTIVE)) // SoM: Flags are more efficient
|
||||||
{
|
{
|
||||||
FBITFIELD blendmode = PF_Translucent;
|
FBITFIELD blendmode = PF_Translucent | HWR_RippleBlend(gl_frontsector, rover, true);
|
||||||
if (rover->alpha == FFLOOR_ALPHA_SPECIAL_ADDITIVE)
|
if (rover->alpha == FFLOOR_ALPHA_SPECIAL_ADDITIVE)
|
||||||
blendmode = PF_Additive;
|
blendmode = PF_Additive;
|
||||||
else if (rover->alpha == FFLOOR_ALPHA_SPECIAL_SUBTRACTIVE)
|
else if (rover->alpha == FFLOOR_ALPHA_SPECIAL_SUBTRACTIVE)
|
||||||
|
|
@ -3215,14 +3222,14 @@ static void HWR_Subsector(size_t num)
|
||||||
true,
|
true,
|
||||||
*rover->topheight,
|
*rover->topheight,
|
||||||
*gl_frontsector->lightlist[light].lightlevel,
|
*gl_frontsector->lightlist[light].lightlevel,
|
||||||
rover->alpha-1 > 255 ? 255 : rover->alpha-1, rover->master->frontsector, (rover->flags & FF_RIPPLE ? PF_Ripple : 0)|blendmode,
|
rover->alpha-1 > 255 ? 255 : rover->alpha-1, rover->master->frontsector, blendmode,
|
||||||
false, *gl_frontsector->lightlist[light].extra_colormap);
|
false, *gl_frontsector->lightlist[light].extra_colormap);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
HWR_GetLevelFlat(&levelflats[*rover->toppic], R_NoEncore(gl_frontsector, true));
|
HWR_GetLevelFlat(&levelflats[*rover->toppic], R_NoEncore(gl_frontsector, true));
|
||||||
light = R_GetPlaneLight(gl_frontsector, centerHeight, dup_viewz < cullHeight ? true : false);
|
light = R_GetPlaneLight(gl_frontsector, centerHeight, dup_viewz < cullHeight ? true : false);
|
||||||
HWR_RenderPlane(sub, &extrasubsectors[num], true, *rover->topheight, (rover->flags & FF_RIPPLE ? PF_Ripple : 0)|PF_Occlude, *gl_frontsector->lightlist[light].lightlevel, &levelflats[*rover->toppic],
|
HWR_RenderPlane(sub, &extrasubsectors[num], true, *rover->topheight, HWR_RippleBlend(gl_frontsector, rover, true) | PF_Occlude, *gl_frontsector->lightlist[light].lightlevel, &levelflats[*rover->toppic],
|
||||||
rover->master->frontsector, 255, *gl_frontsector->lightlist[light].extra_colormap);
|
rover->master->frontsector, 255, *gl_frontsector->lightlist[light].extra_colormap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6156,6 +6156,12 @@ void P_SpawnSpecials(boolean fromnetsave)
|
||||||
if (lines[i].flags & ML_EFFECT1)
|
if (lines[i].flags & ML_EFFECT1)
|
||||||
sectors[s].flags |= SF_INVERTPRECIP;
|
sectors[s].flags |= SF_INVERTPRECIP;
|
||||||
|
|
||||||
|
if (lines[i].flags & ML_DONTPEGTOP)
|
||||||
|
sectors[s].flags |= SF_RIPPLE_FLOOR;
|
||||||
|
|
||||||
|
if (lines[i].flags & ML_DONTPEGBOTTOM)
|
||||||
|
sectors[s].flags |= SF_RIPPLE_CEILING;
|
||||||
|
|
||||||
if (lines[i].frontsector && GETSECSPECIAL(lines[i].frontsector->special, 4) == 12)
|
if (lines[i].frontsector && GETSECSPECIAL(lines[i].frontsector->special, 4) == 12)
|
||||||
sectors[s].camsec = sides[*lines[i].sidenum].sector-sectors;
|
sectors[s].camsec = sides[*lines[i].sidenum].sector-sectors;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
22
src/r_bsp.c
22
src/r_bsp.c
|
|
@ -43,7 +43,7 @@ boolean R_NoEncore(sector_t *sector, boolean ceiling)
|
||||||
boolean invertencore = (GETSECSPECIAL(sector->special, 2) == 15);
|
boolean invertencore = (GETSECSPECIAL(sector->special, 2) == 15);
|
||||||
#if 0 // perfect implementation
|
#if 0 // perfect implementation
|
||||||
INT32 val = GETSECSPECIAL(sector->special, 3);
|
INT32 val = GETSECSPECIAL(sector->special, 3);
|
||||||
if (val != 1 && val != 3 // spring panel
|
//if (val != 1 && val != 3 // spring panel
|
||||||
#else // optimised, see #define GETSECSPECIAL(i,j) ((i >> ((j-1)*4))&15)
|
#else // optimised, see #define GETSECSPECIAL(i,j) ((i >> ((j-1)*4))&15)
|
||||||
if ((!(sector->special & (1<<8)) || (sector->special & ((4|8)<<8))) // spring panel
|
if ((!(sector->special & (1<<8)) || (sector->special & ((4|8)<<8))) // spring panel
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -58,6 +58,12 @@ boolean R_NoEncore(sector_t *sector, boolean ceiling)
|
||||||
return ((boolean)(sector->flags & SF_FLIPSPECIAL_FLOOR));
|
return ((boolean)(sector->flags & SF_FLIPSPECIAL_FLOOR));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean R_IsRipplePlane(sector_t *sector, ffloor_t *rover, int ceiling)
|
||||||
|
{
|
||||||
|
return rover ? rover->flags & FF_RIPPLE :
|
||||||
|
sector->flags & (SF_RIPPLE_FLOOR << ceiling);
|
||||||
|
}
|
||||||
|
|
||||||
static void R_PlaneLightOverride(sector_t *sector, boolean ceiling, INT32 *lightlevel)
|
static void R_PlaneLightOverride(sector_t *sector, boolean ceiling, INT32 *lightlevel)
|
||||||
{
|
{
|
||||||
if (GETSECSPECIAL(sector->special, 4) == 6) // Fullbright sneaker panels
|
if (GETSECSPECIAL(sector->special, 4) == 6) // Fullbright sneaker panels
|
||||||
|
|
@ -923,7 +929,7 @@ static void R_Subsector(size_t num)
|
||||||
{
|
{
|
||||||
floorplane = R_FindPlane(frontsector->floorheight, frontsector->floorpic, floorlightlevel,
|
floorplane = R_FindPlane(frontsector->floorheight, frontsector->floorpic, floorlightlevel,
|
||||||
frontsector->floor_xoffs, frontsector->floor_yoffs, frontsector->floorpic_angle, floorcolormap, NULL, NULL, frontsector->f_slope,
|
frontsector->floor_xoffs, frontsector->floor_yoffs, frontsector->floorpic_angle, floorcolormap, NULL, NULL, frontsector->f_slope,
|
||||||
R_NoEncore(frontsector, false));
|
R_NoEncore(frontsector, false), R_IsRipplePlane(frontsector, NULL, false));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
floorplane = NULL;
|
floorplane = NULL;
|
||||||
|
|
@ -935,7 +941,7 @@ static void R_Subsector(size_t num)
|
||||||
ceilingplane = R_FindPlane(frontsector->ceilingheight, frontsector->ceilingpic,
|
ceilingplane = R_FindPlane(frontsector->ceilingheight, frontsector->ceilingpic,
|
||||||
ceilinglightlevel, frontsector->ceiling_xoffs, frontsector->ceiling_yoffs, frontsector->ceilingpic_angle,
|
ceilinglightlevel, frontsector->ceiling_xoffs, frontsector->ceiling_yoffs, frontsector->ceilingpic_angle,
|
||||||
ceilingcolormap, NULL, NULL, frontsector->c_slope,
|
ceilingcolormap, NULL, NULL, frontsector->c_slope,
|
||||||
R_NoEncore(frontsector, true));
|
R_NoEncore(frontsector, true), R_IsRipplePlane(frontsector, NULL, true));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ceilingplane = NULL;
|
ceilingplane = NULL;
|
||||||
|
|
@ -985,7 +991,8 @@ static void R_Subsector(size_t num)
|
||||||
ffloor[numffloors].plane = R_FindPlane(*rover->bottomheight, *rover->bottompic,
|
ffloor[numffloors].plane = R_FindPlane(*rover->bottomheight, *rover->bottompic,
|
||||||
newlightlevel, *rover->bottomxoffs,
|
newlightlevel, *rover->bottomxoffs,
|
||||||
*rover->bottomyoffs, *rover->bottomangle, *frontsector->lightlist[light].extra_colormap, rover, NULL, *rover->b_slope,
|
*rover->bottomyoffs, *rover->bottomangle, *frontsector->lightlist[light].extra_colormap, rover, NULL, *rover->b_slope,
|
||||||
R_NoEncore(rover->master->frontsector, true));
|
R_NoEncore(rover->master->frontsector, true),
|
||||||
|
R_IsRipplePlane(rover->master->frontsector, rover, true));
|
||||||
|
|
||||||
ffloor[numffloors].slope = *rover->b_slope;
|
ffloor[numffloors].slope = *rover->b_slope;
|
||||||
|
|
||||||
|
|
@ -1020,7 +1027,8 @@ static void R_Subsector(size_t num)
|
||||||
ffloor[numffloors].plane = R_FindPlane(*rover->topheight, *rover->toppic,
|
ffloor[numffloors].plane = R_FindPlane(*rover->topheight, *rover->toppic,
|
||||||
*frontsector->lightlist[light].lightlevel, *rover->topxoffs, *rover->topyoffs, *rover->topangle,
|
*frontsector->lightlist[light].lightlevel, *rover->topxoffs, *rover->topyoffs, *rover->topangle,
|
||||||
*frontsector->lightlist[light].extra_colormap, rover, NULL, *rover->t_slope,
|
*frontsector->lightlist[light].extra_colormap, rover, NULL, *rover->t_slope,
|
||||||
R_NoEncore(rover->master->frontsector, false));
|
R_NoEncore(rover->master->frontsector, false),
|
||||||
|
R_IsRipplePlane(rover->master->frontsector, rover, false));
|
||||||
|
|
||||||
ffloor[numffloors].slope = *rover->t_slope;
|
ffloor[numffloors].slope = *rover->t_slope;
|
||||||
|
|
||||||
|
|
@ -1071,7 +1079,7 @@ static void R_Subsector(size_t num)
|
||||||
polysec->floorpic_angle-po->angle,
|
polysec->floorpic_angle-po->angle,
|
||||||
(light == -1 ? frontsector->extra_colormap : *frontsector->lightlist[light].extra_colormap), NULL, po,
|
(light == -1 ? frontsector->extra_colormap : *frontsector->lightlist[light].extra_colormap), NULL, po,
|
||||||
NULL, // will ffloors be slopable eventually?
|
NULL, // will ffloors be slopable eventually?
|
||||||
R_NoEncore(polysec, false));
|
R_NoEncore(polysec, false), false);/* TODO: wet polyobjects? */
|
||||||
|
|
||||||
ffloor[numffloors].height = polysec->floorheight;
|
ffloor[numffloors].height = polysec->floorheight;
|
||||||
ffloor[numffloors].polyobj = po;
|
ffloor[numffloors].polyobj = po;
|
||||||
|
|
@ -1101,7 +1109,7 @@ static void R_Subsector(size_t num)
|
||||||
(light == -1 ? frontsector->lightlevel : *frontsector->lightlist[light].lightlevel), polysec->ceiling_xoffs, polysec->ceiling_yoffs, polysec->ceilingpic_angle-po->angle,
|
(light == -1 ? frontsector->lightlevel : *frontsector->lightlist[light].lightlevel), polysec->ceiling_xoffs, polysec->ceiling_yoffs, polysec->ceilingpic_angle-po->angle,
|
||||||
(light == -1 ? frontsector->extra_colormap : *frontsector->lightlist[light].extra_colormap), NULL, po,
|
(light == -1 ? frontsector->extra_colormap : *frontsector->lightlist[light].extra_colormap), NULL, po,
|
||||||
NULL, // will ffloors be slopable eventually?
|
NULL, // will ffloors be slopable eventually?
|
||||||
R_NoEncore(polysec, true));
|
R_NoEncore(polysec, true), false);/* TODO: wet polyobjects? */
|
||||||
|
|
||||||
ffloor[numffloors].polyobj = po;
|
ffloor[numffloors].polyobj = po;
|
||||||
ffloor[numffloors].height = polysec->ceilingheight;
|
ffloor[numffloors].height = polysec->ceilingheight;
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,8 @@ void R_RenderBSPNode(INT32 bspnum);
|
||||||
// no longer a static since this is used for encore in hw_main.c as well now:
|
// no longer a static since this is used for encore in hw_main.c as well now:
|
||||||
boolean R_NoEncore(sector_t *sector, boolean ceiling);
|
boolean R_NoEncore(sector_t *sector, boolean ceiling);
|
||||||
|
|
||||||
|
boolean R_IsRipplePlane(sector_t *sector, ffloor_t *rover, int ceiling);
|
||||||
|
|
||||||
void R_SortPolyObjects(subsector_t *sub);
|
void R_SortPolyObjects(subsector_t *sub);
|
||||||
|
|
||||||
extern size_t numpolys; // number of polyobjects in current subsector
|
extern size_t numpolys; // number of polyobjects in current subsector
|
||||||
|
|
|
||||||
|
|
@ -264,6 +264,9 @@ typedef enum
|
||||||
SF_TRIGGERSPECIAL_HEADBUMP = 1<<3,
|
SF_TRIGGERSPECIAL_HEADBUMP = 1<<3,
|
||||||
// invertprecip - inverts presence of precipitation
|
// invertprecip - inverts presence of precipitation
|
||||||
SF_INVERTPRECIP = 1<<4,
|
SF_INVERTPRECIP = 1<<4,
|
||||||
|
// water ripple
|
||||||
|
SF_RIPPLE_FLOOR = 1<<5,
|
||||||
|
SF_RIPPLE_CEILING = 1<<6,
|
||||||
} sectorflags_t;
|
} sectorflags_t;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
132
src/r_plane.c
132
src/r_plane.c
|
|
@ -341,7 +341,8 @@ static visplane_t *new_visplane(unsigned hash)
|
||||||
//
|
//
|
||||||
visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel,
|
visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel,
|
||||||
fixed_t xoff, fixed_t yoff, angle_t plangle, extracolormap_t *planecolormap,
|
fixed_t xoff, fixed_t yoff, angle_t plangle, extracolormap_t *planecolormap,
|
||||||
ffloor_t *pfloor, polyobj_t *polyobj, pslope_t *slope, boolean noencore)
|
ffloor_t *pfloor, polyobj_t *polyobj, pslope_t *slope, boolean noencore,
|
||||||
|
boolean ripple)
|
||||||
{
|
{
|
||||||
visplane_t *check;
|
visplane_t *check;
|
||||||
unsigned hash;
|
unsigned hash;
|
||||||
|
|
@ -398,7 +399,8 @@ visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel,
|
||||||
&& check->viewangle == viewangle
|
&& check->viewangle == viewangle
|
||||||
&& check->plangle == plangle
|
&& check->plangle == plangle
|
||||||
&& check->slope == slope
|
&& check->slope == slope
|
||||||
&& check->noencore == noencore)
|
&& check->noencore == noencore
|
||||||
|
&& check->ripple == ripple)
|
||||||
{
|
{
|
||||||
return check;
|
return check;
|
||||||
}
|
}
|
||||||
|
|
@ -428,6 +430,7 @@ visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel,
|
||||||
check->polyobj = polyobj;
|
check->polyobj = polyobj;
|
||||||
check->slope = slope;
|
check->slope = slope;
|
||||||
check->noencore = noencore;
|
check->noencore = noencore;
|
||||||
|
check->ripple = ripple;
|
||||||
|
|
||||||
memset(check->top, 0xff, sizeof (check->top));
|
memset(check->top, 0xff, sizeof (check->top));
|
||||||
memset(check->bottom, 0x00, sizeof (check->bottom));
|
memset(check->bottom, 0x00, sizeof (check->bottom));
|
||||||
|
|
@ -505,6 +508,7 @@ visplane_t *R_CheckPlane(visplane_t *pl, INT32 start, INT32 stop)
|
||||||
new_pl->polyobj = pl->polyobj;
|
new_pl->polyobj = pl->polyobj;
|
||||||
new_pl->slope = pl->slope;
|
new_pl->slope = pl->slope;
|
||||||
new_pl->noencore = pl->noencore;
|
new_pl->noencore = pl->noencore;
|
||||||
|
new_pl->ripple = pl->ripple;
|
||||||
pl = new_pl;
|
pl = new_pl;
|
||||||
pl->minx = start;
|
pl->minx = start;
|
||||||
pl->maxx = stop;
|
pl->maxx = stop;
|
||||||
|
|
@ -859,71 +863,71 @@ void R_DrawSinglePlane(visplane_t *pl)
|
||||||
light = (pl->lightlevel >> LIGHTSEGSHIFT);
|
light = (pl->lightlevel >> LIGHTSEGSHIFT);
|
||||||
}
|
}
|
||||||
else light = (pl->lightlevel >> LIGHTSEGSHIFT);
|
else light = (pl->lightlevel >> LIGHTSEGSHIFT);
|
||||||
|
|
||||||
#ifndef NOWATER
|
|
||||||
if (pl->ffloor->flags & FF_RIPPLE)
|
|
||||||
{
|
|
||||||
INT32 top, bottom;
|
|
||||||
|
|
||||||
itswater = true;
|
|
||||||
if (spanfunctype == SPANDRAWFUNC_TRANS)
|
|
||||||
{
|
|
||||||
UINT8 i;
|
|
||||||
|
|
||||||
spanfunctype = SPANDRAWFUNC_WATER;
|
|
||||||
|
|
||||||
// Copy the current scene, ugh
|
|
||||||
top = pl->high-8;
|
|
||||||
bottom = pl->low+8;
|
|
||||||
|
|
||||||
if (top < 0)
|
|
||||||
top = 0;
|
|
||||||
if (bottom > vid.height)
|
|
||||||
bottom = vid.height;
|
|
||||||
|
|
||||||
// Only copy the part of the screen we need
|
|
||||||
for (i = 0; i <= r_splitscreen; i++)
|
|
||||||
{
|
|
||||||
if (viewplayer == &players[displayplayers[i]])
|
|
||||||
{
|
|
||||||
INT32 scrx = 0;
|
|
||||||
INT32 scry = top;
|
|
||||||
INT32 offset;
|
|
||||||
|
|
||||||
if (r_splitscreen == 1)
|
|
||||||
{
|
|
||||||
if (i & 1)
|
|
||||||
{
|
|
||||||
scry += viewheight;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (i & 1)
|
|
||||||
{
|
|
||||||
scrx += viewwidth;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (i / 2)
|
|
||||||
{
|
|
||||||
scry += viewheight;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
offset = (scry*vid.width) + scrx;
|
|
||||||
|
|
||||||
// No idea if this works
|
|
||||||
VID_BlitLinearScreen(screens[0] + offset, screens[1] + offset,
|
|
||||||
viewwidth, bottom-top,
|
|
||||||
vid.width, vid.width);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
light = (pl->lightlevel >> LIGHTSEGSHIFT);
|
light = (pl->lightlevel >> LIGHTSEGSHIFT);
|
||||||
|
|
||||||
|
#ifndef NOWATER
|
||||||
|
if (pl->ripple)
|
||||||
|
{
|
||||||
|
INT32 top, bottom;
|
||||||
|
|
||||||
|
itswater = true;
|
||||||
|
if (spanfunctype == SPANDRAWFUNC_TRANS)
|
||||||
|
{
|
||||||
|
UINT8 i;
|
||||||
|
|
||||||
|
spanfunctype = SPANDRAWFUNC_WATER;
|
||||||
|
|
||||||
|
// Copy the current scene, ugh
|
||||||
|
top = pl->high-8;
|
||||||
|
bottom = pl->low+8;
|
||||||
|
|
||||||
|
if (top < 0)
|
||||||
|
top = 0;
|
||||||
|
if (bottom > vid.height)
|
||||||
|
bottom = vid.height;
|
||||||
|
|
||||||
|
// Only copy the part of the screen we need
|
||||||
|
for (i = 0; i <= r_splitscreen; i++)
|
||||||
|
{
|
||||||
|
if (viewplayer == &players[displayplayers[i]])
|
||||||
|
{
|
||||||
|
INT32 scrx = 0;
|
||||||
|
INT32 scry = top;
|
||||||
|
INT32 offset;
|
||||||
|
|
||||||
|
if (r_splitscreen == 1)
|
||||||
|
{
|
||||||
|
if (i & 1)
|
||||||
|
{
|
||||||
|
scry += viewheight;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (i & 1)
|
||||||
|
{
|
||||||
|
scrx += viewwidth;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (i / 2)
|
||||||
|
{
|
||||||
|
scry += viewheight;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
offset = (scry*vid.width) + scrx;
|
||||||
|
|
||||||
|
// No idea if this works
|
||||||
|
VID_BlitLinearScreen(screens[0] + offset, screens[1] + offset,
|
||||||
|
viewwidth, bottom-top,
|
||||||
|
vid.width, vid.width);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!pl->slope // Don't mess with angle on slopes! We'll handle this ourselves later
|
if (!pl->slope // Don't mess with angle on slopes! We'll handle this ourselves later
|
||||||
|
|
|
||||||
|
|
@ -55,6 +55,7 @@ typedef struct visplane_s
|
||||||
pslope_t *slope;
|
pslope_t *slope;
|
||||||
|
|
||||||
boolean noencore;
|
boolean noencore;
|
||||||
|
boolean ripple;
|
||||||
} visplane_t;
|
} visplane_t;
|
||||||
|
|
||||||
extern visplane_t *visplanes[MAXVISPLANES];
|
extern visplane_t *visplanes[MAXVISPLANES];
|
||||||
|
|
@ -85,7 +86,8 @@ void R_MapPlane(INT32 y, INT32 x1, INT32 x2);
|
||||||
void R_MakeSpans(INT32 x, INT32 t1, INT32 b1, INT32 t2, INT32 b2);
|
void R_MakeSpans(INT32 x, INT32 t1, INT32 b1, INT32 t2, INT32 b2);
|
||||||
void R_DrawPlanes(void);
|
void R_DrawPlanes(void);
|
||||||
visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel, fixed_t xoff, fixed_t yoff, angle_t plangle,
|
visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel, fixed_t xoff, fixed_t yoff, angle_t plangle,
|
||||||
extracolormap_t *planecolormap, ffloor_t *ffloor, polyobj_t *polyobj, pslope_t *slope, boolean noencore);
|
extracolormap_t *planecolormap, ffloor_t *ffloor, polyobj_t *polyobj, pslope_t *slope, boolean noencore,
|
||||||
|
boolean ripple);
|
||||||
visplane_t *R_CheckPlane(visplane_t *pl, INT32 start, INT32 stop);
|
visplane_t *R_CheckPlane(visplane_t *pl, INT32 start, INT32 stop);
|
||||||
void R_ExpandPlane(visplane_t *pl, INT32 start, INT32 stop);
|
void R_ExpandPlane(visplane_t *pl, INT32 start, INT32 stop);
|
||||||
void R_PlaneBounds(visplane_t *plane);
|
void R_PlaneBounds(visplane_t *plane);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue