- Blood: replaced the remaining spr.pos with int_pos()

This commit is contained in:
Christoph Oelckers 2022-01-30 18:09:26 +01:00
parent 0f8bf5f743
commit f291a943a4
5 changed files with 78 additions and 78 deletions

View file

@ -128,9 +128,9 @@ void InitMirrors(void)
if (sectj->ceilingpicnum != 504)
I_Error("Lower link sector %d doesn't have mirror picnum\n", j);
mirror[mirrorcnt].type = 2;
mirror[mirrorcnt].dx = link2->spr.pos.X - link->spr.pos.X;
mirror[mirrorcnt].dy = link2->spr.pos.Y - link->spr.pos.Y;
mirror[mirrorcnt].dz = link2->spr.pos.Z - link->spr.pos.Z;
mirror[mirrorcnt].dx = link2->int_pos().X - link->int_pos().X;
mirror[mirrorcnt].dy = link2->int_pos().Y - link->int_pos().Y;
mirror[mirrorcnt].dz = link2->int_pos().Z - link->int_pos().Z;
mirror[mirrorcnt].wallnum = i;
mirror[mirrorcnt].link = j;
secti->floorpicnum = 4080 + mirrorcnt;
@ -138,9 +138,9 @@ void InitMirrors(void)
secti->portalnum = portalAdd(PORTAL_SECTOR_FLOOR, j, mirror[mirrorcnt].dx, mirror[mirrorcnt].dy, mirror[mirrorcnt].dz);
mirrorcnt++;
mirror[mirrorcnt].type = 1;
mirror[mirrorcnt].dx = link->spr.pos.X - link2->spr.pos.X;
mirror[mirrorcnt].dy = link->spr.pos.Y - link2->spr.pos.Y;
mirror[mirrorcnt].dz = link->spr.pos.Z - link2->spr.pos.Z;
mirror[mirrorcnt].dx = link->int_pos().X - link2->int_pos().X;
mirror[mirrorcnt].dy = link->int_pos().Y - link2->int_pos().Y;
mirror[mirrorcnt].dz = link->int_pos().Z - link2->int_pos().Z;
mirror[mirrorcnt].wallnum = j;
mirror[mirrorcnt].link = i;
sectj->ceilingpicnum = 4080 + mirrorcnt;

View file

@ -714,15 +714,15 @@ void playerSetGodMode(PLAYER* pPlayer, bool bGodMode)
void playerResetInertia(PLAYER* pPlayer)
{
POSTURE* pPosture = &pPlayer->pPosture[pPlayer->lifeMode][pPlayer->posture];
pPlayer->zView = pPlayer->actor->spr.pos.Z - pPosture->eyeAboveZ;
pPlayer->zWeapon = pPlayer->actor->spr.pos.Z - pPosture->weaponAboveZ;
pPlayer->zView = pPlayer->actor->int_pos().Z - pPosture->eyeAboveZ;
pPlayer->zWeapon = pPlayer->actor->int_pos().Z - pPosture->weaponAboveZ;
viewBackupView(pPlayer->nPlayer);
}
void playerCorrectInertia(PLAYER* pPlayer, vec3_t const* oldpos)
{
pPlayer->zView += pPlayer->actor->spr.pos.Z - oldpos->Z;
pPlayer->zWeapon += pPlayer->actor->spr.pos.Z - oldpos->Z;
pPlayer->zView += pPlayer->actor->int_pos().Z - oldpos->Z;
pPlayer->zWeapon += pPlayer->actor->int_pos().Z - oldpos->Z;
viewCorrectViewOffsets(pPlayer->nPlayer, oldpos);
}
@ -778,7 +778,7 @@ void playerStart(int nPlayer, int bNewLevel)
BloodSectIterator it(pStartZone->sector);
while (auto act = it.Next())
{
if (pStartZone->x == act->spr.pos.X && pStartZone->y == act->spr.pos.Y && act->IsPlayerActor()) {
if (pStartZone->x == act->int_pos().X && pStartZone->y == act->int_pos().Y && act->IsPlayerActor()) {
pStartZone = NULL;
break;
}
@ -807,7 +807,7 @@ void playerStart(int nPlayer, int bNewLevel)
actor->spr.cstat2 |= CSTAT2_SPRITE_MAPPED;
int top, bottom;
GetActorExtents(actor, &top, &bottom);
actor->add_int_z(-(bottom - actor->spr.pos.Z));
actor->add_int_z(-(bottom - actor->int_pos().Z));
actor->spr.pal = 11 + (pPlayer->teamId & 3);
actor->spr.ang = pStartZone->ang;
pPlayer->angle.ang = buildang(actor->spr.ang);
@ -1244,7 +1244,7 @@ bool PickupItem(PLAYER* pPlayer, DBloodActor* itemactor)
return 1;
}
sfxPlay3DSound(plActor->spr.pos.X, plActor->spr.pos.Y, plActor->spr.pos.Z, pickupSnd, plActor->sector());
sfxPlay3DSound(plActor->int_pos().X, plActor->int_pos().Y, plActor->int_pos().Z, pickupSnd, plActor->sector());
return 1;
}
@ -1377,36 +1377,36 @@ void PickUp(PLAYER* pPlayer, DBloodActor* actor)
void CheckPickUp(PLAYER* pPlayer)
{
auto plActor = pPlayer->actor;
int x = plActor->spr.pos.X;
int y = plActor->spr.pos.Y;
int z = plActor->spr.pos.Z;
int x = plActor->int_pos().X;
int y = plActor->int_pos().Y;
int z = plActor->int_pos().Z;
auto pSector = plActor->sector();
BloodStatIterator it(kStatItem);
while (auto itemactor = it.Next())
{
if (itemactor->spr.flags & 32)
continue;
int dx = abs(x - itemactor->spr.pos.X) >> 4;
int dx = abs(x - itemactor->int_pos().X) >> 4;
if (dx > 48)
continue;
int dy = abs(y - itemactor->spr.pos.Y) >> 4;
int dy = abs(y - itemactor->int_pos().Y) >> 4;
if (dy > 48)
continue;
int top, bottom;
GetActorExtents(plActor, &top, &bottom);
int vb = 0;
if (itemactor->spr.pos.Z < top)
vb = (top - itemactor->spr.pos.Z) >> 8;
else if (itemactor->spr.pos.Z > bottom)
vb = (itemactor->spr.pos.Z - bottom) >> 8;
if (itemactor->int_pos().Z < top)
vb = (top - itemactor->int_pos().Z) >> 8;
else if (itemactor->int_pos().Z > bottom)
vb = (itemactor->int_pos().Z - bottom) >> 8;
if (vb > 32)
continue;
if (approxDist(dx, dy) > 48)
continue;
GetActorExtents(itemactor, &top, &bottom);
if (cansee(x, y, z, pSector, itemactor->spr.pos.X, itemactor->spr.pos.Y, itemactor->spr.pos.Z, itemactor->sector())
|| cansee(x, y, z, pSector, itemactor->spr.pos.X, itemactor->spr.pos.Y, top, itemactor->sector())
|| cansee(x, y, z, pSector, itemactor->spr.pos.X, itemactor->spr.pos.Y, bottom, itemactor->sector()))
if (cansee(x, y, z, pSector, itemactor->int_pos().X, itemactor->int_pos().Y, itemactor->int_pos().Z, itemactor->sector())
|| cansee(x, y, z, pSector, itemactor->int_pos().X, itemactor->int_pos().Y, top, itemactor->sector())
|| cansee(x, y, z, pSector, itemactor->int_pos().X, itemactor->int_pos().Y, bottom, itemactor->sector()))
PickUp(pPlayer, itemactor);
}
}
@ -1425,7 +1425,7 @@ int ActionScan(PLAYER* pPlayer, HitInfo* out)
int y = bsin(plActor->spr.ang);
int z = pPlayer->slope;
int hit = HitScan(pPlayer->actor, pPlayer->zView, x, y, z, 0x10000040, 128);
int hitDist = approxDist(plActor->spr.pos.X - gHitInfo.hitpos.X, plActor->spr.pos.Y - gHitInfo.hitpos.Y) >> 4;
int hitDist = approxDist(plActor->int_pos().X - gHitInfo.hitpos.X, plActor->int_pos().Y - gHitInfo.hitpos.Y) >> 4;
if (hitDist < 64)
{
switch (hit)
@ -1518,7 +1518,7 @@ void doslopetilting(PLAYER* pPlayer, double const scaleAdjust = 1)
auto plActor = pPlayer->actor;
int const florhit = pPlayer->actor->hit.florhit.type;
bool const va = plActor->xspr.height < 16 && (florhit == kHitSector || florhit == 0) ? 1 : 0;
pPlayer->horizon.calcviewpitch(plActor->spr.pos.vec2, buildang(plActor->spr.ang), va, plActor->sector()->floorstat & CSTAT_SECTOR_SLOPE, plActor->sector(), scaleAdjust);
pPlayer->horizon.calcviewpitch(plActor->int_pos().vec2, buildang(plActor->spr.ang), va, plActor->sector()->floorstat & CSTAT_SECTOR_SLOPE, plActor->sector(), scaleAdjust);
}
//---------------------------------------------------------------------------
@ -1559,7 +1559,7 @@ void ProcessInput(PLAYER* pPlayer)
DBloodActor* fragger = pPlayer->fragger;
if (fragger)
{
pPlayer->angle.addadjustment(getincanglebam(pPlayer->angle.ang, bvectangbam(fragger->spr.pos.X - actor->spr.pos.X, fragger->spr.pos.Y - actor->spr.pos.Y)));
pPlayer->angle.addadjustment(getincanglebam(pPlayer->angle.ang, bvectangbam(fragger->int_pos().X - actor->int_pos().X, fragger->int_pos().Y - actor->int_pos().Y)));
}
pPlayer->deathTime += 4;
if (!bSeqStat)
@ -1844,8 +1844,8 @@ void playerProcess(PLAYER* pPlayer)
powerupProcess(pPlayer);
int top, bottom;
GetActorExtents(actor, &top, &bottom);
int dzb = (bottom - actor->spr.pos.Z) / 4;
int dzt = (actor->spr.pos.Z - top) / 4;
int dzb = (bottom - actor->int_pos().Z) / 4;
int dzt = (actor->int_pos().Z - top) / 4;
int dw = actor->spr.clipdist << 2;
if (!gNoClip)
{
@ -1866,14 +1866,14 @@ void playerProcess(PLAYER* pPlayer)
ProcessInput(pPlayer);
int nSpeed = approxDist(actor->vel.X, actor->vel.Y);
pPlayer->zViewVel = interpolatedvalue(pPlayer->zViewVel, actor->vel.Z, 0x7000);
int dz = pPlayer->actor->spr.pos.Z - pPosture->eyeAboveZ - pPlayer->zView;
int dz = pPlayer->actor->int_pos().Z - pPosture->eyeAboveZ - pPlayer->zView;
if (dz > 0)
pPlayer->zViewVel += MulScale(dz << 8, 0xa000, 16);
else
pPlayer->zViewVel += MulScale(dz << 8, 0x1800, 16);
pPlayer->zView += pPlayer->zViewVel >> 8;
pPlayer->zWeaponVel = interpolatedvalue(pPlayer->zWeaponVel, actor->vel.Z, 0x5000);
dz = pPlayer->actor->spr.pos.Z - pPosture->weaponAboveZ - pPlayer->zWeapon;
dz = pPlayer->actor->int_pos().Z - pPosture->weaponAboveZ - pPlayer->zWeapon;
if (dz > 0)
pPlayer->zWeaponVel += MulScale(dz << 8, 0x8000, 16);
else
@ -1931,7 +1931,7 @@ void playerProcess(PLAYER* pPlayer)
auto link = actor->sector()->lowerLink;
if (link && (link->spr.type == kMarkerLowGoo || link->spr.type == kMarkerLowWater))
{
if (getceilzofslopeptr(actor->sector(), actor->spr.pos.X, actor->spr.pos.Y) > pPlayer->zView)
if (getceilzofslopeptr(actor->sector(), actor->int_pos().X, actor->int_pos().Y) > pPlayer->zView)
pPlayer->isUnderwater = 0;
}
}
@ -1968,13 +1968,13 @@ void playerProcess(PLAYER* pPlayer)
DBloodActor* playerFireMissile(PLAYER* pPlayer, int a2, int a3, int a4, int a5, int a6)
{
return actFireMissile(pPlayer->actor, a2, pPlayer->zWeapon - pPlayer->actor->spr.pos.Z, a3, a4, a5, a6);
return actFireMissile(pPlayer->actor, a2, pPlayer->zWeapon - pPlayer->actor->int_pos().Z, a3, a4, a5, a6);
}
DBloodActor* playerFireThing(PLAYER* pPlayer, int a2, int a3, int thingType, int a5)
{
assert(thingType >= kThingBase && thingType < kThingMax);
return actFireThing(pPlayer->actor, a2, pPlayer->zWeapon - pPlayer->actor->spr.pos.Z, pPlayer->slope + a3, thingType, a5);
return actFireThing(pPlayer->actor, a2, pPlayer->zWeapon - pPlayer->actor->int_pos().Z, pPlayer->slope + a3, thingType, a5);
}
//---------------------------------------------------------------------------
@ -2174,7 +2174,7 @@ int playerDamageSprite(DBloodActor* source, PLAYER* pPlayer, DAMAGE_TYPE nDamage
{
int top, bottom;
GetActorExtents(pActor, &top, &bottom);
CGibPosition gibPos(pActor->spr.pos.X, pActor->spr.pos.Y, top);
CGibPosition gibPos(pActor->int_pos().X, pActor->int_pos().Y, top);
CGibVelocity gibVel(pActor->vel.X >> 1, pActor->vel.Y >> 1, -0xccccc);
GibSprite(pActor, GIBTYPE_27, &gibPos, &gibVel);
GibSprite(pActor, GIBTYPE_7, NULL, NULL);
@ -2329,7 +2329,7 @@ void voodooTarget(PLAYER* pPlayer)
{
DBloodActor* actor = pPlayer->actor;
int v4 = pPlayer->aim.dz;
int dz = pPlayer->zWeapon - pPlayer->actor->spr.pos.Z;
int dz = pPlayer->zWeapon - pPlayer->actor->int_pos().Z;
if (UseAmmo(pPlayer, 9, 0) < 8)
{
pPlayer->voodooTargets = 0;

View file

@ -75,7 +75,7 @@ void BloodSoundEngine::CalcPosVel(int type, const void* source, const float pt[3
{
FVector3 camera;
if (gMe && gMe->actor) camera = GetSoundPos(gMe->actor->spr.pos);
if (gMe && gMe->actor) camera = GetSoundPos(gMe->actor->int_pos());
else camera = { 0, 0, 0 }; // don't crash if there is no player.
if (vel) vel->Zero();
@ -93,7 +93,7 @@ void BloodSoundEngine::CalcPosVel(int type, const void* source, const float pt[3
// Engine expects velocity in units per second, not units per tic.
if (vel) *vel = { actor->vel.X * (30 / 65536.f), actor->vel.Z * (-30 / 65536.f), actor->vel.Y * (-30 / 65536.f) };
*pos = GetSoundPos(actor->spr.pos);
*pos = GetSoundPos(actor->int_pos());
}
else if (type == SOURCE_Ambient)
{
@ -120,7 +120,7 @@ void GameInterface::UpdateSounds()
{
listener.angle = -gMe->actor->spr.ang * float(BAngRadian); // Build uses a period of 2048.
listener.velocity.Zero();
listener.position = GetSoundPos(gMe->actor->spr.pos);
listener.position = GetSoundPos(gMe->actor->int_pos());
listener.valid = true;
}
else
@ -197,7 +197,7 @@ void sfxPlay3DSoundCP(DBloodActor* pActor, int soundId, int playchannel, int pla
auto sid = soundEngine->FindSoundByResID(soundId);
if (sid == 0) return;
auto svec = GetSoundPos(pActor->spr.pos);
auto svec = GetSoundPos(pActor->int_pos());
float attenuation;
sid = getSfx(sid, attenuation, pitch, volume);

View file

@ -266,21 +266,21 @@ void LifeLeechOperate(DBloodActor* actor, EVENT event)
GetActorExtents(actor, &top, &bottom);
int nType = target->spr.type - kDudeBase;
DUDEINFO* pDudeInfo = getDudeInfo(nType + kDudeBase);
int z1 = (top - actor->spr.pos.Z) - 256;
int x = target->spr.pos.X;
int y = target->spr.pos.Y;
int z = target->spr.pos.Z;
int nDist = approxDist(x - actor->spr.pos.X, y - actor->spr.pos.Y);
if (nDist != 0 && cansee(actor->spr.pos.X, actor->spr.pos.Y, top, actor->sector(), x, y, z, target->sector()))
int z1 = (top - actor->int_pos().Z) - 256;
int x = target->int_pos().X;
int y = target->int_pos().Y;
int z = target->int_pos().Z;
int nDist = approxDist(x - actor->int_pos().X, y - actor->int_pos().Y);
if (nDist != 0 && cansee(actor->int_pos().X, actor->int_pos().Y, top, actor->sector(), x, y, z, target->sector()))
{
int t = DivScale(nDist, 0x1aaaaa, 12);
x += (target->vel.X * t) >> 12;
y += (target->vel.Y * t) >> 12;
int angBak = actor->spr.ang;
actor->spr.ang = getangle(x - actor->spr.pos.X, y - actor->spr.pos.Y);
actor->spr.ang = getangle(x - actor->int_pos().X, y - actor->int_pos().Y);
int dx = bcos(actor->spr.ang);
int dy = bsin(actor->spr.ang);
int tz = target->spr.pos.Z - (target->spr.yrepeat * pDudeInfo->aimHeight) * 4;
int tz = target->int_pos().Z - (target->spr.yrepeat * pDudeInfo->aimHeight) * 4;
int dz = DivScale(tz - top - 256, nDist, 10);
int nMissileType = kMissileLifeLeechAltNormal + (actor->xspr.data3 ? 1 : 0);
int t2;
@ -523,7 +523,7 @@ void OperateSprite(DBloodActor* actor, EVENT event)
actor->xspr.isTriggered = 1;
SetSpriteState(actor, 1, initiator);
for (int p = connecthead; p >= 0; p = connectpoint2[p]) {
auto vec = actor->spr.pos - gPlayer[p].actor->spr.pos;
auto vec = actor->int_pos() - gPlayer[p].actor->int_pos();
int dx = (vec.X) >> 4;
int dy = (vec.Y) >> 4;
int dz = (vec.Z) >> 8;
@ -951,7 +951,7 @@ void TranslateSector(sectortype* pSector, int a2, int a3, int a4, int a5, int a6
{
int top, bottom;
GetActorExtents(actor, &top, &bottom);
int floorZ = getflorzofslopeptr(pSector, actor->spr.pos.X, actor->spr.pos.Y);
int floorZ = getflorzofslopeptr(pSector, actor->int_pos().X, actor->int_pos().Y);
if (!(actor->spr.cstat & CSTAT_SPRITE_ALIGNMENT_MASK) && floorZ <= bottom)
{
viewBackupSpriteLoc(actor);
@ -1133,9 +1133,9 @@ DBloodActor* GetHighestSprite(sectortype* pSector, int nStatus, int* z)
{
int top, bottom;
GetActorExtents(actor, &top, &bottom);
if (actor->spr.pos.Z - top > *z)
if (actor->int_pos().Z - top > *z)
{
*z = actor->spr.pos.Z - top;
*z = actor->int_pos().Z - top;
found = actor;
}
}
@ -1388,7 +1388,7 @@ int HDoorBusy(sectortype* pSector, unsigned int a2, DBloodActor* initiator)
if (!pXSector->marker0 || !pXSector->marker1) return 0;
auto marker0 = pXSector->marker0;
auto marker1 = pXSector->marker1;
TranslateSector(pSector, GetWaveValue(pXSector->busy, nWave), GetWaveValue(a2, nWave), marker0->spr.pos.X, marker0->spr.pos.Y, marker0->spr.pos.X, marker0->spr.pos.Y, marker0->spr.ang, marker1->spr.pos.X, marker1->spr.pos.Y, marker1->spr.ang, pSector->type == kSectorSlide);
TranslateSector(pSector, GetWaveValue(pXSector->busy, nWave), GetWaveValue(a2, nWave), marker0->int_pos().X, marker0->int_pos().Y, marker0->int_pos().X, marker0->int_pos().Y, marker0->spr.ang, marker1->int_pos().X, marker1->int_pos().Y, marker1->spr.ang, pSector->type == kSectorSlide);
ZTranslateSector(pSector, pXSector, a2, nWave);
pXSector->busy = a2;
if (pXSector->command == kCmdLink && pXSector->txID)
@ -1419,7 +1419,7 @@ int RDoorBusy(sectortype* pSector, unsigned int a2, DBloodActor* initiator)
nWave = pXSector->busyWaveB;
if (!pXSector->marker0) return 0;
auto marker0 = pXSector->marker0;
TranslateSector(pSector, GetWaveValue(pXSector->busy, nWave), GetWaveValue(a2, nWave), marker0->spr.pos.X, marker0->spr.pos.Y, marker0->spr.pos.X, marker0->spr.pos.Y, 0, marker0->spr.pos.X, marker0->spr.pos.Y, marker0->spr.ang, pSector->type == kSectorRotate);
TranslateSector(pSector, GetWaveValue(pXSector->busy, nWave), GetWaveValue(a2, nWave), marker0->int_pos().X, marker0->int_pos().Y, marker0->int_pos().X, marker0->int_pos().Y, 0, marker0->int_pos().X, marker0->int_pos().Y, marker0->spr.ang, pSector->type == kSectorRotate);
ZTranslateSector(pSector, pXSector, a2, nWave);
pXSector->busy = a2;
if (pXSector->command == kCmdLink && pXSector->txID)
@ -1450,13 +1450,13 @@ int StepRotateBusy(sectortype* pSector, unsigned int a2, DBloodActor* initiator)
{
vbp = pXSector->data + marker0->spr.ang;
int nWave = pXSector->busyWaveA;
TranslateSector(pSector, GetWaveValue(pXSector->busy, nWave), GetWaveValue(a2, nWave), marker0->spr.pos.X, marker0->spr.pos.Y, marker0->spr.pos.X, marker0->spr.pos.Y, pXSector->data, marker0->spr.pos.X, marker0->spr.pos.Y, vbp, 1);
TranslateSector(pSector, GetWaveValue(pXSector->busy, nWave), GetWaveValue(a2, nWave), marker0->int_pos().X, marker0->int_pos().Y, marker0->int_pos().X, marker0->int_pos().Y, pXSector->data, marker0->int_pos().X, marker0->int_pos().Y, vbp, 1);
}
else
{
vbp = pXSector->data - marker0->spr.ang;
int nWave = pXSector->busyWaveB;
TranslateSector(pSector, GetWaveValue(pXSector->busy, nWave), GetWaveValue(a2, nWave), marker0->spr.pos.X, marker0->spr.pos.Y, marker0->spr.pos.X, marker0->spr.pos.Y, vbp, marker0->spr.pos.X, marker0->spr.pos.Y, pXSector->data, 1);
TranslateSector(pSector, GetWaveValue(pXSector->busy, nWave), GetWaveValue(a2, nWave), marker0->int_pos().X, marker0->int_pos().Y, marker0->int_pos().X, marker0->int_pos().Y, vbp, marker0->int_pos().X, marker0->int_pos().Y, pXSector->data, 1);
}
pXSector->busy = a2;
if (pXSector->command == kCmdLink && pXSector->txID)
@ -1510,7 +1510,7 @@ int PathBusy(sectortype* pSector, unsigned int a2, DBloodActor* initiator)
if (!basepath || !marker0 || !marker1) return 0;
int nWave = marker0->xspr.wave;
TranslateSector(pSector, GetWaveValue(pXSector->busy, nWave), GetWaveValue(a2, nWave), basepath->spr.pos.X, basepath->spr.pos.Y, marker0->spr.pos.X, marker0->spr.pos.Y, marker0->spr.ang, marker1->spr.pos.X, marker1->spr.pos.Y, marker1->spr.ang, 1);
TranslateSector(pSector, GetWaveValue(pXSector->busy, nWave), GetWaveValue(a2, nWave), basepath->int_pos().X, basepath->int_pos().Y, marker0->int_pos().X, marker0->int_pos().Y, marker0->spr.ang, marker1->int_pos().X, marker1->int_pos().Y, marker1->spr.ang, 1);
ZTranslateSector(pSector, pXSector, a2, nWave);
pXSector->busy = a2;
if ((a2 & 0xffff) == 0)
@ -1634,7 +1634,7 @@ void OperateTeleport(sectortype* pSector)
{
TeleFrag(pXSector->actordata, destactor->sector());
}
actor->set_int_xy(destactor->spr.pos.X, destactor->spr.pos.Y);
actor->set_int_xy(destactor->int_pos().X, destactor->int_pos().Y);
actor->add_int_z(destactor->sector()->floorz - pSector->floorz);
actor->spr.ang = destactor->spr.ang;
ChangeActorSect(actor, destactor->sector());
@ -1692,8 +1692,8 @@ void OperatePath(sectortype* pSector, EVENT event)
}
pXSector->marker1 = actor;
pXSector->offFloorZ = marker0->spr.pos.Z;
pXSector->onFloorZ = actor->spr.pos.Z;
pXSector->offFloorZ = marker0->int_pos().Z;
pXSector->onFloorZ = actor->int_pos().Z;
switch (event.cmd) {
case kCmdOn:
pXSector->state = 0;
@ -2309,7 +2309,7 @@ void trInit(TArray<DBloodActor*>& actors)
{
if (!actor->exists()) continue;
actor->spr.inittype = actor->spr.type;
actor->basePoint = actor->spr.pos;
actor->basePoint = actor->int_pos();
}
for (auto& wal : wall)
{
@ -2352,9 +2352,9 @@ void trInit(TArray<DBloodActor*>& actors)
{
auto marker0 = pXSector->marker0;
auto marker1 = pXSector->marker1;
TranslateSector(pSector, 0, -65536, marker0->spr.pos.X, marker0->spr.pos.Y, marker0->spr.pos.X, marker0->spr.pos.Y, marker0->spr.ang, marker1->spr.pos.X, marker1->spr.pos.Y, marker1->spr.ang, pSector->type == kSectorSlide);
TranslateSector(pSector, 0, -65536, marker0->int_pos().X, marker0->int_pos().Y, marker0->int_pos().X, marker0->int_pos().Y, marker0->spr.ang, marker1->int_pos().X, marker1->int_pos().Y, marker1->spr.ang, pSector->type == kSectorSlide);
UpdateBasePoints(pSector);
TranslateSector(pSector, 0, pXSector->busy, marker0->spr.pos.X, marker0->spr.pos.Y, marker0->spr.pos.X, marker0->spr.pos.Y, marker0->spr.ang, marker1->spr.pos.X, marker1->spr.pos.Y, marker1->spr.ang, pSector->type == kSectorSlide);
TranslateSector(pSector, 0, pXSector->busy, marker0->int_pos().X, marker0->int_pos().Y, marker0->int_pos().X, marker0->int_pos().Y, marker0->spr.ang, marker1->int_pos().X, marker1->int_pos().Y, marker1->spr.ang, pSector->type == kSectorSlide);
ZTranslateSector(pSector, pXSector, pXSector->busy, 1);
break;
}
@ -2362,9 +2362,9 @@ void trInit(TArray<DBloodActor*>& actors)
case kSectorRotate:
{
auto marker0 = pXSector->marker0;
TranslateSector(pSector, 0, -65536, marker0->spr.pos.X, marker0->spr.pos.Y, marker0->spr.pos.X, marker0->spr.pos.Y, 0, marker0->spr.pos.X, marker0->spr.pos.Y, marker0->spr.ang, pSector->type == kSectorRotate);
TranslateSector(pSector, 0, -65536, marker0->int_pos().X, marker0->int_pos().Y, marker0->int_pos().X, marker0->int_pos().Y, 0, marker0->int_pos().X, marker0->int_pos().Y, marker0->spr.ang, pSector->type == kSectorRotate);
UpdateBasePoints(pSector);
TranslateSector(pSector, 0, pXSector->busy, marker0->spr.pos.X, marker0->spr.pos.Y, marker0->spr.pos.X, marker0->spr.pos.Y, 0, marker0->spr.pos.X, marker0->spr.pos.Y, marker0->spr.ang, pSector->type == kSectorRotate);
TranslateSector(pSector, 0, pXSector->busy, marker0->int_pos().X, marker0->int_pos().Y, marker0->int_pos().X, marker0->int_pos().Y, 0, marker0->int_pos().X, marker0->int_pos().Y, marker0->spr.ang, pSector->type == kSectorRotate);
ZTranslateSector(pSector, pXSector, pXSector->busy, 1);
break;
}
@ -2501,7 +2501,7 @@ void ActivateGenerator(DBloodActor* actor)
case kGenDripBlood: {
int top, bottom;
GetActorExtents(actor, &top, &bottom);
actSpawnThing(actor->sector(), actor->spr.pos.X, actor->spr.pos.Y, bottom, (actor->spr.type == kGenDripWater) ? kThingDripWater : kThingDripBlood);
actSpawnThing(actor->sector(), actor->int_pos().X, actor->int_pos().Y, bottom, (actor->spr.type == kGenDripWater) ? kThingDripWater : kThingDripBlood);
break;
}
case kGenSound:
@ -2526,7 +2526,7 @@ void ActivateGenerator(DBloodActor* actor)
case kGenBubbleMulti: {
int top, bottom;
GetActorExtents(actor, &top, &bottom);
gFX.fxSpawnActor((actor->spr.type == kGenBubble) ? FX_23 : FX_26, actor->sector(), actor->spr.pos.X, actor->spr.pos.Y, top, 0);
gFX.fxSpawnActor((actor->spr.type == kGenBubble) ? FX_23 : FX_26, actor->sector(), actor->int_pos().X, actor->int_pos().Y, top, 0);
break;
}
}

View file

@ -66,8 +66,8 @@ void viewBackupView(int nPlayer)
PLAYER* pPlayer = &gPlayer[nPlayer];
VIEW* pView = &gPrevView[nPlayer];
pView->angle = pPlayer->angle.ang;
pView->x = pPlayer->actor->spr.pos.X;
pView->y = pPlayer->actor->spr.pos.Y;
pView->x = pPlayer->actor->int_pos().X;
pView->y = pPlayer->actor->int_pos().Y;
pView->viewz = pPlayer->zView;
pView->weaponZ = pPlayer->zWeapon - pPlayer->zView - 0xc00;
pView->horiz = pPlayer->horizon.horiz;
@ -93,9 +93,9 @@ void viewCorrectViewOffsets(int nPlayer, vec3_t const* oldpos)
{
PLAYER* pPlayer = &gPlayer[nPlayer];
VIEW* pView = &gPrevView[nPlayer];
pView->x += pPlayer->actor->spr.pos.X - oldpos->X;
pView->y += pPlayer->actor->spr.pos.Y - oldpos->Y;
pView->viewz += pPlayer->actor->spr.pos.Z - oldpos->Z;
pView->x += pPlayer->actor->int_pos().X - oldpos->X;
pView->y += pPlayer->actor->int_pos().Y - oldpos->Y;
pView->viewz += pPlayer->actor->int_pos().Z - oldpos->Z;
}
//---------------------------------------------------------------------------
@ -472,8 +472,8 @@ static void DrawMap(DBloodActor* view)
tm = 1;
}
VIEW* pView = &gPrevView[gViewIndex];
int x = interpolatedvalue(pView->x, view->spr.pos.X, gInterpolate);
int y = interpolatedvalue(pView->y, view->spr.pos.Y, gInterpolate);
int x = interpolatedvalue(pView->x, view->int_pos().X, gInterpolate);
int y = interpolatedvalue(pView->y, view->int_pos().Y, gInterpolate);
int ang = (!SyncInput() ? gView->angle.sum() : gView->angle.interpolatedsum(gInterpolate)).asbuild();
DrawOverheadMap(x, y, ang, gInterpolate);
if (tm)
@ -521,8 +521,8 @@ void SetupView(int& cX, int& cY, int& cZ, binangle& cA, fixedhoriz& cH, sectorty
#endif
{
VIEW* pView = &gPrevView[gViewIndex];
cX = interpolatedvalue(pView->x, gView->actor->spr.pos.X, gInterpolate);
cY = interpolatedvalue(pView->y, gView->actor->spr.pos.Y, gInterpolate);
cX = interpolatedvalue(pView->x, gView->actor->int_pos().X, gInterpolate);
cY = interpolatedvalue(pView->y, gView->actor->int_pos().Y, gInterpolate);
cZ = interpolatedvalue(pView->viewz, gView->zView, gInterpolate);
zDelta = interpolatedvaluef(pView->weaponZ, gView->zWeapon - gView->zView - (12 << 8), gInterpolate);
bobWidth = interpolatedvalue(pView->bobWidth, gView->bobWidth, gInterpolate);
@ -849,7 +849,7 @@ FString GameInterface::GetCoordString()
FString out;
out.Format("pos= %d, %d, %d - angle = %2.3f",
gMe->actor->spr.pos.X, gMe->actor->spr.pos.Y, gMe->actor->spr.pos.Z, gMe->actor->spr.ang * BAngToDegree);
gMe->actor->int_pos().X, gMe->actor->int_pos().Y, gMe->actor->int_pos().Z, gMe->actor->spr.ang * BAngToDegree);
return out;
}