mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 17:01:51 +00:00
- Blood: Replace CosScale16()
with bsin()
from backend.
This commit is contained in:
parent
3ec1767791
commit
ead877450d
23 changed files with 60 additions and 65 deletions
|
@ -6134,7 +6134,7 @@ static void actCheckTraps()
|
|||
y += (dy / 2) >> 12;
|
||||
}
|
||||
dy = bsin(pSprite->ang);
|
||||
dx = CosScale16(pSprite->ang);
|
||||
dx = bcos(pSprite->ang);
|
||||
gVectorData[kVectorTchernobogBurn].maxDist = pXSprite->data1 << 9;
|
||||
actFireVector(actor, 0, 0, dx, dy, Random2(0x8888), kVectorTchernobogBurn);
|
||||
}
|
||||
|
|
|
@ -138,7 +138,7 @@ bool CanMove(DBloodActor* actor, DBloodActor* target, int nAngle, int nRange)
|
|||
int x = pSprite->x;
|
||||
int y = pSprite->y;
|
||||
int z = pSprite->z;
|
||||
HitScan(pSprite, z, CosScale16(nAngle), bsin(nAngle), 0, CLIPMASK0, nRange);
|
||||
HitScan(pSprite, z, bcos(nAngle), bsin(nAngle), 0, CLIPMASK0, nRange);
|
||||
int nDist = approxDist(x - gHitInfo.hitx, y - gHitInfo.hity);
|
||||
if (nDist - (pSprite->clipdist << 2) < nRange)
|
||||
{
|
||||
|
|
|
@ -68,7 +68,7 @@ void batBiteSeqCallback(int, DBloodActor* actor)
|
|||
spritetype* pSprite = &actor->s();
|
||||
if (!actor->ValidateTarget(__FUNCTION__)) return;
|
||||
spritetype* pTarget = &actor->GetTarget()->s();
|
||||
int dx = CosScale16(pSprite->ang);
|
||||
int dx = bcos(pSprite->ang);
|
||||
int dy = bsin(pSprite->ang);
|
||||
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(pSprite->type);
|
||||
|
|
|
@ -69,7 +69,7 @@ void SlashSeqCallback(int, DBloodActor* actor)
|
|||
spritetype* pSprite = &actor->s();
|
||||
if (!actor->ValidateTarget(__FUNCTION__)) return;
|
||||
spritetype* pTarget = &actor->GetTarget()->s();
|
||||
int dx = CosScale16(pSprite->ang);
|
||||
int dx = bcos(pSprite->ang);
|
||||
int dy = bsin(pSprite->ang);
|
||||
// Correct ?
|
||||
int dz = pSprite->z - pTarget->z;
|
||||
|
@ -86,7 +86,7 @@ void StompSeqCallback(int, DBloodActor* actor1)
|
|||
uint8_t sectmap[(kMaxSectors + 7) >> 3];
|
||||
XSPRITE* pXSprite = &actor1->x();
|
||||
spritetype* pSprite = &actor1->s();
|
||||
int dx = CosScale16(pSprite->ang);
|
||||
int dx = bcos(pSprite->ang);
|
||||
int dy = bsin(pSprite->ang);
|
||||
int x = pSprite->x;
|
||||
int y = pSprite->y;
|
||||
|
|
|
@ -80,7 +80,7 @@ void eelBiteSeqCallback(int, DBloodActor* actor)
|
|||
}
|
||||
|
||||
spritetype* pTarget = &actor->GetTarget()->s();
|
||||
int dx = CosScale16(pSprite->ang);
|
||||
int dx = bcos(pSprite->ang);
|
||||
int dy = bsin(pSprite->ang);
|
||||
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(pSprite->type);
|
||||
|
|
|
@ -61,7 +61,7 @@ AISTATE tinycaleb139698 = { kAiStateOther, 8, -1, 120, NULL, aiMoveTurn, NULL, &
|
|||
void SeqAttackCallback(int, DBloodActor* actor)
|
||||
{
|
||||
spritetype* pSprite = &actor->s();
|
||||
int dx = CosScale16(pSprite->ang);
|
||||
int dx = bcos(pSprite->ang);
|
||||
int dy = bsin(pSprite->ang);
|
||||
int dz = actor->dudeSlope;
|
||||
dx += Random2(1500);
|
||||
|
|
|
@ -60,7 +60,7 @@ void cerberusBiteSeqCallback(int, DBloodActor* actor)
|
|||
{
|
||||
XSPRITE* pXSprite = &actor->x();
|
||||
spritetype* pSprite = &actor->s();
|
||||
int dx = CosScale16(pSprite->ang);
|
||||
int dx = bcos(pSprite->ang);
|
||||
int dy = bsin(pSprite->ang);
|
||||
///assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
||||
|
@ -88,7 +88,7 @@ void cerberusBurnSeqCallback(int, DBloodActor* actor)
|
|||
int z = height; // ???
|
||||
TARGETTRACK tt1 = { 0x10000, 0x10000, 0x100, 0x55, 0x1aaaaa };
|
||||
Aim aim;
|
||||
aim.dx = CosScale16(pSprite->ang);
|
||||
aim.dx = bcos(pSprite->ang);
|
||||
aim.dy = bsin(pSprite->ang);
|
||||
aim.dz = actor->dudeSlope;
|
||||
int nClosest = 0x7fffffff;
|
||||
|
@ -133,7 +133,7 @@ void cerberusBurnSeqCallback(int, DBloodActor* actor)
|
|||
if (cansee(x, y, z, pSprite->sectnum, x2, y2, z2, pSprite2->sectnum))
|
||||
{
|
||||
nClosest = nDist2;
|
||||
aim.dx = CosScale16(nAngle);
|
||||
aim.dx = bcos(nAngle);
|
||||
aim.dy = bsin(nAngle);
|
||||
aim.dz = DivScale(tz, nDist, 10);
|
||||
}
|
||||
|
@ -167,7 +167,7 @@ void cerberusBurnSeqCallback2(int, DBloodActor* actor)
|
|||
TARGETTRACK tt1 = { 0x10000, 0x10000, 0x100, 0x55, 0x1aaaaa };
|
||||
Aim aim;
|
||||
int ax, ay, az;
|
||||
aim.dx = ax = CosScale16(pSprite->ang);
|
||||
aim.dx = ax = bcos(pSprite->ang);
|
||||
aim.dy = ay = bsin(pSprite->ang);
|
||||
aim.dz = actor->dudeSlope;
|
||||
az = 0;
|
||||
|
@ -215,7 +215,7 @@ void cerberusBurnSeqCallback2(int, DBloodActor* actor)
|
|||
if (cansee(x, y, z, pSprite->sectnum, x2, y2, z2, pSprite2->sectnum))
|
||||
{
|
||||
nClosest = nDist2;
|
||||
aim.dx = CosScale16(nAngle);
|
||||
aim.dx = bcos(nAngle);
|
||||
aim.dy = bsin(nAngle);
|
||||
aim.dz = DivScale(tz, nDist, 10);
|
||||
}
|
||||
|
|
|
@ -77,7 +77,7 @@ void TommySeqCallback(int, DBloodActor* actor)
|
|||
{
|
||||
XSPRITE* pXSprite = &actor->x();
|
||||
spritetype* pSprite = &actor->s();
|
||||
int dx = CosScale16(pSprite->ang);
|
||||
int dx = bcos(pSprite->ang);
|
||||
int dy = bsin(pSprite->ang);
|
||||
int dz = actor->dudeSlope;
|
||||
dx += Random3((5 - gGameOptions.nDifficulty) * 1000);
|
||||
|
@ -93,7 +93,7 @@ void TeslaSeqCallback(int, DBloodActor* actor)
|
|||
spritetype* pSprite = &actor->s();
|
||||
if (Chance(dword_138BB0[gGameOptions.nDifficulty]))
|
||||
{
|
||||
int dx = CosScale16(pSprite->ang);
|
||||
int dx = bcos(pSprite->ang);
|
||||
int dy = bsin(pSprite->ang);
|
||||
int dz = actor->dudeSlope;
|
||||
dx += Random3((5 - gGameOptions.nDifficulty) * 1000);
|
||||
|
@ -108,7 +108,7 @@ void ShotSeqCallback(int, DBloodActor* actor)
|
|||
{
|
||||
XSPRITE* pXSprite = &actor->x();
|
||||
spritetype* pSprite = &actor->s();
|
||||
int dx = CosScale16(pSprite->ang);
|
||||
int dx = bcos(pSprite->ang);
|
||||
int dy = bsin(pSprite->ang);
|
||||
int dz = actor->dudeSlope;
|
||||
dx += Random2((5 - gGameOptions.nDifficulty) * 1000 - 500);
|
||||
|
|
|
@ -88,7 +88,7 @@ void SlashFSeqCallback(int, DBloodActor* actor)
|
|||
int height = (pSprite->yrepeat * pDudeInfo->eyeHeight) << 2;
|
||||
int height2 = (pTarget->yrepeat * pDudeInfoT->eyeHeight) << 2;
|
||||
int dz = height - height2;
|
||||
int dx = CosScale16(pSprite->ang);
|
||||
int dx = bcos(pSprite->ang);
|
||||
int dy = bsin(pSprite->ang);
|
||||
actFireVector(actor, 0, 0, dx, dy, dz, kVectorGargSlash);
|
||||
int r1 = Random(50);
|
||||
|
@ -121,7 +121,7 @@ void BlastSSeqCallback(int, DBloodActor* actor)
|
|||
int z = height;
|
||||
TARGETTRACK tt = { 0x10000, 0x10000, 0x100, 0x55, 0x1aaaaa };
|
||||
Aim aim;
|
||||
aim.dx = CosScale16(pSprite->ang);
|
||||
aim.dx = bcos(pSprite->ang);
|
||||
aim.dy = bsin(pSprite->ang);
|
||||
aim.dz = actor->dudeSlope;
|
||||
int nClosest = 0x7fffffff;
|
||||
|
@ -166,7 +166,7 @@ void BlastSSeqCallback(int, DBloodActor* actor)
|
|||
if (cansee(x, y, z, pSprite->sectnum, x2, y2, z2, pSprite2->sectnum))
|
||||
{
|
||||
nClosest = nDist2;
|
||||
aim.dx = CosScale16(nAngle);
|
||||
aim.dx = bcos(nAngle);
|
||||
aim.dy = bsin(nAngle);
|
||||
aim.dz = DivScale(tz, nDist, 10);
|
||||
if (tz > -0x333)
|
||||
|
|
|
@ -72,7 +72,7 @@ void ghostSlashSeqCallback(int, DBloodActor* actor)
|
|||
int height = (pSprite->yrepeat * pDudeInfo->eyeHeight) << 2;
|
||||
int height2 = (pTarget->yrepeat * pDudeInfoT->eyeHeight) << 2;
|
||||
int dz = height - height2;
|
||||
int dx = CosScale16(pSprite->ang);
|
||||
int dx = bcos(pSprite->ang);
|
||||
int dy = bsin(pSprite->ang);
|
||||
sfxPlay3DSound(actor, 1406, 0, 0);
|
||||
actFireVector(actor, 0, 0, dx, dy, dz, kVectorGhost);
|
||||
|
@ -104,7 +104,7 @@ void ghostBlastSeqCallback(int, DBloodActor* actor)
|
|||
int z = height;
|
||||
TARGETTRACK tt = { 0x10000, 0x10000, 0x100, 0x55, 0x1aaaaa };
|
||||
Aim aim;
|
||||
aim.dx = CosScale16(pSprite->ang);
|
||||
aim.dx = bcos(pSprite->ang);
|
||||
aim.dy = bsin(pSprite->ang);
|
||||
aim.dz = actor->dudeSlope;
|
||||
int nClosest = 0x7fffffff;
|
||||
|
@ -149,7 +149,7 @@ void ghostBlastSeqCallback(int, DBloodActor* actor)
|
|||
if (cansee(x, y, z, pSprite->sectnum, x2, y2, z2, pSprite2->sectnum))
|
||||
{
|
||||
nClosest = nDist2;
|
||||
aim.dx = CosScale16(nAngle);
|
||||
aim.dx = bcos(nAngle);
|
||||
aim.dy = bsin(nAngle);
|
||||
aim.dz = DivScale(tz, nDist, 10);
|
||||
if (tz > -0x333)
|
||||
|
|
|
@ -64,7 +64,7 @@ void GillBiteSeqCallback(int, DBloodActor* actor)
|
|||
spritetype* pSprite = &actor->s();
|
||||
if (!actor->ValidateTarget(__FUNCTION__)) return;
|
||||
spritetype* pTarget = &actor->GetTarget()->s();
|
||||
int dx = CosScale16(pSprite->ang);
|
||||
int dx = bcos(pSprite->ang);
|
||||
int dy = bsin(pSprite->ang);
|
||||
int dz = pSprite->z - pTarget->z;
|
||||
dx += Random3(2000);
|
||||
|
|
|
@ -47,7 +47,7 @@ void houndBiteSeqCallback(int, DBloodActor* actor)
|
|||
{
|
||||
XSPRITE* pXSprite = &actor->x();
|
||||
spritetype* pSprite = &actor->s();
|
||||
int dx = CosScale16(pSprite->ang);
|
||||
int dx = bcos(pSprite->ang);
|
||||
int dy = bsin(pSprite->ang);
|
||||
///assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||
if (!(pSprite->type >= kDudeBase && pSprite->type < kDudeMax)) {
|
||||
|
@ -69,7 +69,7 @@ void houndBiteSeqCallback(int, DBloodActor* actor)
|
|||
void houndBurnSeqCallback(int, DBloodActor* actor)
|
||||
{
|
||||
spritetype* pSprite = &actor->s();
|
||||
actFireMissile(actor, 0, 0, CosScale16(pSprite->ang), bsin(pSprite->ang), 0, kMissileFlameHound);
|
||||
actFireMissile(actor, 0, 0, bcos(pSprite->ang), bsin(pSprite->ang), 0, kMissileFlameHound);
|
||||
}
|
||||
|
||||
static void houndThinkSearch(DBloodActor* actor)
|
||||
|
|
|
@ -46,7 +46,7 @@ void ratBiteSeqCallback(int, DBloodActor* actor)
|
|||
{
|
||||
XSPRITE* pXSprite = &actor->x();
|
||||
spritetype* pSprite = &actor->s();
|
||||
int dx = CosScale16(pSprite->ang);
|
||||
int dx = bcos(pSprite->ang);
|
||||
int dy = bsin(pSprite->ang);
|
||||
assert(pSprite->type >= kDudeBase && pSprite->type < kDudeMax);
|
||||
if (!actor->ValidateTarget(__FUNCTION__)) return;
|
||||
|
|
|
@ -65,7 +65,7 @@ void SpidBiteSeqCallback(int, DBloodActor* actor)
|
|||
{
|
||||
XSPRITE* pXSprite = &actor->x();
|
||||
spritetype* pSprite = &actor->s();
|
||||
int dx = CosScale16(pSprite->ang);
|
||||
int dx = bcos(pSprite->ang);
|
||||
int dy = bsin(pSprite->ang);
|
||||
dx += Random2(2000);
|
||||
dy += Random2(2000);
|
||||
|
@ -117,7 +117,7 @@ void SpidJumpSeqCallback(int, DBloodActor* actor)
|
|||
{
|
||||
XSPRITE* pXSprite = &actor->x();
|
||||
spritetype* pSprite = &actor->s();
|
||||
int dx = CosScale16(pSprite->ang);
|
||||
int dx = bcos(pSprite->ang);
|
||||
int dy = bsin(pSprite->ang);
|
||||
dx += Random2(200);
|
||||
dy += Random2(200);
|
||||
|
|
|
@ -74,7 +74,7 @@ void sub_71BD4(int, DBloodActor* actor)
|
|||
int z = height;
|
||||
TARGETTRACK tt = { 0x10000, 0x10000, 0x100, 0x55, 0x100000 };
|
||||
Aim aim;
|
||||
aim.dx = CosScale16(pSprite->ang);
|
||||
aim.dx = bcos(pSprite->ang);
|
||||
aim.dy = bsin(pSprite->ang);
|
||||
aim.dz = actor->dudeSlope;
|
||||
int nClosest = 0x7fffffff;
|
||||
|
@ -119,7 +119,7 @@ void sub_71BD4(int, DBloodActor* actor)
|
|||
if (cansee(x, y, z, pSprite->sectnum, x2, y2, z2, pSprite2->sectnum))
|
||||
{
|
||||
nClosest = nDist2;
|
||||
aim.dx = CosScale16(nAngle);
|
||||
aim.dx = bcos(nAngle);
|
||||
aim.dy = bsin(nAngle);
|
||||
aim.dz = DivScale(tz, nDist, 10);
|
||||
}
|
||||
|
@ -141,7 +141,7 @@ void sub_720AC(int, DBloodActor* actor)
|
|||
DUDEINFO* pDudeInfo = getDudeInfo(pSprite->type);
|
||||
int height = pSprite->yrepeat * pDudeInfo->eyeHeight;
|
||||
int ax, ay, az;
|
||||
ax = CosScale16(pSprite->ang);
|
||||
ax = bcos(pSprite->ang);
|
||||
ay = bsin(pSprite->ang);
|
||||
int x = pSprite->x;
|
||||
int y = pSprite->y;
|
||||
|
@ -194,7 +194,7 @@ void sub_720AC(int, DBloodActor* actor)
|
|||
if (cansee(x, y, z, pSprite->sectnum, x2, y2, z2, pSprite2->sectnum))
|
||||
{
|
||||
nClosest = nDist2;
|
||||
aim.dx = CosScale16(nAngle);
|
||||
aim.dx = bcos(nAngle);
|
||||
aim.dy = bsin(nAngle);
|
||||
aim.dz = DivScale(tz, nDist, 10);
|
||||
}
|
||||
|
|
|
@ -151,7 +151,7 @@ static bool genDudeAdjustSlope(DBloodActor* actor, int dist, int weaponType, int
|
|||
|
||||
for (int i = -8191; i < 8192; i += by)
|
||||
{
|
||||
HitScan(pSprite, pSprite->z, CosScale16(pSprite->ang), bsin(pSprite->ang), i, clipMask, dist);
|
||||
HitScan(pSprite, pSprite->z, bcos(pSprite->ang), bsin(pSprite->ang), i, clipMask, dist);
|
||||
if (!fStart && actor->GetTarget() == gHitInfo.hitactor) fStart = i;
|
||||
else if (fStart && actor->GetTarget() != gHitInfo.hitactor)
|
||||
{
|
||||
|
@ -213,7 +213,7 @@ void punchCallback(int, DBloodActor* actor)
|
|||
if(target->IsDudeActor())
|
||||
nZOffset2 = getDudeInfo(pTarget->type)->eyeHeight * pTarget->yrepeat << 2;
|
||||
|
||||
int dx = CosScale16(pSprite->ang);
|
||||
int dx = bcos(pSprite->ang);
|
||||
int dy = bsin(pSprite->ang);
|
||||
int dz = nZOffset1 - nZOffset2;
|
||||
|
||||
|
@ -247,7 +247,7 @@ void genDudeAttack1(int, DBloodActor* actor)
|
|||
|
||||
if (pExtra->weaponType == kGenDudeWeaponHitscan)
|
||||
{
|
||||
dx = CosScale16(pSprite->ang); dy = bsin(pSprite->ang); dz = actor->dudeSlope;
|
||||
dx = bcos(pSprite->ang); dy = bsin(pSprite->ang); dz = actor->dudeSlope;
|
||||
// dispersal modifiers here in case if non-melee enemy
|
||||
if (!dudeIsMelee(actor))
|
||||
{
|
||||
|
@ -285,7 +285,7 @@ void genDudeAttack1(int, DBloodActor* actor)
|
|||
}
|
||||
else if (pExtra->weaponType == kGenDudeWeaponMissile)
|
||||
{
|
||||
dx = CosScale16(pSprite->ang); dy = bsin(pSprite->ang); dz = actor->dudeSlope;
|
||||
dx = bcos(pSprite->ang); dy = bsin(pSprite->ang); dz = actor->dudeSlope;
|
||||
|
||||
// dispersal modifiers here
|
||||
dx += Random3(dispersion); dy += Random3(dispersion); dz += Random3(dispersion >> 1);
|
||||
|
@ -778,9 +778,9 @@ static void unicultThinkChase(DBloodActor* actor)
|
|||
{
|
||||
int objDist = -1; int targetDist = -1; int hit = -1;
|
||||
if (weaponType == kGenDudeWeaponHitscan)
|
||||
hit = HitScan(pSprite, pSprite->z, CosScale16(pSprite->ang), bsin(pSprite->ang), actor->dudeSlope, CLIPMASK1, dist);
|
||||
hit = HitScan(pSprite, pSprite->z, bcos(pSprite->ang), bsin(pSprite->ang), actor->dudeSlope, CLIPMASK1, dist);
|
||||
else if (weaponType == kGenDudeWeaponMissile)
|
||||
hit = HitScan(pSprite, pSprite->z, CosScale16(pSprite->ang), bsin(pSprite->ang), actor->dudeSlope, CLIPMASK0, dist);
|
||||
hit = HitScan(pSprite, pSprite->z, bcos(pSprite->ang), bsin(pSprite->ang), actor->dudeSlope, CLIPMASK0, dist);
|
||||
|
||||
if (hit >= 0)
|
||||
{
|
||||
|
@ -902,7 +902,7 @@ static void unicultThinkChase(DBloodActor* actor)
|
|||
else if (weaponType == kGenDudeWeaponHitscan && hscn)
|
||||
{
|
||||
if (genDudeAdjustSlope(actor, dist, weaponType)) break;
|
||||
VectorScan(pSprite, 0, 0, CosScale16(pSprite->ang), bsin(pSprite->ang), actor->dudeSlope, dist, 1);
|
||||
VectorScan(pSprite, 0, 0, bcos(pSprite->ang), bsin(pSprite->ang), actor->dudeSlope, dist, 1);
|
||||
if (actor == gHitInfo.hitactor) break;
|
||||
|
||||
bool immune = nnExtIsImmune(pHSprite, gVectorData[curWeapon].dmgType);
|
||||
|
@ -962,7 +962,7 @@ static void unicultThinkChase(DBloodActor* actor)
|
|||
if (hit == 4 && weaponType == kGenDudeWeaponHitscan && hscn)
|
||||
{
|
||||
bool masked = (pHWall->cstat & CSTAT_WALL_MASKED);
|
||||
if (masked) VectorScan(pSprite, 0, 0, CosScale16(pSprite->ang), bsin(pSprite->ang), actor->dudeSlope, dist, 1);
|
||||
if (masked) VectorScan(pSprite, 0, 0, bcos(pSprite->ang), bsin(pSprite->ang), actor->dudeSlope, dist, 1);
|
||||
|
||||
//viewSetSystemMessage("WALL VHIT: %d", gHitInfo.hitwall);
|
||||
if ((actor != gHitInfo.hitactor) && (pHWall->type != kWallGib || !masked || pXHWall == NULL || !pXHWall->triggerVector || pXHWall->locked))
|
||||
|
@ -1874,7 +1874,7 @@ void dudeLeechOperate(DBloodActor* actor, const EVENT& event)
|
|||
y += (actTarget->yvel() * t) >> 12;
|
||||
int angBak = pSprite->ang;
|
||||
pSprite->ang = getangle(x - pSprite->x, y - pSprite->y);
|
||||
int dx = CosScale16(pSprite->ang);
|
||||
int dx = bcos(pSprite->ang);
|
||||
int dy = bsin(pSprite->ang);
|
||||
int tz = pTarget->z - (pTarget->yrepeat * pDudeInfo->aimHeight) * 4;
|
||||
int dz = DivScale(tz - top - 256, nDist, 10);
|
||||
|
|
|
@ -73,7 +73,7 @@ void HackSeqCallback(int, DBloodActor* actor)
|
|||
int height = (pSprite->yrepeat * pDudeInfo->eyeHeight) << 2;
|
||||
int height2 = (pTarget->yrepeat * pDudeInfoT->eyeHeight) << 2;
|
||||
int dz = height - height2;
|
||||
int dx = CosScale16(nAngle);
|
||||
int dx = bcos(nAngle);
|
||||
int dy = bsin(nAngle);
|
||||
sfxPlay3DSound(pSprite, 1101, 1, 0);
|
||||
actFireVector(actor, 0, 0, dx, dy, dz, kVectorAxe);
|
||||
|
|
|
@ -58,7 +58,7 @@ void zombfHackSeqCallback(int, DBloodActor* actor)
|
|||
int height = (pDudeInfo->eyeHeight * pSprite->yrepeat);
|
||||
DUDEINFO* pDudeInfoT = getDudeInfo(pTarget->type);
|
||||
int height2 = (pDudeInfoT->eyeHeight * pTarget->yrepeat);
|
||||
actFireVector(actor, 0, 0, CosScale16(pSprite->ang), bsin(pSprite->ang), height - height2, kVectorCleaver);
|
||||
actFireVector(actor, 0, 0, bcos(pSprite->ang), bsin(pSprite->ang), height - height2, kVectorCleaver);
|
||||
}
|
||||
|
||||
void PukeSeqCallback(int, DBloodActor* actor)
|
||||
|
@ -74,7 +74,7 @@ void PukeSeqCallback(int, DBloodActor* actor)
|
|||
int tx = pXSprite->targetX - pSprite->x;
|
||||
int ty = pXSprite->targetY - pSprite->y;
|
||||
int nAngle = getangle(tx, ty);
|
||||
int dx = CosScale16(nAngle);
|
||||
int dx = bcos(nAngle);
|
||||
int dy = bsin(nAngle);
|
||||
sfxPlay3DSound(pSprite, 1203, 1, 0);
|
||||
actFireMissile(actor, 0, -(height - height2), dx, dy, 0, kMissilePukeGreen);
|
||||
|
@ -83,7 +83,7 @@ void PukeSeqCallback(int, DBloodActor* actor)
|
|||
void ThrowSeqCallback(int, DBloodActor* actor)
|
||||
{
|
||||
spritetype* pSprite = &actor->s();
|
||||
actFireMissile(actor, 0, -getDudeInfo(pSprite->type)->eyeHeight, CosScale16(pSprite->ang), bsin(pSprite->ang), 0, kMissileButcherKnife);
|
||||
actFireMissile(actor, 0, -getDudeInfo(pSprite->type)->eyeHeight, bcos(pSprite->ang), bsin(pSprite->ang), 0, kMissileButcherKnife);
|
||||
}
|
||||
|
||||
static void zombfThinkSearch(DBloodActor* actor)
|
||||
|
|
|
@ -83,11 +83,6 @@ inline int Cos(int ang)
|
|||
return costable[ang & 2047];
|
||||
}
|
||||
|
||||
inline int CosScale16(int ang)
|
||||
{
|
||||
return FixedToInt(costable[ang & 2047]);
|
||||
}
|
||||
|
||||
enum SurfaceType {
|
||||
kSurfNone = 0,
|
||||
kSurfStone,
|
||||
|
|
|
@ -3982,7 +3982,7 @@ bool condCheckSprite(XSPRITE* pXCond, int cmpOp, bool PUSH) {
|
|||
if ((pPlayer = getPlayerById(pSpr->type)) != NULL)
|
||||
var = HitScan(pSpr, pPlayer->zWeapon, pPlayer->aim.dx, pPlayer->aim.dy, pPlayer->aim.dz, arg1, arg3 << 1);
|
||||
else if (IsDudeSprite(pSpr))
|
||||
var = HitScan(pSpr, pSpr->z, CosScale16(pSpr->ang), bsin(pSpr->ang), (!xspriRangeIsFine(pSpr->extra)) ? 0 : spractor->dudeSlope, arg1, arg3 << 1);
|
||||
var = HitScan(pSpr, pSpr->z, bcos(pSpr->ang), bsin(pSpr->ang), (!xspriRangeIsFine(pSpr->extra)) ? 0 : spractor->dudeSlope, arg1, arg3 << 1);
|
||||
else if ((var2 & CSTAT_SPRITE_ALIGNMENT_MASK) == CSTAT_SPRITE_ALIGNMENT_FLOOR) {
|
||||
|
||||
var3 = (var2 & 0x0008) ? 0x10000 << 1 : -(0x10000 << 1);
|
||||
|
@ -3990,7 +3990,7 @@ bool condCheckSprite(XSPRITE* pXCond, int cmpOp, bool PUSH) {
|
|||
|
||||
} else {
|
||||
|
||||
var = HitScan(pSpr, pSpr->z, CosScale16(pSpr->ang), bsin(pSpr->ang), 0, arg1, arg3 << 1);
|
||||
var = HitScan(pSpr, pSpr->z, bcos(pSpr->ang), bsin(pSpr->ang), 0, arg1, arg3 << 1);
|
||||
|
||||
}
|
||||
|
||||
|
@ -5532,7 +5532,7 @@ void useUniMissileGen(XSPRITE* pXSource, spritetype* pSprite) {
|
|||
if (pSprite->cstat & 8) dz = 0x4000;
|
||||
else dz = -0x4000;
|
||||
} else {
|
||||
dx = CosScale16(pSprite->ang);
|
||||
dx = bcos(pSprite->ang);
|
||||
dy = bsin(pSprite->ang);
|
||||
dz = pXSource->data3 << 6; // add slope controlling
|
||||
if (dz > 0x10000) dz = 0x10000;
|
||||
|
|
|
@ -1245,7 +1245,7 @@ int ActionScan(PLAYER *pPlayer, int *a2, int *a3)
|
|||
*a2 = 0;
|
||||
*a3 = 0;
|
||||
spritetype *pSprite = pPlayer->pSprite;
|
||||
int x = CosScale16(pSprite->ang);
|
||||
int x = bcos(pSprite->ang);
|
||||
int y = bsin(pSprite->ang);
|
||||
int z = pPlayer->slope;
|
||||
int hit = HitScan(pSprite, pPlayer->zView, x, y, z, 0x10000040, 128);
|
||||
|
@ -1579,7 +1579,7 @@ void ProcessInput(PLAYER *pPlayer)
|
|||
spritetype* pSprite2 = &spawned->s();
|
||||
pSprite2->ang = (pPlayer->pSprite->ang+1024)&2047;
|
||||
int nSprite = pPlayer->pSprite->index;
|
||||
int x = CosScale16(pPlayer->pSprite->ang);
|
||||
int x = bcos(pPlayer->pSprite->ang);
|
||||
int y = bsin(pPlayer->pSprite->ang);
|
||||
xvel[pSprite2->index] = xvel[nSprite] + MulScale(0x155555, x, 14);
|
||||
yvel[pSprite2->index] = yvel[nSprite] + MulScale(0x155555, y, 14);
|
||||
|
@ -2123,9 +2123,9 @@ void voodooTarget(PLAYER *pPlayer)
|
|||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
int ang1 = (pPlayer->voodooVar1+pPlayer->vodooVar2)&2047;
|
||||
actFireVector(actor, 0, dz, CosScale16(ang1), bsin(ang1), v4, kVectorVoodoo10);
|
||||
actFireVector(actor, 0, dz, bcos(ang1), bsin(ang1), v4, kVectorVoodoo10);
|
||||
int ang2 = (pPlayer->voodooVar1+2048-pPlayer->vodooVar2)&2047;
|
||||
actFireVector(actor, 0, dz, CosScale16(ang2), bsin(ang2), v4, kVectorVoodoo10);
|
||||
actFireVector(actor, 0, dz, bcos(ang2), bsin(ang2), v4, kVectorVoodoo10);
|
||||
}
|
||||
pPlayer->voodooTargets = ClipLow(pPlayer->voodooTargets-1, 0);
|
||||
}
|
||||
|
|
|
@ -248,7 +248,7 @@ void LifeLeechOperate(spritetype *pSprite, XSPRITE *pXSprite, EVENT event)
|
|||
y += (yvel[nTarget]*t)>>12;
|
||||
int angBak = pSprite->ang;
|
||||
pSprite->ang = getangle(x-pSprite->x, y-pSprite->y);
|
||||
int dx = CosScale16(pSprite->ang);
|
||||
int dx = bcos(pSprite->ang);
|
||||
int dy = bsin(pSprite->ang);
|
||||
int tz = pTarget->z - (pTarget->yrepeat * pDudeInfo->aimHeight) * 4;
|
||||
int dz = DivScale(tz - top - 256, nDist, 10);
|
||||
|
@ -2258,7 +2258,7 @@ void FireballTrapSeqCallback(int, DBloodActor* actor)
|
|||
if (pSprite->cstat&32)
|
||||
actFireMissile(actor, 0, 0, 0, 0, (pSprite->cstat&8) ? 0x4000 : -0x4000, kMissileFireball);
|
||||
else
|
||||
actFireMissile(actor, 0, 0, CosScale16(pSprite->ang), bsin(pSprite->ang), 0, kMissileFireball);
|
||||
actFireMissile(actor, 0, 0, bcos(pSprite->ang), bsin(pSprite->ang), 0, kMissileFireball);
|
||||
}
|
||||
|
||||
|
||||
|
@ -2274,7 +2274,7 @@ void MGunFireSeqCallback(int, DBloodActor* actor)
|
|||
if (pXSprite->data2 == 0)
|
||||
evPostActor(&bloodActors[pXSprite->reference], 1, kCmdOff);
|
||||
}
|
||||
int dx = CosScale16(pSprite->ang)+Random2(1000);
|
||||
int dx = bcos(pSprite->ang)+Random2(1000);
|
||||
int dy = bsin(pSprite->ang)+Random2(1000);
|
||||
int dz = Random2(1000);
|
||||
actFireVector(actor, 0, 0, dx, dy, dz, kVectorBullet);
|
||||
|
|
|
@ -353,7 +353,7 @@ void UpdateAimVector(PLAYER * pPlayer)
|
|||
int y = pPSprite->y;
|
||||
int z = pPlayer->zWeapon;
|
||||
Aim aim;
|
||||
aim.dx = CosScale16(pPSprite->ang);
|
||||
aim.dx = bcos(pPSprite->ang);
|
||||
aim.dy = bsin(pPSprite->ang);
|
||||
aim.dz = pPlayer->slope;
|
||||
WEAPONTRACK *pWeaponTrack = &gWeaponTrack[pPlayer->curWeapon];
|
||||
|
@ -415,7 +415,7 @@ void UpdateAimVector(PLAYER * pPlayer)
|
|||
if (cansee(x, y, z, pPSprite->sectnum, x2, y2, z2, pSprite->sectnum))
|
||||
{
|
||||
nClosest = nDist2;
|
||||
aim.dx = CosScale16(angle);
|
||||
aim.dx = bcos(angle);
|
||||
aim.dy = bsin(angle);
|
||||
aim.dz = DivScale(dzCenter, nDist, 10);
|
||||
nTarget = nSprite;
|
||||
|
@ -464,7 +464,7 @@ void UpdateAimVector(PLAYER * pPlayer)
|
|||
if (cansee(x, y, z, pPSprite->sectnum, pSprite->x, pSprite->y, pSprite->z, pSprite->sectnum))
|
||||
{
|
||||
nClosest = nDist2;
|
||||
aim.dx = CosScale16(angle);
|
||||
aim.dx = bcos(angle);
|
||||
aim.dy = bsin(angle);
|
||||
aim.dz = DivScale(dz, nDist, 10);
|
||||
nTarget = nSprite;
|
||||
|
@ -1295,7 +1295,7 @@ void FireSpread(int nTrigger, PLAYER *pPlayer)
|
|||
assert(nTrigger > 0 && nTrigger <= kMaxSpread);
|
||||
Aim *aim = &pPlayer->aim;
|
||||
int angle = (getangle(aim->dx, aim->dy)+((112*(nTrigger-1))/14-56))&2047;
|
||||
int dx = CosScale16(angle);
|
||||
int dx = bcos(angle);
|
||||
int dy = bsin(angle);
|
||||
sfxPlay3DSound(pPlayer->pSprite, 431, -1, 0);
|
||||
int r1, r2, r3;
|
||||
|
@ -1317,7 +1317,7 @@ void AltFireSpread(int nTrigger, PLAYER *pPlayer)
|
|||
assert(nTrigger > 0 && nTrigger <= kMaxSpread);
|
||||
Aim *aim = &pPlayer->aim;
|
||||
int angle = (getangle(aim->dx, aim->dy)+((112*(nTrigger-1))/14-56))&2047;
|
||||
int dx = CosScale16(angle);
|
||||
int dx = bcos(angle);
|
||||
int dy = bsin(angle);
|
||||
sfxPlay3DSound(pPlayer->pSprite, 431, -1, 0);
|
||||
int r1, r2, r3;
|
||||
|
@ -1347,7 +1347,7 @@ void AltFireSpread2(int nTrigger, PLAYER *pPlayer)
|
|||
assert(nTrigger > 0 && nTrigger <= kMaxSpread);
|
||||
Aim *aim = &pPlayer->aim;
|
||||
int angle = (getangle(aim->dx, aim->dy)+((112*(nTrigger-1))/14-56))&2047;
|
||||
int dx = CosScale16(angle);
|
||||
int dx = bcos(angle);
|
||||
int dy = bsin(angle);
|
||||
sfxPlay3DSound(pPlayer->pSprite, 431, -1, 0);
|
||||
if (powerupCheck(pPlayer, kPwUpTwoGuns) && checkAmmo2(pPlayer, 3, 2))
|
||||
|
|
Loading…
Reference in a new issue