mirror of
https://github.com/ZDoom/Raze.git
synced 2025-02-20 18:42:26 +00:00
- nXSector is gone.
This commit is contained in:
parent
a0ef54cb54
commit
8f5b9d2f03
7 changed files with 52 additions and 65 deletions
|
@ -4896,7 +4896,7 @@ void MoveDude(DBloodActor* actor)
|
|||
int nHitWall = coll.index;
|
||||
walltype* pHitWall = &wall[nHitWall];
|
||||
XWALL* pHitXWall = nullptr;
|
||||
if (pHitWall->extra > 0) pHitXWall = &pHitWall->xw();
|
||||
if (pHitWall->hasX()) pHitXWall = &pHitWall->xw();
|
||||
|
||||
if (pDudeInfo->lockOut && pHitXWall && pHitXWall->triggerPush && !pHitXWall->key && !pHitXWall->dudeLockout && !pHitXWall->state && !pHitXWall->busy && !pPlayer)
|
||||
trTriggerWall(pHitWall, kCmdWallPush);
|
||||
|
|
|
@ -79,7 +79,6 @@ template<typename T> tspritetype* viewInsertTSprite(spritetype* tsprite, int& sp
|
|||
pTSprite->xrepeat = 64;
|
||||
pTSprite->yrepeat = 64;
|
||||
pTSprite->owner = -1;
|
||||
pTSprite->extra = -1;
|
||||
pTSprite->type = -spritesortcnt;
|
||||
pTSprite->statnum = nStatnum;
|
||||
pTSprite->sectnum = nSector;
|
||||
|
@ -523,7 +522,6 @@ void viewProcessSprites(spritetype* tsprite, int& spritesortcnt, int32_t cX, int
|
|||
{
|
||||
tspritetype *pTSprite = &tsprite[nTSprite];
|
||||
auto owneractor = &bloodActors[pTSprite->owner];
|
||||
//int nXSprite = pTSprite->extra;
|
||||
XSPRITE *pTXSprite = NULL;
|
||||
if (sprite[pTSprite->owner].detail > gDetail)
|
||||
{
|
||||
|
|
|
@ -118,9 +118,9 @@ void hudDraw(PLAYER *gView, int nSectnum, double bobx, double boby, double zDelt
|
|||
}
|
||||
int nShade = sector[nSectnum].floorshade;
|
||||
int nPalette = 0;
|
||||
if (sector[gView->pSprite->sectnum].extra > 0) {
|
||||
sectortype* pSector = §or[gView->pSprite->sectnum];
|
||||
XSECTOR* pXSector = &xsector[pSector->extra];
|
||||
if (gView->pSprite->sector()->hasX()) {
|
||||
sectortype* pSector = gView->pSprite->sector();
|
||||
XSECTOR* pXSector = &pSector->xs();
|
||||
if (pXSector->color)
|
||||
nPalette = pSector->floorpal;
|
||||
}
|
||||
|
|
|
@ -1186,10 +1186,10 @@ void nnExtProcessSuperSprites()
|
|||
}
|
||||
|
||||
}
|
||||
else if (sectRangeIsFine(pWind->sectnum))
|
||||
else if (validSectorIndex(pWind->sectnum))
|
||||
{
|
||||
sectortype* pSect = §or[pWind->sectnum];
|
||||
XSECTOR* pXSector = (pSect->extra > 0) ? &xsector[pSect->extra] : NULL;
|
||||
sectortype* pSect = pWind->sector();
|
||||
XSECTOR* pXSector = (pSect->hasX()) ? &pSect->xs() : nullptr;
|
||||
if ((fWindAlways) || (pXSector && !pXSector->locked && (pXSector->windAlways || pXSector->busy)))
|
||||
windGenDoVerticalWind(pXWind->sysData2, pWind->sectnum);
|
||||
}
|
||||
|
@ -1457,7 +1457,7 @@ int getSpriteMassBySize(DBloodActor* actor)
|
|||
int mass = 0; int seqId = -1; int clipDist = pSprite->clipdist;
|
||||
if (!actor->hasX())
|
||||
{
|
||||
I_Error("getSpriteMassBySize: pSprite->extra < 0");
|
||||
I_Error("getSpriteMassBySize: pSprite->hasX == false");
|
||||
}
|
||||
else if (actor->IsDudeActor())
|
||||
{
|
||||
|
@ -4054,7 +4054,7 @@ bool condCheckSector(DBloodActor* aCond, int cmpOp, bool PUSH)
|
|||
condError(aCond, "Object #%d (objType: %d) is not a sector!", objIndex, objType);
|
||||
|
||||
sectortype* pSect = §or[objIndex];
|
||||
XSECTOR* pXSect = (xsectRangeIsFine(pSect->extra)) ? &xsector[pSect->extra] : NULL;
|
||||
XSECTOR* pXSect = pSect->hasX()? &pSect->xs() : nullptr;
|
||||
|
||||
if (cond < (kCondRange >> 1))
|
||||
{
|
||||
|
|
|
@ -1939,7 +1939,6 @@ int playerDamageSprite(DBloodActor* source, PLAYER *pPlayer, DAMAGE_TYPE nDamage
|
|||
spritetype *pSprite = pPlayer->pSprite;
|
||||
XSPRITE *pXSprite = pPlayer->pXSprite;
|
||||
auto pActor = pPlayer->actor;
|
||||
int nXSector = sector[pSprite->sectnum].extra;
|
||||
DUDEINFO *pDudeInfo = getDudeInfo(pSprite->type);
|
||||
int nDeathSeqID = -1;
|
||||
int nKneelingPlayer = -1;
|
||||
|
@ -2051,7 +2050,7 @@ int playerDamageSprite(DBloodActor* source, PLAYER *pPlayer, DAMAGE_TYPE nDamage
|
|||
if (nDeathSeqID != 16)
|
||||
{
|
||||
powerupClear(pPlayer);
|
||||
if (nXSector > 0 && xsector[nXSector].Exit)
|
||||
if (pSprite->sector()->hasX() && pSprite->sector()->xs().Exit)
|
||||
trTriggerSector(pSprite->sector(), kCmdSectorExit);
|
||||
pSprite->flags |= 7;
|
||||
for (int p = connecthead; p >= 0; p = connectpoint2[p])
|
||||
|
|
|
@ -422,10 +422,9 @@ static void fakeMoveDude(spritetype *pSprite)
|
|||
}
|
||||
bool bUnderwater = 0;
|
||||
bool bDepth = 0;
|
||||
int nXSector = sector[nSector].extra;
|
||||
if (nXSector > 0)
|
||||
if (sector[sectnum].hasX())
|
||||
{
|
||||
XSECTOR *pXSector = &xsector[nXSector];
|
||||
XSECTOR *pXSector = §or[sectnum].xs();
|
||||
if (pXSector->Underwater)
|
||||
bUnderwater = 1;
|
||||
if (pXSector->Depth)
|
||||
|
@ -550,8 +549,8 @@ static void fakeMoveDude(spritetype *pSprite)
|
|||
return;
|
||||
}
|
||||
}
|
||||
int nXSector = sector[pSprite->sectnum].extra;
|
||||
if (nXSector > 0 && xsector[nXSector].Underwater)
|
||||
int n XSector = sector [pSprite->sectnum]. extra;
|
||||
if (n XSector > 0 && xsector[n XSector].Underwater)
|
||||
return;
|
||||
if (predict.floordist >= 0x100)
|
||||
return;
|
||||
|
|
|
@ -811,8 +811,8 @@ void DragPoint(int nWall, int x, int y)
|
|||
void TranslateSector(int nSector, int a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9, int a10, int a11, char a12)
|
||||
{
|
||||
int x, y;
|
||||
int nXSector = sector[nSector].extra;
|
||||
XSECTOR *pXSector = &xsector[nXSector];
|
||||
auto pSector = §or[nSector];
|
||||
XSECTOR *pXSector = &pSector->xs();
|
||||
int v20 = interpolatedvalue(a6, a9, a2);
|
||||
int vc = interpolatedvalue(a6, a9, a3);
|
||||
int v28 = vc - v20;
|
||||
|
@ -822,10 +822,10 @@ void TranslateSector(int nSector, int a2, int a3, int a4, int a5, int a6, int a7
|
|||
int v44 = interpolatedvalue(a8, a11, a2);
|
||||
int vbp = interpolatedvalue(a8, a11, a3);
|
||||
int v14 = vbp - v44;
|
||||
int nWall = sector[nSector].wallptr;
|
||||
int nWall = pSector->wallptr;
|
||||
if (a12)
|
||||
{
|
||||
for (int i = 0; i < sector[nSector].wallnum; nWall++, i++)
|
||||
for (int i = 0; i < pSector->wallnum; nWall++, i++)
|
||||
{
|
||||
x = baseWall[nWall].x;
|
||||
y = baseWall[nWall].y;
|
||||
|
@ -836,7 +836,7 @@ void TranslateSector(int nSector, int a2, int a3, int a4, int a5, int a6, int a7
|
|||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < sector[nSector].wallnum; nWall++, i++)
|
||||
for (int i = 0; i < pSector->wallnum; nWall++, i++)
|
||||
{
|
||||
int v10 = wall[nWall].point2;
|
||||
x = baseWall[nWall].x;
|
||||
|
@ -1035,10 +1035,10 @@ DBloodActor* GetCrushedSpriteExtents(unsigned int nSector, int *pzTop, int *pzBo
|
|||
|
||||
int VCrushBusy(unsigned int nSector, unsigned int a2)
|
||||
{
|
||||
assert(nSector < (unsigned int)numsectors);
|
||||
int nXSector = sector[nSector].extra;
|
||||
assert(nXSector > 0 && nXSector < kMaxXSectors);
|
||||
XSECTOR *pXSector = &xsector[nXSector];
|
||||
assert(validSectorIndex(nSector));
|
||||
auto pSector = §or[nSector];
|
||||
assert(pSector->hasX());
|
||||
XSECTOR *pXSector = &pSector->xs();
|
||||
int nWave;
|
||||
if (pXSector->busy < a2)
|
||||
nWave = pXSector->busyWaveA;
|
||||
|
@ -1057,9 +1057,9 @@ int VCrushBusy(unsigned int nSector, unsigned int a2)
|
|||
return 1;
|
||||
viewInterpolateSector(nSector, §or[nSector]);
|
||||
if (dz1 != 0)
|
||||
sector[nSector].ceilingz = vc;
|
||||
pSector->ceilingz = vc;
|
||||
if (dz2 != 0)
|
||||
sector[nSector].floorz = v10;
|
||||
pSector->floorz = v10;
|
||||
pXSector->busy = a2;
|
||||
if (pXSector->command == kCmdLink && pXSector->txID)
|
||||
evSendSector(nSector,pXSector->txID, kCmdLink);
|
||||
|
@ -1074,10 +1074,10 @@ int VCrushBusy(unsigned int nSector, unsigned int a2)
|
|||
|
||||
int VSpriteBusy(unsigned int nSector, unsigned int a2)
|
||||
{
|
||||
assert(nSector < (unsigned int)numsectors);
|
||||
int nXSector = sector[nSector].extra;
|
||||
assert(nXSector > 0 && nXSector < kMaxXSectors);
|
||||
XSECTOR *pXSector = &xsector[nXSector];
|
||||
assert(validSectorIndex(nSector));
|
||||
auto pSector = §or[nSector];
|
||||
assert(pSector->hasX());
|
||||
XSECTOR* pXSector = &pSector->xs();
|
||||
int nWave;
|
||||
if (pXSector->busy < a2)
|
||||
nWave = pXSector->busyWaveA;
|
||||
|
@ -1125,10 +1125,10 @@ int VSpriteBusy(unsigned int nSector, unsigned int a2)
|
|||
|
||||
int VDoorBusy(unsigned int nSector, unsigned int a2)
|
||||
{
|
||||
assert(nSector < (unsigned int)numsectors);
|
||||
int nXSector = sector[nSector].extra;
|
||||
assert(nXSector > 0 && nXSector < kMaxXSectors);
|
||||
XSECTOR *pXSector = &xsector[nXSector];
|
||||
assert(validSectorIndex(nSector));
|
||||
auto pSector = §or[nSector];
|
||||
assert(pSector->hasX());
|
||||
XSECTOR *pXSector = &pSector->xs();
|
||||
int vbp;
|
||||
if (pXSector->state)
|
||||
vbp = 65536/ClipLow((120*pXSector->busyTimeA)/10, 1);
|
||||
|
@ -1222,11 +1222,10 @@ int VDoorBusy(unsigned int nSector, unsigned int a2)
|
|||
|
||||
int HDoorBusy(unsigned int nSector, unsigned int a2)
|
||||
{
|
||||
assert(nSector < (unsigned int)numsectors);
|
||||
assert(validSectorIndex(nSector));
|
||||
sectortype *pSector = §or[nSector];
|
||||
int nXSector = pSector->extra;
|
||||
assert(nXSector > 0 && nXSector < kMaxXSectors);
|
||||
XSECTOR *pXSector = &xsector[nXSector];
|
||||
assert(pSector->hasX());
|
||||
XSECTOR* pXSector = &pSector->xs();
|
||||
int nWave;
|
||||
if (pXSector->busy < a2)
|
||||
nWave = pXSector->busyWaveA;
|
||||
|
@ -1251,11 +1250,10 @@ int HDoorBusy(unsigned int nSector, unsigned int a2)
|
|||
|
||||
int RDoorBusy(unsigned int nSector, unsigned int a2)
|
||||
{
|
||||
assert(nSector < (unsigned int)numsectors);
|
||||
assert(validSectorIndex(nSector));
|
||||
sectortype *pSector = §or[nSector];
|
||||
int nXSector = pSector->extra;
|
||||
assert(nXSector > 0 && nXSector < kMaxXSectors);
|
||||
XSECTOR *pXSector = &xsector[nXSector];
|
||||
assert(pSector->hasX());
|
||||
XSECTOR* pXSector = &pSector->xs();
|
||||
int nWave;
|
||||
if (pXSector->busy < a2)
|
||||
nWave = pXSector->busyWaveA;
|
||||
|
@ -1279,11 +1277,10 @@ int RDoorBusy(unsigned int nSector, unsigned int a2)
|
|||
|
||||
int StepRotateBusy(unsigned int nSector, unsigned int a2)
|
||||
{
|
||||
assert(nSector < (unsigned int)numsectors);
|
||||
assert(validSectorIndex(nSector));
|
||||
sectortype *pSector = §or[nSector];
|
||||
int nXSector = pSector->extra;
|
||||
assert(nXSector > 0 && nXSector < kMaxXSectors);
|
||||
XSECTOR *pXSector = &xsector[nXSector];
|
||||
assert(pSector->hasX());
|
||||
XSECTOR* pXSector = &pSector->xs();
|
||||
if (!pXSector->marker0) return 0;
|
||||
spritetype* pSprite = &pXSector->marker0->s();
|
||||
int vbp;
|
||||
|
@ -1314,11 +1311,10 @@ int StepRotateBusy(unsigned int nSector, unsigned int a2)
|
|||
|
||||
int GenSectorBusy(unsigned int nSector, unsigned int a2)
|
||||
{
|
||||
assert(nSector < (unsigned int)numsectors);
|
||||
assert(validSectorIndex(nSector));
|
||||
sectortype *pSector = §or[nSector];
|
||||
int nXSector = pSector->extra;
|
||||
assert(nXSector > 0 && nXSector < kMaxXSectors);
|
||||
XSECTOR *pXSector = &xsector[nXSector];
|
||||
assert(pSector->hasX());
|
||||
XSECTOR* pXSector = &pSector->xs();
|
||||
pXSector->busy = a2;
|
||||
if (pXSector->command == kCmdLink && pXSector->txID)
|
||||
evSendSector(nSector,pXSector->txID, kCmdLink);
|
||||
|
@ -1333,11 +1329,10 @@ int GenSectorBusy(unsigned int nSector, unsigned int a2)
|
|||
|
||||
int PathBusy(unsigned int nSector, unsigned int a2)
|
||||
{
|
||||
assert(nSector < (unsigned int)numsectors);
|
||||
assert(validSectorIndex(nSector));
|
||||
sectortype *pSector = §or[nSector];
|
||||
int nXSector = pSector->extra;
|
||||
assert(nXSector > 0 && nXSector < kMaxXSectors);
|
||||
XSECTOR *pXSector = &xsector[nXSector];
|
||||
assert(pSector->hasX());
|
||||
XSECTOR* pXSector = &pSector->xs();
|
||||
|
||||
if (!pXSector->basePath || !pXSector->marker0 || !pXSector->marker1) return 0;
|
||||
spritetype* pSprite = &pXSector->basePath->s();
|
||||
|
@ -1856,10 +1851,8 @@ void ProcessMotion(void)
|
|||
int nSector;
|
||||
for (pSector = §or[0], nSector = 0; nSector < numsectors; nSector++, pSector++)
|
||||
{
|
||||
int nXSector = pSector->extra;
|
||||
if (nXSector <= 0)
|
||||
continue;
|
||||
XSECTOR *pXSector = &xsector[nXSector];
|
||||
if (!pSector->hasX()) continue;
|
||||
XSECTOR* pXSector = &pSector->xs();
|
||||
if (pXSector->bobSpeed != 0)
|
||||
{
|
||||
if (pXSector->bobAlways)
|
||||
|
@ -2029,11 +2022,9 @@ void trInit(void)
|
|||
sectortype *pSector = §or[i];
|
||||
baseFloor[i] = pSector->floorz;
|
||||
baseCeil[i] = pSector->ceilingz;
|
||||
int nXSector = pSector->extra;
|
||||
if (nXSector > 0)
|
||||
if (pSector->hasX())
|
||||
{
|
||||
assert(nXSector < kMaxXSectors);
|
||||
XSECTOR *pXSector = &xsector[nXSector];
|
||||
XSECTOR *pXSector = &pSector->xs();
|
||||
if (pXSector->state)
|
||||
pXSector->busy = 65536;
|
||||
switch (pSector->type)
|
||||
|
|
Loading…
Reference in a new issue