Update to ZDoom r1705:

- ZDoom now disables the input method editor, since it has no east-Asian
  support, and having it open a composition window when you're only expecting
  a single keypress is not so good.
- Fixed: Setting intermissioncounter to false in gameinfo drew all the stats
  at once, instead of revealing them one line at a time.
- Fixed: The border definition in MAPINFO's gameinfo block used extra braces.
- Added A_SetCrosshair.
- Added A_WeaponBob.
- Dropped the Hexen player classes' JumpZ down to 9, since the original value
  now works as it originally did.
- MF2_NODMGTHRUST now works with players, too. (Previously, it was only for
  missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players
  from being thrusted while taking damage. (Non-players were already
  unthrusted.)
- A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING
  will leave it unaltered.
- Added Gez's PowerInvisibility changes.
- Fixed: clearflags did not clear flags6.
- Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity.
- Enough with this "momentum" garbage. What Doom calls "momentum" is really
  velocity, and now it's known as such. The actor variables momx/momy/momz
  are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z
  are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will
  continue to work as aliases from DECORATE. The ACS functions, however,
  require you to use the new name, since they never saw an official release
  yet.
- Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon
  maintains its own FOV scale independent from any other weapons the player
  may have.
- Fixed: When parsing DECORATE functions that were not exported, the parser
  crashed after giving you the warning.
- Fixed some improper preprocessor lines in autostart/autozend.cpp.
- Added XInput support. For the benefit of people compiling with MinGW,
  the CMakeLists.txt checks for xinput.h and disables it if it cannot
  be found. (And much to my surprise, I accidentally discovered that if you
  have the DirectX SDK installed, those headers actually do work with GCC,
  though they add a few extra warnings.)

git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
This commit is contained in:
Christoph Oelckers 2009-07-04 08:28:50 +00:00
parent f62aff3100
commit 75008caf22
123 changed files with 2297 additions and 1189 deletions

View file

@ -702,17 +702,17 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomMissile)
self->y-=y;
// It is not necessary to use the correct angle here.
// The only important thing is that the horizontal momentum is correct.
// The only important thing is that the horizontal velocity is correct.
// Therefore use 0 as the missile's angle and simplify the calculations accordingly.
// The actual momentum vector is set below.
// The actual velocity vector is set below.
if (missile)
{
fixed_t vx = finecosine[pitch>>ANGLETOFINESHIFT];
fixed_t vz = finesine[pitch>>ANGLETOFINESHIFT];
missile->momx = FixedMul (vx, missile->Speed);
missile->momy = 0;
missile->momz = FixedMul (vz, missile->Speed);
missile->velx = FixedMul (vx, missile->Speed);
missile->vely = 0;
missile->velz = FixedMul (vz, missile->Speed);
}
break;
@ -720,17 +720,17 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomMissile)
if (missile)
{
// Use the actual momentum instead of the missile's Speed property
// Use the actual velocity instead of the missile's Speed property
// so that this can handle missiles with a high vertical velocity
// component properly.
FVector3 velocity (missile->momx, missile->momy, 0);
FVector3 velocity (missile->velx, missile->vely, 0);
fixed_t missilespeed = (fixed_t)velocity.Length();
missile->angle += Angle;
ang = missile->angle >> ANGLETOFINESHIFT;
missile->momx = FixedMul (missilespeed, finecosine[ang]);
missile->momy = FixedMul (missilespeed, finesine[ang]);
missile->velx = FixedMul (missilespeed, finecosine[ang]);
missile->vely = FixedMul (missilespeed, finesine[ang]);
// handle projectile shooting projectiles - track the
// links back to a real owner
@ -1022,12 +1022,12 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FireCustomMissile)
{
// This original implementation is to aim straight ahead and then offset
// the angle from the resulting direction.
FVector3 velocity(misl->momx, misl->momy, 0);
FVector3 velocity(misl->velx, misl->vely, 0);
fixed_t missilespeed = (fixed_t)velocity.Length();
misl->angle += Angle;
angle_t an = misl->angle >> ANGLETOFINESHIFT;
misl->momx = FixedMul (missilespeed, finecosine[an]);
misl->momy = FixedMul (missilespeed, finesine[an]);
misl->velx = FixedMul (missilespeed, finecosine[an]);
misl->vely = FixedMul (missilespeed, finesine[an]);
}
}
}
@ -1176,8 +1176,8 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomRailgun)
if (aim)
{
saved_angle = self->angle = R_PointToAngle2 (self->x, self->y,
self->target->x - self->target->momx * 3,
self->target->y - self->target->momy * 3);
self->target->x - self->target->velx * 3,
self->target->y - self->target->vely * 3);
if (aim == CRF_AIMDIRECT)
{
@ -1187,8 +1187,8 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomRailgun)
self->y += Spawnofs_XY * finesine[self->angle];
Spawnofs_XY = 0;
self->angle = R_PointToAngle2 (self->x, self->y,
self->target->x - self->target->momx * 3,
self->target->y - self->target->momy * 3);
self->target->x - self->target->velx * 3,
self->target->y - self->target->vely * 3);
}
if (self->target->flags & MF_SHADOW)
@ -1317,7 +1317,7 @@ enum SIX_Flags
SIXF_TRANSFERTRANSLATION=1,
SIXF_ABSOLUTEPOSITION=2,
SIXF_ABSOLUTEANGLE=4,
SIXF_ABSOLUTEMOMENTUM=8,
SIXF_ABSOLUTEVELOCITY=8,
SIXF_SETMASTER=16,
SIXF_NOCHECKPOSITION=32,
SIXF_TELEFRAG=64,
@ -1466,9 +1466,9 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SpawnItemEx)
ACTION_PARAM_FIXED(xofs, 1);
ACTION_PARAM_FIXED(yofs, 2);
ACTION_PARAM_FIXED(zofs, 3);
ACTION_PARAM_FIXED(xmom, 4);
ACTION_PARAM_FIXED(ymom, 5);
ACTION_PARAM_FIXED(zmom, 6);
ACTION_PARAM_FIXED(xvel, 4);
ACTION_PARAM_FIXED(yvel, 5);
ACTION_PARAM_FIXED(zvel, 6);
ACTION_PARAM_ANGLE(Angle, 7);
ACTION_PARAM_INT(flags, 8);
ACTION_PARAM_INT(chance, 9);
@ -1506,24 +1506,25 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SpawnItemEx)
y = self->y + FixedMul(xofs, finesine[ang]) - FixedMul(yofs, finecosine[ang]);
}
if (!(flags & SIXF_ABSOLUTEMOMENTUM))
if (!(flags & SIXF_ABSOLUTEVELOCITY))
{
// Same orientation issue here!
fixed_t newxmom = FixedMul(xmom, finecosine[ang]) + FixedMul(ymom, finesine[ang]);
ymom = FixedMul(xmom, finesine[ang]) - FixedMul(ymom, finecosine[ang]);
xmom = newxmom;
fixed_t newxvel = FixedMul(xvel, finecosine[ang]) + FixedMul(yvel, finesine[ang]);
yvel = FixedMul(xvel, finesine[ang]) - FixedMul(yvel, finecosine[ang]);
xvel = newxvel;
}
AActor * mo = Spawn( missile, x, y, self->z - self->floorclip + zofs, ALLOW_REPLACE);
AActor * mo = Spawn(missile, x, y, self->z - self->floorclip + zofs, ALLOW_REPLACE);
bool res = InitSpawnedItem(self, mo, flags);
ACTION_SET_RESULT(res); // for an inventory item's use state
if (mo)
{
mo->momx=xmom;
mo->momy=ymom;
mo->momz=zmom;
mo->angle=Angle;
if (flags & SIXF_TRANSFERAMBUSHFLAG) mo->flags = (mo->flags&~MF_AMBUSH) | (self->flags & MF_AMBUSH);
mo->velx = xvel;
mo->vely = yvel;
mo->velz = zvel;
mo->angle = Angle;
if (flags & SIXF_TRANSFERAMBUSHFLAG)
mo->flags = (mo->flags&~MF_AMBUSH) | (self->flags & MF_AMBUSH);
}
}
@ -1539,8 +1540,8 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_ThrowGrenade)
ACTION_PARAM_START(5);
ACTION_PARAM_CLASS(missile, 0);
ACTION_PARAM_FIXED(zheight, 1);
ACTION_PARAM_FIXED(xymom, 2);
ACTION_PARAM_FIXED(zmom, 3);
ACTION_PARAM_FIXED(xyvel, 2);
ACTION_PARAM_FIXED(zvel, 3);
ACTION_PARAM_BOOL(useammo, 4);
if (missile == NULL) return;
@ -1565,18 +1566,20 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_ThrowGrenade)
int pitch = self->pitch;
P_PlaySpawnSound(bo, self);
if (xymom) bo->Speed=xymom;
bo->angle = self->angle+(((pr_grenade()&7)-4)<<24);
bo->momz = zmom + 2*finesine[pitch>>ANGLETOFINESHIFT];
if (xyvel)
bo->Speed = xyvel;
bo->angle = self->angle + (((pr_grenade()&7) - 4) << 24);
bo->velz = zvel + 2*finesine[pitch>>ANGLETOFINESHIFT];
bo->z += 2 * finesine[pitch>>ANGLETOFINESHIFT];
P_ThrustMobj(bo, bo->angle, bo->Speed);
bo->momx += self->momx>>1;
bo->momy += self->momy>>1;
bo->velx += self->velx >> 1;
bo->vely += self->vely >> 1;
bo->target= self;
if (bo->flags4&MF4_RANDOMIZE)
{
bo->tics -= pr_grenade()&3;
if (bo->tics<1) bo->tics=1;
bo->tics -= pr_grenade() & 3;
if (bo->tics < 1)
bo->tics = 1;
}
P_CheckMissileSpawn (bo);
}
@ -1592,12 +1595,12 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_ThrowGrenade)
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Recoil)
{
ACTION_PARAM_START(1);
ACTION_PARAM_FIXED(xymom, 0);
ACTION_PARAM_FIXED(xyvel, 0);
angle_t angle = self->angle + ANG180;
angle >>= ANGLETOFINESHIFT;
self->momx += FixedMul (xymom, finecosine[angle]);
self->momy += FixedMul (xymom, finesine[angle]);
self->velx += FixedMul (xyvel, finecosine[angle]);
self->vely += FixedMul (xyvel, finesine[angle]);
}
@ -1757,9 +1760,9 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SpawnDebris)
if (mo && i < mo->GetClass()->ActorInfo->NumOwnedStates)
{
mo->SetState (mo->GetClass()->ActorInfo->OwnedStates + i);
mo->momz = FixedMul(mult_v, ((pr_spawndebris()&7)+5)*FRACUNIT);
mo->momx = FixedMul(mult_h, pr_spawndebris.Random2()<<(FRACBITS-6));
mo->momy = FixedMul(mult_h, pr_spawndebris.Random2()<<(FRACBITS-6));
mo->velz = FixedMul(mult_v, ((pr_spawndebris()&7)+5)*FRACUNIT);
mo->velx = FixedMul(mult_h, pr_spawndebris.Random2()<<(FRACBITS-6));
mo->vely = FixedMul(mult_h, pr_spawndebris.Random2()<<(FRACBITS-6));
}
}
}
@ -1945,7 +1948,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Burst)
if (chunk == NULL) return;
self->momx = self->momy = self->momz = 0;
self->velx = self->vely = self->velz = 0;
self->height = self->GetDefault()->height;
// [RH] In Hexen, this creates a random number of shards (range [24,56])
@ -1964,9 +1967,9 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Burst)
if (mo)
{
mo->momz = FixedDiv(mo->z-self->z, self->height)<<2;
mo->momx = pr_burst.Random2 () << (FRACBITS-7);
mo->momy = pr_burst.Random2 () << (FRACBITS-7);
mo->velz = FixedDiv(mo->z - self->z, self->height)<<2;
mo->velx = pr_burst.Random2 () << (FRACBITS-7);
mo->vely = pr_burst.Random2 () << (FRACBITS-7);
mo->RenderStyle = self->RenderStyle;
mo->alpha = self->alpha;
mo->CopyFriendliness(self, true);
@ -2024,18 +2027,29 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CheckCeiling)
//===========================================================================
//
// A_Stop
// resets all momentum of the actor to 0
// resets all velocity of the actor to 0
//
//===========================================================================
DEFINE_ACTION_FUNCTION(AActor, A_Stop)
{
self->momx = self->momy = self->momz = 0;
self->velx = self->vely = self->velz = 0;
if (self->player && self->player->mo == self && !(self->player->cheats & CF_PREDICTING))
{
self->player->mo->PlayIdle ();
self->player->momx = self->player->momy = 0;
self->player->mo->PlayIdle();
self->player->velx = self->player->vely = 0;
}
}
static void CheckStopped(AActor *self)
{
if (self->player != NULL &&
self->player->mo == self &&
!(self->player->cheats & CF_PREDICTING) &&
!(self->velx | self->vely | self->velz))
{
self->player->mo->PlayIdle();
self->player->velx = self->player->vely = 0;
}
}
//===========================================================================
@ -2531,7 +2545,9 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_RemoveChildren)
//===========================================================================
//
// keep firing unless target got out of sight
// A_MonsterRefire
//
// Keep firing unless target got out of sight
//
//===========================================================================
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_MonsterRefire)
@ -2555,3 +2571,103 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_MonsterRefire)
}
}
//===========================================================================
//
// A_SetAngle
//
// Set actor's angle (in degrees).
//
//===========================================================================
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetAngle)
{
ACTION_PARAM_START(1);
ACTION_PARAM_ANGLE(angle, 0);
self->angle = angle;
}
//===========================================================================
//
// A_SetPitch
//
// Set actor's pitch (in degrees).
//
//===========================================================================
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetPitch)
{
ACTION_PARAM_START(1);
ACTION_PARAM_ANGLE(pitch, 0);
self->pitch = pitch;
}
//===========================================================================
//
// A_ScaleVelocity
//
// Scale actor's velocity.
//
//===========================================================================
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_ScaleVelocity)
{
ACTION_PARAM_START(1);
ACTION_PARAM_FIXED(scale, 0);
INTBOOL was_moving = self->velx | self->vely | self->velz;
self->velx = FixedMul(self->velx, scale);
self->vely = FixedMul(self->vely, scale);
self->velz = FixedMul(self->velz, scale);
// If the actor was previously moving but now is not, and is a player,
// update its player variables. (See A_Stop.)
if (was_moving)
{
CheckStopped(self);
}
}
//===========================================================================
//
// A_ChangeVelocity
//
//===========================================================================
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_ChangeVelocity)
{
ACTION_PARAM_START(4);
ACTION_PARAM_FIXED(x, 0);
ACTION_PARAM_FIXED(y, 1);
ACTION_PARAM_FIXED(z, 2);
ACTION_PARAM_INT(flags, 3);
INTBOOL was_moving = self->velx | self->vely | self->velz;
fixed_t vx = x, vy = y, vz = z;
fixed_t sina = finesine[self->angle >> ANGLETOFINESHIFT];
fixed_t cosa = finecosine[self->angle >> ANGLETOFINESHIFT];
if (flags & 1) // relative axes - make x, y relative to actor's current angle
{
vx = DMulScale16(x, cosa, -y, sina);
vy = DMulScale16(x, sina, y, cosa);
}
if (flags & 2) // discard old velocity - replace old velocity with new velocity
{
self->velx = vx;
self->vely = vy;
self->velz = vz;
}
else // add new velocity to old velocity
{
self->velx += vx;
self->vely += vy;
self->velz += vz;
}
if (was_moving)
{
CheckStopped(self);
}
}