mirror of
https://github.com/ZDoom/Raze.git
synced 2025-02-28 14:11:06 +00:00
- some quick sprite[] replacements.
This commit is contained in:
parent
3419d6a901
commit
33261db902
1 changed files with 21 additions and 18 deletions
|
@ -1073,22 +1073,23 @@ void MoveSector(short nSector, int nAngle, int *nXVel, int *nYVel)
|
||||||
it.Reset(nNextSector);
|
it.Reset(nNextSector);
|
||||||
while ((i = it.NextIndex()) >= 0)
|
while ((i = it.NextIndex()) >= 0)
|
||||||
{
|
{
|
||||||
if (sprite[i].statnum >= 99)
|
auto pSprite = &sprite[i];
|
||||||
|
if (pSprite->statnum >= 99)
|
||||||
{
|
{
|
||||||
x = sprite[i].x;
|
x = pSprite->x;
|
||||||
y = sprite[i].y;
|
y = pSprite->y;
|
||||||
z = sprite[i].z;
|
z = pSprite->z;
|
||||||
nSectorB = nNextSector;
|
nSectorB = nNextSector;
|
||||||
|
|
||||||
clipmove_old((int32_t*)&x, (int32_t*)&y, (int32_t*)&z, &nSectorB,
|
clipmove_old((int32_t*)&x, (int32_t*)&y, (int32_t*)&z, &nSectorB,
|
||||||
-xvect - (bcos(nAngle) * (4 * sprite[i].clipdist)),
|
-xvect - (bcos(nAngle) * (4 * pSprite->clipdist)),
|
||||||
-yvect - (bsin(nAngle) * (4 * sprite[i].clipdist)),
|
-yvect - (bsin(nAngle) * (4 * pSprite->clipdist)),
|
||||||
4 * sprite[i].clipdist, 0, 0, CLIPMASK0);
|
4 * pSprite->clipdist, 0, 0, CLIPMASK0);
|
||||||
|
|
||||||
|
|
||||||
if (nSectorB != nNextSector && (nSectorB == nSector || nNextSector == nSector))
|
if (nSectorB != nNextSector && (nSectorB == nSector || nNextSector == nSector))
|
||||||
{
|
{
|
||||||
if (nSectorB != nSector || nFloorZ >= sprite[i].z)
|
if (nSectorB != nSector || nFloorZ >= pSprite->z)
|
||||||
{
|
{
|
||||||
if (nSectorB >= 0 && nSectorB < kMaxSectors) {
|
if (nSectorB >= 0 && nSectorB < kMaxSectors) {
|
||||||
mychangespritesect(i, nSectorB);
|
mychangespritesect(i, nSectorB);
|
||||||
|
@ -1097,8 +1098,8 @@ void MoveSector(short nSector, int nAngle, int *nXVel, int *nYVel)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
movesprite(i,
|
movesprite(i,
|
||||||
(xvect << 14) + bcos(nAngle) * sprite[i].clipdist,
|
(xvect << 14) + bcos(nAngle) * pSprite->clipdist,
|
||||||
(yvect << 14) + bsin(nAngle) * sprite[i].clipdist,
|
(yvect << 14) + bsin(nAngle) * pSprite->clipdist,
|
||||||
0, 0, 0, CLIPMASK0);
|
0, 0, 0, CLIPMASK0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1125,10 +1126,11 @@ void MoveSector(short nSector, int nAngle, int *nXVel, int *nYVel)
|
||||||
SectIterator it(nSector);
|
SectIterator it(nSector);
|
||||||
while ((i = it.NextIndex()) >= 0)
|
while ((i = it.NextIndex()) >= 0)
|
||||||
{
|
{
|
||||||
if (sprite[i].statnum >= 99 && nZVal == sprite[i].z && !(sprite[i].cstat & 0x8000))
|
auto pSprite = &sprite[i];
|
||||||
|
if (pSprite->statnum >= 99 && nZVal == pSprite->z && !(pSprite->cstat & 0x8000))
|
||||||
{
|
{
|
||||||
nSectorB = nSector;
|
nSectorB = nSector;
|
||||||
clipmove_old(&sprite[i].x, &sprite[i].y, &sprite[i].z, &nSectorB, xvect, yvect, 4 * sprite[i].clipdist, 5120, -5120, CLIPMASK0);
|
clipmove_old(&pSprite->x, &pSprite->y, &pSprite->z, &nSectorB, xvect, yvect, 4 * pSprite->clipdist, 5120, -5120, CLIPMASK0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1149,12 +1151,13 @@ void MoveSector(short nSector, int nAngle, int *nXVel, int *nYVel)
|
||||||
Can cause local player sounds to play off-centre.
|
Can cause local player sounds to play off-centre.
|
||||||
TODO: Might need to be done elsewhere too?
|
TODO: Might need to be done elsewhere too?
|
||||||
*/
|
*/
|
||||||
int nPlayerSprite = PlayerList[nLocalPlayer].nSprite;
|
auto pActor = PlayerList[nLocalPlayer].Actor();
|
||||||
initx = sprite[nPlayerSprite].x;
|
auto pSprite = &pActor->s();
|
||||||
inity = sprite[nPlayerSprite].y;
|
initx = pSprite->x;
|
||||||
initz = sprite[nPlayerSprite].z;
|
inity = pSprite->y;
|
||||||
inita = sprite[nPlayerSprite].ang;
|
initz = pSprite->z;
|
||||||
initsect = sprite[nPlayerSprite].sectnum;
|
inita = pSprite->ang;
|
||||||
|
initsect = pSprite->sectnum;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetQuake(short nSprite, int nVal)
|
void SetQuake(short nSprite, int nVal)
|
||||||
|
|
Loading…
Reference in a new issue