* Updated to ZDoom r3708:

- Make voxels slightly larger so that the size of one 3D "texel" is the same as one 2D texel at the same location. [Software renderer only; OpenGL was already correct.]
- Fixed: Texture positioning for one-sided lines marked ML_DONTPEGBOTTOM was wrong.
- Added RGF_CENTERZ to spawn a rail from the actor's center instead of offsetting it upward.
- Merged all the multiple bool parameters to the railgun functions into a single flags parameter.

git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1412 b0f79afe-0144-0410-b225-9a4edf0717df
This commit is contained in:
gez 2012-06-24 08:15:04 +00:00
parent 4a49af9e41
commit 0e53e14c0a
9 changed files with 46 additions and 44 deletions

View file

@ -586,21 +586,23 @@ void P_DrawSplash2 (int count, fixed_t x, fixed_t y, fixed_t z, angle_t angle, i
}
}
void P_DrawRailTrail (AActor *source, const FVector3 &start, const FVector3 &end, int color1, int color2, float maxdiff, bool silent, const PClass *spawnclass, angle_t angle, bool fullbright, int duration, float sparsity, float drift)
void P_DrawRailTrail (AActor *source, const FVector3 &start, const FVector3 &end, int color1, int color2, float maxdiff, int flags, const PClass *spawnclass, angle_t angle, int duration, float sparsity, float drift)
{
double length, lengthsquared;
int steps, i;
FAngle deg;
FVector3 step, dir, pos, extend;
bool fullbright;
dir = end - start;
lengthsquared = dir | dir;
length = sqrt(lengthsquared);
steps = int(length / 3);
steps = xs_FloorToInt(length / 3);
fullbright = !!(flags & RAF_FULLBRIGHT);
if (steps)
{
if (!silent)
if (!(flags & RAF_SILENT))
{
FSoundID sound;

View file

@ -88,7 +88,7 @@ void P_RunEffects (void);
void P_RunEffect (AActor *actor, int effects);
void P_DrawRailTrail (AActor *source, const FVector3 &start, const FVector3 &end, int color1, int color2, float maxdiff = 0, bool silent = false, const PClass *spawnclass = NULL, angle_t angle = 0, bool fullbright = false, int duration = 35, float sparsity = 1.0, float drift = 1.0);
void P_DrawRailTrail (AActor *source, const FVector3 &start, const FVector3 &end, int color1, int color2, float maxdiff = 0, int flags = 0, const PClass *spawnclass = NULL, angle_t angle = 0, int duration = 35, float sparsity = 1.0, float drift = 1.0);
void P_DrawSplash (int count, fixed_t x, fixed_t y, fixed_t z, angle_t angle, int kind);
void P_DrawSplash2 (int count, fixed_t x, fixed_t y, fixed_t z, angle_t angle, int updown, int kind);
void P_DisconnectEffect (AActor *actor);

View file

@ -446,7 +446,7 @@ bool P_ChangeSector (sector_t* sector, int crunch, int amt, int floorOrCeil, boo
fixed_t P_AimLineAttack (AActor *t1, angle_t angle, fixed_t distance, AActor **pLineTarget = NULL, fixed_t vrange=0, int flags = 0, AActor *target=NULL, AActor *friender=NULL);
enum
enum // P_AimLineAttack flags
{
ALF_FORCENOSMART = 1,
ALF_CHECK3D = 2,
@ -461,10 +461,20 @@ void P_TraceBleed (int damage, fixed_t x, fixed_t y, fixed_t z, AActor *target,
void P_TraceBleed (int damage, AActor *target, angle_t angle, int pitch);
void P_TraceBleed (int damage, AActor *target, AActor *missile); // missile version
void P_TraceBleed (int damage, AActor *target); // random direction version
void P_RailAttack (AActor *source, int damage, int offset, int color1 = 0, int color2 = 0, float maxdiff = 0, bool silent = false, const PClass *puff = NULL, bool pierce = true, angle_t angleoffset = 0, angle_t pitchoffset = 0, fixed_t distance = 8192*FRACUNIT, bool fullbright = false, int duration = 0, float sparsity = 1.0, float drift = 1.0, const PClass *spawnclass = NULL); // [RH] Shoot a railgun
bool P_HitFloor (AActor *thing);
bool P_HitWater (AActor *thing, sector_t *sec, fixed_t splashx = FIXED_MIN, fixed_t splashy = FIXED_MIN, fixed_t splashz=FIXED_MIN, bool checkabove = false, bool alert = true);
void P_CheckSplash(AActor *self, fixed_t distance);
void P_RailAttack (AActor *source, int damage, int offset, int color1 = 0, int color2 = 0, float maxdiff = 0, int flags = 0, const PClass *puff = NULL, angle_t angleoffset = 0, angle_t pitchoffset = 0, fixed_t distance = 8192*FRACUNIT, int duration = 0, float sparsity = 1.0, float drift = 1.0, const PClass *spawnclass = NULL); // [RH] Shoot a railgun
enum // P_RailAttack / A_RailAttack / A_CustomRailgun / P_DrawRailTrail flags
{
RAF_SILENT = 1,
RAF_NOPIERCE = 2,
RAF_EXPLICITANGLE = 4,
RAF_FULLBRIGHT = 8,
RAF_CENTERZ = 16,
};
bool P_CheckMissileSpawn (AActor *missile);
void P_PlaySpawnSound(AActor *missile, AActor *spawner);

View file

@ -3925,7 +3925,7 @@ static bool ProcessNoPierceRailHit (FTraceResults &res)
//
//
//==========================================================================
void P_RailAttack (AActor *source, int damage, int offset, int color1, int color2, float maxdiff, bool silent, const PClass *puffclass, bool pierce, angle_t angleoffset, angle_t pitchoffset, fixed_t distance, bool fullbright, int duration, float sparsity, float drift, const PClass *spawnclass)
void P_RailAttack (AActor *source, int damage, int offset, int color1, int color2, float maxdiff, int railflags, const PClass *puffclass, angle_t angleoffset, angle_t pitchoffset, fixed_t distance, int duration, float sparsity, float drift, const PClass *spawnclass)
{
fixed_t vx, vy, vz;
angle_t angle, pitch;
@ -3948,13 +3948,16 @@ void P_RailAttack (AActor *source, int damage, int offset, int color1, int color
shootz = source->z - source->floorclip + (source->height >> 1);
if (source->player != NULL)
if (!(railflags & RAF_CENTERZ))
{
shootz += FixedMul (source->player->mo->AttackZOffset, source->player->crouchfactor);
}
else
{
shootz += 8*FRACUNIT;
if (source->player != NULL)
{
shootz += FixedMul (source->player->mo->AttackZOffset, source->player->crouchfactor);
}
else
{
shootz += 8*FRACUNIT;
}
}
angle = ((source->angle + angleoffset) - ANG90) >> ANGLETOFINESHIFT;
@ -3973,18 +3976,9 @@ void P_RailAttack (AActor *source, int damage, int offset, int color1, int color
if (puffDefaults != NULL && puffDefaults->flags6 & MF6_NOTRIGGER) flags = 0;
else flags = TRACE_PCross|TRACE_Impact;
if (pierce)
{
Trace (x1, y1, shootz, source->Sector, vx, vy, vz,
distance, MF_SHOOTABLE, ML_BLOCKEVERYTHING, source, trace,
flags, ProcessRailHit);
}
else
{
Trace (x1, y1, shootz, source->Sector, vx, vy, vz,
distance, MF_SHOOTABLE, ML_BLOCKEVERYTHING, source, trace,
flags, ProcessNoPierceRailHit);
}
Trace (x1, y1, shootz, source->Sector, vx, vy, vz,
distance, MF_SHOOTABLE, ML_BLOCKEVERYTHING, source, trace,
flags, (railflags & RAF_NOPIERCE) ? ProcessNoPierceRailHit : ProcessRailHit);
// Hurt anything the trace hit
unsigned int i;
@ -4061,7 +4055,7 @@ void P_RailAttack (AActor *source, int damage, int offset, int color1, int color
end.X = FIXED2FLOAT(trace.X);
end.Y = FIXED2FLOAT(trace.Y);
end.Z = FIXED2FLOAT(trace.Z);
P_DrawRailTrail (source, start, end, color1, color2, maxdiff, silent, spawnclass, source->angle + angleoffset, fullbright, duration, sparsity, drift);
P_DrawRailTrail (source, start, end, color1, color2, maxdiff, railflags, spawnclass, source->angle + angleoffset, duration, sparsity, drift);
}
//==========================================================================

View file

@ -1953,11 +1953,11 @@ void R_NewWall (bool needlights)
yrepeat = FixedMul(midtexture->yScale, rw_midtexturescaley);
if (linedef->flags & ML_DONTPEGBOTTOM)
{ // bottom of texture at bottom
rw_midtexturemid = frontsector->GetPlaneTexZ(sector_t::floor) + (midtexture->GetHeight() << FRACBITS);
rw_midtexturemid = MulScale16(frontsector->GetPlaneTexZ(sector_t::floor) - viewz, yrepeat) + (midtexture->GetHeight() << FRACBITS);
}
else
{ // top of texture at top
rw_midtexturemid = frontsector->GetPlaneTexZ(sector_t::ceiling);
rw_midtexturemid = MulScale16(frontsector->GetPlaneTexZ(sector_t::ceiling) - viewz, yrepeat);
if (rowoffset < 0 && midtexture != NULL)
{
rowoffset += midtexture->GetHeight() << FRACBITS;
@ -1965,13 +1965,13 @@ void R_NewWall (bool needlights)
}
if (midtexture->bWorldPanning)
{
rw_midtexturemid = MulScale16(rw_midtexturemid - viewz + rowoffset, yrepeat);
rw_midtexturemid = MulScale16(rowoffset, yrepeat);
}
else
{
// rowoffset is added outside the multiply so that it positions the texture
// by texels instead of world units.
rw_midtexturemid = MulScale16(rw_midtexturemid - viewz, yrepeat) + rowoffset;
rw_midtexturemid += rowoffset;
}
}
}

View file

@ -2245,8 +2245,11 @@ void R_DrawVoxel(fixed_t dasprx, fixed_t daspry, fixed_t dasprz, angle_t daspran
dasprx = dasprx >> 12;
daspry = -daspry >> 12;
dasprz = -dasprz >> 8;
daxscale >>= 10;
dayscale >>= 10;
// Shift the scales from 16 bits of fractional precision to 6.
// Also do some magic voodoo scaling to make them the right size.
daxscale = daxscale / (0xD000 >> 6);
dayscale = dayscale / (0xD000 >> 6);
cosang = viewcos >> 2;
sinang = -viewsin >> 2;

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 "3705"
#define ZD_SVN_REVISION_NUMBER 3705
#define ZD_SVN_REVISION_STRING "3708"
#define ZD_SVN_REVISION_NUMBER 3708

View file

@ -1380,14 +1380,6 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomPunch)
}
enum
{
RAF_SILENT = 1,
RAF_NOPIERCE = 2,
RAF_EXPLICITANGLE = 4,
RAF_FULLBRIGHT = 8
};
//==========================================================================
//
// customizable railgun attack function
@ -1439,7 +1431,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_RailAttack)
slope = pr_crailgun.Random2() * (Spread_Z / 255);
}
P_RailAttack (self, Damage, Spawnofs_XY, Color1, Color2, MaxDiff, !!(Flags & RAF_SILENT), PuffType, (!(Flags & RAF_NOPIERCE)), angle, slope, Range, !!(Flags & RAF_FULLBRIGHT), Duration, Sparsity, DriftSpeed, SpawnClass);
P_RailAttack (self, Damage, Spawnofs_XY, Color1, Color2, MaxDiff, Flags, PuffType, angle, slope, Range, Duration, Sparsity, DriftSpeed, SpawnClass);
}
//==========================================================================
@ -1556,7 +1548,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomRailgun)
slopeoffset = pr_crailgun.Random2() * (Spread_Z / 255);
}
P_RailAttack (self, Damage, Spawnofs_XY, Color1, Color2, MaxDiff, !!(Flags & RAF_SILENT), PuffType, (!(Flags & RAF_NOPIERCE)), angleoffset, slopeoffset, Range, !!(Flags & RAF_FULLBRIGHT), Duration, Sparsity, DriftSpeed, SpawnClass);
P_RailAttack (self, Damage, Spawnofs_XY, Color1, Color2, MaxDiff, Flags, PuffType, angleoffset, slopeoffset, Range, Duration, Sparsity, DriftSpeed, SpawnClass);
self->x = saved_x;
self->y = saved_y;

View file

@ -117,6 +117,7 @@ const int RGF_SILENT = 1;
const int RGF_NOPIERCING = 2;
const int RGF_EXPLICITANGLE = 4;
const int RGF_FULLBRIGHT = 8;
const int RGF_CENTERZ = 16;
// Flags for A_Mushroom
const int MSF_Standard = 0;