mirror of
https://github.com/DrBeef/Raze.git
synced 2025-04-05 07:21:26 +00:00
- the final bits and pieces in Blood
This commit is contained in:
parent
41506f35db
commit
5d78b228b7
11 changed files with 29 additions and 42 deletions
|
@ -357,8 +357,7 @@ int HitScan(DBloodActor *actor, int z, int dx, int dy, int dz, unsigned int nMas
|
|||
vec3_t pos = { x, y, z };
|
||||
hitdata_t hitData;
|
||||
hitData.pos.z = gHitInfo.hitz;
|
||||
int nSector = pSprite->sectnum;
|
||||
hitscan(&pos, nSector, dx, dy, dz << 4, &hitData, nMask);
|
||||
hitscan(&pos, pSprite->sectnum, dx, dy, dz << 4, &hitData, nMask);
|
||||
gHitInfo.set(&hitData);
|
||||
hitscangoal.x = hitscangoal.y = 0x1ffffff;
|
||||
pSprite->cstat = bakCstat;
|
||||
|
@ -406,8 +405,7 @@ int VectorScan(DBloodActor *actor, int nOffset, int nZOffset, int dx, int dy, in
|
|||
vec3_t pos = { x1, y1, z1 };
|
||||
hitdata_t hitData;
|
||||
hitData.pos.z = gHitInfo.hitz;
|
||||
int nSector = pSprite->sectnum;
|
||||
hitscan(&pos, nSector, dx, dy, dz << 4, &hitData, CLIPMASK1);
|
||||
hitscan(&pos, pSprite->sectnum, dx, dy, dz << 4, &hitData, CLIPMASK1);
|
||||
gHitInfo.set(&hitData);
|
||||
hitscangoal.x = hitscangoal.y = 0x1ffffff;
|
||||
pSprite->cstat = bakCstat;
|
||||
|
|
|
@ -6143,10 +6143,7 @@ int useCondition(DBloodActor* sourceactor, const EVENT& event)
|
|||
|
||||
bool srcIsCondition = false;
|
||||
|
||||
int objType = event.isActor() ? SS_SPRITE : event.isSector() ? SS_SECTOR : SS_WALL;
|
||||
int objIndex = event.isActor() ? -1 : event.isSector() ? sectnum(event.getSector()) : wallnum(event.getWall());
|
||||
auto pActor = event.isActor() ? event.getActor() : nullptr;
|
||||
|
||||
auto const pActor = event.isActor() ? event.getActor() : nullptr;
|
||||
|
||||
if (event.isActor() && pActor == nullptr) return -1;
|
||||
if (event.isActor() && pActor != sourceactor)
|
||||
|
|
|
@ -1672,18 +1672,18 @@ void playerProcess(PLAYER *pPlayer)
|
|||
int dw = pSprite->clipdist<<2;
|
||||
if (!gNoClip)
|
||||
{
|
||||
int nSector = pSprite->sectnum;
|
||||
if (pushmove(&pSprite->pos, &nSector, dw, dzt, dzb, CLIPMASK0) == -1)
|
||||
auto pSector = pSprite->sector();
|
||||
if (pushmove(&pSprite->pos, &pSector, dw, dzt, dzb, CLIPMASK0) == -1)
|
||||
actDamageSprite(actor, actor, kDamageFall, 500<<4);
|
||||
if (pSprite->sectnum != nSector)
|
||||
if (pSprite->sector() != pSector)
|
||||
{
|
||||
if (nSector == -1)
|
||||
if (pSector == nullptr)
|
||||
{
|
||||
nSector = pSprite->sectnum;
|
||||
pSector = pSprite->sector();
|
||||
actDamageSprite(actor, actor, kDamageFall, 500<<4);
|
||||
}
|
||||
assert(validSectorIndex(nSector));
|
||||
ChangeActorSect(actor, nSector);
|
||||
else
|
||||
ChangeActorSect(actor, pSector);
|
||||
}
|
||||
}
|
||||
ProcessInput(pPlayer);
|
||||
|
@ -1751,11 +1751,10 @@ void playerProcess(PLAYER *pPlayer)
|
|||
if (pPlayer->posture == 1)
|
||||
{
|
||||
pPlayer->isUnderwater = 1;
|
||||
int nSector = pSprite->sectnum;
|
||||
auto link = getLowerLink(nSector);
|
||||
auto link = pSprite->sector()->lowerLink;
|
||||
if (link && (link->s().type == kMarkerLowGoo || link->s().type == kMarkerLowWater))
|
||||
{
|
||||
if (getceilzofslope(nSector, pSprite->x, pSprite->y) > pPlayer->zView)
|
||||
if (getceilzofslopeptr(pSprite->sector(), pSprite->x, pSprite->y) > pPlayer->zView)
|
||||
pPlayer->isUnderwater = 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -452,7 +452,7 @@ static void fakeMoveDude(spritetype *pSprite)
|
|||
pTempSprite->x = predict.x;
|
||||
pTempSprite->y = predict.y;
|
||||
pTempSprite->z = predict.z;
|
||||
pTempSprite->sectnum = predict.sectnum;
|
||||
pTempSprite-> sectnum = predict. sectnum;
|
||||
int ceilZ, floorZ;
|
||||
Collision ceilColl, floorColl;
|
||||
GetZRange(pTempSprite, &ceilZ, &ceilColl, &floorZ, &floorColl, wd, CLIPMASK0);
|
||||
|
|
|
@ -352,7 +352,7 @@ void SEQINST::Update()
|
|||
spritetype* pSprite = &actor->s();
|
||||
if (!VanillaMode() && pSequence->frames[frameIndex].surfaceSound && actor->zvel == 0 && actor->xvel != 0) {
|
||||
|
||||
if (getUpperLink(pSprite->sectnum)) break; // don't play surface sound for stacked sectors
|
||||
if (pSprite->sector()->upperLink) break; // don't play surface sound for stacked sectors
|
||||
int surf = tileGetSurfType(pSprite->sector()->floorpicnum);
|
||||
if (!surf) break;
|
||||
static int surfSfxMove[15][4] = {
|
||||
|
|
|
@ -148,7 +148,7 @@ FSoundID getSfx(FSoundID soundId, float &attenuation, int &pitch, int &relvol)
|
|||
return soundId;
|
||||
}
|
||||
|
||||
void sfxPlay3DSound(int x, int y, int z, int soundId, int nSector)
|
||||
void sfxPlay3DSound(int x, int y, int z, int soundId, sectortype* pSector)
|
||||
{
|
||||
if (!SoundEnabled() || soundId < 0) return;
|
||||
auto sid = soundEngine->FindSoundByResID(soundId);
|
||||
|
@ -166,7 +166,7 @@ void sfxPlay3DSound(int x, int y, int z, int soundId, int nSector)
|
|||
if (sfx && sfx->LoopStart >= 0) flags |= CHANF_LOOP;
|
||||
|
||||
auto chan = soundEngine->StartSound(SOURCE_Unattached, nullptr, &svec, -1, flags, sid, (0.8f / 80.f) * relvol, attenuation, nullptr, pitch / 65536.f);
|
||||
if (chan) chan->UserData = nSector;
|
||||
if (chan) chan->UserData = sectnum(pSector);
|
||||
}
|
||||
|
||||
void sfxPlay3DSoundCP(spritetype* pSprite, int soundId, int playchannel, int playflags, int pitch, int volume)
|
||||
|
|
|
@ -50,11 +50,7 @@ void sndProcess(void);
|
|||
void sndTerm(void);
|
||||
void sndInit(void);
|
||||
|
||||
void sfxPlay3DSound(int x, int y, int z, int soundId, int nSector);
|
||||
void sfxPlay3DSound(int x, int y, int z, int soundId, sectortype* pSector)
|
||||
{
|
||||
sfxPlay3DSound(x, y, z, soundId, sectnum(pSector));
|
||||
}
|
||||
void sfxPlay3DSound(int x, int y, int z, int soundId, sectortype* pSector);
|
||||
void sfxPlay3DSound(spritetype *pSprite, int soundId, int a3 = -1, int a4 = 0);
|
||||
void sfxPlay3DSoundCP(spritetype* pSprite, int soundId, int a3 = -1, int a4 = 0, int pitch = 0, int volume = 0);
|
||||
void sfxKill3DSound(spritetype *pSprite, int a2 = -1, int a3 = -1);
|
||||
|
|
|
@ -226,7 +226,7 @@ void LifeLeechOperate(DBloodActor* actor, EVENT event)
|
|||
int y = pTarget->y;
|
||||
int z = pTarget->z;
|
||||
int nDist = approxDist(x - pSprite->x, y - pSprite->y);
|
||||
if (nDist != 0 && cansee(pSprite->x, pSprite->y, top, pSprite->sectnum, x, y, z, pTarget->sectnum))
|
||||
if (nDist != 0 && cansee(pSprite->x, pSprite->y, top, pSprite->sector(), x, y, z, pTarget->sector()))
|
||||
{
|
||||
int t = DivScale(nDist, 0x1aaaaa, 12);
|
||||
x += (target->xvel*t)>>12;
|
||||
|
@ -1364,9 +1364,9 @@ void OperateDoor(sectortype* pSector, EVENT event, BUSYID busyWave)
|
|||
}
|
||||
}
|
||||
|
||||
bool SectorContainsDudes(int nSector)
|
||||
bool SectorContainsDudes(sectortype * pSector)
|
||||
{
|
||||
BloodSectIterator it(nSector);
|
||||
BloodSectIterator it(pSector);
|
||||
while (auto actor = it.Next())
|
||||
{
|
||||
spritetype* pSprite = &actor->s();
|
||||
|
@ -1398,7 +1398,7 @@ void OperateTeleport(sectortype* pSector)
|
|||
spritetype *pDest = &nDest->s();
|
||||
assert(pDest->statnum == kStatMarker);
|
||||
assert(pDest->type == kMarkerWarpDest);
|
||||
assert(validSectorIndex(pDest->sectnum));
|
||||
assert(pDest->insector());
|
||||
BloodSectIterator it(pSector);
|
||||
while (auto actor = it.Next())
|
||||
{
|
||||
|
@ -1411,7 +1411,7 @@ void OperateTeleport(sectortype* pSector)
|
|||
pPlayer = &gPlayer[pSprite->type-kDudePlayer1];
|
||||
else
|
||||
pPlayer = NULL;
|
||||
if (bPlayer || !SectorContainsDudes(pDest->sectnum))
|
||||
if (bPlayer || !SectorContainsDudes(pDest->sector()))
|
||||
{
|
||||
if (!(gGameOptions.uNetGameFlags & 2))
|
||||
{
|
||||
|
@ -1496,8 +1496,6 @@ void OperateSector(sectortype* pSector, EVENT event)
|
|||
return;
|
||||
#endif
|
||||
|
||||
int nSector = sectnum(pSector);
|
||||
|
||||
switch (event.cmd) {
|
||||
case kCmdLock:
|
||||
pXSector->locked = 1;
|
||||
|
|
|
@ -506,7 +506,7 @@ void renderCrystalBall()
|
|||
int vd8 = pOther->pSprite->x;
|
||||
int vd4 = pOther->pSprite->y;
|
||||
int vd0 = pOther->zView;
|
||||
int vcc = pOther->pSprite->sectnum;
|
||||
int vcc = pOther->pSprite-> sectnum;
|
||||
int v50 = pOther->pSprite->ang;
|
||||
int v54 = 0;
|
||||
if (pOther->flickerEffect)
|
||||
|
|
|
@ -188,9 +188,9 @@ void warpInit(void)
|
|||
int CheckLink(DBloodActor *actor)
|
||||
{
|
||||
auto pSprite = &actor->s();
|
||||
int nSector = pSprite->sectnum;
|
||||
auto aUpper = getUpperLink(nSector);
|
||||
auto aLower = getLowerLink(nSector);
|
||||
auto pSector = pSprite->sector();
|
||||
auto aUpper = pSector->upperLink;
|
||||
auto aLower = pSector->lowerLink;
|
||||
if (aUpper)
|
||||
{
|
||||
spritetype* pUpper = &aUpper->s();
|
||||
|
@ -204,7 +204,7 @@ int CheckLink(DBloodActor *actor)
|
|||
aLower = aUpper->GetOwner();
|
||||
assert(aLower);
|
||||
spritetype *pLower = &aLower->s();
|
||||
assert(validSectorIndex(pLower->sectnum));
|
||||
assert(pLower->insector());
|
||||
ChangeActorSect(actor, pLower->sector());
|
||||
pSprite->x += pLower->x-pUpper->x;
|
||||
pSprite->y += pLower->y-pUpper->y;
|
||||
|
@ -231,7 +231,7 @@ int CheckLink(DBloodActor *actor)
|
|||
aUpper = aLower->GetOwner();
|
||||
assert(aUpper);
|
||||
spritetype *pUpper = &aUpper->s();
|
||||
assert(validSectorIndex(pUpper->sectnum));
|
||||
assert(pUpper->insector());
|
||||
ChangeActorSect(actor, pUpper->sector());
|
||||
pSprite->x += pUpper->x-pLower->x;
|
||||
pSprite->y += pUpper->y-pLower->y;
|
||||
|
@ -265,7 +265,7 @@ int CheckLink(int *x, int *y, int *z, sectortype** pSector)
|
|||
lower = upper->GetOwner();
|
||||
assert(lower);
|
||||
spritetype *pLower = &lower->s();
|
||||
assert(validSectorIndex(pLower->sectnum));
|
||||
assert(pLower->insector());
|
||||
*pSector = pLower->sector();
|
||||
*x += pLower->x-pUpper->x;
|
||||
*y += pLower->y-pUpper->y;
|
||||
|
|
|
@ -2662,7 +2662,6 @@ void teslaHit(DBloodActor *missileactor, int a2)
|
|||
int y = pMissile->y;
|
||||
int z = pMissile->z;
|
||||
int nDist = 300;
|
||||
int nSector = pMissile->sectnum;
|
||||
auto pSector = pMissile->sector();
|
||||
auto owneractor = missileactor->GetOwner();
|
||||
const bool newSectCheckMethod = !cl_bloodvanillaexplosions && !VanillaMode(); // use new sector checking logic
|
||||
|
|
Loading…
Reference in a new issue