mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 08:52:00 +00:00
- replaced all add_int_z calls with constants.
This commit is contained in:
parent
4a6f9f316a
commit
b32c4444c4
19 changed files with 44 additions and 45 deletions
|
@ -4584,7 +4584,7 @@ static Collision MoveThing(DBloodActor* actor)
|
|||
|
||||
if ((actor->spr.flags & 2) && bottom < floorZ)
|
||||
{
|
||||
actor->add_int_z(455);
|
||||
actor->spr.pos.Z += 1.777;
|
||||
actor->vel.Z += 58254;
|
||||
if (actor->spr.type == kThingZombieHead)
|
||||
{
|
||||
|
|
|
@ -746,8 +746,8 @@ void nnExtInitModernStuff(TArray<DBloodActor*>& actors)
|
|||
|
||||
// very quick fix for floor sprites with Touch trigger flag if their Z is equals sector florz / ceilgz
|
||||
if (actor->insector() && actor->xspr.Touch && (actor->spr.cstat & CSTAT_SPRITE_ALIGNMENT_FLOOR)) {
|
||||
if (actor->int_pos().Z == actor->sector()->int_floorz()) actor->add_int_z(-1);
|
||||
else if (actor->int_pos().Z == actor->sector()->int_ceilingz()) actor->add_int_z(1);
|
||||
if (actor->int_pos().Z == actor->sector()->int_floorz()) actor->spr.pos.Z -= zmaptoworld;
|
||||
else if (actor->int_pos().Z == actor->sector()->int_ceilingz()) actor->spr.pos.Z += zmaptoworld;
|
||||
}
|
||||
|
||||
// make Proximity flag work not just for dudes and things...
|
||||
|
@ -1747,7 +1747,7 @@ void debrisMove(int listIndex)
|
|||
}
|
||||
else if ((actor->xspr.physAttr & kPhysGravity) && bottom < floorZ)
|
||||
{
|
||||
actor->add_int_z(455);
|
||||
actor->spr.pos.Z += 1.777;
|
||||
actor->vel.Z += 58254;
|
||||
|
||||
}
|
||||
|
|
|
@ -491,7 +491,7 @@ void moveplayers(void)
|
|||
if (act->sector()->lotag != ST_2_UNDERWATER)
|
||||
makeitfall(act);
|
||||
if (act->spr.zvel == 0 && act->sector()->lotag == ST_1_ABOVE_WATER)
|
||||
act->add_int_z((32 << 8));
|
||||
act->spr.pos.Z += 32;
|
||||
}
|
||||
|
||||
if (act->spr.extra < 8)
|
||||
|
@ -663,7 +663,7 @@ void movecrane(DDukeActor *actor, int crane)
|
|||
}
|
||||
else if (actor->temp_data[0] == 2 || actor->temp_data[0] == 7)
|
||||
{
|
||||
actor->add_int_z((1024 + 512));
|
||||
actor->spr.pos.Z += 6;
|
||||
|
||||
if (actor->temp_data[0] == 2)
|
||||
{
|
||||
|
@ -923,7 +923,7 @@ void detonate(DDukeActor *actor, int explosion)
|
|||
}
|
||||
}
|
||||
|
||||
actor->add_int_z(-(32 << 8));
|
||||
actor->spr.pos.Z -= 32;
|
||||
|
||||
if ((actor->temp_data[3] == 1 && actor->spr.xrepeat) || actor->spr.lotag == -99)
|
||||
{
|
||||
|
@ -1371,7 +1371,7 @@ void rpgexplode(DDukeActor *actor, int hit, const vec3_t &pos, int EXPLOSION2, i
|
|||
else
|
||||
{
|
||||
explosion->spr.cstat |= CSTAT_SPRITE_YFLIP;
|
||||
explosion->add_int_z((48 << 8));
|
||||
explosion->spr.pos.Z += 48;
|
||||
}
|
||||
}
|
||||
if (newextra > 0) actor->spr.extra = newextra;
|
||||
|
@ -1634,7 +1634,7 @@ void recon(DDukeActor *actor, int explosion, int firelaser, int attacksnd, int p
|
|||
|
||||
if (actor->temp_data[0] == -1)
|
||||
{
|
||||
actor->add_int_z(1024);
|
||||
actor->spr.pos.Z += 4;
|
||||
actor->temp_data[2]++;
|
||||
if ((actor->temp_data[2] & 3) == 0) spawn(actor, explosion);
|
||||
getglobalz(actor);
|
||||
|
|
|
@ -740,7 +740,7 @@ void movefallers_d(void)
|
|||
}
|
||||
}
|
||||
act->set_int_ang(act->temp_data[1]);
|
||||
act->add_int_z(+(16 << 8));
|
||||
act->spr.pos.Z += 16;
|
||||
}
|
||||
else if (act->temp_data[0] == 1)
|
||||
{
|
||||
|
@ -1645,7 +1645,7 @@ static void weaponcommon_d(DDukeActor* proj)
|
|||
if (proj->spr.zvel < 0)
|
||||
{
|
||||
spawned->spr.cstat |= CSTAT_SPRITE_YFLIP;
|
||||
spawned->add_int_z(72 << 8);
|
||||
spawned->spr.pos.Z += 72;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2610,7 +2610,7 @@ static void heavyhbomb(DDukeActor *actor)
|
|||
|
||||
if (actor->sector()->lotag == 1 && actor->spr.zvel == 0)
|
||||
{
|
||||
actor->add_int_z(32 << 8);
|
||||
actor->spr.pos.Z += 32;
|
||||
if (actor->temp_data[5] == 0)
|
||||
{
|
||||
actor->temp_data[5] = 1;
|
||||
|
|
|
@ -1309,7 +1309,7 @@ static void weaponcommon_r(DDukeActor *proj)
|
|||
if (proj->spr.zvel < 0)
|
||||
{
|
||||
spawned->spr.cstat |= CSTAT_SPRITE_YFLIP;
|
||||
spawned->add_int_z(72 << 8);
|
||||
spawned->spr.pos.Z += 72;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -183,7 +183,7 @@ void animatesprites_d(tspriteArray& tsprites, int x, int y, int a, int smoothrat
|
|||
switch (h->spr.picnum)
|
||||
{
|
||||
case DUKELYINGDEAD:
|
||||
t->add_int_z(24 << 8);
|
||||
t->pos.Z += 24;
|
||||
break;
|
||||
case BLOODPOOL:
|
||||
case FOOTPRINTS:
|
||||
|
@ -299,7 +299,7 @@ void animatesprites_d(tspriteArray& tsprites, int x, int y, int a, int smoothrat
|
|||
|
||||
p = h->spr.yvel;
|
||||
|
||||
if (t->pal == 1) t->add_int_z(-(18 << 8));
|
||||
if (t->pal == 1) t->pos.Z -= 18;
|
||||
|
||||
if (ps[p].over_shoulder_on > 0 && ps[p].newOwner == nullptr)
|
||||
{
|
||||
|
|
|
@ -181,7 +181,7 @@ void animatesprites_r(tspriteArray& tsprites, int x, int y, int a, int smoothrat
|
|||
h->spr.xrepeat = 24;
|
||||
h->spr.yrepeat = 17;
|
||||
if (h->spr.extra > 0)
|
||||
t->add_int_z(6 << 8);
|
||||
t->pos.Z += 6;
|
||||
break;
|
||||
case BLOODPOOL:
|
||||
case FOOTPRINTS:
|
||||
|
@ -341,7 +341,7 @@ void animatesprites_r(tspriteArray& tsprites, int x, int y, int a, int smoothrat
|
|||
|
||||
p = h->spr.yvel;
|
||||
|
||||
if (t->pal == 1) t->add_int_z(-(18 << 8));
|
||||
if (t->pal == 1) t->pos.Z -= 18;
|
||||
|
||||
if (ps[p].over_shoulder_on > 0 && ps[p].newOwner == nullptr)
|
||||
{
|
||||
|
|
|
@ -617,7 +617,7 @@ void playerisdead(int snum, int psectlotag, int fz, int cz)
|
|||
}
|
||||
else
|
||||
{
|
||||
actor->add_int_z(-512);
|
||||
actor->spr.pos.Z -= 2;
|
||||
actor->spr.zvel = -348;
|
||||
}
|
||||
|
||||
|
|
|
@ -894,7 +894,7 @@ void shoot_r(DDukeActor* actor, int atwith)
|
|||
{
|
||||
j->spr.xvel = 32;
|
||||
j->spr.angle = actor->spr.angle;
|
||||
j->add_int_z(-(5 << 8));
|
||||
j->spr.pos.Z -= 5;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -905,7 +905,7 @@ void shoot_r(DDukeActor* actor, int atwith)
|
|||
{
|
||||
j->spr.xvel = 250;
|
||||
j->spr.angle = actor->spr.angle;
|
||||
j->add_int_z(-(15 << 8));
|
||||
j->spr.pos.Z -= 15;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -127,7 +127,7 @@ void DoSpawn(player_struct *p, int snum)
|
|||
// like chaingun shells
|
||||
j->set_int_ang((j->int_ang() + 1024) & 2047);
|
||||
j->spr.xvel += 32;
|
||||
j->add_int_z(3<<8);
|
||||
j->spr.pos.Z += 3;
|
||||
ssp(j,CLIPMASK0);
|
||||
}
|
||||
|
||||
|
|
|
@ -199,7 +199,7 @@ void operaterespawns_d(int low)
|
|||
auto star = spawn(act, TRANSPORTERSTAR);
|
||||
if (star)
|
||||
{
|
||||
star->add_int_z(-(32 << 8));
|
||||
star->spr.pos.Z -= 32;
|
||||
|
||||
act->spr.extra = 66 - 12; // Just a way to killit
|
||||
}
|
||||
|
|
|
@ -313,7 +313,7 @@ void operaterespawns_r(int low)
|
|||
if (badguypic(act->spr.hitag) && ud.monsters_off) break;
|
||||
|
||||
auto star = spawn(act, TRANSPORTERSTAR);
|
||||
if (star) star->add_int_z(-(32 << 8));
|
||||
if (star) star->spr.pos.Z -= 32;
|
||||
|
||||
act->spr.extra = 66 - 12; // Just a way to killit
|
||||
break;
|
||||
|
|
|
@ -318,7 +318,7 @@ void spawntransporter(DDukeActor *actj, DDukeActor* act, bool beam)
|
|||
act->spr.xrepeat = 48;
|
||||
act->spr.yrepeat = 64;
|
||||
if (actj->spr.statnum == 10 || badguy(actj))
|
||||
act->add_int_z(-(32 << 8));
|
||||
act->spr.pos.Z -= 32;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -527,9 +527,9 @@ void initwaterdrip(DDukeActor* actj, DDukeActor* actor)
|
|||
if (actj->spr.pal != 1)
|
||||
{
|
||||
actor->spr.pal = 2;
|
||||
actor->add_int_z(-(18 << 8));
|
||||
actor->spr.pos.Z -= 18;
|
||||
}
|
||||
else actor->add_int_z(-(13 << 8));
|
||||
else actor->spr.pos.Z -= 13;
|
||||
actor->set_int_ang(getangle(ps[connecthead].player_int_pos().X - actor->int_pos().X, ps[connecthead].player_int_pos().Y - actor->int_pos().Y));
|
||||
actor->spr.xvel = 48 - (krand() & 31);
|
||||
ssp(actor, CLIPMASK0);
|
||||
|
|
|
@ -262,7 +262,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
|
|||
|
||||
case BLOOD:
|
||||
act->spr.xrepeat = act->spr.yrepeat = 16;
|
||||
act->add_int_z(-(26 << 8));
|
||||
act->spr.pos.Z -= 26;
|
||||
if (actj && actj->spr.pal == 6)
|
||||
act->spr.pal = 6;
|
||||
ChangeActorStat(act, STAT_MISC);
|
||||
|
@ -297,7 +297,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
|
|||
int fz = getflorzofslopeptr(act->sector(), act->int_pos().X, act->int_pos().Y);
|
||||
if (fz != act->int_pos().Z)
|
||||
act->set_int_z(fz);
|
||||
act->add_int_z(-200);
|
||||
act->spr.pos.Z -= 0.78125;
|
||||
}
|
||||
[[fallthrough]];
|
||||
|
||||
|
@ -1000,7 +1000,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
|
|||
if (actj)
|
||||
{
|
||||
act->spr.lotag = 0;
|
||||
act->add_int_z(-(32 << 8));
|
||||
act->spr.pos.Z -= 32;
|
||||
act->spr.zvel = -1024;
|
||||
ssp(act, CLIPMASK0);
|
||||
if (krand() & 4) act->spr.cstat |= CSTAT_SPRITE_XFLIP;
|
||||
|
|
|
@ -324,7 +324,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
|
|||
|
||||
case BLOOD:
|
||||
act->spr.xrepeat = act->spr.yrepeat = 4;
|
||||
act->add_int_z(-(26 << 8));
|
||||
act->spr.pos.Z -= 26;
|
||||
ChangeActorStat(act, STAT_MISC);
|
||||
break;
|
||||
case BLOODPOOL:
|
||||
|
@ -1155,7 +1155,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
|
|||
act->spr.lotag = 0;
|
||||
if (act->spr.picnum != BOWLINGBALLSPRITE)
|
||||
{
|
||||
act->add_int_z(-(32 << 8));
|
||||
act->spr.pos.Z -= 32;
|
||||
act->spr.zvel = -(4 << 8);
|
||||
}
|
||||
else
|
||||
|
|
|
@ -1838,7 +1838,7 @@ int InitBloodSpray(DSWActor* actor, bool dogib, short velocity)
|
|||
|
||||
int BloodSprayFall(DSWActor* actor)
|
||||
{
|
||||
actor->add_int_z(1500);
|
||||
actor->spr.pos.Z += 5.86;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -2191,7 +2191,7 @@ int SpawnShell(DSWActor* actor, int ShellNum)
|
|||
switch (actorNew->user.ID)
|
||||
{
|
||||
case UZI_SHELL:
|
||||
actorNew->add_int_z(-Z(13));
|
||||
actorNew->spr.pos.Z -= 13;
|
||||
|
||||
if (ShellNum == -3)
|
||||
{
|
||||
|
@ -2217,7 +2217,7 @@ int SpawnShell(DSWActor* actor, int ShellNum)
|
|||
actorNew->spr.yrepeat = actorNew->spr.xrepeat = 13;
|
||||
break;
|
||||
case SHOT_SHELL:
|
||||
actorNew->add_int_z(-Z(13));
|
||||
actorNew->spr.pos.Z -= 13;
|
||||
actorNew->spr.angle = actor->spr.angle;
|
||||
HelpMissileLateral(actorNew,2500);
|
||||
actorNew->set_int_ang(NORM_ANGLE(actorNew->spr.int_ang() + 512));
|
||||
|
|
|
@ -5962,7 +5962,7 @@ void DoPlayerDeathDrown(PLAYER* pp)
|
|||
{
|
||||
pp->pos.Z += 2;
|
||||
if (MoveSkip2 == 0)
|
||||
actor->add_int_z(Z(4));
|
||||
actor->spr.pos.Z += 4;
|
||||
|
||||
// Stick like glue when you hit the ground
|
||||
if (pp->int_ppos().Z > pp->loz - PLAYER_DEATH_HEIGHT)
|
||||
|
|
|
@ -6556,12 +6556,12 @@ Collision move_ground_missile(DSWActor* actor, int xchange, int ychange, int cei
|
|||
{
|
||||
if (actor->user.z_tgt > actor->int_pos().Z)
|
||||
{
|
||||
actor->add_int_z(Z(30));
|
||||
actor->spr.pos.Z += 30;
|
||||
return retval;
|
||||
}
|
||||
else
|
||||
{
|
||||
actor->add_int_z(-Z(30));
|
||||
actor->spr.pos.Z -= 30;
|
||||
return retval;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3724,7 +3724,7 @@ AutoShrap:
|
|||
break;
|
||||
case Vomit1:
|
||||
shrap_bounce = false;
|
||||
actor->add_int_z(-Z(4));
|
||||
actor->spr.pos.Z -= 4;
|
||||
shrap_xsize = actor->user.pos.X = 12 + (RANDOM_P2(32<<8)>>8);
|
||||
shrap_ysize = actor->user.pos.Y = 12 + (RANDOM_P2(32<<8)>>8);
|
||||
actor->user.Counter = (RANDOM_P2(2048<<5)>>5);
|
||||
|
@ -3739,7 +3739,7 @@ AutoShrap:
|
|||
break;
|
||||
case EMP:
|
||||
shrap_bounce = false;
|
||||
actor->add_int_z(-Z(4));
|
||||
actor->spr.pos.Z -= 4;
|
||||
shrap_xsize = actor->user.pos.X = 5 + (RANDOM_P2(4<<8)>>8);
|
||||
shrap_ysize = actor->user.pos.Y = 5 + (RANDOM_P2(4<<8)>>8);
|
||||
break;
|
||||
|
@ -4459,13 +4459,13 @@ bool WeaponMoveHit(DSWActor* actor)
|
|||
|
||||
int DoUziSmoke(DSWActor* actor)
|
||||
{
|
||||
actor->add_int_z(-200); // !JIM! Make them float up
|
||||
actor->spr.pos.Z -= 0.78125; // !JIM! Make them float up
|
||||
return 0;
|
||||
}
|
||||
|
||||
int DoShotgunSmoke(DSWActor* actor)
|
||||
{
|
||||
actor->add_int_z(-200); // !JIM! Make them float up
|
||||
actor->spr.pos.Z -= 0.78125; // !JIM! Make them float up
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -7393,7 +7393,7 @@ int DoStar(DSWActor* actor)
|
|||
SpawnBubble(actor);
|
||||
}
|
||||
|
||||
actor->add_int_z(128 * MISSILEMOVETICS);
|
||||
actor->spr.pos.Z += 0.5 * MISSILEMOVETICS;
|
||||
|
||||
DoActorZrange(actor);
|
||||
MissileWaterAdjust(actor);
|
||||
|
@ -17453,8 +17453,7 @@ int QueueFloorBlood(DSWActor* actor)
|
|||
spawnedActor->spr.extra = 0;
|
||||
spawnedActor->spr.clipdist = 0;
|
||||
spawnedActor->spr.xoffset = spawnedActor->spr.yoffset = 0;
|
||||
spawnedActor->spr.pos = actor->spr.pos;
|
||||
spawnedActor->add_int_z(Z(1));
|
||||
spawnedActor->spr.pos = actor->spr.pos.plusZ(1);
|
||||
spawnedActor->set_int_ang(RANDOM_P2(2048)); // Just make it any old angle
|
||||
spawnedActor->spr.shade -= 5; // Brighten it up just a bit
|
||||
|
||||
|
@ -17785,7 +17784,7 @@ int DoWallBlood(DSWActor* actor)
|
|||
if (actor->spr.yrepeat < 80)
|
||||
{
|
||||
actor->spr.yrepeat++;
|
||||
actor->add_int_z(128);
|
||||
actor->spr.pos.Z += 0.5;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Reference in a new issue