- wrapped all literal assignments to clipdist - part 6

This commit is contained in:
Christoph Oelckers 2022-09-09 18:17:20 +02:00
parent c55fdd41e8
commit 51c059657b

View file

@ -3755,7 +3755,7 @@ AutoShrap:
actor->spr.shade = int8_t(shrap_shade);
actor->spr.xrepeat = uint8_t(shrap_xsize);
actor->spr.yrepeat = uint8_t(shrap_ysize);
actor->spr.clipdist = 16 >> 2;
actor->set_native_clipdist(16 >> 2);
if (ShrapOwner != nullptr)
{
@ -4159,7 +4159,7 @@ int SpawnBlood(DSWActor* actor, DSWActor* weapActor, DAngle hit_angle, const DVe
actorNew->spr.shade = int8_t(shrap_shade);
actorNew->spr.xrepeat = uint8_t(shrap_xsize);
actorNew->spr.yrepeat = uint8_t(shrap_ysize);
actorNew->spr.clipdist = 16 >> 2;
actorNew->set_native_clipdist(16 >> 2);
actorNew->spr.pal = actorNew->user.spal = uint8_t(shrap_pal);
@ -7646,7 +7646,7 @@ int DoStar(DSWActor* actor)
actor->spr.xrepeat -= 16;
actor->spr.yrepeat -= 16;
actor->spr.cstat &= ~(CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN);
actor->spr.clipdist = 16L >> 2;
actor->set_native_clipdist(16L >> 2);
actor->user.ceiling_dist = (2);
actor->user.floor_dist = (2);
// treat this just like a KillSprite but don't kill
@ -8111,7 +8111,7 @@ int InitPlasmaFountain(DSWActor* wActor, DSWActor* sActor)
SetOwner(GetOwner(wActor), actorNew);
SetAttach(sActor, actorNew);
actorNew->spr.yrepeat = 0;
actorNew->spr.clipdist = 8>>2;
actorNew->set_native_clipdist(8>>2);
actorNew->user.WaitTics = 120+60;
actorNew->user.Radius = 50;
@ -9780,7 +9780,7 @@ int DoUziBullet(DSWActor* actor)
actorNew->spr.yrepeat = UZI_SMOKE_REPEAT;
SetOwner(GetOwner(actor), actorNew);
actorNew->spr.angle = actor->spr.angle;
actorNew->spr.clipdist = 128 >> 2;
actorNew->set_native_clipdist(128 >> 2);
actorNew->spr.cstat |= (CSTAT_SPRITE_TRANSLUCENT | CSTAT_SPRITE_YCENTER);
if (!(actor->user.Flags & SPR_UNDERWATER))
@ -11438,7 +11438,7 @@ int DoMirv(DSWActor* actor)
actorNew->spr.shade = -40;
actorNew->spr.xrepeat = 40;
actorNew->spr.yrepeat = 40;
actorNew->spr.clipdist = 32L >> 2;
actorNew->set_native_clipdist(32 >> 2);
actorNew->vel.Z = 0;
actorNew->spr.cstat |= (CSTAT_SPRITE_YCENTER);
@ -11860,7 +11860,7 @@ int InitLavaThrow(DSWActor* actor)
actorNew->user.Radius = 200;
actorNew->spr.cstat |= (CSTAT_SPRITE_YCENTER);
actorNew->spr.clipdist = 256>>2;
actorNew->set_native_clipdist(256>>2);
actorNew->user.ceiling_dist = (14);
actorNew->user.floor_dist = (14);
@ -11915,7 +11915,7 @@ void InitVulcanBoulder(DSWActor* actor)
actorNew->user.Radius = 200;
actorNew->spr.cstat |= (CSTAT_SPRITE_YCENTER);
actorNew->spr.clipdist = 256>>2;
actorNew->set_native_clipdist(256>>2);
actorNew->user.ceiling_dist = zsize/2;
actorNew->user.floor_dist = zsize/2;
if (RANDOM_P2(1024) > 512)
@ -12059,7 +12059,7 @@ void InitSpellNapalm(PLAYER* pp)
actor->spr.shade = -40;
actor->spr.xrepeat = 32;
actor->spr.yrepeat = 32;
actor->spr.clipdist = 0;
actor->set_native_clipdist(0);
actor->vel.Z = -pp->horizon.horiz.asbuildf() * HORIZ_MULTF;
actor->spr.cstat |= (CSTAT_SPRITE_TRANSLUCENT | CSTAT_SPRITE_YCENTER);
actor->spr.cstat &= ~(CSTAT_SPRITE_BLOCK | CSTAT_SPRITE_BLOCK_HITSCAN);
@ -12070,7 +12070,7 @@ void InitSpellNapalm(PLAYER* pp)
actor->user.Dist = 12.5;
auto oclipdist = plActor->spr.clipdist;
plActor->spr.clipdist = 1;
plActor->set_native_clipdist(1);
if (mp[i].dist_over != 0)
{
@ -12136,7 +12136,7 @@ int InitEnemyNapalm(DSWActor* actor)
actorNew->spr.shade = -40;
actorNew->spr.xrepeat = 32;
actorNew->spr.yrepeat = 32;
actorNew->spr.clipdist = 0;
actorNew->set_native_clipdist(0);
actorNew->spr.cstat |= (CSTAT_SPRITE_TRANSLUCENT | CSTAT_SPRITE_YCENTER);
actorNew->spr.cstat &= ~(CSTAT_SPRITE_BLOCK | CSTAT_SPRITE_BLOCK_HITSCAN);
actorNew->user.Flags2 |= (SPR2_BLUR_TAPER_FAST);
@ -12146,7 +12146,7 @@ int InitEnemyNapalm(DSWActor* actor)
actorNew->user.Dist = 12.5;
auto oclipdist = actor->spr.clipdist;
actor->spr.clipdist = 1;
actor->set_native_clipdist(1);
if (mp[i].dist_over != 0)
{
@ -12191,7 +12191,7 @@ int InitSpellMirv(PLAYER* pp)
actorNew->spr.shade = -40;
actorNew->spr.xrepeat = 72;
actorNew->spr.yrepeat = 72;
actorNew->spr.clipdist = 32 >> 2;
actorNew->set_native_clipdist(32 >> 2);
actorNew->vel.Z = -pp->horizon.horiz.asbuildf() * HORIZ_MULTF;
actorNew->spr.cstat |= (CSTAT_SPRITE_TRANSLUCENT | CSTAT_SPRITE_YCENTER);
actorNew->spr.cstat &= ~(CSTAT_SPRITE_BLOCK | CSTAT_SPRITE_BLOCK_HITSCAN);
@ -12202,7 +12202,7 @@ int InitSpellMirv(PLAYER* pp)
DSWActor* plActor = pp->actor;
auto oclipdist = plActor->spr.clipdist;
plActor->spr.clipdist = 0;
plActor->set_native_clipdist(0);
UpdateChange(actorNew);
@ -12232,7 +12232,7 @@ int InitEnemyMirv(DSWActor* actor)
actorNew->spr.shade = -40;
actorNew->spr.xrepeat = 72;
actorNew->spr.yrepeat = 72;
actorNew->spr.clipdist = 32L >> 2;
actorNew->set_native_clipdist(32 >> 2);
actorNew->spr.cstat |= (CSTAT_SPRITE_TRANSLUCENT | CSTAT_SPRITE_YCENTER);
actorNew->spr.cstat &= ~(CSTAT_SPRITE_BLOCK | CSTAT_SPRITE_BLOCK_HITSCAN);
@ -12650,7 +12650,7 @@ int InitSumoNapalm(DSWActor* actor)
actorNew->spr.shade = -40;
actorNew->spr.xrepeat = 32;
actorNew->spr.yrepeat = 32;
actorNew->spr.clipdist = 0;
actorNew->set_native_clipdist(0);
actorNew->spr.cstat |= (CSTAT_SPRITE_TRANSLUCENT | CSTAT_SPRITE_YCENTER);
actorNew->spr.cstat &= ~(CSTAT_SPRITE_BLOCK | CSTAT_SPRITE_BLOCK_HITSCAN);
actorNew->user.Flags2 |= (SPR2_BLUR_TAPER_FAST);
@ -12660,7 +12660,7 @@ int InitSumoNapalm(DSWActor* actor)
actorNew->user.Dist = 12.5;
auto oclipdist = actor->spr.clipdist;
actor->spr.clipdist = 1;
actor->set_native_clipdist(1);
if (mp[i].dist_over != 0)
{
@ -13064,7 +13064,7 @@ int InitStar(PLAYER* pp)
SetOwner(pp->actor, actorNew);
actorNew->spr.yrepeat = actorNew->spr.xrepeat = STAR_REPEAT;
actorNew->spr.shade = -25;
actorNew->spr.clipdist = 32 >> 2;
actorNew->set_native_clipdist(32 >> 2);
// zvel was overflowing with this calculation - had to move to a local long var
double zvel = -pp->horizon.horiz.asbuildf() * ((HORIZ_MULT + STAR_HORIZ_ADJ) / 256.);
@ -13166,7 +13166,7 @@ void InitHeartAttack(PLAYER* pp)
actorNew->spr.shade = -10;
actorNew->spr.xrepeat = 52;
actorNew->spr.yrepeat = 52;
actorNew->spr.clipdist = 0;
actorNew->set_native_clipdist(0);
actorNew->vel.Z = -pp->horizon.horiz.asbuildf() * HORIZ_MULTF;
actorNew->spr.cstat &= ~(CSTAT_SPRITE_BLOCK | CSTAT_SPRITE_BLOCK_HITSCAN);
actorNew->user.Flags2 |= (SPR2_DONT_TARGET_OWNER);
@ -13177,7 +13177,7 @@ void InitHeartAttack(PLAYER* pp)
actorNew->user.Dist = 12.5;
auto oclipdist = plActor->spr.clipdist;
plActor->spr.clipdist = 1;
plActor->set_native_clipdist(1);
UpdateChange(actorNew);
@ -13471,7 +13471,7 @@ int InitLaser(PLAYER* pp)
actorNew->spr.yrepeat = 52;
actorNew->spr.xrepeat = 52;
actorNew->spr.shade = -15;
actorNew->spr.clipdist = 64 >> 2;
actorNew->set_native_clipdist(64 >> 2);;
// the slower the missile travels the less of a zvel it needs
actorNew->vel.Z = -pp->horizon.horiz.asbuildf() * HORIZ_MULTF * 0.25;
@ -13486,7 +13486,7 @@ int InitLaser(PLAYER* pp)
// at certain angles the clipping box was big enough to block the
// initial positioning of the fireball.
auto oclipdist = actor->spr.clipdist;
actor->spr.clipdist = 0;
actor->set_native_clipdist(0);
actorNew->spr.angle += DAngle90;
HelpMissileLateral(actorNew, 900);
@ -13585,8 +13585,8 @@ int InitRail(PLAYER* pp)
// at certain angles the clipping box was big enough to block the
// initial positioning
auto oclipdist = actor->spr.clipdist;
actor->spr.clipdist = 0;
actorNew->spr.clipdist = 32L>>2;
actor->set_native_clipdist(0);
actorNew->set_native_clipdist(32 >> 2);
actorNew->spr.angle += DAngle90;
HelpMissileLateral(actorNew, 700);
@ -13659,8 +13659,8 @@ int InitZillaRail(DSWActor* actor)
// at certain angles the clipping box was big enough to block the
// initial positioning
auto oclipdist = actor->spr.clipdist;
actor->spr.clipdist = 0;
actorNew->spr.clipdist = 32 >> 2;
actor->set_native_clipdist(0);
actorNew->set_native_clipdist(32 >> 2);
actorNew->spr.angle += DAngle90;
HelpMissileLateral(actorNew, 700);
@ -13738,7 +13738,7 @@ int InitRocket(PLAYER* pp)
actorNew->spr.shade = -15;
zvel = -pp->horizon.horiz.asbuildf() * ((HORIZ_MULT + 35) / 256.);
actorNew->spr.clipdist = 64 >> 2;
actorNew->set_native_clipdist(64 >> 2);
actorNew->user.RotNum = 5;
NewStateGroup(actorNew, &sg_Rocket[0]);
@ -13767,7 +13767,7 @@ int InitRocket(PLAYER* pp)
// at certain angles the clipping box was big enough to block the
// initial positioning of the fireball.
auto oclipdist = actor->spr.clipdist;
actor->spr.clipdist = 0;
actor->set_native_clipdist(0);
actorNew->spr.angle += DAngle90;
HelpMissileLateral(actorNew, 900);
@ -13846,7 +13846,7 @@ int InitBunnyRocket(PLAYER* pp)
actorNew->spr.shade = -15;
zvel = -pp->horizon.horiz.asbuildf() * ((HORIZ_MULT + 35) / 256.);
actorNew->spr.clipdist = 64 >> 2;
actorNew->set_native_clipdist(64 >> 2);
actorNew->user.RotNum = 5;
NewStateGroup(actorNew, &sg_BunnyRocket[0]);
@ -13872,7 +13872,7 @@ int InitBunnyRocket(PLAYER* pp)
// at certain angles the clipping box was big enough to block the
// initial positioning of the fireball.
auto oclipdist = actor->spr.clipdist;
actor->spr.clipdist = 0;
actor->set_native_clipdist(0);
actorNew->spr.angle += DAngle90;
HelpMissileLateral(actorNew, 900);
@ -13948,7 +13948,7 @@ int InitNuke(PLAYER* pp)
actorNew->spr.xrepeat = 128;
actorNew->spr.shade = -15;
zvel = -pp->horizon.horiz.asbuildf() * ((HORIZ_MULT + 36) / 256.);
actorNew->spr.clipdist = 64L>>2;
actorNew->set_native_clipdist(64 >> 2);
// Set to red palette
actorNew->spr.pal = actorNew->user.spal = 19;
@ -13966,7 +13966,7 @@ int InitNuke(PLAYER* pp)
// at certain angles the clipping box was big enough to block the
// initial positioning of the fireball.
auto oclipdist = actor->spr.clipdist;
actor->spr.clipdist = 0;
actor->set_native_clipdist(0);
actorNew->spr.angle += DAngle90;
HelpMissileLateral(actorNew, 900);
@ -14031,7 +14031,7 @@ int InitEnemyNuke(DSWActor* actor)
actorNew->spr.xrepeat = 128;
actorNew->spr.shade = -15;
double zvel = (100 * (HORIZ_MULT-36)) / 256.; // Ugh...
actorNew->spr.clipdist = 64>>2;
actorNew->set_native_clipdist(64 >> 2);
// Set to red palette
actorNew->spr.pal = actorNew->user.spal = 19;
@ -14131,7 +14131,7 @@ int InitMicro(PLAYER* pp)
actorNew->spr.xrepeat = 24;
actorNew->spr.shade = -15;
actorNew->vel.Z = -pp->horizon.horiz.asbuildf() * HORIZ_MULTF;
actorNew->spr.clipdist = 64L>>2;
actorNew->set_native_clipdist(64 >> 2);
// randomize zvelocity
actorNew->vel.Z += RandomRangeF(8) - 5;
@ -14152,7 +14152,7 @@ int InitMicro(PLAYER* pp)
// at certain angles the clipping box was big enough to block the
// initial positioning of the fireball.
auto oclipdist = actor->spr.clipdist;
actor->spr.clipdist = 0;
actor->set_native_clipdist(0);
actorNew->spr.angle += DAngle90;
const int MICRO_LATERAL = 5000;
@ -14552,7 +14552,7 @@ int InitSerpSpell(DSWActor* actor)
actorNew->user.spal = actorNew->spr.pal = 27; // Bright Green
actorNew->spr.xrepeat = 64;
actorNew->spr.yrepeat = 64;
actorNew->spr.clipdist = 32L >> 2;
actorNew->set_native_clipdist(32 >> 2);
actorNew->vel.Z = 0;
actorNew->spr.cstat |= (CSTAT_SPRITE_YCENTER);
@ -14561,7 +14561,7 @@ int InitSerpSpell(DSWActor* actor)
actorNew->user.Dist = 12.5;
auto oclipdist = actor->spr.clipdist;
actor->spr.clipdist = 1;
actor->set_native_clipdist(1);
actorNew->spr.angle += lat_ang[i];
HelpMissileLateral(actorNew, 4200);
@ -14655,7 +14655,7 @@ int InitSerpMonstSpell(DSWActor* actor)
actorNew->spr.shade = -40;
actorNew->spr.xrepeat = 122;
actorNew->spr.yrepeat = 116;
actorNew->spr.clipdist = 32L >> 2;
actorNew->set_native_clipdist(32 >> 2);
actorNew->vel.Z = 0;
actorNew->spr.cstat |= (CSTAT_SPRITE_YCENTER);
@ -14665,7 +14665,7 @@ int InitSerpMonstSpell(DSWActor* actor)
actorNew->user.Dist = 12.5;
auto oclipdist = actor->spr.clipdist;
actor->spr.clipdist = 1;
actor->set_native_clipdist(1);
actorNew->spr.angle += lat_ang[i];
HelpMissileLateral(actorNew, 4200);
@ -14736,7 +14736,7 @@ int InitEnemyRocket(DSWActor* actor)
actorNew->spr.shade = -15;
actorNew->vel.Z = 0;
actorNew->spr.angle = actor->spr.angle;
actorNew->spr.clipdist = 64L>>2;
actorNew->set_native_clipdist(64 >> 2);
actorNew->user.RotNum = 5;
NewStateGroup(actorNew, &sg_Rocket[0]);
@ -14821,7 +14821,7 @@ int InitEnemyRail(DSWActor* actor)
actorNew->spr.cstat |= (CSTAT_SPRITE_YCENTER|CSTAT_SPRITE_INVISIBLE);
actorNew->spr.cstat |= (CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN);
actorNew->spr.clipdist = 64 >> 2;
actorNew->set_native_clipdist(64 >> 2);
UpdateChange(actorNew);
@ -14876,7 +14876,7 @@ int InitZillaRocket(DSWActor* actor)
actorNew->spr.shade = -15;
actorNew->vel.Z = 0;
actorNew->spr.angle = actor->spr.angle;
actorNew->spr.clipdist = 64 >>2;
actorNew->set_native_clipdist(64 >> 2);
actorNew->user.RotNum = 5;
NewStateGroup(actorNew, &sg_Rocket[0]);
@ -14933,7 +14933,7 @@ int InitEnemyStar(DSWActor* actor)
actorNew->spr.shade = -25;
actorNew->vel.Z = 0;
actorNew->spr.angle = actor->spr.angle;
actorNew->spr.clipdist = 64L>>2;
actorNew->set_native_clipdist(64 >> 2);
UpdateChange(actorNew);
@ -14969,7 +14969,7 @@ int InitEnemyCrossbow(DSWActor* actor)
actorNew->spr.shade = -25;
actorNew->vel.Z = 0;
actorNew->spr.angle = actor->spr.angle;
actorNew->spr.clipdist = 64>>2;
actorNew->set_native_clipdist(64 >> 2);
actorNew->user.RotNum = 5;
NewStateGroup(actorNew, &sg_CrossBolt[0]);
@ -15012,7 +15012,7 @@ int InitSkelSpell(DSWActor* actor)
actorNew->spr.shade = -40;
actorNew->vel.Z = 0;
actorNew->spr.angle = actor->spr.angle;
actorNew->spr.clipdist = 64L>>2;
actorNew->set_native_clipdist(64 >> 2);
actorNew->spr.cstat |= (CSTAT_SPRITE_YCENTER);
// find the distance to the target (player)
@ -15050,7 +15050,7 @@ int InitCoolgFire(DSWActor* actor)
actorNew->spr.shade = -40;
actorNew->vel.Z = 0;
actorNew->spr.angle = actor->spr.angle;
actorNew->spr.clipdist = 32>>2;
actorNew->set_native_clipdist(32 >> 2);
actorNew->user.ceiling_dist = (4);
actorNew->user.floor_dist = (4);
if (actor->user.ID == RIPPER_RUN_R0)
@ -15109,7 +15109,7 @@ int InitCoolgDrip(DSWActor* actor)
actorNew->spr.yrepeat = actorNew->spr.xrepeat = 20;
actorNew->spr.shade = -5;
actorNew->vel.Z = 0;
actorNew->spr.clipdist = 16L>>2;
actorNew->set_native_clipdist(16 >> 2);
actorNew->user.ceiling_dist = (4);
actorNew->user.floor_dist = (4);
actorNew->spr.cstat |= (CSTAT_SPRITE_YCENTER);
@ -15148,7 +15148,7 @@ int GenerateDrips(DSWActor* actor)
actorNew->spr.yrepeat = actorNew->spr.xrepeat = 20;
actorNew->spr.shade = -10;
actorNew->vel.Z = 0;
actorNew->spr.clipdist = 16L>>2;
actorNew->set_native_clipdist(16 >> 2);
actorNew->user.ceiling_dist = (4);
actorNew->user.floor_dist = (4);
actorNew->spr.cstat |= (CSTAT_SPRITE_YCENTER);
@ -15219,7 +15219,7 @@ void InitFireballTrap(DSWActor* actor)
actorNew->spr.xrepeat -= 20;
actorNew->spr.yrepeat -= 20;
actorNew->spr.shade = -40;
actorNew->spr.clipdist = 32>>2;
actorNew->set_native_clipdist(32 >> 2);
actorNew->vel.Z = 0;
actorNew->spr.cstat |= (CSTAT_SPRITE_YCENTER);
actorNew->user.WeaponNum = WPN_HOTHEAD;
@ -15272,7 +15272,7 @@ void InitSpearTrap(DSWActor* actor)
actorNew->spr.xrepeat = 16;
actorNew->spr.yrepeat = 26;
actorNew->spr.shade = -25;
actorNew->spr.clipdist = 64 >> 2;
actorNew->set_native_clipdist(64 >> 2);
actorNew->user.RotNum = 5;
NewStateGroup(actorNew, &sg_CrossBolt[0]);
@ -15333,7 +15333,7 @@ int InitTracerUzi(PLAYER* pp)
actorNew->spr.xrepeat = 10;
actorNew->spr.shade = -40;
actorNew->vel.Z = 0;
actorNew->spr.clipdist = 32 >> 2;
actorNew->set_native_clipdist(32 >> 2);
actorNew->user.WeaponNum = actor->user.WeaponNum;
actorNew->user.Radius = 50;
@ -15344,7 +15344,7 @@ int InitTracerUzi(PLAYER* pp)
DSWActor* plActor = pp->actor;
oclipdist = plActor->spr.clipdist;
plActor->spr.clipdist = 0;
plActor->set_native_clipdist(0);
actorNew->spr.angle += DAngle90;
if (pp->Flags & (PF_TWO_UZI) && pp->WpnUziType == 0)
@ -15398,7 +15398,7 @@ int InitTracerTurret(DSWActor* actor, DSWActor* Operator, fixedhoriz horiz)
actorNew->spr.xrepeat = 10;
actorNew->spr.shade = -40;
actorNew->vel.Z = 0;
actorNew->spr.clipdist = 8 >> 2;
actorNew->set_native_clipdist(8 >> 2);
actorNew->user.WeaponNum = actor->user.WeaponNum;
actorNew->user.Radius = 50;
@ -15440,7 +15440,7 @@ int InitTracerAutoTurret(DSWActor* actor, const DVector3& change)
actorNew->spr.xrepeat = 10;
actorNew->spr.shade = -40;
actorNew->vel.Z = 0;
actorNew->spr.clipdist = 8 >> 2;
actorNew->set_native_clipdist(8 >> 2);
actorNew->user.WeaponNum = actor->user.WeaponNum;
actorNew->user.Radius = 50;
@ -15747,7 +15747,7 @@ int InitUzi(PLAYER* pp)
actorNew->spr.yrepeat = UZI_SMOKE_REPEAT;
SetOwner(pp->actor, actorNew);
actorNew->spr.cstat |= (cstat | CSTAT_SPRITE_YCENTER);
actorNew->spr.clipdist = 8 >> 2;
actorNew->set_native_clipdist(8 >> 2);
HitscanSpriteAdjust(actorNew, hit.hitWall);
DoHitscanDamage(actorNew, hit.actor());
@ -15760,7 +15760,7 @@ int InitUzi(PLAYER* pp)
SetOwner(pp->actor, actorNew);
actorNew->user.spal = actorNew->spr.pal = pal;
actorNew->spr.cstat |= (cstat | CSTAT_SPRITE_YCENTER);
actorNew->spr.clipdist = 8 >> 2;
actorNew->set_native_clipdist(8 >> 2);
HitscanSpriteAdjust(actorNew, hit.hitWall);
@ -15793,7 +15793,7 @@ int InitTankShell(DSWActor* actor, PLAYER* pp)
actorNew->spr.xrepeat = 8;
actorNew->spr.shade = -40;
actorNew->vel.Z = 0;
actorNew->spr.clipdist = 32 >> 2;
actorNew->set_native_clipdist(32 >> 2);
actorNew->user.WeaponNum = actor->user.WeaponNum;
actorNew->user.Radius = 50;
@ -15873,7 +15873,7 @@ int InitTurretMicro(DSWActor* actor, PLAYER* pp)
actorNew->spr.xrepeat = 24;
actorNew->spr.shade = -15;
actorNew->vel.Z = -pp->horizon.horiz.asbuildf() * HORIZ_MULTF + RandomRangeF(8) - 5;
actorNew->spr.clipdist = 64L>>2;
actorNew->set_native_clipdist(64 >> 2);
actorNew->user.RotNum = 5;
@ -15933,7 +15933,7 @@ int InitTurretRocket(DSWActor* actor, PLAYER* pp)
actorNew->spr.xrepeat = 40;
actorNew->spr.shade = -40;
actorNew->vel.Z = 0;
actorNew->spr.clipdist = 32 >> 2;
actorNew->set_native_clipdist(32 >> 2);
actorNew->user.WeaponNum = actor->user.WeaponNum;
actorNew->user.Radius = 50;
@ -15973,7 +15973,7 @@ int InitTurretFireball(DSWActor* actor, PLAYER* pp)
actorNew->spr.xrepeat = 40;
actorNew->spr.shade = -40;
actorNew->vel.Z = 0;
actorNew->spr.clipdist = 32 >> 2;
actorNew->set_native_clipdist(32 >> 2);
actorNew->user.WeaponNum = actor->user.WeaponNum;
actorNew->user.Radius = 50;
@ -16032,7 +16032,7 @@ int InitTurretRail(DSWActor* actor, PLAYER* pp)
actorNew->spr.cstat |= (CSTAT_SPRITE_YCENTER|CSTAT_SPRITE_INVISIBLE);
actorNew->spr.cstat |= (CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN);
actorNew->spr.clipdist = 64L>>2;
actorNew->set_native_clipdist(64 >> 2);
if (WeaponAutoAim(pp->actor, actorNew, DAngle22_5 / 4, false) == -1)
{
@ -16076,7 +16076,7 @@ int InitTurretLaser(DSWActor* actor, PLAYER* pp)
actorNew->user.Flags2 |= (SPR2_SO_MISSILE);
actorNew->spr.cstat |= (CSTAT_SPRITE_YCENTER);
actorNew->spr.cstat |= (CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN);
actorNew->spr.clipdist = 64L>>2;
actorNew->set_native_clipdist(64 >> 2);
if (WeaponAutoAim(actor, actorNew, DAngle22_5 / 4, false) == -1)
{
@ -16310,7 +16310,7 @@ DSWActor* SpawnBoatSparks(PLAYER* pp, sectortype* hit_sect, walltype* hit_wall,
// Sprite starts out with center exactly on wall.
// This moves it back enough to see it at all angles.
actorNew->spr.clipdist = 32 >> 2;
actorNew->set_native_clipdist(32 >> 2);
HitscanSpriteAdjust(actorNew, hit_wall);
@ -16323,7 +16323,7 @@ DSWActor* SpawnBoatSparks(PLAYER* pp, sectortype* hit_sect, walltype* hit_wall,
actorNew->user.spal = actorNew->spr.pal = PALETTE_DEFAULT;
actorNew->spr.cstat |= (CSTAT_SPRITE_YCENTER);
actorNew->spr.clipdist = 32 >> 2;
actorNew->set_native_clipdist(32 >> 2);
HitscanSpriteAdjust(actorNew, hit_wall);
@ -16353,7 +16353,7 @@ int SpawnSwordSparks(PLAYER* pp, sectortype* hit_sect, walltype* hit_wall, const
// Sprite starts out with center exactly on wall.
// This moves it back enough to see it at all angles.
actorNew->spr.clipdist = 32 >> 2;
actorNew->set_native_clipdist(32 >> 2);
if (hit_wall != nullptr)
HitscanSpriteAdjust(actorNew, hit_wall);
@ -16367,7 +16367,7 @@ int SpawnSwordSparks(PLAYER* pp, sectortype* hit_sect, walltype* hit_wall, const
if (actor->user.WeaponNum == WPN_FIST)
actorNew->spr.cstat |= (CSTAT_SPRITE_INVISIBLE);
actorNew->spr.clipdist = 32 >> 2;
actorNew->set_native_clipdist(32 >> 2);
if (hit_wall != nullptr)
HitscanSpriteAdjust(actorNew, hit_wall);
@ -16393,7 +16393,7 @@ DSWActor* SpawnTurretSparks(sectortype* hit_sect, walltype* hit_wall, const DVec
// Sprite starts out with center exactly on wall.
// This moves it back enough to see it at all angles.
actorNew->spr.clipdist = 32 >> 2;
actorNew->set_native_clipdist(32 >> 2);
HitscanSpriteAdjust(actorNew, hit_wall);
actorNew = SpawnActor(STAT_MISSILE, UZI_SPARK, s_UziSpark, hit_sect, hitpos, hit_ang, 0);
@ -16404,7 +16404,7 @@ DSWActor* SpawnTurretSparks(sectortype* hit_sect, walltype* hit_wall, const DVec
actorNew->user.spal = actorNew->spr.pal = PALETTE_DEFAULT;
actorNew->spr.cstat |= (CSTAT_SPRITE_YCENTER);
actorNew->spr.clipdist = 32 >> 2;
actorNew->set_native_clipdist(32 >> 2);
HitscanSpriteAdjust(actorNew, hit_wall);
if (RANDOM_P2(1024) < 100)
@ -16430,7 +16430,7 @@ DSWActor* SpawnShotgunSparks(PLAYER* pp, sectortype* hit_sect, walltype* hit_wal
actorNew->user.spal = actorNew->spr.pal = PALETTE_DEFAULT;
actorNew->spr.cstat |= (CSTAT_SPRITE_YCENTER);
actorNew->spr.clipdist = 32 >> 2;
actorNew->set_native_clipdist(32 >> 2);
HitscanSpriteAdjust(actorNew, hit_wall);
@ -16444,7 +16444,7 @@ DSWActor* SpawnShotgunSparks(PLAYER* pp, sectortype* hit_sect, walltype* hit_wal
// Sprite starts out with center exactly on wall.
// This moves it back enough to see it at all angles.
actorNew->spr.clipdist = 32 >> 2;
actorNew->set_native_clipdist(32 >> 2);
HitscanSpriteAdjust(actorNew, hit_wall);
@ -16721,7 +16721,7 @@ int InitEnemyUzi(DSWActor* actor)
actorNew->user.WaitTics = 63;
actorNew->spr.cstat |= (CSTAT_SPRITE_YCENTER);
actorNew->spr.clipdist = 32L >> 2;
actorNew->set_native_clipdist(32 >> 2);
actorNew = SpawnActor(STAT_MISSILE, UZI_SMOKE, s_UziSmoke, hit.hitSector, hit.hitpos, daang, 0);
actorNew->spr.shade = -40;
@ -16729,7 +16729,7 @@ int InitEnemyUzi(DSWActor* actor)
actorNew->spr.yrepeat = UZI_SMOKE_REPEAT;
SetOwner(actor, actorNew);
actorNew->spr.cstat |= (CSTAT_SPRITE_YCENTER);
actorNew->spr.clipdist = 8 >> 2;
actorNew->set_native_clipdist(8 >> 2);
HitscanSpriteAdjust(actorNew, hit.hitWall);
DoHitscanDamage(actorNew, hit.actor());
@ -16742,7 +16742,7 @@ int InitEnemyUzi(DSWActor* actor)
SetOwner(actor, actorNew);
actorNew->user.spal = actorNew->spr.pal;
actorNew->spr.cstat |= (CSTAT_SPRITE_YCENTER);
actorNew->spr.clipdist = 8 >> 2;
actorNew->set_native_clipdist(8 >> 2);
HitscanSpriteAdjust(actorNew, hit.hitWall);
@ -16802,8 +16802,8 @@ int InitGrenade(PLAYER* pp)
actorNew->spr.yrepeat = 32;
actorNew->spr.xrepeat = 32;
actorNew->spr.shade = -15;
//actorNew->spr.clipdist = 80L>>2;
actorNew->spr.clipdist = 32L>>2;
//actorNew->set_native_clipdist(80 >> 2);
actorNew->set_native_clipdist(32 >> 2);
actorNew->user.WeaponNum = actor->user.WeaponNum;
actorNew->user.Radius = 200;
actorNew->user.ceiling_dist = (3);
@ -16818,7 +16818,7 @@ int InitGrenade(PLAYER* pp)
actorNew->vel.Z = -pp->horizon.horiz.asbuildf() * HORIZ_MULTF;
auto oclipdist = actor->spr.clipdist;
actor->spr.clipdist = 0;
actor->set_native_clipdist(0);
actorNew->spr.angle += DAngle90;
HelpMissileLateral(actorNew, 800);
@ -16877,8 +16877,8 @@ int InitSpriteGrenade(DSWActor* actor)
actorNew->spr.yrepeat = 32;
actorNew->spr.xrepeat = 32;
actorNew->spr.shade = -15;
//actorNew->spr.clipdist = 80L>>2;
actorNew->spr.clipdist = 32L>>2;
//actorNew->set_native_clipdist(80 >> 2);
actorNew->set_native_clipdist(32 >> 2);
actorNew->user.WeaponNum = actor->user.WeaponNum;
actorNew->user.Radius = 200;
actorNew->user.ceiling_dist = (3);
@ -16932,7 +16932,7 @@ int InitMine(PLAYER* pp)
actorNew->spr.yrepeat = 32;
actorNew->spr.xrepeat = 32;
actorNew->spr.shade = -15;
actorNew->spr.clipdist = 128L>>2;
actorNew->set_native_clipdist(128 >> 2);
actorNew->vel.Z = -pp->horizon.horiz.asbuildf() * HORIZ_MULTF;
actorNew->user.WeaponNum = actor->user.WeaponNum;
actorNew->user.Radius = 200;
@ -16981,7 +16981,7 @@ int InitEnemyMine(DSWActor* actor)
actorNew->spr.yrepeat = 32;
actorNew->spr.xrepeat = 32;
actorNew->spr.shade = -15;
actorNew->spr.clipdist = 128 >> 2;
actorNew->set_native_clipdist(128 >> 2);
actorNew->user.WeaponNum = actor->user.WeaponNum;
actorNew->user.Radius = 200;
@ -17021,7 +17021,7 @@ int HelpMissileLateral(DSWActor* actor, int dist)
auto vec = actor->spr.angle.ToVector() * actor->vel.X;
actor->spr.clipdist = 32L >> 2;
actor->set_native_clipdist(32 >> 2);
actor->user.coll = move_missile(actor, DVector3(vec, 0), 16, 16, 0, 1);
@ -17061,7 +17061,7 @@ int InitFireball(PLAYER* pp)
actorNew->spr.xrepeat = 40;
actorNew->spr.yrepeat = 40;
actorNew->spr.shade = -40;
actorNew->spr.clipdist = 32>>2;
actorNew->set_native_clipdist(32 >> 2);
SetOwner(pp->actor, actorNew);
actorNew->spr.cstat |= (CSTAT_SPRITE_YCENTER);
actorNew->user.Radius = 100;
@ -17073,7 +17073,7 @@ int InitFireball(PLAYER* pp)
// at certain angles the clipping box was big enough to block the
// initial positioning of the fireball.
auto oclipdist = actor->spr.clipdist;
actor->spr.clipdist = 0;
actor->set_native_clipdist(0);
actorNew->spr.angle += DAngle90;
HelpMissileLateral(actorNew, 2100);
@ -17142,7 +17142,7 @@ int InitEnemyFireball(DSWActor* actor)
SetOwner(actor, actorNew);
actorNew->vel.Z = 0;
actorNew->spr.clipdist = 16>>2;
actorNew->set_native_clipdist(16>>2);
actorNew->spr.angle += lat_ang[i];
HelpMissileLateral(actorNew, 500);
@ -17618,7 +17618,7 @@ DSWActor* SpawnBubble(DSWActor* actor)
actorNew->spr.shade = actor->sector()->floorshade - 10;
actorNew->user.WaitTics = 120 * 120;
actorNew->vel.Z = 2;
actorNew->spr.clipdist = 12 >> 2;
actorNew->set_native_clipdist(12 >> 2);
actorNew->spr.cstat |= (CSTAT_SPRITE_YCENTER);
actorNew->user.Flags |= (SPR_UNDERWATER);
actorNew->spr.shade = -60; // Make em brighter
@ -17955,7 +17955,7 @@ void QueueHole(sectortype* hit_sect, walltype* hit_wall, const DVector3& pos)
spawnedActor->spr.pal = 0;
spawnedActor->spr.shade = 0;
spawnedActor->spr.extra = 0;
spawnedActor->spr.clipdist = 0;
spawnedActor->set_native_clipdist(0);
spawnedActor->spr.xoffset = spawnedActor->spr.yoffset = 0;
spawnedActor->spr.pos = pos;
spawnedActor->spr.picnum = 2151;
@ -18042,7 +18042,7 @@ int QueueFloorBlood(DSWActor* actor)
spawnedActor->spr.pal = 0;
spawnedActor->spr.shade = 0;
spawnedActor->spr.extra = 0;
spawnedActor->spr.clipdist = 0;
spawnedActor->set_native_clipdist(0);
spawnedActor->spr.xoffset = spawnedActor->spr.yoffset = 0;
spawnedActor->spr.pos = actor->spr.pos.plusZ(1);
spawnedActor->spr.angle = RandomAngle(); // Just make it any old angle
@ -18154,7 +18154,7 @@ int QueueFootPrint(DSWActor* actor)
spawnedActor->spr.pal = 0;
spawnedActor->spr.shade = 0;
spawnedActor->spr.extra = 0;
spawnedActor->spr.clipdist = 0;
spawnedActor->set_native_clipdist(0);
spawnedActor->spr.xoffset = spawnedActor->spr.yoffset = 0;
spawnedActor->spr.pos = actor->spr.pos;
spawnedActor->spr.angle = actor->spr.angle;
@ -18295,7 +18295,7 @@ DSWActor* QueueWallBlood(DSWActor* actor, DAngle bang)
spawnedActor->spr.pal = 0;
spawnedActor->spr.shade = 0;
spawnedActor->spr.extra = 0;
spawnedActor->spr.clipdist = 0;
spawnedActor->set_native_clipdist(0);
spawnedActor->spr.xoffset = spawnedActor->spr.yoffset = 0;
spawnedActor->spr.pos = hit.hitpos;
spawnedActor->spr.shade -= 5; // Brighten it up just a bit