diff --git a/src/r_plane.cpp b/src/r_plane.cpp index 429eeeff8..448633248 100644 --- a/src/r_plane.cpp +++ b/src/r_plane.cpp @@ -940,7 +940,7 @@ void R_DrawSinglePlane(drawspandata_t *ds, visplane_t *pl, boolean allow_paralle INT32 type, spanfunctype = BASEDRAWFUNC; debugrender_highlight_t debug = debugrender_highlight_t::SW_HI_PLANES; void (*mapfunc)(drawspandata_t*, void(*)(drawspandata_t*), INT32, INT32, INT32, boolean) = R_MapPlane; - bool highlight = R_PlaneIsHighlighted(pl); + INT16 highlight = R_PlaneIsHighlighted(pl); if (!(pl->minx <= pl->maxx)) return; @@ -952,10 +952,10 @@ void R_DrawSinglePlane(drawspandata_t *ds, visplane_t *pl, boolean allow_paralle // sky flat if (pl->picnum == skyflatnum) { - if (highlight) + if (highlight != -1) { drawcolumndata_t dc = {}; - dc.r8_flatcolor = 35; // red + dc.r8_flatcolor = highlight; dc.lightmap = colormaps; for (dc.x = pl->minx; dc.x <= pl->maxx; ++dc.x) @@ -1021,7 +1021,7 @@ void R_DrawSinglePlane(drawspandata_t *ds, visplane_t *pl, boolean allow_paralle // Hacked up support for alpha value in software mode Tails 09-24-2002 // ...unhacked by toaster 04-01-2021 - if (!highlight) + if (highlight == -1) { INT32 trans = (10*((256+12) - pl->ffloor->alpha))/255; if (trans >= 10) @@ -1221,9 +1221,9 @@ void R_DrawSinglePlane(drawspandata_t *ds, visplane_t *pl, boolean allow_paralle ds->planezlight = zlight[light]; } - if (highlight && R_SetSpanFuncFlat(BASEDRAWFUNC)) + if (highlight != -1 && R_SetSpanFuncFlat(BASEDRAWFUNC)) { - ds->r8_flatcolor = 35; // red + ds->r8_flatcolor = highlight; ds->flatlighting = colormaps; } else @@ -1267,7 +1267,15 @@ void R_PlaneBounds(visplane_t *plane) plane->low = low; } -boolean R_PlaneIsHighlighted(const visplane_t *pl) +INT16 R_PlaneIsHighlighted(const visplane_t *pl) { - return pl->damage == SD_DEATHPIT || pl->damage == SD_INSTAKILL; + switch (pl->damage) + { + case SD_DEATHPIT: + case SD_INSTAKILL: + return 35; // red + + default: + return -1; + } } diff --git a/src/r_plane.h b/src/r_plane.h index 6f116b0c1..9e3ec8647 100644 --- a/src/r_plane.h +++ b/src/r_plane.h @@ -105,7 +105,8 @@ void R_CalculateSlopeVectors(drawspandata_t* ds); // Sets the slope vector pointers for the current tilted span. void R_SetTiltedSpan(drawspandata_t* ds, INT32 span); -boolean R_PlaneIsHighlighted(const visplane_t *pl); +// Returns a palette index or -1 if not highlighted +INT16 R_PlaneIsHighlighted(const visplane_t *pl); struct visffloor_t {