Make polyobjects agree with sector lighting/colormap like a FOF.
Caution: has weird retry/reload bug. Ask sphere for sample map/coords.
This commit is contained in:
parent
9d2e7b66ba
commit
1f2baf5b6b
|
@ -3333,6 +3333,7 @@ static void HWR_AddPolyObjectPlanes(void)
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
sector_t *polyobjsector;
|
sector_t *polyobjsector;
|
||||||
|
INT32 light = 0;
|
||||||
|
|
||||||
// Polyobject Planes need their own function for drawing because they don't have extrasubsectors by themselves
|
// Polyobject Planes need their own function for drawing because they don't have extrasubsectors by themselves
|
||||||
// It should be okay because polyobjects should always be convex anyway
|
// It should be okay because polyobjects should always be convex anyway
|
||||||
|
@ -3351,19 +3352,22 @@ static void HWR_AddPolyObjectPlanes(void)
|
||||||
&& polyobjsector->floorheight >= gr_frontsector->floorheight
|
&& polyobjsector->floorheight >= gr_frontsector->floorheight
|
||||||
&& (viewz < polyobjsector->floorheight))
|
&& (viewz < polyobjsector->floorheight))
|
||||||
{
|
{
|
||||||
|
light = R_GetPlaneLight(gr_frontsector, polyobjsector->floorheight, true);
|
||||||
if (po_ptrs[i]->translucency > 0)
|
if (po_ptrs[i]->translucency > 0)
|
||||||
{
|
{
|
||||||
FSurfaceInfo Surf;
|
FSurfaceInfo Surf;
|
||||||
FBITFIELD blendmode = HWR_TranstableToAlpha(po_ptrs[i]->translucency, &Surf);
|
FBITFIELD blendmode;
|
||||||
|
memset(&Surf, 0x00, sizeof(Surf));
|
||||||
|
blendmode = HWR_TranstableToAlpha(po_ptrs[i]->translucency, &Surf);
|
||||||
HWR_AddTransparentPolyobjectFloor(levelflats[polyobjsector->floorpic].lumpnum, po_ptrs[i], false, polyobjsector->floorheight,
|
HWR_AddTransparentPolyobjectFloor(levelflats[polyobjsector->floorpic].lumpnum, po_ptrs[i], false, polyobjsector->floorheight,
|
||||||
polyobjsector->lightlevel, Surf.FlatColor.s.alpha, polyobjsector, blendmode, NULL);
|
(light == -1 ? gr_frontsector->lightlevel : *gr_frontsector->lightlist[light].lightlevel), Surf.FlatColor.s.alpha, polyobjsector, blendmode, (light == -1 ? gr_frontsector->extra_colormap : *gr_frontsector->lightlist[light].extra_colormap));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
HWR_GetFlat(levelflats[polyobjsector->floorpic].lumpnum);
|
HWR_GetFlat(levelflats[polyobjsector->floorpic].lumpnum);
|
||||||
HWR_RenderPolyObjectPlane(po_ptrs[i], false, polyobjsector->floorheight, PF_Occlude,
|
HWR_RenderPolyObjectPlane(po_ptrs[i], false, polyobjsector->floorheight, PF_Occlude,
|
||||||
polyobjsector->lightlevel, levelflats[polyobjsector->floorpic].lumpnum,
|
(light == -1 ? gr_frontsector->lightlevel : *gr_frontsector->lightlist[light].lightlevel), levelflats[polyobjsector->floorpic].lumpnum,
|
||||||
polyobjsector, 255, NULL);
|
polyobjsector, 255, (light == -1 ? gr_frontsector->extra_colormap : *gr_frontsector->lightlist[light].extra_colormap));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3371,6 +3375,7 @@ static void HWR_AddPolyObjectPlanes(void)
|
||||||
&& polyobjsector->ceilingheight <= gr_frontsector->ceilingheight
|
&& polyobjsector->ceilingheight <= gr_frontsector->ceilingheight
|
||||||
&& (viewz > polyobjsector->ceilingheight))
|
&& (viewz > polyobjsector->ceilingheight))
|
||||||
{
|
{
|
||||||
|
light = R_GetPlaneLight(gr_frontsector, polyobjsector->ceilingheight, true);
|
||||||
if (po_ptrs[i]->translucency > 0)
|
if (po_ptrs[i]->translucency > 0)
|
||||||
{
|
{
|
||||||
FSurfaceInfo Surf;
|
FSurfaceInfo Surf;
|
||||||
|
@ -3378,14 +3383,14 @@ static void HWR_AddPolyObjectPlanes(void)
|
||||||
memset(&Surf, 0x00, sizeof(Surf));
|
memset(&Surf, 0x00, sizeof(Surf));
|
||||||
blendmode = HWR_TranstableToAlpha(po_ptrs[i]->translucency, &Surf);
|
blendmode = HWR_TranstableToAlpha(po_ptrs[i]->translucency, &Surf);
|
||||||
HWR_AddTransparentPolyobjectFloor(levelflats[polyobjsector->ceilingpic].lumpnum, po_ptrs[i], true, polyobjsector->ceilingheight,
|
HWR_AddTransparentPolyobjectFloor(levelflats[polyobjsector->ceilingpic].lumpnum, po_ptrs[i], true, polyobjsector->ceilingheight,
|
||||||
polyobjsector->lightlevel, Surf.FlatColor.s.alpha, polyobjsector, blendmode, NULL);
|
(light == -1 ? gr_frontsector->lightlevel : *gr_frontsector->lightlist[light].lightlevel), Surf.FlatColor.s.alpha, polyobjsector, blendmode, (light == -1 ? gr_frontsector->extra_colormap : *gr_frontsector->lightlist[light].extra_colormap));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
HWR_GetFlat(levelflats[polyobjsector->ceilingpic].lumpnum);
|
HWR_GetFlat(levelflats[polyobjsector->ceilingpic].lumpnum);
|
||||||
HWR_RenderPolyObjectPlane(po_ptrs[i], true, polyobjsector->ceilingheight, PF_Occlude,
|
HWR_RenderPolyObjectPlane(po_ptrs[i], true, polyobjsector->ceilingheight, PF_Occlude,
|
||||||
polyobjsector->lightlevel, levelflats[polyobjsector->floorpic].lumpnum,
|
(light == -1 ? gr_frontsector->lightlevel : *gr_frontsector->lightlist[light].lightlevel), levelflats[polyobjsector->floorpic].lumpnum,
|
||||||
polyobjsector, 255, NULL);
|
polyobjsector, 255, (light == -1 ? gr_frontsector->extra_colormap : *gr_frontsector->lightlist[light].extra_colormap));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
10
src/r_bsp.c
10
src/r_bsp.c
|
@ -1088,9 +1088,9 @@ static void R_Subsector(size_t num)
|
||||||
{
|
{
|
||||||
light = R_GetPlaneLight(frontsector, polysec->floorheight, viewz < polysec->floorheight);
|
light = R_GetPlaneLight(frontsector, polysec->floorheight, viewz < polysec->floorheight);
|
||||||
ffloor[numffloors].plane = R_FindPlane(polysec->floorheight, polysec->floorpic,
|
ffloor[numffloors].plane = R_FindPlane(polysec->floorheight, polysec->floorpic,
|
||||||
polysec->lightlevel, polysec->floor_xoffs, polysec->floor_yoffs,
|
(light == -1 ? frontsector->lightlevel : *frontsector->lightlist[light].lightlevel), polysec->floor_xoffs, polysec->floor_yoffs,
|
||||||
polysec->floorpic_angle-po->angle,
|
polysec->floorpic_angle-po->angle,
|
||||||
NULL, NULL, po
|
(light == -1 ? frontsector->extra_colormap : *frontsector->lightlist[light].extra_colormap), NULL, po
|
||||||
#ifdef ESLOPE
|
#ifdef ESLOPE
|
||||||
, NULL // will ffloors be slopable eventually?
|
, NULL // will ffloors be slopable eventually?
|
||||||
#endif
|
#endif
|
||||||
|
@ -1115,10 +1115,10 @@ static void R_Subsector(size_t num)
|
||||||
&& polysec->ceilingheight <= ceilingcenterz
|
&& polysec->ceilingheight <= ceilingcenterz
|
||||||
&& (viewz > polysec->ceilingheight))
|
&& (viewz > polysec->ceilingheight))
|
||||||
{
|
{
|
||||||
light = R_GetPlaneLight(frontsector, polysec->ceilingheight, viewz < polysec->ceilingheight);
|
light = R_GetPlaneLight(frontsector, polysec->floorheight, viewz < polysec->floorheight);
|
||||||
ffloor[numffloors].plane = R_FindPlane(polysec->ceilingheight, polysec->ceilingpic,
|
ffloor[numffloors].plane = R_FindPlane(polysec->ceilingheight, polysec->ceilingpic,
|
||||||
polysec->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,
|
||||||
NULL, NULL, po
|
(light == -1 ? frontsector->extra_colormap : *frontsector->lightlist[light].extra_colormap), NULL, po
|
||||||
#ifdef ESLOPE
|
#ifdef ESLOPE
|
||||||
, NULL // will ffloors be slopable eventually?
|
, NULL // will ffloors be slopable eventually?
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue