- added 'floorterrain' and 'ceilingterrain' sector properties for UDMF. These will take precedence over texture based terrain if used.
'ceilingterrain' is needed because the top of 3D-floors refers to the model sector's ceiling, so in order to give a 3D floor a terrain it must be assignable to the sector's ceiling. Note that although it is basically the same property, its actual function bears no relevance to its use in Eternity.
This commit is contained in:
parent
4b3adf548a
commit
71c7f2b42c
19 changed files with 80 additions and 17 deletions
|
|
@ -242,6 +242,7 @@ void P_GetFloorCeilingZ(FCheckPosition &tmf, int flags)
|
|||
tmf.floorz = tmf.dropoffz = sec->floorplane.ZatPoint(tmf.x, tmf.y);
|
||||
tmf.ceilingz = sec->ceilingplane.ZatPoint(tmf.x, tmf.y);
|
||||
tmf.floorpic = sec->GetTexture(sector_t::floor);
|
||||
tmf.floorterrain = sec->GetTerrain(sector_t::floor);
|
||||
tmf.ceilingpic = sec->GetTexture(sector_t::ceiling);
|
||||
}
|
||||
else
|
||||
|
|
@ -264,6 +265,7 @@ void P_GetFloorCeilingZ(FCheckPosition &tmf, int flags)
|
|||
{
|
||||
tmf.dropoffz = tmf.floorz = ff_top;
|
||||
tmf.floorpic = *rover->top.texture;
|
||||
tmf.floorterrain = rover->model->GetTerrain(rover->top.isceiling);
|
||||
}
|
||||
}
|
||||
if (ff_bottom <= tmf.ceilingz && ff_bottom > tmf.z + tmf.thing->height)
|
||||
|
|
@ -304,6 +306,7 @@ void P_FindFloorCeiling(AActor *actor, int flags)
|
|||
tmf.floorz = tmf.dropoffz = actor->floorz;
|
||||
tmf.ceilingz = actor->ceilingz;
|
||||
tmf.floorpic = actor->floorpic;
|
||||
tmf.floorterrain = actor->floorterrain;
|
||||
tmf.ceilingpic = actor->ceilingpic;
|
||||
P_GetFloorCeilingZ(tmf, flags);
|
||||
}
|
||||
|
|
@ -311,6 +314,7 @@ void P_FindFloorCeiling(AActor *actor, int flags)
|
|||
actor->dropoffz = tmf.dropoffz;
|
||||
actor->ceilingz = tmf.ceilingz;
|
||||
actor->floorpic = tmf.floorpic;
|
||||
actor->floorterrain = tmf.floorterrain;
|
||||
actor->floorsector = tmf.floorsector;
|
||||
actor->ceilingpic = tmf.ceilingpic;
|
||||
actor->ceilingsector = tmf.ceilingsector;
|
||||
|
|
@ -337,6 +341,7 @@ void P_FindFloorCeiling(AActor *actor, int flags)
|
|||
actor->dropoffz = tmf.dropoffz;
|
||||
actor->ceilingz = tmf.ceilingz;
|
||||
actor->floorpic = tmf.floorpic;
|
||||
actor->floorterrain = tmf.floorterrain;
|
||||
actor->floorsector = tmf.floorsector;
|
||||
actor->ceilingpic = tmf.ceilingpic;
|
||||
actor->ceilingsector = tmf.ceilingsector;
|
||||
|
|
@ -348,6 +353,7 @@ void P_FindFloorCeiling(AActor *actor, int flags)
|
|||
if (actor->Sector != NULL)
|
||||
{
|
||||
actor->floorpic = actor->Sector->GetTexture(sector_t::floor);
|
||||
actor->floorterrain = actor->Sector->GetTerrain(sector_t::floor);
|
||||
actor->ceilingpic = actor->Sector->GetTexture(sector_t::ceiling);
|
||||
}
|
||||
}
|
||||
|
|
@ -455,6 +461,7 @@ bool P_TeleportMove(AActor *thing, fixed_t x, fixed_t y, fixed_t z, bool telefra
|
|||
thing->ceilingz = tmf.ceilingz;
|
||||
thing->floorsector = tmf.floorsector;
|
||||
thing->floorpic = tmf.floorpic;
|
||||
thing->floorterrain = tmf.floorterrain;
|
||||
thing->ceilingsector = tmf.ceilingsector;
|
||||
thing->ceilingpic = tmf.ceilingpic;
|
||||
thing->dropoffz = tmf.dropoffz; // killough 11/98
|
||||
|
|
@ -532,14 +539,14 @@ void P_PlayerStartStomp(AActor *actor)
|
|||
inline fixed_t secfriction(const sector_t *sec, int plane = sector_t::floor)
|
||||
{
|
||||
if (sec->Flags & SECF_FRICTION) return sec->friction;
|
||||
fixed_t friction = Terrains[TerrainTypes[sec->GetTexture(plane)]].Friction;
|
||||
fixed_t friction = Terrains[sec->GetTerrain(plane)].Friction;
|
||||
return friction != 0 ? friction : ORIG_FRICTION;
|
||||
}
|
||||
|
||||
inline fixed_t secmovefac(const sector_t *sec, int plane = sector_t::floor)
|
||||
{
|
||||
if (sec->Flags & SECF_FRICTION) return sec->friction;
|
||||
fixed_t movefactor = Terrains[TerrainTypes[sec->GetTexture(plane)]].MoveFactor;
|
||||
fixed_t movefactor = Terrains[sec->GetTerrain(plane)].MoveFactor;
|
||||
return movefactor != 0 ? movefactor : ORIG_FRICTION_FACTOR;
|
||||
}
|
||||
|
||||
|
|
@ -633,7 +640,7 @@ int P_GetFriction(const AActor *mo, int *frictionfactor)
|
|||
}
|
||||
|
||||
if (!(sec->Flags & SECF_FRICTION) &&
|
||||
Terrains[TerrainTypes[sec->GetTexture(sector_t::floor)]].Friction == 0)
|
||||
Terrains[sec->GetTerrain(sector_t::floor)].Friction == 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
|
@ -891,6 +898,7 @@ bool PIT_CheckLine(line_t *ld, const FBoundingBox &box, FCheckPosition &tm)
|
|||
tm.floorz = open.bottom;
|
||||
tm.floorsector = open.bottomsec;
|
||||
tm.floorpic = open.floorpic;
|
||||
tm.floorterrain = open.floorterrain;
|
||||
tm.touchmidtex = open.touchmidtex;
|
||||
tm.abovemidtex = open.abovemidtex;
|
||||
tm.thing->BlockingLine = ld;
|
||||
|
|
@ -1436,6 +1444,7 @@ bool P_CheckPosition(AActor *thing, fixed_t x, fixed_t y, FCheckPosition &tm, bo
|
|||
tm.floorz = tm.dropoffz = newsec->floorplane.ZatPoint(x, y);
|
||||
tm.ceilingz = newsec->ceilingplane.ZatPoint(x, y);
|
||||
tm.floorpic = newsec->GetTexture(sector_t::floor);
|
||||
tm.floorterrain = newsec->GetTerrain(sector_t::floor);
|
||||
tm.floorsector = newsec;
|
||||
tm.ceilingpic = newsec->GetTexture(sector_t::ceiling);
|
||||
tm.ceilingsector = newsec;
|
||||
|
|
@ -1468,6 +1477,7 @@ bool P_CheckPosition(AActor *thing, fixed_t x, fixed_t y, FCheckPosition &tm, bo
|
|||
{
|
||||
tm.floorz = tm.dropoffz = ff_top;
|
||||
tm.floorpic = *rover->top.texture;
|
||||
tm.floorterrain = rover->model->GetTerrain(rover->top.isceiling);
|
||||
}
|
||||
if (ff_bottom < tm.ceilingz && abs(delta1) >= abs(delta2))
|
||||
{
|
||||
|
|
@ -2091,6 +2101,7 @@ bool P_TryMove(AActor *thing, fixed_t x, fixed_t y,
|
|||
thing->ceilingz = tm.ceilingz;
|
||||
thing->dropoffz = tm.dropoffz; // killough 11/98: keep track of dropoffs
|
||||
thing->floorpic = tm.floorpic;
|
||||
thing->floorterrain = tm.floorterrain;
|
||||
thing->floorsector = tm.floorsector;
|
||||
thing->ceilingpic = tm.ceilingpic;
|
||||
thing->ceilingsector = tm.ceilingsector;
|
||||
|
|
@ -4951,6 +4962,7 @@ bool P_AdjustFloorCeil(AActor *thing, FChangePosition *cpos)
|
|||
thing->ceilingz = tm.ceilingz;
|
||||
thing->dropoffz = tm.dropoffz; // killough 11/98: remember dropoffs
|
||||
thing->floorpic = tm.floorpic;
|
||||
thing->floorterrain = tm.floorterrain;
|
||||
thing->floorsector = tm.floorsector;
|
||||
thing->ceilingpic = tm.ceilingpic;
|
||||
thing->ceilingsector = tm.ceilingsector;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue