- Added submission for ACS CheckPlayerCamera ACS function.

- Removed FRadiusThingsIterator after discovering that VC++ misoptimized
  it in P_CheckPosition. Now FBlockThingsIterator is used with the distance
  check being done manually. 

SVN r914 (trunk)
This commit is contained in:
Christoph Oelckers 2008-04-15 10:04:41 +00:00
commit 99b2fab410
9 changed files with 71 additions and 53 deletions

View file

@ -253,7 +253,7 @@ bool P_TeleportMove (AActor *thing, fixed_t x, fixed_t y, fixed_t z, bool telefr
if (tmf.touchmidtex) tmf.dropoffz = tmf.floorz;
FRadiusThingsIterator it2(x, y, thing->radius);
FBlockThingsIterator it2(FBoundingBox(x, y, thing->radius));
AActor *th;
while ((th = it2.Next()))
@ -265,6 +265,10 @@ bool P_TeleportMove (AActor *thing, fixed_t x, fixed_t y, fixed_t z, bool telefr
if (th == thing)
continue;
fixed_t blockdist = th->radius + tmf.thing->radius;
if ( abs(th->x - tmf.x) >= blockdist || abs(th->y - tmf.y) >= blockdist)
continue;
// [RH] Z-Check
// But not if not MF2_PASSMOBJ or MF3_DONTOVERLAP are set!
// Otherwise those things would get stuck inside each other.
@ -325,7 +329,7 @@ bool P_TeleportMove (AActor *thing, fixed_t x, fixed_t y, fixed_t z, bool telefr
void P_PlayerStartStomp (AActor *actor)
{
AActor *th;
FRadiusThingsIterator it(actor->x, actor->y, actor->radius);
FBlockThingsIterator it(FBoundingBox(actor->x, actor->y, actor->radius));
while ((th = it.Next()))
{
@ -336,6 +340,9 @@ void P_PlayerStartStomp (AActor *actor)
if (th == actor || (th->player == actor->player && th->player != NULL))
continue;
if (!th->intersects(actor))
continue;
// only kill monsters and other players
if (th->player == NULL && !(th->flags3 & MF3_ISMONSTER))
continue;
@ -643,7 +650,7 @@ bool PIT_CheckThing (AActor *thing, FCheckPosition &tm)
fixed_t topz;
bool solid;
int damage;
// don't clip against self
if (thing == tm.thing)
return true;
@ -651,6 +658,10 @@ bool PIT_CheckThing (AActor *thing, FCheckPosition &tm)
if (!(thing->flags & (MF_SOLID|MF_SPECIAL|MF_SHOOTABLE)) )
return true; // can't hit thing
fixed_t blockdist = thing->radius + tm.thing->radius;
if ( abs(thing->x - tm.x) >= blockdist || abs(thing->y - tm.y) >= blockdist)
return true;
tm.thing->BlockingMobj = thing;
topz = thing->z + thing->height;
if (!(i_compatflags & COMPATF_NO_PASSMOBJ) && !(tm.thing->flags & (MF_FLOAT|MF_MISSILE|MF_SKULLFLY|MF_NOGRAVITY)) &&
@ -1037,7 +1048,7 @@ bool P_CheckPosition (AActor *thing, fixed_t x, fixed_t y, FCheckPosition &tm)
tm.stepthing = NULL;
FRadiusThingsIterator it2(x, y, thing->radius);
FBlockThingsIterator it2(FBoundingBox(x, y, thing->radius));
AActor *th;
while ((th = it2.Next()))
{
@ -1168,11 +1179,15 @@ bool P_TestMobjZ (AActor *actor, bool quick, AActor **pOnmobj)
return true;
}
FRadiusThingsIterator it(actor->x, actor->y, actor->radius);
FBlockThingsIterator it(FBoundingBox(actor->x, actor->y, actor->radius));
AActor *thing;
while ((thing = it.Next()))
{
if (!thing->intersects(actor))
{
continue;
}
if (!(thing->flags & MF_SOLID))
{ // Can't hit thing
continue;
@ -3392,7 +3407,7 @@ void P_RadiusAttack (AActor *bombspot, AActor *bombsource, int bombdamage, int b
float bombdamagefloat = (float)bombdamage;
FVector3 bombvec(FIXED2FLOAT(bombspot->x), FIXED2FLOAT(bombspot->y), FIXED2FLOAT(bombspot->z));
FRadiusThingsIterator it(bombspot->x, bombspot->y, bombdistance<<FRACBITS);
FBlockThingsIterator it(FBoundingBox(bombspot->x, bombspot->y, bombdistance<<FRACBITS));
AActor *thing;
while ((thing = it.Next()))
@ -3627,9 +3642,13 @@ void P_FindAboveIntersectors (AActor *actor)
return;
AActor *thing;
FRadiusThingsIterator it(actor->x, actor->y, actor->radius);
FBlockThingsIterator it(FBoundingBox(actor->x, actor->y, actor->radius));
while ((thing = it.Next()))
{
if (!thing->intersects(actor))
{
continue;
}
if (!(thing->flags & MF_SOLID))
{ // Can't hit thing
continue;
@ -3665,9 +3684,13 @@ void P_FindBelowIntersectors (AActor *actor)
return;
AActor *thing;
FRadiusThingsIterator it(actor->x, actor->y, actor->radius);
FBlockThingsIterator it(FBoundingBox(actor->x, actor->y, actor->radius));
while ((thing = it.Next()))
{
if (!thing->intersects(actor))
{
continue;
}
if (!(thing->flags & MF_SOLID))
{ // Can't hit thing
continue;