Change all remaining instances (hopefully) of UINT32 to fixed_t for alpha

This commit is contained in:
MIDIMan 2024-03-02 09:51:28 -05:00
parent 5668e02857
commit 509adc3454
3 changed files with 8 additions and 8 deletions

View file

@ -3000,7 +3000,7 @@ static void HWR_SplitSprite(gl_vissprite_t *spr)
// co-ordinates // co-ordinates
memcpy(wallVerts, baseWallVerts, sizeof(baseWallVerts)); memcpy(wallVerts, baseWallVerts, sizeof(baseWallVerts));
UINT32 newalpha = spr->mobj->alpha; fixed_t newalpha = spr->mobj->alpha;
// if sprite has linkdraw, then dont write to z-buffer (by not using PF_Occlude) // if sprite has linkdraw, then dont write to z-buffer (by not using PF_Occlude)
// this will result in sprites drawn afterwards to be drawn on top like intended when using linkdraw. // this will result in sprites drawn afterwards to be drawn on top like intended when using linkdraw.
@ -3495,7 +3495,7 @@ static void HWR_DrawSprite(gl_vissprite_t *spr)
FBITFIELD blend = 0; FBITFIELD blend = 0;
FBITFIELD occlusion; FBITFIELD occlusion;
boolean use_linkdraw_hack = false; boolean use_linkdraw_hack = false;
UINT32 newalpha = spr->mobj->alpha; fixed_t newalpha = spr->mobj->alpha;
// if sprite has linkdraw, then dont write to z-buffer (by not using PF_Occlude) // if sprite has linkdraw, then dont write to z-buffer (by not using PF_Occlude)
// this will result in sprites drawn afterwards to be drawn on top like intended when using linkdraw. // this will result in sprites drawn afterwards to be drawn on top like intended when using linkdraw.

View file

@ -763,7 +763,7 @@ UINT8 *R_GetTranslationForThing(mobj_t *mobj, skincolornum_t color, UINT16 trans
return NULL; return NULL;
} }
transnum_t R_GetTransmapFromAlpha(UINT32 alpha, transnum_t transmap) transnum_t R_GetTransmapFromAlpha(fixed_t alpha, transnum_t transmap)
{ {
INT32 value = 10 - transmap; INT32 value = 10 - transmap;
value = 10 - (FixedCeil(alpha * value)>>FRACBITS); value = 10 - (FixedCeil(alpha * value)>>FRACBITS);
@ -1276,7 +1276,7 @@ static void R_ProjectDropShadow(mobj_t *thing, vissprite_t *vis, fixed_t scale,
floordiff = abs((isflipped ? interp.height : 0) + interp.z - groundz); floordiff = abs((isflipped ? interp.height : 0) + interp.z - groundz);
trans = floordiff / (100*FRACUNIT) + 3; trans = floordiff / (100*FRACUNIT) + 3;
trans = R_GetTransmapFromAlpha((UINT32)thing->alpha, trans); trans = R_GetTransmapFromAlpha(thing->alpha, trans);
if (trans >= 9) return; if (trans >= 9) return;
scalemul = FixedMul(FRACUNIT - floordiff/640, scale); scalemul = FixedMul(FRACUNIT - floordiff/640, scale);
@ -1963,9 +1963,9 @@ static void R_ProjectSprite(mobj_t *thing)
trans = 0; trans = 0;
if ((oldthing->flags2 & MF2_LINKDRAW) && oldthing->tracer) if ((oldthing->flags2 & MF2_LINKDRAW) && oldthing->tracer)
trans = R_GetTransmapFromAlpha((UINT32)oldthing->tracer->alpha, trans); trans = R_GetTransmapFromAlpha(oldthing->tracer->alpha, trans);
else else
trans = R_GetTransmapFromAlpha((UINT32)oldthing->alpha, trans); trans = R_GetTransmapFromAlpha(oldthing->alpha, trans);
// Check if this sprite needs to be rendered like a shadow // Check if this sprite needs to be rendered like a shadow
shadowdraw = (!!(thing->renderflags & RF_SHADOWDRAW) && !(papersprite || splat)); shadowdraw = (!!(thing->renderflags & RF_SHADOWDRAW) && !(papersprite || splat));
@ -3428,7 +3428,7 @@ boolean R_ThingVisible (mobj_t *thing)
(thing->sprite == SPR_NULL) || // Don't draw null-sprites (thing->sprite == SPR_NULL) || // Don't draw null-sprites
(thing->flags2 & MF2_DONTDRAW) || // Don't draw MF2_LINKDRAW objects (thing->flags2 & MF2_DONTDRAW) || // Don't draw MF2_LINKDRAW objects
(thing->drawonlyforplayer && thing->drawonlyforplayer != viewplayer) || // Don't draw other players' personal objects (thing->drawonlyforplayer && thing->drawonlyforplayer != viewplayer) || // Don't draw other players' personal objects
((rendermode == render_soft && R_GetTransmapFromAlpha((UINT32)thing->alpha, (thing->frame & FF_TRANSMASK)>>FF_TRANSSHIFT) >= 10) || ((rendermode == render_soft && R_GetTransmapFromAlpha(thing->alpha, (thing->frame & FF_TRANSMASK)>>FF_TRANSSHIFT) >= 10) ||
(rendermode == render_opengl && thing->alpha == 0)) || (rendermode == render_opengl && thing->alpha == 0)) ||
(!P_MobjWasRemoved(r_viewmobj) && ( (!P_MobjWasRemoved(r_viewmobj) && (
(r_viewmobj == thing) || // Don't draw first-person players or awayviewmobj objects (r_viewmobj == thing) || // Don't draw first-person players or awayviewmobj objects

View file

@ -90,7 +90,7 @@ boolean R_ThingIsFullDark (mobj_t *thing);
boolean R_ThingIsFlashing (mobj_t *thing); boolean R_ThingIsFlashing (mobj_t *thing);
UINT8 *R_GetTranslationForThing(mobj_t *mobj, skincolornum_t color, UINT16 translation); UINT8 *R_GetTranslationForThing(mobj_t *mobj, skincolornum_t color, UINT16 translation);
transnum_t R_GetTransmapFromAlpha(UINT32 alpha, transnum_t transmap); transnum_t R_GetTransmapFromAlpha(fixed_t alpha, transnum_t transmap);
void R_ThingOffsetOverlay (mobj_t *thing, fixed_t *outx, fixed_t *outy); void R_ThingOffsetOverlay (mobj_t *thing, fixed_t *outx, fixed_t *outy);