attempt o make fofs in software always cut cyan pixels
if they do contain cyan pixels lel kinda meh, and needs a toggle
This commit is contained in:
1 parent
4c44b70cea
commit
cf10e50063
5 files changed
+36
No files matched your search
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -58,6 +58,7 @@ typedef struct visplane_s
|
||||
pslope_t *slope;
|
||||
|
||||
boolean noencore;
|
||||
boolean cyan;
|
||||
} visplane_t;
|
||||
|
||||
extern visplane_t *visplanes[MAXVISPLANES];
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in new issue
Block a user