- Blood: remove GetWallAngle variant with index parameter

This commit is contained in:
Christoph Oelckers 2021-11-21 09:45:50 +01:00
parent 624ad6a2ad
commit 7a7537961b
6 changed files with 6 additions and 14 deletions

View file

@ -152,7 +152,6 @@ extern TArray<walltype> wall;
extern spritetype sprite[MAXSPRITES];
EXTERN int leveltimer;
extern TArray<sectortype> sectorbackup;
extern TArray<walltype> wallbackup;

View file

@ -5785,7 +5785,7 @@ static void actCheckThings()
speed = pXSector->panVel << 9;
if (!pXSector->panAlways && pXSector->busy) speed = MulScale(speed, pXSector->busy, 16);
}
if (pSector->floorstat & 64) angle = (angle + GetWallAngle(pSector->wallptr) + 512) & 2047;
if (pSector->floorstat & 64) angle = (angle + GetWallAngle(pSector->firstWall()) + 512) & 2047;
actor->xvel += MulScale(speed, Cos(angle), 30);
actor->yvel += MulScale(speed, Sin(angle), 30);
@ -6235,7 +6235,7 @@ static void actCheckDudes()
speed = MulScale(speed, pXSector->busy, 16);
}
if (pSector->floorstat & 64)
angle = (angle + GetWallAngle(pSector->wallptr) + 512) & 2047;
angle = (angle + GetWallAngle(pSector->firstWall()) + 512) & 2047;
int dx = MulScale(speed, Cos(angle), 30);
int dy = MulScale(speed, Sin(angle), 30);
actor->xvel += dx;
@ -6910,7 +6910,7 @@ void actFireVector(DBloodActor* shooter, int a2, int a3, int a4, int a5, int a6,
auto pFX = gFX.fxSpawnActor(pVectorData->surfHit[nSurf].fx1, nSector, x, y, z, 0);
if (pFX)
{
pFX->s().ang = (GetWallAngle(nWall) + 512) & 2047;
pFX->s().ang = (GetWallAngle(pWall) + 512) & 2047;
pFX->s().cstat |= 16;
}
}
@ -7017,7 +7017,7 @@ void actFireVector(DBloodActor* shooter, int a2, int a3, int a4, int a5, int a6,
if (pFX)
{
pFX->zvel = 0x2222;
pFX->s().ang = (GetWallAngle(nWall) + 512) & 2047;
pFX->s().ang = (GetWallAngle(&wall[nWall]) + 512) & 2047;
pFX->s().cstat |= 16;
}
}

View file

@ -284,12 +284,6 @@ bool CheckProximityWall(int nWall, int x, int y, int nDist)
return check1 * check1 < check2 * nDist * nDist;
}
int GetWallAngle(int nWall)
{
int nWall2 = wall[nWall].point2;
return getangle(wall[nWall2].x - wall[nWall].x, wall[nWall2].y - wall[nWall].y);
}
int GetWallAngle(walltype* pWall)
{
int nWall2 = pWall->point2;

View file

@ -56,7 +56,6 @@ bool FindSector(int nX, int nY, int *nSector);
bool CheckProximity(DBloodActor *pSprite, int nX, int nY, int nZ, int nSector, int nDist);
bool CheckProximityPoint(int nX1, int nY1, int nZ1, int nX2, int nY2, int nZ2, int nDist);
bool CheckProximityWall(int nWall, int x, int y, int nDist);
int GetWallAngle(int nWall);
int GetWallAngle(walltype* pWall);
void GetWallNormal(int nWall, int *pX, int *pY);
bool IntersectRay(int wx, int wy, int wdx, int wdy, int x1, int y1, int z1, int x2, int y2, int z2, int *ix, int *iy, int *iz);

View file

@ -1356,7 +1356,7 @@ void nnExtProcessSuperSprites()
speed = MulScale(speed, pXSector->busy, 16);
}
if (sector[pDebris->sectnum].floorstat & 64)
angle = (angle + GetWallAngle(sector[pDebris->sectnum].wallptr) + 512) & 2047;
angle = (angle + GetWallAngle(sector[pDebris->sectnum].firstWall()) + 512) & 2047;
int dx = MulScale(speed, Cos(angle), 30);
int dy = MulScale(speed, Sin(angle), 30);
debrisactor->xvel += dx;

View file

@ -410,7 +410,7 @@ static void fakeMoveDude(spritetype *pSprite)
// ???
}
}
actWallBounceVector(&predict.xvel, &predict.yvel, nHitWall, 0);
actWallBounceVector(&predict.xvel, &predict.yvel, pHitWall, 0);
break;
}
}