- 34 more uses of SetScale.

This commit is contained in:
Christoph Oelckers 2022-10-06 00:29:10 +02:00
parent e60fafec52
commit 71d61b26df
12 changed files with 36 additions and 54 deletions

View file

@ -536,13 +536,13 @@ void viewProcessSprites(tspriteArray& tsprites, const DVector3& cPos, DAngle cA,
auto owneractor = static_cast<DBloodActor*>(pTSprite->ownerActor);
if (owneractor->spr.detail > gDetail)
{
pTSprite->xrepeat = 0;
pTSprite->SetScale(0, 0);
continue;
}
int nTile = pTSprite->picnum;
if (nTile < 0 || nTile >= kMaxTiles)
{
pTSprite->xrepeat = 0;
pTSprite->SetScale(0, 0);
continue;
}
// skip picnum 0 on face sprites. picnum 0 is a simple wall texture in Blood,
@ -550,7 +550,7 @@ void viewProcessSprites(tspriteArray& tsprites, const DVector3& cPos, DAngle cA,
// Since the wall texture is perfectly fine for wall and floor sprites, these will be allowed to pass.
if (nTile == 0 && (pTSprite->cstat & CSTAT_SPRITE_ALIGNMENT_MASK) == CSTAT_SPRITE_ALIGNMENT_FACING)
{
pTSprite->xrepeat = 0;
pTSprite->SetScale(0, 0);
continue;
}
@ -810,7 +810,7 @@ void viewProcessSprites(tspriteArray& tsprites, const DVector3& cPos, DAngle cA,
if (pTSprite->statnum == kStatFlare) {
if (owneractor->GetTarget() == pPlayer->actor)
{
pTSprite->xrepeat = 0;
pTSprite->SetScale(0, 0);
break;
}
}
@ -841,7 +841,7 @@ void viewProcessSprites(tspriteArray& tsprites, const DVector3& cPos, DAngle cA,
auto target = owneractor->GetTarget();
if (target && target->IsPlayerActor())
{
pTSprite->xrepeat = 0;
pTSprite->SetScale(0, 0);
break;
}
}

View file

@ -560,7 +560,7 @@ void sleeveStopBouncing(DBloodActor* actor)
}
actor->spr.type = FX_51;
actor->spr.xrepeat = actor->spr.yrepeat = 10;
actor->spr.SetScale(0.15625, 0.15625);
}

View file

@ -1082,7 +1082,7 @@ CLEAR_THE_BOLT2:
actor->temp_data[2]--;
return;
}
if ((actor->spr.xrepeat | actor->spr.yrepeat) == 0)
if ((actor->spr.xrepeat == 0 && actor->spr.yrepeat) == 0)
{
actor->spr.xrepeat = actor->temp_data[0];
actor->spr.yrepeat = actor->temp_data[1];

View file

@ -220,7 +220,7 @@ void animatesprites_d(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
if (OwnerAc && OwnerAc->spr.statnum == STAT_PLAYER)
{
if (display_mirror == 0 && OwnerAc->PlayerIndex() == screenpeek && ps[screenpeek].over_shoulder_on == 0)
t->xrepeat = 0;
t->SetScale(0, 0);
else
{
t->angle = (viewVec - t->pos.XY()).Angle();

View file

@ -212,7 +212,7 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
if (OwnerAc && OwnerAc->spr.statnum == STAT_PLAYER)
{
if (display_mirror == 0 && OwnerAc->PlayerIndex() == screenpeek && ps[OwnerAc->PlayerIndex()].over_shoulder_on == 0)
t->xrepeat = 0;
t->SetScale(0, 0);
else
{
t->angle = (viewVec - t->pos.XY()).Angle();

View file

@ -2235,8 +2235,7 @@ int ParseState::parse(void)
g_ac->spr.shade = -12;
g_ac->clipdist = 16;
g_ac->spr.xrepeat = 42;
g_ac->spr.yrepeat = 36;
g_ac->spr.SetScale(0.65625, 0.5625);
g_ac->SetOwner(g_ac);
g_ac->spr.xoffset = 0;
g_ac->spr.pal = ps[g_p].palookup;

View file

@ -210,8 +210,7 @@ static void shootflamethrowerflame(DDukeActor* actor, int p, DVector3 spos, DAng
spawned->setsector(actor->sector());
spawned->spr.cstat = CSTAT_SPRITE_YCENTER;
spawned->spr.angle = sang;
spawned->spr.xrepeat = 2;
spawned->spr.yrepeat = 2;
spawned->spr.SetScale(0.03125, 0.03125);
spawned->clipdist = 10;
spawned->spr.yint = p;
spawned->SetOwner(actor);
@ -221,8 +220,7 @@ static void shootflamethrowerflame(DDukeActor* actor, int p, DVector3 spos, DAng
if (actor->spr.picnum == BOSS5)
{
spawned->spr.pos += sang.ToVector() * (128. / 7);
spawned->spr.xrepeat = 10;
spawned->spr.yrepeat = 10;
spawned->spr.SetScale(0.15625, 0.15625);
}
}
}
@ -449,7 +447,7 @@ static void shootweapon(DDukeActor *actor, int p, DVector3 pos, DAngle ang, int
{
jib->spr.pos.Z += 4;
jib->vel.X = 1;
jib->spr.xrepeat = jib->spr.yrepeat = 24;
jib->spr.SetScale(0.375, 0.375);
jib->spr.angle += DAngle22_5 / 2 - randomAngle(22.5);
}
}
@ -790,7 +788,7 @@ static void shootrpg(DDukeActor *actor, int p, DVector3 pos, DAngle ang, int atw
spawned->spr.pos += spawnofs;
spawned->spr.angle += aoffs;
spawned->spr.xrepeat = 42;
spawned->spr.SetScale(0.65625, 0.65625);
spawned->spr.yrepeat = 42;
}
else if (actor->spr.picnum == BOSS2)
@ -807,13 +805,11 @@ static void shootrpg(DDukeActor *actor, int p, DVector3 pos, DAngle ang, int atw
spawned->spr.pos += spawnofs;
spawned->spr.angle += aoffs;
spawned->spr.xrepeat = 24;
spawned->spr.yrepeat = 24;
spawned->spr.SetScale(0.375, 0.375);
}
else if (atwith != FREEZEBLAST)
{
spawned->spr.xrepeat = 30;
spawned->spr.yrepeat = 30;
spawned->spr.SetScale(0.46875, 0.46875);
spawned->spr.extra >>= 2;
}
}
@ -987,7 +983,7 @@ static void shootgrowspark(DDukeActor* actor, int p, DVector3 pos, DAngle ang)
spark->spr.pal = 2;
spark->spr.cstat |= CSTAT_SPRITE_YCENTER | CSTAT_SPRITE_TRANSLUCENT;
spark->spr.xrepeat = spark->spr.yrepeat = 1;
spark->spr.SetScale(REPEAT_SCALE, REPEAT_SCALE);
if (hit.hitWall == nullptr && hit.actor() == nullptr && hit.hitSector != nullptr)
{

View file

@ -312,8 +312,7 @@ static void shootweapon(DDukeActor* actor, int p, DVector3 pos, DAngle ang, int
{
if (hit.hitSector->ceilingstat & CSTAT_SECTOR_SKY)
{
spark->spr.xrepeat = 0;
spark->spr.yrepeat = 0;
spark->spr.SetScale(0, 0);
return;
}
else
@ -336,7 +335,7 @@ static void shootweapon(DDukeActor* actor, int p, DVector3 pos, DAngle ang, int
{
jib->spr.pos.Z += 4;
jib->vel.X = 1;
jib->spr.xrepeat = jib->spr.yrepeat = 24;
jib->spr.SetScale(0.375, 0.375);
jib->spr.angle += DAngle22_5 / 2 - randomAngle(22.5);
}
}
@ -581,8 +580,7 @@ static void shootstuff(DDukeActor* actor, int p, DVector3 pos, DAngle ang, int a
if (atwith == FIRELASER)
{
spawned->spr.xrepeat = 8;
spawned->spr.yrepeat = 8;
spawned->spr.SetScale(0.125, 0.125);
}
scount--;
@ -2355,7 +2353,7 @@ static void underwater(int snum, ESyncBits actions, double floorz, double ceilin
if (j)
{
j->spr.pos += (p->angle.ang.ToVector() + DVector2(12 - (global_random & 8), 12 - (global_random & 8))) * 16;
j->spr.xrepeat = 3;
j->spr.SetScale(0.046875, 0.03125);
j->spr.yrepeat = 2;
j->spr.pos.Z = p->pos.Z + 8;
j->spr.cstat = CSTAT_SPRITE_TRANS_FLIP | CSTAT_SPRITE_TRANSLUCENT;

View file

@ -615,8 +615,8 @@ void resetpspritevars(int g)
{
act->SetOwner(act);
act->spr.shade = 0;
act->spr.xrepeat = isRR() ? 24 : 42;
act->spr.yrepeat = isRR() ? 17 : 36;
if (isRR()) act->spr.SetScale(0.375, 0.265625);
else act->spr.SetScale(0.65625, 0.5625);
act->spr.cstat = CSTAT_SPRITE_BLOCK_ALL;
act->spr.xoffset = 0;
act->clipdist = 16;

View file

@ -286,8 +286,7 @@ void spawntransporter(DDukeActor *actj, DDukeActor* act, bool beam)
if (actj == nullptr) return;
if (beam)
{
act->spr.xrepeat = 31;
act->spr.yrepeat = 1;
act->spr.SetScale(0.484375, REPEAT_SCALE);
act->spr.pos.Z = actj->sector()->floorz - gs.playerheight;
}
else

View file

@ -67,8 +67,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
}
else
{
act->spr.xrepeat = 80;
act->spr.yrepeat = 80;
act->spr.SetScale(1.25, 1.25);
act->clipdist = 41;
}
}
@ -228,8 +227,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
break;
case LASERLINE:
act->spr.yrepeat = 6;
act->spr.xrepeat = 32;
act->spr.SetScale(0.5, 0.09375);
if (gs.lasermode == 1)
act->spr.cstat = CSTAT_SPRITE_ALIGNMENT_WALL | CSTAT_SPRITE_TRANSLUCENT;
@ -237,8 +235,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
act->spr.cstat = CSTAT_SPRITE_ALIGNMENT_WALL;
else
{
act->spr.xrepeat = 0;
act->spr.yrepeat = 0;
act->spr.SetScale(0, 0);
}
if (actj) act->spr.angle = actj->temp_angle + DAngle90;
@ -253,7 +250,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
}
else
{
act->spr.xrepeat = act->spr.yrepeat = 1;
act->spr.SetScale(REPEAT_SCALE, REPEAT_SCALE);
ChangeActorStat(act, STAT_MISC);
}
break;
@ -298,7 +295,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
case FECES:
if (actj)
act->spr.xrepeat = act->spr.yrepeat = 1;
act->spr.SetScale(REPEAT_SCALE, REPEAT_SCALE);
ChangeActorStat(act, STAT_MISC);
break;

View file

@ -55,8 +55,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
case RRTILE2028:
act->spr.cstat = 0;
act->spr.cstat |= CSTAT_SPRITE_INVISIBLE;
act->spr.xrepeat = 0;
act->spr.yrepeat = 0;
act->spr.SetScale(0, 0);
act->clipdist = 0;
act->spr.extra = 0;
ChangeActorStat(act, STAT_BOWLING);
@ -92,20 +91,17 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
case RRTILE7424:
if (!isRRRA()) goto default_case;
act->spr.extra = 0;
act->spr.xrepeat = 0;
act->spr.yrepeat = 0;
act->spr.SetScale(0, 0);
ChangeActorStat(act, 11);
break;
case RRTILE7936:
if (!isRRRA()) goto default_case;
act->spr.xrepeat = 0;
act->spr.yrepeat = 0;
act->spr.SetScale(0, 0);
fogactive = 1;
break;
case RRTILE6144:
if (!isRRRA()) goto default_case;
act->spr.xrepeat = 0;
act->spr.yrepeat = 0;
act->spr.SetScale(0, 0);
ps[screenpeek].sea_sick_stat = 1;
break;
case RRTILE8448:
@ -126,14 +122,12 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
break;
case RRTILE8192:
if (!isRRRA()) goto default_case;
act->spr.xrepeat = 0;
act->spr.yrepeat = 0;
act->spr.SetScale(0, 0);
ufospawnsminion = 1;
break;
case RRTILE8193:
if (!isRRRA()) goto default_case;
act->spr.xrepeat = 0;
act->spr.yrepeat = 0;
act->spr.SetScale(0, 0);
pistonsound = 1;
break;
case RRTILE8165:
@ -163,8 +157,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
case RRTILE293:
act->spr.cstat = 0;
act->spr.cstat |= CSTAT_SPRITE_INVISIBLE;
act->spr.xrepeat = 0;
act->spr.yrepeat = 0;
act->spr.SetScale(0, 0);
act->clipdist = 0;
act->spr.lotag = 0;
ChangeActorStat(act, 106);