mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-22 20:21:26 +00:00
- Renamed plane flags from SECF_* to PLANEF_*.
- Changed Heretic's plat raise type to use a flag to block further sector movement instead of keeping the dead thinker around. SVN r1853 (trunk)
This commit is contained in:
parent
555f41b0ba
commit
f3f209160e
13 changed files with 49 additions and 27 deletions
|
@ -1,3 +1,8 @@
|
|||
September 17, 2009 (Changes by Graf Zahl)
|
||||
- Renamed plane flags from SECF_* to PLANEF_*.
|
||||
- Changed Heretic's plat raise type to use a flag to block further sector movement
|
||||
instead of keeping the dead thinker around to block the sector.
|
||||
|
||||
September 16, 2009 (Changes by Graf Zahl)
|
||||
- Fixed: A_LookEx did not work for monsters having the MF_NOSECTOR flag.
|
||||
- Fixed: The deprecated flag handler for the old bounce flags needs to clear
|
||||
|
@ -16897,7 +16902,7 @@ November 14, 2000
|
|||
into c_cvars.cpp. Virtual inline functions are not inlined and cause the
|
||||
function to be generated for every source file the class is used in.
|
||||
- Fixed bug with Transfer_CeilingLight special. I was or'ing CeilingLight
|
||||
with SECF_ABSLIGHTING instead of CeilingFlags.
|
||||
with PLANEF_ABSLIGHTING instead of CeilingFlags.
|
||||
|
||||
November 11, 2000
|
||||
- Slopes don't work in mirrors. :-(
|
||||
|
|
|
@ -381,7 +381,7 @@ static void LoadSectors (sectortype *bsec)
|
|||
sec->SetXOffset(sector_t::floor, (bsec->floorxpanning << FRACBITS) + (32 << FRACBITS));
|
||||
sec->SetYOffset(sector_t::floor, bsec->floorypanning << FRACBITS);
|
||||
sec->SetPlaneLight(sector_t::floor, SHADE2LIGHT (bsec->floorshade));
|
||||
sec->ChangeFlags(sector_t::floor, 0, SECF_ABSLIGHTING);
|
||||
sec->ChangeFlags(sector_t::floor, 0, PLANEF_ABSLIGHTING);
|
||||
|
||||
sec->SetPlaneTexZ(sector_t::ceiling, -(LittleLong(bsec->ceilingz) << 8));
|
||||
sec->ceilingplane.d = sec->GetPlaneTexZ(sector_t::ceiling);
|
||||
|
@ -399,7 +399,7 @@ static void LoadSectors (sectortype *bsec)
|
|||
sec->SetXOffset(sector_t::ceiling, (bsec->ceilingxpanning << FRACBITS) + (32 << FRACBITS));
|
||||
sec->SetYOffset(sector_t::ceiling, bsec->ceilingypanning << FRACBITS);
|
||||
sec->SetPlaneLight(sector_t::ceiling, SHADE2LIGHT (bsec->ceilingshade));
|
||||
sec->ChangeFlags(sector_t::ceiling, 0, SECF_ABSLIGHTING);
|
||||
sec->ChangeFlags(sector_t::ceiling, 0, PLANEF_ABSLIGHTING);
|
||||
|
||||
sec->lightlevel = (sec->GetPlaneLight(sector_t::floor) + sec->GetPlaneLight(sector_t::ceiling)) / 2;
|
||||
|
||||
|
|
|
@ -232,7 +232,7 @@ bool EV_DoCeiling (DCeiling::ECeiling type, line_t *line,
|
|||
sec = §ors[secnum];
|
||||
manual_ceiling:
|
||||
// if ceiling already moving, don't start a second function on it
|
||||
if (sec->ceilingdata)
|
||||
if (sec->PlaneMoving(sector_t::ceiling))
|
||||
{
|
||||
if (!manual)
|
||||
continue;
|
||||
|
|
|
@ -394,7 +394,7 @@ bool EV_DoDoor (DDoor::EVlDoor type, line_t *line, AActor *thing,
|
|||
secnum = int(sec-sectors);
|
||||
|
||||
// if door already has a thinker, use it
|
||||
if (sec->ceilingdata)
|
||||
if (sec->PlaneMoving(sector_t::ceiling))
|
||||
{
|
||||
if (sec->ceilingdata->IsKindOf (RUNTIME_CLASS(DDoor)))
|
||||
{
|
||||
|
@ -447,7 +447,7 @@ bool EV_DoDoor (DDoor::EVlDoor type, line_t *line, AActor *thing,
|
|||
{
|
||||
sec = §ors[secnum];
|
||||
// if the ceiling already moving, don't start the door action
|
||||
if (sec->ceilingdata)
|
||||
if (sec->PlaneMoving(sector_t::ceiling))
|
||||
continue;
|
||||
|
||||
if (new DDoor (sec, type, speed, delay, lightTag))
|
||||
|
|
|
@ -377,7 +377,7 @@ bool EV_DoFloor (DFloor::EFloor floortype, line_t *line, int tag,
|
|||
|
||||
manual_floor:
|
||||
// ALREADY MOVING? IF SO, KEEP GOING...
|
||||
if (sec->floordata)
|
||||
if (sec->PlaneMoving(sector_t::floor))
|
||||
{
|
||||
if (manual)
|
||||
continue;
|
||||
|
@ -748,7 +748,7 @@ manual_stair:
|
|||
// ALREADY MOVING? IF SO, KEEP GOING...
|
||||
//jff 2/26/98 add special lockout condition to wait for entire
|
||||
//staircase to build before retriggering
|
||||
if (sec->floordata || sec->stairlock)
|
||||
if (sec->PlaneMoving(sector_t::floor) || sec->stairlock)
|
||||
{
|
||||
if (!manual)
|
||||
continue;
|
||||
|
@ -800,7 +800,7 @@ manual_stair:
|
|||
|
||||
// if sector's floor already moving, look for another
|
||||
//jff 2/26/98 special lockout condition for retriggering
|
||||
if (tsec->floordata || tsec->stairlock)
|
||||
if (tsec->PlaneMoving(sector_t::floor) || tsec->stairlock)
|
||||
{
|
||||
prev = sec;
|
||||
sec = tsec;
|
||||
|
@ -833,7 +833,7 @@ manual_stair:
|
|||
|
||||
// if sector's floor already moving, look for another
|
||||
//jff 2/26/98 special lockout condition for retriggering
|
||||
if (tsec->floordata || tsec->stairlock)
|
||||
if (tsec->PlaneMoving(sector_t::floor) || tsec->stairlock)
|
||||
continue;
|
||||
|
||||
ok = true;
|
||||
|
@ -917,7 +917,7 @@ bool EV_DoDonut (int tag, fixed_t pillarspeed, fixed_t slimespeed)
|
|||
s1 = §ors[secnum]; // s1 is pillar's sector
|
||||
|
||||
// ALREADY MOVING? IF SO, KEEP GOING...
|
||||
if (s1->floordata)
|
||||
if (s1->PlaneMoving(sector_t::floor))
|
||||
continue;
|
||||
|
||||
rtn = true;
|
||||
|
@ -925,7 +925,7 @@ bool EV_DoDonut (int tag, fixed_t pillarspeed, fixed_t slimespeed)
|
|||
if (!s2) // note lowest numbered line around
|
||||
continue; // pillar must be two-sided
|
||||
|
||||
if (s2->floordata)
|
||||
if (s2->PlaneMoving(sector_t::floor))
|
||||
continue;
|
||||
|
||||
for (i = 0; i < s2->linecount; i++)
|
||||
|
@ -1007,7 +1007,7 @@ bool EV_DoElevator (line_t *line, DElevator::EElevator elevtype,
|
|||
sec = §ors[secnum];
|
||||
|
||||
// If either floor or ceiling is already activated, skip it
|
||||
if (sec->floordata || sec->ceilingdata) //jff 2/22/98
|
||||
if (sec->PlaneMoving(sector_t::floor) || sec->ceilingdata) //jff 2/22/98
|
||||
continue;
|
||||
|
||||
// create and initialize new elevator thinker
|
||||
|
@ -1225,7 +1225,8 @@ bool EV_StartWaggle (int tag, int height, int speed, int offset,
|
|||
while ((sectorIndex = P_FindSectorFromTag(tag, sectorIndex)) >= 0)
|
||||
{
|
||||
sector = §ors[sectorIndex];
|
||||
if ((!ceiling && sector->floordata) || (ceiling && sector->ceilingdata))
|
||||
if ((!ceiling && sector->PlaneMoving(sector_t::floor)) ||
|
||||
(ceiling && sector->PlaneMoving(sector_t::ceiling)))
|
||||
{ // Already busy with another thinker
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -300,7 +300,8 @@ bool P_AddSectorLinks(sector_t *control, int tag, INTBOOL ceiling, int movetype)
|
|||
int param = movetype;
|
||||
|
||||
// can't be done if the control sector is moving.
|
||||
if ((ceiling && control->ceilingdata) || (!ceiling && control->floordata)) return false;
|
||||
if ((ceiling && control->PlaneMoving(sector_t::ceiling)) ||
|
||||
(!ceiling && control->PlaneMoving(sector_t::floor))) return false;
|
||||
|
||||
// Make sure we have only valid combinations
|
||||
movetype &= LINK_FLAGMASK;
|
||||
|
|
|
@ -205,7 +205,7 @@ bool EV_DoPillar (DPillar::EPillar type, int tag, fixed_t speed, fixed_t height,
|
|||
{
|
||||
sector_t *sec = §ors[secnum];
|
||||
|
||||
if (sec->floordata || sec->ceilingdata)
|
||||
if (sec->PlaneMoving(sector_t::floor) || sec->PlaneMoving(sector_t::ceiling))
|
||||
continue;
|
||||
|
||||
fixed_t flor, ceil;
|
||||
|
|
|
@ -91,7 +91,10 @@ void DPlat::Tick ()
|
|||
switch (m_Type)
|
||||
{
|
||||
case platRaiseAndStayLockout:
|
||||
break;
|
||||
// Instead of keeping the dead thinker like Heretic did let's
|
||||
// better use a flag to avoid problems elsewhere. For example,
|
||||
// keeping the thinker would make tagwait wait indefinitely.
|
||||
m_Sector->planes[sector_t::floor].Flags |= PLANEF_BLOCKED;
|
||||
case platRaiseAndStay:
|
||||
case platDownByValue:
|
||||
case platDownWaitUpStay:
|
||||
|
@ -236,7 +239,7 @@ bool EV_DoPlat (int tag, line_t *line, DPlat::EPlatType type, int height,
|
|||
sec = §ors[secnum];
|
||||
|
||||
manual_plat:
|
||||
if (sec->floordata)
|
||||
if (sec->PlaneMoving(sector_t::floor))
|
||||
{
|
||||
if (!manual)
|
||||
continue;
|
||||
|
|
|
@ -761,3 +761,12 @@ void sector_t::ClosestPoint(fixed_t fx, fixed_t fy, fixed_t &ox, fixed_t &oy) co
|
|||
ox = fixed_t(bestx);
|
||||
oy = fixed_t(besty);
|
||||
}
|
||||
|
||||
|
||||
bool sector_t::PlaneMoving(int pos)
|
||||
{
|
||||
if (pos == floor)
|
||||
return (floordata != NULL || (planes[floor].Flags & PLANEF_BLOCKED));
|
||||
else
|
||||
return (ceilingdata != NULL || (planes[ceiling].Flags & PLANEF_BLOCKED));
|
||||
}
|
||||
|
|
|
@ -692,12 +692,12 @@ DLightTransfer::DLightTransfer (sector_t *srcSec, int target, bool copyFloor)
|
|||
if (copyFloor)
|
||||
{
|
||||
for (secnum = -1; (secnum = P_FindSectorFromTag (target, secnum)) >= 0; )
|
||||
sectors[secnum].ChangeFlags(sector_t::floor, 0, SECF_ABSLIGHTING);
|
||||
sectors[secnum].ChangeFlags(sector_t::floor, 0, PLANEF_ABSLIGHTING);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (secnum = -1; (secnum = P_FindSectorFromTag (target, secnum)) >= 0; )
|
||||
sectors[secnum].ChangeFlags(sector_t::ceiling, 0, SECF_ABSLIGHTING);
|
||||
sectors[secnum].ChangeFlags(sector_t::ceiling, 0, PLANEF_ABSLIGHTING);
|
||||
}
|
||||
ChangeStatNum (STAT_LIGHTTRANSFER);
|
||||
}
|
||||
|
|
|
@ -1125,13 +1125,13 @@ struct UDMFParser
|
|||
continue;
|
||||
|
||||
case NAME_Lightfloorabsolute:
|
||||
if (CheckBool(key)) sec->ChangeFlags(sector_t::floor, 0, SECF_ABSLIGHTING);
|
||||
else sec->ChangeFlags(sector_t::floor, SECF_ABSLIGHTING, 0);
|
||||
if (CheckBool(key)) sec->ChangeFlags(sector_t::floor, 0, PLANEF_ABSLIGHTING);
|
||||
else sec->ChangeFlags(sector_t::floor, PLANEF_ABSLIGHTING, 0);
|
||||
continue;
|
||||
|
||||
case NAME_Lightceilingabsolute:
|
||||
if (CheckBool(key)) sec->ChangeFlags(sector_t::ceiling, 0, SECF_ABSLIGHTING);
|
||||
else sec->ChangeFlags(sector_t::ceiling, SECF_ABSLIGHTING, 0);
|
||||
if (CheckBool(key)) sec->ChangeFlags(sector_t::ceiling, 0, PLANEF_ABSLIGHTING);
|
||||
else sec->ChangeFlags(sector_t::ceiling, PLANEF_ABSLIGHTING, 0);
|
||||
continue;
|
||||
|
||||
case NAME_Gravity:
|
||||
|
|
|
@ -270,7 +270,7 @@ void R_ClearClipSegs (short left, short right)
|
|||
|
||||
int GetFloorLight (const sector_t *sec)
|
||||
{
|
||||
if (sec->GetFlags(sector_t::floor) & SECF_ABSLIGHTING)
|
||||
if (sec->GetFlags(sector_t::floor) & PLANEF_ABSLIGHTING)
|
||||
{
|
||||
return sec->GetPlaneLight(sector_t::floor);
|
||||
}
|
||||
|
@ -282,7 +282,7 @@ int GetFloorLight (const sector_t *sec)
|
|||
|
||||
int GetCeilingLight (const sector_t *sec)
|
||||
{
|
||||
if (sec->GetFlags(sector_t::ceiling) & SECF_ABSLIGHTING)
|
||||
if (sec->GetFlags(sector_t::ceiling) & PLANEF_ABSLIGHTING)
|
||||
{
|
||||
return sec->GetPlaneLight(sector_t::ceiling);
|
||||
}
|
||||
|
|
|
@ -299,7 +299,8 @@ inline FArchive &operator<< (FArchive &arc, secplane_t &plane)
|
|||
// Ceiling/floor flags
|
||||
enum
|
||||
{
|
||||
SECF_ABSLIGHTING = 1 // floor/ceiling light is absolute, not relative
|
||||
PLANEF_ABSLIGHTING = 1, // floor/ceiling light is absolute, not relative
|
||||
PLANEF_BLOCKED = 2 // can not be moved anymore.
|
||||
};
|
||||
|
||||
// Internal sector flags
|
||||
|
@ -605,6 +606,8 @@ struct sector_t
|
|||
return lightlevel;
|
||||
}
|
||||
|
||||
bool PlaneMoving(int pos);
|
||||
|
||||
|
||||
// Member variables
|
||||
fixed_t CenterFloor () const { return floorplane.ZatPoint (soundorg[0], soundorg[1]); }
|
||||
|
|
Loading…
Reference in a new issue