- converted g_strife to full floating point use, except the floor height changing stuff in A_LightGoesOut.

This commit is contained in:
Christoph Oelckers 2016-03-22 12:42:27 +01:00
parent 5a4b974187
commit a652c061f6
36 changed files with 192 additions and 493 deletions

View file

@ -1003,6 +1003,11 @@ public:
} }
} }
DVector3 Vec3Offset(const DVector3 &ofs, bool absolute = false)
{
return Vec3Offset(ofs.X, ofs.Y, ofs.Z, absolute);
}
fixedvec3 _f_Vec3Angle(fixed_t length, angle_t angle, fixed_t dz, bool absolute = false) fixedvec3 _f_Vec3Angle(fixed_t length, angle_t angle, fixed_t dz, bool absolute = false)
{ {
if (absolute) if (absolute)
@ -1270,7 +1275,13 @@ public:
FSoundIDNoInit WallBounceSound; FSoundIDNoInit WallBounceSound;
FSoundIDNoInit CrushPainSound; FSoundIDNoInit CrushPainSound;
fixed_t MaxDropOffHeight, MaxStepHeight; fixed_t MaxDropOffHeight;
double MaxStepHeight;
fixed_t _f_MaxStepHeight()
{
return FLOAT2FIXED(MaxStepHeight);
}
SDWORD Mass; SDWORD Mass;
SWORD PainChance; SWORD PainChance;
int PainThreshold; int PainThreshold;
@ -1728,6 +1739,15 @@ inline T *Spawn(const DVector3 &pos, replace_t allowreplacement)
return static_cast<T *>(AActor::StaticSpawn(RUNTIME_TEMPLATE_CLASS(T), FLOAT2FIXED(pos.X), FLOAT2FIXED(pos.Y), zz, allowreplacement)); return static_cast<T *>(AActor::StaticSpawn(RUNTIME_TEMPLATE_CLASS(T), FLOAT2FIXED(pos.X), FLOAT2FIXED(pos.Y), zz, allowreplacement));
} }
template<class T>
inline T *Spawn(double x, double y, double z, replace_t allowreplacement)
{
fixed_t zz;
if (z != ONFLOORZ && z != ONCEILINGZ && z != FLOATRANDZ) zz = FLOAT2FIXED(z);
else zz = (int)z;
return static_cast<T *>(AActor::StaticSpawn(RUNTIME_TEMPLATE_CLASS(T), FLOAT2FIXED(x), FLOAT2FIXED(y), zz, allowreplacement));
}
template<class T> template<class T>
inline T *Spawn() // for inventory items we do not need coordinates and replacement info. inline T *Spawn() // for inventory items we do not need coordinates and replacement info.
{ {

View file

@ -269,17 +269,17 @@ bool FCajunMaster::CleanAhead (AActor *thing, fixed_t x, fixed_t y, ticcmd_t *cm
if (!(thing->flags & MF_NOCLIP) ) if (!(thing->flags & MF_NOCLIP) )
{ {
fixed_t maxstep = thing->MaxStepHeight;
if (tm.ceilingz - tm.floorz < thing->Height) if (tm.ceilingz - tm.floorz < thing->Height)
return false; // doesn't fit return false; // doesn't fit
double maxmove = FIXED2FLOAT(MAXMOVEHEIGHT);
if (!(thing->flags&MF_MISSILE)) if (!(thing->flags&MF_MISSILE))
{ {
if(tm._f_floorz() > (thing->Sector->floorplane.ZatPoint (x, y)+MAXMOVEHEIGHT)) //Too high wall if(tm.floorz > (thing->Sector->floorplane._f_ZatPointF(x, y)+maxmove)) //Too high wall
return false; return false;
//Jumpable //Jumpable
if(tm._f_floorz()>(thing->Sector->floorplane.ZatPoint (x, y)+thing->MaxStepHeight)) if(tm.floorz > (thing->Sector->floorplane._f_ZatPointF(x, y)+thing->MaxStepHeight))
cmd->ucmd.buttons |= BT_JUMP; cmd->ucmd.buttons |= BT_JUMP;
@ -292,7 +292,7 @@ bool FCajunMaster::CleanAhead (AActor *thing, fixed_t x, fixed_t y, ticcmd_t *cm
// maxstep=37*FRACUNIT; // maxstep=37*FRACUNIT;
if ( !(thing->flags & MF_TELEPORT) && if ( !(thing->flags & MF_TELEPORT) &&
(tm._f_floorz() - thing->_f_Z() > maxstep ) ) (tm.floorz - thing->Z() > thing->MaxStepHeight) )
return false; // too big a step up return false; // too big a step up

View file

@ -404,7 +404,7 @@ public:
float FOV; // current field of vision float FOV; // current field of vision
fixed_t viewz; // focal origin above r.z fixed_t viewz; // focal origin above r.z
fixed_t viewheight; // base height above floor for viewz fixed_t viewheight; // base height above floor for viewz
fixed_t deltaviewheight; // squat speed. double deltaviewheight; // squat speed.
double bob; // bounded/scaled total velocity double bob; // bounded/scaled total velocity
// killough 10/98: used for realistic bobbing (i.e. not simply overall speed) // killough 10/98: used for realistic bobbing (i.e. not simply overall speed)
@ -502,9 +502,9 @@ public:
DAngle ConversationNPCAngle; DAngle ConversationNPCAngle;
bool ConversationFaceTalker; bool ConversationFaceTalker;
fixed_t GetDeltaViewHeight() const double GetDeltaViewHeight() const
{ {
return (mo->ViewHeight + crouchviewdelta - viewheight) >> 3; return FIXED2DBL((mo->ViewHeight + crouchviewdelta - viewheight) >> 3);
} }
void Uncrouch() void Uncrouch()

View file

@ -161,7 +161,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MinotaurAtk1)
if ((player = self->target->player) != NULL && if ((player = self->target->player) != NULL &&
player->mo == self->target) player->mo == self->target)
{ // Squish the player { // Squish the player
player->deltaviewheight = -16*FRACUNIT; player->deltaviewheight = -16;
} }
} }
return 0; return 0;
@ -350,7 +350,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MinotaurAtk3)
if ((player = self->target->player) != NULL && if ((player = self->target->player) != NULL &&
player->mo == self->target) player->mo == self->target)
{ // Squish the player { // Squish the player
player->deltaviewheight = -16*FRACUNIT; player->deltaviewheight = -16;
} }
} }
else else

View file

@ -168,7 +168,6 @@ bool P_UndoPlayerMorph (player_t *activator, player_t *player, int unmorphflag,
AWeapon *beastweap; AWeapon *beastweap;
APlayerPawn *mo; APlayerPawn *mo;
APlayerPawn *pmo; APlayerPawn *pmo;
angle_t angle;
pmo = player->mo; pmo = player->mo;
// [MH] // [MH]
@ -305,11 +304,10 @@ bool P_UndoPlayerMorph (player_t *activator, player_t *player, int unmorphflag,
} }
} }
angle = mo->_f_angle() >> ANGLETOFINESHIFT;
AActor *eflash = NULL; AActor *eflash = NULL;
if (exit_flash != NULL) if (exit_flash != NULL)
{ {
eflash = Spawn(exit_flash, pmo->Vec3Offset(20*finecosine[angle], 20*finesine[angle], TELEFOGHEIGHT), ALLOW_REPLACE); eflash = Spawn(exit_flash, pmo->Vec3Angle(20., mo->Angles.Yaw, TELEFOGHEIGHT), ALLOW_REPLACE);
if (eflash) eflash->target = mo; if (eflash) eflash->target = mo;
} }
mo->SetupWeaponSlots(); // Use original class's weapon slots. mo->SetupWeaponSlots(); // Use original class's weapon slots.

View file

@ -29,7 +29,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_HideDecepticon)
{ {
PARAM_ACTION_PROLOGUE; PARAM_ACTION_PROLOGUE;
EV_DoDoor (DDoor::doorClose, NULL, self, 999, 8*FRACUNIT, 0, 0, 0); EV_DoDoor (DDoor::doorClose, NULL, self, 999, 8., 0, 0, 0);
if (self->target != NULL && self->target->player != NULL) if (self->target != NULL && self->target->player != NULL)
{ {
P_NoiseAlert (self->target, self); P_NoiseAlert (self->target, self);

View file

@ -22,7 +22,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SpectreChunkSmall)
{ {
PARAM_ACTION_PROLOGUE; PARAM_ACTION_PROLOGUE;
AActor *foo = Spawn("AlienChunkSmall", self->PosPlusZ(10*FRACUNIT), ALLOW_REPLACE); AActor *foo = Spawn("AlienChunkSmall", self->PosPlusZ(10.), ALLOW_REPLACE);
if (foo != NULL) if (foo != NULL)
{ {
@ -43,7 +43,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SpectreChunkLarge)
{ {
PARAM_ACTION_PROLOGUE; PARAM_ACTION_PROLOGUE;
AActor *foo = Spawn("AlienChunkLarge", self->PosPlusZ(10*FRACUNIT), ALLOW_REPLACE); AActor *foo = Spawn("AlienChunkLarge", self->PosPlusZ(10.), ALLOW_REPLACE);
if (foo != NULL) if (foo != NULL)
{ {
@ -67,7 +67,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_Spectre3Attack)
if (self->target == NULL) if (self->target == NULL)
return 0; return 0;
AActor *foo = Spawn("SpectralLightningV2", self->PosPlusZ(32*FRACUNIT), ALLOW_REPLACE); AActor *foo = Spawn("SpectralLightningV2", self->PosPlusZ(32.), ALLOW_REPLACE);
foo->Vel.Z = -12; foo->Vel.Z = -12;
foo->target = self; foo->target = self;
@ -114,7 +114,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_AlienSpectreDeath)
switch (self->GetClass()->TypeName) switch (self->GetClass()->TypeName)
{ {
case NAME_AlienSpectre1: case NAME_AlienSpectre1:
EV_DoFloor (DFloor::floorLowerToLowest, NULL, 999, FRACUNIT, 0, -1, 0, false); EV_DoFloor (DFloor::floorLowerToLowest, NULL, 999, 1., 0., -1, 0, false);
log = 95; log = 95;
break; break;
@ -152,7 +152,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_AlienSpectreDeath)
{ // You wield the power of the complete Sigil. { // You wield the power of the complete Sigil.
log = 85; log = 85;
} }
EV_DoDoor (DDoor::doorOpen, NULL, NULL, 222, 8*FRACUNIT, 0, 0, 0); EV_DoDoor (DDoor::doorOpen, NULL, NULL, 222, 8., 0, 0, 0);
break; break;
} }
@ -188,7 +188,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_AlienSpectreDeath)
{ // Another Sigil piece. Woohoo! { // Another Sigil piece. Woohoo!
log = 83; log = 83;
} }
EV_DoFloor (DFloor::floorLowerToLowest, NULL, 666, FRACUNIT, 0, -1, 0, false); EV_DoFloor (DFloor::floorLowerToLowest, NULL, 666, 1., 0., -1, 0, false);
break; break;
default: default:

View file

@ -13,7 +13,7 @@ static bool CrusaderCheckRange (AActor *self)
{ {
if (self->reactiontime == 0 && P_CheckSight (self, self->target)) if (self->reactiontime == 0 && P_CheckSight (self, self->target))
{ {
return self->AproxDistance (self->target) < 264*FRACUNIT; return self->Distance2D (self->target) < 264.;
} }
return false; return false;
} }
@ -29,18 +29,18 @@ DEFINE_ACTION_FUNCTION(AActor, A_CrusaderChoose)
{ {
A_FaceTarget (self); A_FaceTarget (self);
self->Angles.Yaw -= 180./16; self->Angles.Yaw -= 180./16;
P_SpawnMissileZAimed (self, self->_f_Z() + 40*FRACUNIT, self->target, PClass::FindActor("FastFlameMissile")); P_SpawnMissileZAimed (self, self->Z() + 40, self->target, PClass::FindActor("FastFlameMissile"));
} }
else else
{ {
if (P_CheckMissileRange (self)) if (P_CheckMissileRange (self))
{ {
A_FaceTarget (self); A_FaceTarget (self);
P_SpawnMissileZAimed (self, self->_f_Z() + 56*FRACUNIT, self->target, PClass::FindActor("CrusaderMissile")); P_SpawnMissileZAimed (self, self->Z() + 56, self->target, PClass::FindActor("CrusaderMissile"));
self->Angles.Yaw -= 45./32; self->Angles.Yaw -= 45./32;
P_SpawnMissileZAimed (self, self->_f_Z() + 40*FRACUNIT, self->target, PClass::FindActor("CrusaderMissile")); P_SpawnMissileZAimed (self, self->Z() + 40, self->target, PClass::FindActor("CrusaderMissile"));
self->Angles.Yaw += 45./16; self->Angles.Yaw += 45./16;
P_SpawnMissileZAimed (self, self->_f_Z() + 40*FRACUNIT, self->target, PClass::FindActor("CrusaderMissile")); P_SpawnMissileZAimed (self, self->Z() + 40, self->target, PClass::FindActor("CrusaderMissile"));
self->Angles.Yaw -= 45./16; self->Angles.Yaw -= 45./16;
self->reactiontime += 15; self->reactiontime += 15;
} }
@ -54,7 +54,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CrusaderSweepLeft)
PARAM_ACTION_PROLOGUE; PARAM_ACTION_PROLOGUE;
self->Angles.Yaw += 90./16; self->Angles.Yaw += 90./16;
AActor *misl = P_SpawnMissileZAimed (self, self->_f_Z() + 48*FRACUNIT, self->target, PClass::FindActor("FastFlameMissile")); AActor *misl = P_SpawnMissileZAimed (self, self->Z() + 48, self->target, PClass::FindActor("FastFlameMissile"));
if (misl != NULL) if (misl != NULL)
{ {
misl->Vel.Z += 1; misl->Vel.Z += 1;
@ -67,7 +67,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CrusaderSweepRight)
PARAM_ACTION_PROLOGUE; PARAM_ACTION_PROLOGUE;
self->Angles.Yaw -= 90./16; self->Angles.Yaw -= 90./16;
AActor *misl = P_SpawnMissileZAimed (self, self->_f_Z() + 48*FRACUNIT, self->target, PClass::FindActor("FastFlameMissile")); AActor *misl = P_SpawnMissileZAimed (self, self->Z() + 48, self->target, PClass::FindActor("FastFlameMissile"));
if (misl != NULL) if (misl != NULL)
{ {
misl->Vel.Z += 1; misl->Vel.Z += 1;
@ -94,7 +94,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CrusaderDeath)
if (CheckBossDeath (self)) if (CheckBossDeath (self))
{ {
EV_DoFloor (DFloor::floorLowerToLowest, NULL, 667, FRACUNIT, 0, -1, 0, false); EV_DoFloor (DFloor::floorLowerToLowest, NULL, 667, 1., 0., -1, 0, false);
} }
return 0; return 0;
} }

View file

@ -27,8 +27,7 @@ void A_SpectralMissile (AActor *self, const char *missilename)
{ {
if (self->target != NULL) if (self->target != NULL)
{ {
AActor *missile = P_SpawnMissileXYZ (self->PosPlusZ(32*FRACUNIT), AActor *missile = P_SpawnMissileXYZ (self->PosPlusZ(32.), self, self->target, PClass::FindActor(missilename), false);
self, self->target, PClass::FindActor(missilename), false);
if (missile != NULL) if (missile != NULL)
{ {
missile->tracer = self->target; missile->tracer = self->target;
@ -78,7 +77,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SpawnEntity)
{ {
PARAM_ACTION_PROLOGUE; PARAM_ACTION_PROLOGUE;
AActor *entity = Spawn("EntityBoss", self->PosPlusZ(70*FRACUNIT), ALLOW_REPLACE); AActor *entity = Spawn("EntityBoss", self->PosPlusZ(70), ALLOW_REPLACE);
if (entity != NULL) if (entity != NULL)
{ {
entity->Angles.Yaw = self->Angles.Yaw; entity->Angles.Yaw = self->Angles.Yaw;
@ -94,7 +93,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_EntityDeath)
PARAM_ACTION_PROLOGUE; PARAM_ACTION_PROLOGUE;
AActor *second; AActor *second;
double secondRadius = FIXED2DBL(GetDefaultByName("EntitySecond")->_f_radius() * 2); double secondRadius = GetDefaultByName("EntitySecond")->radius * 2;
static const double turns[3] = { 0, 90, -90 }; static const double turns[3] = { 0, 90, -90 };
const double velmul[3] = { 4.8828125f, secondRadius*4, secondRadius*4 }; const double velmul[3] = { 4.8828125f, secondRadius*4, secondRadius*4 };

View file

@ -23,7 +23,7 @@ bool InquisitorCheckDistance (AActor *self)
{ {
if (self->reactiontime == 0 && P_CheckSight (self, self->target)) if (self->reactiontime == 0 && P_CheckSight (self, self->target))
{ {
return self->AproxDistance (self->target) < 264*FRACUNIT; return self->Distance2D (self->target) < 264.;
} }
return false; return false;
} }
@ -61,20 +61,20 @@ DEFINE_ACTION_FUNCTION(AActor, A_InquisitorAttack)
A_FaceTarget (self); A_FaceTarget (self);
self->_f_AddZ(32*FRACUNIT); self->AddZ(32);
self->Angles.Yaw -= 45./32; self->Angles.Yaw -= 45./32;
proj = P_SpawnMissileZAimed (self, self->_f_Z(), self->target, PClass::FindActor("InquisitorShot")); proj = P_SpawnMissileZAimed (self, self->Z(), self->target, PClass::FindActor("InquisitorShot"));
if (proj != NULL) if (proj != NULL)
{ {
proj->Vel.Z += 9; proj->Vel.Z += 9;
} }
self->Angles.Yaw += 45./16; self->Angles.Yaw += 45./16;
proj = P_SpawnMissileZAimed (self, self->_f_Z(), self->target, PClass::FindActor("InquisitorShot")); proj = P_SpawnMissileZAimed (self, self->Z(), self->target, PClass::FindActor("InquisitorShot"));
if (proj != NULL) if (proj != NULL)
{ {
proj->Vel.Z += 16; proj->Vel.Z += 16;
} }
self->_f_AddZ(-32*FRACUNIT); self->AddZ(-32);
return 0; return 0;
} }
@ -89,7 +89,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_InquisitorJump)
return 0; return 0;
S_Sound (self, CHAN_ITEM|CHAN_LOOP, "inquisitor/jump", 1, ATTN_NORM); S_Sound (self, CHAN_ITEM|CHAN_LOOP, "inquisitor/jump", 1, ATTN_NORM);
self->_f_AddZ(64*FRACUNIT); self->AddZ(64);
A_FaceTarget (self); A_FaceTarget (self);
speed = self->Speed * (2./3); speed = self->Speed * (2./3);
self->VelFromAngle(speed); self->VelFromAngle(speed);
@ -127,7 +127,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_TossArm)
{ {
PARAM_ACTION_PROLOGUE; PARAM_ACTION_PROLOGUE;
AActor *foo = Spawn("InquisitorArm", self->PosPlusZ(24*FRACUNIT), ALLOW_REPLACE); AActor *foo = Spawn("InquisitorArm", self->PosPlusZ(24), ALLOW_REPLACE);
foo->Angles.Yaw = self->Angles.Yaw - 90. + pr_inq.Random2() * (360./1024.); foo->Angles.Yaw = self->Angles.Yaw - 90. + pr_inq.Random2() * (360./1024.);
foo->VelFromAngle(foo->Speed / 8); foo->VelFromAngle(foo->Speed / 8);
foo->Vel.Z = pr_inq() / 64.; foo->Vel.Z = pr_inq() / 64.;

View file

@ -37,7 +37,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_LoremasterChain)
S_Sound (self, CHAN_BODY, "loremaster/active", 1, ATTN_NORM); S_Sound (self, CHAN_BODY, "loremaster/active", 1, ATTN_NORM);
Spawn("LoreShot2", self->Pos(), ALLOW_REPLACE); Spawn("LoreShot2", self->Pos(), ALLOW_REPLACE);
Spawn("LoreShot2", self->Vec3Offset(-(self->_f_velx() >> 1), -(self->_f_vely() >> 1), -(self->_f_velz() >> 1)), ALLOW_REPLACE); Spawn("LoreShot2", self->Vec3Offset(-self->Vel/2.), ALLOW_REPLACE);
Spawn("LoreShot2", self->Vec3Offset(-self->_f_velx(), -self->_f_vely(), -self->_f_velz()), ALLOW_REPLACE); Spawn("LoreShot2", self->Vec3Offset(-self->Vel), ALLOW_REPLACE);
return 0; return 0;
} }

View file

@ -130,7 +130,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SpawnProgrammerBase)
{ {
PARAM_ACTION_PROLOGUE; PARAM_ACTION_PROLOGUE;
AActor *foo = Spawn("ProgrammerBase", self->PosPlusZ(24*FRACUNIT), ALLOW_REPLACE); AActor *foo = Spawn("ProgrammerBase", self->PosPlusZ(24), ALLOW_REPLACE);
if (foo != NULL) if (foo != NULL)
{ {
foo->Angles.Yaw = self->Angles.Yaw + 180. + pr_prog.Random2() * (360. / 1024.); foo->Angles.Yaw = self->Angles.Yaw + 180. + pr_prog.Random2() * (360. / 1024.);

View file

@ -78,10 +78,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_Beacon)
AActor *owner = self->target; AActor *owner = self->target;
AActor *rebel; AActor *rebel;
angle_t an;
rebel = Spawn("Rebel1", self->PosAtZ(self->floorz), ALLOW_REPLACE); rebel = Spawn("Rebel1", self->PosAtZ(self->floorz), ALLOW_REPLACE);
if (!P_TryMove (rebel, rebel->X(), rebel->Y(), true)) if (!P_TryMove (rebel, rebel->Pos(), true))
{ {
rebel->Destroy (); rebel->Destroy ();
return 0; return 0;
@ -116,8 +115,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_Beacon)
rebel->SetState (rebel->SeeState); rebel->SetState (rebel->SeeState);
rebel->Angles.Yaw = self->Angles.Yaw; rebel->Angles.Yaw = self->Angles.Yaw;
an = self->_f_angle() >> ANGLETOFINESHIFT; Spawn<ATeleportFog> (rebel->Vec3Angle(20., self->Angles.Yaw, TELEFOGHEIGHT), ALLOW_REPLACE);
Spawn<ATeleportFog> (rebel->Vec3Offset(20*finecosine[an], 20*finesine[an], TELEFOGHEIGHT), ALLOW_REPLACE);
if (--self->health < 0) if (--self->health < 0)
{ {
self->SetState(self->FindState(NAME_Death)); self->SetState(self->FindState(NAME_Death));

View file

@ -53,14 +53,14 @@ DEFINE_ACTION_FUNCTION(AActor, A_SentinelAttack)
return 0; return 0;
} }
missile = P_SpawnMissileZAimed (self, self->_f_Z() + 32*FRACUNIT, self->target, PClass::FindActor("SentinelFX2")); missile = P_SpawnMissileZAimed (self, self->Z() + 32, self->target, PClass::FindActor("SentinelFX2"));
if (missile != NULL && (missile->Vel.X != 0 || missile->Vel.Y != 0)) if (missile != NULL && (missile->Vel.X != 0 || missile->Vel.Y != 0))
{ {
for (int i = 8; i > 1; --i) for (int i = 8; i > 1; --i)
{ {
trail = Spawn("SentinelFX1", trail = Spawn("SentinelFX1",
self->_f_Vec3Angle(missile->_f_radius()*i, missile->_f_angle(), (missile->_f_velz() / 4 * i)), ALLOW_REPLACE); self->Vec3Angle(missile->radius*i, missile->Angles.Yaw, missile->Vel.Z / 4 * i), ALLOW_REPLACE);
if (trail != NULL) if (trail != NULL)
{ {
trail->target = self; trail->target = self;

View file

@ -135,7 +135,7 @@ IMPLEMENT_CLASS (APrisonPass)
bool APrisonPass::TryPickup (AActor *&toucher) bool APrisonPass::TryPickup (AActor *&toucher)
{ {
Super::TryPickup (toucher); Super::TryPickup (toucher);
EV_DoDoor (DDoor::doorOpen, NULL, toucher, 223, 2*FRACUNIT, 0, 0, 0); EV_DoDoor (DDoor::doorOpen, NULL, toucher, 223, 2., 0, 0, 0);
toucher->GiveInventoryType (QuestItemClasses[9]); toucher->GiveInventoryType (QuestItemClasses[9]);
return true; return true;
} }
@ -152,7 +152,7 @@ bool APrisonPass::TryPickup (AActor *&toucher)
bool APrisonPass::SpecialDropAction (AActor *dropper) bool APrisonPass::SpecialDropAction (AActor *dropper)
{ {
EV_DoDoor (DDoor::doorOpen, NULL, dropper, 223, 2*FRACUNIT, 0, 0, 0); EV_DoDoor (DDoor::doorOpen, NULL, dropper, 223, 2., 0, 0, 0);
Destroy (); Destroy ();
return true; return true;
} }
@ -210,7 +210,7 @@ IMPLEMENT_CLASS (AOpenDoor222)
bool AOpenDoor222::TryPickup (AActor *&toucher) bool AOpenDoor222::TryPickup (AActor *&toucher)
{ {
EV_DoDoor (DDoor::doorOpen, NULL, toucher, 222, 2*FRACUNIT, 0, 0, 0); EV_DoDoor (DDoor::doorOpen, NULL, toucher, 222, 2., 0, 0, 0);
GoAwayAndDie (); GoAwayAndDie ();
return true; return true;
} }
@ -229,14 +229,14 @@ IMPLEMENT_CLASS (ACloseDoor222)
bool ACloseDoor222::TryPickup (AActor *&toucher) bool ACloseDoor222::TryPickup (AActor *&toucher)
{ {
EV_DoDoor (DDoor::doorClose, NULL, toucher, 222, 2*FRACUNIT, 0, 0, 0); EV_DoDoor (DDoor::doorClose, NULL, toucher, 222, 2., 0, 0, 0);
GoAwayAndDie (); GoAwayAndDie ();
return true; return true;
} }
bool ACloseDoor222::SpecialDropAction (AActor *dropper) bool ACloseDoor222::SpecialDropAction (AActor *dropper)
{ {
EV_DoDoor (DDoor::doorClose, NULL, dropper, 222, 2*FRACUNIT, 0, 0, 0); EV_DoDoor (DDoor::doorClose, NULL, dropper, 222, 2., 0, 0, 0);
if (dropper->target->CheckLocalView (consoleplayer)) if (dropper->target->CheckLocalView (consoleplayer))
{ {
Printf ("You're dead! You set off the alarm.\n"); Printf ("You're dead! You set off the alarm.\n");
@ -260,14 +260,14 @@ IMPLEMENT_CLASS (AOpenDoor224)
bool AOpenDoor224::TryPickup (AActor *&toucher) bool AOpenDoor224::TryPickup (AActor *&toucher)
{ {
EV_DoDoor (DDoor::doorOpen, NULL, toucher, 224, 2*FRACUNIT, 0, 0, 0); EV_DoDoor (DDoor::doorOpen, NULL, toucher, 224, 2., 0, 0, 0);
GoAwayAndDie (); GoAwayAndDie ();
return true; return true;
} }
bool AOpenDoor224::SpecialDropAction (AActor *dropper) bool AOpenDoor224::SpecialDropAction (AActor *dropper)
{ {
EV_DoDoor (DDoor::doorOpen, NULL, dropper, 224, 2*FRACUNIT, 0, 0, 0); EV_DoDoor (DDoor::doorOpen, NULL, dropper, 224, 2., 0, 0, 0);
Destroy (); Destroy ();
return true; return true;
} }

View file

@ -58,354 +58,6 @@
// angle += pr_spawnmissile.Random2() << 22 // angle += pr_spawnmissile.Random2() << 22
// Note that these numbers are different from those used by all the other Doom engine games. // Note that these numbers are different from those used by all the other Doom engine games.
/* These mobjinfos have been converted:
0 ForceFieldGuard
1 StrifePlayer
2 WeaponSmith
3 BarKeep
4 Armorer
5 Medic
6 Peasant1
7 Peasant2
8 Peasant3
9 Peasant4
10 Peasant5
11 Peasant6
12 Peasant7
13 Peasant8
14 Peasant9
15 Peasant10
16 Peasant11
17 Peasant12
18 Peasant13
19 Peasant14
20 Peasant15
21 Peasant16
22 Peasant17
23 Peasant18
24 Peasant19
25 Peasant20
26 Peasant21
27 Peasant22
28 Zombie
29 AcolyteToBe
30 ZombieSpawner
31 Tank1
32 Tank2
33 Tank3
34 Tank4
35 Tank5
36 Tank6
37 KneelingGuy
38 Beggar1
39 Beggar2
40 Beggar3
41 Beggar4
42 Beggar5
43 Rebel1
44 Rebel2
45 Rebel3
46 Rebel4
47 Rebel5
48 Rebel6
49 Macil1
50 Macil2
51 RocketTrail
52 Reaver
53 AcolyteTan
54 AcolyteRed
55 AcolyteRust
56 AcolyteGray
57 AcolyteDGreen
58 AcolyteGold
59 AcolyteLGreen
60 AcolyteBlue
61 AcolyteShadow
62 Templar
63 Crusader
64 StrifeBishop
65 Oracle
66 Loremaster (aka Priest)
67 AlienSpectre1
68 AlienChunkSmall
69 AlienChunkLarge
70 AlienSpectre2
71 AlienSpectre3
72 AlienSpectre4
73 AlienSpectre5
74 EntityBoss
75 EntitySecond
76 EntityNest
77 EntityPod
78 SpectralLightningH1
79 SpectralLightningH2
80 SpectralLightningBall1
81 SpectralLightningBall2
82 SpectralLightningH3
83 SpectralLightningHTail
84 SpectralLightningBigBall1
85 SpectralLightningBigBall2
86 SpectralLightningV1
87 SpectralLightningV2
88 SpectralLightningSpot
89 SpectralLightningBigV1
90 SpectralLightningBigV2
91 Sentinel
92 Stalker
93 Inquisitor
94 InquisitorArm
95 Programmer
96 ProgrammerBase
97 LoreShot
98 LoreShot2
99 MiniMissile
100 CrusaderMissile
101 BishopMissile
102 ElectricBolt
103 PoisonBolt
104 SentinelFX1
105 SentinelFX2
106 HEGrenade
107 PhosphorousGrenade
108 InquisitorShot
109 PhosphorousFire
110 MaulerTorpedo
111 MaulerTorpedoWave
112 FlameMissile
113 FastFlameMissile
114 MaulerPuff
115 StrifePuff
116 StrifeSpark
117 Blood
118 TeleportFog
119 ItemFog
120 teleport destination
121 KlaxonWarningLight
122 CeilingTurret
123 Piston
124 Computer
125 MedPatch
126 MedicalKit
127 SurgeryKit
128 DegninOre
129 MetalArmor
130 LeatherArmor
131 WaterBottle
132 Mug
133 BaseKey
134 GovsKey
135 Passcard
136 IDBadge
137 PrisonKey
138 SeveredHand
139 Power1Key
140 Power2Key
141 Power3Key
142 GoldKey
143 IDCard
144 SilverKey
145 OracleKey
146 MilitaryID
147 OrderKey
148 WarehouseKey
149 BrassKey
150 RedCrystalKey
151 BlueCrystalKey
152 ChapelKey
153 CatacombKey
154 SecurityKey
155 CoreKey
156 MaulerKey
157 FactoryKey
158 MineKey
159 NewKey5
160 ShadowArmor
161 EnvironmentalSuit
162 GuardUniform
163 OfficersUniform
164 StrifeMap
165 Scanner
166
167 Targeter
168 Coin
169 Gold10
170 Gold25
171 Gold50
172 Gold300
173 BeldinsRing
174 OfferingChalice
175 Ear
176 Communicator
177 HEGrenadeRounds
178 PhosphorusGrenadeRounds
179 ClipOfBullets
180 BoxOfBullets
181 MiniMissiles
182 CrateOfMissiles
183 EnergyPod
184 EnergyPack
185 PoisonBolts
186 ElectricBolts
187 AmmoSatchel
188 AssaultGun
189 AssaultGunStanding
190 FlameThrower
191 FlameThrowerParts
192 MiniMissileLauncher
193 Mauler
194 StrifeCrossbow
195 StrifeGrenadeLauncher
196 Sigil1
197 Sigil2
198 Sigil3
199 Sigil4
200 Sigil5
201 PowerCrystal
202 RatBuddy
203 WoodenBarrel
204 ExplosiveBarrel2
205 TargetPractice
206 LightSilverFluorescent
207 LightBrownFluorescent
208 LightGoldFluorescent
209 LightGlobe
210 PillarTechno
211 PillarAztec
212 PillarAztecDamaged
213 PillarAztecRuined
214 PillarHugeTech
215 PillarAlienPower
216 SStalactiteBig
217 SStalactiteSmall
218 SStalagmiteBig
219 CavePillarTop
220 CavePillarBottom
221 SStalagmiteSmall
222 Candle
223 StrifeCandelabra
224 WaterDropOnFloor
225 WaterfallSplash
226 WaterDrip
227 WaterFountain
228 HeartsInTank
229 TeleportSwirl
230 DeadCrusader
231 DeadStrifePlayer
232 DeadPeasant
233 DeadAcolyte
234 DeadReaver
235 DeadRebel
236 SacrificedGuy
237 PileOfGuts
238 StrifeBurningBarrel
239 BurningBowl
240 BurningBrazier
241 SmallTorchLit
242 SmallTorchUnlit
243 CeilingChain
244 CageLight
245 Statue
246 StatueRuined
247 MediumTorch
248 OutsideLamp
249 PoleLantern
250 SRock1
251 SRock2
252 SRock3
253 SRock4
254 StickInWater
255 Rubble1
256 Rubble2
257 Rubble3
258 Rubble4
259 Rubble5
260 Rubble6
261 Rubble7
262 Rubble8
263 SurgeryCrab
264 LargeTorch
265 HugeTorch
266 PalmTree
267 BigTree2
268 PottedTree
269 TreeStub
270 ShortBush
271 TallBush
272 ChimneyStack
273 BarricadeColumn
274 Pot
275 Pitcher
276 Stool
277 MetalPot
278 Tub
279 Anvil
280 TechLampSilver
281 TechLampBrass
282 Tray
283 AmmoFiller
284 SigilBanner
285 RebelBoots
286 RebelHelmet
287 RebelShirt
288 PowerCoupling
289 BrokenPowerCoupling
290 AlienBubbleColumn
291 AlienFloorBubble
292 AlienCeilingBubble
293 AlienAspClimber
294 AlienSpiderLight
295 Meat
296 Junk
297 FireDroplet
298 AmmoFillup
299 HealthFillup
300 Info
301 RaiseAlarm
302 OpenDoor222
303 CloseDoor222
304 PrisonPass
305 OpenDoor224
306 UpgradeStamina
307 UpgradeAccuracy
308 InterrogatorReport (seems to be unused)
309 HealthTraining
310 GunTraining
311 OraclePass
312 QuestItem1
313 QuestItem2
314 QuestItem3
315 QuestItem4
316 QuestItem5
317 QuestItem6
318 QuestItem7
319 QuestItem8
320 QuestItem9
321 QuestItem10
322 QuestItem11
323 QuestItem12
324 QuestItem13
325 QuestItem14
326 QuestItem15
327 QuestItem16
328 QuestItem17
329 QuestItem18
330 QuestItem19
331 QuestItem20
332 QuestItem21
333 QuestItem22
334 QuestItem23
335 QuestItem24
336 QuestItem25
337 QuestItem26
338 QuestItem27
339 QuestItem28
340 QuestItem29
341 QuestItem30
342 QuestItem31
343 SlideshowStarter
*/
static FRandom pr_gibtosser ("GibTosser"); static FRandom pr_gibtosser ("GibTosser");
// Force Field Guard -------------------------------------------------------- // Force Field Guard --------------------------------------------------------
@ -564,8 +216,8 @@ void APowerCoupling::Die (AActor *source, AActor *inflictor, int dmgflags)
{ {
P_NoiseAlert (source, this); P_NoiseAlert (source, this);
} }
EV_DoDoor (DDoor::doorClose, NULL, players[i].mo, 225, 2*FRACUNIT, 0, 0, 0); EV_DoDoor (DDoor::doorClose, NULL, players[i].mo, 225, 2., 0, 0, 0);
EV_DoFloor (DFloor::floorLowerToHighest, NULL, 44, FRACUNIT, 0, -1, 0, false); EV_DoFloor (DFloor::floorLowerToHighest, NULL, 44, 1., 0., -1, 0, false);
players[i].mo->GiveInventoryType (QuestItemClasses[5]); players[i].mo->GiveInventoryType (QuestItemClasses[5]);
S_Sound (CHAN_VOICE, "svox/voc13", 1, ATTN_NORM); S_Sound (CHAN_VOICE, "svox/voc13", 1, ATTN_NORM);
players[i].SetLogNumber (13); players[i].SetLogNumber (13);
@ -599,7 +251,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_TossGib)
PARAM_ACTION_PROLOGUE; PARAM_ACTION_PROLOGUE;
const char *gibtype = (self->flags & MF_NOBLOOD) ? "Junk" : "Meat"; const char *gibtype = (self->flags & MF_NOBLOOD) ? "Junk" : "Meat";
AActor *gib = Spawn (gibtype, self->PosPlusZ(24*FRACUNIT), ALLOW_REPLACE); AActor *gib = Spawn (gibtype, self->PosPlusZ(24), ALLOW_REPLACE);
if (gib == NULL) if (gib == NULL)
{ {
@ -654,7 +306,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CheckTerrain)
sector_t *sec = self->Sector; sector_t *sec = self->Sector;
if (self->_f_Z() == sec->floorplane.ZatPoint(self) && sec->PortalBlocksMovement(sector_t::floor)) if (self->Z() == sec->floorplane.ZatPointF(self) && sec->PortalBlocksMovement(sector_t::floor))
{ {
if (sec->special == Damage_InstantDeath) if (sec->special == Damage_InstantDeath)
{ {
@ -714,8 +366,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_DropFire)
{ {
PARAM_ACTION_PROLOGUE; PARAM_ACTION_PROLOGUE;
AActor *drop = Spawn("FireDroplet", self->PosPlusZ(24*FRACUNIT), ALLOW_REPLACE); AActor *drop = Spawn("FireDroplet", self->PosPlusZ(24.), ALLOW_REPLACE);
drop->Vel.Z = -FRACUNIT; drop->Vel.Z = -1.;
P_RadiusAttack (self, self, 64, 64, NAME_Fire, 0); P_RadiusAttack (self, self, 64, 64, NAME_Fire, 0);
return 0; return 0;
} }

View file

@ -147,7 +147,7 @@ enum
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_AlertMonsters) DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_AlertMonsters)
{ {
PARAM_ACTION_PROLOGUE; PARAM_ACTION_PROLOGUE;
PARAM_FIXED_OPT(maxdist) { maxdist = 0; } PARAM_FLOAT_OPT(maxdist) { maxdist = 0; }
PARAM_INT_OPT(Flags) { Flags = 0; } PARAM_INT_OPT(Flags) { Flags = 0; }
AActor * target = NULL; AActor * target = NULL;
@ -379,8 +379,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_RocketInFlight)
AActor *trail; AActor *trail;
S_Sound (self, CHAN_VOICE, "misc/missileinflight", 1, ATTN_NORM); S_Sound (self, CHAN_VOICE, "misc/missileinflight", 1, ATTN_NORM);
P_SpawnPuff (self, PClass::FindActor("MiniMissilePuff"), self->_f_Pos(), self->_f_angle() - ANGLE_180, 2, PF_HITTHING); P_SpawnPuff (self, PClass::FindActor("MiniMissilePuff"), self->Pos(), self->Angles.Yaw - 180, self->Angles.Yaw - 180, 2, PF_HITTHING);
trail = Spawn("RocketTrail", self->Vec3Offset(-self->_f_velx(), -self->_f_vely(), 0), ALLOW_REPLACE); trail = Spawn("RocketTrail", self->Vec3Offset(-self->Vel.X, -self->Vel.Y, 0.), ALLOW_REPLACE);
if (trail != NULL) if (trail != NULL)
{ {
trail->Vel.Z = 1; trail->Vel.Z = 1;
@ -547,11 +547,11 @@ DEFINE_ACTION_FUNCTION(AActor, A_MaulerTorpedoWave)
PARAM_ACTION_PROLOGUE; PARAM_ACTION_PROLOGUE;
AActor *wavedef = GetDefaultByName("MaulerTorpedoWave"); AActor *wavedef = GetDefaultByName("MaulerTorpedoWave");
fixed_t savedz; double savedz;
self->Angles.Yaw += 180.; self->Angles.Yaw += 180.;
// If the torpedo hit the ceiling, it should still spawn the wave // If the torpedo hit the ceiling, it should still spawn the wave
savedz = self->_f_Z(); savedz = self->Z();
if (wavedef && self->ceilingz < wavedef->Top()) if (wavedef && self->ceilingz < wavedef->Top())
{ {
self->SetZ(self->ceilingz - wavedef->Height); self->SetZ(self->ceilingz - wavedef->Height);
@ -562,7 +562,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MaulerTorpedoWave)
self->Angles.Yaw += 4.5; self->Angles.Yaw += 4.5;
P_SpawnSubMissile (self, PClass::FindActor("MaulerTorpedoWave"), self->target); P_SpawnSubMissile (self, PClass::FindActor("MaulerTorpedoWave"), self->target);
} }
self->_f_SetZ(savedz); self->SetZ(savedz);
return 0; return 0;
} }
@ -639,7 +639,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_Burnination)
if (!(self->flags & MF_DROPPED)) if (!(self->flags & MF_DROPPED))
{ {
// Original x and y offsets seemed to be like this: // Original x and y offsets seemed to be like this:
// x + (((pr_phburn() + 12) & 31) << FRACBITS); // x + (((pr_phburn() + 12) & 31) << F.RACBITS);
// //
// But that creates a lop-sided burn because it won't use negative offsets. // But that creates a lop-sided burn because it won't use negative offsets.
int xofs, xrand = pr_phburn(); int xofs, xrand = pr_phburn();
@ -658,19 +658,16 @@ DEFINE_ACTION_FUNCTION(AActor, A_Burnination)
yofs = -yofs; yofs = -yofs;
} }
fixedvec2 pos = self->Vec2Offset(xofs << FRACBITS, yofs << FRACBITS); DVector2 pos = self->Vec2Offset((double)xofs, (double)yofs);
sector_t * sector = P_PointInSector(pos.x, pos.y); sector_t * sector = P_PointInSector(pos);
// The sector's floor is too high so spawn the flame elsewhere. // The sector's floor is too high so spawn the flame elsewhere.
if (sector->floorplane.ZatPoint(pos.x, pos.y) > self->_f_Z() + self->MaxStepHeight) if (sector->floorplane.ZatPoint(pos) > self->Z() + self->MaxStepHeight)
{ {
pos.x = self->_f_X(); pos = self->Pos();
pos.y = self->_f_Y();
} }
AActor *drop = Spawn<APhosphorousFire> ( AActor *drop = Spawn<APhosphorousFire> (pos.X, pos.Y, self->Z() + 4., ALLOW_REPLACE);
pos.x, pos.y,
self->_f_Z() + 4*FRACUNIT, ALLOW_REPLACE);
if (drop != NULL) if (drop != NULL)
{ {
drop->Vel.X = self->Vel.X + pr_phburn.Random2 (7); drop->Vel.X = self->Vel.X + pr_phburn.Random2 (7);
@ -693,13 +690,12 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FireGrenade)
{ {
PARAM_ACTION_PROLOGUE; PARAM_ACTION_PROLOGUE;
PARAM_CLASS(grenadetype, AActor); PARAM_CLASS(grenadetype, AActor);
PARAM_ANGLE(angleofs); PARAM_DANGLE(angleofs);
PARAM_STATE(flash) PARAM_STATE(flash)
player_t *player = self->player; player_t *player = self->player;
AActor *grenade; AActor *grenade;
angle_t an; DAngle an;
fixed_t tworadii;
AWeapon *weapon; AWeapon *weapon;
if (player == NULL || grenadetype == NULL) if (player == NULL || grenadetype == NULL)
@ -715,9 +711,9 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FireGrenade)
if (grenadetype != NULL) if (grenadetype != NULL)
{ {
self->_f_AddZ(32*FRACUNIT); self->AddZ(32);
grenade = P_SpawnSubMissile (self, grenadetype, self); grenade = P_SpawnSubMissile (self, grenadetype, self);
self->_f_AddZ(-32*FRACUNIT); self->AddZ(-32);
if (grenade == NULL) if (grenade == NULL)
return 0; return 0;
@ -728,20 +724,10 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FireGrenade)
grenade->Vel.Z = (-self->Angles.Pitch.TanClamped()) * grenade->Speed + 8; grenade->Vel.Z = (-self->Angles.Pitch.TanClamped()) * grenade->Speed + 8;
fixedvec2 offset; DVector2 offset = self->Angles.Yaw.ToVector(self->radius + grenade->radius);
DAngle an = self->Angles.Yaw + angleofs;
an = self->_f_angle() >> ANGLETOFINESHIFT; offset += an.ToVector(15);
tworadii = self->_f_radius() + grenade->_f_radius(); grenade->SetOrigin(grenade->Vec3Offset(offset.X, offset.Y, 0.), false);
offset.x = FixedMul (finecosine[an], tworadii);
offset.y = FixedMul (finesine[an], tworadii);
an = self->_f_angle() + angleofs;
an >>= ANGLETOFINESHIFT;
offset.x += FixedMul (finecosine[an], 15*FRACUNIT);
offset.y += FixedMul (finesine[an], 15*FRACUNIT);
fixedvec2 newpos = grenade->Vec2Offset(offset.x, offset.y);
grenade->SetOrigin(newpos.x, newpos.y, grenade->_f_Z(), false);
} }
return 0; return 0;
} }
@ -995,7 +981,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireSigil1)
} }
else else
{ {
spot = Spawn("SpectralLightningSpot", self->_f_Pos(), ALLOW_REPLACE); spot = Spawn("SpectralLightningSpot", self->Pos(), ALLOW_REPLACE);
if (spot != NULL) if (spot != NULL)
{ {
spot->VelFromAngle(self->Angles.Yaw, 28.); spot->VelFromAngle(self->Angles.Yaw, 28.);

View file

@ -18,9 +18,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_Bang4Cloud)
{ {
PARAM_ACTION_PROLOGUE; PARAM_ACTION_PROLOGUE;
fixed_t xo = (pr_bang4cloud.Random2() & 3) * 10240; double xo = (pr_bang4cloud.Random2() & 3) * (10. / 64);
fixed_t yo = (pr_bang4cloud.Random2() & 3) * 10240; double yo = (pr_bang4cloud.Random2() & 3) * (10. / 64);
Spawn("Bang4Cloud", self->Vec3Offset(xo, yo, 0), ALLOW_REPLACE); Spawn("Bang4Cloud", self->Vec3Offset(xo, yo, 0.), ALLOW_REPLACE);
return 0; return 0;
} }

View file

@ -327,7 +327,7 @@ private:
if (ItemFlash > 0) if (ItemFlash > 0)
{ {
ItemFlash -= FRACUNIT/14; ItemFlash -= 1/14.;
if (ItemFlash < 0) if (ItemFlash < 0)
{ {
ItemFlash = 0; ItemFlash = 0;
@ -379,7 +379,7 @@ private:
void FlashItem (const PClass *itemtype) void FlashItem (const PClass *itemtype)
{ {
ItemFlash = FRACUNIT*3/4; ItemFlash = 0.75;
} }
void DrawMainBar () void DrawMainBar ()
@ -454,7 +454,7 @@ private:
screen->DrawTexture (Images[CursorImage], screen->DrawTexture (Images[CursorImage],
42 + 35*i + ST_X, 12 + ST_Y, 42 + 35*i + ST_X, 12 + ST_Y,
DTA_Bottom320x200, Scaled, DTA_Bottom320x200, Scaled,
DTA_Alpha, OPAQUE - ItemFlash, DTA_AlphaF, 1. - ItemFlash,
TAG_DONE); TAG_DONE);
} }
if (item->Icon.isValid()) if (item->Icon.isValid())
@ -526,7 +526,7 @@ private:
DTA_HUDRules, HUD_Normal, DTA_HUDRules, HUD_Normal,
DTA_LeftOffset, cursor->GetWidth(), DTA_LeftOffset, cursor->GetWidth(),
DTA_TopOffset, cursor->GetHeight(), DTA_TopOffset, cursor->GetHeight(),
DTA_Alpha, ItemFlash, DTA_AlphaF, ItemFlash,
TAG_DONE); TAG_DONE);
} }
DrINumberOuter (CPlayer->mo->InvSel->Amount, -51, -10, false, 7); DrINumberOuter (CPlayer->mo->InvSel->Amount, -51, -10, false, 7);
@ -583,7 +583,7 @@ private:
left = screen->GetWidth()/2 - 160*CleanXfac; left = screen->GetWidth()/2 - 160*CleanXfac;
top = bottom + height * yscale; top = bottom + height * yscale;
screen->DrawTexture (Images[back], left, top, DTA_CleanNoMove, true, DTA_Alpha, FRACUNIT*3/4, TAG_DONE); screen->DrawTexture (Images[back], left, top, DTA_CleanNoMove, true, DTA_AlphaF, 0.75, TAG_DONE);
screen->DrawTexture (Images[bars], left, top, DTA_CleanNoMove, true, TAG_DONE); screen->DrawTexture (Images[bars], left, top, DTA_CleanNoMove, true, TAG_DONE);
@ -847,7 +847,7 @@ private:
int CursorImage; int CursorImage;
int CurrentPop, PendingPop, PopHeight, PopHeightChange; int CurrentPop, PendingPop, PopHeight, PopHeightChange;
int KeyPopPos, KeyPopScroll; int KeyPopPos, KeyPopScroll;
fixed_t ItemFlash; double ItemFlash;
}; };
IMPLEMENT_CLASS(DStrifeStatusBar); IMPLEMENT_CLASS(DStrifeStatusBar);

View file

@ -133,6 +133,13 @@ const char* GameInfoBorders[] =
gameinfo.key = static_cast<float> (sc.Float); \ gameinfo.key = static_cast<float> (sc.Float); \
} }
#define GAMEINFOKEY_DOUBLE(key, variable) \
else if(nextKey.CompareNoCase(variable) == 0) \
{ \
sc.MustGetFloat(); \
gameinfo.key = sc.Float; \
}
#define GAMEINFOKEY_FIXED(key, variable) \ #define GAMEINFOKEY_FIXED(key, variable) \
else if(nextKey.CompareNoCase(variable) == 0) \ else if(nextKey.CompareNoCase(variable) == 0) \
{ \ { \
@ -310,7 +317,7 @@ void FMapInfoParser::ParseGameInfo()
GAMEINFOKEY_STRING(PauseSign, "pausesign") GAMEINFOKEY_STRING(PauseSign, "pausesign")
GAMEINFOKEY_STRING(quitSound, "quitSound") GAMEINFOKEY_STRING(quitSound, "quitSound")
GAMEINFOKEY_STRING(BorderFlat, "borderFlat") GAMEINFOKEY_STRING(BorderFlat, "borderFlat")
GAMEINFOKEY_FIXED(telefogheight, "telefogheight") GAMEINFOKEY_DOUBLE(telefogheight, "telefogheight")
GAMEINFOKEY_FIXED(gibfactor, "gibfactor") GAMEINFOKEY_FIXED(gibfactor, "gibfactor")
GAMEINFOKEY_INT(defKickback, "defKickback") GAMEINFOKEY_INT(defKickback, "defKickback")
GAMEINFOKEY_STRING(SkyFlatName, "SkyFlatName") GAMEINFOKEY_STRING(SkyFlatName, "SkyFlatName")

View file

@ -138,7 +138,7 @@ struct gameinfo_t
fixed_t Armor2Percent; fixed_t Armor2Percent;
FString quitSound; FString quitSound;
gameborder_t Border; gameborder_t Border;
int telefogheight; double telefogheight;
int defKickback; int defKickback;
FString translator; FString translator;
DWORD defaultbloodcolor; DWORD defaultbloodcolor;

View file

@ -811,7 +811,7 @@ void P_LineOpening_XFloors (FLineOpening &open, AActor * thing, const line_t *li
highestfloorsec = j == 0 ? linedef->frontsector : linedef->backsector; highestfloorsec = j == 0 ? linedef->frontsector : linedef->backsector;
highestfloorplanes[j] = rover->top.plane; highestfloorplanes[j] = rover->top.plane;
} }
if(ff_top > lowestfloor[j] && ff_top <= thing->_f_Z() + thing->MaxStepHeight) lowestfloor[j] = ff_top; if(ff_top > lowestfloor[j] && ff_top <= thing->_f_Z() + thing->_f_MaxStepHeight()) lowestfloor[j] = ff_top;
} }
} }

View file

@ -299,7 +299,7 @@ bool P_LineOpening_3dMidtex(AActor *thing, const line_t *linedef, FLineOpening &
} }
// returns true if it touches the midtexture // returns true if it touches the midtexture
return (abs(thing->_f_Z() - tt) <= thing->MaxStepHeight); return (abs(thing->_f_Z() - tt) <= thing->_f_MaxStepHeight());
} }
} }
return false; return false;

View file

@ -4214,7 +4214,7 @@ bool DLevelScript::DoCheckActorTexture(int tid, AActor *activator, int string, b
if (floor) if (floor)
{ {
actor->Sector->NextLowestFloorAt(actor->_f_X(), actor->_f_Y(), actor->_f_Z(), 0, actor->MaxStepHeight, &resultsec, &resffloor); actor->Sector->NextLowestFloorAt(actor->_f_X(), actor->_f_Y(), actor->_f_Z(), 0, actor->_f_MaxStepHeight(), &resultsec, &resffloor);
secpic = resffloor ? *resffloor->top.texture : resultsec->planes[sector_t::floor].Texture; secpic = resffloor ? *resffloor->top.texture : resultsec->planes[sector_t::floor].Texture;
} }
else else

View file

@ -576,7 +576,7 @@ bool P_Move (AActor *actor)
!((actor->flags & MF_NOGRAVITY) || (actor->flags6 & MF6_CANJUMP)) !((actor->flags & MF_NOGRAVITY) || (actor->flags6 & MF6_CANJUMP))
&& actor->Z() > actor->floorz && !(actor->flags2 & MF2_ONMOBJ)) && actor->Z() > actor->floorz && !(actor->flags2 & MF2_ONMOBJ))
{ {
if (actor->_f_Z() <= actor->_f_floorz() + actor->MaxStepHeight) if (actor->Z() <= actor->floorz + actor->MaxStepHeight)
{ {
double savedz = actor->Z(); double savedz = actor->Z();
actor->SetZ(actor->floorz); actor->SetZ(actor->floorz);

View file

@ -50,6 +50,11 @@ void P_DaggerAlert (AActor *target, AActor *emitter);
void P_RecursiveSound (sector_t *sec, AActor *soundtarget, bool splash, int soundblocks, AActor *emitter=NULL, fixed_t maxdist=0); void P_RecursiveSound (sector_t *sec, AActor *soundtarget, bool splash, int soundblocks, AActor *emitter=NULL, fixed_t maxdist=0);
bool P_HitFriend (AActor *self); bool P_HitFriend (AActor *self);
void P_NoiseAlert (AActor *target, AActor *emmiter, bool splash=false, fixed_t maxdist=0); void P_NoiseAlert (AActor *target, AActor *emmiter, bool splash=false, fixed_t maxdist=0);
inline void P_NoiseAlert(AActor *target, AActor *emmiter, bool splash, double maxdist)
{
P_NoiseAlert(target, emmiter, splash, FLOAT2FIXED(maxdist));
}
bool P_CheckMeleeRange2 (AActor *actor); bool P_CheckMeleeRange2 (AActor *actor);
bool P_Move (AActor *actor); bool P_Move (AActor *actor);
bool P_TryWalk (AActor *actor); bool P_TryWalk (AActor *actor);

View file

@ -189,6 +189,10 @@ inline AActor *P_SpawnMissileAngleZSpeed(AActor *source, double z, PClassActor *
return P_SpawnMissileAngleZSpeed(source, FLOAT2FIXED(z), type, angle.BAMs(), FLOAT2FIXED(vz), FLOAT2FIXED(speed), owner, checkspawn); return P_SpawnMissileAngleZSpeed(source, FLOAT2FIXED(z), type, angle.BAMs(), FLOAT2FIXED(vz), FLOAT2FIXED(speed), owner, checkspawn);
} }
AActor *P_SpawnMissileZAimed (AActor *source, fixed_t z, AActor *dest, PClassActor *type); AActor *P_SpawnMissileZAimed (AActor *source, fixed_t z, AActor *dest, PClassActor *type);
inline AActor *P_SpawnMissileZAimed(AActor *source, double z, AActor *dest, PClassActor *type)
{
return P_SpawnMissileZAimed(source, FLOAT2FIXED(z), dest, type);
}
AActor *P_SpawnPlayerMissile (AActor* source, PClassActor *type); AActor *P_SpawnPlayerMissile (AActor* source, PClassActor *type);
AActor *P_SpawnPlayerMissile (AActor *source, PClassActor *type, DAngle angle); AActor *P_SpawnPlayerMissile (AActor *source, PClassActor *type, DAngle angle);

View file

@ -292,7 +292,7 @@ void P_GetFloorCeilingZ(FCheckPosition &tmf, int flags)
F3DFloor *ffc, *fff; F3DFloor *ffc, *fff;
tmf.ceilingz = FIXED2DBL(sec->NextHighestCeilingAt(tmf.x, tmf.y, tmf.z, tmf.z + tmf.thing->_f_height(), flags, &tmf.ceilingsector, &ffc)); tmf.ceilingz = FIXED2DBL(sec->NextHighestCeilingAt(tmf.x, tmf.y, tmf.z, tmf.z + tmf.thing->_f_height(), flags, &tmf.ceilingsector, &ffc));
tmf.dropoffz = sec->NextLowestFloorAt(tmf.x, tmf.y, tmf.z, flags, tmf.thing->MaxStepHeight, &tmf.floorsector, &fff); tmf.dropoffz = sec->NextLowestFloorAt(tmf.x, tmf.y, tmf.z, flags, tmf.thing->_f_MaxStepHeight(), &tmf.floorsector, &fff);
tmf.floorz = FIXED2DBL(tmf.dropoffz); tmf.floorz = FIXED2DBL(tmf.dropoffz);
if (fff) if (fff)
@ -1224,7 +1224,7 @@ bool PIT_CheckThing(FMultiBlockThingsIterator &it, FMultiBlockThingsIterator::Ch
{ {
// [RH] Let monsters walk on actors as well as floors // [RH] Let monsters walk on actors as well as floors
if ((tm.thing->flags3 & MF3_ISMONSTER) && if ((tm.thing->flags3 & MF3_ISMONSTER) &&
topz >= tm._f_floorz() && topz <= tm.thing->_f_Z() + tm.thing->MaxStepHeight) topz >= tm._f_floorz() && topz <= tm.thing->_f_Z() + tm.thing->_f_MaxStepHeight())
{ {
// The commented-out if is an attempt to prevent monsters from walking off a // The commented-out if is an attempt to prevent monsters from walking off a
// thing further than they would walk off a ledge. I can't think of an easy // thing further than they would walk off a ledge. I can't think of an easy
@ -1549,7 +1549,7 @@ bool PIT_CheckThing(FMultiBlockThingsIterator &it, FMultiBlockThingsIterator::Ch
// [RH] The next condition is to compensate for the extra height // [RH] The next condition is to compensate for the extra height
// that gets added by P_CheckPosition() so that you cannot pick // that gets added by P_CheckPosition() so that you cannot pick
// up things that are above your true height. // up things that are above your true height.
&& thing->_f_Z() < tm.thing->_f_Top() - tm.thing->MaxStepHeight) && thing->Z() < tm.thing->Top() - tm.thing->MaxStepHeight)
{ // Can be picked up by tmthing { // Can be picked up by tmthing
P_TouchSpecialThing(thing, tm.thing); // can remove thing P_TouchSpecialThing(thing, tm.thing); // can remove thing
} }
@ -1645,7 +1645,7 @@ bool P_CheckPosition(AActor *thing, fixed_t x, fixed_t y, FCheckPosition &tm, bo
thingblocker = NULL; thingblocker = NULL;
if (thing->player) if (thing->player)
{ // [RH] Fake taller height to catch stepping up into things. { // [RH] Fake taller height to catch stepping up into things.
thing->Height = realHeight + FIXED2DBL(thing->MaxStepHeight); thing->Height = realHeight + thing->MaxStepHeight;
} }
tm.stepthing = NULL; tm.stepthing = NULL;
@ -1671,17 +1671,17 @@ bool P_CheckPosition(AActor *thing, fixed_t x, fixed_t y, FCheckPosition &tm, bo
return false; return false;
} }
else if (!BlockingMobj->player && !(thing->flags & (MF_FLOAT | MF_MISSILE | MF_SKULLFLY)) && else if (!BlockingMobj->player && !(thing->flags & (MF_FLOAT | MF_MISSILE | MF_SKULLFLY)) &&
BlockingMobj->_f_Top() - thing->_f_Z() <= thing->MaxStepHeight) BlockingMobj->Top() - thing->Z() <= thing->MaxStepHeight)
{ {
if (thingblocker == NULL || if (thingblocker == NULL ||
BlockingMobj->_f_Z() > thingblocker->_f_Z()) BlockingMobj->Z() > thingblocker->Z())
{ {
thingblocker = BlockingMobj; thingblocker = BlockingMobj;
} }
thing->BlockingMobj = NULL; thing->BlockingMobj = NULL;
} }
else if (thing->player && else if (thing->player &&
thing->_f_Top() - BlockingMobj->_f_Z() <= thing->MaxStepHeight) thing->Top() - BlockingMobj->Z() <= thing->MaxStepHeight)
{ {
if (thingblocker) if (thingblocker)
{ // There is something to step up on. Return this thing as { // There is something to step up on. Return this thing as
@ -2054,8 +2054,8 @@ bool P_TryMove(AActor *thing, fixed_t x, fixed_t y,
{ {
goto pushline; goto pushline;
} }
else if (BlockingMobj->_f_Top() - thing->_f_Z() > thing->MaxStepHeight else if (BlockingMobj->Top() - thing->Z() > thing->MaxStepHeight
|| (BlockingMobj->Sector->ceilingplane.ZatPoint(x, y) - (BlockingMobj->_f_Top()) < thing->_f_height()) || (BlockingMobj->Sector->ceilingplane._f_ZatPointF(x, y) - (BlockingMobj->Top()) < thing->Height)
|| (tm.ceilingz - (BlockingMobj->Top()) < thing->Height)) || (tm.ceilingz - (BlockingMobj->Top()) < thing->Height))
{ {
goto pushline; goto pushline;
@ -2124,7 +2124,7 @@ bool P_TryMove(AActor *thing, fixed_t x, fixed_t y,
{ // [RH] Don't let normal missiles climb steps { // [RH] Don't let normal missiles climb steps
goto pushline; goto pushline;
} }
if (tm._f_floorz() - thing->_f_Z() > thing->MaxStepHeight) if (tm.floorz - thing->Z() > thing->MaxStepHeight)
{ // too big a step up { // too big a step up
goto pushline; goto pushline;
} }
@ -2569,7 +2569,7 @@ bool P_CheckMove(AActor *thing, fixed_t x, fixed_t y)
} }
if (!(thing->flags & MF_TELEPORT) && !(thing->flags3 & MF3_FLOORHUGGER)) if (!(thing->flags & MF_TELEPORT) && !(thing->flags3 & MF3_FLOORHUGGER))
{ {
if (tm._f_floorz() - newz > thing->MaxStepHeight) if (tm._f_floorz() - newz > thing->_f_MaxStepHeight())
{ // too big a step up { // too big a step up
return false; return false;
} }
@ -3034,7 +3034,7 @@ const secplane_t * P_CheckSlopeWalk(AActor *actor, fixed_t &xmove, fixed_t &ymov
fixed_t thisplanez = rover->top.plane->ZatPoint(pos); fixed_t thisplanez = rover->top.plane->ZatPoint(pos);
if (thisplanez>planezhere && thisplanez <= actor->_f_Z() + actor->MaxStepHeight) if (thisplanez>planezhere && thisplanez <= actor->_f_Z() + actor->_f_MaxStepHeight())
{ {
copyplane = *rover->top.plane; copyplane = *rover->top.plane;
if (copyplane.c<0) copyplane.FlipVert(); if (copyplane.c<0) copyplane.FlipVert();
@ -3052,7 +3052,7 @@ const secplane_t * P_CheckSlopeWalk(AActor *actor, fixed_t &xmove, fixed_t &ymov
fixed_t thisplanez = rover->top.plane->ZatPoint(actor); fixed_t thisplanez = rover->top.plane->ZatPoint(actor);
if (thisplanez>planezhere && thisplanez <= actor->_f_Z() + actor->MaxStepHeight) if (thisplanez>planezhere && thisplanez <= actor->_f_Z() + actor->_f_MaxStepHeight())
{ {
copyplane = *rover->top.plane; copyplane = *rover->top.plane;
if (copyplane.c<0) copyplane.FlipVert(); if (copyplane.c<0) copyplane.FlipVert();
@ -3107,7 +3107,7 @@ const secplane_t * P_CheckSlopeWalk(AActor *actor, fixed_t &xmove, fixed_t &ymov
pos.x += xmove; pos.x += xmove;
pos.y += ymove; pos.y += ymove;
if (sec->floorplane.ZatPoint(pos) >= actor->_f_Z() - actor->MaxStepHeight) if (sec->floorplane.ZatPoint(pos) >= actor->_f_Z() - actor->_f_MaxStepHeight())
{ {
dopush = false; dopush = false;
break; break;
@ -5086,7 +5086,7 @@ bool P_NoWayTraverse(AActor *usething, fixed_t startx, fixed_t starty, fixed_t e
if (ld->flags&(ML_BLOCKING | ML_BLOCKEVERYTHING | ML_BLOCK_PLAYERS)) return true; if (ld->flags&(ML_BLOCKING | ML_BLOCKEVERYTHING | ML_BLOCK_PLAYERS)) return true;
P_LineOpening(open, NULL, ld, it.InterceptPoint(in)); P_LineOpening(open, NULL, ld, it.InterceptPoint(in));
if (open.range <= 0 || if (open.range <= 0 ||
open.bottom > usething->_f_Z() + usething->MaxStepHeight || open.bottom > usething->_f_Z() + usething->_f_MaxStepHeight() ||
open.top < usething->_f_Top()) return true; open.top < usething->_f_Top()) return true;
} }
return false; return false;

View file

@ -2701,7 +2701,7 @@ static void PlayerLandedOnThing (AActor *mo, AActor *onmobj)
if (mo->player->mo == mo) if (mo->player->mo == mo)
{ {
mo->player->deltaviewheight = mo->_f_velz() >> 3; mo->player->deltaviewheight = mo->Vel.Z / 8.;
} }
if (mo->player->cheats & CF_PREDICTING) if (mo->player->cheats & CF_PREDICTING)
@ -2826,7 +2826,7 @@ void P_NightmareRespawn (AActor *mobj)
P_SpawnTeleportFog(mobj, mobj->PosPlusZ(TELEFOGHEIGHT), true, true); P_SpawnTeleportFog(mobj, mobj->PosPlusZ(TELEFOGHEIGHT), true, true);
// spawn a teleport fog at the new spot // spawn a teleport fog at the new spot
P_SpawnTeleportFog(mobj, x, y, z + TELEFOGHEIGHT, false, true); P_SpawnTeleportFog(mobj, FIXED2DBL(x), FIXED2DBL(y), FIXED2DBL(z) + TELEFOGHEIGHT, false, true);
// remove the old monster // remove the old monster
mobj->Destroy (); mobj->Destroy ();
@ -3745,7 +3745,7 @@ void AActor::Tick ()
const sector_t *sec = node->m_sector; const sector_t *sec = node->m_sector;
if (sec->floorplane.c >= STEEPSLOPE) if (sec->floorplane.c >= STEEPSLOPE)
{ {
if (floorplane.ZatPoint (PosRelative(node->m_sector)) >= _f_Z() - MaxStepHeight) if (floorplane.ZatPoint (PosRelative(node->m_sector)) >= _f_Z() - _f_MaxStepHeight())
{ {
dopush = false; dopush = false;
break; break;
@ -3810,12 +3810,12 @@ void AActor::Tick ()
PlayerLandedOnThing (this, onmo); PlayerLandedOnThing (this, onmo);
} }
} }
if (onmo->_f_Top() - _f_Z() <= MaxStepHeight) if (onmo->Top() - Z() <= MaxStepHeight)
{ {
if (player && player->mo == this) if (player && player->mo == this)
{ {
player->viewheight -= onmo->_f_Top() - _f_Z(); player->viewheight -= onmo->_f_Top() - _f_Z();
fixed_t deltaview = player->GetDeltaViewHeight(); double deltaview = player->GetDeltaViewHeight();
if (deltaview > player->deltaviewheight) if (deltaview > player->deltaviewheight)
{ {
player->deltaviewheight = deltaview; player->deltaviewheight = deltaview;
@ -4780,8 +4780,7 @@ APlayerPawn *P_SpawnPlayer (FPlayerStart *mthing, int playernum, int flags)
if (multiplayer) if (multiplayer)
{ {
unsigned an = mobj->_f_angle() >> ANGLETOFINESHIFT; Spawn ("TeleportFog", mobj->Vec3Angle(20, mobj->Angles.Yaw, TELEFOGHEIGHT), ALLOW_REPLACE);
Spawn ("TeleportFog", mobj->Vec3Offset(20*finecosine[an], 20*finesine[an], TELEFOGHEIGHT), ALLOW_REPLACE);
} }
// "Fix" for one of the starts on exec.wad MAP01: If you start inside the ceiling, // "Fix" for one of the starts on exec.wad MAP01: If you start inside the ceiling,

View file

@ -801,6 +801,11 @@ bool EV_BuildStairs (int tag, DFloor::EStair type, line_t *line,
int usespecials); int usespecials);
bool EV_DoFloor (DFloor::EFloor floortype, line_t *line, int tag, bool EV_DoFloor (DFloor::EFloor floortype, line_t *line, int tag,
fixed_t speed, fixed_t height, int crush, int change, bool hexencrush, bool hereticlower=false); fixed_t speed, fixed_t height, int crush, int change, bool hexencrush, bool hereticlower=false);
inline bool EV_DoFloor(DFloor::EFloor floortype, line_t *line, int tag,
double speed, double height, int crush, int change, bool hexencrush, bool hereticlower = false)
{
return EV_DoFloor(floortype, line, tag, FLOAT2FIXED(speed), FLOAT2FIXED(height), crush, change, hexencrush, hereticlower);
}
bool EV_FloorCrushStop (int tag); bool EV_FloorCrushStop (int tag);
bool EV_DoDonut (int tag, line_t *line, fixed_t pillarspeed, fixed_t slimespeed); bool EV_DoDonut (int tag, line_t *line, fixed_t pillarspeed, fixed_t slimespeed);
@ -928,6 +933,10 @@ inline void P_SpawnTeleportFog(AActor *mobj, const DVector3 &pos, bool beforeTel
{ {
P_SpawnTeleportFog(mobj, FLOAT2FIXED(pos.X), FLOAT2FIXED(pos.Y), FLOAT2FIXED(pos.Z), beforeTele, setTarget); P_SpawnTeleportFog(mobj, FLOAT2FIXED(pos.X), FLOAT2FIXED(pos.Y), FLOAT2FIXED(pos.Z), beforeTele, setTarget);
} }
inline void P_SpawnTeleportFog(AActor *mobj, double x, double y, double z, bool beforeTele = true, bool setTarget = false)
{
P_SpawnTeleportFog(mobj, FLOAT2FIXED(x), FLOAT2FIXED(y), FLOAT2FIXED(z), beforeTele, setTarget);
}
bool P_Teleport (AActor *thing, fixed_t x, fixed_t y, fixed_t z, DAngle angle, int flags); // bool useFog, bool sourceFog, bool keepOrientation, bool haltVelocity = true, bool keepHeight = false bool P_Teleport (AActor *thing, fixed_t x, fixed_t y, fixed_t z, DAngle angle, int flags); // bool useFog, bool sourceFog, bool keepOrientation, bool haltVelocity = true, bool keepHeight = false
inline bool P_Teleport(AActor *thing, const DVector3 &pos, DAngle angle, int flags) inline bool P_Teleport(AActor *thing, const DVector3 &pos, DAngle angle, int flags)
{ {

View file

@ -191,10 +191,10 @@ bool P_Teleport (AActor *thing, fixed_t x, fixed_t y, fixed_t z, DAngle angle, i
{ {
if (!predicting) if (!predicting)
{ {
fixed_t fogDelta = thing->flags & MF_MISSILE ? 0 : TELEFOGHEIGHT; double fogDelta = thing->flags & MF_MISSILE ? 0 : TELEFOGHEIGHT;
fixedvec2 vector = Vec2Angle(20 * FRACUNIT, angle); DVector2 vector = angle.ToVector(20);
fixedvec2 fogpos = P_GetOffsetPosition(x, y, vector.x, vector.y); DVector2 fogpos = P_GetOffsetPosition(FIXED2DBL(x), FIXED2DBL(y), vector.X, vector.Y);
P_SpawnTeleportFog(thing, fogpos.x, fogpos.y, thing->_f_Z() + fogDelta, false, true); P_SpawnTeleportFog(thing, fogpos.X, fogpos.Y, thing->Z() + fogDelta, false, true);
} }
if (thing->player) if (thing->player)
@ -560,7 +560,7 @@ bool EV_SilentLineTeleport (line_t *line, int side, AActor *thing, int id, INTBO
player->Vel.Y = p.Y*c + p.X*s; player->Vel.Y = p.Y*c + p.X*s;
// Save the current deltaviewheight, used in stepping // Save the current deltaviewheight, used in stepping
fixed_t deltaviewheight = player->deltaviewheight; double deltaviewheight = player->deltaviewheight;
// Clear deltaviewheight, since we don't want any changes now // Clear deltaviewheight, since we don't want any changes now
player->deltaviewheight = 0; player->deltaviewheight = 0;

View file

@ -86,7 +86,7 @@ bool P_Thing_Spawn (int tid, AActor *source, int type, DAngle angle, bool fog, i
} }
while (spot != NULL) while (spot != NULL)
{ {
mobj = Spawn (kind, spot->_f_Pos(), ALLOW_REPLACE); mobj = Spawn (kind, spot->Pos(), ALLOW_REPLACE);
if (mobj != NULL) if (mobj != NULL)
{ {
@ -98,7 +98,7 @@ bool P_Thing_Spawn (int tid, AActor *source, int type, DAngle angle, bool fog, i
mobj->Angles.Yaw = (angle != 1000000. ? angle : spot->Angles.Yaw); mobj->Angles.Yaw = (angle != 1000000. ? angle : spot->Angles.Yaw);
if (fog) if (fog)
{ {
P_SpawnTeleportFog(mobj, spot->_f_X(), spot->_f_Y(), spot->_f_Z() + TELEFOGHEIGHT, false, true); P_SpawnTeleportFog(mobj, spot->PosPlusZ(TELEFOGHEIGHT), false, true);
} }
if (mobj->flags & MF_SPECIAL) if (mobj->flags & MF_SPECIAL)
mobj->flags |= MF_DROPPED; // Don't respawn mobj->flags |= MF_DROPPED; // Don't respawn

View file

@ -1879,7 +1879,7 @@ void P_CalcHeight (player_t *player)
// move viewheight // move viewheight
if (player->playerstate == PST_LIVE) if (player->playerstate == PST_LIVE)
{ {
player->viewheight += player->deltaviewheight; player->viewheight += FLOAT2FIXED(player->deltaviewheight);
if (player->viewheight > defaultviewheight) if (player->viewheight > defaultviewheight)
{ {
@ -1890,14 +1890,14 @@ void P_CalcHeight (player_t *player)
{ {
player->viewheight = defaultviewheight>>1; player->viewheight = defaultviewheight>>1;
if (player->deltaviewheight <= 0) if (player->deltaviewheight <= 0)
player->deltaviewheight = 1; player->deltaviewheight = 1 / 65536.;
} }
if (player->deltaviewheight) if (player->deltaviewheight)
{ {
player->deltaviewheight += FRACUNIT/4; player->deltaviewheight += 0.25;
if (!player->deltaviewheight) if (!player->deltaviewheight)
player->deltaviewheight = 1; player->deltaviewheight = 1/65536.;
} }
} }

View file

@ -217,4 +217,11 @@ void P_NormalizeVXVY(fixed_t& vx, fixed_t& vy);
fixed_t P_PointLineDistance(line_t* line, fixed_t x, fixed_t y); fixed_t P_PointLineDistance(line_t* line, fixed_t x, fixed_t y);
fixedvec2 P_GetOffsetPosition(fixed_t x, fixed_t y, fixed_t dx, fixed_t dy); fixedvec2 P_GetOffsetPosition(fixed_t x, fixed_t y, fixed_t dx, fixed_t dy);
inline DVector2 P_GetOffsetPosition(double x, double y, double dx, double dy)
{
fixedvec2 v = P_GetOffsetPosition(FLOAT2FIXED(x), FLOAT2FIXED(y), FLOAT2FIXED(dx), FLOAT2FIXED(dy));
return{ FIXED2DBL(v.x), FIXED2DBL(v.y) };
}
#endif #endif

View file

@ -264,12 +264,22 @@ struct secplane_t
return FixedMul (ic, -d - DMulScale16 (a, x, b, y)); return FixedMul (ic, -d - DMulScale16 (a, x, b, y));
} }
double _f_ZatPointF(fixed_t x, fixed_t y) const
{
return FIXED2DBL(FixedMul(ic, -d - DMulScale16(a, x, b, y)));
}
// Returns the value of z at (x,y) as a double // Returns the value of z at (x,y) as a double
double ZatPoint (double x, double y) const double ZatPoint (double x, double y) const
{ {
return (d + a*x + b*y) * ic / (-65536.0 * 65536.0); return (d + a*x + b*y) * ic / (-65536.0 * 65536.0);
} }
double ZatPoint(const DVector2 &pos) const
{
return (d + a*pos.X + b*pos.Y) * ic / (-65536.0 * 65536.0);
}
// Returns the value of z at vertex v // Returns the value of z at vertex v
fixed_t ZatPoint (const vertex_t *v) const fixed_t ZatPoint (const vertex_t *v) const
{ {
@ -1294,6 +1304,11 @@ inline sector_t *P_PointInSector(fixed_t x, fixed_t y)
return P_PointInSubsector(x, y)->sector; return P_PointInSubsector(x, y)->sector;
} }
inline sector_t *P_PointInSector(const DVector2 &pos)
{
return P_PointInSubsector(FLOAT2FIXED(pos.X), FLOAT2FIXED(pos.Y))->sector;
}
inline fixedvec3 AActor::PosRelative(int portalgroup) const inline fixedvec3 AActor::PosRelative(int portalgroup) const
{ {
return __pos + Displacements.getOffset(Sector->PortalGroup, portalgroup); return __pos + Displacements.getOffset(Sector->PortalGroup, portalgroup);

View file

@ -1247,7 +1247,7 @@ DEFINE_PROPERTY(decal, S, Actor)
//========================================================================== //==========================================================================
DEFINE_PROPERTY(maxstepheight, F, Actor) DEFINE_PROPERTY(maxstepheight, F, Actor)
{ {
PROP_FIXED_PARM(i, 0); PROP_DOUBLE_PARM(i, 0);
defaults->MaxStepHeight = i; defaults->MaxStepHeight = i;
} }