diff --git a/src/p_setup.c b/src/p_setup.c index 69d7b3caa..85e4d16ab 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -689,6 +689,19 @@ INT32 P_AddLevelFlat(const char *flatname, levelflat_t *levelflat) } #endif + { + UINT8 *flat = (UINT8 *)W_CacheLumpNum(levelflat->lumpnum, PU_LEVEL); + size_t size = W_LumpLength(levelflat->lumpnum); + for (size_t steppy = 0; steppy < size; steppy++) + { + if (flat[steppy] == TRANSPARENTPIXEL) + { + levelflat->cyan = true; + break; + } + } + } + #ifndef ZDEBUG CONS_Debug(DBG_SETUP, "flat #%03d: %s\n", atoi(sizeu1(numlevelflats)), levelflat->name); #endif @@ -734,6 +747,19 @@ INT32 P_AddLevelFlatRuntime(const char *flatname) levelflat->lumpnum = R_GetFlatNumForName(flatname); levelflat->baselumpnum = LUMPERROR; + { + UINT8 *flat = (UINT8 *)W_CacheLumpNum(levelflat->lumpnum, PU_LEVEL); + size_t size = W_LumpLength(levelflat->lumpnum); + for (size_t steppy = 0; steppy < size; steppy++) + { + if (flat[steppy] == TRANSPARENTPIXEL) + { + levelflat->cyan = true; + break; + } + } + } + #ifndef ZDEBUG CONS_Debug(DBG_SETUP, "flat #%03d: %s\n", atoi(sizeu1(numlevelflats)), levelflat->name); #endif diff --git a/src/p_setup.h b/src/p_setup.h index aa8d90447..8542aa8dc 100644 --- a/src/p_setup.h +++ b/src/p_setup.h @@ -52,6 +52,7 @@ typedef struct INT32 animseq; // start pos. in the anim sequence INT32 numpics; INT32 speed; + boolean cyan; } levelflat_t; extern size_t numlevelflats; diff --git a/src/r_plane.cpp b/src/r_plane.cpp index 1d4b1e2d1..57a2d2887 100644 --- a/src/r_plane.cpp +++ b/src/r_plane.cpp @@ -500,6 +500,7 @@ visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel, check->polyobj = polyobj; check->slope = slope; check->noencore = noencore; + check->cyan = levelflats[picnum].cyan; memset(check->top, 0xff, sizeof(*check->top) * viewwidth); memset(check->bottom, 0x00, sizeof(*check->bottom) * viewwidth); @@ -576,6 +577,7 @@ visplane_t *R_CheckPlane(visplane_t *pl, INT32 start, INT32 stop) new_pl->polyobj = pl->polyobj; new_pl->slope = pl->slope; new_pl->noencore = pl->noencore; + new_pl->cyan = pl->cyan; pl = new_pl; pl->minx = start; pl->maxx = stop; @@ -1024,6 +1026,9 @@ void R_DrawSinglePlane(drawspandata_t* ds, visplane_t *pl, boolean allow_paralle } } + if (pl->cyan && !(pl->ffloor->flags & FF_RIPPLE)) + spanfunctype = SPANDRAWFUNC_SPLAT; + if (pl->ffloor->flags & FF_TRANSLUCENT) { spanfunctype = SPANDRAWFUNC_TRANS; diff --git a/src/r_plane.h b/src/r_plane.h index 35e3f2b08..f330baa3d 100644 --- a/src/r_plane.h +++ b/src/r_plane.h @@ -58,6 +58,7 @@ typedef struct visplane_s pslope_t *slope; boolean noencore; + boolean cyan; } visplane_t; extern visplane_t *visplanes[MAXVISPLANES]; diff --git a/src/r_segs.cpp b/src/r_segs.cpp index b0edd3285..5e3416ef2 100644 --- a/src/r_segs.cpp +++ b/src/r_segs.cpp @@ -585,6 +585,9 @@ static void R_DrawRepeatMaskedColumn(drawcolumndata_t* dc, column_t *col) // Returns true if a fake floor is translucent. static boolean R_IsFFloorTranslucent(visffloor_t *pfloor) { + if (pfloor->plane->cyan) + return true; + if (pfloor->polyobj) return true;