clean up some frameflags stuff

mfw no FF_VERTICALFLIP
This commit is contained in:
alufolie91 committed 2026-07-04 20:16:54 +02:00
1 parent a98b408ba2
commit aa4ec45829
5 files changed
+50 -17

No files matched your search

+10 -11
View File
@@ -3733,7 +3733,7 @@ static void HWR_SplitSprite(gl_vissprite_t *spr, const boolean papersprite)
wallVerts[1].z = baseWallVerts[2].z + (baseWallVerts[2].z - baseWallVerts[1].z) * heightmult;
}
HWR_Lighting(&Surf, lightlevel, colormap, P_SectorUsesDirectionalLighting(sector) && !(sprmo->frame & FF_FULLBRIGHT));
HWR_Lighting(&Surf, lightlevel, colormap, P_SectorUsesDirectionalLighting(sector) && !R_ThingIsFullBright(sprmo));
Surf.PolyColor.s.alpha = alpha;
@@ -3787,7 +3787,7 @@ static void HWR_DrawSprite(gl_vissprite_t *spr)
if (!sprmo->subsector)
return;
const boolean papersprite = (sprmo->frame & FF_PAPERSPRITE);
const boolean papersprite = R_ThingIsPaperSprite(sprmo);
const sector_t *sector = sprmo->subsector->sector;
if (sector->numlights)
@@ -3946,7 +3946,7 @@ static void HWR_DrawPrecipitationSprite(gl_vissprite_t *spr)
INT32 shader = SHADER_NONE;
const precipmobj_t *sprmo = spr->precip;
precipmobj_t *sprmo = spr->precip;
if (!sprmo->subsector)
return;
@@ -3992,11 +3992,10 @@ static void HWR_DrawPrecipitationSprite(gl_vissprite_t *spr)
if (sector->numlights)
{
INT32 light;
// Always use the light at the top instead of whatever I was doing before
INT32 light = R_GetPlaneLight(sector, sprmo->z, false); // sprmo->z + sprmo->height
light = R_GetPlaneLight(sector, sprmo->z, false); // Always use the light at the top instead of whatever I was doing before
if (!(sprmo->frame & FF_FULLBRIGHT))
if (!R_PrecipThingIsFullBright(sprmo))
lightlevel = static_cast<INT32>(*sector->lightlist[light].lightlevel);
if (sector->lightlist[light].extra_colormap)
@@ -4004,7 +4003,7 @@ static void HWR_DrawPrecipitationSprite(gl_vissprite_t *spr)
}
else
{
if (!(sprmo->frame & FF_FULLBRIGHT))
if (!R_PrecipThingIsFullBright(sprmo))
lightlevel = static_cast<INT32>(sector->lightlevel);
if (sector->extra_colormap)
@@ -4588,7 +4587,7 @@ static void HWR_ProjectSprite(mobj_t *thing)
return;
}
const boolean papersprite = (thing->frame & FF_PAPERSPRITE);
const boolean papersprite = R_ThingIsPaperSprite(thing);
// transform the origin point
tr_x = FixedToFloat(interp.x);
@@ -4602,8 +4601,8 @@ static void HWR_ProjectSprite(mobj_t *thing)
return;
const boolean mirrored = thing->mirrored;
const boolean vflip = (thing->eflags & MFE_VERTICALFLIP);
const boolean hflip = (!(thing->frame & FF_HORIZONTALFLIP) != !mirrored);
const boolean vflip = R_ThingVerticallyFlipped(thing);
const boolean hflip = (!R_ThingHorizontallyFlipped(thing) != !mirrored);
// decide which patch to use for sprite relative to player
#ifdef RANGECHECK
+4 -1
View File
@@ -1153,8 +1153,11 @@ void HWR_DrawMD2(gl_vissprite_t *spr)
INT32 durs = spr->mobj->state->tics;
INT32 tics = spr->mobj->tics;
//mdlframe_t *next = NULL;
//const UINT8 flip = (UINT8)(!(spr->mobj->eflags & MFE_VERTICALFLIP) != !R_ThingVerticallyFlipped(spr->mobj)); // :chaosleep:
const UINT8 flip = (UINT8)((spr->mobj->eflags & MFE_VERTICALFLIP) == MFE_VERTICALFLIP);
const UINT8 hflip = (UINT8)(!(spr->mobj->mirrored) != !(spr->mobj->frame & FF_HORIZONTALFLIP));
const UINT8 hflip = (UINT8)(!(spr->mobj->mirrored) != !R_ThingHorizontallyFlipped(spr->mobj));
spritedef_t *sprdef;
spriteframe_t *sprframe;
spriteinfo_t *sprinfo;
+1 -1
View File
@@ -411,7 +411,7 @@ angle_t R_PlayerSliptideAngle(player_t *player)
if (!sprframe)
return 0;
if (sprframe->rotate != SRF_SINGLE || (mo->frame & FF_PAPERSPRITE))
if (sprframe->rotate != SRF_SINGLE || R_ThingIsPaperSprite(mo))
ang = R_PointToAngle(mo->x, mo->y) - mo->angle;
return FixedMul(FINECOSINE((ang) >> ANGLETOFINESHIFT), mo->player->sliproll * mo->player->kartstuff[k_aizdriftstrat]);
+30 -4
View File
@@ -1241,9 +1241,9 @@ static void R_ProjectSprite(mobj_t *thing)
return;
const boolean mirrored = thing->mirrored;
const boolean vflip = (thing->eflags & MFE_VERTICALFLIP);
const boolean hflip = (!(thing->frame & FF_HORIZONTALFLIP) != !mirrored);
const boolean papersprite = (thing->frame & FF_PAPERSPRITE);
const boolean vflip = R_ThingVerticallyFlipped(thing);
const boolean hflip = (!R_ThingHorizontallyFlipped(thing) != !mirrored);
const boolean papersprite = R_ThingIsPaperSprite(thing);
// transform the origin point
tr_x = interp.x - viewx;
@@ -3030,11 +3030,37 @@ boolean R_CheckMobjInterpDist(mobj_t *thing)
return R_CheckInterpDist(thing);
}
boolean R_ThingIsFullBright(mobj_t *thing)
boolean R_ThingHorizontallyFlipped(mobj_t *thing)
{
return (thing->frame & FF_HORIZONTALFLIP);
}
boolean R_ThingVerticallyFlipped(mobj_t *thing)
{
return (thing->eflags & MFE_VERTICALFLIP); //(thing->frame & FF_VERTICALFLIP);
}
boolean R_ThingIsPaperSprite(mobj_t *thing)
{
return (thing->frame & FF_PAPERSPRITE);
}
template<typename T>
boolean R_ThingIsFullBrightT(T *thing)
{
return ((thing->frame & FF_BRIGHTMASK) == FF_FULLBRIGHT);
}
boolean R_PrecipThingIsFullBright(precipmobj_t *thing)
{
return R_ThingIsFullBrightT(thing);
}
boolean R_ThingIsFullBright(mobj_t *thing)
{
return R_ThingIsFullBrightT(thing);
}
boolean R_ThingIsSemiBright(mobj_t *thing)
{
return ((thing->frame & FF_BRIGHTMASK) == FF_SEMIBRIGHT);
+5
View File
@@ -88,6 +88,11 @@ boolean R_CheckPrecipMobjInterpDist(precipmobj_t *thing);
boolean R_CheckMobjInterpDist(mobj_t *thing);
fixed_t R_DoPlayerFade(mobj_t *thing);
boolean R_ThingHorizontallyFlipped(mobj_t *thing);
boolean R_ThingVerticallyFlipped(mobj_t *thing);
boolean R_ThingIsPaperSprite(mobj_t *thing);
boolean R_PrecipThingIsFullBright(precipmobj_t *thing);
boolean R_ThingIsFullBright(mobj_t *thing);
boolean R_ThingIsSemiBright(mobj_t *thing);
boolean R_ThingIsFullDark(mobj_t *thing);