From 4865e7109c69ccd621190ff6ab3612dd6a0b7b68 Mon Sep 17 00:00:00 2001 From: Major Cooke Date: Wed, 28 Sep 2016 21:20:15 -0500 Subject: [PATCH 1/3] Fixed merge conflicts. --- src/p_pspr.cpp | 97 +++++++++++++++++++++++++++------- src/p_pspr.h | 14 +++-- src/r_things.cpp | 37 ++++++++++--- wadsrc/static/actors/actor.txt | 7 ++- 4 files changed, 123 insertions(+), 32 deletions(-) diff --git a/src/p_pspr.cpp b/src/p_pspr.cpp index fab7e38d8d..4c9872993b 100644 --- a/src/p_pspr.cpp +++ b/src/p_pspr.cpp @@ -111,14 +111,16 @@ END_POINTERS //------------------------------------------------------------------------ DPSprite::DPSprite(player_t *owner, AActor *caller, int id) -: x(.0), y(.0), - oldx(.0), oldy(.0), - firstTic(true), - Flags(0), - Caller(caller), - Owner(owner), - ID(id), - processPending(true) +: x(.0), y(.0), + oldx(.0), oldy(.0), + alpha(1.), + firstTic(true), + Flags(0), + Caller(caller), + Owner(owner), + ID(id), + processPending(true), + RenderStyle(STYLE_Normal) { DPSprite *prev = nullptr; DPSprite *next = Owner->psprites; @@ -967,7 +969,7 @@ void A_OverlayOffset(AActor *self, int layer, double wx, double wy, int flags) player_t *player = self->player; DPSprite *psp; - if (player && (player->playerstate != PST_DEAD)) + if (player) { psp = player->FindPSprite(layer); @@ -1051,22 +1053,80 @@ DEFINE_ACTION_FUNCTION(AActor, A_OverlayFlags) //--------------------------------------------------------------------------- // -// PROC OverlayID -// Because non-action functions cannot acquire the ID of the overlay... +// PROC A_OverlayAlpha +// //--------------------------------------------------------------------------- -DEFINE_ACTION_FUNCTION(AActor, OverlayID) +DEFINE_ACTION_FUNCTION(AActor, A_OverlayAlpha) { PARAM_ACTION_PROLOGUE; + PARAM_INT(layer); + PARAM_FLOAT(alphaset); - if (ACTION_CALL_FROM_PSPRITE()) - { - ACTION_RETURN_INT(stateinfo->mPSPIndex); - } - ACTION_RETURN_INT(0); + if (self->player == nullptr) + return 0; + + DPSprite *pspr = self->player->FindPSprite(layer); + + if (pspr == nullptr) + return 0; + + pspr->alpha = clamp(alphaset, 0.0, 1.0); + + return 0; } +// NON-ACTION function to get the overlay alpha of a layer. +DEFINE_ACTION_FUNCTION(AActor, OverlayAlpha) +{ + if (numret > 0) + { + assert(ret != nullptr); + PARAM_SELF_PROLOGUE(AActor); + PARAM_INT(layer); + if (self->player == nullptr) + return 0; + + DPSprite *pspr = self->player->FindPSprite(layer); + + if (pspr == nullptr) + { + ret->SetFloat(0.0); + } + else + { + ret->SetFloat(pspr->alpha); + } + return 1; + } + return 0; +} + +//--------------------------------------------------------------------------- +// +// PROC A_OverlayRenderStyle +// +//--------------------------------------------------------------------------- + +DEFINE_ACTION_FUNCTION(AActor, A_OverlayRenderStyle) +{ + PARAM_ACTION_PROLOGUE; + PARAM_INT(layer); + PARAM_INT(style); + + if (self->player == nullptr) + return 0; + + DPSprite *pspr = self->player->FindPSprite(layer); + + if (pspr == nullptr || style >= STYLE_Count) + return 0; + + pspr->RenderStyle = style; + + return 0; +} //--------------------------------------------------------------------------- // @@ -1483,7 +1543,8 @@ void DPSprite::Serialize(FSerializer &arc) ("x", x) ("y", y) ("oldx", oldx) - ("oldy", oldy); + ("oldy", oldy) + ("alpha", alpha); } //------------------------------------------------------------------------ diff --git a/src/p_pspr.h b/src/p_pspr.h index 7e51096577..86f484a3a4 100644 --- a/src/p_pspr.h +++ b/src/p_pspr.h @@ -53,10 +53,13 @@ enum PSPLayers enum PSPFlags { - PSPF_ADDWEAPON = 1 << 0, - PSPF_ADDBOB = 1 << 1, - PSPF_POWDOUBLE = 1 << 2, - PSPF_CVARFAST = 1 << 3, + PSPF_ADDWEAPON = 1 << 0, + PSPF_ADDBOB = 1 << 1, + PSPF_POWDOUBLE = 1 << 2, + PSPF_CVARFAST = 1 << 3, + PSPF_ALPHA = 1 << 4, + PSPF_RENDERSTYLE = 1 << 5, + PSPF_FLIP = 1 << 6, }; class DPSprite : public DObject @@ -77,11 +80,12 @@ public: AActor* GetCaller() { return Caller; } void SetCaller(AActor *newcaller) { Caller = newcaller; } - double x, y; + double x, y, alpha; double oldx, oldy; bool firstTic; int Tics; int Flags; + int RenderStyle; private: DPSprite () {} diff --git a/src/r_things.cpp b/src/r_things.cpp index a45a6826a7..0c49a2dc2c 100644 --- a/src/r_things.cpp +++ b/src/r_things.cpp @@ -1290,7 +1290,7 @@ void R_AddSprites (sector_t *sec, int lightlevel, int fakeside) // // R_DrawPSprite // -void R_DrawPSprite(DPSprite *pspr, AActor *owner, float bobx, float boby, double wx, double wy, double ticfrac) +void R_DrawPSprite(DPSprite *pspr, AActor *owner, float bobx, float boby, double wx, double wy, double ticfrac, double alpha) { double tx; int x1; @@ -1326,7 +1326,7 @@ void R_DrawPSprite(DPSprite *pspr, AActor *owner, float bobx, float boby, double flip = sprframe->Flip & 1; tex = TexMan(picnum); - if (tex->UseType == FTexture::TEX_Null) + if (tex->UseType == FTexture::TEX_Null || pspr->RenderStyle == STYLE_None) return; if (pspr->firstTic) @@ -1363,10 +1363,10 @@ void R_DrawPSprite(DPSprite *pspr, AActor *owner, float bobx, float boby, double tx += tex->GetScaledWidth(); x2 = xs_RoundToInt(CenterX + tx * pspritexscale); - + // off the left side if (x2 <= 0) - return; + return; // store information in a vissprite vis = &avis[vispspindex]; @@ -1404,7 +1404,9 @@ void R_DrawPSprite(DPSprite *pspr, AActor *owner, float bobx, float boby, double vis->pic = tex; vis->ColormapNum = 0; - if (flip) + // If flip is used, provided that it's not already flipped (that would just invert itself) + // (It's an XOR...) + if (!(flip) != !(pspr->Flags & PSPF_FLIP)) { vis->xiscale = -FLOAT2FIXED(pspritexiscale * tex->Scale.X); vis->startfrac = (tex->GetWidth() << FRACBITS) - 1; @@ -1422,8 +1424,26 @@ void R_DrawPSprite(DPSprite *pspr, AActor *owner, float bobx, float boby, double FDynamicColormap *colormap_to_use = nullptr; if (pspr->GetID() < PSP_TARGETCENTER) { - vis->Style.Alpha = float(owner->Alpha); - vis->Style.RenderStyle = owner->RenderStyle; + // Set the alpha based on if using the overlay's own or not. + vis->Style.Alpha = (pspr->Flags & PSPF_ALPHA) ? float(alpha) : float(owner->Alpha); + + // Set the render style + if (pspr->Flags & PSPF_RENDERSTYLE) + { + const int rs = clamp(pspr->RenderStyle, 0, STYLE_Count); + + if (rs == STYLE_Normal && vis->Style.Alpha < 1.0) + vis->Style.RenderStyle = LegacyRenderStyles[STYLE_Translucent]; + else + vis->Style.RenderStyle = LegacyRenderStyles[rs]; + } + else + { + if (owner->RenderStyle == LegacyRenderStyles[STYLE_Normal] && vis->Style.Alpha < 1.0) + vis->Style.RenderStyle = LegacyRenderStyles[STYLE_Translucent]; + else + vis->Style.RenderStyle = owner->RenderStyle; + } // The software renderer cannot invert the source without inverting the overlay // too. That means if the source is inverted, we need to do the reverse of what @@ -1657,9 +1677,10 @@ void R_DrawPlayerSprites () // It's possible this psprite's caller is now null but the layer itself hasn't been destroyed // because it didn't tick yet (if we typed 'take all' while in the console for example). // In this case let's simply not draw it to avoid crashing. + if ((psp->GetID() != PSP_TARGETCENTER || CrosshairImage == nullptr) && psp->GetCaller() != nullptr) { - R_DrawPSprite(psp, camera, bobx, boby, wx, wy, r_TicFracF); + R_DrawPSprite(psp, camera, bobx, boby, wx, wy, r_TicFracF, psp->alpha); } psp = psp->GetNext(); diff --git a/wadsrc/static/actors/actor.txt b/wadsrc/static/actors/actor.txt index 44b801f511..77c60bbca1 100644 --- a/wadsrc/static/actors/actor.txt +++ b/wadsrc/static/actors/actor.txt @@ -59,6 +59,9 @@ ACTOR Actor native //: Thinker native int GetMissileDamage(int mask, int add, int ptr = AAPTR_DEFAULT); action native int OverlayID(); + // Overlay Functions + native float OverlayAlpha(int layer); + // Action functions // Meh, MBF redundant functions. Only for DeHackEd support. action native A_Turn(float angle = 0); @@ -340,7 +343,6 @@ ACTOR Actor native //: Thinker native state A_CheckSightOrRange(float distance, state label, bool two_dimension = false); native state A_CheckRange(float distance, state label, bool two_dimension = false); action native bool A_FaceMovementDirection(float offset = 0, float anglelimit = 0, float pitchlimit = 0, int flags = 0, int ptr = AAPTR_DEFAULT); - action native int A_ClearOverlays(int sstart = 0, int sstop = 0, bool safety = true); action native bool A_CopySpriteFrame(int from, int to, int flags = 0); action native bool A_SetSpriteAngle(float angle = 0, int ptr = AAPTR_DEFAULT); action native bool A_SetSpriteRotation(float angle = 0, int ptr = AAPTR_DEFAULT); @@ -352,9 +354,12 @@ ACTOR Actor native //: Thinker action native A_CopyFriendliness(int ptr_source = AAPTR_MASTER); action native bool A_Overlay(int layer, state start = "", bool nooverride = false); + action native int A_ClearOverlays(int sstart = 0, int sstop = 0, bool safety = true); action native A_WeaponOffset(float wx = 0, float wy = 32, int flags = 0); action native A_OverlayOffset(int layer = PSP_WEAPON, float wx = 0, float wy = 32, int flags = 0); action native A_OverlayFlags(int layer, int flags, bool set); + action native A_OverlayAlpha(int layer, float alphaset); + action native A_OverlayRenderStyle(int layer, int style); native int ACS_NamedExecute(name script, int mapnum=0, int arg1=0, int arg2=0, int arg3=0); native int ACS_NamedSuspend(name script, int mapnum=0); From 8cfeca655db95a917b8674609ba085fc71fbc9e8 Mon Sep 17 00:00:00 2001 From: Major Cooke Date: Thu, 29 Sep 2016 11:10:15 -0500 Subject: [PATCH 2/3] Added priority renderstyles, and added PSPF_FORCE(ALPHA / STYLE). - Renderstyles now override alpha based on which is used. - The new flags will override whatever renderstyle and alpha is currently being utilized. --- src/p_pspr.h | 2 + src/r_things.cpp | 97 +++++++++++++++++++++++++++--- wadsrc/static/actors/constants.txt | 13 ++-- 3 files changed, 98 insertions(+), 14 deletions(-) diff --git a/src/p_pspr.h b/src/p_pspr.h index 86f484a3a4..6a782f8e07 100644 --- a/src/p_pspr.h +++ b/src/p_pspr.h @@ -60,6 +60,8 @@ enum PSPFlags PSPF_ALPHA = 1 << 4, PSPF_RENDERSTYLE = 1 << 5, PSPF_FLIP = 1 << 6, + PSPF_FORCEALPHA = 1 << 7, + PSPF_FORCESTYLE = 1 << 8, }; class DPSprite : public DObject diff --git a/src/r_things.cpp b/src/r_things.cpp index 0c49a2dc2c..c8d0eacdc4 100644 --- a/src/r_things.cpp +++ b/src/r_things.cpp @@ -1424,27 +1424,104 @@ void R_DrawPSprite(DPSprite *pspr, AActor *owner, float bobx, float boby, double FDynamicColormap *colormap_to_use = nullptr; if (pspr->GetID() < PSP_TARGETCENTER) { - // Set the alpha based on if using the overlay's own or not. - vis->Style.Alpha = (pspr->Flags & PSPF_ALPHA) ? float(alpha) : float(owner->Alpha); + // [MC] Set the render style - // Set the render style if (pspr->Flags & PSPF_RENDERSTYLE) { const int rs = clamp(pspr->RenderStyle, 0, STYLE_Count); - - if (rs == STYLE_Normal && vis->Style.Alpha < 1.0) - vis->Style.RenderStyle = LegacyRenderStyles[STYLE_Translucent]; + + if (pspr->Flags & PSPF_FORCESTYLE) + { + if (rs == STYLE_Normal && vis->Style.Alpha < 1.0) + { + vis->Style.RenderStyle = LegacyRenderStyles[STYLE_Translucent]; + } + else + { + vis->Style.RenderStyle = LegacyRenderStyles[rs]; + } + } + else if (owner->RenderStyle == LegacyRenderStyles[STYLE_Fuzzy]) + { + vis->Style.RenderStyle = LegacyRenderStyles[STYLE_Fuzzy]; + } + else if (owner->RenderStyle == LegacyRenderStyles[STYLE_OptFuzzy]) + { + vis->Style.RenderStyle = LegacyRenderStyles[STYLE_OptFuzzy]; + vis->Style.RenderStyle.CheckFuzz(); + } + else if (owner->RenderStyle == LegacyRenderStyles[STYLE_Subtract]) + { + vis->Style.RenderStyle = LegacyRenderStyles[STYLE_Subtract]; + } else + { vis->Style.RenderStyle = LegacyRenderStyles[rs]; + } } else { - if (owner->RenderStyle == LegacyRenderStyles[STYLE_Normal] && vis->Style.Alpha < 1.0) - vis->Style.RenderStyle = LegacyRenderStyles[STYLE_Translucent]; - else - vis->Style.RenderStyle = owner->RenderStyle; + vis->Style.RenderStyle = owner->RenderStyle; } + // Set the alpha based on if using the overlay's own or not. Also adjust + // and override the alpha if not forced. + if (pspr->Flags & PSPF_ALPHA) + { + if (pspr->Flags & PSPF_FORCEALPHA) + { + vis->Style.Alpha = float(alpha); + } + else if (vis->Style.RenderStyle == LegacyRenderStyles[STYLE_Fuzzy]) + { + vis->Style.Alpha = float(owner->Alpha); + } + else if (vis->Style.RenderStyle == LegacyRenderStyles[STYLE_OptFuzzy]) + { + FRenderStyle style = vis->Style.RenderStyle; + style.CheckFuzz(); + switch (style.BlendOp) + { + default: + vis->Style.Alpha = float(alpha * owner->Alpha); + break; + case STYLEOP_Fuzz: + case STYLEOP_Sub: + vis->Style.Alpha = float(owner->Alpha); + break; + } + + } + else if (vis->Style.RenderStyle == LegacyRenderStyles[STYLE_Subtract]) + { + vis->Style.Alpha = float(owner->Alpha); + } + else if (vis->Style.RenderStyle == LegacyRenderStyles[STYLE_Add] || + vis->Style.RenderStyle == LegacyRenderStyles[STYLE_Translucent] || + vis->Style.RenderStyle == LegacyRenderStyles[STYLE_TranslucentStencil] || + vis->Style.RenderStyle == LegacyRenderStyles[STYLE_AddStencil] || + vis->Style.RenderStyle == LegacyRenderStyles[STYLE_AddShaded]) + { + vis->Style.Alpha = float(alpha * owner->Alpha); + } + else + { + vis->Style.Alpha = float(owner->Alpha); + } + } + + // Should normal renderstyle come out on top at the end and we desire alpha, + // switch it to translucent. Normal never applies any sort of alpha. + if ((pspr->Flags & PSPF_ALPHA) && + vis->Style.RenderStyle == LegacyRenderStyles[STYLE_Normal] && + vis->Style.Alpha < 1.0) + { + vis->Style.RenderStyle = LegacyRenderStyles[STYLE_Translucent]; + vis->Style.Alpha = (pspr->Flags & PSPF_FORCEALPHA) ? float(alpha) : float(alpha * owner->Alpha); + } + + //----------------------------------------------------------------------------- + // The software renderer cannot invert the source without inverting the overlay // too. That means if the source is inverted, we need to do the reverse of what // the invert overlay flag says to do. diff --git a/wadsrc/static/actors/constants.txt b/wadsrc/static/actors/constants.txt index dce2488c25..35f39a39d8 100644 --- a/wadsrc/static/actors/constants.txt +++ b/wadsrc/static/actors/constants.txt @@ -594,10 +594,15 @@ enum // Flags for psprite layers enum { - PSPF_ADDWEAPON = 1 << 0, - PSPF_ADDBOB = 1 << 1, - PSPF_POWDOUBLE = 1 << 2, - PSPF_CVARFAST = 1 << 3, + PSPF_ADDWEAPON = 1 << 0, + PSPF_ADDBOB = 1 << 1, + PSPF_POWDOUBLE = 1 << 2, + PSPF_CVARFAST = 1 << 3, + PSPF_ALPHA = 1 << 4, + PSPF_RENDERSTYLE = 1 << 5, + PSPF_FLIP = 1 << 6, + PSPF_FORCEALPHA = 1 << 7, + PSPF_FORCESTYLE = 1 << 8, }; // Default psprite layers From d597af149494337e1a4ef6f3a17ea67a59bad61b Mon Sep 17 00:00:00 2001 From: Major Cooke Date: Mon, 3 Oct 2016 13:14:48 -0500 Subject: [PATCH 3/3] - Fixed a few corner cases where forcing alpha wouldn't work. - On the other hand, soultrans, fuzzy and stencil (as is, not including the mixing styles like stenciladd) are no longer accounted for by FORCEALPHA. --- src/r_data/renderstyle.h | 3 +++ src/r_draw.cpp | 6 ++++- src/r_things.cpp | 58 ++++++++++++++++++++++++---------------- 3 files changed, 43 insertions(+), 24 deletions(-) diff --git a/src/r_data/renderstyle.h b/src/r_data/renderstyle.h index 501c14c5f9..63e0856cd7 100644 --- a/src/r_data/renderstyle.h +++ b/src/r_data/renderstyle.h @@ -125,6 +125,9 @@ enum ERenderFlags // Actors only: Ignore sector fade and fade to black. To fade to white, // combine this with STYLEF_InvertOverlay. STYLEF_FadeToBlack = 64, + + // Force alpha. + STYLEF_ForceAlpha = 128, }; union FRenderStyle diff --git a/src/r_draw.cpp b/src/r_draw.cpp index 80b91ed2d4..d0d1013aea 100644 --- a/src/r_draw.cpp +++ b/src/r_draw.cpp @@ -2373,7 +2373,11 @@ ESPSResult R_SetPatchStyle (FRenderStyle style, fixed_t alpha, int translation, color = 0; } - if (style.Flags & STYLEF_TransSoulsAlpha) + if (style.Flags & STYLEF_ForceAlpha) + { + alpha = clamp(alpha, 0, OPAQUE); + } + else if (style.Flags & STYLEF_TransSoulsAlpha) { alpha = fixed_t(transsouls * OPAQUE); } diff --git a/src/r_things.cpp b/src/r_things.cpp index c8d0eacdc4..8f0f808f50 100644 --- a/src/r_things.cpp +++ b/src/r_things.cpp @@ -1290,7 +1290,7 @@ void R_AddSprites (sector_t *sec, int lightlevel, int fakeside) // // R_DrawPSprite // -void R_DrawPSprite(DPSprite *pspr, AActor *owner, float bobx, float boby, double wx, double wy, double ticfrac, double alpha) +void R_DrawPSprite(DPSprite *pspr, AActor *owner, float bobx, float boby, double wx, double wy, double ticfrac) { double tx; int x1; @@ -1303,6 +1303,7 @@ void R_DrawPSprite(DPSprite *pspr, AActor *owner, float bobx, float boby, double FTexture* tex; vissprite_t* vis; bool noaccel; + double alpha = owner->Alpha; static TArray avis; if (avis.Size() < vispspindex + 1) @@ -1432,14 +1433,7 @@ void R_DrawPSprite(DPSprite *pspr, AActor *owner, float bobx, float boby, double if (pspr->Flags & PSPF_FORCESTYLE) { - if (rs == STYLE_Normal && vis->Style.Alpha < 1.0) - { - vis->Style.RenderStyle = LegacyRenderStyles[STYLE_Translucent]; - } - else - { - vis->Style.RenderStyle = LegacyRenderStyles[rs]; - } + vis->Style.RenderStyle = LegacyRenderStyles[rs]; } else if (owner->RenderStyle == LegacyRenderStyles[STYLE_Fuzzy]) { @@ -1468,13 +1462,9 @@ void R_DrawPSprite(DPSprite *pspr, AActor *owner, float bobx, float boby, double // and override the alpha if not forced. if (pspr->Flags & PSPF_ALPHA) { - if (pspr->Flags & PSPF_FORCEALPHA) + if (vis->Style.RenderStyle == LegacyRenderStyles[STYLE_Fuzzy]) { - vis->Style.Alpha = float(alpha); - } - else if (vis->Style.RenderStyle == LegacyRenderStyles[STYLE_Fuzzy]) - { - vis->Style.Alpha = float(owner->Alpha); + alpha = owner->Alpha; } else if (vis->Style.RenderStyle == LegacyRenderStyles[STYLE_OptFuzzy]) { @@ -1483,18 +1473,18 @@ void R_DrawPSprite(DPSprite *pspr, AActor *owner, float bobx, float boby, double switch (style.BlendOp) { default: - vis->Style.Alpha = float(alpha * owner->Alpha); + alpha = pspr->alpha * owner->Alpha; break; case STYLEOP_Fuzz: case STYLEOP_Sub: - vis->Style.Alpha = float(owner->Alpha); + alpha = owner->Alpha; break; } } else if (vis->Style.RenderStyle == LegacyRenderStyles[STYLE_Subtract]) { - vis->Style.Alpha = float(owner->Alpha); + alpha = owner->Alpha; } else if (vis->Style.RenderStyle == LegacyRenderStyles[STYLE_Add] || vis->Style.RenderStyle == LegacyRenderStyles[STYLE_Translucent] || @@ -1502,11 +1492,11 @@ void R_DrawPSprite(DPSprite *pspr, AActor *owner, float bobx, float boby, double vis->Style.RenderStyle == LegacyRenderStyles[STYLE_AddStencil] || vis->Style.RenderStyle == LegacyRenderStyles[STYLE_AddShaded]) { - vis->Style.Alpha = float(alpha * owner->Alpha); + alpha = owner->Alpha * pspr->alpha; } else { - vis->Style.Alpha = float(owner->Alpha); + alpha = owner->Alpha; } } @@ -1517,9 +1507,31 @@ void R_DrawPSprite(DPSprite *pspr, AActor *owner, float bobx, float boby, double vis->Style.Alpha < 1.0) { vis->Style.RenderStyle = LegacyRenderStyles[STYLE_Translucent]; - vis->Style.Alpha = (pspr->Flags & PSPF_FORCEALPHA) ? float(alpha) : float(alpha * owner->Alpha); + alpha = owner->Alpha * pspr->alpha; } + // ALWAYS take priority if asked for, except fuzz. Fuzz does absolutely nothing + // no matter what way it's changed. + if (pspr->Flags & PSPF_FORCEALPHA) + { + //Due to lack of != operators... + if (vis->Style.RenderStyle == LegacyRenderStyles[STYLE_Fuzzy] || + vis->Style.RenderStyle == LegacyRenderStyles[STYLE_SoulTrans] || + vis->Style.RenderStyle == LegacyRenderStyles[STYLE_Stencil]) + { } + else + { + alpha = pspr->alpha; + vis->Style.RenderStyle.Flags |= STYLEF_ForceAlpha; + } + } + vis->Style.Alpha = clamp(float(alpha), 0.f, 1.f); + + // Due to how some of the effects are handled, going to 0 or less causes some + // weirdness to display. There's no point rendering it anyway if it's 0. + if (vis->Style.Alpha <= 0.) + return; + //----------------------------------------------------------------------------- // The software renderer cannot invert the source without inverting the overlay @@ -1619,7 +1631,6 @@ void R_DrawPSprite(DPSprite *pspr, AActor *owner, float bobx, float boby, double { colormap_to_use = basecolormap; vis->Style.colormap = basecolormap->Maps; - vis->Style.RenderStyle = STYLE_Normal; } // Check for hardware-assisted 2D. If it's available, and this sprite is not @@ -1640,6 +1651,7 @@ void R_DrawPSprite(DPSprite *pspr, AActor *owner, float bobx, float boby, double return; } } + R_DrawVisSprite(vis); } @@ -1757,7 +1769,7 @@ void R_DrawPlayerSprites () if ((psp->GetID() != PSP_TARGETCENTER || CrosshairImage == nullptr) && psp->GetCaller() != nullptr) { - R_DrawPSprite(psp, camera, bobx, boby, wx, wy, r_TicFracF, psp->alpha); + R_DrawPSprite(psp, camera, bobx, boby, wx, wy, r_TicFracF); } psp = psp->GetNext();