mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-23 12:32:34 +00:00
Merge branch 'master' of https://github.com/rheit/zdoom
# Conflicts: # src/actor.h
This commit is contained in:
commit
954f03e531
23 changed files with 120 additions and 114 deletions
|
@ -912,6 +912,8 @@ public:
|
|||
return ret;
|
||||
}
|
||||
|
||||
void ClearInterpolation();
|
||||
|
||||
void Move(fixed_t dx, fixed_t dy, fixed_t dz)
|
||||
{
|
||||
SetOrigin(X() + dx, Y() + dy, Z() + dz, true);
|
||||
|
@ -1120,6 +1122,7 @@ public:
|
|||
// [RH] Used to interpolate the view to get >35 FPS
|
||||
fixed_t PrevX, PrevY, PrevZ;
|
||||
angle_t PrevAngle;
|
||||
int PrevPortalGroup;
|
||||
|
||||
// ThingIDs
|
||||
static void ClearTIDHashes ();
|
||||
|
@ -1253,11 +1256,6 @@ public:
|
|||
__pos.y = npos.y;
|
||||
__pos.z = npos.z;
|
||||
}
|
||||
void SetMovement(fixed_t x, fixed_t y, fixed_t z)
|
||||
{
|
||||
// not yet implemented
|
||||
}
|
||||
|
||||
|
||||
// begin of GZDoom specific additions
|
||||
TArray<TObjPtr<AActor> > dynamiclights;
|
||||
|
|
|
@ -1974,8 +1974,8 @@ void AM_drawSubsectors()
|
|||
}
|
||||
else
|
||||
{
|
||||
secx = FIXED2DBL(sec->soundorg[0]);
|
||||
secy = FIXED2DBL(sec->soundorg[1]);
|
||||
secx = FIXED2DBL(sec->centerspot.x);
|
||||
secy = FIXED2DBL(sec->centerspot.y);
|
||||
}
|
||||
seczb = floorplane->ZatPoint(secx, secy);
|
||||
seczt = sec->ceilingplane.ZatPoint(secx, secy);
|
||||
|
|
|
@ -1615,7 +1615,7 @@ void FParser::SF_FloorHeight(void)
|
|||
DFloorChanger * f = new DFloorChanger(§ors[i]);
|
||||
if (!f->Move(
|
||||
abs(dest - sectors[i].CenterFloor()),
|
||||
sectors[i].floorplane.PointToDist (CenterSpot(§ors[i]), dest),
|
||||
sectors[i].floorplane.PointToDist (sectors[i].centerspot, dest),
|
||||
crush? 10:-1,
|
||||
(dest > sectors[i].CenterFloor()) ? 1 : -1))
|
||||
{
|
||||
|
@ -1699,7 +1699,7 @@ void FParser::SF_MoveFloor(void)
|
|||
// Don't start a second thinker on the same floor
|
||||
if (sec->floordata) continue;
|
||||
|
||||
new DMoveFloor(sec,sec->floorplane.PointToDist(CenterSpot(sec),destheight),
|
||||
new DMoveFloor(sec,sec->floorplane.PointToDist(sec->centerspot,destheight),
|
||||
destheight < sec->CenterFloor() ? -1:1,crush,platspeed);
|
||||
}
|
||||
}
|
||||
|
@ -1763,7 +1763,7 @@ void FParser::SF_CeilingHeight(void)
|
|||
DCeilingChanger * c = new DCeilingChanger(§ors[i]);
|
||||
if (!c->Move(
|
||||
abs(dest - sectors[i].CenterCeiling()),
|
||||
sectors[i].ceilingplane.PointToDist (CenterSpot(§ors[i]), dest),
|
||||
sectors[i].ceilingplane.PointToDist (sectors[i].centerspot, dest),
|
||||
crush? 10:-1,
|
||||
(dest > sectors[i].CenterCeiling()) ? 1 : -1))
|
||||
{
|
||||
|
@ -1807,8 +1807,7 @@ public:
|
|||
m_Silent = silent;
|
||||
m_Type = DCeiling::ceilLowerByValue; // doesn't really matter as long as it's no special value
|
||||
m_Tag=tag;
|
||||
vertex_t * spot=CenterSpot(sec);
|
||||
m_TopHeight=m_BottomHeight=sec->ceilingplane.PointToDist(spot,destheight);
|
||||
m_TopHeight=m_BottomHeight=sec->ceilingplane.PointToDist(sec->centerspot,destheight);
|
||||
m_Direction=destheight>sec->GetPlaneTexZ(sector_t::ceiling)? 1:-1;
|
||||
|
||||
// Do not interpolate instant movement ceilings.
|
||||
|
|
|
@ -1257,6 +1257,7 @@ void G_FinishTravel ()
|
|||
oldpawn->Destroy();
|
||||
pawndup->Destroy ();
|
||||
pawn->LinkToWorld ();
|
||||
pawn->ClearInterpolation();
|
||||
pawn->AddToHash ();
|
||||
pawn->SetState(pawn->SpawnState);
|
||||
pawn->player->SendPitchLimits();
|
||||
|
|
|
@ -27,11 +27,8 @@ void AFastProjectile::Tick ()
|
|||
fixed_t zfrac;
|
||||
int changexy;
|
||||
|
||||
PrevX = X();
|
||||
PrevY = Y();
|
||||
PrevZ = Z();
|
||||
ClearInterpolation();
|
||||
fixed_t oldz = Z();
|
||||
PrevAngle = angle;
|
||||
|
||||
if (!(flags5 & MF5_NOTIMEFREEZE))
|
||||
{
|
||||
|
|
|
@ -590,10 +590,7 @@ void AActorMover::Activate (AActor *activator)
|
|||
// Don't let the renderer interpolate between the actor's
|
||||
// old position and its new position.
|
||||
Interpolate ();
|
||||
tracer->PrevX = tracer->X();
|
||||
tracer->PrevY = tracer->Y();
|
||||
tracer->PrevZ = tracer->Z();
|
||||
tracer->PrevAngle = tracer->angle;
|
||||
tracer->ClearInterpolation();
|
||||
}
|
||||
|
||||
void AActorMover::Deactivate (AActor *activator)
|
||||
|
|
|
@ -458,9 +458,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_RestoreSpecialPosition)
|
|||
}
|
||||
// Do not interpolate from the position the actor was at when it was
|
||||
// picked up, in case that is different from where it is now.
|
||||
self->PrevX = self->X();
|
||||
self->PrevY = self->Y();
|
||||
self->PrevZ = self->Z();
|
||||
self->ClearInterpolation();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -478,13 +478,13 @@ void P_Recalculate3DFloors(sector_t * sector)
|
|||
while (oldlist.Size())
|
||||
{
|
||||
pick=oldlist[0];
|
||||
fixed_t height=pick->top.plane->ZatPoint(CenterSpot(sector));
|
||||
fixed_t height=pick->top.plane->ZatPoint(sector->centerspot);
|
||||
|
||||
// find highest starting ffloor - intersections are not supported!
|
||||
pickindex=0;
|
||||
for (j=1;j<oldlist.Size();j++)
|
||||
{
|
||||
fixed_t h2=oldlist[j]->top.plane->ZatPoint(CenterSpot(sector));
|
||||
fixed_t h2=oldlist[j]->top.plane->ZatPoint(sector->centerspot);
|
||||
|
||||
if (h2>height)
|
||||
{
|
||||
|
@ -495,7 +495,7 @@ void P_Recalculate3DFloors(sector_t * sector)
|
|||
}
|
||||
|
||||
oldlist.Delete(pickindex);
|
||||
fixed_t pick_bottom=pick->bottom.plane->ZatPoint(CenterSpot(sector));
|
||||
fixed_t pick_bottom=pick->bottom.plane->ZatPoint(sector->centerspot);
|
||||
|
||||
if (pick->flags & FF_THISINSIDE)
|
||||
{
|
||||
|
@ -609,7 +609,7 @@ void P_Recalculate3DFloors(sector_t * sector)
|
|||
if ( !(rover->flags & FF_EXISTS) || rover->flags & FF_NOSHADE )
|
||||
continue;
|
||||
|
||||
fixed_t ff_top=rover->top.plane->ZatPoint(CenterSpot(sector));
|
||||
fixed_t ff_top=rover->top.plane->ZatPoint(sector->centerspot);
|
||||
if (ff_top < minheight) break; // reached the floor
|
||||
if (ff_top < maxheight)
|
||||
{
|
||||
|
@ -624,7 +624,7 @@ void P_Recalculate3DFloors(sector_t * sector)
|
|||
}
|
||||
else
|
||||
{
|
||||
fixed_t ff_bottom=rover->bottom.plane->ZatPoint(CenterSpot(sector));
|
||||
fixed_t ff_bottom=rover->bottom.plane->ZatPoint(sector->centerspot);
|
||||
if (ff_bottom<maxheight)
|
||||
{
|
||||
// this segment begins over the ceiling and extends beyond it
|
||||
|
@ -650,7 +650,7 @@ void P_Recalculate3DFloors(sector_t * sector)
|
|||
|
||||
if (rover->flags&FF_DOUBLESHADOW)
|
||||
{
|
||||
fixed_t ff_bottom=rover->bottom.plane->ZatPoint(CenterSpot(sector));
|
||||
fixed_t ff_bottom=rover->bottom.plane->ZatPoint(sector->centerspot);
|
||||
if(ff_bottom < maxheight && ff_bottom>minheight)
|
||||
{
|
||||
newlight.caster = rover;
|
||||
|
@ -738,11 +738,11 @@ lightlist_t * P_GetPlaneLight(sector_t * sector, secplane_t * plane, bool unders
|
|||
unsigned i;
|
||||
TArray<lightlist_t> &lightlist = sector->e->XFloor.lightlist;
|
||||
|
||||
fixed_t planeheight=plane->ZatPoint(CenterSpot(sector));
|
||||
fixed_t planeheight=plane->ZatPoint(sector->centerspot);
|
||||
if(underside) planeheight--;
|
||||
|
||||
for(i = 1; i < lightlist.Size(); i++)
|
||||
if (lightlist[i].plane.ZatPoint(CenterSpot(sector)) <= planeheight)
|
||||
if (lightlist[i].plane.ZatPoint(sector->centerspot) <= planeheight)
|
||||
return &lightlist[i - 1];
|
||||
|
||||
return &lightlist[lightlist.Size() - 1];
|
||||
|
@ -1002,8 +1002,8 @@ CCMD (dump3df)
|
|||
|
||||
for (unsigned int i = 0; i < ffloors.Size(); i++)
|
||||
{
|
||||
fixed_t height=ffloors[i]->top.plane->ZatPoint(CenterSpot(sector));
|
||||
fixed_t bheight=ffloors[i]->bottom.plane->ZatPoint(CenterSpot(sector));
|
||||
fixed_t height=ffloors[i]->top.plane->ZatPoint(sector->centerspot);
|
||||
fixed_t bheight=ffloors[i]->bottom.plane->ZatPoint(sector->centerspot);
|
||||
|
||||
IGNORE_FORMAT_PRE
|
||||
Printf("FFloor %d @ top = %f (model = %d), bottom = %f (model = %d), flags = %B, alpha = %d %s %s\n",
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
#define __SECTORE_H
|
||||
|
||||
|
||||
#define CenterSpot(sec) (vertex_t*)&(sec)->soundorg[0]
|
||||
|
||||
// 3D floor flags. Most are the same as in Legacy but I added some for EDGE's and Vavoom's features as well.
|
||||
typedef enum
|
||||
{
|
||||
|
|
|
@ -525,9 +525,7 @@ bool P_Move (AActor *actor)
|
|||
// so make it switchable
|
||||
if (nomonsterinterpolation)
|
||||
{
|
||||
actor->PrevX = actor->X();
|
||||
actor->PrevY = actor->Y();
|
||||
actor->PrevZ = actor->Z();
|
||||
actor->ClearInterpolation();
|
||||
}
|
||||
|
||||
if (try_ok && friction > ORIG_FRICTION)
|
||||
|
@ -2520,6 +2518,7 @@ void A_DoChase (VMFrameStack *stack, AActor *actor, bool fastchase, FState *mele
|
|||
// CANTLEAVEFLOORPIC handling was completely missing in the non-serpent functions.
|
||||
fixed_t oldX = actor->X();
|
||||
fixed_t oldY = actor->Y();
|
||||
int oldgroup = actor->PrevPortalGroup;
|
||||
FTextureID oldFloor = actor->floorpic;
|
||||
|
||||
// chase towards player
|
||||
|
@ -2537,6 +2536,7 @@ void A_DoChase (VMFrameStack *stack, AActor *actor, bool fastchase, FState *mele
|
|||
{
|
||||
actor->PrevX = oldX;
|
||||
actor->PrevY = oldY;
|
||||
actor->PrevPortalGroup = oldgroup;
|
||||
}
|
||||
}
|
||||
if (!(flags & CHF_STOPIFBLOCKED))
|
||||
|
|
|
@ -343,16 +343,16 @@ bool EV_DoFloor (DFloor::EFloor floortype, line_t *line, int tag,
|
|||
floor->m_Speed = height;
|
||||
case DFloor::floorLowerByValue:
|
||||
floor->m_Direction = -1;
|
||||
newheight = sec->floorplane.ZatPoint (sec->soundorg[0], sec->soundorg[1]) - height;
|
||||
floor->m_FloorDestDist = sec->floorplane.PointToDist (sec->soundorg[0], sec->soundorg[1], newheight);
|
||||
newheight = sec->CenterFloor() - height;
|
||||
floor->m_FloorDestDist = sec->floorplane.PointToDist (sec->centerspot, newheight);
|
||||
break;
|
||||
|
||||
case DFloor::floorRaiseInstant:
|
||||
floor->m_Speed = height;
|
||||
case DFloor::floorRaiseByValue:
|
||||
floor->m_Direction = 1;
|
||||
newheight = sec->floorplane.ZatPoint (sec->soundorg[0], sec->soundorg[1]) + height;
|
||||
floor->m_FloorDestDist = sec->floorplane.PointToDist (sec->soundorg[0], sec->soundorg[1], newheight);
|
||||
newheight = sec->CenterFloor() + height;
|
||||
floor->m_FloorDestDist = sec->floorplane.PointToDist (sec->centerspot, newheight);
|
||||
break;
|
||||
|
||||
case DFloor::floorMoveToValue:
|
||||
|
@ -412,8 +412,8 @@ bool EV_DoFloor (DFloor::EFloor floortype, line_t *line, int tag,
|
|||
|
||||
case DFloor::floorLowerByTexture:
|
||||
floor->m_Direction = -1;
|
||||
newheight = sec->floorplane.ZatPoint (sec->soundorg[0], sec->soundorg[1]) - sec->FindShortestTextureAround ();
|
||||
floor->m_FloorDestDist = sec->floorplane.PointToDist (sec->soundorg[0], sec->soundorg[1], newheight);
|
||||
newheight = sec->CenterFloor() - sec->FindShortestTextureAround ();
|
||||
floor->m_FloorDestDist = sec->floorplane.PointToDist (sec->centerspot, newheight);
|
||||
break;
|
||||
|
||||
case DFloor::floorLowerToCeiling:
|
||||
|
@ -429,14 +429,14 @@ bool EV_DoFloor (DFloor::EFloor floortype, line_t *line, int tag,
|
|||
// since the code is identical to what was here. (Oddly
|
||||
// enough, BOOM preserved the code here even though it
|
||||
// also had this function.)
|
||||
newheight = sec->floorplane.ZatPoint (sec->soundorg[0], sec->soundorg[1]) + sec->FindShortestTextureAround ();
|
||||
floor->m_FloorDestDist = sec->floorplane.PointToDist (sec->soundorg[0], sec->soundorg[1], newheight);
|
||||
newheight = sec->CenterFloor() + sec->FindShortestTextureAround ();
|
||||
floor->m_FloorDestDist = sec->floorplane.PointToDist (sec->centerspot, newheight);
|
||||
break;
|
||||
|
||||
case DFloor::floorRaiseAndChange:
|
||||
floor->m_Direction = 1;
|
||||
newheight = sec->floorplane.ZatPoint (sec->soundorg[0], sec->soundorg[1]) + height;
|
||||
floor->m_FloorDestDist = sec->floorplane.PointToDist (sec->soundorg[0], sec->soundorg[1], newheight);
|
||||
newheight = sec->CenterFloor() + height;
|
||||
floor->m_FloorDestDist = sec->floorplane.PointToDist (sec->centerspot, newheight);
|
||||
if (line != NULL)
|
||||
{
|
||||
FTextureID oldpic = sec->GetTexture(sector_t::floor);
|
||||
|
@ -619,8 +619,8 @@ bool EV_BuildStairs (int tag, DFloor::EStair type, line_t *line,
|
|||
floor->m_Hexencrush = false;
|
||||
|
||||
floor->m_Speed = speed;
|
||||
height = sec->floorplane.ZatPoint (sec->soundorg[0], sec->soundorg[1]) + stairstep;
|
||||
floor->m_FloorDestDist = sec->floorplane.PointToDist (sec->soundorg[0], sec->soundorg[1], height);
|
||||
height = sec->CenterFloor() + stairstep;
|
||||
floor->m_FloorDestDist = sec->floorplane.PointToDist (sec->centerspot, height);
|
||||
|
||||
texture = sec->GetTexture(sector_t::floor);
|
||||
osecnum = secnum; //jff 3/4/98 preserve loop index
|
||||
|
@ -1037,15 +1037,15 @@ bool EV_DoElevator (line_t *line, DElevator::EElevator elevtype,
|
|||
// [RH] elevate up by a specific amount
|
||||
case DElevator::elevateRaise:
|
||||
elevator->m_Direction = 1;
|
||||
elevator->m_FloorDestDist = sec->floorplane.PointToDist (sec->soundorg[0], sec->soundorg[1], floorheight + height);
|
||||
elevator->m_CeilingDestDist = sec->ceilingplane.PointToDist (sec->soundorg[0], sec->soundorg[1], ceilingheight + height);
|
||||
elevator->m_FloorDestDist = sec->floorplane.PointToDist (sec->centerspot, floorheight + height);
|
||||
elevator->m_CeilingDestDist = sec->ceilingplane.PointToDist (sec->centerspot, ceilingheight + height);
|
||||
break;
|
||||
|
||||
// [RH] elevate down by a specific amount
|
||||
case DElevator::elevateLower:
|
||||
elevator->m_Direction = -1;
|
||||
elevator->m_FloorDestDist = sec->floorplane.PointToDist (sec->soundorg[0], sec->soundorg[1], floorheight - height);
|
||||
elevator->m_CeilingDestDist = sec->ceilingplane.PointToDist (sec->soundorg[0], sec->soundorg[1], ceilingheight - height);
|
||||
elevator->m_FloorDestDist = sec->floorplane.PointToDist (sec->centerspot, floorheight - height);
|
||||
elevator->m_CeilingDestDist = sec->ceilingplane.PointToDist (sec->centerspot, ceilingheight - height);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3277,8 +3277,8 @@ FUNC(LS_GlassBreak)
|
|||
|
||||
x = ln->v1->x + ln->dx/2;
|
||||
y = ln->v1->y + ln->dy/2;
|
||||
x += (ln->frontsector->soundorg[0] - x) / 5;
|
||||
y += (ln->frontsector->soundorg[1] - y) / 5;
|
||||
x += (ln->frontsector->centerspot.x - x) / 5;
|
||||
y += (ln->frontsector->centerspot.y - y) / 5;
|
||||
|
||||
for (int i = 0; i < 7; ++i)
|
||||
{
|
||||
|
|
|
@ -508,10 +508,6 @@ bool P_TeleportMove(AActor *thing, fixed_t x, fixed_t y, fixed_t z, bool telefra
|
|||
R_ResetViewInterpolation();
|
||||
}
|
||||
|
||||
thing->PrevX = x;
|
||||
thing->PrevY = y;
|
||||
thing->PrevZ = z;
|
||||
|
||||
// If this teleport was caused by a move, P_TryMove() will handle the
|
||||
// sector transition messages better than we can here.
|
||||
if (!(thing->flags6 & MF6_INTRYMOVE))
|
||||
|
|
|
@ -416,6 +416,7 @@ bool AActor::FixMapthingPos()
|
|||
// Get the distance we have to move the object away from the wall
|
||||
distance = radius - distance;
|
||||
SetXY(X() + FixedMul(distance, finecosine[finean]), Y() + FixedMul(distance, finesine[finean]));
|
||||
ClearInterpolation();
|
||||
success = true;
|
||||
}
|
||||
}
|
||||
|
@ -533,9 +534,9 @@ void AActor::SetOrigin (fixed_t ix, fixed_t iy, fixed_t iz, bool moving)
|
|||
{
|
||||
UnlinkFromWorld ();
|
||||
SetXYZ(ix, iy, iz);
|
||||
if (moving) SetMovement(ix - X(), iy - Y(), iz - Z());
|
||||
LinkToWorld ();
|
||||
P_FindFloorCeiling(this, FFCF_ONLYSPAWNPOS);
|
||||
if (!moving) ClearInterpolation();
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
|
|
@ -473,10 +473,7 @@ void AActor::Serialize (FArchive &arc)
|
|||
Speed = GetDefault()->Speed;
|
||||
}
|
||||
}
|
||||
PrevX = X();
|
||||
PrevY = Y();
|
||||
PrevZ = Z();
|
||||
PrevAngle = angle;
|
||||
ClearInterpolation();
|
||||
UpdateWaterLevel(Z(), false);
|
||||
}
|
||||
}
|
||||
|
@ -3304,6 +3301,7 @@ void AActor::CheckPortalTransition(bool islinked)
|
|||
PrevY += Y() - oldpos.y;
|
||||
PrevZ += Z() - oldpos.z;
|
||||
Sector = P_PointInSector(X(), Y());
|
||||
PrevPortalGroup = Sector->PortalGroup;
|
||||
moved = true;
|
||||
}
|
||||
else break;
|
||||
|
@ -3322,6 +3320,7 @@ void AActor::CheckPortalTransition(bool islinked)
|
|||
PrevY += Y() - oldpos.y;
|
||||
PrevZ += Z() - oldpos.z;
|
||||
Sector = P_PointInSector(X(), Y());
|
||||
PrevPortalGroup = Sector->PortalGroup;
|
||||
moved = true;
|
||||
}
|
||||
else break;
|
||||
|
@ -3368,10 +3367,7 @@ void AActor::Tick ()
|
|||
|
||||
// This is necessary to properly interpolate movement outside this function
|
||||
// like from an ActorMover
|
||||
PrevX = X();
|
||||
PrevY = Y();
|
||||
PrevZ = Z();
|
||||
PrevAngle = angle;
|
||||
ClearInterpolation();
|
||||
|
||||
if (flags5 & MF5_NOINTERACTION)
|
||||
{
|
||||
|
@ -3398,7 +3394,6 @@ void AActor::Tick ()
|
|||
flags |= MF_NOBLOCKMAP;
|
||||
SetXYZ(Vec3Offset(velx, vely, velz));
|
||||
CheckPortalTransition(false);
|
||||
SetMovement(velx, vely, velz);
|
||||
LinkToWorld ();
|
||||
}
|
||||
else
|
||||
|
@ -4157,9 +4152,6 @@ AActor *AActor::StaticSpawn (PClassActor *type, fixed_t ix, fixed_t iy, fixed_t
|
|||
actor->Conversation = NULL;
|
||||
}
|
||||
|
||||
actor->PrevX = ix;
|
||||
actor->PrevY = iy;
|
||||
actor->PrevZ = iz;
|
||||
actor->SetXYZ(ix, iy, iz);
|
||||
actor->picnum.SetInvalid();
|
||||
actor->health = actor->SpawnHealth();
|
||||
|
@ -4195,6 +4187,7 @@ AActor *AActor::StaticSpawn (PClassActor *type, fixed_t ix, fixed_t iy, fixed_t
|
|||
|
||||
// set subsector and/or block links
|
||||
actor->LinkToWorld (SpawningMapThing);
|
||||
actor->ClearInterpolation();
|
||||
|
||||
actor->dropoffz = // killough 11/98: for tracking dropoffs
|
||||
actor->floorz = actor->Sector->floorplane.ZatPoint (ix, iy);
|
||||
|
@ -5822,6 +5815,7 @@ bool P_CheckMissileSpawn (AActor* th, fixed_t maxdist)
|
|||
return false;
|
||||
}
|
||||
}
|
||||
th->ClearInterpolation();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -144,15 +144,15 @@ DPillar::DPillar (sector_t *sector, EPillar type, fixed_t speed,
|
|||
if (floordist == 0)
|
||||
{
|
||||
newheight = (sector->CenterFloor () + sector->CenterCeiling ()) / 2;
|
||||
m_FloorTarget = sector->floorplane.PointToDist (sector->soundorg[0], sector->soundorg[1], newheight);
|
||||
m_CeilingTarget = sector->ceilingplane.PointToDist (sector->soundorg[0], sector->soundorg[1], newheight);
|
||||
m_FloorTarget = sector->floorplane.PointToDist (sector->centerspot, newheight);
|
||||
m_CeilingTarget = sector->ceilingplane.PointToDist (sector->centerspot, newheight);
|
||||
floordist = newheight - sector->CenterFloor ();
|
||||
}
|
||||
else
|
||||
{
|
||||
newheight = sector->CenterFloor () + floordist;
|
||||
m_FloorTarget = sector->floorplane.PointToDist (sector->soundorg[0], sector->soundorg[1], newheight);
|
||||
m_CeilingTarget = sector->ceilingplane.PointToDist (sector->soundorg[0], sector->soundorg[1], newheight);
|
||||
m_FloorTarget = sector->floorplane.PointToDist (sector->centerspot, newheight);
|
||||
m_CeilingTarget = sector->ceilingplane.PointToDist (sector->centerspot, newheight);
|
||||
}
|
||||
ceilingdist = sector->CenterCeiling () - newheight;
|
||||
}
|
||||
|
@ -168,8 +168,8 @@ DPillar::DPillar (sector_t *sector, EPillar type, fixed_t speed,
|
|||
}
|
||||
else
|
||||
{
|
||||
newheight = sector->floorplane.ZatPoint (0, 0) - floordist;
|
||||
m_FloorTarget = sector->floorplane.PointToDist (0, 0, newheight);
|
||||
newheight = sector->CenterFloor() - floordist;
|
||||
m_FloorTarget = sector->floorplane.PointToDist (sector->centerspot, newheight);
|
||||
}
|
||||
if (ceilingdist == 0)
|
||||
{
|
||||
|
@ -179,8 +179,8 @@ DPillar::DPillar (sector_t *sector, EPillar type, fixed_t speed,
|
|||
}
|
||||
else
|
||||
{
|
||||
newheight = sector->ceilingplane.ZatPoint (0, 0) + ceilingdist;
|
||||
m_CeilingTarget = sector->ceilingplane.PointToDist (0, 0, newheight);
|
||||
newheight = sector->CenterCeiling() + ceilingdist;
|
||||
m_CeilingTarget = sector->ceilingplane.PointToDist (sector->centerspot, newheight);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3221,9 +3221,9 @@ static void P_GroupLines (bool buildmap)
|
|||
}
|
||||
}
|
||||
|
||||
// set the soundorg to the middle of the bounding box
|
||||
sector->soundorg[0] = bbox.Right()/2 + bbox.Left()/2;
|
||||
sector->soundorg[1] = bbox.Top()/2 + bbox.Bottom()/2;
|
||||
// set the center to the middle of the bounding box
|
||||
sector->centerspot.x = bbox.Right()/2 + bbox.Left()/2;
|
||||
sector->centerspot.y = bbox.Top()/2 + bbox.Bottom()/2;
|
||||
|
||||
// For triangular sectors the above does not calculate good points unless the longest of the triangle's lines is perfectly horizontal and vertical
|
||||
if (sector->linecount == 3)
|
||||
|
@ -3245,8 +3245,8 @@ static void P_GroupLines (bool buildmap)
|
|||
if (DMulScale32 (v->y - Triangle[0]->y, dx,
|
||||
Triangle[0]->x - v->x, dy) != 0)
|
||||
{
|
||||
sector->soundorg[0] = Triangle[0]->x / 3 + Triangle[1]->x / 3 + v->x / 3;
|
||||
sector->soundorg[1] = Triangle[0]->y / 3 + Triangle[1]->y / 3 + v->y / 3;
|
||||
sector->centerspot.x = Triangle[0]->x / 3 + Triangle[1]->x / 3 + v->x / 3;
|
||||
sector->centerspot.y = Triangle[0]->y / 3 + Triangle[1]->y / 3 + v->y / 3;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -130,7 +130,7 @@ bool P_MoveThing(AActor *source, fixed_t x, fixed_t y, fixed_t z, bool fog)
|
|||
oldy = source->Y();
|
||||
oldz = source->Z();
|
||||
|
||||
source->SetOrigin (x, y, z, false);
|
||||
source->SetOrigin (x, y, z, true);
|
||||
if (P_TestMobjLocation (source))
|
||||
{
|
||||
if (fog)
|
||||
|
@ -138,9 +138,7 @@ bool P_MoveThing(AActor *source, fixed_t x, fixed_t y, fixed_t z, bool fog)
|
|||
P_SpawnTeleportFog(source, x, y, z, false, true);
|
||||
P_SpawnTeleportFog(source, oldx, oldy, oldz, true, true);
|
||||
}
|
||||
source->PrevX = x;
|
||||
source->PrevY = y;
|
||||
source->PrevZ = z;
|
||||
source->ClearInterpolation();
|
||||
if (source == players[consoleplayer].camera)
|
||||
{
|
||||
R_ResetViewInterpolation();
|
||||
|
@ -149,7 +147,7 @@ bool P_MoveThing(AActor *source, fixed_t x, fixed_t y, fixed_t z, bool fog)
|
|||
}
|
||||
else
|
||||
{
|
||||
source->SetOrigin (oldx, oldy, oldz, false);
|
||||
source->SetOrigin (oldx, oldy, oldz, true);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -695,6 +693,8 @@ int P_Thing_Warp(AActor *caller, AActor *reference, fixed_t xofs, fixed_t yofs,
|
|||
}
|
||||
|
||||
fixedvec3 old = caller->Pos();
|
||||
int oldpgroup = caller->Sector->PortalGroup;
|
||||
|
||||
zofs += FixedMul(reference->height, heightoffset);
|
||||
|
||||
|
||||
|
@ -744,12 +744,12 @@ int P_Thing_Warp(AActor *caller, AActor *reference, fixed_t xofs, fixed_t yofs,
|
|||
{
|
||||
if (flags & WARPF_TOFLOOR)
|
||||
{
|
||||
caller->SetOrigin(xofs + FixedMul(rad, finecosine[fineangle]), yofs + FixedMul(rad, finesine[fineangle]), zofs);
|
||||
caller->SetOrigin(xofs + FixedMul(rad, finecosine[fineangle]), yofs + FixedMul(rad, finesine[fineangle]), zofs, true);
|
||||
caller->SetZ(caller->floorz + zofs);
|
||||
}
|
||||
else
|
||||
{
|
||||
caller->SetOrigin(xofs + FixedMul(rad, finecosine[fineangle]), yofs + FixedMul(rad, finesine[fineangle]), zofs);
|
||||
caller->SetOrigin(xofs + FixedMul(rad, finecosine[fineangle]), yofs + FixedMul(rad, finesine[fineangle]), zofs, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -782,23 +782,29 @@ int P_Thing_Warp(AActor *caller, AActor *reference, fixed_t xofs, fixed_t yofs,
|
|||
caller->velz = 0;
|
||||
}
|
||||
|
||||
// this is no fun with line portals
|
||||
if (flags & WARPF_WARPINTERPOLATION)
|
||||
{
|
||||
caller->PrevX += caller->X() - old.x;
|
||||
caller->PrevY += caller->Y() - old.y;
|
||||
caller->PrevZ += caller->Z() - old.z;
|
||||
// This just translates the movement but doesn't change the vector
|
||||
fixedvec3 displacedold = old + Displacements(oldpgroup, caller->Sector->PortalGroup);
|
||||
caller->PrevX += caller->X() - displacedold.x;
|
||||
caller->PrevY += caller->Y() - displacedold.y;
|
||||
caller->PrevZ += caller->Z() - displacedold.z;
|
||||
caller->PrevPortalGroup = caller->Sector->PortalGroup;
|
||||
}
|
||||
else if (flags & WARPF_COPYINTERPOLATION)
|
||||
{
|
||||
caller->PrevX = caller->X() + reference->PrevX - reference->X();
|
||||
caller->PrevY = caller->Y() + reference->PrevY - reference->Y();
|
||||
caller->PrevZ = caller->Z() + reference->PrevZ - reference->Z();
|
||||
// Map both positions of the reference actor to the current portal group
|
||||
fixedvec3 displacedold = old + Displacements(reference->PrevPortalGroup, caller->Sector->PortalGroup);
|
||||
fixedvec3 displacedref = old + Displacements(reference->Sector->PortalGroup, caller->Sector->PortalGroup);
|
||||
caller->PrevX = caller->X() + displacedold.x - displacedref.x;
|
||||
caller->PrevY = caller->Y() + displacedold.y - displacedref.y;
|
||||
caller->PrevZ = caller->Z() + displacedold.z - displacedref.z;
|
||||
caller->PrevPortalGroup = caller->Sector->PortalGroup;
|
||||
}
|
||||
else if (!(flags & WARPF_INTERPOLATE))
|
||||
{
|
||||
caller->PrevX = caller->X();
|
||||
caller->PrevY = caller->Y();
|
||||
caller->PrevZ = caller->Z();
|
||||
caller->ClearInterpolation();
|
||||
}
|
||||
if ((flags & WARPF_BOB) && (reference->flags2 & MF2_FLOATBOB))
|
||||
{
|
||||
|
|
|
@ -1183,9 +1183,9 @@ void R_Subsector (subsector_t *sub)
|
|||
fakeFloor->validcount = validcount;
|
||||
R_3D_NewClip();
|
||||
}
|
||||
fakeHeight = fakeFloor->top.plane->ZatPoint(frontsector->soundorg[0], frontsector->soundorg[0]);
|
||||
fakeHeight = fakeFloor->top.plane->ZatPoint(frontsector->centerspot);
|
||||
if (fakeHeight < viewz &&
|
||||
fakeHeight > frontsector->floorplane.ZatPoint(frontsector->soundorg[0], frontsector->soundorg[1]))
|
||||
fakeHeight > frontsector->floorplane.ZatPoint(frontsector->centerspot))
|
||||
{
|
||||
fake3D = FAKE3D_FAKEFLOOR;
|
||||
tempsec = *fakeFloor->model;
|
||||
|
@ -1245,9 +1245,9 @@ void R_Subsector (subsector_t *sub)
|
|||
fakeFloor->validcount = validcount;
|
||||
R_3D_NewClip();
|
||||
}
|
||||
fakeHeight = fakeFloor->bottom.plane->ZatPoint(frontsector->soundorg[0], frontsector->soundorg[1]);
|
||||
fakeHeight = fakeFloor->bottom.plane->ZatPoint(frontsector->centerspot);
|
||||
if (fakeHeight > viewz &&
|
||||
fakeHeight < frontsector->ceilingplane.ZatPoint(frontsector->soundorg[0], frontsector->soundorg[1]))
|
||||
fakeHeight < frontsector->ceilingplane.ZatPoint(frontsector->centerspot))
|
||||
{
|
||||
fake3D = FAKE3D_FAKECEILING;
|
||||
tempsec = *fakeFloor->model;
|
||||
|
|
21
src/r_defs.h
21
src/r_defs.h
|
@ -371,6 +371,11 @@ struct secplane_t
|
|||
return -TMulScale16 (a, x, y, b, z, c);
|
||||
}
|
||||
|
||||
fixed_t PointToDist(fixedvec2 xy, fixed_t z) const
|
||||
{
|
||||
return -TMulScale16(a, xy.x, xy.y, b, z, c);
|
||||
}
|
||||
|
||||
fixed_t PointToDist (const vertex_t *v, fixed_t z) const
|
||||
{
|
||||
return -TMulScale16 (a, v->x, b, v->y, z, c);
|
||||
|
@ -878,8 +883,8 @@ struct sector_t
|
|||
}
|
||||
|
||||
// Member variables
|
||||
fixed_t CenterFloor () const { return floorplane.ZatPoint (soundorg[0], soundorg[1]); }
|
||||
fixed_t CenterCeiling () const { return ceilingplane.ZatPoint (soundorg[0], soundorg[1]); }
|
||||
fixed_t CenterFloor () const { return floorplane.ZatPoint (centerspot); }
|
||||
fixed_t CenterCeiling () const { return ceilingplane.ZatPoint (centerspot); }
|
||||
|
||||
// [RH] store floor and ceiling planes instead of heights
|
||||
secplane_t floorplane, ceilingplane;
|
||||
|
@ -897,7 +902,7 @@ struct sector_t
|
|||
int sky;
|
||||
FNameNoInit SeqName; // Sound sequence name. Setting seqType non-negative will override this.
|
||||
|
||||
fixed_t soundorg[2]; // origin for any sounds played by the sector
|
||||
fixedvec2 centerspot; // origin for any sounds played by the sector
|
||||
int validcount; // if == validcount, already checked
|
||||
AActor* thinglist; // list of mobjs in sector
|
||||
|
||||
|
@ -1385,4 +1390,14 @@ inline fixedvec3 PosRelative(const fixedvec3 &pos, line_t *line, sector_t *refse
|
|||
return pos + Displacements(refsec->PortalGroup, line->frontsector->PortalGroup);
|
||||
}
|
||||
|
||||
inline void AActor::ClearInterpolation()
|
||||
{
|
||||
PrevX = X();
|
||||
PrevY = Y();
|
||||
PrevZ = Z();
|
||||
PrevAngle = angle;
|
||||
PrevPortalGroup = Sector->PortalGroup;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
@ -709,8 +709,8 @@ static void CalcPosVel(int type, const AActor *actor, const sector_t *sector,
|
|||
}
|
||||
else
|
||||
{
|
||||
x = sector->soundorg[0];
|
||||
z = sector->soundorg[1];
|
||||
x = sector->centerspot.x;
|
||||
z = sector->centerspot.y;
|
||||
chanflags |= CHAN_LISTENERZ;
|
||||
}
|
||||
}
|
||||
|
@ -776,8 +776,8 @@ static void CalcSectorSoundOrg(const sector_t *sec, int channum, fixed_t *x, fix
|
|||
}
|
||||
else
|
||||
{
|
||||
*x = sec->soundorg[0];
|
||||
*y = sec->soundorg[1];
|
||||
*x = sec->centerspot.x;
|
||||
*y = sec->centerspot.y;
|
||||
}
|
||||
|
||||
// Set sound vertical position based on channel.
|
||||
|
|
|
@ -4983,7 +4983,6 @@ void A_Weave(AActor *self, int xyspeed, int zspeed, fixed_t xydist, fixed_t zdis
|
|||
newX -= self->X();
|
||||
newY -= self->Y();
|
||||
self->SetXY(self->Vec2Offset(newX, newY));
|
||||
self->SetMovement(newX, newY, 0);
|
||||
self->LinkToWorld ();
|
||||
}
|
||||
self->WeaveIndexXY = weaveXY;
|
||||
|
|
|
@ -207,3 +207,10 @@ enum
|
|||
416 = 0, Floor_LowerToHighest(0)
|
||||
420 = 0, ACS_ExecuteWithResult(0)
|
||||
421 = 0, Thing_ChangeTID(0)
|
||||
422 = 0, Thing_Raise(0)
|
||||
423 = 0, Thing_Stop(0)
|
||||
424 = 0, ThrustThing(0)
|
||||
425 = 0, ThrustThingZ(0)
|
||||
426 = 0, DamageThing(0)
|
||||
427 = 0, Thing_Damage(0)
|
||||
428 = 0, Thing_Destroy(0)
|
||||
|
|
Loading…
Reference in a new issue