mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 08:52:00 +00:00
- Blood: handled the remaining write accesses to 'pos'
This commit is contained in:
parent
04c9422db8
commit
702a73ff6c
6 changed files with 30 additions and 10 deletions
|
@ -95,6 +95,12 @@ public:
|
||||||
spr.pos = add;
|
spr.pos = add;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void copy_int_xy(DCoreActor* other)
|
||||||
|
{
|
||||||
|
spr.pos.X = other->spr.pos.X;
|
||||||
|
spr.pos.Y = other->spr.pos.Y;
|
||||||
|
}
|
||||||
|
|
||||||
void set_int_xy(int x, int y)
|
void set_int_xy(int x, int y)
|
||||||
{
|
{
|
||||||
spr.pos.X = x;
|
spr.pos.X = x;
|
||||||
|
@ -490,6 +496,17 @@ inline int pushmove(vec3_t* const vect, sectortype** const sect, int32_t const w
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline int pushmove(DCoreActor* actor, sectortype** const sect, int32_t const walldist, int32_t const ceildist, int32_t const flordist,
|
||||||
|
uint32_t const cliptype, bool clear = true)
|
||||||
|
{
|
||||||
|
auto vect = actor->int_pos();
|
||||||
|
int sectno = *sect ? sector.IndexOf(*sect) : -1;
|
||||||
|
int res = pushmove_(&vect, §no, walldist, ceildist, flordist, cliptype, clear);
|
||||||
|
actor->set_int_pos(vect);
|
||||||
|
*sect = sectno == -1 ? nullptr : §or[sectno];
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
tspritetype* renderAddTsprite(tspriteArray& tsprites, DCoreActor* actor);
|
tspritetype* renderAddTsprite(tspriteArray& tsprites, DCoreActor* actor);
|
||||||
|
|
||||||
inline PClassActor* PClass::FindActor(FName name)
|
inline PClassActor* PClass::FindActor(FName name)
|
||||||
|
|
|
@ -4776,7 +4776,7 @@ void MoveDude(DBloodActor* actor)
|
||||||
if (pSector->type >= kSectorPath && pSector->type <= kSectorRotate)
|
if (pSector->type >= kSectorPath && pSector->type <= kSectorRotate)
|
||||||
{
|
{
|
||||||
auto pSector2 = pSector;
|
auto pSector2 = pSector;
|
||||||
if (pushmove(&actor->spr.pos, &pSector2, wd, tz, bz, CLIPMASK0) == -1)
|
if (pushmove(actor, &pSector2, wd, tz, bz, CLIPMASK0) == -1)
|
||||||
actDamageSprite(actor, actor, kDamageFall, 1000 << 4);
|
actDamageSprite(actor, actor, kDamageFall, 1000 << 4);
|
||||||
if (pSector2 != nullptr)
|
if (pSector2 != nullptr)
|
||||||
pSector = pSector2;
|
pSector = pSector2;
|
||||||
|
|
|
@ -1692,7 +1692,7 @@ void debrisMove(int listIndex)
|
||||||
if (pSector->type >= kSectorPath && pSector->type <= kSectorRotate)
|
if (pSector->type >= kSectorPath && pSector->type <= kSectorRotate)
|
||||||
{
|
{
|
||||||
auto pSector2 = pSector;
|
auto pSector2 = pSector;
|
||||||
if (pushmove(&actor->spr.pos, &pSector2, clipDist, ceilDist, floorDist, CLIPMASK0) != -1)
|
if (pushmove(actor, &pSector2, clipDist, ceilDist, floorDist, CLIPMASK0) != -1)
|
||||||
pSector = pSector2;
|
pSector = pSector2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,8 +36,9 @@ void GameInterface::WarpToCoords(int x, int y, int z, int ang, int horz)
|
||||||
PLAYER* pPlayer = &gPlayer[myconnectindex];
|
PLAYER* pPlayer = &gPlayer[myconnectindex];
|
||||||
VIEW* pView = &gPrevView[myconnectindex];
|
VIEW* pView = &gPrevView[myconnectindex];
|
||||||
|
|
||||||
pPlayer->actor->spr.pos.X = pView->x = gView->actor->spr.pos.X = x;
|
pPlayer->actor->copy_int_xy(gView->actor);
|
||||||
pPlayer->actor->spr.pos.Y = pView->y = gView->actor->spr.pos.Y = y;
|
pView->x = gView->actor->int_pos().X;
|
||||||
|
pView->y = gView->actor->int_pos().Y;
|
||||||
pPlayer->zView = pView->viewz = gView->zView = z;
|
pPlayer->zView = pView->viewz = gView->zView = z;
|
||||||
|
|
||||||
if (ang != INT_MIN)
|
if (ang != INT_MIN)
|
||||||
|
|
|
@ -1850,7 +1850,7 @@ void playerProcess(PLAYER* pPlayer)
|
||||||
if (!gNoClip)
|
if (!gNoClip)
|
||||||
{
|
{
|
||||||
auto pSector = actor->sector();
|
auto pSector = actor->sector();
|
||||||
if (pushmove(&actor->spr.pos, &pSector, dw, dzt, dzb, CLIPMASK0) == -1)
|
if (pushmove(actor, &pSector, dw, dzt, dzb, CLIPMASK0) == -1)
|
||||||
actDamageSprite(actor, actor, kDamageFall, 500 << 4);
|
actDamageSprite(actor, actor, kDamageFall, 500 << 4);
|
||||||
if (actor->sector() != pSector)
|
if (actor->sector() != pSector)
|
||||||
{
|
{
|
||||||
|
|
|
@ -937,8 +937,7 @@ void TranslateSector(sectortype* pSector, int a2, int a3, int a4, int a5, int a6
|
||||||
RotatePoint((int*)&x, (int*)&y, ang, a4, a5);
|
RotatePoint((int*)&x, (int*)&y, ang, a4, a5);
|
||||||
viewBackupSpriteLoc(actor);
|
viewBackupSpriteLoc(actor);
|
||||||
actor->spr.ang = (actor->spr.ang + v14) & 2047;
|
actor->spr.ang = (actor->spr.ang + v14) & 2047;
|
||||||
actor->spr.pos.X = x + vc - a4;
|
actor->set_int_xy(x + vc - a4, y + v8 - a5);
|
||||||
actor->spr.pos.Y = y + v8 - a5;
|
|
||||||
}
|
}
|
||||||
else if (actor->spr.cstat & CSTAT_SPRITE_MOVE_REVERSE)
|
else if (actor->spr.cstat & CSTAT_SPRITE_MOVE_REVERSE)
|
||||||
{
|
{
|
||||||
|
@ -946,8 +945,7 @@ void TranslateSector(sectortype* pSector, int a2, int a3, int a4, int a5, int a6
|
||||||
RotatePoint((int*)&x, (int*)&y, -ang, a4, sprDy);
|
RotatePoint((int*)&x, (int*)&y, -ang, a4, sprDy);
|
||||||
viewBackupSpriteLoc(actor);
|
viewBackupSpriteLoc(actor);
|
||||||
actor->spr.ang = (actor->spr.ang - v14) & 2047;
|
actor->spr.ang = (actor->spr.ang - v14) & 2047;
|
||||||
actor->spr.pos.X = x - (vc - a4);
|
actor->set_int_xy(x - vc + a4, y - v8 + a5);
|
||||||
actor->spr.pos.Y = y - (v8 - a5);
|
|
||||||
}
|
}
|
||||||
else if (pXSector->Drag)
|
else if (pXSector->Drag)
|
||||||
{
|
{
|
||||||
|
@ -958,7 +956,11 @@ void TranslateSector(sectortype* pSector, int a2, int a3, int a4, int a5, int a6
|
||||||
{
|
{
|
||||||
viewBackupSpriteLoc(actor);
|
viewBackupSpriteLoc(actor);
|
||||||
if (v14)
|
if (v14)
|
||||||
RotatePoint((int*)&actor->spr.pos.X, (int*)&actor->spr.pos.Y, v14, v20, v24);
|
{
|
||||||
|
auto pos = actor->int_pos();
|
||||||
|
RotatePoint(&pos.X, &pos.Y, v14, v20, v24);
|
||||||
|
actor->set_int_pos(pos);
|
||||||
|
}
|
||||||
actor->spr.ang = (actor->spr.ang + v14) & 2047;
|
actor->spr.ang = (actor->spr.ang + v14) & 2047;
|
||||||
actor->add_int_pos({ v28, v2c, 0 });
|
actor->add_int_pos({ v28, v2c, 0 });
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue