- get*slope and sfxPlay3DSound

This commit is contained in:
Christoph Oelckers 2021-11-24 00:38:07 +01:00
parent 9343e3f9c4
commit d99542a678
8 changed files with 26 additions and 26 deletions

View file

@ -3773,7 +3773,7 @@ static int actDamageThing(DBloodActor* source, DBloodActor* actor, int damage, D
{
case -1:
GibSprite(actor, GIBTYPE_14, nullptr, nullptr);
sfxPlay3DSound(pSprite->x, pSprite->y, pSprite->z, 312, pSprite->sectnum);
sfxPlay3DSound(pSprite->x, pSprite->y, pSprite->z, 312, pSprite->sector());
actPostSprite(actor, kStatFree);
break;
@ -3953,7 +3953,7 @@ static void actImpactMissile(DBloodActor* missileActor, int hitCode)
case kMissileArcGargoyle:
sfxKill3DSound(pMissile, -1, -1);
sfxPlay3DSound(pMissile->x, pMissile->y, pMissile->z, 306, pMissile->sectnum);
sfxPlay3DSound(pMissile->x, pMissile->y, pMissile->z, 306, pMissile->sector());
GibSprite(missileActor, GIBTYPE_6, NULL, NULL);
if (hitCode == 3 && pSpriteHit && (pThingInfo || pDudeInfo))
@ -3967,7 +3967,7 @@ static void actImpactMissile(DBloodActor* missileActor, int hitCode)
case kMissileLifeLeechAltNormal:
case kMissileLifeLeechAltSmall:
sfxKill3DSound(pMissile, -1, -1);
sfxPlay3DSound(pMissile->x, pMissile->y, pMissile->z, 306, pMissile->sectnum);
sfxPlay3DSound(pMissile->x, pMissile->y, pMissile->z, 306, pMissile->sector());
if (hitCode == 3 && pSpriteHit && (pThingInfo || pDudeInfo))
{
@ -4081,7 +4081,7 @@ static void actImpactMissile(DBloodActor* missileActor, int hitCode)
case kMissileEctoSkull:
sfxKill3DSound(pMissile, -1, -1);
sfxPlay3DSound(pMissile->x, pMissile->y, pMissile->z, 522, pMissile->sectnum);
sfxPlay3DSound(pMissile->x, pMissile->y, pMissile->z, 522, pMissile->sector());
actPostSprite(missileActor, kStatDebris);
seqSpawn(20, missileActor, -1);
if (hitCode == 3 && actorHit && actorHit->hasX())
@ -4114,7 +4114,7 @@ static void actImpactMissile(DBloodActor* missileActor, int hitCode)
case kMissileTeslaRegular:
sfxKill3DSound(pMissile, -1, -1);
sfxPlay3DSound(pMissile->x, pMissile->y, pMissile->z, 518, pMissile->sectnum);
sfxPlay3DSound(pMissile->x, pMissile->y, pMissile->z, 518, pMissile->sector());
GibSprite(missileActor, (hitCode == 2) ? GIBTYPE_23 : GIBTYPE_22, NULL, NULL);
evKillActor(missileActor);
seqKill(missileActor);
@ -4357,7 +4357,7 @@ static void checkHit(DBloodActor* actor)
break;
case kThingZombieHead:
sfxPlay3DSound(pSprite->x, pSprite->y, pSprite->z, 357, pSprite->sectnum);
sfxPlay3DSound(pSprite->x, pSprite->y, pSprite->z, 357, pSprite->sector());
actKickObject(actor, actor2);
actDamageSprite(nullptr, actor2, kDamageFall, 80);
break;
@ -4439,7 +4439,7 @@ static void checkFloorHit(DBloodActor* actor)
pPlayer->kickPower = PlayClock + 60;
}
actKickObject(actor, actor2);
sfxPlay3DSound(pSprite->x, pSprite->y, pSprite->z, 357, pSprite->sectnum);
sfxPlay3DSound(pSprite->x, pSprite->y, pSprite->z, 357, pSprite->sector());
sfxPlay3DSound(actor, 374, 0, 0);
break;
case kThingZombieHead:
@ -4449,7 +4449,7 @@ static void checkFloorHit(DBloodActor* actor)
pPlayer->kickPower = PlayClock + 60;
}
actKickObject(actor, actor2);
sfxPlay3DSound(pSprite->x, pSprite->y, pSprite->z, 357, pSprite->sectnum);
sfxPlay3DSound(pSprite->x, pSprite->y, pSprite->z, 357, pSprite->sector());
actDamageSprite(nullptr, actor2, kDamageFall, 80);
break;
case kTrapSawCircular:
@ -4572,7 +4572,7 @@ void actAirDrag(DBloodActor* actor, int a2)
int wind_x = 0;
int wind_y = 0;
assert(validSectorIndex(pSprite->sectnum));
assert(pSprite->sector());
sectortype* pSector = pSprite->sector();
if (pSector->hasX())
{
@ -4925,7 +4925,7 @@ void MoveDude(DBloodActor* actor)
if (pSprite->sector() != pSector)
{
assert(validSectorIndex(pSprite->sectnum));
assert(pSprite->sector());
auto pOldSector = pSprite->sector();
XSECTOR* pXOldSector = pOldSector->hasX()? &pOldSector->xs() : nullptr;
@ -5619,7 +5619,7 @@ void actActivateGibObject(DBloodActor* actor)
if (gib1 > 0) GibSprite(actor, (GIBTYPE)(gib1 - 1), nullptr, nullptr);
if (gib2 > 0) GibSprite(actor, (GIBTYPE)(gib2 - 1), nullptr, nullptr);
if (gib3 > 0 && pXSprite->burnTime > 0) GibSprite(actor, (GIBTYPE)(gib3 - 1), nullptr, nullptr);
if (sound > 0) sfxPlay3DSound(pSprite->x, pSprite->y, pSprite->z, sound, pSprite->sectnum);
if (sound > 0) sfxPlay3DSound(pSprite->x, pSprite->y, pSprite->z, sound, pSprite->sector());
if (dropmsg > 0) actDropObject(actor, dropmsg);
if (!(pSprite->cstat & 32768) && !(pSprite->flags & kHitagRespawn))

View file

@ -300,7 +300,7 @@ static void batThinkChase(DBloodActor* actor)
if (nDist < pDudeInfo->seeDist && abs(nDeltaAngle) <= pDudeInfo->periphery)
{
aiSetTarget(actor, actor->GetTarget());
int floorZ = getflorzofslope(pSprite->sectnum, pSprite->x, pSprite->y);
int floorZ = getflorzofslopeptr(pSprite->sector(), pSprite->x, pSprite->y);
if (height2 - height < 0x2000 && nDist < 0x200 && abs(nDeltaAngle) < 85)
aiNewState(actor, &batBite);
else if ((height2 - height > 0x5000 || floorZ - bottom > 0x5000) && nDist < 0x1400 && nDist > 0x800 && abs(nDeltaAngle) < 85)

View file

@ -387,7 +387,7 @@ static void gargThinkChase(DBloodActor* actor)
if (nDist < pDudeInfo->seeDist && abs(nDeltaAngle) <= pDudeInfo->periphery)
{
aiSetTarget(actor, actor->GetTarget());
int floorZ = getflorzofslope(pSprite->sectnum, pSprite->x, pSprite->y);
int floorZ = getflorzofslopeptr(pSprite->sector(), pSprite->x, pSprite->y);
switch (pSprite->type)
{
case kDudeGargoyleFlesh:

View file

@ -367,7 +367,7 @@ static void ghostThinkChase(DBloodActor* actor)
if (nDist < pDudeInfo->seeDist && abs(nDeltaAngle) <= pDudeInfo->periphery)
{
aiSetTarget(actor, actor->GetTarget());
int floorZ = getflorzofslope(pSprite->sectnum, pSprite->x, pSprite->y);
int floorZ = getflorzofslopeptr(pSprite->sector(), pSprite->x, pSprite->y);
switch (pSprite->type) {
case kDudePhantasm:
if (nDist < 0x2000 && nDist > 0x1000 && abs(nDeltaAngle) < 85) {

View file

@ -213,7 +213,7 @@ void CFX::fxProcess(void)
remove(actor);
continue;
}
if (getflorzofslope(pSprite->sectnum, pSprite->x, pSprite->y) <= pSprite->z)
if (getflorzofslopeptr(pSprite->sector(), pSprite->x, pSprite->y) <= pSprite->z)
{
if (pFXData->funcID < 0 || pFXData->funcID >= kCallbackMax)
{

View file

@ -6507,12 +6507,12 @@ void sprite2sectorSlope(DBloodActor* actor, sectortype* pSector, char rel, bool
int slope = 0, z = 0;
switch (rel) {
default:
z = getflorzofslope(pSprite->sectnum, pSprite->x, pSprite->y);
z = getflorzofslopeptr(pSprite->sector(), pSprite->x, pSprite->y);
if ((pSprite->cstat & CSTAT_SPRITE_ALIGNMENT_FLOOR) && actor->hasX() && actor->x().Touch) z--;
slope = pSector->floorheinum;
break;
case 1:
z = getceilzofslope(pSprite->sectnum, pSprite->x, pSprite->y);
z = getceilzofslopeptr(pSprite->sector(), pSprite->x, pSprite->y);
if ((pSprite->cstat & CSTAT_SPRITE_ALIGNMENT_FLOOR) && actor->hasX() && actor->x().Touch) z++;
slope = pSector->ceilingheinum;
break;
@ -9149,9 +9149,9 @@ void clampSprite(DBloodActor* actor, int which)
{
GetSpriteExtents(pSprite, &zTop, &zBot);
if (which & 0x01)
pSprite->z += ClipHigh(getflorzofslope(pSprite->sectnum, pSprite->x, pSprite->y) - zBot, 0);
pSprite->z += ClipHigh(getflorzofslopeptr(pSprite->sector(), pSprite->x, pSprite->y) - zBot, 0);
if (which & 0x02)
pSprite->z += ClipLow(getceilzofslope(pSprite->sectnum, pSprite->x, pSprite->y) - zTop, 0);
pSprite->z += ClipLow(getceilzofslopeptr(pSprite->sector(), pSprite->x, pSprite->y) - zTop, 0);
}

View file

@ -1090,7 +1090,7 @@ bool PickupItem(PLAYER *pPlayer, DBloodActor* itemactor)
return 1;
}
sfxPlay3DSound(pSprite->x, pSprite->y, pSprite->z, pickupSnd, pSprite->sectnum);
sfxPlay3DSound(pSprite->x, pSprite->y, pSprite->z, pickupSnd, pSprite->sector());
return 1;
}

View file

@ -133,7 +133,7 @@ void warpInit(void)
pSprite->sector()->upperLink = actor;
pSprite->cstat |= 32768;
pSprite->cstat &= ~257;
pSprite->z = getflorzofslope(pSprite->sectnum, pSprite->x, pSprite->y);
pSprite->z = getflorzofslopeptr(pSprite->sector(), pSprite->x, pSprite->y);
break;
case kMarkerLowWater:
case kMarkerLowStack:
@ -141,7 +141,7 @@ void warpInit(void)
pSprite->sector()->lowerLink = actor;
pSprite->cstat |= 32768;
pSprite->cstat &= ~257;
pSprite->z = getceilzofslope(pSprite->sectnum, pSprite->x, pSprite->y);
pSprite->z = getceilzofslopeptr(pSprite->sector(), pSprite->x, pSprite->y);
break;
}
}
@ -198,7 +198,7 @@ int CheckLink(DBloodActor *actor)
if (pUpper->type == kMarkerUpLink)
z = pUpper->z;
else
z = getflorzofslope(pSprite->sectnum, pSprite->x, pSprite->y);
z = getflorzofslopeptr(pSprite->sector(), pSprite->x, pSprite->y);
if (z <= pSprite->z)
{
aLower = aUpper->GetOwner();
@ -212,7 +212,7 @@ int CheckLink(DBloodActor *actor)
if (pLower->type == kMarkerLowLink)
z2 = pLower->z;
else
z2 = getceilzofslope(pSprite->sectnum, pSprite->x, pSprite->y);
z2 = getceilzofslopeptr(pSprite->sector(), pSprite->x, pSprite->y);
pSprite->z += z2-z;
actor->interpolated = false;
return pUpper->type;
@ -225,7 +225,7 @@ int CheckLink(DBloodActor *actor)
if (pLower->type == kMarkerLowLink)
z = pLower->z;
else
z = getceilzofslope(pSprite->sectnum, pSprite->x, pSprite->y);
z = getceilzofslopeptr(pSprite->sector(), pSprite->x, pSprite->y);
if (z >= pSprite->z)
{
aUpper = aLower->GetOwner();
@ -239,7 +239,7 @@ int CheckLink(DBloodActor *actor)
if (pUpper->type == kMarkerUpLink)
z2 = pUpper->z;
else
z2 = getflorzofslope(pSprite->sectnum, pSprite->x, pSprite->y);
z2 = getflorzofslopeptr(pSprite->sector(), pSprite->x, pSprite->y);
pSprite->z += z2-z;
actor->interpolated = false;
return pLower->type;