Testing changes for GZDoom 4.11/5.0.
This commit is contained in:
parent
75ffce1627
commit
d0fddbf8a3
24 changed files with 104 additions and 331 deletions
|
|
@ -9,68 +9,6 @@ enum EExitType
|
|||
|
||||
extend Class SWWMUtility
|
||||
{
|
||||
// how the fuck is this not available to ZScript?
|
||||
// copied from P_PointOnLineSidePrecise()
|
||||
deprecated("4.11", "Use Level.PointOnLineSide() instead") static int PointOnLineSide( Vector2 p, Line l )
|
||||
{
|
||||
if ( !l ) return 0;
|
||||
return (((p.y-l.v1.p.y)*l.delta.x+(l.v1.p.x-p.x)*l.delta.y) > double.epsilon);
|
||||
}
|
||||
|
||||
// haha another one
|
||||
// copied from BoxOnLineSide()
|
||||
deprecated("4.11", "Use Level.BoxOnLineSide() instead") static int BoxOnLineSide( double top, double bottom, double left, double right, Line l )
|
||||
{
|
||||
if ( !l ) return 0;
|
||||
int p1, p2;
|
||||
if ( l.delta.x == 0 )
|
||||
{
|
||||
// ST_VERTICAL:
|
||||
p1 = (right < l.v1.p.x);
|
||||
p2 = (left < l.v1.p.x);
|
||||
if ( l.delta.y < 0 )
|
||||
{
|
||||
p1 ^= 1;
|
||||
p2 ^= 1;
|
||||
}
|
||||
}
|
||||
else if ( l.delta.y == 0 )
|
||||
{
|
||||
// ST_HORIZONTAL:
|
||||
p1 = (top > l.v1.p.y);
|
||||
p2 = (bottom > l.v1.p.y);
|
||||
if ( l.delta.x < 0 )
|
||||
{
|
||||
p1 ^= 1;
|
||||
p2 ^= 1;
|
||||
}
|
||||
}
|
||||
else if ( (l.delta.x*l.delta.y) >= 0 )
|
||||
{
|
||||
// ST_POSITIVE:
|
||||
p1 = PointOnLineSide((left,top),l);
|
||||
p2 = PointOnLineSide((right,bottom),l);
|
||||
}
|
||||
else
|
||||
{
|
||||
// ST_NEGATIVE:
|
||||
p1 = PointOnLineSide((right,top),l);
|
||||
p2 = PointOnLineSide((left,bottom),l);
|
||||
}
|
||||
return (p1==p2)?p1:-1;
|
||||
}
|
||||
|
||||
// wrapper
|
||||
deprecated("4.11", "Use Level.ActorOnLineSide() instead") static int ActorOnLineSide( Actor a, Line l )
|
||||
{
|
||||
double box[4];
|
||||
box[0] = a.pos.y+a.radius;
|
||||
box[1] = a.pos.y-a.radius;
|
||||
box[2] = a.pos.x-a.radius;
|
||||
box[3] = a.pos.x+a.radius;
|
||||
return BoxOnLineSide(box[0],box[1],box[2],box[3],l);
|
||||
}
|
||||
|
||||
// Thanks to ZZYZX and Nash
|
||||
static play void SetToSlopeSpecific( Actor a, double dang, SecPlane plane, bool flipnorm )
|
||||
{
|
||||
|
|
@ -208,17 +146,6 @@ extend Class SWWMUtility
|
|||
return false;
|
||||
}
|
||||
|
||||
deprecated("4.11","Use Key.IsLockDefined() instead") static bool IsValidLockNum( int l )
|
||||
{
|
||||
if ( (l < 1) || (l > 255) ) return true;
|
||||
return SWWMCachedLockInfo.IsValidLock(l);
|
||||
}
|
||||
|
||||
deprecated("4.11","Use Key.GetMapColorForLock() instead") static Color GetLockColor( int l )
|
||||
{
|
||||
return SWWMCachedLockInfo.GetLockColor(l);
|
||||
}
|
||||
|
||||
static bool IsDoorSector( Sector s, int part )
|
||||
{
|
||||
// super-easy mode: check for boss special sectors
|
||||
|
|
@ -586,7 +513,7 @@ extend Class SWWMUtility
|
|||
else if ( a.BlockingLine && BlockingLineIsBlocking(a,Line.ML_BLOCKEVERYTHING|Line.ML_BLOCKPROJECTILE,a.BlockingLine) )
|
||||
{
|
||||
HitNormal = (-a.BlockingLine.delta.y,a.BlockingLine.delta.x,0).unit();
|
||||
if ( !SWWMUtility.PointOnLineSide(a.pos.xy,a.BlockingLine) )
|
||||
if ( !Level.PointOnLineSide(a.pos.xy,a.BlockingLine) )
|
||||
HitNormal *= -1;
|
||||
}
|
||||
else
|
||||
|
|
@ -747,6 +674,6 @@ extend Class SWWMUtility
|
|||
}
|
||||
}
|
||||
// is the point behind both lines?
|
||||
return (PointOnLineSide(p,a) && PointOnLineSide(p,b));
|
||||
return (Level.PointOnLineSide(p,a) && Level.PointOnLineSide(p,b));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue