- removed Scale(), CopyScale() and MultScale wrappers.

This commit is contained in:
Christoph Oelckers 2022-10-07 23:41:15 +02:00
parent 51768439a9
commit 85b52b1c77
22 changed files with 44 additions and 61 deletions

View file

@ -1222,7 +1222,7 @@ tspritetype* renderAddTsprite(tspriteArray& tsprites, DCoreActor* actor)
tspr->pal = actor->spr.pal;
tspr->clipdist = 0;
tspr->blend = actor->spr.blend;
tspr->CopyScale(&actor->spr);
tspr->scale = actor->spr.scale;
tspr->xoffset = actor->spr.xoffset;
tspr->yoffset = actor->spr.yoffset;
tspr->sectp = actor->spr.sectp;

View file

@ -506,22 +506,6 @@ struct spritetypebase
{
scale.Y += y;
}
void MultScale(double x)
{
scale *= x;
}
void CopyScale(const spritetypebase* other)
{
scale = other->scale;
}
DVector2 Scale() const
{
return scale;
}
};

View file

@ -2947,7 +2947,7 @@ static bool actKillModernDude(DBloodActor* actor, DAMAGE_TYPE damageType)
{
pEffect->spr.cstat = CSTAT_SPRITE_ALIGNMENT_FACING;
pEffect->spr.pal = 6;
pEffect->spr.CopyScale(&actor->spr);
pEffect->spr.scale = actor->spr.scale;
}
GIBTYPE nGibType;

View file

@ -1937,7 +1937,7 @@ DBloodActor* genDudeSpawn(DBloodActor* source, DBloodActor* actor, double nDist)
// inherit sprite size (useful for seqs with zero repeats)
if (source->spr.flags & kModernTypeFlag2)
{
spawned->spr.CopyScale(&source->spr);
spawned->spr.scale = source->spr.scale;
}
gKillMgr.AddKill(spawned);
@ -1981,7 +1981,7 @@ void genDudeTransform(DBloodActor* actor)
actor->spr.pal = actIncarnation->spr.pal;
actor->spr.shade = actIncarnation->spr.shade;
actor->copy_clipdist(actIncarnation);
actor->spr.CopyScale(&actIncarnation->spr);
actor->spr.scale = actIncarnation->spr.scale;
actor->xspr.txID = actIncarnation->xspr.txID;
actor->xspr.command = actIncarnation->xspr.command;

View file

@ -46,7 +46,6 @@ static DAngle gCameraAng;
DAngle random_angles[16][3];
// to allow quick replacement later
#define COPY_SCALE pNSprite->CopyScale(pTSprite);
//---------------------------------------------------------------------------
//
@ -196,7 +195,7 @@ static tspritetype* viewAddEffect(tspriteArray& tsprites, int nTSprite, VIEW_EFF
pNSprite->pos.Z = pTSprite->pos.Z;
pNSprite->cstat |= CSTAT_SPRITE_TRANSLUCENT;
pNSprite->shade = -128;
COPY_SCALE;
pNSprite->scale = pTSprite->scale;
pNSprite->picnum = 2135;
break;
}
@ -273,7 +272,7 @@ static tspritetype* viewAddEffect(tspriteArray& tsprites, int nTSprite, VIEW_EFF
if (i < 2)
pNSprite->cstat |= CSTAT_SPRITE_TRANSLUCENT | CSTAT_SPRITE_TRANS_FLIP;
pNSprite->shade = ClipLow(pTSprite->shade - 16, -128);
COPY_SCALE;
pNSprite->scale = pTSprite->scale;
pNSprite->picnum = pTSprite->picnum;
}
break;
@ -307,7 +306,7 @@ static tspritetype* viewAddEffect(tspriteArray& tsprites, int nTSprite, VIEW_EFF
pNSprite->picnum = 754;
pNSprite->cstat |= CSTAT_SPRITE_TRANSLUCENT;
pNSprite->shade = 8;
COPY_SCALE;
pNSprite->scale = pTSprite->scale;
break;
}
case kViewEffectSmokeLow:
@ -325,7 +324,7 @@ static tspritetype* viewAddEffect(tspriteArray& tsprites, int nTSprite, VIEW_EFF
pNSprite->picnum = 754;
pNSprite->cstat |= CSTAT_SPRITE_TRANSLUCENT;
pNSprite->shade = 8;
COPY_SCALE;
pNSprite->scale = pTSprite->scale;
break;
}
case kViewEffectTorchHigh:
@ -405,7 +404,7 @@ static tspritetype* viewAddEffect(tspriteArray& tsprites, int nTSprite, VIEW_EFF
pNSprite->pal = 2;
pNSprite->cstat |= CSTAT_SPRITE_TRANSLUCENT;
pNSprite->pos.Z = pTSprite->pos.Z;
COPY_SCALE;
pNSprite->scale = pTSprite->scale;
pNSprite->picnum = 2427;
break;
}

View file

@ -3353,7 +3353,7 @@ void useEffectGen(DBloodActor* sourceactor, DBloodActor* actor)
pEffect->spr.pal = sourceactor->spr.pal;
pEffect->spr.xoffset = sourceactor->spr.xoffset;
pEffect->spr.yoffset = sourceactor->spr.yoffset;
pEffect->spr.CopyScale(&sourceactor->spr);
pEffect->spr.scale = sourceactor->spr.scale;
pEffect->spr.shade = sourceactor->spr.shade;
}
@ -3787,7 +3787,7 @@ void useSeqSpawnerGen(DBloodActor* sourceactor, int objType, sectortype* pSector
{
spawned->spr.pal = sourceactor->spr.pal;
spawned->spr.shade = sourceactor->spr.shade;
spawned->spr.CopyScale(&sourceactor->spr);
spawned->spr.scale = sourceactor->spr.scale;
spawned->spr.xoffset = sourceactor->spr.xoffset;
spawned->spr.yoffset = sourceactor->spr.yoffset;
}
@ -9189,8 +9189,8 @@ void callbackUniMissileBurst(DBloodActor* actor, sectortype*) // 22
burstactor->spr.pal = actor->spr.pal;
burstactor->clipdist = actor->clipdist * 0.25;
burstactor->spr.flags = actor->spr.flags;
burstactor->spr.CopyScale(&actor->spr);
burstactor->spr.MultScale(0.5);
burstactor->spr.scale = actor->spr.scale;
burstactor->spr.scale *= 0.5;
burstactor->spr.angle = actor->spr.angle + mapangle(missileInfo[actor->spr.type - kMissileBase].angleOfs);
burstactor->SetOwner(actor);

View file

@ -2418,7 +2418,7 @@ void glasspieces(DDukeActor* actor)
if (sectp->lotag == 2)
actor->vel.Z *= 0.5;
actor->spr.MultScale(0.5);
actor->spr.scale *= 0.5;
if (rnd(96))
SetActor(actor, actor->spr.pos);
actor->temp_data[0]++;//Number of bounces

View file

@ -575,7 +575,7 @@ void guts_d(DDukeActor* actor, int gtype, int n, int p)
{
if (spawned->spr.picnum == JIBS2)
{
spawned->spr.MultScale(0.25);
spawned->spr.scale *= 0.25;
}
if (pal != 0)
spawned->spr.pal = pal;
@ -1568,7 +1568,7 @@ static void weaponcommon_d(DDukeActor* proj)
double zAdd = k * proj->vel.Z / 24;
auto spawned = CreateActor(proj->sector(), proj->spr.pos.plusZ(zAdd) + proj->spr.angle.ToVector() * k * 2.,
FIRELASER, -40 + (k << 2),
proj->spr.Scale(), nullAngle, 0., 0., proj->GetOwner(), 5);
proj->spr.scale, nullAngle, 0., 0., proj->GetOwner(), 5);
if (spawned)
{

View file

@ -1243,7 +1243,7 @@ static void weaponcommon_r(DDukeActor *proj)
double zAdd = k * proj->vel.Z / 24;
auto x = CreateActor(proj->sector(), proj->spr.pos.plusZ(zAdd) + proj->spr.angle.ToVector() * k * 2.,
FIRELASER, -40 + (k << 2),
proj->spr.Scale(), nullAngle, 0., 0., proj->GetOwner(), 5);
proj->spr.scale, nullAngle, 0., 0., proj->GetOwner(), 5);
if (x)
{
@ -1848,12 +1848,12 @@ static void rrra_specialstats()
case MAMA:
if (enemysizecheat == 3)
{
act->spr.MultScale(2);
act->spr.scale *= 2;
act->setClipDistFromTile();
}
else if (enemysizecheat == 2)
{
act->spr.MultScale(0.5);
act->spr.scale *= 0.5;
act->clipdist = act->spr.scale.X, tileHeight(act->spr.picnum) * 0.125;
}
break;

View file

@ -124,7 +124,7 @@ static const char *cheatKfc(int player)
if (spr)
{
spr->spr.pal = 1;
spr->spr.MultScale(4);
spr->spr.scale *= 4;
}
}
return quoteMgr.GetQuote(QUOTE_CHEAT_KFC);

View file

@ -730,7 +730,7 @@ static void shootrpg(DDukeActor *actor, int p, DVector3 pos, DAngle ang, int atw
else
{
spawned->spr.yint = gs.numfreezebounces;
spawned->spr.MultScale(0.5);
spawned->spr.scale *= 0.5;
spawned->vel.Z -= 0.25;
}
@ -797,7 +797,7 @@ static void shootrpg(DDukeActor *actor, int p, DVector3 pos, DAngle ang, int atw
DVector2 spawnofs(ang.Sin()* 4, ang.Cos() * -4);
spawned->spr.pos += spawnofs;
}
spawned->spr.MultScale(0.5);
spawned->spr.scale *= 0.5;
}
spawned->spr.cstat = CSTAT_SPRITE_YCENTER;

View file

@ -662,7 +662,7 @@ static void shootrpg(DDukeActor* actor, int p, DVector3 pos, DAngle ang, int atw
else
{
spawned->spr.yint = gs.numfreezebounces;
spawned->spr.MultScale(0.5);
spawned->spr.scale *= 0.5;
spawned->vel.Z -= 0.125;
}
@ -694,7 +694,7 @@ static void shootrpg(DDukeActor* actor, int p, DVector3 pos, DAngle ang, int atw
DVector2 spawnofs(ang.Sin() * 4, ang.Cos() * -4);
spawned->spr.pos += spawnofs;
}
spawned->spr.MultScale(0.5);
spawned->spr.scale *= 0.5;
}
spawned->spr.cstat = CSTAT_SPRITE_YCENTER;

View file

@ -673,7 +673,7 @@ void checkhitwall_d(DDukeActor* spr, walltype* wal, const DVector3& pos, int atw
else
{
if (atwith == CHAINGUN)
spawned = CreateActor(sptr, pos, FORCERIPPLE, -127, DVector2(0.25, 0.25) + spr->spr.Scale(), nullAngle, 0., 0., spr, 5);
spawned = CreateActor(sptr, pos, FORCERIPPLE, -127, DVector2(0.25, 0.25) + spr->spr.scale, nullAngle, 0., 0., spr, 5);
else spawned = CreateActor(sptr, pos, FORCERIPPLE, -127, DVector2(0.5, 0.5), nullAngle, 0., 0., spr, 5);
}
if (spawned)

View file

@ -220,7 +220,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
case FRAMEEFFECT1:
if (actj)
{
act->spr.CopyScale(&actj->spr);
act->spr.scale = actj->spr.scale;
act->temp_data[1] = actj->spr.picnum;
}
else act->spr.SetScale(0, 0);
@ -501,7 +501,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
case DUKELYINGDEAD:
if (actj && actj->spr.picnum == APLAYER)
{
act->spr.CopyScale(&actj->spr);
act->spr.scale = actj->spr.scale;
act->spr.shade = actj->spr.shade;
act->spr.pal = ps[actj->PlayerIndex()].palookup;
}
@ -644,7 +644,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
case PLAYERONWATER:
if (actj)
{
act->spr.CopyScale(&actj->spr);
act->spr.scale = actj->spr.scale;
act->vel.Z = 0.5;
if (act->sector()->lotag != 2)
act->spr.cstat |= CSTAT_SPRITE_INVISIBLE;

View file

@ -253,7 +253,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
rrra_badguy:
if (act->spr.picnum == JIBS6)
{
act->spr.MultScale(0.5);
act->spr.scale *= 0.5;
}
else if (isRRRA())
{
@ -288,7 +288,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
case FRAMEEFFECT1:
if (actj)
{
act->spr.CopyScale(&actj->spr);
act->spr.scale = actj->spr.scale;
if (actj->spr.picnum == APLAYER)
act->temp_data[1] = SMALLSMOKE;
else
@ -520,7 +520,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
case DUKELYINGDEAD:
if (actj && actj->spr.picnum == APLAYER)
{
act->spr.CopyScale(&actj->spr);
act->spr.scale = actj->spr.scale;
act->spr.shade = actj->spr.shade;
act->spr.pal = ps[actj->PlayerIndex()].palookup;
}
@ -634,7 +634,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
case PLAYERONWATER:
if (actj)
{
act->spr.CopyScale(&actj->spr);
act->spr.scale = actj->spr.scale;
act->vel.Z = 0.5;
if (act->sector()->lotag != 2)
act->spr.cstat |= CSTAT_SPRITE_INVISIBLE;

View file

@ -1414,7 +1414,7 @@ DExhumedActor* BuildSpark(DExhumedActor* pActor, int nVal)
}
else
{
pSpark->spr.SetScale(pActor->spr.Scale() + DVector2(0.234375, 0.234375));
pSpark->spr.SetScale(pActor->spr.scale + DVector2(0.234375, 0.234375));
}
}
else

View file

@ -338,7 +338,7 @@ void RestartPlayer(int nPlayer)
pActor->spr.lotag = runlist_HeadRun() + 1;
pDActor->spr.pos = pActor->spr.pos;
pDActor->spr.CopyScale(&pActor->spr);
pDActor->spr.scale = pActor->spr.scale;
pDActor->spr.xoffset = 0;
pDActor->spr.yoffset = 0;
pDActor->spr.shade = pActor->spr.shade;

View file

@ -66,7 +66,7 @@ void InitSpiritHead()
nPixels = 0;
auto pSpiritSpr = pSpiritSprite;
nSpiritScale = pSpiritSpr->spr.Scale();
nSpiritScale = pSpiritSpr->spr.scale;
tileLoad(kTileRamsesNormal); // Ramses Normal Head

View file

@ -643,7 +643,7 @@ int seq_PlotSequence(int nSprite, int16_t edx, int16_t nFrame, int16_t ecx)
tsp->shade = shade;
tsp->pal = pTSprite->pal;
tsp->CopyScale(pTSprite);
tsp->scale = pTSprite->scale;
tsp->angle = pTSprite->angle;
tsp->ownerActor = pTSprite->ownerActor;
tsp->sectp = pTSprite->sectp;

View file

@ -308,7 +308,7 @@ void DoShadows(tspriteArray& tsprites, tspritetype* tsp, double viewz)
}
else
{
scale = tsp->Scale();
scale = tsp->scale;
}
loz = ownerActor->user.loz;
@ -404,7 +404,7 @@ void DoMotionBlur(tspriteArray& tsprites, tspritetype const * const tsp)
dpos.XY() = npos.XY() = angle.ToVector() * ownerActor->user.motion_blur_dist;
dpos.Z = npos.Z = z_amt_per_pixel * ownerActor->user.motion_blur_dist * (1./16);
scale = tsp->Scale();
scale = tsp->scale;
switch ((ownerActor->user.Flags2 & SPR2_BLUR_TAPER))
{
@ -541,7 +541,7 @@ DSWActor* CopySprite(spritetypebase const* tsp, sectortype* newsector)
actorNew->spr.cstat = tsp->cstat;
actorNew->spr.picnum = tsp->picnum;
actorNew->spr.pal = tsp->pal;
actorNew->spr.CopyScale(tsp);
actorNew->spr.scale = tsp->scale;
actorNew->spr.xoffset = tsp->xoffset;
actorNew->spr.yoffset = tsp->yoffset;
actorNew->spr.angle = tsp->angle;

View file

@ -2485,7 +2485,7 @@ void SpawnPlayerUnderSprite(PLAYER* pp)
actor->spr.picnum = plActor->spr.picnum;
actor->copy_clipdist(plActor);
actor->spr.CopyScale(&plActor->spr);
actor->spr.scale = plActor->spr.scale;
}
//---------------------------------------------------------------------------

View file

@ -3832,7 +3832,7 @@ int DoVomit(DSWActor* actor)
actor->spr.pos.Z = actor->user.loz;
actor->user.WaitTics = 60;
// notreallypos
actor->user.pos.XY() = actor->spr.Scale();
actor->user.pos.XY() = actor->spr.scale;
return 0;
}
@ -17517,7 +17517,7 @@ DSWActor* SpawnBubble(DSWActor* actor)
double scale = (8 + (RANDOM_P2(8 << 8) >> 8)) * REPEAT_SCALE;
actorNew->spr.SetScale(scale, scale);
// notreallypos
actorNew->user.pos.XY() = actorNew->spr.Scale();
actorNew->user.pos.XY() = actorNew->spr.scale;
actorNew->user.ceiling_dist = 1;
actorNew->user.floor_dist = 1;
actorNew->spr.shade = actor->sector()->floorshade - 10;
@ -18332,7 +18332,7 @@ void QueueGeneric(DSWActor* actor, short pic)
return;
}
auto scale = actor->spr.Scale();
auto scale = actor->spr.scale;
// can and should kill the user portion
if (GenericQueue[GenericQueueHead] == nullptr)
@ -18817,7 +18817,7 @@ void QueueLoWangs(DSWActor* actor)
// Point passed in sprite to ps
spawnedActor->spr.cstat = 0;
spawnedActor->spr.CopyScale(&actor->spr);
spawnedActor->spr.scale = actor->spr.scale;
spawnedActor->spr.shade = actor->spr.shade;
spawnedActor->user.spal = spawnedActor->spr.pal = actor->spr.pal;
change_actor_stat(spawnedActor, STAT_DEFAULT); // Breakable