diff --git a/source/build/src/mdsprite.cpp b/source/build/src/mdsprite.cpp index 43686bd6a..9bf953a4d 100644 --- a/source/build/src/mdsprite.cpp +++ b/source/build/src/mdsprite.cpp @@ -1529,7 +1529,7 @@ int32_t polymost_mddraw(tspriteptr_t tspr) allocmodelverts = maxmodelverts; } - mdmodel_t *const vm = models[tile2model[Ptile2tile(tspr->picnum, tspr->ownerActor->s().pal)].modelid]; + mdmodel_t *const vm = models[tile2model[Ptile2tile(tspr->picnum, tspr->ownerActor->spr.pal)].modelid]; if (vm->mdnum == 1) return polymost_voxdraw((voxmodel_t *)vm,tspr, false); // can't access rotating info anymore else if (vm->mdnum == 3) diff --git a/source/build/src/polymost.cpp b/source/build/src/polymost.cpp index 6c83bcd10..fad935d48 100644 --- a/source/build/src/polymost.cpp +++ b/source/build/src/polymost.cpp @@ -3240,7 +3240,7 @@ void polymost_drawsprite(int32_t snum) break; } - actor->s().cstat2 |= CSTAT2_SPRITE_MAPPED; + actor->spr.cstat2 |= CSTAT2_SPRITE_MAPPED; _drawsprite_return: ; @@ -3811,7 +3811,7 @@ int32_t polymost_voxdraw(voxmodel_t* m, tspriteptr_t const tspr, bool rotate) k0 = m->bscale / 64.f; f = (float)tspr->xrepeat * (256.f / 320.f) * k0; - if ((tspr->ownerActor->s().cstat & CSTAT_SPRITE_ALIGNMENT_MASK) == CSTAT_SPRITE_ALIGNMENT_WALL) + if ((tspr->ownerActor->spr.cstat & CSTAT_SPRITE_ALIGNMENT_MASK) == CSTAT_SPRITE_ALIGNMENT_WALL) { f *= 1.25f; a0.Y -= tspr->xoffset * bcosf(tspr->ownerActor->sx().angoff, -20); @@ -3827,7 +3827,7 @@ int32_t polymost_voxdraw(voxmodel_t* m, tspriteptr_t const tspr, bool rotate) m0.Z *= f; a0.Z *= f; k0 = (float)(tspr->z + tspr->ownerActor->sx().position_offset.z); - f = ((globalorientation & 8) && (tspr->ownerActor->s().cstat & CSTAT_SPRITE_ALIGNMENT_MASK) != 0) ? -4.f : 4.f; + f = ((globalorientation & 8) && (tspr->ownerActor->spr.cstat & CSTAT_SPRITE_ALIGNMENT_MASK) != 0) ? -4.f : 4.f; k0 -= (tspr->yoffset * tspr->yrepeat) * f * m->bscale; zoff = m->siz.z * .5f; if (!(tspr->cstat & CSTAT_SPRITE_YCENTER)) diff --git a/source/core/actorlist.cpp b/source/core/actorlist.cpp index 72749be86..3aee388fb 100644 --- a/source/core/actorlist.cpp +++ b/source/core/actorlist.cpp @@ -97,7 +97,7 @@ static void AddStatTail(DCoreActor* actor, int statnum) else statList[statnum].firstEntry = actor; statList[statnum].lastEntry = actor; assert(ValidateStatList(statnum)); - actor->s().statnum = statnum; + actor->spr.statnum = statnum; actor->link_stat = statnum; GC::WriteBarrier(actor); GC::WriteBarrier(tail); @@ -121,7 +121,7 @@ static void AddStatHead(DCoreActor* actor, int statnum) else statList[statnum].lastEntry = actor; assert(ValidateStatList(statnum)); statList[statnum].firstEntry = actor; - actor->s().statnum = statnum; + actor->spr.statnum = statnum; actor->link_stat = statnum; GC::WriteBarrier(actor); GC::WriteBarrier(head); @@ -154,7 +154,7 @@ static void RemoveActorStat(DCoreActor* actor) assert(ValidateStatList(actor->link_stat)); actor->nextStat = actor->prevStat = nullptr; - actor->s().statnum = MAXSTATUS; + actor->spr.statnum = MAXSTATUS; actor->link_stat = MAXSTATUS; GC::WriteBarrier(prev); GC::WriteBarrier(next); @@ -184,7 +184,7 @@ int ChangeActorStat(DCoreActor* actor, int statnum, bool tail) { int oldstat = actor->link_stat; assert(statnum >= 0 && statnum < MAXSTATUS); - assert(actor->s().statnum >= 0 && actor->s().statnum < MAXSTATUS); + assert(actor->spr.statnum >= 0 && actor->spr.statnum < MAXSTATUS); RemoveActorStat(actor); InsertActorStat(actor, statnum, tail); return 0; @@ -236,7 +236,7 @@ static void AddSectTail(DCoreActor *actor, sectortype* sect) else sect->firstEntry = actor; sect->lastEntry = actor; assert(ValidateSectList(sect)); - actor->s().setsector(sect); + actor->spr.setsector(sect); actor->link_sector = sect; GC::WriteBarrier(actor); GC::WriteBarrier(tail); @@ -260,7 +260,7 @@ static void AddSectHead(DCoreActor *actor, sectortype* sect) else sect->lastEntry = actor; sect->firstEntry = actor; assert(ValidateSectList(sect)); - actor->s().setsector(sect); + actor->spr.setsector(sect); actor->link_sector = sect; GC::WriteBarrier(actor); GC::WriteBarrier(head); @@ -297,7 +297,7 @@ static void RemoveActorSect(DCoreActor* actor) assert(ValidateSectList(actor->link_sector, actor)); actor->nextSect = actor->prevSect = nullptr; - actor->s().setsector(nullptr); + actor->spr.setsector(nullptr); actor->link_sector = nullptr; GC::WriteBarrier(prev); GC::WriteBarrier(next); @@ -316,7 +316,7 @@ static void InsertActorSect(DCoreActor* actor, sectortype* sector, bool tail) if (!sector) { actor->link_sector = nullptr; - actor->s().setsector(nullptr); + actor->spr.setsector(nullptr); return; } if (isSafe() || tail) AddSectTail(actor, sector); @@ -356,7 +356,7 @@ DCoreActor* InsertActor(PClass* type, sectortype* sector, int stat, bool tail) InsertActorSect(actor, sector, tail); Numsprites++; - actor->s().time = leveltimer++; + actor->spr.time = leveltimer++; return actor; } @@ -448,7 +448,7 @@ void InitSpriteLists() void SetActor(DCoreActor* actor, const vec3_t* newpos) { auto tempsector = actor->sector(); - actor->s().setpos(*newpos); + actor->spr.setpos(*newpos); updatesector(newpos->x, newpos->y, &tempsector); if (tempsector && tempsector != actor->sector()) @@ -458,7 +458,7 @@ void SetActor(DCoreActor* actor, const vec3_t* newpos) void SetActorZ(DCoreActor* actor, const vec3_t* newpos) { auto tempsector = actor->sector(); - actor->s().setpos(*newpos); + actor->spr.setpos(*newpos); updatesectorz(newpos->x, newpos->y, newpos->z, &tempsector); if (tempsector && tempsector != actor->sector()) diff --git a/source/core/rendering/scene/hw_drawinfo.cpp b/source/core/rendering/scene/hw_drawinfo.cpp index 7e57fdab0..7e914e927 100644 --- a/source/core/rendering/scene/hw_drawinfo.cpp +++ b/source/core/rendering/scene/hw_drawinfo.cpp @@ -281,7 +281,7 @@ void HWDrawInfo::DispatchSprites() if (actor == nullptr || tspr->xrepeat == 0 || tspr->yrepeat == 0 || tilenum >= MAXTILES) continue; - actor->s().cstat2 |= CSTAT2_SPRITE_MAPPED; + actor->spr.cstat2 |= CSTAT2_SPRITE_MAPPED; tileUpdatePicnum(&tilenum, (actor->GetIndex() & 16383) + 32768, 0); tspr->picnum = tilenum; diff --git a/source/core/rendering/scene/hw_sprites.cpp b/source/core/rendering/scene/hw_sprites.cpp index 4068adb76..d7a107529 100644 --- a/source/core/rendering/scene/hw_sprites.cpp +++ b/source/core/rendering/scene/hw_sprites.cpp @@ -477,7 +477,7 @@ bool HWSprite::ProcessVoxel(HWDrawInfo* di, voxmodel_t* vox, tspritetype* spr, s float basescale = voxel->bscale / 64.f; float sprxscale = (float)spr->xrepeat * (256.f / 320.f) * basescale; - if ((spr->ownerActor->s().cstat & CSTAT_SPRITE_ALIGNMENT_MASK) == CSTAT_SPRITE_ALIGNMENT_WALL) + if ((spr->ownerActor->spr.cstat & CSTAT_SPRITE_ALIGNMENT_MASK) == CSTAT_SPRITE_ALIGNMENT_WALL) { sprxscale *= 1.25f; translatevec.Y -= spr->xoffset * bcosf(sprext->angoff, -20); @@ -505,7 +505,7 @@ bool HWSprite::ProcessVoxel(HWDrawInfo* di, voxmodel_t* vox, tspritetype* spr, s translatevec.Z *= sprzscale; float zpos = (float)(spr->z + sprext->position_offset.z); - float zscale = ((spr->cstat & CSTAT_SPRITE_YFLIP) && (spr->ownerActor->s().cstat & CSTAT_SPRITE_ALIGNMENT_MASK) != 0) ? -4.f : 4.f; + float zscale = ((spr->cstat & CSTAT_SPRITE_YFLIP) && (spr->ownerActor->spr.cstat & CSTAT_SPRITE_ALIGNMENT_MASK) != 0) ? -4.f : 4.f; zpos -= (spr->yoffset * spr->yrepeat) * zscale * voxel->bscale; x = (spr->x + sprext->position_offset.x) * (1 / 16.f); diff --git a/source/games/blood/src/actor.cpp b/source/games/blood/src/actor.cpp index 32e484a56..7f6227ac1 100644 --- a/source/games/blood/src/actor.cpp +++ b/source/games/blood/src/actor.cpp @@ -2527,9 +2527,9 @@ void actInit(TArray& actors) BloodStatIterator it(kStatItem); while (auto act = it.Next()) { - if (act->s().type == kItemWeaponVoodooDoll) + if (act->spr.type == kItemWeaponVoodooDoll) { - act->s().type = kItemAmmoVoodooDoll; + act->spr.type = kItemAmmoVoodooDoll; break; } } @@ -2767,7 +2767,7 @@ static DBloodActor* actSpawnFloor(DBloodActor* actor) updatesector(x, y, &pSector); int zFloor = getflorzofslopeptr(pSector, x, y); auto spawned = actSpawnSprite(pSector, x, y, zFloor, 3, 0); - if (spawned) spawned->s().cstat &= ~CSTAT_SPRITE_BLOCK_ALL; + if (spawned) spawned->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL; return spawned; } @@ -2895,8 +2895,8 @@ DBloodActor* actDropObject(DBloodActor* actor, int nType) { int top, bottom; GetActorExtents(act2, &top, &bottom); - if (bottom >= act2->s().z) - act2->s().z -= bottom - act2->s().z; + if (bottom >= act2->spr.z) + act2->spr.z -= bottom - act2->spr.z; } return act2; @@ -3143,7 +3143,7 @@ static void checkDropObjects(DBloodActor* actor) if (pXSprite->key > 0) actDropObject(actor, kItemKeyBase + pXSprite->key - 1); if (pXSprite->dropMsg > 0) actDropObject(actor, pXSprite->dropMsg); - switch (actor->s().type) + switch (actor->spr.type) { case kDudeCultistTommy: { @@ -3256,7 +3256,7 @@ static void spawnGibs(DBloodActor* actor, int type, int velz) { int top, bottom; GetActorExtents(actor, &top, &bottom); - CGibPosition gibPos(actor->s().x, actor->s().y, top); + CGibPosition gibPos(actor->spr.x, actor->spr.y, top); CGibVelocity gibVel(actor->xvel >> 1, actor->yvel >> 1, velz); GibSprite(actor, GIBTYPE_27, &gibPos, &gibVel); } @@ -3724,7 +3724,7 @@ static int actDamageThing(DBloodActor* source, DBloodActor* actor, int damage, D pXSprite->stateTimer = pXSprite->data4 = pXSprite->isTriggered = 0; #ifdef NOONE_EXTENSIONS - if (Owner && Owner->s().type == kDudeModernCustom) + if (Owner && Owner->spr.type == kDudeModernCustom) Owner->SetSpecialOwner(); // indicates if custom dude had life leech. #endif break; @@ -3813,7 +3813,7 @@ int actDamageSprite(DBloodActor* source, DBloodActor* actor, DAMAGE_TYPE damageT if (source == nullptr) source = actor; PLAYER* pSourcePlayer = nullptr; - if (source->IsPlayerActor()) pSourcePlayer = &gPlayer[source->s().type - kDudePlayer1]; + if (source->IsPlayerActor()) pSourcePlayer = &gPlayer[source->spr.type - kDudePlayer1]; if (!gGameOptions.bFriendlyFire && IsTargetTeammate(pSourcePlayer, pSprite)) return 0; switch (pSprite->statnum) @@ -3907,7 +3907,7 @@ static void actImpactMissile(DBloodActor* missileActor, int hitCode) if (gGameOptions.weaponsV10x && !VanillaMode() && pDudeInfo != nullptr) { if (missileOwner->IsDudeActor() && missileOwner->hasX() && missileOwner->x().health != 0) - actHealDude(missileOwner, nDamage >> 2, getDudeInfo(missileOwner->s().type)->startHealth); + actHealDude(missileOwner, nDamage >> 2, getDudeInfo(missileOwner->spr.type)->startHealth); } } @@ -3933,7 +3933,7 @@ static void actImpactMissile(DBloodActor* missileActor, int hitCode) if (pWallHit) { auto pFX = gFX.fxSpawnActor(FX_52, pMissile->sector(), pMissile->x, pMissile->y, pMissile->z, 0); - if (pFX) pFX->s().ang = (GetWallAngle(pWallHit) + 512) & 2047; + if (pFX) pFX->spr.ang = (GetWallAngle(pWallHit) + 512) & 2047; } break; } @@ -4105,7 +4105,7 @@ static void actImpactMissile(DBloodActor* missileActor, int hitCode) { int nDamage = (10 + Random(10)) << 4; actDamageSprite(missileOwner, actorHit, kDamageSpirit, nDamage); - int nType = missileOwner->s().type - kDudeBase; + int nType = missileOwner->spr.type - kDudeBase; if (missileOwner->x().health > 0) actHealDude(missileOwner, 10, getDudeInfo(nType + kDudeBase)->startHealth); } @@ -4153,10 +4153,10 @@ static void actImpactMissile(DBloodActor* missileActor, int hitCode) static void actKickObject(DBloodActor* kicker, DBloodActor* kicked) { int nSpeed = ClipLow(approxDist(kicker->xvel, kicker->yvel) * 2, 0xaaaaa); - kicked->xvel = MulScale(nSpeed, Cos(kicker->s().ang + Random2(85)), 30); - kicked->yvel = MulScale(nSpeed, Sin(kicker->s().ang + Random2(85)), 30); + kicked->xvel = MulScale(nSpeed, Cos(kicker->spr.ang + Random2(85)), 30); + kicked->yvel = MulScale(nSpeed, Sin(kicker->spr.ang + Random2(85)), 30); kicked->zvel = MulScale(nSpeed, -0x2000, 14); - kicked->s().flags = 7; + kicked->spr.flags = 7; } //--------------------------------------------------------------------------- @@ -4952,8 +4952,8 @@ void MoveDude(DBloodActor* actor) } DCoreActor* pUpperLink = pSector->upperLink; DCoreActor* pLowerLink = pSector->lowerLink; - if (pUpperLink && (pUpperLink->s().type == kMarkerUpWater || pUpperLink->s().type == kMarkerUpGoo)) bDepth = 1; - if (pLowerLink && (pLowerLink->s().type == kMarkerLowWater || pLowerLink->s().type == kMarkerLowGoo)) bDepth = 1; + if (pUpperLink && (pUpperLink->spr.type == kMarkerUpWater || pUpperLink->spr.type == kMarkerUpGoo)) bDepth = 1; + if (pLowerLink && (pLowerLink->spr.type == kMarkerLowWater || pLowerLink->spr.type == kMarkerLowGoo)) bDepth = 1; if (pPlayer) wd += 16; if (actor->zvel) pSprite->z += actor->zvel >> 8; @@ -5265,10 +5265,10 @@ void MoveDude(DBloodActor* actor) if (floorColl.type == kHitSprite) { auto hitAct = floorColl.actor(); - if ((hitAct->s().cstat & CSTAT_SPRITE_ALIGNMENT_MASK) == CSTAT_SPRITE_ALIGNMENT_FACING) + if ((hitAct->spr.cstat & CSTAT_SPRITE_ALIGNMENT_MASK) == CSTAT_SPRITE_ALIGNMENT_FACING) { - actor->xvel += MulScale(4, pSprite->x - hitAct->s().x, 2); - actor->yvel += MulScale(4, pSprite->y - hitAct->s().y, 2); + actor->xvel += MulScale(4, pSprite->x - hitAct->spr.x, 2); + actor->yvel += MulScale(4, pSprite->y - hitAct->spr.y, 2); return; } } @@ -6008,7 +6008,7 @@ static void actCheckExplosion() if (gImpactSpritesList[i] == nullptr) continue; DBloodActor* impactactor = gImpactSpritesList[i]; - if (!impactactor->hasX() || !impactactor->s().insector() || (impactactor->s().flags & kHitagFree) != 0) continue; + if (!impactactor->hasX() || !impactactor->spr.insector() || (impactactor->spr.flags & kHitagFree) != 0) continue; if (!CheckSector(sectorMap, &impactactor->s()) || !CheckProximity(impactactor, x, y, z, pSector, radius)) continue; @@ -6899,8 +6899,8 @@ void actFireVector(DBloodActor* shooter, int a2, int a3, int a4, int a5, int a6, auto pFX = gFX.fxSpawnActor(pVectorData->surfHit[nSurf].fx1, pSector, x, y, z, 0); if (pFX) { - pFX->s().ang = (GetWallAngle(pWall) + 512) & 2047; - pFX->s().cstat |= CSTAT_SPRITE_ALIGNMENT_WALL; + pFX->spr.ang = (GetWallAngle(pWall) + 512) & 2047; + pFX->spr.cstat |= CSTAT_SPRITE_ALIGNMENT_WALL; } } } @@ -7004,8 +7004,8 @@ void actFireVector(DBloodActor* shooter, int a2, int a3, int a4, int a5, int a6, if (pFX) { pFX->zvel = 0x2222; - pFX->s().ang = (GetWallAngle(pWall) + 512) & 2047; - pFX->s().cstat |= CSTAT_SPRITE_ALIGNMENT_WALL; + pFX->spr.ang = (GetWallAngle(pWall) + 512) & 2047; + pFX->spr.cstat |= CSTAT_SPRITE_ALIGNMENT_WALL; } } } @@ -7222,11 +7222,11 @@ void actPostProcess(void) { for (auto& p : gPost) { - p.sprite->s().flags &= ~32; + p.sprite->spr.flags &= ~32; int nStatus = p.status; if (nStatus == kStatFree) { - if (p.sprite->s().statnum != kStatFree) + if (p.sprite->spr.statnum != kStatFree) { evKillActor(p.sprite); if (p.sprite->hasX()) seqKill(p.sprite); @@ -7276,7 +7276,7 @@ void MakeSplash(DBloodActor* actor) void actBurnSprite(DBloodActor* pSource, DBloodActor* pTarget, int nTime) { auto pXSprite = &pTarget->x(); - pXSprite->burnTime = ClipHigh(pXSprite->burnTime + nTime, pTarget->s().statnum == kStatDude ? 2400 : 1200); + pXSprite->burnTime = ClipHigh(pXSprite->burnTime + nTime, pTarget->spr.statnum == kStatDude ? 2400 : 1200); pTarget->SetBurnSource(pSource); } diff --git a/source/games/blood/src/ai.cpp b/source/games/blood/src/ai.cpp index 207a485a5..7f0e3c416 100644 --- a/source/games/blood/src/ai.cpp +++ b/source/games/blood/src/ai.cpp @@ -112,7 +112,7 @@ static bool isImmune(DBloodActor* actor, int dmgType, int minScale) if (dmgType >= kDmgFall && dmgType < kDmgMax && actor->hasX() && actor->x().locked != 1) { - int type = actor->s().type; + int type = actor->spr.type; if (type >= kThingBase && type < kThingMax) return (thingInfo[type - kThingBase].dmgControl[dmgType] <= minScale); else if (actor->IsDudeActor()) @@ -171,12 +171,12 @@ bool CanMove(DBloodActor* actor, DBloodActor* target, int nAngle, int nRange) auto Lower = pSector->lowerLink; if (Upper != nullptr) { - if (Upper->s().type == kMarkerUpWater || Upper->s().type == kMarkerUpGoo) + if (Upper->spr.type == kMarkerUpWater || Upper->spr.type == kMarkerUpGoo) Water = Depth = 1; } if (Lower != nullptr) { - if (Lower->s().type == kMarkerLowWater || Lower->s().type == kMarkerLowGoo) + if (Lower->spr.type == kMarkerLowWater || Lower->spr.type == kMarkerLowGoo) Depth = 1; } switch (pSprite->type) { @@ -1734,7 +1734,7 @@ void aiInitSprite(DBloodActor* actor) if (gModernMap) { // must keep it in case of loading save - if (pXSprite->dudeFlag4 && actor->GetTarget() && actor->GetTarget()->s().type == kMarkerPath) + if (pXSprite->dudeFlag4 && actor->GetTarget() && actor->GetTarget()->spr.type == kMarkerPath) { stateTimer = pXSprite->stateTimer; pTargetMarker = actor->GetTarget(); @@ -1968,7 +1968,7 @@ void aiInitSprite(DBloodActor* actor) // make dude follow the markers bool uwater = spriteIsUnderwater(actor); - if (actor->GetTarget() == nullptr || actor->GetTarget()->s().type != kMarkerPath) + if (actor->GetTarget() == nullptr || actor->GetTarget()->spr.type != kMarkerPath) { actor->SetTarget(nullptr); aiPatrolSetMarker(actor); diff --git a/source/games/blood/src/aibeast.cpp b/source/games/blood/src/aibeast.cpp index 6707e7f00..05e93d41e 100644 --- a/source/games/blood/src/aibeast.cpp +++ b/source/games/blood/src/aibeast.cpp @@ -269,7 +269,7 @@ static void beastThinkChase(DBloodActor* actor) aiNewState(actor, &beastStomp); break; case 3: - if (pSprite->type != gHitInfo.actor()->s().type) + if (pSprite->type != gHitInfo.actor()->spr.type) { if (!pXSector || !pXSector->Underwater) aiNewState(actor, &beastStomp); @@ -301,7 +301,7 @@ static void beastThinkChase(DBloodActor* actor) aiNewState(actor, &beastSlash); break; case 3: - if (pSprite->type != gHitInfo.actor()->s().type) + if (pSprite->type != gHitInfo.actor()->spr.type) { if (pXSector && pXSector->Underwater) aiNewState(actor, &beastSwimSlash); diff --git a/source/games/blood/src/aicaleb.cpp b/source/games/blood/src/aicaleb.cpp index c7d3ec8f0..30f8d0a73 100644 --- a/source/games/blood/src/aicaleb.cpp +++ b/source/games/blood/src/aicaleb.cpp @@ -176,7 +176,7 @@ static void calebThinkChase(DBloodActor* actor) aiNewState(actor, &tinycalebAttack); break; case 3: - if (pSprite->type != gHitInfo.actor()->s().type) + if (pSprite->type != gHitInfo.actor()->spr.type) { if (pXSector && pXSector->Underwater) aiNewState(actor, &tinycalebSwimAttack); diff --git a/source/games/blood/src/aicerber.cpp b/source/games/blood/src/aicerber.cpp index dd86d83dc..d47a131d9 100644 --- a/source/games/blood/src/aicerber.cpp +++ b/source/games/blood/src/aicerber.cpp @@ -424,7 +424,7 @@ static void cerberusThinkChase(DBloodActor* actor) aiNewState(actor, &cerberusBite); break; case 3: - if (pSprite->type != gHitInfo.actor()->s().type && gHitInfo.actor()->s().type != kDudeHellHound) + if (pSprite->type != gHitInfo.actor()->spr.type && gHitInfo.actor()->spr.type != kDudeHellHound) aiNewState(actor, &cerberusBite); break; case 0: @@ -441,7 +441,7 @@ static void cerberusThinkChase(DBloodActor* actor) aiNewState(actor, &cerberus2Bite); break; case 3: - if (pSprite->type != gHitInfo.actor()->s().type && gHitInfo.actor()->s().type != kDudeHellHound) + if (pSprite->type != gHitInfo.actor()->spr.type && gHitInfo.actor()->spr.type != kDudeHellHound) aiNewState(actor, &cerberus2Bite); break; case 0: diff --git a/source/games/blood/src/aicult.cpp b/source/games/blood/src/aicult.cpp index 909bd6494..cefeaa801 100644 --- a/source/games/blood/src/aicult.cpp +++ b/source/games/blood/src/aicult.cpp @@ -182,7 +182,7 @@ static bool TargetNearExplosion(spritetype* pSprite) BloodSectIterator it(pSprite->sector()); while (auto actor = it.Next()) { - if (actor->s().type == kThingArmedTNTStick || actor->s().statnum == kStatExplosion) + if (actor->spr.type == kThingArmedTNTStick || actor->spr.statnum == kStatExplosion) return true; } return false; @@ -307,7 +307,7 @@ static void cultThinkChase(DBloodActor* actor) case 4: break; case 3: - if (pSprite->type != gHitInfo.actor()->s().type && gHitInfo.actor()->s().type != kDudeCultistShotgun && pXSprite->medium != kMediumWater && pXSprite->medium != kMediumGoo) + if (pSprite->type != gHitInfo.actor()->spr.type && gHitInfo.actor()->spr.type != kDudeCultistShotgun && pXSprite->medium != kMediumWater && pXSprite->medium != kMediumGoo) aiNewState(actor, &cultistTThrow); break; default: @@ -329,7 +329,7 @@ static void cultThinkChase(DBloodActor* actor) aiNewState(actor, &cultistTSwimFire); break; case 3: - if (pSprite->type != gHitInfo.actor()->s().type && gHitInfo.actor()->s().type != kDudeCultistShotgun) + if (pSprite->type != gHitInfo.actor()->spr.type && gHitInfo.actor()->spr.type != kDudeCultistShotgun) { if (!dudeIsPlayingSeq(actor, 14) && pXSprite->medium == kMediumNormal) aiNewState(actor, &cultistTFire); @@ -375,7 +375,7 @@ static void cultThinkChase(DBloodActor* actor) case 4: break; case 3: - if (pSprite->type != gHitInfo.actor()->s().type && gHitInfo.actor()->s().type != kDudeCultistShotgun && pXSprite->medium != kMediumWater && pXSprite->medium != kMediumGoo) + if (pSprite->type != gHitInfo.actor()->spr.type && gHitInfo.actor()->spr.type != kDudeCultistShotgun && pXSprite->medium != kMediumWater && pXSprite->medium != kMediumGoo) aiNewState(actor, &cultistSThrow); break; default: @@ -397,7 +397,7 @@ static void cultThinkChase(DBloodActor* actor) aiNewState(actor, &cultistSSwimFire); break; case 3: - if (pSprite->type != gHitInfo.actor()->s().type && gHitInfo.actor()->s().type != kDudeCultistTommy) + if (pSprite->type != gHitInfo.actor()->spr.type && gHitInfo.actor()->spr.type != kDudeCultistTommy) { if (!dudeIsPlayingSeq(actor, 14) && pXSprite->medium == kMediumNormal) aiNewState(actor, &cultistSFire); @@ -443,7 +443,7 @@ static void cultThinkChase(DBloodActor* actor) case 4: break; case 3: - if (pSprite->type != gHitInfo.actor()->s().type && gHitInfo.actor()->s().type != kDudeCultistShotgun && pXSprite->medium != kMediumWater && pXSprite->medium != kMediumGoo) + if (pSprite->type != gHitInfo.actor()->spr.type && gHitInfo.actor()->spr.type != kDudeCultistShotgun && pXSprite->medium != kMediumWater && pXSprite->medium != kMediumGoo) aiNewState(actor, &cultistTsThrow); break; default: @@ -465,7 +465,7 @@ static void cultThinkChase(DBloodActor* actor) aiNewState(actor, &cultistTsSwimFire); break; case 3: - if (pSprite->type != gHitInfo.actor()->s().type && gHitInfo.actor()->s().type != kDudeCultistTommy) + if (pSprite->type != gHitInfo.actor()->spr.type && gHitInfo.actor()->spr.type != kDudeCultistTommy) { if (!dudeIsPlayingSeq(actor, 14) && pXSprite->medium == kMediumNormal) aiNewState(actor, &cultistTsFire); @@ -509,7 +509,7 @@ static void cultThinkChase(DBloodActor* actor) case 4: break; case 3: - if (pSprite->type != gHitInfo.actor()->s().type && gHitInfo.actor()->s().type != kDudeCultistShotgun && pXSprite->medium != kMediumWater && pXSprite->medium != kMediumGoo) + if (pSprite->type != gHitInfo.actor()->spr.type && gHitInfo.actor()->spr.type != kDudeCultistShotgun && pXSprite->medium != kMediumWater && pXSprite->medium != kMediumGoo) aiNewState(actor, &cultistDThrow); break; default: @@ -530,7 +530,7 @@ static void cultThinkChase(DBloodActor* actor) case 4: break; case 3: - if (pSprite->type != gHitInfo.actor()->s().type && gHitInfo.actor()->s().type != kDudeCultistShotgun && pXSprite->medium != kMediumWater && pXSprite->medium != kMediumGoo) + if (pSprite->type != gHitInfo.actor()->spr.type && gHitInfo.actor()->spr.type != kDudeCultistShotgun && pXSprite->medium != kMediumWater && pXSprite->medium != kMediumGoo) aiNewState(actor, &cultist139A78); break; default: @@ -555,7 +555,7 @@ static void cultThinkChase(DBloodActor* actor) case 4: break; case 3: - if (pSprite->type != gHitInfo.actor()->s().type && gHitInfo.actor()->s().type != kDudeCultistShotgun && pXSprite->medium != kMediumWater && pXSprite->medium != kMediumGoo) + if (pSprite->type != gHitInfo.actor()->spr.type && gHitInfo.actor()->spr.type != kDudeCultistShotgun && pXSprite->medium != kMediumWater && pXSprite->medium != kMediumGoo) aiNewState(actor, &cultistSThrow); break; default: @@ -577,7 +577,7 @@ static void cultThinkChase(DBloodActor* actor) aiNewState(actor, &cultistSSwimFire); break; case 3: - if (pSprite->type != gHitInfo.actor()->s().type && gHitInfo.actor()->s().type != kDudeCultistTommy) + if (pSprite->type != gHitInfo.actor()->spr.type && gHitInfo.actor()->spr.type != kDudeCultistTommy) { if (!dudeIsPlayingSeq(actor, 14) && pXSprite->medium == kMediumNormal) aiNewState(actor, &cultistSFire); diff --git a/source/games/blood/src/aigarg.cpp b/source/games/blood/src/aigarg.cpp index 31759ddfd..b518c2977 100644 --- a/source/games/blood/src/aigarg.cpp +++ b/source/games/blood/src/aigarg.cpp @@ -404,7 +404,7 @@ static void gargThinkChase(DBloodActor* actor) case 4: break; case 3: - if (pSprite->type != gHitInfo.actor()->s().type && gHitInfo.actor()->s().type != kDudeGargoyleStone) + if (pSprite->type != gHitInfo.actor()->spr.type && gHitInfo.actor()->spr.type != kDudeGargoyleStone) { sfxPlay3DSound(actor, 1408, 0, 0); aiNewState(actor, &gargoyleFThrow); @@ -429,7 +429,7 @@ static void gargThinkChase(DBloodActor* actor) case 4: break; case 3: - if (pSprite->type != gHitInfo.actor()->s().type && gHitInfo.actor()->s().type != kDudeGargoyleStone) + if (pSprite->type != gHitInfo.actor()->spr.type && gHitInfo.actor()->spr.type != kDudeGargoyleStone) { sfxPlay3DSound(actor, 1406, 0, 0); aiNewState(actor, &gargoyleFSlash); @@ -463,7 +463,7 @@ static void gargThinkChase(DBloodActor* actor) case 4: break; case 3: - if (pSprite->type != gHitInfo.actor()->s().type && gHitInfo.actor()->s().type != kDudeGargoyleFlesh) + if (pSprite->type != gHitInfo.actor()->spr.type && gHitInfo.actor()->spr.type != kDudeGargoyleFlesh) { sfxPlay3DSound(actor, 1457, 0, 0); aiNewState(actor, &gargoyleSBlast); @@ -487,7 +487,7 @@ static void gargThinkChase(DBloodActor* actor) case 4: break; case 3: - if (pSprite->type != gHitInfo.actor()->s().type && gHitInfo.actor()->s().type != kDudeGargoyleFlesh) + if (pSprite->type != gHitInfo.actor()->spr.type && gHitInfo.actor()->spr.type != kDudeGargoyleFlesh) aiNewState(actor, &gargoyleFSlash); break; default: diff --git a/source/games/blood/src/aighost.cpp b/source/games/blood/src/aighost.cpp index 509df4dc1..21dd4faf3 100644 --- a/source/games/blood/src/aighost.cpp +++ b/source/games/blood/src/aighost.cpp @@ -381,7 +381,7 @@ static void ghostThinkChase(DBloodActor* actor) case 4: break; case 3: - if (pSprite->type != gHitInfo.actor()->s().type && gHitInfo.actor()->s().type != kDudePhantasm) + if (pSprite->type != gHitInfo.actor()->spr.type && gHitInfo.actor()->spr.type != kDudePhantasm) aiNewState(actor, &ghostBlast); break; default: @@ -401,7 +401,7 @@ static void ghostThinkChase(DBloodActor* actor) case 4: break; case 3: - if (pSprite->type != gHitInfo.actor()->s().type && gHitInfo.actor()->s().type != kDudePhantasm) + if (pSprite->type != gHitInfo.actor()->spr.type && gHitInfo.actor()->spr.type != kDudePhantasm) aiNewState(actor, &ghostSlash); break; default: diff --git a/source/games/blood/src/aigilbst.cpp b/source/games/blood/src/aigilbst.cpp index b23d40071..9429df367 100644 --- a/source/games/blood/src/aigilbst.cpp +++ b/source/games/blood/src/aigilbst.cpp @@ -165,7 +165,7 @@ static void gillThinkChase(DBloodActor* actor) aiNewState(actor, &gillBeastBite); break; case 3: - if (pSprite->type != gHitInfo.actor()->s().type) + if (pSprite->type != gHitInfo.actor()->spr.type) { if (pXSector && pXSector->Underwater) aiNewState(actor, &gillBeastSwimBite); diff --git a/source/games/blood/src/aiunicult.cpp b/source/games/blood/src/aiunicult.cpp index fc5d0478a..3e936f119 100644 --- a/source/games/blood/src/aiunicult.cpp +++ b/source/games/blood/src/aiunicult.cpp @@ -1494,7 +1494,7 @@ DBloodActor* getNextIncarnation(DBloodActor* actor) { if (!rxBucket[i].isActor()) continue; auto rxactor = rxBucket[i].actor(); - if (actor != rxactor && rxactor->s().statnum == kStatInactive) return rxactor; + if (actor != rxactor && rxactor->spr.statnum == kStatInactive) return rxactor; } return nullptr; } @@ -1623,7 +1623,7 @@ static void scaleDamage(DBloodActor* actor) } // take in account yrepeat of sprite - int yrepeat = actor->s().yrepeat; + int yrepeat = actor->spr.yrepeat; if (yrepeat < 64) { for (int i = 0; i < kDmgMax; i++) curScale[i] += (64 - yrepeat); @@ -1634,7 +1634,7 @@ static void scaleDamage(DBloodActor* actor) } // take surface type into account - int surfType = tileGetSurfType(actor->s().picnum); + int surfType = tileGetSurfType(actor->spr.picnum); switch (surfType) { case 1: // stone @@ -2518,7 +2518,7 @@ bool genDudePrepare(DBloodActor* actor, int propId) BloodStatIterator it(kStatThing); while (auto actor2 = it.Next()) { - if (actor2->GetOwner() == actor && actor2->s().type == kModernThingEnemyLifeLeech) { + if (actor2->GetOwner() == actor && actor2->spr.type == kModernThingEnemyLifeLeech) { pExtra->pLifeLeech = actor2; break; } diff --git a/source/games/blood/src/aizombf.cpp b/source/games/blood/src/aizombf.cpp index 7fdffb99b..6aff27810 100644 --- a/source/games/blood/src/aizombf.cpp +++ b/source/games/blood/src/aizombf.cpp @@ -152,7 +152,7 @@ static void zombfThinkChase(DBloodActor* actor) aiNewState(actor, &zombieFThrow); break; case 3: - if (pSprite->type != gHitInfo.actor()->s().type) + if (pSprite->type != gHitInfo.actor()->spr.type) aiNewState(actor, &zombieFThrow); else aiNewState(actor, &zombieFDodge); @@ -171,7 +171,7 @@ static void zombfThinkChase(DBloodActor* actor) aiNewState(actor, &zombieFPuke); break; case 3: - if (pSprite->type != gHitInfo.actor()->s().type) + if (pSprite->type != gHitInfo.actor()->spr.type) aiNewState(actor, &zombieFPuke); else aiNewState(actor, &zombieFDodge); @@ -190,7 +190,7 @@ static void zombfThinkChase(DBloodActor* actor) aiNewState(actor, &zombieFHack); break; case 3: - if (pSprite->type != gHitInfo.actor()->s().type) + if (pSprite->type != gHitInfo.actor()->spr.type) aiNewState(actor, &zombieFHack); else aiNewState(actor, &zombieFDodge); diff --git a/source/games/blood/src/animatesprite.cpp b/source/games/blood/src/animatesprite.cpp index dbe95c5e5..72aec545f 100644 --- a/source/games/blood/src/animatesprite.cpp +++ b/source/games/blood/src/animatesprite.cpp @@ -521,7 +521,7 @@ void viewProcessSprites(tspritetype* tsprite, int& spritesortcnt, int32_t cX, in tspritetype *pTSprite = &tsprite[nTSprite]; auto owneractor = static_cast(pTSprite->ownerActor); XSPRITE *pTXSprite = NULL; - if (owneractor->s().detail > gDetail) + if (owneractor->spr.detail > gDetail) { pTSprite->xrepeat = 0; continue; @@ -694,7 +694,7 @@ void viewProcessSprites(tspritetype* tsprite, int& spritesortcnt, int32_t cX, in } nShade += tileShade[pTSprite->picnum]; pTSprite->shade = ClipRange(nShade, -128, 127); - if ((pTSprite->flags&kHitagRespawn) && pTSprite->ownerActor->s().owner == 3) // Where does this 3 come from? Nothing sets it. + if ((pTSprite->flags&kHitagRespawn) && pTSprite->ownerActor->spr.owner == 3) // Where does this 3 come from? Nothing sets it. { assert(pTXSprite != NULL); pTSprite->xrepeat = 48; diff --git a/source/games/blood/src/blood.cpp b/source/games/blood/src/blood.cpp index 7658cfa4e..bdb2b9e21 100644 --- a/source/games/blood/src/blood.cpp +++ b/source/games/blood/src/blood.cpp @@ -158,13 +158,13 @@ void PropagateMarkerReferences(void) BloodStatIterator it(kStatMarker); while (auto actor = it.Next()) { - switch (actor->s().type) + switch (actor->spr.type) { case kMarkerOff: case kMarkerAxis: case kMarkerWarpDest: { - int nOwner = actor->s().owner; + int nOwner = actor->spr.owner; if (validSectorIndex(nOwner)) { if (sector[nOwner].hasX()) @@ -177,7 +177,7 @@ void PropagateMarkerReferences(void) break; case kMarkerOn: { - int nOwner = actor->s().owner; + int nOwner = actor->spr.owner; if (validSectorIndex(nOwner)) { if (sector[nOwner].hasX()) diff --git a/source/games/blood/src/callback.cpp b/source/games/blood/src/callback.cpp index 185f84d18..d01175e36 100644 --- a/source/games/blood/src/callback.cpp +++ b/source/games/blood/src/callback.cpp @@ -164,7 +164,7 @@ void fxBloodSpurt(DBloodActor* actor, sectortype*) // 6 auto pFX = gFX.fxSpawnActor(FX_27, pSprite->sector(), pSprite->x, pSprite->y, pSprite->z, 0); if (pFX) { - pFX->s().ang = 0; + pFX->spr.ang = 0; pFX->xvel = actor->xvel>>8; pFX->yvel = actor->yvel>>8; pFX->zvel = actor->zvel>>8; @@ -362,7 +362,7 @@ void CounterCheck(DBloodActor*, sectortype* pSector) // 12 BloodSectIterator it(pSector); while (auto actor = it.Next()) { - if (actor->s().type == nType) nCount++; + if (actor->spr.type == nType) nCount++; } if (nCount < nReq) { @@ -408,7 +408,7 @@ void fxBloodBits(DBloodActor* actor, sectortype*) // 14 { auto pFX = gFX.fxSpawnActor(FX_36, pSprite->sector(), x, y, floorZ-64, 0); if (pFX) - pFX->s().ang = nAngle; + pFX->spr.ang = nAngle; } gFX.remove(actor); } @@ -532,7 +532,7 @@ void fxPodBloodSpray(DBloodActor* actor, sectortype*) // 18 pFX = gFX.fxSpawnActor(FX_54, pSprite->sector(), pSprite->x, pSprite->y, pSprite->z, 0); if (pFX) { - pFX->s().ang = 0; + pFX->spr.ang = 0; pFX->xvel = actor->xvel >> 8; pFX->yvel = actor->yvel >> 8; pFX->zvel = actor->zvel >> 8; @@ -567,13 +567,13 @@ void fxPodBloodSplat(DBloodActor* actor, sectortype*) // 19 if (Chance(0x500) || pSprite->type == kThingPodGreenBall) pFX = gFX.fxSpawnActor(FX_55, pSprite->sector(), x, y, floorZ-64, 0); if (pFX) - pFX->s().ang = nAngle; + pFX->spr.ang = nAngle; } else { pFX = gFX.fxSpawnActor(FX_32, pSprite->sector(), x, y, floorZ-64, 0); if (pFX) - pFX->s().ang = nAngle; + pFX->spr.ang = nAngle; } gFX.remove(actor); } diff --git a/source/games/blood/src/eventq.cpp b/source/games/blood/src/eventq.cpp index ffa192a73..cbac18fd6 100644 --- a/source/games/blood/src/eventq.cpp +++ b/source/games/blood/src/eventq.cpp @@ -493,7 +493,7 @@ void evSend(EventObject& eob, int rxId, COMMAND_ID command) { auto actor = eo.actor(); - if (actor && actor->hasX() && !(actor->s().flags & 32)) + if (actor && actor->hasX() && !(actor->spr.flags & 32)) { if (actor->x().rxID > 0) trMessageSprite(actor, event); @@ -638,7 +638,7 @@ void evProcess(unsigned int time) if (event.target.isActor()) { // Don't call events on destroyed actors. Seems to happen occasionally. - if (!event.target.actor() || event.target.actor()->s().statnum == kStatFree) continue; + if (!event.target.actor() || event.target.actor()->spr.statnum == kStatFree) continue; } if (event.cmd == kCmdCallback) diff --git a/source/games/blood/src/fx.cpp b/source/games/blood/src/fx.cpp index 078aade25..89ebb5d70 100644 --- a/source/games/blood/src/fx.cpp +++ b/source/games/blood/src/fx.cpp @@ -155,7 +155,7 @@ DBloodActor* CFX::fxSpawnActor(FX_ID nFx, sectortype* pSector, int x, int y, int { BloodStatIterator it(kStatFX); auto iactor = it.Next(); - while (iactor && (iactor->s().flags & 32)) + while (iactor && (iactor->spr.flags & 32)) iactor = it.Next(); if (!iactor) return nullptr; @@ -266,7 +266,7 @@ void fxSpawnBlood(DBloodActor *actor, int ) auto bloodactor = gFX.fxSpawnActor(FX_27, pSprite->sector(), pSprite->x, pSprite->y, pSprite->z, 0); if (bloodactor) { - bloodactor->s().ang = 1024; + bloodactor->spr.ang = 1024; bloodactor->xvel = Random2(0x6aaaa); bloodactor->yvel = Random2(0x6aaaa); bloodactor->zvel = -(int)Random(0x10aaaa)-100; @@ -291,7 +291,7 @@ void fxSpawnPodStuff(DBloodActor* actor, int ) spawnactor = gFX.fxSpawnActor(FX_54, pSprite->sector(), pSprite->x, pSprite->y, pSprite->z, 0); if (spawnactor) { - spawnactor->s().ang = 1024; + spawnactor->spr.ang = 1024; spawnactor->xvel = Random2(0x6aaaa); spawnactor->yvel = Random2(0x6aaaa); spawnactor->zvel = -(int)Random(0x10aaaa)-100; @@ -310,7 +310,7 @@ void fxSpawnEjectingBrass(DBloodActor* actor, int z, int a3, int a4) if (pBrass) { if (!VanillaMode()) - pBrass->s().ang = Random(2047); + pBrass->spr.ang = Random(2047); int nDist = (a4 << 18) / 120 + Random2(((a4 / 4) << 18) / 120); int nAngle = pSprite->ang + Random2(56) + 512; pBrass->xvel = MulScale(nDist, Cos(nAngle), 30); @@ -330,7 +330,7 @@ void fxSpawnEjectingShell(DBloodActor* actor, int z, int a3, int a4) if (pShell) { if (!VanillaMode()) - pShell->s().ang = Random(2047); + pShell->spr.ang = Random(2047); int nDist = (a4 << 18) / 120 + Random2(((a4 / 4) << 18) / 120); int nAngle = pSprite->ang + Random2(56) + 512; pShell->xvel = MulScale(nDist, Cos(nAngle), 30); diff --git a/source/games/blood/src/gameutil.cpp b/source/games/blood/src/gameutil.cpp index 4273dab89..8d67e3af1 100644 --- a/source/games/blood/src/gameutil.cpp +++ b/source/games/blood/src/gameutil.cpp @@ -527,11 +527,11 @@ int VectorScan(DBloodActor *actor, int nOffset, int nZOffset, int dx, int dy, in if (!actor) return 2; auto link = actor->GetOwner(); gHitInfo.clearObj(); - x1 = gHitInfo.hitpos.x + link->s().x - actor->s().x; - y1 = gHitInfo.hitpos.y + link->s().y - actor->s().y; - z1 = gHitInfo.hitpos.z + link->s().z - actor->s().z; + x1 = gHitInfo.hitpos.x + link->spr.x - actor->spr.x; + y1 = gHitInfo.hitpos.y + link->spr.y - actor->spr.y; + z1 = gHitInfo.hitpos.z + link->spr.z - actor->spr.z; pos = { x1, y1, z1 }; - hitscan(pos, link->s().sector(), { dx, dy, dz << 4 }, gHitInfo, CLIPMASK1); + hitscan(pos, link->spr.sector(), { dx, dy, dz << 4 }, gHitInfo, CLIPMASK1); continue; } @@ -541,11 +541,11 @@ int VectorScan(DBloodActor *actor, int nOffset, int nZOffset, int dx, int dy, in if (!actor) return 1; auto link = actor->GetOwner(); gHitInfo.clearObj(); - x1 = gHitInfo.hitpos.x + link->s().x - actor->s().x; - y1 = gHitInfo.hitpos.y + link->s().y - actor->s().y; - z1 = gHitInfo.hitpos.z + link->s().z - actor->s().z; + x1 = gHitInfo.hitpos.x + link->spr.x - actor->spr.x; + y1 = gHitInfo.hitpos.y + link->spr.y - actor->spr.y; + z1 = gHitInfo.hitpos.z + link->spr.z - actor->spr.z; pos = { x1, y1, z1 }; - hitscan(pos, link->s().sector(), { dx, dy, dz << 4 }, gHitInfo, CLIPMASK1); + hitscan(pos, link->spr.sector(), { dx, dy, dz << 4 }, gHitInfo, CLIPMASK1); continue; } } @@ -578,9 +578,9 @@ void GetZRange(DBloodActor *actor, int *ceilZ, Collision *ceilColl, int *floorZ, if (actor) { auto link = actor->GetOwner(); - vec3_t lpos = pSprite->pos + link->s().pos - actor->s().pos; - getzrange(lpos, link->s().sector(), &nTemp1, scratch, (int32_t*)floorZ, *floorColl, nDist, nMask); - *floorZ -= link->s().z - actor->s().z; + vec3_t lpos = pSprite->pos + link->spr.pos - actor->spr.pos; + getzrange(lpos, link->spr.sector(), &nTemp1, scratch, (int32_t*)floorZ, *floorColl, nDist, nMask); + *floorZ -= link->spr.z - actor->spr.z; } } if (ceilColl->type == kHitSector) @@ -592,9 +592,9 @@ void GetZRange(DBloodActor *actor, int *ceilZ, Collision *ceilColl, int *floorZ, if (actor) { auto link = actor->GetOwner(); - vec3_t lpos = pSprite->pos + link->s().pos - actor->s().pos; - getzrange(lpos, link->s().sector(), (int32_t*)ceilZ, *ceilColl, &nTemp1, scratch, nDist, nMask); - *ceilZ -= link->s().z - actor->s().z; + vec3_t lpos = pSprite->pos + link->spr.pos - actor->spr.pos; + getzrange(lpos, link->spr.sector(), (int32_t*)ceilZ, *ceilColl, &nTemp1, scratch, nDist, nMask); + *ceilZ -= link->spr.z - actor->spr.z; } } pSprite->cstat = bakCstat; @@ -620,9 +620,9 @@ void GetZRangeAtXYZ(int x, int y, int z, sectortype* pSector, int *ceilZ, Collis if (actor) { auto link = actor->GetOwner(); - vec3_t newpos = lpos + link->s().pos - actor->s().pos; - getzrange(newpos, link->s().sector(), &nTemp1, scratch, (int32_t*)floorZ, *floorColl, nDist, nMask); - *floorZ -= link->s().z - actor->s().z; + vec3_t newpos = lpos + link->spr.pos - actor->spr.pos; + getzrange(newpos, link->spr.sector(), &nTemp1, scratch, (int32_t*)floorZ, *floorColl, nDist, nMask); + *floorZ -= link->spr.z - actor->spr.z; } } if (ceilColl->type == kHitSector) @@ -634,9 +634,9 @@ void GetZRangeAtXYZ(int x, int y, int z, sectortype* pSector, int *ceilZ, Collis if (actor) { auto link = actor->GetOwner(); - vec3_t newpos = lpos + link->s().pos - actor->s().pos; - getzrange(newpos, link->s().sector(), (int32_t*)ceilZ, *ceilColl, &nTemp1, scratch, nDist, nMask); - *ceilZ -= link->s().z - actor->s().z; + vec3_t newpos = lpos + link->spr.pos - actor->spr.pos; + getzrange(newpos, link->spr.sector(), (int32_t*)ceilZ, *ceilColl, &nTemp1, scratch, nDist, nMask); + *ceilZ -= link->spr.z - actor->spr.z; } } } diff --git a/source/games/blood/src/gib.cpp b/source/games/blood/src/gib.cpp index c58706ebc..4b1d39da0 100644 --- a/source/games/blood/src/gib.cpp +++ b/source/games/blood/src/gib.cpp @@ -292,7 +292,7 @@ void GibFX(DBloodActor* actor, GIBFX *pGFX, CGibPosition *pPos, CGibVelocity *pV if (pFX) { if (pGFX->at1 < 0) - pFX->s().pal = pSprite->pal; + pFX->spr.pal = pSprite->pal; if (pVel) { pFX->xvel = pVel->vx+Random2(pGFX->atd); @@ -409,7 +409,7 @@ void GibSprite(DBloodActor* actor, GIBTYPE nGibType, CGibPosition *pPos, CGibVel assert(actor != NULL); assert(nGibType >= 0 && nGibType < kGibMax); - if (!actor->s().insector()) + if (!actor->spr.insector()) return; GIBLIST *pGib = &gibList[nGibType]; for (int i = 0; i < pGib->Kills; i++) @@ -440,7 +440,7 @@ void GibFX(walltype* pWall, GIBFX * pGFX, int a3, int a4, int a5, int a6, CGibVe if (pGib) { if (pGFX->at1 < 0) - pGib->s().pal = pWall->pal; + pGib->spr.pal = pWall->pal; if (!pVel) { pGib->xvel = Random2((pGFX->atd<<18)/120); diff --git a/source/games/blood/src/mirrors.cpp b/source/games/blood/src/mirrors.cpp index a23e54e39..585884512 100644 --- a/source/games/blood/src/mirrors.cpp +++ b/source/games/blood/src/mirrors.cpp @@ -120,14 +120,14 @@ void InitMirrors(void) if (link2 == nullptr) continue; - auto sectj = link2->s().sector(); + auto sectj = link2->spr.sector(); int j = sectnum(sectj); 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->s().x - link->s().x; - mirror[mirrorcnt].dy = link2->s().y - link->s().y; - mirror[mirrorcnt].dz = link2->s().z - link->s().z; + mirror[mirrorcnt].dx = link2->spr.x - link->spr.x; + mirror[mirrorcnt].dy = link2->spr.y - link->spr.y; + mirror[mirrorcnt].dz = link2->spr.z - link->spr.z; mirror[mirrorcnt].wallnum = i; mirror[mirrorcnt].link = j; secti->floorpicnum = 4080 + mirrorcnt; @@ -135,9 +135,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->s().x - link2->s().x; - mirror[mirrorcnt].dy = link->s().y - link2->s().y; - mirror[mirrorcnt].dz = link->s().z - link2->s().z; + mirror[mirrorcnt].dx = link->spr.x - link2->spr.x; + mirror[mirrorcnt].dy = link->spr.y - link2->spr.y; + mirror[mirrorcnt].dz = link->spr.z - link2->spr.z; mirror[mirrorcnt].wallnum = j; mirror[mirrorcnt].link = i; sectj->ceilingpicnum = 4080 + mirrorcnt; diff --git a/source/games/blood/src/nnexts.cpp b/source/games/blood/src/nnexts.cpp index a570d9a44..18ce56fb6 100644 --- a/source/games/blood/src/nnexts.cpp +++ b/source/games/blood/src/nnexts.cpp @@ -1229,10 +1229,10 @@ void nnExtProcessSuperSprites() pXSightSpr->isTriggered) continue; // don't process locked or triggered sprites // sprite is drawn for one of players - if ((pXSightSpr->unused3 & kTriggerSpriteScreen) && (pSight->s().cstat2 & CSTAT2_SPRITE_MAPPED)) + if ((pXSightSpr->unused3 & kTriggerSpriteScreen) && (pSight->spr.cstat2 & CSTAT2_SPRITE_MAPPED)) { trTriggerSprite(pSight, kCmdSpriteSight); - pSight->s().cstat2 &= ~CSTAT2_SPRITE_MAPPED; + pSight->spr.cstat2 &= ~CSTAT2_SPRITE_MAPPED; continue; } @@ -1821,7 +1821,7 @@ void debrisMove(int listIndex) if ((pFX = gFX.fxSpawnActor(FX_10, pSprite->sector(), pSprite->x, pSprite->y, floorZ, 0)) == NULL) break; for (i = 0; i < 7; i++) { - if ((pFX2 = gFX.fxSpawnActor(FX_14, pFX->s().sector(), pFX->s().x, pFX->s().y, pFX->s().z, 0)) == NULL) continue; + if ((pFX2 = gFX.fxSpawnActor(FX_14, pFX->spr.sector(), pFX->spr.x, pFX->spr.y, pFX->spr.z, 0)) == NULL) continue; pFX2->xvel = Random2(0x6aaaa); pFX2->yvel = Random2(0x6aaaa); pFX2->zvel = -(int)Random(0xd5555); @@ -1870,10 +1870,10 @@ void debrisMove(int listIndex) else if (floorColl.type == kHitSprite) { - if ((floorColl.actor()->s().cstat & CSTAT_SPRITE_ALIGNMENT_MASK) == 0) + if ((floorColl.actor()->spr.cstat & CSTAT_SPRITE_ALIGNMENT_MASK) == 0) { - actor->xvel += MulScale(4, pSprite->x - floorColl.actor()->s().x, 2); - actor->yvel += MulScale(4, pSprite->y - floorColl.actor()->s().y, 2); + actor->xvel += MulScale(4, pSprite->x - floorColl.actor()->spr.x, 2); + actor->yvel += MulScale(4, pSprite->y - floorColl.actor()->spr.y, 2); return; } } @@ -1902,7 +1902,7 @@ bool ceilIsTooLow(DBloodActor* actor) { if (actor != nullptr) { - sectortype* pSector = actor->s().sector(); + sectortype* pSector = actor->spr.sector(); int a = pSector->ceilingz - pSector->floorz; int top, bottom; GetActorExtents(actor, &top, &bottom); @@ -1920,7 +1920,7 @@ bool ceilIsTooLow(DBloodActor* actor) void aiSetGenIdleState(DBloodActor* actor) { - switch (actor->s().type) + switch (actor->spr.type) { case kDudeModernCustom: case kDudeModernCustomBurning: @@ -2418,7 +2418,7 @@ void trPlayerCtrlUsePackItem(int data2, int data3, int data4, PLAYER* pPlayer, i void trPlayerCtrlUsePowerup(DBloodActor* sourceactor, PLAYER* pPlayer, int evCmd) { - bool relative = (sourceactor->s().flags & kModernTypeFlag1); + bool relative = (sourceactor->spr.flags & kModernTypeFlag1); int nPower = (kMinAllowedPowerup + sourceactor->x().data2) - 1; int nTime = ClipRange(abs(sourceactor->x().data3) * 100, -gPowerUpInfo[nPower].maxTime, gPowerUpInfo[nPower].maxTime); @@ -2480,7 +2480,7 @@ void useObjResizer(DBloodActor* sourceactor, int targType, sectortype* targSect, bool fit = false; auto pTarget = &targetactor->s(); // resize by seq scaling - if (sourceactor->s().flags & kModernTypeFlag1) + if (sourceactor->spr.flags & kModernTypeFlag1) { if (valueIsBetween(pXSource->data1, -255, 32767)) { @@ -3353,7 +3353,7 @@ void useSpriteDamager(DBloodActor* sourceactor, int objType, sectortype* targSec BloodStatIterator it(kStatDude); while (auto iactor = it.Next()) { - if (iactor->s().statnum != kStatDude) continue; + if (iactor->spr.statnum != kStatDude) continue; switch (pXSource->data1) { case 667: @@ -3772,7 +3772,7 @@ bool condCheckMixed(DBloodActor* aCond, const EVENT& event, int cmpOp, bool PUSH case 20: // type in a range? if (eob.isWall()) return condCmp(eob.wall()->type, arg1, arg2, cmpOp); if (eob.isSector()) return condCmp(eob.sector()->type, arg1, arg2, cmpOp); - if (eob.isActor()) return eob.actor() && condCmp(eob.actor()->s().type, arg1, arg2, cmpOp); + if (eob.isActor()) return eob.actor() && condCmp(eob.actor()->spr.type, arg1, arg2, cmpOp); break; case 24: case 25: case 26: case 27: @@ -4020,7 +4020,7 @@ bool condCheckSector(DBloodActor* aCond, int cmpOp, bool PUSH) BloodSectIterator it(pSect); while (auto iactor = it.Next()) { - if (!condCmp(iactor->s().type, arg1, arg2, cmpOp)) continue; + if (!condCmp(iactor->spr.type, arg1, arg2, cmpOp)) continue; else if (PUSH) condPush(aCond, iactor); return true; } @@ -4252,7 +4252,7 @@ bool condCheckDude(DBloodActor* aCond, int cmpOp, bool PUSH) default: break; case 0: // dude have any targets? if (!targ) return false; - else if (!targ->IsDudeActor() && targ->s().type != kMarkerPath) return false; + else if (!targ->IsDudeActor() && targ->spr.type != kMarkerPath) return false; else if (PUSH) condPush(aCond, targ); return true; case 1: return aiFightDudeIsAffected(objActor); // dude affected by ai fight? @@ -4298,7 +4298,7 @@ bool condCheckDude(DBloodActor* aCond, int cmpOp, bool PUSH) case 9: return (pXSpr->unused1 & kDudeFlagStealth); case 10: // check if the marker is busy with another dude case 11: // check if the marker is reached - if (!pXSpr->dudeFlag4 || !targ || targ->s().type != kMarkerPath) return false; + if (!pXSpr->dudeFlag4 || !targ || targ->spr.type != kMarkerPath) return false; switch (cond) { case 10: { @@ -4314,7 +4314,7 @@ bool condCheckDude(DBloodActor* aCond, int cmpOp, bool PUSH) } return true; case 12: // compare spot progress value in % - if (!pXSpr->dudeFlag4 || !targ || targ->s().type != kMarkerPath) var = 0; + if (!pXSpr->dudeFlag4 || !targ || targ->spr.type != kMarkerPath) var = 0; else if (!(pXSpr->unused1 & kDudeFlagStealth) || pXSpr->data3 < 0 || pXSpr->data3 > kMaxPatrolSpotValue) var = 0; else var = (kPercFull * pXSpr->data3) / kMaxPatrolSpotValue; return condCmp(var, arg1, arg2, cmpOp); @@ -4556,7 +4556,7 @@ bool condCheckSprite(DBloodActor* aCond, int cmpOp, bool PUSH) BloodSpriteIterator it; while (auto iactor = it.Next()) { - if (iactor->s().flags & kHitagRespawn) continue; + if (iactor->spr.flags & kHitagRespawn) continue; auto& hit = iactor->hit; switch (arg3) { @@ -4591,7 +4591,7 @@ bool condCheckSprite(DBloodActor* aCond, int cmpOp, bool PUSH) BloodStatIterator it(kStatFlare); while (auto flareactor = it.Next()) { - if (!flareactor->hasX() || (flareactor->s().flags & kHitagFree)) + if (!flareactor->hasX() || (flareactor->spr.flags & kHitagFree)) continue; if (flareactor->GetTarget() != objActor) continue; @@ -5034,7 +5034,7 @@ void aiFightFreeTargets(DBloodActor* actor) { if (!targetactor->IsDudeActor() || !targetactor->hasX()) continue; else if (targetactor->GetTarget() == actor) - aiSetTarget(targetactor, targetactor->s().x, targetactor->s().y, targetactor->s().z); + aiSetTarget(targetactor, targetactor->spr.x, targetactor->spr.y, targetactor->spr.z); } } @@ -5159,13 +5159,13 @@ void aiFightAlarmDudesInSight(DBloodActor* actor, int max) bool aiFightUnitCanFly(DBloodActor* dude) { - return (dude->IsDudeActor() && gDudeInfoExtra[dude->s().type - kDudeBase].flying); + return (dude->IsDudeActor() && gDudeInfoExtra[dude->spr.type - kDudeBase].flying); } bool aiFightIsMeleeUnit(DBloodActor* dude) { - if (dude->s().type == kDudeModernCustom) return (dude->hasX() && dudeIsMelee(dude)); - else return (dude->IsDudeActor() && gDudeInfoExtra[dude->s().type - kDudeBase].melee); + if (dude->spr.type == kDudeModernCustom) return (dude->hasX() && dudeIsMelee(dude)); + else return (dude->IsDudeActor() && gDudeInfoExtra[dude->spr.type - kDudeBase].melee); } //--------------------------------------------------------------------------- @@ -5176,8 +5176,8 @@ bool aiFightIsMeleeUnit(DBloodActor* dude) int aiFightGetTargetDist(DBloodActor* actor, DUDEINFO* pDudeInfo, DBloodActor* target) { - int dx = target->s().x - actor->s().x; - int dy = target->s().y - actor->s().y; + int dx = target->spr.x - actor->spr.x; + int dy = target->spr.y - actor->spr.y; int dist = approxDist(dx, dy); if (dist <= pDudeInfo->meleeDist) return 0; @@ -5204,8 +5204,8 @@ int aiFightGetTargetDist(DBloodActor* actor, DUDEINFO* pDudeInfo, DBloodActor* t int aiFightGetFineTargetDist(DBloodActor* actor, DBloodActor* target) { - int dx = target->s().x - actor->s().x; - int dy = target->s().y - actor->s().y; + int dx = target->spr.x - actor->spr.x; + int dy = target->spr.y - actor->spr.y; int dist = approxDist(dx, dy); return dist; @@ -5222,7 +5222,7 @@ void sectorKillSounds(sectortype* pSector) BloodSectIterator it(pSector); while (auto actor = it.Next()) { - if (actor->s().type != kSoundSector) continue; + if (actor->spr.type != kSoundSector) continue; sfxKill3DSound(actor); } } @@ -5409,13 +5409,13 @@ bool modernTypeOperateSector(sectortype* pSector, const EVENT& event) void useCustomDudeSpawn(DBloodActor* pSource, DBloodActor* pSprite) { - genDudeSpawn(pSource, pSprite, pSprite->s().clipdist << 1); + genDudeSpawn(pSource, pSprite, pSprite->spr.clipdist << 1); } void useDudeSpawn(DBloodActor* pSource, DBloodActor* pSprite) { - if (randomSpawnDude(pSource, pSprite, pSprite->s().clipdist << 1, 0) == nullptr) - nnExtSpawnDude(pSource, pSprite, pSource->x().data1, pSprite->s().clipdist << 1, 0); + if (randomSpawnDude(pSource, pSprite, pSprite->spr.clipdist << 1, 0) == nullptr) + nnExtSpawnDude(pSource, pSprite, pSource->x().data1, pSprite->spr.clipdist << 1, 0); } //--------------------------------------------------------------------------- @@ -6140,7 +6140,7 @@ int useCondition(DBloodActor* sourceactor, EVENT& event) if (event.isActor() && pActor == nullptr) return -1; if (event.isActor() && pActor != sourceactor) - srcIsCondition = (pActor->s().type == kModernCondition || pActor->s().type == kModernConditionFalse); + srcIsCondition = (pActor->spr.type == kModernCondition || pActor->spr.type == kModernConditionFalse); // if it's a tracking condition, it must ignore all the commands sent from objects if (pXSource->busyTime > 0 && event.funcID != kCallbackMax) return -1; @@ -6894,7 +6894,7 @@ void useTargetChanger(DBloodActor* sourceactor, DBloodActor* actor) // Make prev target not aim in dude if (targetactor) { - aiSetTarget(targetactor, targetactor->s().x, targetactor->s().y, targetactor->s().z); + aiSetTarget(targetactor, targetactor->spr.x, targetactor->spr.y, targetactor->spr.z); if (!isActive(newtargactor)) aiActivateDude(newtargactor); } @@ -7028,13 +7028,13 @@ void usePictureChanger(DBloodActor* sourceactor, int objType, sectortype* targSe break; case OBJ_SPRITE: if (valueIsBetween(pXSource->data1, -1, 32767)) - objActor->s().picnum = pXSource->data1; + objActor->spr.picnum = pXSource->data1; - if (pXSource->data2 >= 0) objActor->s().shade = (pXSource->data2 > 127) ? 127 : pXSource->data2; - else if (pXSource->data2 < -1) objActor->s().shade = (pXSource->data2 < -127) ? -127 : pXSource->data2; + if (pXSource->data2 >= 0) objActor->spr.shade = (pXSource->data2 > 127) ? 127 : pXSource->data2; + else if (pXSource->data2 < -1) objActor->spr.shade = (pXSource->data2 < -127) ? -127 : pXSource->data2; if (valueIsBetween(pXSource->data3, -1, 32767)) - objActor->s().pal = uint8_t(pXSource->data3); + objActor->spr.pal = uint8_t(pXSource->data3); break; case OBJ_WALL: if (valueIsBetween(pXSource->data1, -1, 32767)) @@ -7262,7 +7262,7 @@ PLAYER* getPlayerById(int id) bool IsBurningDude(DBloodActor* actor) { if (actor == NULL) return false; - switch (actor->s().type) + switch (actor->spr.type) { case kDudeBurningInnocent: case kDudeBurningCultist: @@ -7279,7 +7279,7 @@ bool IsBurningDude(DBloodActor* actor) bool IsKillableDude(DBloodActor* actor) { - switch (actor->s().type) + switch (actor->spr.type) { case kDudeGargoyleStatueFlesh: case kDudeGargoyleStatueStone: @@ -7292,14 +7292,14 @@ bool IsKillableDude(DBloodActor* actor) bool isGrown(DBloodActor* actor) { - if (powerupCheck(&gPlayer[actor->s().type - kDudePlayer1], kPwUpGrowShroom) > 0) return true; + if (powerupCheck(&gPlayer[actor->spr.type - kDudePlayer1], kPwUpGrowShroom) > 0) return true; else if (actor->hasX() && actor->x().scale >= 512) return true; else return false; } bool isShrinked(DBloodActor* actor) { - if (powerupCheck(&gPlayer[actor->s().type - kDudePlayer1], kPwUpShrinkShroom) > 0) return true; + if (powerupCheck(&gPlayer[actor->spr.type - kDudePlayer1], kPwUpShrinkShroom) > 0) return true; else if (actor->hasX() && actor->x().scale > 0 && actor->x().scale <= 128) return true; else return false; } @@ -7342,7 +7342,7 @@ int getDataFieldOfObject(EventObject &eob, int dataIndex) case 1: return actor->x().data1; case 2: return actor->x().data2; case 3: - switch (actor->s().type) + switch (actor->spr.type) { case kDudeModernCustom: return actor->x().sysData1; default: return actor->x().data3; @@ -7374,7 +7374,7 @@ int getDataFieldOfObject(int objType, sectortype* sect, walltype* wal, DBloodAct case 1: return actor->x().data1; case 2: return actor->x().data2; case 3: - switch (actor->s().type) + switch (actor->spr.type) { case kDudeModernCustom: return actor->x().sysData1; default: return actor->x().data3; @@ -7401,7 +7401,7 @@ bool setDataValueOfObject(int objType, sectortype* sect, walltype* wal, DBloodAc case OBJ_SPRITE: { XSPRITE* pXSprite = &objActor->x(); - int type = objActor->s().type; + int type = objActor->spr.type; // exceptions if (objActor->IsDudeActor() && pXSprite->health <= 0) return true; @@ -7668,7 +7668,7 @@ DBloodActor* aiPatrolMarkerBusy(DBloodActor* except, DBloodActor* marker) continue; auto targ = actor->GetTarget(); - if (actor->x().health > 0 && targ != nullptr && targ->s().type == kMarkerPath && targ == marker) + if (actor->x().health > 0 && targ != nullptr && targ->spr.type == kMarkerPath && targ == marker) return actor; } return nullptr; @@ -7687,7 +7687,7 @@ bool aiPatrolMarkerReached(DBloodActor* actor) const DUDEINFO_EXTRA* pExtra = &gDudeInfoExtra[pSprite->type - kDudeBase]; auto markeractor = actor->GetTarget(); - if (markeractor && markeractor->s().type == kMarkerPath) + if (markeractor && markeractor->spr.type == kMarkerPath) { spritetype* pMarker = &markeractor->s(); int okDist = ClipLow(pMarker->clipdist << 1, 4); @@ -7806,7 +7806,7 @@ void aiPatrolSetMarker(DBloodActor* actor) } } // set next marker - else if (targetactor->s().type == kMarkerPath && targetactor->hasX()) + else if (targetactor->spr.type == kMarkerPath && targetactor->hasX()) { // idea: which one of next (allowed) markers are closer to the potential target? // idea: -3 select random next marker that dude can see in radius of reached marker @@ -7898,9 +7898,9 @@ void aiPatrolStop(DBloodActor* actor, DBloodActor* targetactor, bool alarm) auto mytarget = actor->GetTarget(); - if (mytarget && mytarget->s().type == kMarkerPath) + if (mytarget && mytarget->spr.type == kMarkerPath) { - if (targetactor == nullptr) pSprite->ang = mytarget->s().ang & 2047; + if (targetactor == nullptr) pSprite->ang = mytarget->spr.ang & 2047; actor->SetTarget(nullptr); } @@ -7946,7 +7946,7 @@ void aiPatrolRandGoalAng(DBloodActor* actor) if (Chance(0x8000)) goal = -goal; - actor->x().goalAng = (actor->s().ang + goal) & 2047; + actor->x().goalAng = (actor->spr.ang + goal) & 2047; } //--------------------------------------------------------------------------- @@ -8301,15 +8301,15 @@ DBloodActor* aiPatrolSearchTargets(DBloodActor* actor) { auto emitterActor = (DBloodActor*)chan->Source; if (emitterActor == nullptr) return false; // not a valid source. - sndx = emitterActor->s().x; - sndy = emitterActor->s().y; + sndx = emitterActor->spr.x; + sndy = emitterActor->spr.y; // sound attached to the sprite if (pPlayer->actor != emitterActor && emitterActor->GetOwner() != actor) { - if (!emitterActor->s().insector()) return false; - searchsect = emitterActor->s().sector(); + if (!emitterActor->spr.insector()) return false; + searchsect = emitterActor->spr.sector(); } } else if (chan->SourceType == SOURCE_Unattached) @@ -8875,7 +8875,7 @@ DBloodActor* evrIsRedirector(DBloodActor* actor) { if (actor) { - switch (actor->s().type) + switch (actor->spr.type) { case kModernRandomTX: case kModernSequentialTX: @@ -8999,7 +8999,7 @@ void seqSpawnerOffSameTx(DBloodActor* actor) BloodSpriteIterator it; while (auto iactor = it.Next()) { - if (iactor->s().type != kModernSeqSpawner || !iactor->hasX() || iactor == actor) continue; + if (iactor->spr.type != kModernSeqSpawner || !iactor->hasX() || iactor == actor) continue; XSPRITE* pXSprite = &iactor->x(); if (pXSprite->txID == pXSource->txID && pXSprite->state == 1) { @@ -9091,8 +9091,8 @@ void callbackUniMissileBurst(DBloodActor* actor, sectortype*) // 22 void callbackMakeMissileBlocking(DBloodActor* actor, sectortype*) // 23 { - if (!actor || actor->s().statnum != kStatProjectile) return; - actor->s().cstat |= CSTAT_SPRITE_BLOCK; + if (!actor || actor->spr.statnum != kStatProjectile) return; + actor->spr.cstat |= CSTAT_SPRITE_BLOCK; } void callbackGenDudeUpdate(DBloodActor* actor, sectortype*) // 24 diff --git a/source/games/blood/src/player.cpp b/source/games/blood/src/player.cpp index b5750080e..b06af0596 100644 --- a/source/games/blood/src/player.cpp +++ b/source/games/blood/src/player.cpp @@ -671,7 +671,7 @@ void playerStart(int nPlayer, int bNewLevel) playerResetPosture(pPlayer); seqSpawn(pDudeInfo->seqStartID, actor, -1); if (pPlayer == gMe) - actor->s().cstat2 |= CSTAT2_SPRITE_MAPPED; + actor->spr.cstat2 |= CSTAT2_SPRITE_MAPPED; int top, bottom; GetSpriteExtents(pSprite, &top, &bottom); pSprite->z -= bottom - pSprite->z; @@ -1377,7 +1377,7 @@ void ProcessInput(PLAYER *pPlayer) DBloodActor* fragger = pPlayer->fragger; if (fragger) { - pPlayer->angle.addadjustment(getincanglebam(pPlayer->angle.ang, bvectangbam(fragger->s().x - pSprite->x, fragger->s().y - pSprite->y))); + pPlayer->angle.addadjustment(getincanglebam(pPlayer->angle.ang, bvectangbam(fragger->spr.x - pSprite->x, fragger->spr.y - pSprite->y))); } pPlayer->deathTime += 4; if (!bSeqStat) @@ -1753,7 +1753,7 @@ void playerProcess(PLAYER *pPlayer) { pPlayer->isUnderwater = 1; auto link = pSprite->sector()->lowerLink; - if (link && (link->s().type == kMarkerLowGoo || link->s().type == kMarkerLowWater)) + if (link && (link->spr.type == kMarkerLowGoo || link->spr.type == kMarkerLowWater)) { if (getceilzofslopeptr(pSprite->sector(), pSprite->x, pSprite->y) > pPlayer->zView) pPlayer->isUnderwater = 0; @@ -1859,7 +1859,7 @@ void FragPlayer(PLAYER *pPlayer, DBloodActor* killer) { if (killer && killer->IsPlayerActor()) { - PLAYER *pKiller = &gPlayer[killer->s().type - kDudePlayer1]; + PLAYER *pKiller = &gPlayer[killer->spr.type - kDudePlayer1]; playerFrag(pKiller, pPlayer); int nTeam1 = pKiller->teamId&1; int nTeam2 = pPlayer->teamId&1; diff --git a/source/games/blood/src/prediction.cpp b/source/games/blood/src/prediction.cpp index c06a6ecfd..4221ee881 100644 --- a/source/games/blood/src/prediction.cpp +++ b/source/games/blood/src/prediction.cpp @@ -348,7 +348,7 @@ void fakePlayerProcess(PLAYER *pPlayer, InputPacket *pInput) predict.at72 = 1; int nSector = predict.sector; auto nLink = getLowerLink(nSector); - if (nLink && (nLink->s().type == kMarkerLowGoo || nLink->s().type == kMarkerLowWater)) + if (nLink && (nLink->spr.type == kMarkerLowGoo || nLink->spr.type == kMarkerLowWater)) { if (getceilzofslope(nSector, predict.x, predict.y) > predict.viewz) predict.at72 = 0; @@ -438,9 +438,9 @@ static void fakeMoveDude(spritetype *pSprite) } auto nUpperLink = getUpperLink(nSector); auto nLowerLink = getLowerLink(nSector); - if (nUpperLink >= 0 && (nUpperLink->s().type == kMarkerUpWater || nUpperLink->s().type == kMarkerUpGoo)) + if (nUpperLink >= 0 && (nUpperLink->spr.type == kMarkerUpWater || nUpperLink->spr.type == kMarkerUpGoo)) bDepth = 1; - if (nLowerLink >= 0 && (nLowerLink->s().type == kMarkerLowWater || nLowerLink->s().type == kMarkerLowGoo)) + if (nLowerLink >= 0 && (nLowerLink->spr.type == kMarkerLowWater || nLowerLink->spr.type == kMarkerLowGoo)) bDepth = 1; if (pPlayer) wd += 16; @@ -548,10 +548,10 @@ static void fakeMoveDude(spritetype *pSprite) if (floorColl.type == kHitSprite) { auto hitactor = floorColl.actor; - if ((hitactor->s().cstat & 0x30) == 0) + if ((hitactor->spr.cstat & 0x30) == 0) { - predict.xvel += MulScale(4, predict.x - hitactor->s().x, 2); - predict.yvel += MulScale(4, predict.y - hitactor->s().y, 2); + predict.xvel += MulScale(4, predict.x - hitactor->spr.x, 2); + predict.yvel += MulScale(4, predict.y - hitactor->spr.y, 2); return; } } diff --git a/source/games/blood/src/seq.cpp b/source/games/blood/src/seq.cpp index 3e16f0691..317b15c6d 100644 --- a/source/games/blood/src/seq.cpp +++ b/source/games/blood/src/seq.cpp @@ -705,7 +705,7 @@ void seqProcess(int nTicks) if (actor) { evKillActor(actor); - if ((actor->s().hitag & kAttrRespawn) != 0 && (actor->s().inittype >= kDudeBase && actor->s().inittype < kDudeMax)) + if ((actor->spr.hitag & kAttrRespawn) != 0 && (actor->spr.inittype >= kDudeBase && actor->spr.inittype < kDudeMax)) evPostActor(actor, gGameOptions.nMonsterRespawnTime, kCallbackRespawn); else DeleteSprite(actor); // safe to not use actPostSprite here } diff --git a/source/games/blood/src/sfx.cpp b/source/games/blood/src/sfx.cpp index 88f18b2de..2f46d1e11 100644 --- a/source/games/blood/src/sfx.cpp +++ b/source/games/blood/src/sfx.cpp @@ -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->xvel * (30 / 65536.f), actor->zvel * (-30 / 65536.f), actor->yvel * (-30 / 65536.f) }; - *pos = GetSoundPos(&actor->s().pos); + *pos = GetSoundPos(&actor->spr.pos); } else if (type == SOURCE_Ambient) { @@ -174,7 +174,7 @@ void sfxPlay3DSoundCP(DBloodActor* pActor, int soundId, int playchannel, int pla auto sid = soundEngine->FindSoundByResID(soundId); if (sid == 0) return; - auto svec = GetSoundPos(&pActor->s().pos); + auto svec = GetSoundPos(&pActor->spr.pos); float attenuation; sid = getSfx(sid, attenuation, pitch, volume); diff --git a/source/games/blood/src/tile.cpp b/source/games/blood/src/tile.cpp index 52ea8448c..5796c6aff 100644 --- a/source/games/blood/src/tile.cpp +++ b/source/games/blood/src/tile.cpp @@ -86,7 +86,7 @@ int tileGetSurfType(CollisionBase& hit) case kHitWall: return surfType[hit.hitWall->picnum]; case kHitSprite: - return surfType[hit.hitActor->s().picnum]; + return surfType[hit.hitActor->spr.picnum]; } } diff --git a/source/games/blood/src/triggers.cpp b/source/games/blood/src/triggers.cpp index ab35d24a6..e32cfc833 100644 --- a/source/games/blood/src/triggers.cpp +++ b/source/games/blood/src/triggers.cpp @@ -251,7 +251,7 @@ void LifeLeechOperate(DBloodActor* actor, EVENT event) evPostActor(actor, t2, kCallbackLeechStateTimer); pXSprite->data3 = ClipLow(pXSprite->data3-1, 0); if (!VanillaMode()) // disable collisions so lifeleech doesn't do that weird bobbing - missile->s().cstat &= ~CSTAT_SPRITE_BLOCK_ALL; + missile->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL; } pSprite->ang = angBak; } @@ -2025,7 +2025,7 @@ void trInit(TArray& actors) BloodSectIterator it(pSector); while (auto actor = it.Next()) { - actor->basePoint = actor->s().pos; + actor->basePoint = actor->spr.pos; } TranslateSector(pSector, 0, pXSector->busy, pSprite1->x, pSprite1->y, pSprite1->x, pSprite1->y, pSprite1->ang, pSprite2->x, pSprite2->y, pSprite2->ang, pSector->type == kSectorSlide); ZTranslateSector(pSector, pXSector, pXSector->busy, 1); @@ -2044,7 +2044,7 @@ void trInit(TArray& actors) BloodSectIterator it(pSector); while (auto actor = it.Next()) { - actor->basePoint = actor->s().pos; + actor->basePoint = actor->spr.pos; } TranslateSector(pSector, 0, pXSector->busy, pSprite1->x, pSprite1->y, pSprite1->x, pSprite1->y, 0, pSprite1->x, pSprite1->y, pSprite1->ang, pSector->type == kSectorRotate); ZTranslateSector(pSector, pXSector, pXSector->busy, 1); diff --git a/source/games/blood/src/view.cpp b/source/games/blood/src/view.cpp index 4d8cba2ff..2d08aaaac 100644 --- a/source/games/blood/src/view.cpp +++ b/source/games/blood/src/view.cpp @@ -621,7 +621,7 @@ void viewDrawScreen(bool sceneonly) BloodStatIterator it(kStatExplosion); while (auto actor = it.Next()) { - if (actor->hasX() && gotsector[actor->s().sectno()]) + if (actor->hasX() && gotsector[actor->spr.sectno()]) { brightness += actor->x().data3 * 32; } diff --git a/source/games/blood/src/view.h b/source/games/blood/src/view.h index 100407287..90e97f61e 100644 --- a/source/games/blood/src/view.h +++ b/source/games/blood/src/view.h @@ -175,7 +175,7 @@ inline void viewBackupSpriteLoc(DBloodActor* actor) { if (!actor->interpolated) { - actor->s().backuploc(); + actor->spr.backuploc(); actor->interpolated = true; } } diff --git a/source/games/blood/src/weapon.cpp b/source/games/blood/src/weapon.cpp index 5a3484072..a7f16be0c 100644 --- a/source/games/blood/src/weapon.cpp +++ b/source/games/blood/src/weapon.cpp @@ -1713,7 +1713,7 @@ void FireLifeLeech(int nTrigger, PLAYER *pPlayer) if (missileActor) { missileActor->SetTarget(pPlayer->aimTarget); - missileActor->s().ang = (nTrigger==2) ? 1024 : 0; + missileActor->spr.ang = (nTrigger==2) ? 1024 : 0; } if (checkAmmo2(pPlayer, 8, 1)) UseAmmo(pPlayer, 8, 1); @@ -2462,7 +2462,7 @@ void WeaponProcess(PLAYER *pPlayer) { { } pPlayer->voodooTarget = pPlayer->aimTarget; - if (pPlayer->voodooTarget == nullptr || pPlayer->voodooTarget->s().statnum != kStatDude) + if (pPlayer->voodooTarget == nullptr || pPlayer->voodooTarget->spr.statnum != kStatDude) i = 4; StartQAV(pPlayer,kQAVVDFIRE1 + i, nClientFireVoodoo); return; @@ -2672,7 +2672,7 @@ void teslaHit(DBloodActor *missileactor, int a2) bool v4 = true; DBloodActor* actor = nullptr; actHitcodeToData(a2, &gHitInfo, &actor); - if (a2 == 3 && actor && actor->s().statnum == kStatDude) + if (a2 == 3 && actor && actor->spr.statnum == kStatDude) v4 = false; BloodStatIterator it(kStatDude); while (auto hitactor = it.Next()) diff --git a/source/games/exhumed/src/anubis.cpp b/source/games/exhumed/src/anubis.cpp index 07fff6719..6c0833df1 100644 --- a/source/games/exhumed/src/anubis.cpp +++ b/source/games/exhumed/src/anubis.cpp @@ -188,7 +188,7 @@ void AIAnubis::Tick(RunListEvent* ev) { if (move.actor() == pTarget) { - int nAng = getangle(pTarget->s().x - sp->x, pTarget->s().y - sp->y); + int nAng = getangle(pTarget->spr.x - sp->x, pTarget->spr.y - sp->y); int nAngDiff = AngleDiff(sp->ang, nAng); if (nAngDiff < 64) @@ -222,11 +222,11 @@ void AIAnubis::Tick(RunListEvent* ev) if (pTarget != nullptr) // NOTE: nTarget can be -1. this check wasn't in original code. TODO: demo compatiblity? { if (cansee(sp->x, sp->y, sp->z - GetActorHeight(ap), sp->sector(), - pTarget->s().x, pTarget->s().y, pTarget->s().z - GetActorHeight(pTarget), pTarget->s().sector())) + pTarget->spr.x, pTarget->spr.y, pTarget->spr.z - GetActorHeight(pTarget), pTarget->spr.sector())) { sp->xvel = 0; sp->yvel = 0; - sp->ang = GetMyAngle(pTarget->s().x - sp->x, pTarget->s().y - sp->y); + sp->ang = GetMyAngle(pTarget->spr.x - sp->x, pTarget->spr.y - sp->y); ap->nAction = 3; ap->nFrame = 0; @@ -336,7 +336,7 @@ void AIAnubis::Tick(RunListEvent* ev) // loc_2564C: if (nAction && pTarget != nullptr) { - if (!(pTarget->s().cstat & CSTAT_SPRITE_BLOCK_ALL)) + if (!(pTarget->spr.cstat & CSTAT_SPRITE_BLOCK_ALL)) { ap->nAction = 0; ap->nFrame = 0; diff --git a/source/games/exhumed/src/bubbles.cpp b/source/games/exhumed/src/bubbles.cpp index c98e2751f..6c712862e 100644 --- a/source/games/exhumed/src/bubbles.cpp +++ b/source/games/exhumed/src/bubbles.cpp @@ -152,6 +152,6 @@ void DoBubbles(int nPlayer) WheresMyMouth(nPlayer, &pos, &pSector); auto pActor = BuildBubble(pos, pSector); - pActor->s().hitag = nPlayer; + pActor->spr.hitag = nPlayer; } END_PS_NS diff --git a/source/games/exhumed/src/bullet.cpp b/source/games/exhumed/src/bullet.cpp index f14e2be9f..2d566ea08 100644 --- a/source/games/exhumed/src/bullet.cpp +++ b/source/games/exhumed/src/bullet.cpp @@ -175,11 +175,11 @@ void IgniteSprite(DExhumedActor* pActor) pAnimActor->pTarget = pActor; ChangeActorStat(pAnimActor, kStatIgnited); - int yRepeat = (tileHeight(pAnimActor->s().picnum) * 32) / nFlameHeight; + int yRepeat = (tileHeight(pAnimActor->spr.picnum) * 32) / nFlameHeight; if (yRepeat < 1) yRepeat = 1; - pAnimActor->s().yrepeat = (uint8_t)yRepeat; + pAnimActor->spr.yrepeat = (uint8_t)yRepeat; } } @@ -336,7 +336,7 @@ int MoveBullet(int nBullet) DExhumedActor* pEnemyActor = BulletList[nBullet].pEnemy; if (pEnemyActor) { - if (!(pEnemyActor->s().cstat & CSTAT_SPRITE_BLOCK_ALL)) + if (!(pEnemyActor->spr.cstat & CSTAT_SPRITE_BLOCK_ALL)) BulletList[nBullet].pEnemy = nullptr; else { @@ -599,7 +599,7 @@ DExhumedActor* BuildBullet(DExhumedActor* pActor, int nType, int nZOffset, int n sBullet.nDoubleDamage = nDoubleDamage; sBullet.pActor = insertActor(pSprite->sector(), 200); - sBullet.pActor->s().ang = nAngle; + sBullet.pActor->spr.ang = nAngle; int nHeight = GetActorHeight(pTarget); diff --git a/source/games/exhumed/src/exhumed.cpp b/source/games/exhumed/src/exhumed.cpp index 71ec704a4..233c2f11a 100644 --- a/source/games/exhumed/src/exhumed.cpp +++ b/source/games/exhumed/src/exhumed.cpp @@ -269,7 +269,7 @@ void GameMove(void) ExhumedSpriteIterator it; while (auto ac = it.Next()) { - ac->s().backuploc(); + ac->spr.backuploc(); } if (currentLevel->gameflags & LEVEL_EX_COUNTDOWN) diff --git a/source/games/exhumed/src/fish.cpp b/source/games/exhumed/src/fish.cpp index 9eb86a0fa..a5aa2f7e7 100644 --- a/source/games/exhumed/src/fish.cpp +++ b/source/games/exhumed/src/fish.cpp @@ -307,7 +307,7 @@ void AIFish::Damage(RunListEvent* ev) else { auto pTarget = ev->pOtherActor; - if (pTarget && pTarget->s().statnum < 199) + if (pTarget && pTarget->spr.statnum < 199) { pActor->pTarget = pTarget; } @@ -361,7 +361,7 @@ void AIFish::Tick(RunListEvent* ev) pActor->nAction = 2; pActor->nFrame = 0; - int nAngle = GetMyAngle(pTargetActor->s().x - pSprite->x, pTargetActor->s().z - pSprite->z); + int nAngle = GetMyAngle(pTargetActor->spr.x - pSprite->x, pTargetActor->spr.z - pSprite->z); pSprite->zvel = bsin(nAngle, -5); pActor->nCount = RandomSize(6) + 90; @@ -392,7 +392,7 @@ void AIFish::Tick(RunListEvent* ev) PlotCourseToSprite(pActor, pTargetActor); int nHeight = GetActorHeight(pActor) >> 1; - int z = abs(pTargetActor->s().z - pSprite->z); + int z = abs(pTargetActor->spr.z - pSprite->z); if (z <= nHeight) { @@ -405,7 +405,7 @@ void AIFish::Tick(RunListEvent* ev) pSprite->yvel = 0; } - pSprite->zvel = (pTargetActor->s().z - pSprite->z) >> 3; + pSprite->zvel = (pTargetActor->spr.z - pSprite->z) >> 3; } break; } diff --git a/source/games/exhumed/src/grenade.cpp b/source/games/exhumed/src/grenade.cpp index 7f66573a2..2f0f69e09 100644 --- a/source/games/exhumed/src/grenade.cpp +++ b/source/games/exhumed/src/grenade.cpp @@ -32,7 +32,7 @@ void DestroyGrenade(DExhumedActor* pActor) { runlist_DoSubRunRec(pActor->nPhase); runlist_SubRunRec(pActor->nRun); - runlist_DoSubRunRec(pActor->s().lotag - 1); + runlist_DoSubRunRec(pActor->spr.lotag - 1); DeleteActor(pActor); } @@ -334,7 +334,7 @@ void AIGrenade::Tick(RunListEvent* ev) } else if (nMov.type == kHitSprite) { - BounceGrenade(pActor, nMov.actor()->s().ang); + BounceGrenade(pActor, nMov.actor()->spr.ang); } pActor->nHealth = 0; diff --git a/source/games/exhumed/src/gun.cpp b/source/games/exhumed/src/gun.cpp index 193681585..ebe4049f4 100644 --- a/source/games/exhumed/src/gun.cpp +++ b/source/games/exhumed/src/gun.cpp @@ -245,7 +245,7 @@ Collision CheckCloseRange(int nPlayer, int *x, int *y, int *z, sectortype* *ppSe { auto pActor = PlayerList[nPlayer].Actor(); - int ang = pActor->s().ang; + int ang = pActor->spr.ang; int xVect = bcos(ang); int yVect = bsin(ang); @@ -954,7 +954,7 @@ void DrawWeapons(double smooth) } if (nWeapon < 0) { - nShade = PlayerList[nLocalPlayer].Actor()->s().shade; + nShade = PlayerList[nLocalPlayer].Actor()->spr.shade; } double const look_anghalf = PlayerList[nLocalPlayer].angle.look_anghalf(smooth); diff --git a/source/games/exhumed/src/items.cpp b/source/games/exhumed/src/items.cpp index 86a063fde..38bc5624d 100644 --- a/source/games/exhumed/src/items.cpp +++ b/source/games/exhumed/src/items.cpp @@ -128,11 +128,11 @@ void BuildItemAnim(DExhumedActor* pActor) auto pAnimActor = BuildAnim(pActor, 41, nItemAnimInfo[nItem].a, pSprite->x, pSprite->y, pSprite->z, pSprite->sector(), nItemAnimInfo[nItem].repeat, 20); if (nItem == 44) { - pAnimActor->s().cstat |= CSTAT_SPRITE_TRANSLUCENT; + pAnimActor->spr.cstat |= CSTAT_SPRITE_TRANSLUCENT; } ChangeActorStat(pAnimActor, pSprite->statnum); - pAnimActor->s().hitag = pSprite->hitag; + pAnimActor->spr.hitag = pSprite->hitag; pSprite->owner = 0; } else @@ -145,7 +145,7 @@ void BuildItemAnim(DExhumedActor* pActor) void DestroyItemAnim(DExhumedActor* actor) { - if (actor && actor->s().owner >= 0) + if (actor && actor->spr.owner >= 0) DestroyAnim(actor); } @@ -352,7 +352,7 @@ void DropMagic(DExhumedActor* pActor) if (pAnimActor) { - AddFlash(pAnimActor->s().sector(), pAnimActor->s().x, pAnimActor->s().y, pAnimActor->s().z, 128); + AddFlash(pAnimActor->spr.sector(), pAnimActor->spr.x, pAnimActor->spr.y, pAnimActor->spr.z, 128); ChangeActorStat(pAnimActor, 950); } nMagicCount = RandomSize(2); diff --git a/source/games/exhumed/src/lavadude.cpp b/source/games/exhumed/src/lavadude.cpp index b0323f387..c01450fe9 100644 --- a/source/games/exhumed/src/lavadude.cpp +++ b/source/games/exhumed/src/lavadude.cpp @@ -99,7 +99,7 @@ void AILavaDudeLimb::Draw(RunListEvent* ev) { auto pActor = ev->pObjActor; if (!pActor) return; - seq_PlotSequence(ev->nParam, (SeqOffsets[kSeqLavag] + 30) + pActor->s().picnum, 0, 1); + seq_PlotSequence(ev->nParam, (SeqOffsets[kSeqLavag] + 30) + pActor->spr.picnum, 0, 1); } @@ -202,7 +202,7 @@ void AILavaDude::Damage(RunListEvent* ev) if (pTarget) { - if (pTarget->s().statnum < 199) + if (pTarget->spr.statnum < 199) { pActor->pTarget = pTarget; } @@ -259,7 +259,7 @@ void AILavaDude::Tick(RunListEvent* ev) if (pTarget && nAction < 4) { - if (!(pTarget->s().cstat & CSTAT_SPRITE_BLOCK_ALL) || pTarget->s().statnum == MAXSTATUS) + if (!(pTarget->spr.cstat & CSTAT_SPRITE_BLOCK_ALL) || pTarget->spr.statnum == MAXSTATUS) { pTarget = nullptr; pActor->pTarget = nullptr; @@ -327,7 +327,7 @@ void AILavaDude::Tick(RunListEvent* ev) { if (coll.actor() == pTarget) { - int nAng = getangle(pTarget->s().x - pSprite->x, pTarget->s().y - pSprite->y); + int nAng = getangle(pTarget->spr.x - pSprite->x, pTarget->spr.y - pSprite->y); if (AngleDiff(pSprite->ang, nAng) < 64) { pActor->nAction = 2; diff --git a/source/games/exhumed/src/lion.cpp b/source/games/exhumed/src/lion.cpp index c9d1a2cbe..d48583d4a 100644 --- a/source/games/exhumed/src/lion.cpp +++ b/source/games/exhumed/src/lion.cpp @@ -159,7 +159,7 @@ void AILion::Damage(RunListEvent* ev) if (pTarget) { - if (pTarget->s().statnum < 199) { + if (pTarget->spr.statnum < 199) { pActor->pTarget = pTarget; } @@ -318,7 +318,7 @@ void AILion::Tick(RunListEvent* ev) } else { - int nAng = getangle(pTarget->s().x - pSprite->x, pTarget->s().y - pSprite->y); + int nAng = getangle(pTarget->spr.x - pSprite->x, pTarget->spr.y - pSprite->y); if (AngleDiff(pSprite->ang, nAng) < 64) { @@ -451,7 +451,7 @@ void AILion::Tick(RunListEvent* ev) { if (nMov.actor() == pTarget) { - int nAng = getangle(pTarget->s().x - pSprite->x, pTarget->s().y - pSprite->y); + int nAng = getangle(pTarget->spr.x - pSprite->x, pTarget->spr.y - pSprite->y); if (AngleDiff(pSprite->ang, nAng) < 64) { pActor->nAction = 3; @@ -536,7 +536,7 @@ void AILion::Tick(RunListEvent* ev) // loc_379AD: ? if (nAction != 1 && pTarget != nullptr) { - if (!(pTarget->s().cstat & CSTAT_SPRITE_BLOCK_ALL)) + if (!(pTarget->spr.cstat & CSTAT_SPRITE_BLOCK_ALL)) { pActor->nAction = 1; pActor->nFrame = 0; diff --git a/source/games/exhumed/src/move.cpp b/source/games/exhumed/src/move.cpp index 6abcecf37..d418c6a43 100644 --- a/source/games/exhumed/src/move.cpp +++ b/source/games/exhumed/src/move.cpp @@ -247,7 +247,7 @@ int BelowNear(DExhumedActor* pActor, int x, int y, int walldist) if (loHit.type == kHitSprite) { - z2 = loHit.actor()->s().z; + z2 = loHit.actor()->spr.z; } else { @@ -480,7 +480,7 @@ Collision movespritez(DExhumedActor* pActor, int z, int height, int, int clipdis int GetActorHeight(DExhumedActor* actor) { - return tileHeight(actor->s().picnum) * actor->s().yrepeat * 4; + return tileHeight(actor->spr.picnum) * actor->spr.yrepeat * 4; } DExhumedActor* insertActor(sectortype* s, int st) @@ -1122,8 +1122,8 @@ void SetQuake(DExhumedActor* pActor, int nVal) auto pPlayerActor = PlayerList[i].Actor(); - uint32_t xDiff = abs((int32_t)((pPlayerActor->s().x - x) >> 8)); - uint32_t yDiff = abs((int32_t)((pPlayerActor->s().y - y) >> 8)); + uint32_t xDiff = abs((int32_t)((pPlayerActor->spr.x - x) >> 8)); + uint32_t yDiff = abs((int32_t)((pPlayerActor->spr.y - y) >> 8)); uint32_t sqrtNum = xDiff * xDiff + yDiff * yDiff; @@ -1367,7 +1367,7 @@ DExhumedActor* GrabChunkSprite() pActor = insertActor(0, 899); nChunkSprite[nCurChunkNum] = pActor; } - else if (pActor->s().statnum) + else if (pActor->spr.statnum) { // TODO MonoOut("too many chunks being used at once!\n"); return nullptr; @@ -1382,7 +1382,7 @@ DExhumedActor* GrabChunkSprite() if (nChunkTotal < kMaxMoveChunks) nChunkTotal++; - pActor->s().cstat = CSTAT_SPRITE_YCENTER; + pActor->spr.cstat = CSTAT_SPRITE_YCENTER; return pActor; } @@ -1480,7 +1480,7 @@ void AICreatureChunk::Tick(RunListEvent* ev) } else if (nVal.type == kHitSprite) { - nAngle = nVal.actor()->s().ang; + nAngle = nVal.actor()->spr.ang; } else if (nVal.type == kHitWall) { @@ -1514,7 +1514,7 @@ DExhumedActor* UpdateEnemy(DExhumedActor** ppEnemy) { if (*ppEnemy) { - if (!((*ppEnemy)->s().cstat & CSTAT_SPRITE_BLOCK_ALL)) { + if (!((*ppEnemy)->spr.cstat & CSTAT_SPRITE_BLOCK_ALL)) { *ppEnemy = nullptr; } } diff --git a/source/games/exhumed/src/mummy.cpp b/source/games/exhumed/src/mummy.cpp index 863fab64e..2b385cd65 100644 --- a/source/games/exhumed/src/mummy.cpp +++ b/source/games/exhumed/src/mummy.cpp @@ -158,7 +158,7 @@ void AIMummy::Tick(RunListEvent* ev) if (pTarget != nullptr && nAction < 4) { - if ((!pTarget->s().cstat) && nAction) + if ((!pTarget->spr.cstat) && nAction) { pActor->nAction = 0; pActor->nFrame = 0; @@ -217,7 +217,7 @@ void AIMummy::Tick(RunListEvent* ev) if (RandomBit() && pTarget) { if (cansee(pSprite->x, pSprite->y, pSprite->z - GetActorHeight(pActor), pSprite->sector(), - pTarget->s().x, pTarget->s().y, pTarget->s().z - GetActorHeight(pTarget), pTarget->s().sector())) + pTarget->spr.x, pTarget->spr.y, pTarget->spr.z - GetActorHeight(pTarget), pTarget->spr.sector())) { pActor->nAction = 3; pActor->nFrame = 0; @@ -284,7 +284,7 @@ void AIMummy::Tick(RunListEvent* ev) { if (nMov.actor() == pTarget) { - int nAngle = getangle(pTarget->s().x - pSprite->x, pTarget->s().y - pSprite->y); + int nAngle = getangle(pTarget->spr.x - pSprite->x, pTarget->spr.y - pSprite->y); if (AngleDiff(pSprite->ang, nAngle) < 64) { pActor->nAction = 2; @@ -346,7 +346,7 @@ void AIMummy::Tick(RunListEvent* ev) if (!RandomSize(3)) { SetBulletEnemy(pBullet->nPhase, pTarget); - pBullet->s().pal = 5; + pBullet->spr.pal = 5; } } } diff --git a/source/games/exhumed/src/object.cpp b/source/games/exhumed/src/object.cpp index 032003f7a..022132825 100644 --- a/source/games/exhumed/src/object.cpp +++ b/source/games/exhumed/src/object.cpp @@ -626,7 +626,7 @@ int CheckSectorSprites(sectortype* pSector, int nVal) ExhumedSectIterator it(pSector); while (auto pActor = it.Next()) { - if (pActor->s().cstat & CSTAT_SPRITE_BLOCK_ALL) { + if (pActor->spr.cstat & CSTAT_SPRITE_BLOCK_ALL) { return 1; } } @@ -869,7 +869,7 @@ void AIElev::Tick(RunListEvent* ev) // maybe this doesn't go here? while (pElevSpr) { - pElevSpr->s().z += ebp; + pElevSpr->spr.z += ebp; pElevSpr = pElevSpr->pTarget; } } @@ -1327,12 +1327,12 @@ void AITrap::Tick(RunListEvent* ev) { if (nType == 15) { - pBullet->s().ang = (pBullet->s().ang - 512) & kAngleMask; + pBullet->spr.ang = (pBullet->spr.ang - 512) & kAngleMask; D3PlayFX(StaticSound[kSound32], pBullet); } else { - pBullet->s().clipdist = 50; + pBullet->spr.clipdist = 50; auto pWall = sTrap[nTrap].pWall1; if (pWall) @@ -1519,7 +1519,7 @@ void DoFinale() if (!(dword_96788 & 2)) { int nAng = RandomSize(11); - pFinaleSpr->s().ang = nAng; + pFinaleSpr->spr.ang = nAng; BuildSpark(pFinaleSpr, 1); } @@ -2060,9 +2060,9 @@ void AIObject::RadialDamage(RunListEvent* ev) if (pActor->nHealth > 0 && pSprite->cstat & CSTAT_SPRITE_BLOCK_ALL && (nStat != kStatExplodeTarget - || ev->pRadialActor->s().statnum == 201 + || ev->pRadialActor->spr.statnum == 201 || (nRadialBullet != 3 && nRadialBullet > -1) - || ev->pRadialActor->s().statnum == kStatExplodeTrigger)) + || ev->pRadialActor->spr.statnum == kStatExplodeTrigger)) { int nDamage = runlist_CheckRadialDamage(pActor); if (nDamage <= 0) { @@ -2571,7 +2571,7 @@ void PostProcess() { wal.pal = 1; auto pActor = insertActor(§, 407); - pActor->s().cstat = CSTAT_SPRITE_INVISIBLE; + pActor->spr.cstat = CSTAT_SPRITE_INVISIBLE; } } } @@ -2592,7 +2592,7 @@ void PostProcess() { auto pObjectActor = ObjectList[i]; - if (pObjectActor->s().statnum == kStatExplodeTarget) + if (pObjectActor->spr.statnum == kStatExplodeTarget) { if (!pObjectActor->nIndex2) { pObjectActor->nIndex2 = -1; @@ -2605,7 +2605,7 @@ void PostProcess() for (unsigned j = 0; j < ObjectList.Size(); j++) { - if (i != j && ObjectList[j]->s().statnum == kStatExplodeTarget && edi == ObjectList[j]->nIndex2) + if (i != j && ObjectList[j]->spr.statnum == kStatExplodeTarget && edi == ObjectList[j]->nIndex2) { pObjectActor->nIndex2 = j; ObjectList[j]->nIndex2 = i; diff --git a/source/games/exhumed/src/player.cpp b/source/games/exhumed/src/player.cpp index 78234ab65..6fb1d1a32 100644 --- a/source/games/exhumed/src/player.cpp +++ b/source/games/exhumed/src/player.cpp @@ -612,7 +612,7 @@ static void pickupMessage(int no) void UpdatePlayerSpriteAngle(Player* pPlayer) { inita = pPlayer->angle.ang.asbuild(); - if (pPlayer->Actor()) pPlayer->Actor()->s().ang = inita; + if (pPlayer->Actor()) pPlayer->Actor()->spr.ang = inita; } void AIPlayer::Draw(RunListEvent* ev) @@ -711,7 +711,7 @@ void AIPlayer::Damage(RunListEvent* ev) else { // player has died - if (pActor2 && pActor2->s().statnum == 100) + if (pActor2 && pActor2->spr.statnum == 100) { int nPlayer2 = GetPlayerFromActor(pActor2); @@ -781,7 +781,7 @@ void AIPlayer::Tick(RunListEvent* ev) int var_EC = PlayerList[nPlayer].nSeqSize; pPlayerSprite->picnum = seq_GetSeqPicnum(PlayerList[nPlayer].nSeq, PlayerSeq[nHeightTemplate[nAction]].a, var_EC); - pDopple->s().picnum = pPlayerSprite->picnum; + pDopple->spr.picnum = pPlayerSprite->picnum; if (PlayerList[nPlayer].nTorch > 0) { @@ -820,7 +820,7 @@ void AIPlayer::Tick(RunListEvent* ev) DExhumedActor* pFloorSprite = PlayerList[nPlayer].pPlayerFloorSprite; if (pFloorSprite != nullptr) { - pFloorSprite->s().cstat &= ~CSTAT_SPRITE_BLOCK; // set visible + pFloorSprite->spr.cstat &= ~CSTAT_SPRITE_BLOCK; // set visible } } else if (PlayerList[nPlayer].nInvisible == 150 && nPlayer == nLocalPlayer) @@ -1326,7 +1326,7 @@ sectdone: feebtag(pPlayerSprite->x, pPlayerSprite->y, pPlayerSprite->z, pPlayerSprite->sector(), &pActorB, var_30, 768); // Item pickup code - if (pActorB != nullptr && pActorB->s().statnum >= 900) + if (pActorB != nullptr && pActorB->spr.statnum >= 900) { auto pSpriteB = &pActorB->s(); int var_8C = 16; @@ -2609,17 +2609,17 @@ sectdone: } // loc_1C4E1 - pDopple->s().pos = pPlayerSprite->pos; + pDopple->spr.pos = pPlayerSprite->pos; if (pPlayerSprite->sector()->pAbove != nullptr) { - pDopple->s().ang = pPlayerSprite->ang; + pDopple->spr.ang = pPlayerSprite->ang; ChangeActorSect(pDopple, pPlayerSprite->sector()->pAbove); - pDopple->s().cstat = CSTAT_SPRITE_BLOCK_ALL; + pDopple->spr.cstat = CSTAT_SPRITE_BLOCK_ALL; } else { - pDopple->s().cstat = CSTAT_SPRITE_INVISIBLE; + pDopple->spr.cstat = CSTAT_SPRITE_INVISIBLE; } MoveWeapons(nPlayer); @@ -2774,7 +2774,7 @@ DEFINE_ACTION_FUNCTION(_ExhumedPlayer, IsUnderwater) DEFINE_ACTION_FUNCTION(_ExhumedPlayer, GetAngle) { PARAM_SELF_STRUCT_PROLOGUE(Player); - ACTION_RETURN_INT(self->Actor()->s().ang); + ACTION_RETURN_INT(self->Actor()->spr.ang); } diff --git a/source/games/exhumed/src/queen.cpp b/source/games/exhumed/src/queen.cpp index dd3298fe9..95be64089 100644 --- a/source/games/exhumed/src/queen.cpp +++ b/source/games/exhumed/src/queen.cpp @@ -557,7 +557,7 @@ void AIQueenEgg::Tick(RunListEvent* ev) pEgg->pActor = enemy; pEgg->pTarget = pTarget; - if (pTarget && (pTarget->s().cstat & CSTAT_SPRITE_BLOCK_ALL) == 0) + if (pTarget && (pTarget->spr.cstat & CSTAT_SPRITE_BLOCK_ALL) == 0) { pEgg->pTarget = nullptr; pEgg->nAction = 0; @@ -599,7 +599,7 @@ void AIQueenEgg::Tick(RunListEvent* ev) nAngle = GetWallNormal(nMov.hitWall); break; case kHitSprite: - nAngle = nMov.actor()->s().ang; + nAngle = nMov.actor()->spr.ang; break; } @@ -629,7 +629,7 @@ void AIQueenEgg::Tick(RunListEvent* ev) switch (nMov.type) { case kHitSprite: - if (nMov.actor()->s().statnum != 121) + if (nMov.actor()->spr.statnum != 121) { runlist_DamageEnemy(nMov.actor(), pActor, 5); } @@ -663,7 +663,7 @@ void AIQueenEgg::Tick(RunListEvent* ev) if (pEgg->nCounter <= 0) { auto pWaspSprite = BuildWasp(nullptr, pSprite->x, pSprite->y, pSprite->z, pSprite->sector(), pSprite->ang, true); - pSprite->z = pWaspSprite->s().z; + pSprite->z = pWaspSprite->spr.z; DestroyEgg(nEgg); } @@ -794,7 +794,7 @@ void AIQueenHead::Tick(RunListEvent* ev) if (pTarget) { - if (!(pTarget->s().cstat & CSTAT_SPRITE_BLOCK_ALL)) + if (!(pTarget->spr.cstat & CSTAT_SPRITE_BLOCK_ALL)) { pTarget = nullptr; QueenHead.pTarget = pTarget; @@ -834,7 +834,7 @@ void AIQueenHead::Tick(RunListEvent* ev) if (nMov.exbits == 0) { - if (nMov.type == kHitSprite) nNewAng = nMov.actor()->s().ang; + if (nMov.type == kHitSprite) nNewAng = nMov.actor()->spr.ang; else if (nMov.type == kHitWall) nNewAng = GetWallNormal(nMov.hitWall); } else if (nMov.exbits == kHitAux2) @@ -880,7 +880,7 @@ void AIQueenHead::Tick(RunListEvent* ev) [[fallthrough]]; case 1: - if ((pTarget->s().z - 51200) > pSprite->z) + if ((pTarget->spr.z - 51200) > pSprite->z) { QueenHead.nAction = 4; QueenHead.nFrame = 0; @@ -1348,7 +1348,7 @@ void AIQueen::Tick(RunListEvent* ev) // loc_35BD2 if (nAction && pTarget != nullptr) { - if (!(pTarget->s().cstat & CSTAT_SPRITE_BLOCK_ALL)) + if (!(pTarget->spr.cstat & CSTAT_SPRITE_BLOCK_ALL)) { QueenList[nQueen].nAction = 0; QueenList[nQueen].nFrame = 0; @@ -1420,16 +1420,16 @@ void AIQueen::Tick(RunListEvent* ev) { auto pChunkActor = BuildCreatureChunk(pActor, seq_GetSeqPicnum(kSeqQueen, 57, 0)); - pChunkActor->s().picnum = kQueenChunk + (i % 3); - pChunkActor->s().xrepeat = 100; - pChunkActor->s().yrepeat = 100; + pChunkActor->spr.picnum = kQueenChunk + (i % 3); + pChunkActor->spr.xrepeat = 100; + pChunkActor->spr.yrepeat = 100; } auto pChunkActor = BuildCreatureChunk(pActor, seq_GetSeqPicnum(kSeqQueen, 57, 0)); - pChunkActor->s().picnum = kTile3126; - pChunkActor->s().yrepeat = 100; - pChunkActor->s().xrepeat = 100; + pChunkActor->spr.picnum = kTile3126; + pChunkActor->spr.yrepeat = 100; + pChunkActor->spr.xrepeat = 100; PlayFXAtXYZ( StaticSound[kSound40], diff --git a/source/games/exhumed/src/ramses.cpp b/source/games/exhumed/src/ramses.cpp index c5e964423..712aab3ae 100644 --- a/source/games/exhumed/src/ramses.cpp +++ b/source/games/exhumed/src/ramses.cpp @@ -75,9 +75,9 @@ void InitSpiritHead() ExhumedSpriteIterator it; while (auto act = it.Next()) { - if (act->s().statnum) + if (act->spr.statnum) { - act->s().cstat |= CSTAT_SPRITE_INVISIBLE; + act->spr.cstat |= CSTAT_SPRITE_INVISIBLE; } } diff --git a/source/games/exhumed/src/rat.cpp b/source/games/exhumed/src/rat.cpp index c86a0b772..d5e54d767 100644 --- a/source/games/exhumed/src/rat.cpp +++ b/source/games/exhumed/src/rat.cpp @@ -240,8 +240,8 @@ void AIRat::Tick(RunListEvent* ev) return; } - int xVal = abs(pSprite->x - pTarget->s().x); - int yVal = abs(pSprite->y - pTarget->s().y); + int xVal = abs(pSprite->x - pTarget->spr.x); + int yVal = abs(pSprite->y - pTarget->spr.y); if (xVal > 50 || yVal > 50) { @@ -293,8 +293,8 @@ void AIRat::Tick(RunListEvent* ev) MoveCreature(pActor); - int xVal = abs(pSprite->x - pTarget->s().x); - int yVal = abs(pSprite->y - pTarget->s().y); + int xVal = abs(pSprite->x - pTarget->spr.x); + int yVal = abs(pSprite->y - pTarget->spr.y); if (xVal >= 50 || yVal >= 50) { diff --git a/source/games/exhumed/src/rex.cpp b/source/games/exhumed/src/rex.cpp index 16f063af1..add985527 100644 --- a/source/games/exhumed/src/rex.cpp +++ b/source/games/exhumed/src/rex.cpp @@ -120,7 +120,7 @@ void AIRex::Damage(RunListEvent* ev) if (ev->nDamage) { auto pTarget = ev->pOtherActor; - if (pTarget && pTarget->s().statnum == 100) + if (pTarget && pTarget->spr.statnum == 100) { pActor->pTarget = pTarget; } @@ -441,7 +441,7 @@ void AIRex::Tick(RunListEvent* ev) // break-ed if (nAction > 0) { - if ((pTarget != nullptr) && (!(pTarget->s().cstat & CSTAT_SPRITE_BLOCK_ALL))) + if ((pTarget != nullptr) && (!(pTarget->spr.cstat & CSTAT_SPRITE_BLOCK_ALL))) { pActor->nAction = 0; pActor->nFrame = 0; diff --git a/source/games/exhumed/src/roach.cpp b/source/games/exhumed/src/roach.cpp index bc48c22a5..8f3afa234 100644 --- a/source/games/exhumed/src/roach.cpp +++ b/source/games/exhumed/src/roach.cpp @@ -159,7 +159,7 @@ void AIRoach::Damage(RunListEvent* ev) auto pSprite2 = ev->pOtherActor; if (pSprite2) { - if (pSprite2->s().statnum < 199) { + if (pSprite2->spr.statnum < 199) { pActor->pTarget = pSprite2; } @@ -282,7 +282,7 @@ void AIRoach::Tick(RunListEvent* ev) pSprite->xvel = 0; pSprite->yvel = 0; - pSprite->ang = GetMyAngle(pTarget->s().x - pSprite->x, pTarget->s().y - pSprite->y); + pSprite->ang = GetMyAngle(pTarget->spr.x - pSprite->x, pTarget->spr.y - pSprite->y); pActor->nFrame = 0; } @@ -311,13 +311,13 @@ void AIRoach::Tick(RunListEvent* ev) pSprite->xvel = 0; pSprite->yvel = 0; - pSprite->ang = GetMyAngle(pTarget->s().x - pSprite->x, pTarget->s().y - pSprite->y); + pSprite->ang = GetMyAngle(pTarget->spr.x - pSprite->x, pTarget->spr.y - pSprite->y); pActor->nFrame = 0; } } - if (pTarget && !(pTarget->s().cstat & CSTAT_SPRITE_BLOCK_ALL)) + if (pTarget && !(pTarget->spr.cstat & CSTAT_SPRITE_BLOCK_ALL)) { pActor->nAction = 1; pActor->nFrame = 0; diff --git a/source/games/exhumed/src/runlist.cpp b/source/games/exhumed/src/runlist.cpp index 2c165112c..915f8fd35 100644 --- a/source/games/exhumed/src/runlist.cpp +++ b/source/games/exhumed/src/runlist.cpp @@ -1723,7 +1723,7 @@ void runlist_DamageEnemy(DExhumedActor* pActor, DExhumedActor* pActor2, int nDam // is there now one less creature? (has one died) if (nPreCreaturesKilled < nCreaturesKilled && pActor2 != nullptr) { - if (pActor2->s().statnum != 100) { + if (pActor2->spr.statnum != 100) { return; } @@ -1734,7 +1734,7 @@ void runlist_DamageEnemy(DExhumedActor* pActor, DExhumedActor* pActor2, int nDam { // Do a taunt auto pPlayerActor = PlayerList[nPlayer].Actor(); - auto pSector = pPlayerActor->s().sector(); + auto pSector = pPlayerActor->spr.sector(); if (!(pSector->Flag & kSectUnderwater)) { diff --git a/source/games/exhumed/src/scorp.cpp b/source/games/exhumed/src/scorp.cpp index 145663ee1..60fa10560 100644 --- a/source/games/exhumed/src/scorp.cpp +++ b/source/games/exhumed/src/scorp.cpp @@ -260,7 +260,7 @@ void AIScorp::Tick(RunListEvent* ev) { if (pTarget == nMov.actor()) { - int nAngle = getangle(pTarget->s().x - pSprite->x, pTarget->s().y - pSprite->y); + int nAngle = getangle(pTarget->spr.x - pSprite->x, pTarget->spr.y - pSprite->y); if (AngleDiff(pSprite->ang, nAngle) < 64) { pActor->nAction = 2; @@ -441,11 +441,11 @@ void AIScorp::Effect(RunListEvent* ev, DExhumedActor* pTarget, int mode) pActor->nCount = 45; if (cansee(pSprite->x, pSprite->y, pSprite->z - GetActorHeight(pActor), pSprite->sector(), - pTarget->s().x, pTarget->s().y, pTarget->s().z - GetActorHeight(pTarget), pTarget->s().sector())) + pTarget->spr.x, pTarget->spr.y, pTarget->spr.z - GetActorHeight(pTarget), pTarget->spr.sector())) { pSprite->xvel = 0; pSprite->yvel = 0; - pSprite->ang = GetMyAngle(pTarget->s().x - pSprite->x, pTarget->s().y - pSprite->y); + pSprite->ang = GetMyAngle(pTarget->spr.x - pSprite->x, pTarget->spr.y - pSprite->y); pActor->nIndex = RandomSize(2) + RandomSize(3); @@ -465,7 +465,7 @@ void AIScorp::Effect(RunListEvent* ev, DExhumedActor* pTarget, int mode) return; } - if (!(pTarget->s().cstat & CSTAT_SPRITE_BLOCK_ALL)) + if (!(pTarget->spr.cstat & CSTAT_SPRITE_BLOCK_ALL)) { pActor->nAction = 0; pActor->nFrame = 0; diff --git a/source/games/exhumed/src/sequence.cpp b/source/games/exhumed/src/sequence.cpp index 4826b0c04..7fc5f8fb8 100644 --- a/source/games/exhumed/src/sequence.cpp +++ b/source/games/exhumed/src/sequence.cpp @@ -603,7 +603,7 @@ int seq_PlotSequence(int nSprite, int16_t edx, int16_t nFrame, int16_t ecx) nBase++; } - if (!(pTSprite->cstat & CSTAT_SPRITE_BLOCK_ALL) || (pOwner->s().statnum == 100 && nNetPlayerCount)) + if (!(pTSprite->cstat & CSTAT_SPRITE_BLOCK_ALL) || (pOwner->spr.statnum == 100 && nNetPlayerCount)) { pTSprite->ownerActor = nullptr; } diff --git a/source/games/exhumed/src/set.cpp b/source/games/exhumed/src/set.cpp index e474e9a11..21906e71d 100644 --- a/source/games/exhumed/src/set.cpp +++ b/source/games/exhumed/src/set.cpp @@ -271,7 +271,7 @@ void AISet::Tick(RunListEvent* ev) if (pTarget && nAction < 10) { - if (!(pTarget->s().cstat & CSTAT_SPRITE_BLOCK_ALL)) + if (!(pTarget->spr.cstat & CSTAT_SPRITE_BLOCK_ALL)) { pActor->pTarget = nullptr; pActor->nAction = 0; @@ -446,7 +446,7 @@ void AISet::Tick(RunListEvent* ev) { if (pTarget == nMov.actor()) { - int nAng = getangle(pTarget->s().x - pSprite->x, pTarget->s().y - pSprite->y); + int nAng = getangle(pTarget->spr.x - pSprite->x, pTarget->spr.y - pSprite->y); if (AngleDiff(pSprite->ang, nAng) < 64) { pActor->nAction = 4; @@ -621,7 +621,7 @@ void AISet::Tick(RunListEvent* ev) { if (pTarget) { - if (!(pTarget->s().cstat & CSTAT_SPRITE_BLOCK_ALL)) + if (!(pTarget->spr.cstat & CSTAT_SPRITE_BLOCK_ALL)) { pActor->nAction = 0; pActor->nFrame = 0; diff --git a/source/games/exhumed/src/snake.cpp b/source/games/exhumed/src/snake.cpp index bb906740f..d8e1464ff 100644 --- a/source/games/exhumed/src/snake.cpp +++ b/source/games/exhumed/src/snake.cpp @@ -174,7 +174,7 @@ void BuildSnake(int nPlayer, int zVal) { DExhumedActor* pTarget = nullptr; auto hitactor = hit.actor(); - if (hitactor && hitactor->s().statnum >= 90 && hitactor->s().statnum <= 199) { + if (hitactor && hitactor->spr.statnum >= 90 && hitactor->spr.statnum <= 199) { pTarget = hitactor; } else if (sPlayerInput[nPlayer].pTarget != nullptr) @@ -210,9 +210,9 @@ void BuildSnake(int nPlayer, int zVal) } else { - pSprite->x = sprt->s().x; - pSprite->y = sprt->s().y; - pSprite->z = sprt->s().z; + pSprite->x = sprt->spr.x; + pSprite->y = sprt->spr.y; + pSprite->z = sprt->spr.z; pSprite->xrepeat = 40 - 3 * i; pSprite->yrepeat = 40 - 3 * i; } @@ -345,7 +345,7 @@ void AISnake::Tick(RunListEvent* ev) } else { - if (!(pEnemySprite->s().cstat & CSTAT_SPRITE_BLOCK_ALL)) + if (!(pEnemySprite->spr.cstat & CSTAT_SPRITE_BLOCK_ALL)) { SnakeList[nSnake].pEnemy = nullptr; goto SEARCH_ENEMY; diff --git a/source/games/exhumed/src/sound.cpp b/source/games/exhumed/src/sound.cpp index 7da86aaab..ff9d85de1 100644 --- a/source/games/exhumed/src/sound.cpp +++ b/source/games/exhumed/src/sound.cpp @@ -478,7 +478,7 @@ void EXSoundEngine::CalcPosVel(int type, const void* source, const float pt[3], assert(actor != nullptr); if (actor != nullptr) { - *pos = GetSoundPos(&actor->s().pos); + *pos = GetSoundPos(&actor->spr.pos); } } if ((chanflags & CHANF_LISTENERZ) && type != SOURCE_None) @@ -567,9 +567,9 @@ void PlayFX2(int nSound, DExhumedActor* pActor, int sectf, EChanFlags chanflags, { fullvol = (sprflags & 0x2000) != 0; hiprio = (sprflags & 0x4000) != 0; - soundx = pActor->s().x; - soundy = pActor->s().y; - soundz = pActor->s().z; + soundx = pActor->spr.x; + soundy = pActor->spr.y; + soundz = pActor->spr.z; } int nVolume = 255; @@ -644,7 +644,7 @@ void PlayFX2(int nSound, DExhumedActor* pActor, int sectf, EChanFlags chanflags, } // Nuke: added nSprite >= 0 check - if (pActor != PlayerList[nLocalPlayer].Actor() && pActor != nullptr && (pActor->s().cstat & CSTAT_SPRITE_BLOCK_ALL)) + if (pActor != PlayerList[nLocalPlayer].Actor() && pActor != nullptr && (pActor->spr.cstat & CSTAT_SPRITE_BLOCK_ALL)) nCreepyTimer = kCreepyCount; } diff --git a/source/games/exhumed/src/spider.cpp b/source/games/exhumed/src/spider.cpp index 1f3c18620..24e0ede08 100644 --- a/source/games/exhumed/src/spider.cpp +++ b/source/games/exhumed/src/spider.cpp @@ -129,7 +129,7 @@ void AISpider::Tick(RunListEvent* ev) DExhumedActor* pTarget = spp->pTarget; - if (pTarget == nullptr || pTarget->s().cstat & CSTAT_SPRITE_BLOCK_ALL) + if (pTarget == nullptr || pTarget->spr.cstat & CSTAT_SPRITE_BLOCK_ALL) { switch (nAction) { @@ -316,7 +316,7 @@ void AISpider::Tick(RunListEvent* ev) { if (nMov.actor() == pTarget) { - int nAng = getangle(pTarget->s().x - sp->x, pTarget->s().y - sp->y); + int nAng = getangle(pTarget->spr.x - sp->x, pTarget->spr.y - sp->y); if (AngleDiff(sp->ang, nAng) < 64) { spp->nAction = 2; @@ -382,7 +382,7 @@ void AISpider::Damage(RunListEvent* ev) or should code below (action set, b set) happen? Other AI doesn't show consistency in this regard (see Scorpion code) */ - if (pTarget && pTarget->s().statnum == 100) + if (pTarget && pTarget->spr.statnum == 100) { spp->pTarget = pTarget; } diff --git a/source/games/exhumed/src/view.cpp b/source/games/exhumed/src/view.cpp index 387f48b9e..3ed53da73 100644 --- a/source/games/exhumed/src/view.cpp +++ b/source/games/exhumed/src/view.cpp @@ -237,8 +237,8 @@ void DrawView(double smoothRatio, bool sceneonly) } else { - nEnemyPal = pEnemy->s().pal; - pEnemy->s().pal = 5; + nEnemyPal = pEnemy->spr.pal; + pEnemy->spr.pal = 5; } } else @@ -444,7 +444,7 @@ void DrawView(double smoothRatio, bool sceneonly) { RestoreGreenPal(); if (nEnemyPal > -1) { - pEnemy->s().pal = (uint8_t)nEnemyPal; + pEnemy->spr.pal = (uint8_t)nEnemyPal; } DrawMap(smoothRatio); diff --git a/source/games/exhumed/src/wasp.cpp b/source/games/exhumed/src/wasp.cpp index 8cc019075..cf3ee92c7 100644 --- a/source/games/exhumed/src/wasp.cpp +++ b/source/games/exhumed/src/wasp.cpp @@ -217,7 +217,7 @@ void AIWasp::Tick(RunListEvent* ev) { pTarget = pActor->pTarget; - if (pTarget && (!(pTarget->s().cstat & CSTAT_SPRITE_BLOCK_ALL) || (pTarget->s().sector()->Flag & kSectUnderwater))) + if (pTarget && (!(pTarget->spr.cstat & CSTAT_SPRITE_BLOCK_ALL) || (pTarget->spr.sector()->Flag & kSectUnderwater))) { // goto pink pActor->pTarget = nullptr; diff --git a/source/games/sw/src/actor.cpp b/source/games/sw/src/actor.cpp index 974c647fe..a76d672bb 100644 --- a/source/games/sw/src/actor.cpp +++ b/source/games/sw/src/actor.cpp @@ -219,7 +219,7 @@ int DoActorDie(DSWActor* actor, DSWActor* weapActor, int meansofdeath) } u->ActorActionFunc = nullptr; // Get angle to player - sp->ang = NORM_ANGLE(getangle(u->targetActor->s().x - sp->x, u->targetActor->s().y - sp->y) + 1024); + sp->ang = NORM_ANGLE(getangle(u->targetActor->spr.x - sp->x, u->targetActor->spr.y - sp->y) + 1024); break; case UZI_SMOKE+1: // Shotgun @@ -242,7 +242,7 @@ int DoActorDie(DSWActor* actor, DSWActor* weapActor, int meansofdeath) DoActorBeginJump(actor); u->ActorActionFunc = nullptr; // Get angle to player - sp->ang = NORM_ANGLE(getangle(u->targetActor->s().x - sp->x, u->targetActor->s().y - sp->y) + 1024); + sp->ang = NORM_ANGLE(getangle(u->targetActor->spr.x - sp->x, u->targetActor->spr.y - sp->y) + 1024); break; default: @@ -775,7 +775,7 @@ int DoActorStopFall(DSWActor* actor) // don't stand on face or wall sprites - jump again - if (u->lowActor && !TEST(u->lowActor->s().cstat, CSTAT_SPRITE_ALIGNMENT_FLOOR)) + if (u->lowActor && !TEST(u->lowActor->spr.cstat, CSTAT_SPRITE_ALIGNMENT_FLOOR)) { //sp->ang = NORM_ANGLE(sp->ang + (RANDOM_P2(64<<8)>>8) - 32); sp->ang = NORM_ANGLE(sp->ang + 1024 + (RANDOM_P2(512<<8)>>8)); diff --git a/source/games/sw/src/ai.cpp b/source/games/sw/src/ai.cpp index b11e37431..f2d1873e7 100644 --- a/source/games/sw/src/ai.cpp +++ b/source/games/sw/src/ai.cpp @@ -232,7 +232,7 @@ bool CanSeePlayer(DSWActor* actor) // if actor can still see the player int look_height = SPRITEp_TOS(sp); - if (u->targetActor && FAFcansee(sp->x, sp->y, look_height, sp->sector(), u->targetActor->s().x, u->targetActor->s().y, ActorUpper(u->targetActor), u->targetActor->s().sector())) + if (u->targetActor && FAFcansee(sp->x, sp->y, look_height, sp->sector(), u->targetActor->spr.x, u->targetActor->spr.y, ActorUpper(u->targetActor), u->targetActor->spr.sector())) return true; else return false; @@ -343,7 +343,7 @@ int DoActorPickClosePlayer(DSWActor* actor) continue; // if co-op don't hurt teammate - // if (gNet.MultiGameType == MULTI_GAME_COOPERATIVE && !gNet.HurtTeammate && u->spal == pp->Actor()->s().spal) + // if (gNet.MultiGameType == MULTI_GAME_COOPERATIVE && !gNet.HurtTeammate && u->spal == pp->Actor()->spr.spal) // continue; } @@ -373,7 +373,7 @@ int DoActorPickClosePlayer(DSWActor* actor) continue; // if co-op don't hurt teammate - //if (gNet.MultiGameType == MULTI_GAME_COOPERATIVE && !gNet.HurtTeammate && u->spal == pp->Actor()->s().spal) + //if (gNet.MultiGameType == MULTI_GAME_COOPERATIVE && !gNet.HurtTeammate && u->spal == pp->Actor()->spr.spal) // continue; } @@ -438,8 +438,8 @@ DSWActor* GetPlayerSpriteNum(DSWActor* actor) int CloseRangeDist(DSWActor* actor1, DSWActor* actor2) { - int clip1 = actor1->s().clipdist; - int clip2 = actor2->s().clipdist; + int clip1 = actor1->spr.clipdist; + int clip2 = actor2->spr.clipdist; // add clip boxes and a fudge factor const int DIST_CLOSE_RANGE = 400; @@ -551,7 +551,7 @@ ANIMATORp DoActorActionDecide(DSWActor* actor) DoActorOperate(actor); // if far enough away and cannot see the player - dist = Distance(sp->x, sp->y, u->targetActor->s().x, u->targetActor->s().y); + dist = Distance(sp->x, sp->y, u->targetActor->spr.x, u->targetActor->spr.y); if (dist > 30000 && !ICanSee) { @@ -642,7 +642,7 @@ ANIMATORp DoActorActionDecide(DSWActor* actor) DoActorPickClosePlayer(actor); // if close by - dist = Distance(sp->x, sp->y, u->targetActor->s().x, u->targetActor->s().y); + dist = Distance(sp->x, sp->y, u->targetActor->spr.x, u->targetActor->spr.y); if (dist < 15000 || ICanSee) { if ((Facing(actor, u->targetActor) && dist < 10000) || ICanSee) @@ -952,7 +952,7 @@ int DoActorMoveCloser(DSWActor* actor) else { // turn to face player - sp->ang = getangle(u->targetActor->s().x - sp->x, u->targetActor->s().y - sp->y); + sp->ang = getangle(u->targetActor->spr.x - sp->x, u->targetActor->spr.y - sp->y); } } @@ -1200,7 +1200,7 @@ int InitActorAttack(DSWActor* actor) return 0; } - if (TEST(u->targetActor->s().cstat, CSTAT_SPRITE_TRANSLUCENT)) + if (TEST(u->targetActor->spr.cstat, CSTAT_SPRITE_TRANSLUCENT)) { InitActorRunAway(actor); return 0; @@ -1235,7 +1235,7 @@ int InitActorAttack(DSWActor* actor) //NewStateGroup(actor, u->ActorActionSet->Stand); // face player when attacking - sp->ang = NORM_ANGLE(getangle(u->targetActor->s().x - sp->x, u->targetActor->s().y - sp->y)); + sp->ang = NORM_ANGLE(getangle(u->targetActor->spr.x - sp->x, u->targetActor->spr.y - sp->y)); // If it's your own kind, lay off! if (u->ID == u->targetActor->u()->ID && !u->targetActor->u()->PlayerP) @@ -1278,7 +1278,7 @@ int DoActorAttack(DSWActor* actor) DoActorNoise(ChooseAction(u->Personality->Broadcast),actor); - DISTANCE(sp->x, sp->y, u->targetActor->s().x, u->targetActor->s().y, dist, a, b, c); + DISTANCE(sp->x, sp->y, u->targetActor->spr.x, u->targetActor->spr.y, dist, a, b, c); auto pActor = GetPlayerSpriteNum(actor); if ((u->ActorActionSet->CloseAttack[0] && dist < CloseRangeDist(actor, u->targetActor)) || @@ -1394,7 +1394,7 @@ int InitActorDuck(DSWActor* actor) u->ActorActionFunc = DoActorDuck; NewStateGroup(actor, u->ActorActionSet->Duck); - dist = Distance(sp->x, sp->y, u->targetActor->s().x, u->targetActor->s().y); + dist = Distance(sp->x, sp->y, u->targetActor->spr.x, u->targetActor->spr.y); if (dist > 8000) { @@ -1552,7 +1552,7 @@ int FindNewAngle(DSWActor* actor, int dir, int DistToMove) DistToMove = (DistToMove >> 2) + (DistToMove >> 3); // Find angle to from the player - oang = NORM_ANGLE(getangle(u->targetActor->s().x - sp->x, u->targetActor->s().y - sp->y)); + oang = NORM_ANGLE(getangle(u->targetActor->spr.x - sp->x, u->targetActor->spr.y - sp->y)); // choose a random angle array switch (dir) @@ -1700,7 +1700,7 @@ int InitActorReposition(DSWActor* actor) u->Dist = 0; rnum = RANDOM_P2(8<<8)>>8; - dist = Distance(sp->x, sp->y, u->targetActor->s().x, u->targetActor->s().y); + dist = Distance(sp->x, sp->y, u->targetActor->spr.x, u->targetActor->spr.y); if (dist < PlayerDist[rnum] || TEST(u->Flags, SPR_RUN_AWAY)) { diff --git a/source/games/sw/src/coolie.cpp b/source/games/sw/src/coolie.cpp index 31ebb37e7..47e14e284 100644 --- a/source/games/sw/src/coolie.cpp +++ b/source/games/sw/src/coolie.cpp @@ -586,7 +586,7 @@ int DoCoolieMove(DSWActor* actor) return 0; } - if (Distance(sp->x, sp->y, u->targetActor->s().x, u->targetActor->s().y) < 1200) + if (Distance(sp->x, sp->y, u->targetActor->spr.x, u->targetActor->spr.y) < 1200) { UpdateSinglePlayKills(actor); DoActorDie(actor, actor, 0); diff --git a/source/games/sw/src/copysect.cpp b/source/games/sw/src/copysect.cpp index f5ec31ae8..31ef6e21e 100644 --- a/source/games/sw/src/copysect.cpp +++ b/source/games/sw/src/copysect.cpp @@ -261,7 +261,7 @@ void CopySectorMatch(int match) it.Reset(STAT_COPY_DEST); while (auto dActor = it.Next()) { - if (match == dActor->s().lotag) + if (match == dActor->spr.lotag) KillActor(dActor); } @@ -269,7 +269,7 @@ void CopySectorMatch(int match) it.Reset(STAT_COPY_SOURCE); while (auto sActor = it.Next()) { - if (match == sActor->s().lotag) + if (match == sActor->spr.lotag) KillActor(sActor); } diff --git a/source/games/sw/src/draw.cpp b/source/games/sw/src/draw.cpp index 55e03a26d..7d662797c 100644 --- a/source/games/sw/src/draw.cpp +++ b/source/games/sw/src/draw.cpp @@ -301,7 +301,7 @@ void DoShadows(tspritetype* tsprite, int& spritesortcnt, tspriteptr_t tsp, int v loz = tu->loz; if (tu->lowActor) { - if (!TEST(tu->lowActor->s().cstat, CSTAT_SPRITE_ALIGNMENT_WALL | CSTAT_SPRITE_ALIGNMENT_FLOOR)) + if (!TEST(tu->lowActor->spr.cstat, CSTAT_SPRITE_ALIGNMENT_WALL | CSTAT_SPRITE_ALIGNMENT_FLOOR)) { loz = DoShadowFindGroundPoint(tsp); } @@ -762,7 +762,7 @@ void analyzesprites(tspritetype* tsprite, int& spritesortcnt, int viewx, int vie { tsp->pal = PALETTE_RED_LIGHTING; // Turn it off, it gets reset by PrintSpriteInfo - tActor->s().hitag = 0; + tActor->spr.hitag = 0; } } @@ -1254,7 +1254,7 @@ void PreDraw(void) SWStatIterator it(STAT_FLOOR_SLOPE_DONT_DRAW); while (auto actor = it.Next()) { - RESET(actor->s().sector()->floorstat, CSTAT_SECTOR_SLOPE); + RESET(actor->spr.sector()->floorstat, CSTAT_SECTOR_SLOPE); } } @@ -1264,7 +1264,7 @@ void PostDraw(void) SWStatIterator it(STAT_FLOOR_SLOPE_DONT_DRAW); while (auto actor = it.Next()) { - SET(actor->s().sector()->floorstat, CSTAT_SECTOR_SLOPE); + SET(actor->spr.sector()->floorstat, CSTAT_SECTOR_SLOPE); } it.Reset(STAT_FAF_COPY); @@ -1280,7 +1280,7 @@ void PreDrawStackedWater(void) SWStatIterator it(STAT_CEILING_FLOOR_PIC_OVERRIDE); while (auto itActor = it.Next()) { - SWSectIterator it2(itActor->s().sector()); + SWSectIterator it2(itActor->spr.sector()); while (auto itActor2 = it2.Next()) { if (itActor2->hasU()) diff --git a/source/games/sw/src/eel.cpp b/source/games/sw/src/eel.cpp index cdf7f116f..3e14e2657 100644 --- a/source/games/sw/src/eel.cpp +++ b/source/games/sw/src/eel.cpp @@ -477,7 +477,7 @@ int DoEelMatchPlayerZ(DSWActor* actor) // lower bound if (u->lowActor && u->targetActor == u->highActor) // this doesn't look right... { - DISTANCE(sp->x, sp->y, u->lowActor->s().x, u->lowActor->s().y, dist, a, b, c); + DISTANCE(sp->x, sp->y, u->lowActor->spr.x, u->lowActor->spr.y, dist, a, b, c); if (dist <= 300) bound = u->sz; else @@ -494,7 +494,7 @@ int DoEelMatchPlayerZ(DSWActor* actor) // upper bound if (u->highActor && u->targetActor == u->highActor) { - DISTANCE(sp->x, sp->y, u->highActor->s().x, u->highActor->s().y, dist, a, b, c); + DISTANCE(sp->x, sp->y, u->highActor->spr.x, u->highActor->spr.y, dist, a, b, c); if (dist <= 300) bound = u->sz; else diff --git a/source/games/sw/src/game.h b/source/games/sw/src/game.h index e5116d947..e2461d0c1 100644 --- a/source/games/sw/src/game.h +++ b/source/games/sw/src/game.h @@ -2191,7 +2191,7 @@ struct ANIMstruct return SectorObject[animindex].zmid; case ANIM_Spritez: if (animactor == nullptr) return scratch; - return animactor->s().z; + return animactor->spr.z; case ANIM_Userz: if (animactor == nullptr) return scratch; return animactor->u()->sz; diff --git a/source/games/sw/src/interpso.cpp b/source/games/sw/src/interpso.cpp index d1b26d275..2be220f01 100644 --- a/source/games/sw/src/interpso.cpp +++ b/source/games/sw/src/interpso.cpp @@ -113,15 +113,15 @@ static int &getvalue(so_interp::interp_data& element, bool write) return SectorObject[index].zmid; case soi_sprx: if (element.actorofang) - return element.actorofang->s().x; + return element.actorofang->spr.x; break; case soi_spry: if (element.actorofang) - return element.actorofang->s().y; + return element.actorofang->spr.y; break; case soi_sprz: if (element.actorofang) - return element.actorofang->s().z; + return element.actorofang->spr.z; break; default: break; @@ -165,7 +165,7 @@ static void so_setspriteanginterpolation(so_interp *interp, DSWActor* actor) data->curelement = soi_sprang; data->oldipos = data->lastipos = - data->lastoldipos = actor->s().ang; + data->lastoldipos = actor->spr.ang; data->lastangdiff = 0; data->actorofang = actor; } @@ -211,7 +211,7 @@ void so_addinterpolation(SECTOR_OBJECTp sop) SWSectIterator it(*sectp); while (auto actor = it.Next()) - if (actor->s().statnum == STAT_VATOR && SP_TAG1(&actor->s()) == SECT_VATOR) + if (actor->spr.statnum == STAT_VATOR && SP_TAG1(&actor->s()) == SECT_VATOR) { interp->hasvator = true; break; @@ -294,7 +294,7 @@ void so_updateinterpolations(void) // Stick at beginning of domovethings u->oangdiff = 0; if (!interpolating) data->lastangdiff = 0; - data->oldipos = actorofang->s().ang; + data->oldipos = actorofang->spr.ang; } } else @@ -332,7 +332,7 @@ void so_dointerpolations(int32_t smoothratio) // Stick at b continue; // target went poof. interp->data[i].bakipos = (interp->data[i].curelement == soi_sprang) ? - actorofang->s().ang : + actorofang->spr.ang : getvalue(interp->data[i], false); } if (interp->tic == 0) // Only if the SO has just moved @@ -391,9 +391,9 @@ void so_dointerpolations(int32_t smoothratio) // Stick at b DSWActor* actor = data->actorofang; if (!actor) continue; USERp u = actor->u(); - if (u && (actor->s().statnum != STAT_DEFAULT) && - ((TEST(u->Flags, SPR_SKIP4) && (actor->s().statnum <= STAT_SKIP4_INTERP_END)) || - (TEST(u->Flags, SPR_SKIP2) && (actor->s().statnum <= STAT_SKIP2_INTERP_END)))) + if (u && (actor->spr.statnum != STAT_DEFAULT) && + ((TEST(u->Flags, SPR_SKIP4) && (actor->spr.statnum <= STAT_SKIP4_INTERP_END)) || + (TEST(u->Flags, SPR_SKIP2) && (actor->spr.statnum <= STAT_SKIP2_INTERP_END)))) continue; } @@ -401,7 +401,7 @@ void so_dointerpolations(int32_t smoothratio) // Stick at b { DSWActor* actor = data->actorofang; if (!actor) continue; - actor->s().ang = NORM_ANGLE(data->lastoldipos + MulScale(data->lastangdiff, ratio, 16)); + actor->spr.ang = NORM_ANGLE(data->lastoldipos + MulScale(data->lastangdiff, ratio, 16)); } else { @@ -430,7 +430,7 @@ void so_restoreinterpolations(void) // Stick at end of drawscree if (data->curelement == soi_sprang) { auto actorofang = interp->data[i].actorofang; - if (actorofang) actorofang->s().ang = data->bakipos; + if (actorofang) actorofang->spr.ang = data->bakipos; } else getvalue(*data, true) = data->bakipos; diff --git a/source/games/sw/src/jweapon.cpp b/source/games/sw/src/jweapon.cpp index 6bfac42ec..9d390ec4b 100644 --- a/source/games/sw/src/jweapon.cpp +++ b/source/games/sw/src/jweapon.cpp @@ -1983,7 +1983,7 @@ int InitBloodSpray(DSWActor* actor, bool dogib, short velocity) int BloodSprayFall(DSWActor* actor) { - actor->s().z += 1500; + actor->spr.z += 1500; return 0; } diff --git a/source/games/sw/src/miscactr.cpp b/source/games/sw/src/miscactr.cpp index f1c9f5581..a7594fe70 100644 --- a/source/games/sw/src/miscactr.cpp +++ b/source/games/sw/src/miscactr.cpp @@ -155,7 +155,7 @@ int DoToiletGirl(DSWActor* actor) bool ICanSee = false; DoActorPickClosePlayer(actor); - ICanSee = FAFcansee(sp->x,sp->y,SPRITEp_MID(sp),sp->sector(),u->targetActor->s().x,u->targetActor->s().y,ActorMid(u->targetActor),u->targetActor->s().sector()); + ICanSee = FAFcansee(sp->x,sp->y,SPRITEp_MID(sp),sp->sector(),u->targetActor->spr.x,u->targetActor->spr.y,ActorMid(u->targetActor),u->targetActor->spr.sector()); if (u->FlagOwner != 1) { @@ -210,7 +210,7 @@ int NullToiletGirl(DSWActor* actor) bool ICanSee = false; DoActorPickClosePlayer(actor); - ICanSee = FAFcansee(sp->x,sp->y,SPRITEp_MID(sp),sp->sector(),u->targetActor->s().x,u->targetActor->s().y,u->targetActor->s().z,u->targetActor->s().sector()); + ICanSee = FAFcansee(sp->x,sp->y,SPRITEp_MID(sp),sp->sector(),u->targetActor->spr.x,u->targetActor->spr.y,u->targetActor->spr.z,u->targetActor->spr.sector()); if (!TEST(u->Flags,SPR_CLIMBING)) KeepActorOnFloor(actor); @@ -390,7 +390,7 @@ int DoWashGirl(DSWActor* actor) bool ICanSee = false; DoActorPickClosePlayer(actor); - ICanSee = FAFcansee(sp->x,sp->y,SPRITEp_MID(sp),sp->sector(),u->targetActor->s().x,u->targetActor->s().y,ActorMid(u->targetActor),u->targetActor->s().sector()); + ICanSee = FAFcansee(sp->x,sp->y,SPRITEp_MID(sp),sp->sector(),u->targetActor->spr.x,u->targetActor->spr.y,ActorMid(u->targetActor),u->targetActor->spr.sector()); if (RandomRange(1000) > 980 && u->ShellNum <= 0) { @@ -454,7 +454,7 @@ int NullWashGirl(DSWActor* actor) bool ICanSee = false; DoActorPickClosePlayer(actor); - ICanSee = FAFcansee(sp->x,sp->y,SPRITEp_MID(sp),sp->sector(),u->targetActor->s().x,u->targetActor->s().y,u->targetActor->s().z,u->targetActor->s().sector()); + ICanSee = FAFcansee(sp->x,sp->y,SPRITEp_MID(sp),sp->sector(),u->targetActor->spr.x,u->targetActor->spr.y,u->targetActor->spr.z,u->targetActor->spr.sector()); if (!TEST(u->Flags,SPR_CLIMBING)) KeepActorOnFloor(actor); @@ -1253,7 +1253,7 @@ int DoCarGirl(DSWActor* actor) bool ICanSee = false; DoActorPickClosePlayer(actor); - ICanSee = FAFcansee(sp->x,sp->y,SPRITEp_MID(sp),sp->sector(),u->targetActor->s().x,u->targetActor->s().y,ActorMid(u->targetActor),u->targetActor->s().sector()); + ICanSee = FAFcansee(sp->x,sp->y,SPRITEp_MID(sp),sp->sector(),u->targetActor->spr.x,u->targetActor->spr.y,ActorMid(u->targetActor),u->targetActor->spr.sector()); if (u->FlagOwner == 1) { @@ -1299,7 +1299,7 @@ int NullCarGirl(DSWActor* actor) bool ICanSee = false; DoActorPickClosePlayer(actor); - ICanSee = FAFcansee(sp->x,sp->y,SPRITEp_MID(sp),sp->sector(),u->targetActor->s().x,u->targetActor->s().y,u->targetActor->s().z,u->targetActor->s().sector()); + ICanSee = FAFcansee(sp->x,sp->y,SPRITEp_MID(sp),sp->sector(),u->targetActor->spr.x,u->targetActor->spr.y,u->targetActor->spr.z,u->targetActor->spr.sector()); if (!TEST(u->Flags,SPR_CLIMBING)) KeepActorOnFloor(actor); @@ -1467,7 +1467,7 @@ int DoMechanicGirl(DSWActor* actor) bool ICanSee = false; DoActorPickClosePlayer(actor); - ICanSee = FAFcansee(sp->x,sp->y,SPRITEp_MID(sp),sp->sector(),u->targetActor->s().x,u->targetActor->s().y,ActorMid(u->targetActor),u->targetActor->s().sector()); + ICanSee = FAFcansee(sp->x,sp->y,SPRITEp_MID(sp),sp->sector(),u->targetActor->spr.x,u->targetActor->spr.y,ActorMid(u->targetActor),u->targetActor->spr.sector()); if (u->FlagOwner == 1) { @@ -1513,7 +1513,7 @@ int NullMechanicGirl(DSWActor* actor) bool ICanSee = false; DoActorPickClosePlayer(actor); - ICanSee = FAFcansee(sp->x,sp->y,SPRITEp_MID(sp),sp->sector(),u->targetActor->s().x,u->targetActor->s().y,u->targetActor->s().z,u->targetActor->s().sector()); + ICanSee = FAFcansee(sp->x,sp->y,SPRITEp_MID(sp),sp->sector(),u->targetActor->spr.x,u->targetActor->spr.y,u->targetActor->spr.z,u->targetActor->spr.sector()); if (!TEST(u->Flags,SPR_CLIMBING)) KeepActorOnFloor(actor); @@ -1683,7 +1683,7 @@ int DoSailorGirl(DSWActor* actor) bool ICanSee = false; DoActorPickClosePlayer(actor); - ICanSee = FAFcansee(sp->x,sp->y,SPRITEp_MID(sp),sp->sector(),u->targetActor->s().x,u->targetActor->s().y,ActorMid(u->targetActor),u->targetActor->s().sector()); + ICanSee = FAFcansee(sp->x,sp->y,SPRITEp_MID(sp),sp->sector(),u->targetActor->spr.x,u->targetActor->spr.y,ActorMid(u->targetActor),u->targetActor->spr.sector()); if (u->FlagOwner == 1) { @@ -1734,7 +1734,7 @@ int NullSailorGirl(DSWActor* actor) static short alreadythrew = 0; DoActorPickClosePlayer(actor); - ICanSee = FAFcansee(sp->x,sp->y,SPRITEp_MID(sp),sp->sector(),u->targetActor->s().x,u->targetActor->s().y,u->targetActor->s().z,u->targetActor->s().sector()); + ICanSee = FAFcansee(sp->x,sp->y,SPRITEp_MID(sp),sp->sector(),u->targetActor->spr.x,u->targetActor->spr.y,u->targetActor->spr.z,u->targetActor->spr.sector()); if (!TEST(u->Flags,SPR_CLIMBING)) KeepActorOnFloor(actor); @@ -1890,7 +1890,7 @@ int DoPruneGirl(DSWActor* actor) bool ICanSee = false; DoActorPickClosePlayer(actor); - ICanSee = FAFcansee(sp->x,sp->y,SPRITEp_MID(sp),sp->sector(),u->targetActor->s().x,u->targetActor->s().y,ActorMid(u->targetActor),u->targetActor->s().sector()); + ICanSee = FAFcansee(sp->x,sp->y,SPRITEp_MID(sp),sp->sector(),u->targetActor->spr.x,u->targetActor->spr.y,ActorMid(u->targetActor),u->targetActor->spr.sector()); if (u->FlagOwner == 1) { @@ -1952,7 +1952,7 @@ int NullPruneGirl(DSWActor* actor) bool ICanSee = false; DoActorPickClosePlayer(actor); - ICanSee = FAFcansee(sp->x,sp->y,SPRITEp_MID(sp),sp->sector(),u->targetActor->s().x,u->targetActor->s().y,u->targetActor->s().z,u->targetActor->s().sector()); + ICanSee = FAFcansee(sp->x,sp->y,SPRITEp_MID(sp),sp->sector(),u->targetActor->spr.x,u->targetActor->spr.y,u->targetActor->spr.z,u->targetActor->spr.sector()); if (!TEST(u->Flags,SPR_CLIMBING)) KeepActorOnFloor(actor); diff --git a/source/games/sw/src/player.cpp b/source/games/sw/src/player.cpp index 4bb4cae81..eabe97bf4 100644 --- a/source/games/sw/src/player.cpp +++ b/source/games/sw/src/player.cpp @@ -1514,7 +1514,7 @@ void DoPlayerTurnVehicle(PLAYERp pp, float avel, int z, int floor_dist) if (MultiClipTurn(pp, NORM_ANGLE(sum.asbuild()), z, floor_dist)) { pp->angle.ang = sum; - pp->Actor()->s().ang = pp->angle.ang.asbuild(); + pp->Actor()->spr.ang = pp->angle.ang.asbuild(); } } } @@ -1542,7 +1542,7 @@ void DoPlayerTurnVehicleRect(PLAYERp pp, int *x, int *y, int *ox, int *oy) if (RectClipTurn(pp, NORM_ANGLE(sum.asbuild()), x, y, ox, oy)) { pp->angle.ang = sum; - pp->Actor()->s().ang = pp->angle.ang.asbuild(); + pp->Actor()->spr.ang = pp->angle.ang.asbuild(); } } } @@ -1582,7 +1582,7 @@ void DoPlayerTurnTurret(PLAYERp pp, float avel) } pp->angle.ang = new_ang; - pp->Actor()->s().ang = pp->angle.ang.asbuild(); + pp->Actor()->spr.ang = pp->angle.ang.asbuild(); } OperateSectorObject(pp->sop, pp->angle.ang.asbuild(), pp->sop->xmid, pp->sop->ymid); @@ -3437,7 +3437,7 @@ int DoPlayerWadeSuperJump(PLAYERp pp) if (hit.hitSector != nullptr && labs(hit.hitSector->floorz - pp->posz) < Z(50)) { - if (Distance(pp->posx, pp->posy, hit.hitpos.x, hit.hitpos.y) < ((((int)pp->Actor()->s().clipdist)<<2) + 256)) + if (Distance(pp->posx, pp->posy, hit.hitpos.x, hit.hitpos.y) < ((((int)pp->Actor()->spr.clipdist)<<2) + 256)) return true; } } @@ -3758,7 +3758,7 @@ bool PlayerOnLadder(PLAYERp pp) if (hit.actor() != nullptr) { - int cstat = hit.actor()->s().cstat; + int cstat = hit.actor()->spr.cstat; // if the sprite blocking you hit is not a wall sprite there is something between // you and the ladder if (TEST(cstat, CSTAT_SPRITE_BLOCK) && @@ -4335,7 +4335,7 @@ void DoPlayerStopDiveNoWarp(PLAYERp pp) RESET(pp->Flags, PF_DIVING|PF_DIVING_IN_LAVA); DoPlayerDivePalette(pp); DoPlayerNightVisionPalette(pp); - RESET(pp->Actor()->s().cstat, CSTAT_SPRITE_YCENTER); + RESET(pp->Actor()->spr.cstat, CSTAT_SPRITE_YCENTER); if (pp == Player + screenpeek) { COVER_SetReverb(0); @@ -4625,7 +4625,7 @@ void DoPlayerCurrent(PLAYERp pp) xvect = sectu->speed * synctics * bcos(sectu->ang) >> 4; yvect = sectu->speed * synctics * bsin(sectu->ang) >> 4; - push_ret = pushmove(&pp->pos, &pp->cursector, ((int)pp->Actor()->s().clipdist<<2), pp->ceiling_dist, pp->floor_dist, CLIPMASK_PLAYER); + push_ret = pushmove(&pp->pos, &pp->cursector, ((int)pp->Actor()->spr.clipdist<<2), pp->ceiling_dist, pp->floor_dist, CLIPMASK_PLAYER); if (push_ret < 0) { if (!TEST(pp->Flags, PF_DEAD)) @@ -4641,10 +4641,10 @@ void DoPlayerCurrent(PLAYERp pp) return; } Collision coll; - clipmove(pp->pos, &pp->cursector, xvect, yvect, ((int)pp->Actor()->s().clipdist<<2), pp->ceiling_dist, pp->floor_dist, CLIPMASK_PLAYER, coll); + clipmove(pp->pos, &pp->cursector, xvect, yvect, ((int)pp->Actor()->spr.clipdist<<2), pp->ceiling_dist, pp->floor_dist, CLIPMASK_PLAYER, coll); PlayerCheckValidMove(pp); - pushmove(&pp->pos, &pp->cursector, ((int)pp->Actor()->s().clipdist<<2), pp->ceiling_dist, pp->floor_dist, CLIPMASK_PLAYER); + pushmove(&pp->pos, &pp->cursector, ((int)pp->Actor()->spr.clipdist<<2), pp->ceiling_dist, pp->floor_dist, CLIPMASK_PLAYER); if (push_ret < 0) { if (!TEST(pp->Flags, PF_DEAD)) @@ -5003,7 +5003,7 @@ void DoPlayerBeginOperate(PLAYERp pp) // look for gun before trying to using it for (i = 0; sop->so_actors[i] != nullptr; i++) { - if (sop->so_actors[i]->s().statnum == STAT_SO_SHOOT_POINT) + if (sop->so_actors[i]->spr.statnum == STAT_SO_SHOOT_POINT) { SET(sop->flags, SOBJ_HAS_WEAPON); break; @@ -5088,7 +5088,7 @@ void DoPlayerBeginRemoteOperate(PLAYERp pp, SECTOR_OBJECTp sop) // look for gun before trying to using it for (i = 0; sop->so_actors[i] != nullptr; i++) { - if (sop->so_actors[i]->s().statnum == STAT_SO_SHOOT_POINT) + if (sop->so_actors[i]->spr.statnum == STAT_SO_SHOOT_POINT) { SET(sop->flags, SOBJ_HAS_WEAPON); break; @@ -6537,7 +6537,7 @@ void MoveSkipSavePos(void) // back up all sprite angles. while (auto actor = it.Next()) { - actor->s().backupang(); + actor->spr.backupang(); } } @@ -7047,7 +7047,7 @@ void InitMultiPlayerInfo(void) auto start0 = SpawnActor(MultiStatList[stat], ST1, nullptr, pp->cursector, pp->posx, pp->posy, pp->posz, pp->angle.ang.asbuild(), 0); start0->clearUser(); - start0->s().picnum = ST1; + start0->spr.picnum = ST1; } memset(SpawnPositionUsed,0,sizeof(SpawnPositionUsed)); diff --git a/source/games/sw/src/ripper2.cpp b/source/games/sw/src/ripper2.cpp index 5e77f4efe..ebaee19f7 100644 --- a/source/games/sw/src/ripper2.cpp +++ b/source/games/sw/src/ripper2.cpp @@ -1025,7 +1025,7 @@ int DoRipper2MoveHang(DSWActor* actor) short w, nw; // Don't keep clinging and going ever higher! - if (abs(sp->z - u->targetActor->s().z) > (4000<<4)) + if (abs(sp->z - u->targetActor->spr.z) > (4000<<4)) return 0; NewStateGroup(actor, u->ActorActionSet->Special[1]); diff --git a/source/games/sw/src/rooms.cpp b/source/games/sw/src/rooms.cpp index d2c0841e6..ee4643789 100644 --- a/source/games/sw/src/rooms.cpp +++ b/source/games/sw/src/rooms.cpp @@ -975,9 +975,9 @@ void CollectPortals() SWSectIterator it(sec); while (auto actor = it.Next()) { - int tx = actor->s().x; - int ty = actor->s().y; - int tz = actor->s().z; + int tx = actor->spr.x; + int ty = actor->spr.y; + int tz = actor->spr.z; auto tsect = §or[sec]; int match = FindViewSectorInScene(tsect, VIEW_LEVEL1); @@ -989,7 +989,7 @@ void CollectPortals() // got something! fp.othersector = sectnum(tsect); fp.offset = { tx, ty, tz }; - fp.offset -= actor->s().pos; + fp.offset -= actor->spr.pos; goto nextfg; } } @@ -1005,9 +1005,9 @@ void CollectPortals() SWSectIterator it(sec); while (auto actor = it.Next()) { - int tx = actor->s().x; - int ty = actor->s().y; - int tz = actor->s().z; + int tx = actor->spr.x; + int ty = actor->spr.y; + int tz = actor->spr.z; auto tsect = §or[sec]; int match = FindViewSectorInScene(tsect, VIEW_LEVEL2); @@ -1019,7 +1019,7 @@ void CollectPortals() // got something! fp.othersector = sectnum(tsect); fp.offset = { tx, ty, tz }; - fp.offset -= actor->s().pos; + fp.offset -= actor->spr.pos; goto nextcg; } } diff --git a/source/games/sw/src/skull.cpp b/source/games/sw/src/skull.cpp index 510c3b503..8fbacd3ca 100644 --- a/source/games/sw/src/skull.cpp +++ b/source/games/sw/src/skull.cpp @@ -377,7 +377,7 @@ int DoSkullJump(DSWActor* actor) int dist,a,b,c; - DISTANCE(sp->x, sp->y, u->targetActor->s().x, u->targetActor->s().y, dist, a, b, c); + DISTANCE(sp->x, sp->y, u->targetActor->spr.x, u->targetActor->spr.y, dist, a, b, c); if (dist < 1000 && SpriteOverlapZ(actor, u->targetActor, Z(32))) @@ -444,7 +444,7 @@ int DoSkullWait(DSWActor* actor) SPRITEp sp = &actor->s(); int a,b,c,dist; - DISTANCE(sp->x, sp->y, u->targetActor->s().x, u->targetActor->s().y, dist, a, b, c); + DISTANCE(sp->x, sp->y, u->targetActor->spr.x, u->targetActor->spr.y, dist, a, b, c); DoActorPickClosePlayer(actor); @@ -478,7 +478,7 @@ int DoSkullWait(DSWActor* actor) if (dist < 8000) { - sp->ang = getangle(u->targetActor->s().x - sp->x, u->targetActor->s().y - sp->y); + sp->ang = getangle(u->targetActor->spr.x - sp->x, u->targetActor->spr.y - sp->y); sp->xvel = 128 + (RANDOM_P2(256<<8)>>8); u->jump_speed = -700; NewStateGroup(actor, sg_SkullJump); @@ -774,7 +774,7 @@ int DoBettyJump(DSWActor* actor) { int dist,a,b,c; - DISTANCE(sp->x, sp->y, u->targetActor->s().x, u->targetActor->s().y, dist, a, b, c); + DISTANCE(sp->x, sp->y, u->targetActor->spr.x, u->targetActor->spr.y, dist, a, b, c); if (dist < 1000 && SpriteOverlapZ(actor, u->targetActor, Z(32))) @@ -839,7 +839,7 @@ int DoBettyWait(DSWActor* actor) SPRITEp sp = &actor->s(); int a,b,c,dist; - DISTANCE(sp->x, sp->y, u->targetActor->s().x, u->targetActor->s().y, dist, a, b, c); + DISTANCE(sp->x, sp->y, u->targetActor->spr.x, u->targetActor->spr.y, dist, a, b, c); DoActorPickClosePlayer(actor); @@ -873,7 +873,7 @@ int DoBettyWait(DSWActor* actor) if (dist < 8000) { - sp->ang = getangle(u->targetActor->s().x - sp->x, u->targetActor->s().y - sp->y); + sp->ang = getangle(u->targetActor->spr.x - sp->x, u->targetActor->spr.y - sp->y); sp->xvel = 128 + (RANDOM_P2(256<<8)>>8); u->jump_speed = -700; NewStateGroup(actor, sg_BettyJump); diff --git a/source/games/sw/src/slidor.cpp b/source/games/sw/src/slidor.cpp index f56886af2..e00e7c9d7 100644 --- a/source/games/sw/src/slidor.cpp +++ b/source/games/sw/src/slidor.cpp @@ -223,7 +223,7 @@ bool TestSlidorMatchActive(short match) void DoSlidorInterp(DSWActor* actor, INTERP_FUNC interp_func) { - auto sp = actor->s().sector(); + auto sp = actor->spr.sector(); // this code is just weird. auto startWall = sp->firstWall(); @@ -275,7 +275,7 @@ void DoSlidorInterp(DSWActor* actor, INTERP_FUNC interp_func) int DoSlidorMoveWalls(DSWActor* actor, int amt) { - auto sp = actor->s().sector(); + auto sp = actor->spr.sector(); // this code is just weird. auto startWall = sp->firstWall(); diff --git a/source/games/sw/src/sounds.cpp b/source/games/sw/src/sounds.cpp index f9399ed01..48427873c 100644 --- a/source/games/sw/src/sounds.cpp +++ b/source/games/sw/src/sounds.cpp @@ -534,7 +534,7 @@ void SWSoundEngine::CalcPosVel(int type, const void* source, const float pt[3], } else if (type == SOURCE_Actor || type == SOURCE_Player) { - vpos = type == SOURCE_Actor ? &((DSWActor*)source)->s().pos : &((PLAYERp)source)->pos; + vpos = type == SOURCE_Actor ? &((DSWActor*)source)->spr.pos : &((PLAYERp)source)->pos; FVector3 npos = GetSoundPos(vpos); *pos = npos; @@ -645,7 +645,7 @@ int _PlaySound(int num, DSWActor* actor, PLAYERp pp, vec3_t* pos, Voc3D_Flags fl { if (actor && !pos) { - pos = &actor->s().pos; + pos = &actor->spr.pos; actor = nullptr; } else if (pp && !pos) diff --git a/source/games/sw/src/sprite.cpp b/source/games/sw/src/sprite.cpp index ebe31e860..7ed31cd67 100644 --- a/source/games/sw/src/sprite.cpp +++ b/source/games/sw/src/sprite.cpp @@ -975,11 +975,11 @@ bool ActorTestSpawn(DSWActor* actor) if (sp->statnum == STAT_DEFAULT && sp->lotag == TAG_SPAWN_ACTOR) { auto actorNew = insertActor(sp->sector(), STAT_DEFAULT); - int t = actorNew->s().time; // must be preserved! + int t = actorNew->spr.time; // must be preserved! actorNew->s() = *sp; - actorNew->s().time = t; + actorNew->spr.time = t; change_actor_stat(actorNew, STAT_SPAWN_TRIGGER); - RESET(actorNew->s().cstat, CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN); + RESET(actorNew->spr.cstat, CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN); return false; } @@ -1070,7 +1070,7 @@ int EnemyCheckSkill() bool ActorSpawn(DSWActor* actor) { bool ret = true; - int picnum = actor->s().picnum; + int picnum = actor->spr.picnum; switch (picnum) { case COOLIE_RUN_R0: @@ -1507,8 +1507,8 @@ void PreMapCombineFloors(void) SWSectIterator it(dasect); while (auto jActor = it.Next()) { - jActor->s().x += dx; - jActor->s().y += dy; + jActor->spr.x += dx; + jActor->spr.y += dy; } for (auto& wal : wallsofsector(dasect)) @@ -1561,7 +1561,7 @@ void SpriteSetupPost(void) SWStatIterator it(STAT_FLOOR_PAN); while (auto iActor = it.Next()) { - SWSectIterator it2(iActor->s().sector()); + SWSectIterator it2(iActor->spr.sector()); while (auto jActor = it.Next()) { ds = &jActor->s(); @@ -3557,7 +3557,7 @@ bool ItemSpotClear(DSWActor* actor, short statnum, short id) SWSectIterator it(sip->sector()); while (auto itActor = it.Next()) { - if (itActor->s().statnum == statnum && itActor->u()->ID == id) + if (itActor->spr.statnum == statnum && itActor->u()->ID == id) { found = true; break; @@ -4377,7 +4377,7 @@ int NewStateGroup(DSWActor* actor, STATEp StateGroup[]) // turn anims off because people keep setting them in the // art file - RESET(picanm[actor->s().picnum].sf, PICANM_ANIMTYPE_MASK); + RESET(picanm[actor->spr.picnum].sf, PICANM_ANIMTYPE_MASK); return 0; } @@ -4837,7 +4837,7 @@ int move_actor(DSWActor* actor, int xchange, int ychange, int zchange) int DoStayOnFloor(DSWActor* actor) { - actor->s().z = actor->s().sector()->floorz; + actor->spr.z = actor->spr.sector()->floorz; return 0; } @@ -6010,7 +6010,7 @@ KeyMain: case ICON_FLAG: { - if (sp->pal == pp->Actor()->s().pal) break; // Can't pick up your own flag! + if (sp->pal == pp->Actor()->spr.pal) break; // Can't pick up your own flag! PlaySound(DIGI_ITEM, actor, v3df_dontpan); diff --git a/source/games/sw/src/track.cpp b/source/games/sw/src/track.cpp index b261031ee..287fa54c3 100644 --- a/source/games/sw/src/track.cpp +++ b/source/games/sw/src/track.cpp @@ -598,7 +598,7 @@ void TrackSetup(void) it.Reset(STAT_TRACK + ndx); while (auto actor = it.Next()) { - if (actor->s().lotag == TRACK_START) + if (actor->spr.lotag == TRACK_START) { ASSERT(t->NumPoints == 0); @@ -639,7 +639,7 @@ void TrackSetup(void) it.Reset(STAT_TRACK + ndx); while (auto actor = it.Next()) { - dist = Distance((tp + t->NumPoints - 1)->x, (tp + t->NumPoints - 1)->y, actor->s().x, actor->s().y); + dist = Distance((tp + t->NumPoints - 1)->x, (tp + t->NumPoints - 1)->y, actor->spr.x, actor->spr.y); if (dist < low_dist) { @@ -683,7 +683,7 @@ DSWActor* FindBoundSprite(int tag) SWStatIterator it(STAT_ST1); while (auto actor = it.Next()) { - if (actor->s().hitag == tag) + if (actor->spr.hitag == tag) { return actor; } @@ -1667,8 +1667,8 @@ void MovePoints(SECTOR_OBJECTp sop, short delta_ang, int nx, int ny) PlayerMove = false; // move child sprite along also - sop->sp_child->s().x = sop->xmid; - sop->sp_child->s().y = sop->ymid; + sop->sp_child->spr.x = sop->xmid; + sop->sp_child->spr.y = sop->ymid; // setting floorz if need be @@ -1861,7 +1861,7 @@ PlayerPart: //pp->posz -= PLAYER_HEIGHT + Z(12); DoPlayerZrange(pp); pp->posz = pp->loz - PLAYER_CRAWL_HEIGHT; - pp->Actor()->s().z = pp->loz; + pp->Actor()->spr.z = pp->loz; } else { @@ -1872,7 +1872,7 @@ PlayerPart: if (!TEST(pp->Flags, PF_JUMPING | PF_FALLING | PF_FLYING)) { pp->posz = pp->loz - PLAYER_HEIGHT; - pp->Actor()->s().z = pp->loz; + pp->Actor()->spr.z = pp->loz; } } } @@ -2871,7 +2871,7 @@ void DoAutoTurretObject(SECTOR_OBJECTp sop) if (shootp->statnum == STAT_SO_SHOOT_POINT) { if (!FAFcansee(shootp->x, shootp->y, shootp->z-Z(4), shootp->sector(), - u->targetActor->s().x, u->targetActor->s().y, ActorUpper(u->targetActor), u->targetActor->s().sector())) + u->targetActor->spr.x, u->targetActor->spr.y, ActorUpper(u->targetActor), u->targetActor->spr.sector())) { return; } @@ -2907,8 +2907,8 @@ void DoAutoTurretObject(SECTOR_OBJECTp sop) } } - //sop->ang_tgt = getangle(sop->xmid - u->targetActor->s().x, sop->ymid - u->targetActor->s().y); - sop->ang_tgt = getangle(u->targetActor->s().x - sop->xmid, u->targetActor->s().y - sop->ymid); + //sop->ang_tgt = getangle(sop->xmid - u->targetActor->spr.x, sop->ymid - u->targetActor->spr.y); + sop->ang_tgt = getangle(u->targetActor->spr.x - sop->xmid, u->targetActor->spr.y - sop->ymid); // get delta to target angle delta_ang = getincangle(sop->ang, sop->ang_tgt); diff --git a/source/games/sw/src/vis.cpp b/source/games/sw/src/vis.cpp index dedfd3c96..e8cded957 100644 --- a/source/games/sw/src/vis.cpp +++ b/source/games/sw/src/vis.cpp @@ -103,10 +103,10 @@ void VisViewChange(PLAYERp pp, int *vis) auto own = GetOwner(actor); if (own != nullptr) { - x = own->s().x; - y = own->s().y; - z = own->s().z; - sectp = own->s().sector(); + x = own->spr.x; + y = own->spr.y; + z = own->spr.z; + sectp = own->spr.sector(); } else { diff --git a/source/games/sw/src/warp.cpp b/source/games/sw/src/warp.cpp index 48f6d6511..8bda9842a 100644 --- a/source/games/sw/src/warp.cpp +++ b/source/games/sw/src/warp.cpp @@ -89,7 +89,7 @@ DSWActor* WarpPlane(int32_t* x, int32_t* y, int32_t* z, sectortype** sect) if (sp_ceiling) { - if (*z <= sp_ceiling->s().z) + if (*z <= sp_ceiling->spr.z) { return WarpToArea(sp_ceiling, x, y, z, sect); } @@ -97,7 +97,7 @@ DSWActor* WarpPlane(int32_t* x, int32_t* y, int32_t* z, sectortype** sect) if (sp_floor) { - if (*z >= sp_floor->s().z) + if (*z >= sp_floor->spr.z) { return WarpToArea(sp_floor, x, y, z, sect); } diff --git a/source/games/sw/src/weapon.cpp b/source/games/sw/src/weapon.cpp index 3d44433fc..2c08abf3c 100644 --- a/source/games/sw/src/weapon.cpp +++ b/source/games/sw/src/weapon.cpp @@ -3834,7 +3834,7 @@ int DoVomit(DSWActor* actor) if (u->coll.type == kHitSprite) { - if (TEST(u->coll.actor()->s().extra, SPRX_PLAYER_OR_ENEMY)) + if (TEST(u->coll.actor()->spr.extra, SPRX_PLAYER_OR_ENEMY)) { DoDamage(u->coll.actor(), actor); } @@ -4321,7 +4321,7 @@ bool WeaponMoveHit(DSWActor* actor) if (u->lowActor) { - if (u->lowActor->s().lotag == TAG_SPRITE_HIT_MATCH) + if (u->lowActor->spr.lotag == TAG_SPRITE_HIT_MATCH) { if (MissileHitMatch(actor, -1, u->lowActor)) return true; @@ -4343,7 +4343,7 @@ bool WeaponMoveHit(DSWActor* actor) // hit a floor sprite if (u->highActor) { - if (u->highActor->s().lotag == TAG_SPRITE_HIT_MATCH) + if (u->highActor->spr.lotag == TAG_SPRITE_HIT_MATCH) { if (MissileHitMatch(actor, -1, u->highActor)) return true; @@ -5145,7 +5145,7 @@ int ActorHealth(DSWActor* actor, short amt) PlaySound(DIGI_NINJACHOKE, actor, v3df_follow); InitPlasmaFountain(nullptr, actor); InitBloodSpray(actor,false,105); - sp->ang = NORM_ANGLE(getangle(u->targetActor->s().x - sp->x, u->targetActor->s().y - sp->y) + 1024); + sp->ang = NORM_ANGLE(getangle(u->targetActor->spr.x - sp->x, u->targetActor->spr.y - sp->y) + 1024); RESET(sp->cstat, CSTAT_SPRITE_YFLIP); if (sw_ninjahack) NewStateGroup(actor, sg_NinjaHariKari); @@ -5285,7 +5285,7 @@ int ActorStdMissile(DSWActor* actor, DSWActor* weapActor) if (goal != nullptr) { // attempt to see if it was killed - ASSERT(goal->s().insector()); + ASSERT(goal->spr.insector()); if (goal->hasU()) RESET(goal->u()->Flags, SPR_TARGETED); } @@ -7200,7 +7200,7 @@ static void DoHitscanDamage(DSWActor* weaponActor, DSWActor* hitActor) for (stat = 0; stat < SIZ(StatDamageList); stat++) { - if (hitActor->s().statnum == StatDamageList[stat]) + if (hitActor->spr.statnum == StatDamageList[stat]) { DoDamage(hitActor, weaponActor); break; @@ -7665,10 +7665,10 @@ int DoStar(DSWActor* actor) } if (u->lowActor) - if (u->lowActor->s().lotag == TAG_SPRITE_HIT_MATCH) + if (u->lowActor->spr.lotag == TAG_SPRITE_HIT_MATCH) break; if (u->highActor) - if (u->highActor->s().lotag == TAG_SPRITE_HIT_MATCH) + if (u->highActor->spr.lotag == TAG_SPRITE_HIT_MATCH) break; ScaleSpriteVector(actor, 58000); @@ -9625,7 +9625,7 @@ int DoRocket(DSWActor* actor) if ((u->FlagOwner -= ACTORMOVETICS)<=0 && u->spal == 20) { - DISTANCE(sp->x, sp->y, u->targetActor->s().x, u->targetActor->s().y, dist, a, b, c); + DISTANCE(sp->x, sp->y, u->targetActor->spr.x, u->targetActor->spr.y, dist, a, b, c); u->FlagOwner = dist>>6; // Special warn sound attached to each seeker spawned PlaySound(DIGI_MINEBEEP, actor, v3df_follow); @@ -11943,7 +11943,7 @@ int DoSerpRing(DSWActor* actor) !TEST(tu->PlayerP->Flags, PF_DEAD)) { u->targetActor = ou->targetActor; - DISTANCE(sp->x, sp->y, u->targetActor->s().x, u->targetActor->s().y, dist, a,b,c); + DISTANCE(sp->x, sp->y, u->targetActor->spr.x, u->targetActor->spr.y, dist, a,b,c); // if ((dist ok and random ok) OR very few skulls left) if ((dist < 18000 && (RANDOM_P2(2048<<5)>>5) < 16) || ou->Counter < 4) @@ -11956,7 +11956,7 @@ int DoSerpRing(DSWActor* actor) { extern STATEp sg_SkullJump[]; u->ID = SKULL_R0; - sp->ang = getangle(u->targetActor->s().x - sp->x, u->targetActor->s().y - sp->y); + sp->ang = getangle(u->targetActor->spr.x - sp->x, u->targetActor->spr.y - sp->y); sp->xvel = dist>>5; sp->xvel += DIV2(sp->xvel); sp->xvel += (RANDOM_P2(128<<8)>>8); @@ -11987,7 +11987,7 @@ int InitLavaThrow(DSWActor* actor) short w; // get angle to player and also face player when attacking - sp->ang = nang = getangle(u->targetActor->s().x - sp->x, u->targetActor->s().y - sp->y); + sp->ang = nang = getangle(u->targetActor->spr.x - sp->x, u->targetActor->spr.y - sp->y); nx = sp->x; ny = sp->y; @@ -12026,7 +12026,7 @@ int InitLavaThrow(DSWActor* actor) MissileSetPos(actorNew, DoLavaBoulder, 1200); // find the distance to the target (player) - dist = Distance(wp->x, wp->y, u->targetActor->s().x, u->targetActor->s().y); + dist = Distance(wp->x, wp->y, u->targetActor->spr.x, u->targetActor->spr.y); if (dist != 0) wu->zchange = wp->zvel = (wp->xvel * (ActorUpper(u->targetActor) - wp->z)) / dist; @@ -12336,7 +12336,7 @@ int InitEnemyNapalm(DSWActor* actor) } // find the distance to the target (player) - dist = Distance(wp->x, wp->y, u->targetActor->s().x, u->targetActor->s().y); + dist = Distance(wp->x, wp->y, u->targetActor->spr.x, u->targetActor->spr.y); if (dist != 0) wp->zvel = (wp->xvel * (ActorUpper(u->targetActor) - wp->z)) / dist; @@ -12438,7 +12438,7 @@ int InitEnemyMirv(DSWActor* actor) MissileSetPos(actorNew, DoMirv, 600); // find the distance to the target (player) - dist = Distance(wp->x, wp->y, u->targetActor->s().x, u->targetActor->s().y); + dist = Distance(wp->x, wp->y, u->targetActor->spr.x, u->targetActor->spr.y); if (dist != 0) wu->zchange = wp->zvel = (wp->xvel * (ActorUpper(u->targetActor) - wp->z)) / dist; @@ -12897,7 +12897,7 @@ int InitSumoNapalm(DSWActor* actor) } // find the distance to the target (player) - dist = Distance(wp->x, wp->y, u->targetActor->s().x, u->targetActor->s().y); + dist = Distance(wp->x, wp->y, u->targetActor->spr.x, u->targetActor->spr.y); if (dist != 0) wp->zvel = (wp->xvel * (ActorUpper(u->targetActor) - wp->z)) / dist; @@ -14913,7 +14913,7 @@ int InitSerpSpell(DSWActor* actor) for (i = 0; i < 2; i++) { - sp->ang = getangle(u->targetActor->s().x - sp->x, u->targetActor->s().y - sp->y); + sp->ang = getangle(u->targetActor->spr.x - sp->x, u->targetActor->spr.y - sp->y); auto actorNew = SpawnActor(STAT_MISSILE, SERP_METEOR, &sg_SerpMeteor[0][0], sp->sector(), sp->x, sp->y, sp->z, sp->ang, 1500); @@ -14949,7 +14949,7 @@ int InitSerpSpell(DSWActor* actor) np->ang = NORM_ANGLE(np->ang - lat_ang[i]); // find the distance to the target (player) - dist = Distance(np->x, np->y, u->targetActor->s().x, u->targetActor->s().y); + dist = Distance(np->x, np->y, u->targetActor->spr.x, u->targetActor->spr.y); if (dist != 0) np->zvel = (np->xvel * (ActorUpper(u->targetActor) - np->z)) / dist; @@ -15025,7 +15025,7 @@ int InitSerpMonstSpell(DSWActor* actor) for (i = 0; i < 1; i++) { - sp->ang = getangle(u->targetActor->s().x - sp->x, u->targetActor->s().y - sp->y); + sp->ang = getangle(u->targetActor->spr.x - sp->x, u->targetActor->spr.y - sp->y); auto actorNew = SpawnActor(STAT_MISSILE, SERP_METEOR, &sg_SerpMeteor[0][0], sp->sector(), sp->x, sp->y, sp->z, sp->ang, 500); @@ -15061,7 +15061,7 @@ int InitSerpMonstSpell(DSWActor* actor) np->ang = NORM_ANGLE(np->ang - lat_ang[i]); // find the distance to the target (player) - dist = Distance(np->x, np->y, u->targetActor->s().x, u->targetActor->s().y); + dist = Distance(np->x, np->y, u->targetActor->spr.x, u->targetActor->spr.y); if (dist != 0) np->zvel = (np->xvel * (ActorUpper(u->targetActor) - np->z)) / dist; @@ -15100,7 +15100,7 @@ int InitEnemyRocket(DSWActor* actor) PlaySound(DIGI_NINJARIOTATTACK, actor, v3df_none); // get angle to player and also face player when attacking - sp->ang = nang = getangle(u->targetActor->s().x - sp->x, u->targetActor->s().y - sp->y); + sp->ang = nang = getangle(u->targetActor->spr.x - sp->x, u->targetActor->spr.y - sp->y); nx = sp->x; ny = sp->y; @@ -15108,7 +15108,7 @@ int InitEnemyRocket(DSWActor* actor) // Spawn a shot auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R2, &s_Rocket[0][0], sp->sector(), - nx, ny, nz-Z(8), u->targetActor->s().ang, NINJA_BOLT_VELOCITY); + nx, ny, nz-Z(8), u->targetActor->spr.ang, NINJA_BOLT_VELOCITY); wp = &actorNew->s(); wu = actorNew->u(); @@ -15146,7 +15146,7 @@ int InitEnemyRocket(DSWActor* actor) MissileSetPos(actorNew, DoBoltThinMan, 400); // find the distance to the target (player) - dist = Distance(wp->x, wp->y, u->targetActor->s().x, u->targetActor->s().y); + dist = Distance(wp->x, wp->y, u->targetActor->spr.x, u->targetActor->spr.y); if (dist != 0) wu->zchange = wp->zvel = (wp->xvel * (ActorUpper(u->targetActor) - wp->z)) / dist; @@ -15182,7 +15182,7 @@ int InitEnemyRail(DSWActor* actor) PlaySound(DIGI_RAILFIRE, actor, v3df_dontpan|v3df_doppler); // get angle to player and also face player when attacking - sp->ang = nang = getangle(u->targetActor->s().x - sp->x, u->targetActor->s().y - sp->y); + sp->ang = nang = getangle(u->targetActor->spr.x - sp->x, u->targetActor->spr.y - sp->y); // add a bit of randomness if (RANDOM_P2(1024) < 512) @@ -15235,7 +15235,7 @@ int InitEnemyRail(DSWActor* actor) } // find the distance to the target (player) - dist = Distance(wp->x, wp->y, u->targetActor->s().x, u->targetActor->s().y); + dist = Distance(wp->x, wp->y, u->targetActor->spr.x, u->targetActor->spr.y); if (dist != 0) wu->zchange = wp->zvel = (wp->xvel * (ActorUpper(u->targetActor) - wp->z)) / dist; @@ -15271,7 +15271,7 @@ int InitZillaRocket(DSWActor* actor) PlaySound(DIGI_NINJARIOTATTACK, actor, v3df_none); // get angle to player and also face player when attacking - sp->ang = nang = getangle(u->targetActor->s().x - sp->x, u->targetActor->s().y - sp->y); + sp->ang = nang = getangle(u->targetActor->spr.x - sp->x, u->targetActor->spr.y - sp->y); for (i = 0; i < (int)SIZ(mp); i++) { @@ -15281,7 +15281,7 @@ int InitZillaRocket(DSWActor* actor) // Spawn a shot auto actorNew = SpawnActor(STAT_MISSILE, BOLT_THINMAN_R2, &s_Rocket[0][0], sp->sector(), - nx, ny, nz-Z(8), u->targetActor->s().ang, NINJA_BOLT_VELOCITY); + nx, ny, nz-Z(8), u->targetActor->spr.ang, NINJA_BOLT_VELOCITY); wp = &actorNew->s(); wu = actorNew->u(); @@ -15321,7 +15321,7 @@ int InitZillaRocket(DSWActor* actor) MissileSetPos(actorNew, DoBoltThinMan, mp[i].dist_out); // find the distance to the target (player) - dist = Distance(wp->x, wp->y, u->targetActor->s().x, u->targetActor->s().y); + dist = Distance(wp->x, wp->y, u->targetActor->spr.x, u->targetActor->spr.y); if (dist != 0) wu->zchange = wp->zvel = (wp->xvel * (ActorUpper(u->targetActor) - wp->z)) / dist; @@ -15338,7 +15338,7 @@ int InitEnemyStar(DSWActor* actor) int nx, ny, nz, dist, nang; // get angle to player and also face player when attacking - sp->ang = nang = NORM_ANGLE(getangle(u->targetActor->s().x - sp->x, u->targetActor->s().y - sp->y)); + sp->ang = nang = NORM_ANGLE(getangle(u->targetActor->spr.x - sp->x, u->targetActor->spr.y - sp->y)); nx = sp->x; ny = sp->y; @@ -15346,7 +15346,7 @@ int InitEnemyStar(DSWActor* actor) // Spawn a shot auto actorNew = SpawnActor(STAT_MISSILE, STAR1, s_Star, sp->sector(), - nx, ny, nz, u->targetActor->s().ang, NINJA_STAR_VELOCITY); + nx, ny, nz, u->targetActor->spr.ang, NINJA_STAR_VELOCITY); wp = &actorNew->s(); wu = actorNew->u(); @@ -15366,7 +15366,7 @@ int InitEnemyStar(DSWActor* actor) MissileSetPos(actorNew, DoStar, 400); // find the distance to the target (player) - dist = Distance(wp->x, wp->y, u->targetActor->s().x, u->targetActor->s().y); + dist = Distance(wp->x, wp->y, u->targetActor->spr.x, u->targetActor->spr.y); if (dist != 0) wu->zchange = wp->zvel = (wp->xvel * (ActorUpper(u->targetActor) - wp->z)) / dist; @@ -15383,7 +15383,7 @@ int InitEnemyCrossbow(DSWActor* actor) int nx, ny, nz, dist, nang; // get angle to player and also face player when attacking - sp->ang = nang = NORM_ANGLE(getangle(u->targetActor->s().x - sp->x, u->targetActor->s().y - sp->y)); + sp->ang = nang = NORM_ANGLE(getangle(u->targetActor->spr.x - sp->x, u->targetActor->spr.y - sp->y)); nx = sp->x; ny = sp->y; @@ -15391,7 +15391,7 @@ int InitEnemyCrossbow(DSWActor* actor) // Spawn a shot auto actorNew = SpawnActor(STAT_MISSILE, CROSSBOLT, &s_CrossBolt[0][0], sp->sector(), - nx, ny, nz, u->targetActor->s().ang, 800); + nx, ny, nz, u->targetActor->spr.ang, 800); wp = &actorNew->s(); wu = actorNew->u(); @@ -15416,7 +15416,7 @@ int InitEnemyCrossbow(DSWActor* actor) MissileSetPos(actorNew, DoStar, 400); // find the distance to the target (player) - dist = Distance(wp->x, wp->y, u->targetActor->s().x, u->targetActor->s().y); + dist = Distance(wp->x, wp->y, u->targetActor->spr.x, u->targetActor->spr.y); if (dist != 0) wu->zchange = wp->zvel = (wp->xvel * (ActorUpper(u->targetActor) - wp->z)) / dist; @@ -15437,7 +15437,7 @@ int InitSkelSpell(DSWActor* actor) PlaySound(DIGI_SPELEC, actor, v3df_none); // get angle to player and also face player when attacking - sp->ang = nang = NORM_ANGLE(getangle(u->targetActor->s().x - sp->x, u->targetActor->s().y - sp->y)); + sp->ang = nang = NORM_ANGLE(getangle(u->targetActor->spr.x - sp->x, u->targetActor->spr.y - sp->y)); nx = sp->x; ny = sp->y; @@ -15445,7 +15445,7 @@ int InitSkelSpell(DSWActor* actor) // Spawn a shot auto actorNew = SpawnActor(STAT_MISSILE, ELECTRO_ENEMY, s_Electro, sp->sector(), - nx, ny, nz, u->targetActor->s().ang, SKEL_ELECTRO_VELOCITY); + nx, ny, nz, u->targetActor->spr.ang, SKEL_ELECTRO_VELOCITY); wp = &actorNew->s(); wu = actorNew->u(); @@ -15460,7 +15460,7 @@ int InitSkelSpell(DSWActor* actor) SET(wp->cstat, CSTAT_SPRITE_YCENTER); // find the distance to the target (player) - dist = Distance(nx, ny, u->targetActor->s().x, u->targetActor->s().y); + dist = Distance(nx, ny, u->targetActor->spr.x, u->targetActor->spr.y); if (dist != 0) wp->zvel = (wp->xvel * (ActorUpper(u->targetActor) - nz)) / dist; @@ -15483,7 +15483,7 @@ int InitCoolgFire(DSWActor* actor) int nx, ny, nz, dist, nang; // get angle to player and also face player when attacking - sp->ang = nang = NORM_ANGLE(getangle(u->targetActor->s().x - sp->x, u->targetActor->s().y - sp->y)); + sp->ang = nang = NORM_ANGLE(getangle(u->targetActor->spr.x - sp->x, u->targetActor->spr.y - sp->y)); nx = sp->x; ny = sp->y; @@ -15496,7 +15496,7 @@ int InitCoolgFire(DSWActor* actor) PlaySound(DIGI_CGMAGIC, actor, v3df_follow); auto actorNew = SpawnActor(STAT_MISSILE, COOLG_FIRE, s_CoolgFire, sp->sector(), - nx, ny, nz, u->targetActor->s().ang, COOLG_FIRE_VELOCITY); + nx, ny, nz, u->targetActor->spr.ang, COOLG_FIRE_VELOCITY); wp = &actorNew->s(); wu = actorNew->u(); @@ -15519,7 +15519,7 @@ int InitCoolgFire(DSWActor* actor) PlaySound(DIGI_MAGIC1, actorNew, v3df_follow|v3df_doppler); // find the distance to the target (player) - dist = Distance(nx, ny, u->targetActor->s().x, u->targetActor->s().y); + dist = Distance(nx, ny, u->targetActor->spr.x, u->targetActor->spr.y); if (dist != 0) // (velocity * difference between the target and the throwing star) / @@ -19102,7 +19102,7 @@ void QueueGeneric(DSWActor* actor, short pic) ChangeActorSect(GenericQueue[GenericQueueHead], sp->sector()); KillActor(actor); actor = GenericQueue[GenericQueueHead]; - ASSERT(actor->s().statnum != MAXSTATUS); + ASSERT(actor->spr.statnum != MAXSTATUS); } sp = &actor->s(); @@ -19604,7 +19604,7 @@ void QueueLoWangs(DSWActor* actor) // move old sprite to new sprite's place SetActorZ(LoWangsQueue[LoWangsQueueHead], &sp->pos); NewSprite = LoWangsQueue[LoWangsQueueHead]; - ASSERT(NewSprite->s().statnum != MAXSTATUS); + ASSERT(NewSprite->spr.statnum != MAXSTATUS); } // Point passed in sprite to ps