From 8dac6782003f84e1a62b2274ec7d47f09c84bf15 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 25 Feb 2017 19:10:49 +0100 Subject: [PATCH] - added DAMAGE_NO_ARMOR flag for ACS's SectorDamage function. --- src/p_spec.cpp | 3 ++- src/p_spec.h | 1 + src/v_draw.cpp | 8 ++++---- src/v_video.h | 2 +- src/wi_stuff.cpp | 32 +++++++++++++++----------------- 5 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/p_spec.cpp b/src/p_spec.cpp index 0eb619723..b3ce7e3e3 100644 --- a/src/p_spec.cpp +++ b/src/p_spec.cpp @@ -466,7 +466,8 @@ static void DoSectorDamage(AActor *actor, sector_t *sec, int amount, FName type, return; } - P_DamageMobj (actor, NULL, NULL, amount, type); + int dflags = (flags & DAMAGE_NO_ARMOR) ? DMG_NO_ARMOR : 0; + P_DamageMobj (actor, NULL, NULL, amount, type, dflags); } void P_SectorDamage(int tag, int amount, FName type, PClassActor *protectClass, int flags) diff --git a/src/p_spec.h b/src/p_spec.h index 5cb8861e4..b00e5cacf 100644 --- a/src/p_spec.h +++ b/src/p_spec.h @@ -76,6 +76,7 @@ const double CARRYFACTOR = 3 / 32.; #define DAMAGE_NONPLAYERS 2 #define DAMAGE_IN_AIR 4 #define DAMAGE_SUBCLASSES_PROTECT 8 +#define DAMAGE_NO_ARMOR 16 // [RH] If a deathmatch game, checks to see if noexit is enabled. diff --git a/src/v_draw.cpp b/src/v_draw.cpp index ca5e1fa37..0a9b75b19 100644 --- a/src/v_draw.cpp +++ b/src/v_draw.cpp @@ -572,7 +572,7 @@ bool DCanvas::ParseDrawTextureTags(FTexture *img, double x, double y, DWORD tag, parms->colorOverlay = 0; parms->alphaChannel = false; parms->flipX = false; - parms->shadowAlpha = 0; + //parms->shadowAlpha = 0; parms->shadowColor = 0; parms->virtWidth = this->GetWidth(); parms->virtHeight = this->GetHeight(); @@ -845,7 +845,7 @@ bool DCanvas::ParseDrawTextureTags(FTexture *img, double x, double y, DWORD tag, break; case DTA_ShadowAlpha: - parms->shadowAlpha = (float)MIN(1., ListGetDouble(tags)); + //parms->shadowAlpha = (float)MIN(1., ListGetDouble(tags)); break; case DTA_ShadowColor: @@ -856,12 +856,12 @@ bool DCanvas::ParseDrawTextureTags(FTexture *img, double x, double y, DWORD tag, boolval = ListGetInt(tags); if (boolval) { - parms->shadowAlpha = 0.5; + //parms->shadowAlpha = 0.5; parms->shadowColor = 0; } else { - parms->shadowAlpha = 0; + //parms->shadowAlpha = 0; } break; diff --git a/src/v_video.h b/src/v_video.h index 72474ee28..8618f95ba 100644 --- a/src/v_video.h +++ b/src/v_video.h @@ -162,7 +162,7 @@ struct DrawParms uint32 colorOverlay; INTBOOL alphaChannel; INTBOOL flipX; - float shadowAlpha; + //float shadowAlpha; int shadowColor; INTBOOL keepratio; INTBOOL masked; diff --git a/src/wi_stuff.cpp b/src/wi_stuff.cpp index 525d0c577..d5c5554da 100644 --- a/src/wi_stuff.cpp +++ b/src/wi_stuff.cpp @@ -738,6 +738,7 @@ public: bool noautostartmap; int dofrags; int ng_state; + float shadowalpha; // // GRAPHICS @@ -777,23 +778,6 @@ public: - //==================================================================== - // - // Draws a single character with a shadow - // - //==================================================================== - - int WI_DrawCharPatch (FFont *font, int charcode, int x, int y, EColorRange translation=CR_UNTRANSLATED, bool nomove=false) - { - int width; - font->GetChar(charcode, &width); - screen->DrawChar(font, translation, x, y, charcode, - nomove ? DTA_CleanNoMove : DTA_Clean, true, - DTA_ShadowAlpha, (gameinfo.gametype & GAME_DoomChex) ? 0 : 0.5, - TAG_DONE); - return x - width; - } - //==================================================================== // // CheckRealHeight @@ -830,6 +814,20 @@ public: return maxy; } + //==================================================================== + // + // Draws a single character with a shadow + // + //==================================================================== + + int WI_DrawCharPatch(FFont *font, int charcode, int x, int y, EColorRange translation = CR_UNTRANSLATED, bool nomove = false) + { + int width; + font->GetChar(charcode, &width); + screen->DrawChar(font, translation, x, y, charcode, nomove ? DTA_CleanNoMove : DTA_Clean, true, TAG_DONE); + return x - width; + } + //==================================================================== // // Draws a level name with the big font