From 35c30ab62fee6cdd3e746aeeacebcfbfeadbe60c Mon Sep 17 00:00:00 2001 From: MajorCooke Date: Sat, 16 Jul 2016 20:28:43 -0500 Subject: [PATCH 01/10] Fixed missing constants. --- wadsrc/static/actors/constants.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wadsrc/static/actors/constants.txt b/wadsrc/static/actors/constants.txt index 46e810a7f..05049e598 100644 --- a/wadsrc/static/actors/constants.txt +++ b/wadsrc/static/actors/constants.txt @@ -38,6 +38,9 @@ const int CBAF_NORANDOM = 2; const int CBAF_EXPLICITANGLE = 4; const int CBAF_NOPITCH = 8; const int CBAF_NORANDOMPUFFZ = 16; +const int CBAF_PUFFTARGET = 32; +const int CBAF_PUFFMASTER = 64; +const int CBAF_PUFFTRACER = 128; // Flags for A_GunFlash const int GFF_NOEXTCHANGE = 1; @@ -210,6 +213,9 @@ const int CPF_STEALARMOR = 32; const int FPF_AIMATANGLE = 1; const int FPF_TRANSFERTRANSLATION = 2; const int FPF_NOAUTOAIM = 4; +const int FBF_PUFFTARGET = 64; +const int FBF_PUFFMASTER = 128; +const int FBF_PUFFTRACER = 256; // Flags for A_Teleport enum From 39042dc4bf11226d3cfe8a28a64703f622d97c6e Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sun, 17 Jul 2016 08:15:23 +0300 Subject: [PATCH 02/10] macOS application controller is now using proper delegate protocol Fixes compilation error with Xcode 8: cannot initialize a parameter of type 'id _Nullable' with an lvalue of type 'ApplicationController *' --- src/posix/cocoa/i_main.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/posix/cocoa/i_main.mm b/src/posix/cocoa/i_main.mm index 5729a3716..bbe344809 100644 --- a/src/posix/cocoa/i_main.mm +++ b/src/posix/cocoa/i_main.mm @@ -220,8 +220,8 @@ int OriginalMain(int argc, char** argv) @interface ApplicationController : NSResponder -#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 - +#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060 + #endif { } From e482a543891b755b7a2b2a7546e7187983daef62 Mon Sep 17 00:00:00 2001 From: Leonard2 Date: Sat, 16 Jul 2016 16:07:31 +0200 Subject: [PATCH 03/10] Fixed a crash with A_ClearOverlays --- src/p_pspr.cpp | 33 +++++++++++---------------------- 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/src/p_pspr.cpp b/src/p_pspr.cpp index 2e285b34a..4d5ab660b 100644 --- a/src/p_pspr.cpp +++ b/src/p_pspr.cpp @@ -1171,50 +1171,39 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_ClearOverlays) PARAM_INT_OPT(stop) { stop = 0; } PARAM_BOOL_OPT(safety) { safety = true; } - if (!self->player) + if (self->player == nullptr) ACTION_RETURN_INT(0); - player_t *player = self->player; if (!start && !stop) { start = INT_MIN; stop = safety ? PSP_TARGETCENTER - 1 : INT_MAX; } - int count = 0; - DPSprite *pspr = player->psprites; - int startID = (pspr != nullptr) ? pspr->GetID() : start; - bool first = true; - while (pspr != nullptr) - { - if (pspr->GetID() == startID) - { - if (first) - first = false; - else - break; - } - int id = pspr->GetID(); + unsigned int count = 0; + int id; - //Do not wipe out layer 0. Ever. - if (!id || id < start) + for (DPSprite *pspr = self->player->psprites; pspr != nullptr; pspr = pspr->GetNext()) + { + id = pspr->GetID(); + + if (id < start || id == 0) continue; - if (id > stop) + else if (id > stop) break; if (safety) { if (id >= PSP_TARGETCENTER) break; - else if ((id >= PSP_STRIFEHANDS && id <= PSP_WEAPON) || (id == PSP_FLASH)) + else if (id == PSP_STRIFEHANDS || id == PSP_WEAPON || id == PSP_FLASH) continue; } - // [MC]Don't affect non-hardcoded layers unless it's really desired. pspr->SetState(nullptr); count++; - pspr = pspr->GetNext(); } + ACTION_RETURN_INT(count); } From 446bc1018c86a4a0e08244a148c775cf986e148e Mon Sep 17 00:00:00 2001 From: Leonard2 Date: Sat, 16 Jul 2016 15:22:36 +0200 Subject: [PATCH 04/10] Fixed: weapons didn't clear their flash layer when the player died --- src/p_pspr.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/p_pspr.cpp b/src/p_pspr.cpp index 4d5ab660b..bad9c2d73 100644 --- a/src/p_pspr.cpp +++ b/src/p_pspr.cpp @@ -1085,9 +1085,8 @@ DEFINE_ACTION_FUNCTION(AInventory, A_Lower) } if (player->playerstate == PST_DEAD) { // Player is dead, so don't bring up a pending weapon - psp->y = WEAPONBOTTOM; - // Player is dead, so keep the weapon off screen + P_SetPsprite(player, PSP_FLASH, nullptr); psp->SetState(nullptr); return 0; } From 8369833dc5f5cc85781c76fb7ce70ff45cb89d80 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sun, 17 Jul 2016 15:34:57 +0300 Subject: [PATCH 05/10] Fixed setting of custom color for static text in menu --- src/menu/menudef.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/menu/menudef.cpp b/src/menu/menudef.cpp index 6d5e3dd64..1948153e4 100644 --- a/src/menu/menudef.cpp +++ b/src/menu/menudef.cpp @@ -662,7 +662,7 @@ static EColorRange ParseOptionColor(FScanner &sc, FOptionMenuDescriptor *desc) if (sc.CheckString(",")) { sc.MustGetString(); - EColorRange cr = V_FindFontColor(sc.String); + cr = V_FindFontColor(sc.String); if (cr == CR_UNTRANSLATED && !sc.Compare("untranslated") && isdigit(sc.String[0])) { if (strtol(sc.String, NULL, 0)) cr = OptionSettings.mFontColorHeader; From d4352dd1a75d3a21927961d05d4a9c771ba4cfa1 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 17 Jul 2016 23:13:10 +0200 Subject: [PATCH 06/10] - fixed slope calculation error. --- src/r_plane.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/r_plane.cpp b/src/r_plane.cpp index d749319e3..ff23492ab 100644 --- a/src/r_plane.cpp +++ b/src/r_plane.cpp @@ -1677,7 +1677,7 @@ void R_DrawTiltedPlane (visplane_t *pl, double _xscale, double _yscale, fixed_t // the textures a constant size across the surface's plane instead. cosine = cos(planeang), sine = sin(planeang); m[1] = pl->height.ZatPoint(ViewPos.X + yscale * sine, ViewPos.Y + yscale * cosine) - zeroheight; - n[1] = pl->height.ZatPoint(ViewPos.X - xscale * cosine, ViewPos.Y + xscale * sine) - zeroheight; + n[1] = -(pl->height.ZatPoint(ViewPos.X - xscale * cosine, ViewPos.Y + xscale * sine) - zeroheight); plane_su = p ^ m; plane_sv = p ^ n; From d09ec5a930e3e16bb234e4a46a82394300620735 Mon Sep 17 00:00:00 2001 From: Blue-Shadow Date: Tue, 19 Jul 2016 03:16:12 +0300 Subject: [PATCH 07/10] Added DamageType ACS actor property --- src/p_acs.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/p_acs.cpp b/src/p_acs.cpp index 919834a06..01953cad9 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -3719,6 +3719,7 @@ enum APROP_DamageMultiplier=43, APROP_MaxStepHeight = 44, APROP_MaxDropOffHeight= 45, + APROP_DamageType = 46, }; // These are needed for ACS's APROP_RenderStyle @@ -3978,6 +3979,9 @@ void DLevelScript::DoSetActorProperty (AActor *actor, int property, int value) actor->MaxDropOffHeight = ACSToDouble(value); break; + case APROP_DamageType: + actor->DamageType = FBehavior::StaticLookupString(value); + break; default: // do nothing. @@ -4081,6 +4085,7 @@ int DLevelScript::GetActorProperty (int tid, int property) case APROP_Friction: return DoubleToACS(actor->Friction); case APROP_MaxStepHeight: return DoubleToACS(actor->MaxStepHeight); case APROP_MaxDropOffHeight: return DoubleToACS(actor->MaxDropOffHeight); + case APROP_DamageType: return GlobalACSStrings.AddString(actor->DamageType); default: return 0; } @@ -4153,6 +4158,7 @@ int DLevelScript::CheckActorProperty (int tid, int property, int value) case APROP_ActiveSound: string = actor->ActiveSound; break; case APROP_Species: string = actor->GetSpecies(); break; case APROP_NameTag: string = actor->GetTag(); break; + case APROP_DamageType: string = actor->DamageType; break; } if (string == NULL) string = ""; return (!stricmp(string, FBehavior::StaticLookupString(value))); From c428e376cd561134a67dedecf462713ff2b82ce1 Mon Sep 17 00:00:00 2001 From: Blue-Shadow Date: Tue, 19 Jul 2016 04:59:07 +0300 Subject: [PATCH 08/10] Added INFLICTORDMGTYPE flag to A_Damage* action functions It forces the use of the inflictor's damagetype instead of whatever is passed to the functions. --- src/thingdef/thingdef_codeptr.cpp | 4 ++++ wadsrc/static/actors/constants.txt | 1 + 2 files changed, 5 insertions(+) diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index 63ba6ec30..ef41faea2 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -6129,6 +6129,7 @@ enum DMSS DMSS_EXFILTER = 64, //Changes filter into a blacklisted class instead of whitelisted. DMSS_EXSPECIES = 128, // ^ but with species instead. DMSS_EITHER = 256, //Allow either type or species to be affected. + DMSS_INFLICTORDMGTYPE = 512, //Ignore the passed damagetype and use the inflictor's instead. }; static void DoDamage(AActor *dmgtarget, AActor *inflictor, AActor *source, int amount, FName DamageType, int flags, PClassActor *filter, FName species) @@ -6153,6 +6154,9 @@ static void DoDamage(AActor *dmgtarget, AActor *inflictor, AActor *source, int a if (amount > 0) { //Should wind up passing them through just fine. + if (flags & DMSS_INFLICTORDMGTYPE) + DamageType = inflictor->DamageType; + P_DamageMobj(dmgtarget, inflictor, source, amount, DamageType, dmgFlags); } else if (amount < 0) diff --git a/wadsrc/static/actors/constants.txt b/wadsrc/static/actors/constants.txt index 05049e598..ba0d1399d 100644 --- a/wadsrc/static/actors/constants.txt +++ b/wadsrc/static/actors/constants.txt @@ -466,6 +466,7 @@ enum DMSS_EXFILTER = 0x00000040, DMSS_EXSPECIES = 0x00000080, DMSS_EITHER = 0x00000100, + DMSS_INFLICTORDMGTYPE = 0x00000200, }; // Flags for A_AlertMonsters From fa22acca5d524bedbee99d20028fb19f5a3eb970 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 21 Jul 2016 12:01:06 +0200 Subject: [PATCH 09/10] - fixed: Dehacked's 'Speed' value should be treated as signed when being assigned to a double variable. --- src/d_dehacked.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/d_dehacked.cpp b/src/d_dehacked.cpp index f79924b2b..387e05be5 100644 --- a/src/d_dehacked.cpp +++ b/src/d_dehacked.cpp @@ -921,7 +921,7 @@ static int PatchThing (int thingy) { if (stricmp (Line1, "Speed") == 0) { - info->Speed = val; // handle fixed point later. + info->Speed = (signed long)val; // handle fixed point later. } else if (stricmp (Line1, "Width") == 0) { From 35666f1e097f72128880397c6b68519545f39e29 Mon Sep 17 00:00:00 2001 From: MajorCooke Date: Thu, 21 Jul 2016 13:12:12 -0500 Subject: [PATCH 10/10] Fixed a nullptr crash with flatsprite actors. --- src/gl/scene/gl_sprite.cpp | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/gl/scene/gl_sprite.cpp b/src/gl/scene/gl_sprite.cpp index e5edcaf97..d144da8fd 100644 --- a/src/gl/scene/gl_sprite.cpp +++ b/src/gl/scene/gl_sprite.cpp @@ -270,7 +270,7 @@ void GLSprite::Draw(int pass) const bool drawBillboardFacingCamera = gl_billboard_faces_camera; // [Nash] has +ROLLSPRITE - const bool drawRollSpriteActor = (actor != NULL && actor->renderflags & RF_ROLLSPRITE); + const bool drawRollSpriteActor = (actor != nullptr && actor->renderflags & RF_ROLLSPRITE); gl_RenderState.Apply(); FVector3 v1; @@ -280,10 +280,10 @@ void GLSprite::Draw(int pass) // [fgsfds] check sprite type mask DWORD spritetype = (DWORD)-1; - if (actor != NULL) spritetype = actor->renderflags & RF_SPRITETYPEMASK; + if (actor != nullptr) spritetype = actor->renderflags & RF_SPRITETYPEMASK; // [Nash] is a flat sprite - const bool isFlatSprite = (actor != NULL) && (spritetype == RF_WALLSPRITE || spritetype == RF_FLATSPRITE); + const bool isFlatSprite = (actor != nullptr) && (spritetype == RF_WALLSPRITE || spritetype == RF_FLATSPRITE); const bool dontFlip = (actor != nullptr) && (actor->renderflags & RF_DONTFLIP); const bool useOffsets = (actor != nullptr) && !(actor->renderflags & RF_ROLLCENTER); @@ -295,8 +295,8 @@ void GLSprite::Draw(int pass) float ycenter = (y1 + y2)*0.5; float zcenter = (z1 + z2)*0.5; float xx = -xcenter + x; - float yy = -zcenter + z; - float zz = -ycenter + y; + float zz = -zcenter + z; + float yy = -ycenter + y; Matrix3x4 mat; mat.MakeIdentity(); mat.Translate(xcenter, zcenter, ycenter); // move to sprite center @@ -336,20 +336,22 @@ void GLSprite::Draw(int pass) // Here we need some form of priority in order to work. if (spritetype == RF_FLATSPRITE) { - DVector3 diff = actor->Vec3To(GLRenderer->mViewActor); + float pitchDegrees = -actor->Angles.Pitch.Degrees; + DVector3 apos = { x, y, z }; + DVector3 diff = ViewPos - apos; DAngle angto = diff.Angle(); + angto = deltaangle(actor->Angles.Yaw, angto); - float pitchDegrees = -actor->Angles.Pitch.Degrees; bool noFlipSprite = (!dontFlip || (fabs(angto) < 90.)); mat.Rotate(0, 1, 0, (noFlipSprite) ? 0 : 180); mat.Rotate(-yawvecY, 0, yawvecX, (noFlipSprite) ? -pitchDegrees : pitchDegrees); if (drawRollSpriteActor) { - if (useOffsets) mat.Translate(xx, yy, zz); + if (useOffsets) mat.Translate(xx, zz, yy); mat.Rotate(yawvecX, 0, yawvecY, (noFlipSprite) ? -rollDegrees : rollDegrees); - if (useOffsets) mat.Translate(-xx, -yy, -zz); + if (useOffsets) mat.Translate(-xx, -zz, -yy); } } // [fgsfds] Rotate the sprite about the sight vector (roll) @@ -358,20 +360,20 @@ void GLSprite::Draw(int pass) mat.Rotate(0, 1, 0, 0); if (drawRollSpriteActor) { - if (useOffsets) mat.Translate(xx, yy, zz); + if (useOffsets) mat.Translate(xx, zz, yy); mat.Rotate(yawvecX, 0, yawvecY, rollDegrees); - if (useOffsets) mat.Translate(-xx, -yy, -zz); + if (useOffsets) mat.Translate(-xx, -zz, -yy); } } else if (drawRollSpriteActor) { - if (useOffsets) mat.Translate(xx, yy, zz); + if (useOffsets) mat.Translate(xx, zz, yy); if (drawWithXYBillboard) { mat.Rotate(-sin(angleRad), 0, cos(angleRad), -GLRenderer->mAngles.Pitch.Degrees); } mat.Rotate(cos(angleRad), 0, sin(angleRad), rollDegrees); - if (useOffsets) mat.Translate(-xx, -yy, -zz); + if (useOffsets) mat.Translate(-xx, -zz, -yy); } // apply the transform