From 6034b6bd99ecfda85c7c973fd445976bc3acd2d9 Mon Sep 17 00:00:00 2001 From: gez Date: Fri, 29 Mar 2013 10:26:08 +0000 Subject: [PATCH] * Updated to ZDoom 4207: - Fixed: Skin mugshots didn't load. (This adds a texture usetype for skin graphics.) - Always spawn RocketSmokeTrail and GrenadeSmokeTrail actors, and make them invisible for players who don't want to see them. This is needed for multiplayer sync between players with different settings for cl_rockettrails. - Added FDARI's CLOFF_JUMP_ON_MISS and CLOFF_AIM_VERT_NOOFFSET flags. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1548 b0f79afe-0144-0410-b225-9a4edf0717df --- src/g_shared/sbar_mugshot.cpp | 2 +- src/p_mobj.cpp | 47 ++++++++++---------- src/svnrevision.h | 4 +- src/textures/texturemanager.cpp | 14 ++++-- src/textures/textures.h | 2 + src/thingdef/thingdef_codeptr.cpp | 70 +++++++++++++++++------------- wadsrc/static/actors/constants.txt | 45 ++++++++++--------- 7 files changed, 102 insertions(+), 82 deletions(-) diff --git a/src/g_shared/sbar_mugshot.cpp b/src/g_shared/sbar_mugshot.cpp index 7d481941..313e2b84 100644 --- a/src/g_shared/sbar_mugshot.cpp +++ b/src/g_shared/sbar_mugshot.cpp @@ -98,7 +98,7 @@ FTexture *FMugShotFrame::GetTexture(const char *default_face, const char *skin_f } sprite.UnlockBuffer(); } - return TexMan[TexMan.CheckForTexture(sprite, 0, true)]; + return TexMan[TexMan.CheckForTexture(sprite, 0, FTextureManager::TEXMAN_TryAny|FTextureManager::TEXMAN_AllowSkins)]; } //=========================================================================== diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index 5cc5ecfe..e0dc45ad 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -3054,37 +3054,36 @@ void AActor::Tick () } - if (cl_rockettrails & 2) + if (effects & FX_ROCKET) { - if (effects & FX_ROCKET) + if (++smokecounter == 4) { - if (++smokecounter==4) + // add some smoke behind the rocket + smokecounter = 0; + AActor *th = Spawn("RocketSmokeTrail", x-velx, y-vely, z-velz, ALLOW_REPLACE); + if (th) { - // add some smoke behind the rocket - smokecounter = 0; - AActor * th = Spawn("RocketSmokeTrail", x-velx, y-vely, z-velz, ALLOW_REPLACE); - if (th) - { - th->tics -= pr_rockettrail()&3; - if (th->tics < 1) th->tics = 1; - } + th->tics -= pr_rockettrail()&3; + if (th->tics < 1) th->tics = 1; + if (!(cl_rockettrails & 2)) th->renderflags |= RF_INVISIBLE; } } - else if (effects & FX_GRENADE) + } + else if (effects & FX_GRENADE) + { + if (++smokecounter == 8) { - if (++smokecounter==8) + smokecounter = 0; + angle_t moveangle = R_PointToAngle2(0,0,velx,vely); + AActor * th = Spawn("GrenadeSmokeTrail", + x - FixedMul (finecosine[(moveangle)>>ANGLETOFINESHIFT], radius*2) + (pr_rockettrail()<<10), + y - FixedMul (finesine[(moveangle)>>ANGLETOFINESHIFT], radius*2) + (pr_rockettrail()<<10), + z - (height>>3) * (velz>>16) + (2*height)/3, ALLOW_REPLACE); + if (th) { - smokecounter = 0; - angle_t moveangle = R_PointToAngle2(0,0,velx,vely); - AActor * th = Spawn("GrenadeSmokeTrail", - x - FixedMul (finecosine[(moveangle)>>ANGLETOFINESHIFT], radius*2) + (pr_rockettrail()<<10), - y - FixedMul (finesine[(moveangle)>>ANGLETOFINESHIFT], radius*2) + (pr_rockettrail()<<10), - z - (height>>3) * (velz>>16) + (2*height)/3, ALLOW_REPLACE); - if (th) - { - th->tics -= pr_rockettrail()&3; - if (th->tics < 1) th->tics = 1; - } + th->tics -= pr_rockettrail()&3; + if (th->tics < 1) th->tics = 1; + if (!(cl_rockettrails & 2)) th->renderflags |= RF_INVISIBLE; } } } diff --git a/src/svnrevision.h b/src/svnrevision.h index a884a648..ec7d1014 100644 --- a/src/svnrevision.h +++ b/src/svnrevision.h @@ -3,5 +3,5 @@ // This file was automatically generated by the // updaterevision tool. Do not edit by hand. -#define ZD_SVN_REVISION_STRING "4204" -#define ZD_SVN_REVISION_NUMBER 4204 +#define ZD_SVN_REVISION_STRING "4207" +#define ZD_SVN_REVISION_NUMBER 4207 diff --git a/src/textures/texturemanager.cpp b/src/textures/texturemanager.cpp index 6fdac54c..0302ca54 100644 --- a/src/textures/texturemanager.cpp +++ b/src/textures/texturemanager.cpp @@ -176,7 +176,8 @@ FTextureID FTextureManager::CheckForTexture (const char *name, int usetype, BITF { // All NULL textures should actually return 0 if (tex->UseType == FTexture::TEX_FirstDefined && !(flags & TEXMAN_ReturnFirst)) return 0; - return FTextureID(tex->UseType==FTexture::TEX_Null? 0 : i); + if (tex->UseType == FTexture::TEX_SkinGraphic && !(flags & TEXMAN_AllowSkins)) return 0; + return FTextureID(tex->UseType==FTexture::TEX_Null ? 0 : i); } else if ((flags & TEXMAN_Overridable) && tex->UseType == FTexture::TEX_Override) { @@ -831,6 +832,7 @@ void FTextureManager::AddTexturesForWad(int wadnum) for (int i= firsttx; i <= lasttx; i++) { + bool skin = false; char name[9]; Wads.GetLumpName(name, i); name[8]=0; @@ -869,11 +871,17 @@ void FTextureManager::AddTexturesForWad(int wadnum) // Don't bother looking this lump if something later overrides it. if (Wads.CheckNumForName(name, ns_graphics) != i) continue; } + else if (ns >= ns_firstskin) + { + // Don't bother looking this lump if something later overrides it. + if (Wads.CheckNumForName(name, ns) != i) continue; + skin = true; + } else continue; // Try to create a texture from this lump and add it. // Unfortunately we have to look at everything that comes through here... - FTexture *out = FTexture::CreateTexture(i, FTexture::TEX_MiscPatch); + FTexture *out = FTexture::CreateTexture(i, skin ? FTexture::TEX_SkinGraphic : FTexture::TEX_MiscPatch); if (out != NULL) { @@ -922,7 +930,7 @@ void FTextureManager::SortTexturesByType(int start, int end) static int texturetypes[] = { FTexture::TEX_Sprite, FTexture::TEX_Null, FTexture::TEX_FirstDefined, FTexture::TEX_WallPatch, FTexture::TEX_Wall, FTexture::TEX_Flat, - FTexture::TEX_Override, FTexture::TEX_MiscPatch + FTexture::TEX_Override, FTexture::TEX_MiscPatch, FTexture::TEX_SkinGraphic }; for(unsigned int i=0;iBadActor = true; return TRACE_Abort; } @@ -3124,7 +3129,14 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CheckLOF) { pitch += self->pitch; } - else pitch += R_PointToAngle2 (0,0, (fixed_t)xyvec.Length(), target->z - z1 + target->height / 2); + else if (flags & CLOFF_AIM_VERT_NOOFFSET) + { + pitch += R_PointToAngle2 (0,0, (fixed_t)xyvec.Length(), target->z - z1 + offsetheight + target->height / 2); + } + else + { + pitch += R_PointToAngle2 (0,0, (fixed_t)xyvec.Length(), target->z - z1 + target->height / 2); + } } else if (flags & CLOFF_ALLOWNULL) { @@ -3166,21 +3178,17 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CheckLOF) lof_data.Self = self; lof_data.Target = target; lof_data.Flags = flags; + lof_data.BadActor = false; Trace(x1, y1, z1, sec, vx, vy, vz, range, 0xFFFFFFFF, ML_BLOCKEVERYTHING, self, trace, 0, CheckLOFTraceFunc, &lof_data); - if (trace.HitType == TRACE_HitActor) + if (trace.HitType == TRACE_HitActor || + ((flags & CLOFF_JUMP_ON_MISS) && !lof_data.BadActor && trace.HitType != TRACE_HitNone)) { - if (minrange > 0) + if (minrange > 0 && trace.Distance < minrange) { - double dx = trace.Actor->x - x1, - dy = trace.Actor->y - y1, - dz = trace.Actor->z + trace.Actor->height/2 - z1; - if (dx*dx+ dy*dy+ dz*dz < (double)minrange*(double)minrange) - { - return; - } + return; } ACTION_JUMP(jump); } diff --git a/wadsrc/static/actors/constants.txt b/wadsrc/static/actors/constants.txt index 587f10d3..24736eb3 100644 --- a/wadsrc/static/actors/constants.txt +++ b/wadsrc/static/actors/constants.txt @@ -308,34 +308,37 @@ const int SPF_FORCECLAMP = 1; enum { - CLOFF_NOAIM_VERT = 0x1, - CLOFF_NOAIM_HORZ = 0x2, + CLOFF_NOAIM_VERT = 0x1, + CLOFF_NOAIM_HORZ = 0x2, - CLOFF_JUMPENEMY = 0x4, - CLOFF_JUMPFRIEND = 0x8, - CLOFF_JUMPOBJECT = 0x10, - CLOFF_JUMPNONHOSTILE = 0x20, + CLOFF_JUMPENEMY = 0x4, + CLOFF_JUMPFRIEND = 0x8, + CLOFF_JUMPOBJECT = 0x10, + CLOFF_JUMPNONHOSTILE = 0x20, - CLOFF_SKIPENEMY = 0x40, - CLOFF_SKIPFRIEND = 0x80, - CLOFF_SKIPOBJECT = 0x100, - CLOFF_SKIPNONHOSTILE = 0x200, + CLOFF_SKIPENEMY = 0x40, + CLOFF_SKIPFRIEND = 0x80, + CLOFF_SKIPOBJECT = 0x100, + CLOFF_SKIPNONHOSTILE = 0x200, - CLOFF_MUSTBESHOOTABLE = 0x400, + CLOFF_MUSTBESHOOTABLE = 0x400, - CLOFF_SKIPTARGET = 0x800, - CLOFF_ALLOWNULL = 0x1000, - CLOFF_CHECKPARTIAL = 0x2000, + CLOFF_SKIPTARGET = 0x800, + CLOFF_ALLOWNULL = 0x1000, + CLOFF_CHECKPARTIAL = 0x2000, - CLOFF_MUSTBEGHOST = 0x4000, - CLOFF_IGNOREGHOST = 0x8000, + CLOFF_MUSTBEGHOST = 0x4000, + CLOFF_IGNOREGHOST = 0x8000, + + CLOFF_MUSTBESOLID = 0x10000, + CLOFF_BEYONDTARGET = 0x20000, - CLOFF_MUSTBESOLID = 0x10000, - CLOFF_BEYONDTARGET = 0x20000, + CLOFF_FROMBASE = 0x40000, + CLOFF_MUL_HEIGHT = 0x80000, + CLOFF_MUL_WIDTH = 0x100000, - CLOFF_FROMBASE = 0x40000, - CLOFF_MUL_HEIGHT = 0x80000, - CLOFF_MUL_WIDTH = 0x100000, + CLOFF_JUMP_ON_MISS = 0x200000, + CLOFF_AIM_VERT_NOOFFSET = 0x400000, CLOFF_SKIPOBSTACLES = CLOFF_SKIPENEMY|CLOFF_SKIPFRIEND|CLOFF_SKIPOBJECT|CLOFF_SKIPNONHOSTILE, CLOFF_NOAIM = CLOFF_NOAIM_VERT|CLOFF_NOAIM_HORZ