mirror of
https://github.com/ZDoom/Raze.git
synced 2025-01-31 12:30:40 +00:00
- floatified SO bobbing
This commit is contained in:
parent
92379863f1
commit
ac998da374
2 changed files with 13 additions and 15 deletions
|
@ -1464,19 +1464,17 @@ struct SECTOR_OBJECT
|
||||||
vel_tgt, // target velocity
|
vel_tgt, // target velocity
|
||||||
update; // Distance from player at which you continue updating
|
update; // Distance from player at which you continue updating
|
||||||
|
|
||||||
// start of must floatify
|
|
||||||
double zorig_floor[MAX_SO_SECTOR], // original z values for all sectors
|
double zorig_floor[MAX_SO_SECTOR], // original z values for all sectors
|
||||||
z_tgt; // target z delta
|
z_tgt; // target z delta
|
||||||
int z_rate, // rate at which z aproaches target
|
int z_rate; // rate at which z aproaches target
|
||||||
// only works for single player.
|
// only works for single player.
|
||||||
bob_diff; // bobbing difference for the frame
|
double bob_diff, // bobbing difference for the frame
|
||||||
double floor_loz, // floor low z
|
floor_loz, // floor low z
|
||||||
floor_hiz; // floor hi z
|
floor_hiz, // floor hi z
|
||||||
int bob_amt, // bob amount max in z coord
|
bob_amt; // bob amount max in z coord
|
||||||
// end of must floatify
|
|
||||||
|
|
||||||
// variables set by mappers for drivables
|
// variables set by mappers for drivables
|
||||||
drive_angspeed,
|
int drive_angspeed,
|
||||||
drive_angslide,
|
drive_angslide,
|
||||||
drive_speed,
|
drive_speed,
|
||||||
drive_slide,
|
drive_slide,
|
||||||
|
|
|
@ -1212,7 +1212,7 @@ void SetupSectorObject(sectortype* sectp, short tag)
|
||||||
KillActor(actor);
|
KillActor(actor);
|
||||||
break;
|
break;
|
||||||
case SO_BOB_START:
|
case SO_BOB_START:
|
||||||
sop->bob_amt = Z(actor->spr.lotag);
|
sop->bob_amt = actor->spr.lotag;
|
||||||
sop->bob_sine_ndx = 0;
|
sop->bob_sine_ndx = 0;
|
||||||
sop->bob_speed = 4;
|
sop->bob_speed = 4;
|
||||||
KillActor(actor);
|
KillActor(actor);
|
||||||
|
@ -1255,7 +1255,7 @@ void SetupSectorObject(sectortype* sectp, short tag)
|
||||||
#if 0
|
#if 0
|
||||||
case SO_SPEED_BOAT:
|
case SO_SPEED_BOAT:
|
||||||
sop->vel = 0;
|
sop->vel = 0;
|
||||||
sop->bob_amt = Z(2);
|
sop->bob_amt = 2;
|
||||||
sop->bob_speed = 4;
|
sop->bob_speed = 4;
|
||||||
sop->flags |= (SOBJ_OPERATIONAL);
|
sop->flags |= (SOBJ_OPERATIONAL);
|
||||||
break;
|
break;
|
||||||
|
@ -1964,7 +1964,7 @@ void MoveZ(SECTOR_OBJECT* sop)
|
||||||
if (sop->bob_amt)
|
if (sop->bob_amt)
|
||||||
{
|
{
|
||||||
sop->bob_sine_ndx = (PlayClock << sop->bob_speed) & 2047;
|
sop->bob_sine_ndx = (PlayClock << sop->bob_speed) & 2047;
|
||||||
sop->bob_diff = MulScale(sop->bob_amt, bsin(sop->bob_sine_ndx), 14);
|
sop->bob_diff = sop->bob_amt * BobVal(sop->bob_sine_ndx);
|
||||||
|
|
||||||
// for all sectors
|
// for all sectors
|
||||||
for (i = 0, sectp = &sop->sectp[0]; *sectp; sectp++, i++)
|
for (i = 0, sectp = &sop->sectp[0]; *sectp; sectp++, i++)
|
||||||
|
@ -1972,7 +1972,7 @@ void MoveZ(SECTOR_OBJECT* sop)
|
||||||
if (sop->sectp[i]->hasU() && (sop->sectp[i]->flags & SECTFU_SO_DONT_BOB))
|
if (sop->sectp[i]->hasU() && (sop->sectp[i]->flags & SECTFU_SO_DONT_BOB))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
(*sectp)->floorz = sop->zorig_floor[i] + sop->bob_diff * zinttoworld;
|
(*sectp)->setfloorz(sop->zorig_floor[i] + sop->bob_diff);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2220,7 +2220,7 @@ DVector2 DoTrack(SECTOR_OBJECT* sop, short locktics)
|
||||||
|
|
||||||
case TRACK_BOB_START:
|
case TRACK_BOB_START:
|
||||||
sop->flags |= (SOBJ_ZMID_FLOOR);
|
sop->flags |= (SOBJ_ZMID_FLOOR);
|
||||||
sop->bob_amt = Z(tpoint->tag_high);
|
sop->bob_amt = tpoint->tag_high;
|
||||||
sop->bob_sine_ndx = 0;
|
sop->bob_sine_ndx = 0;
|
||||||
sop->bob_speed = 4;
|
sop->bob_speed = 4;
|
||||||
break;
|
break;
|
||||||
|
@ -2515,7 +2515,7 @@ void OperateSectorObjectForTics(SECTOR_OBJECT* sop, DAngle newang, const DVector
|
||||||
if (sop->bob_amt)
|
if (sop->bob_amt)
|
||||||
{
|
{
|
||||||
sop->bob_sine_ndx = (PlayClock << sop->bob_speed) & 2047;
|
sop->bob_sine_ndx = (PlayClock << sop->bob_speed) & 2047;
|
||||||
sop->bob_diff = MulScale(sop->bob_amt, bsin(sop->bob_sine_ndx), 14);
|
sop->bob_diff = sop->bob_amt * BobVal(sop->bob_sine_ndx);
|
||||||
|
|
||||||
// for all sectors
|
// for all sectors
|
||||||
for (i = 0, sectp = &sop->sectp[0]; *sectp; sectp++, i++)
|
for (i = 0, sectp = &sop->sectp[0]; *sectp; sectp++, i++)
|
||||||
|
@ -2523,7 +2523,7 @@ void OperateSectorObjectForTics(SECTOR_OBJECT* sop, DAngle newang, const DVector
|
||||||
if (sop->sectp[i]->hasU() && (sop->sectp[i]->flags & SECTFU_SO_DONT_BOB))
|
if (sop->sectp[i]->hasU() && (sop->sectp[i]->flags & SECTFU_SO_DONT_BOB))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
(*sectp)->floorz = sop->zorig_floor[i] + sop->bob_diff * zinttoworld;
|
(*sectp)->setfloorz(sop->zorig_floor[i] + sop->bob_diff);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue