* 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
This commit is contained in:
gez 2013-03-29 10:26:08 +00:00
parent 3d90aa2206
commit 6034b6bd99
7 changed files with 102 additions and 82 deletions

View file

@ -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)];
}
//===========================================================================

View file

@ -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;
}
}
}

View file

@ -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

View file

@ -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;i<countof(texturetypes);i++)

View file

@ -218,6 +218,7 @@ public:
TEX_FontChar,
TEX_Override, // For patches between TX_START/TX_END
TEX_Autopage, // Automap background - used to enable the use of FAutomapTexture
TEX_SkinGraphic,
TEX_Null,
TEX_FirstDefined,
};
@ -433,6 +434,7 @@ public:
TEXMAN_TryAny = 1,
TEXMAN_Overridable = 2,
TEXMAN_ReturnFirst = 4,
TEXMAN_AllowSkins = 8
};
FTextureID CheckForTexture (const char *name, int usetype, BITFIELD flags=TEXMAN_TryAny);

View file

@ -2920,34 +2920,37 @@ DEFINE_ACTION_FUNCTION(AActor, A_ClearTarget)
enum CLOF_flags
{
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,
};
struct LOFData
@ -2955,6 +2958,7 @@ struct LOFData
AActor *Self;
AActor *Target;
int Flags;
bool BadActor;
};
ETraceStatus CheckLOFTraceFunc(FTraceResults &trace, void *userdata)
@ -3025,6 +3029,7 @@ ETraceStatus CheckLOFTraceFunc(FTraceResults &trace, void *userdata)
{
return TRACE_Skip;
}
data->BadActor = 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);
}

View file

@ -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