- removed AddScale wrappers.

This commit is contained in:
Christoph Oelckers 2022-10-07 23:44:21 +02:00
parent 85b52b1c77
commit 8265239d2d
16 changed files with 81 additions and 91 deletions

View file

@ -496,16 +496,6 @@ struct spritetypebase
{
scale.Y = y;
}
void AddScaleX(double x)
{
scale.X += x;
}
void AddScaleY(double y)
{
scale.Y += y;
}
};

View file

@ -480,13 +480,13 @@ void moveplayers(void)
if (act->spr.scale.X < 0.65625)
{
act->spr.AddScaleX(0.0625);
act->spr.scale.X += (0.0625);
act->spr.cstat |= CSTAT_SPRITE_TRANSLUCENT;
}
else act->spr.SetScaleX(0.65625);
if (act->spr.scale.Y < 0.5625)
act->spr.AddScaleY(4);
act->spr.scale.Y += (4);
else
{
act->spr.SetScaleY(0.5625);
@ -2292,16 +2292,16 @@ bool bloodpool(DDukeActor* actor, bool puke)
{
if (actor->spr.scale.X < 1 && actor->spr.scale.Y < 1)
{
actor->spr.AddScaleX((krand() & 3) * REPEAT_SCALE);
actor->spr.AddScaleY((krand() & 3) * REPEAT_SCALE);
actor->spr.scale.X += ((krand() & 3) * REPEAT_SCALE);
actor->spr.scale.Y += ((krand() & 3) * REPEAT_SCALE);
}
}
else
{
if (actor->spr.scale.X < 0.5 && actor->spr.scale.Y < 0.5)
{
actor->spr.AddScaleX((krand() & 3) * REPEAT_SCALE);
actor->spr.AddScaleY((krand() & 3) * REPEAT_SCALE);
actor->spr.scale.X += ((krand() & 3) * REPEAT_SCALE);
actor->spr.scale.Y += ((krand() & 3) * REPEAT_SCALE);
}
}
}
@ -2333,8 +2333,8 @@ bool bloodpool(DDukeActor* actor, bool puke)
if (actor->temp_data[2] == 32)
{
actor->spr.AddScaleX(-6);
actor->spr.AddScaleY(-6);
actor->spr.scale.X += (-6);
actor->spr.scale.Y += (-6);
}
}
else actor->temp_data[1] = 0;

View file

@ -1480,9 +1480,9 @@ static bool weaponhitsector(DDukeActor* proj, const DVector3& oldpos, bool fireb
ssp(proj, CLIPMASK1);
proj->spr.extra >>= 1;
if (proj->spr.scale.X > 0.125 )
proj->spr.AddScaleX(-0.03125);
proj->spr.scale.X += (-0.03125);
if (proj->spr.scale.Y > 0.125 )
proj->spr.AddScaleY(-0.03125);
proj->spr.scale.Y += (-0.03125);
proj->spr.yint--;
return true;
}
@ -2275,8 +2275,8 @@ static void greenslime(DDukeActor *actor)
actor->spr.cstat &= ~CSTAT_SPRITE_YFLIP;
actor->spr.picnum = GREENSLIME + 4;
if (actor->spr.scale.X > 0.5 ) actor->spr.AddScaleX(-(krand() & 7) * REPEAT_SCALE);
if (actor->spr.scale.Y > 0.25 ) actor->spr.AddScaleY(-(krand() & 7) * REPEAT_SCALE);
if (actor->spr.scale.X > 0.5 ) actor->spr.scale.X += (-(krand() & 7) * REPEAT_SCALE);
if (actor->spr.scale.Y > 0.25 ) actor->spr.scale.Y += (-(krand() & 7) * REPEAT_SCALE);
else
{
actor->spr.SetScale(0.625, 0.25);
@ -2299,10 +2299,10 @@ static void greenslime(DDukeActor *actor)
actor->spr.pos = s5->spr.pos + s5->spr.angle.ToVector() * 0.5;
actor->spr.picnum = GREENSLIME + 2 + (global_random & 1);
if (actor->spr.scale.Y < 1) actor->spr.AddScaleY(0.03125);
if (actor->spr.scale.Y < 1) actor->spr.scale.Y += (0.03125);
else
{
if (actor->spr.scale.X < 0.5) actor->spr.AddScaleY(0.0625);
if (actor->spr.scale.X < 0.5) actor->spr.scale.Y += (0.0625);
else
{
actor->temp_data[0] = -1;
@ -2393,8 +2393,8 @@ static void greenslime(DDukeActor *actor)
if (actor->temp_data[0] == 1)
{
actor->spr.picnum = GREENSLIME;
if (actor->spr.scale.Y < 0.625) actor->spr.AddScaleY(0.125);
if (actor->spr.scale.X > 0.125 ) actor->spr.AddScaleX(-0.0625);
if (actor->spr.scale.Y < 0.625) actor->spr.scale.Y += (0.125);
if (actor->spr.scale.X > 0.125 ) actor->spr.scale.X += (-0.0625);
if (actor->vel.Z > -12)
actor->vel.Z -= 348 / 256.;
actor->spr.pos.Z += actor->vel.Z;
@ -2414,13 +2414,13 @@ static void greenslime(DDukeActor *actor)
if (actor->spr.pos.Z > actor->floorz - 8)
{
actor->spr.AddScaleY(-0.0625);
actor->spr.AddScaleX(0.03125);
actor->spr.scale.Y += (-0.0625);
actor->spr.scale.X += (0.03125);
}
else
{
if (actor->spr.scale.Y < 0.5625) actor->spr.AddScaleY(0.125);
if (actor->spr.scale.X > 0.125 ) actor->spr.AddScaleX(-0.0625);
if (actor->spr.scale.Y < 0.5625) actor->spr.scale.Y += (0.125);
if (actor->spr.scale.X > 0.125 ) actor->spr.scale.X += (-0.0625);
}
if (actor->spr.pos.Z > actor->floorz - 8)
@ -2459,7 +2459,7 @@ static void flamethrowerflame(DDukeActor *actor)
int ds = actor->temp_data[0] / 6;
if (actor->spr.scale.X < 0.1250)
{
actor->spr.AddScaleX(ds * REPEAT_SCALE);
actor->spr.scale.X += (ds * REPEAT_SCALE);
actor->spr.SetScaleY(actor->spr.scale.X);
}
actor->clipdist += ds * 0.25;
@ -3005,7 +3005,7 @@ void moveexplosions_d(void) // STATNUM 5
if (act->temp_data[0] == 7 * 26) continue;
act->spr.pos.Z += 1 / 16. + krandf(1 / 16.);
act->temp_data[0]++;
if ((act->temp_data[0] % 9) == 0) act->spr.AddScaleY(REPEAT_SCALE);
if ((act->temp_data[0] % 9) == 0) act->spr.scale.Y += (REPEAT_SCALE);
continue;
case NUKEBUTTON:

View file

@ -1054,9 +1054,9 @@ static bool weaponhitwall(DDukeActor *proj, walltype* wal, const DVector3& oldpo
{
proj->spr.extra >>= 1;
if (proj->spr.scale.X > 0.125 )
proj->spr.AddScaleX(-0.03125);
proj->spr.scale.X += (-0.03125);
if (proj->spr.scale.Y > 0.125 )
proj->spr.AddScaleY(-0.03125);
proj->spr.scale.Y += (-0.03125);
proj->spr.yint--;
}
@ -1138,9 +1138,9 @@ bool weaponhitsector(DDukeActor *proj, const DVector3& oldpos)
ssp(proj, CLIPMASK1);
proj->spr.extra >>= 1;
if (proj->spr.scale.X > 0.125 )
proj->spr.AddScaleX(-0.03125);
proj->spr.scale.X += (-0.03125);
if (proj->spr.scale.Y > 0.125 )
proj->spr.AddScaleY(-0.03125);
proj->spr.scale.Y += (-0.03125);
proj->spr.yint--;
return true;
}
@ -2907,7 +2907,7 @@ void moveexplosions_r(void) // STATNUM 5
if (act->temp_data[0] == 7 * 26) continue;
act->spr.pos.Z += 1 / 16. + krandf(1 / 16.);
act->temp_data[0]++;
if ((act->temp_data[0] % 9) == 0) act->spr.AddScaleY(REPEAT_SCALE);
if ((act->temp_data[0] % 9) == 0) act->spr.scale.Y += (REPEAT_SCALE);
continue;

View file

@ -241,8 +241,8 @@ void animatesprites_d(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
{
t->picnum = STATIC;
t->cstat |= randomFlip();
t->AddScaleX(0.125);
t->AddScaleY(0.125);
t->scale.X += (0.125);
t->scale.Y += (0.125);
}
else if (camsprite && camsprite == h->GetHitOwner())
{

View file

@ -2296,8 +2296,8 @@ int ParseState::parse(void)
parseifelse(ps[g_p].OnBoat == 1);
break;
case concmd_ifsizedown:
g_ac->spr.AddScaleX(-REPEAT_SCALE);
g_ac->spr.AddScaleY(-REPEAT_SCALE);
g_ac->spr.scale.X -= REPEAT_SCALE;
g_ac->spr.scale.Y -= REPEAT_SCALE;
parseifelse(g_ac->spr.scale.X <= 5 * REPEAT_SCALE);
break;
case concmd_ifwind:

View file

@ -347,8 +347,8 @@ int MoveBullet(int nBullet)
{
if (pBullet->field_E < 8)
{
pActor->spr.AddScaleX(-REPEAT_SCALE);
pActor->spr.AddScaleY(0.125);
pActor->spr.scale.X -= REPEAT_SCALE;
pActor->spr.scale.Y += (0.125);
pBullet->vect.Z -= 200/256.;
@ -367,8 +367,8 @@ int MoveBullet(int nBullet)
}
else
{
pActor->spr.AddScaleX(0.0625);
pActor->spr.AddScaleY(0.0625);
pActor->spr.scale.X += (0.0625);
pActor->spr.scale.Y += (0.0625);
}
}

View file

@ -492,8 +492,8 @@ void DoRegenerates()
{
if (pActor->spr.scale.X < s)
{
pActor->spr.AddScaleX(0.03125);
pActor->spr.AddScaleY(0.03125);
pActor->spr.scale.X += (0.03125);
pActor->spr.scale.Y += (0.03125);
continue;
}
}

View file

@ -1461,11 +1461,11 @@ void AISpark::Tick(RunListEvent* ev)
if (!pActor) return;
pActor->spr.shade += 3;
pActor->spr.AddScaleX(-0.03125);
pActor->spr.scale.X += (-0.03125);
if (pActor->spr.scale.X >= 0.0625 && pActor->spr.shade <= 100)
{
pActor->spr.AddScaleY(-0.03125);
pActor->spr.scale.Y += (-0.03125);
// calling BuildSpark() with 2nd parameter as '1' will set kTile986
if (pActor->spr.picnum == kTile986 && int((pActor->spr.scale.X * INV_REPEAT_SCALE)) & 2) // hack alert

View file

@ -383,13 +383,13 @@ void DoSpiritHead()
{
if (pSpiritSpr->spr.scale.X > nSpiritScale.X)
{
pSpiritSpr->spr.AddScaleX(-0.03125);
pSpiritSpr->spr.scale.X += (-0.03125);
if (pSpiritSpr->spr.scale.X < nSpiritScale.X)
pSpiritSpr->spr.SetScaleX(nSpiritScale.X);
}
if (pSpiritSpr->spr.scale.Y > nSpiritScale.Y)
{
pSpiritSpr->spr.AddScaleY(-0.03125);
pSpiritSpr->spr.scale.Y += (-0.03125);
if (pSpiritSpr->spr.scale.Y < nSpiritScale.Y)
pSpiritSpr->spr.SetScaleY(nSpiritScale.Y);
}

View file

@ -146,8 +146,8 @@ void AISoul::Tick(RunListEvent* ev)
if (pActor->spr.scale.X < 0.5)
{
pActor->spr.AddScaleX(REPEAT_SCALE);
pActor->spr.AddScaleY(REPEAT_SCALE);
pActor->spr.scale.X += (REPEAT_SCALE);
pActor->spr.scale.Y += (REPEAT_SCALE);
}
pActor->spr.extra += (pActor->nPhase & 0x0F) + 5;

View file

@ -1460,8 +1460,8 @@ int DoBunnyGrowUp(DSWActor* actor)
if ((actor->user.Counter -= ACTORMOVETICS) <= 0)
{
actor->spr.AddScaleX(REPEAT_SCALE);
actor->spr.AddScaleY(REPEAT_SCALE);
actor->spr.scale.X += (REPEAT_SCALE);
actor->spr.scale.Y += (REPEAT_SCALE);
if ((actor->spr.scale.X) > 1) actor->spr.SetScaleX(1);
if ((actor->spr.scale.Y) > 1) actor->spr.SetScaleY(1);
actor->user.Counter = 60;

View file

@ -870,7 +870,7 @@ int DoCoolgMove(DSWActor* actor)
if (actor->user.FlagOwner-1 == 0)
{
actor->spr.AddScaleX(-REPEAT_SCALE);
actor->spr.scale.X -= REPEAT_SCALE;
actor->spr.shade++;
if (actor->spr.scale.X < 0.0625) actor->spr.SetScaleX(0.0625);
if (actor->spr.shade > 126)
@ -882,7 +882,7 @@ int DoCoolgMove(DSWActor* actor)
else if (actor->user.FlagOwner-1 == 2)
{
actor->spr.hitag = 0;
actor->spr.AddScaleX(REPEAT_SCALE);
actor->spr.scale.X += (REPEAT_SCALE);
actor->spr.shade--;
if (actor->spr.scale.X > 0.65625) actor->spr.SetScaleX(0.65625);
if (actor->spr.shade < -10) actor->spr.shade = -10;

View file

@ -909,8 +909,8 @@ int SetupRipper2(DSWActor* actor)
if (actor->spr.pal == PALETTE_BROWN_RIPPER)
{
EnemyDefaults(actor, &Ripper2BrownActionSet, &Ripper2Personality);
actor->spr.AddScaleX(0.625);
actor->spr.AddScaleY(0.625);
actor->spr.scale.X += (0.625);
actor->spr.scale.Y += (0.625);
if (!(actor->spr.cstat & CSTAT_SPRITE_RESTORE))
actor->user.Health = HEALTH_MOMMA_RIPPER;

View file

@ -923,8 +923,8 @@ void SectorExp(DSWActor* actor, sectortype* sectp, double zh)
auto exp = SpawnSectorExp(actor);
if (!exp) return;
exp->spr.AddScaleX(((RANDOM_P2(32 << 8) >> 8) - 16) * REPEAT_SCALE);
exp->spr.AddScaleY(((RANDOM_P2(32 << 8) >> 8) - 16) * REPEAT_SCALE);
exp->spr.scale.X += (((RANDOM_P2(32 << 8) >> 8) - 16) * REPEAT_SCALE);
exp->spr.scale.Y += (((RANDOM_P2(32 << 8) >> 8) - 16) * REPEAT_SCALE);
exp->user.change.XY() = exp->spr.angle.ToVector(5.75);
}

View file

@ -4583,8 +4583,8 @@ int DoFireballFlames(DSWActor* actor)
if ((actor->user.WaitTics += MISSILEMOVETICS) > 4 * 120)
{
// shrink and go away
actor->spr.AddScaleX(-REPEAT_SCALE);
actor->spr.AddScaleY(-REPEAT_SCALE);
actor->spr.scale.X -= REPEAT_SCALE;
actor->spr.scale.Y -= REPEAT_SCALE;
if (actor->spr.scale.X <= 0)
{
@ -4602,8 +4602,8 @@ int DoFireballFlames(DSWActor* actor)
// grow until the right size
if (actor->spr.scale.X <= actor->user.Counter * REPEAT_SCALE)
{
actor->spr.AddScaleX(3 * REPEAT_SCALE);
actor->spr.AddScaleY(3 * REPEAT_SCALE);
actor->spr.scale.X += (3 * REPEAT_SCALE);
actor->spr.scale.Y += (3 * REPEAT_SCALE);
}
}
}
@ -4661,8 +4661,8 @@ int DoBreakFlames(DSWActor* actor)
if ((actor->user.WaitTics += MISSILEMOVETICS) > 4 * 120)
{
// shrink and go away
actor->spr.AddScaleX(-REPEAT_SCALE);
actor->spr.AddScaleY(-REPEAT_SCALE);
actor->spr.scale.X -= REPEAT_SCALE;
actor->spr.scale.Y -= REPEAT_SCALE;
if (actor->spr.scale.X <= 0)
{
@ -4680,8 +4680,8 @@ int DoBreakFlames(DSWActor* actor)
// grow until the right size
if (actor->spr.scale.X <= actor->user.Counter * REPEAT_SCALE)
{
actor->spr.AddScaleX(3 * REPEAT_SCALE);
actor->spr.AddScaleY(3 * REPEAT_SCALE);
actor->spr.scale.X += (3 * REPEAT_SCALE);
actor->spr.scale.Y += (3 * REPEAT_SCALE);
}
if (actor->user.WaitTics + MISSILEMOVETICS > 4 * 120)
@ -7638,8 +7638,8 @@ int DoStar(DSWActor* actor)
{
actor->user.motion_blur_num = 0;
ChangeState(actor, s_StarStuck);
actor->spr.AddScaleX(-0.25);
actor->spr.AddScaleY(-0.25);
actor->spr.scale.X += (-0.25);
actor->spr.scale.Y += (-0.25);
actor->spr.cstat &= ~(CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN);
actor->clipdist = 1;
actor->user.ceiling_dist = 2;
@ -7804,8 +7804,8 @@ int DoCrossBolt(DSWActor* actor)
int DoPlasmaDone(DSWActor* actor)
{
actor->spr.AddScaleX(actor->user.Counter * REPEAT_SCALE);
actor->spr.AddScaleY(-0.0625);
actor->spr.scale.X += (actor->user.Counter * REPEAT_SCALE);
actor->spr.scale.Y += (-0.0625);
actor->user.Counter += 2;
if (actor->spr.scale.Y < 0.09375)
@ -9145,8 +9145,8 @@ int DoPuff(DSWActor* actor)
int DoRailPuff(DSWActor* actor)
{
actor->spr.AddScaleX(0.0625);
actor->spr.AddScaleY(0.0625);
actor->spr.scale.X += (0.0625);
actor->spr.scale.Y += (0.0625);
return 0;
}
@ -10943,8 +10943,8 @@ int DoFireball(DSWActor* actor)
{
if (actor->user.Flags & (SPR_UNDERWATER))
{
actor->spr.AddScaleX(-REPEAT_SCALE);
actor->spr.AddScaleY(-REPEAT_SCALE);
actor->spr.scale.X -= REPEAT_SCALE;
actor->spr.scale.Y -= REPEAT_SCALE;
if (actor->spr.scale.X <= 0.578125)
{
SpawnSmokePuff(actor);
@ -11124,8 +11124,8 @@ int DoNapalm(DSWActor* actor)
if (actor->user.Flags & (SPR_UNDERWATER))
{
actor->spr.AddScaleX(-REPEAT_SCALE);
actor->spr.AddScaleY(-REPEAT_SCALE);
actor->spr.scale.X -= REPEAT_SCALE;
actor->spr.scale.Y -= REPEAT_SCALE;
if (actor->spr.scale.X <= 0.46875)
{
SpawnSmokePuff(actor);
@ -11295,7 +11295,7 @@ int DoSerpMeteor(DSWActor* actor)
{
auto oldv = actor->spr.pos;
actor->spr.AddScaleX(MISSILEMOVETICS * 2 * REPEAT_SCALE);
actor->spr.scale.X += (MISSILEMOVETICS * 2 * REPEAT_SCALE);
if (actor->spr.scale.X > 1.25)
actor->spr.SetScaleX(1.25);
@ -11340,7 +11340,7 @@ int DoSerpMeteor(DSWActor* actor)
int DoMirvMissile(DSWActor* actor)
{
actor->spr.AddScaleX(MISSILEMOVETICS * 2 * REPEAT_SCALE);
actor->spr.scale.X += (MISSILEMOVETICS * 2 * REPEAT_SCALE);
if (actor->spr.scale.X > 1.25)
actor->spr.SetScaleX(1.25);
@ -11525,8 +11525,8 @@ int DoRing(DSWActor* actor)
if (actor->user.Flags & (SPR_UNDERWATER))
{
actor->spr.AddScaleX(-REPEAT_SCALE);
actor->spr.AddScaleY(-REPEAT_SCALE);
actor->spr.scale.X -= REPEAT_SCALE;
actor->spr.scale.Y -= REPEAT_SCALE;
if (actor->spr.scale.X <= 0.46875)
{
SpawnSmokePuff(actor);
@ -14947,8 +14947,8 @@ int InitSkelSpell(DSWActor* actor)
actor->spr.pos.plusZ(-(ActorSizeZ(actor) * 0.5)), actor->user.targetActor->spr.angle, SKEL_ELECTRO_VELOCITY);
SetOwner(actor, actorNew);
actorNew->spr.AddScaleX(-0.3125);
actorNew->spr.AddScaleY(-0.3125);
actorNew->spr.scale.X += (-0.3125);
actorNew->spr.scale.Y += (-0.3125);
actorNew->spr.shade = -40;
actorNew->vel.Z = 0;
actorNew->spr.angle = actor->spr.angle;
@ -15155,8 +15155,8 @@ void InitFireballTrap(DSWActor* actor)
actorNew->spr.hitag = LUMINOUS; //Always full brightness
SetOwner(actor, actorNew);
actorNew->spr.AddScaleX(-0.3125);
actorNew->spr.AddScaleY(-0.3125);
actorNew->spr.scale.X += (-0.3125);
actorNew->spr.scale.Y += (-0.3125);
actorNew->spr.shade = -40;
actorNew->clipdist = 2;
actorNew->vel.Z = 0;
@ -18249,12 +18249,12 @@ int DoFloorBlood(DSWActor* actor)
// Make pool of blood seem to grow
if (actor->spr.scale.X < scale && actor->spr.scale.X > 0.0625)
{
actor->spr.AddScaleX(REPEAT_SCALE);
actor->spr.scale.X += (REPEAT_SCALE);
}
if (actor->spr.scale.Y < scale && actor->spr.scale.X < scale && actor->spr.scale.X > 0.0625)
{
actor->spr.AddScaleY(REPEAT_SCALE);
actor->spr.scale.Y += (REPEAT_SCALE);
}
// See if any players stepped in blood
@ -18277,7 +18277,7 @@ int DoFloorBlood(DSWActor* actor)
// If blood has already grown to max size, we can shrink it
if (actor->spr.scale.X == 0.625 && actor->spr.scale.Y > 0.15625)
{
actor->spr.AddScaleY(-0.15625);
actor->spr.scale.Y += (-0.15625);
if (actor->spr.scale.Y <= 0.15625) // Shrink it down and don't use it anymore
actor->spr.SetScale(0.0625, 0.0625);
}
@ -18299,7 +18299,7 @@ int DoWallBlood(DSWActor* actor)
// Make blood drip down the wall
if (actor->spr.scale.Y < 1.25)
{
actor->spr.AddScaleY(REPEAT_SCALE);
actor->spr.scale.Y += (REPEAT_SCALE);
actor->spr.pos.Z += 0.5;
}