mirror of
https://github.com/ZDoom/Raze.git
synced 2025-01-18 14:41:55 +00:00
- floatified the angle variables.
This commit is contained in:
parent
d35785f1ee
commit
2148dba3a6
4 changed files with 36 additions and 35 deletions
|
@ -1502,35 +1502,36 @@ struct SECTOR_OBJECT
|
|||
double clipbox_vdist[MAX_CLIPBOX]; // mult-clip box variables
|
||||
DAngle clipbox_ang[MAX_CLIPBOX]; // mult-clip box variables
|
||||
|
||||
int int_i_ang() const { return __i_ang; }
|
||||
int int_i_ang_moving() const { return __i_ang_moving; }
|
||||
int int_i_ang_tgt() const { return __i_ang_tgt; }
|
||||
int int_i_ang_orig() const { return __i_ang_orig; }
|
||||
int int_i_last_ang() const { return __i_last_ang; }
|
||||
int int_i_spin_ang() const { return __i_spin_ang; }
|
||||
int int_i_spin_speed() const { return __i_spin_speed; }
|
||||
void set_int_i_spin_speed(int i) { __i_spin_speed = i; }
|
||||
void set_int_i_last_ang(int i) { __i_last_ang = i; }
|
||||
void set_int_i_spin_ang(int i) { __i_spin_ang = i; }
|
||||
void set_int_i_ang(int i) { __i_ang = i; }
|
||||
void set_int_i_ang_tgt(int i) { __i_ang_tgt = i; }
|
||||
void set_int_i_ang_moving(int i) { __i_ang_moving = i; }
|
||||
void set_int_i_ang_orig(int i) { __i_ang_orig = i; }
|
||||
int int_i_ang() const { return ang.Buildang(); }
|
||||
int int_i_ang_moving() const { return ang_moving.Buildang(); }
|
||||
int int_i_ang_tgt() const { return ang_tgt.Buildang(); }
|
||||
int int_i_ang_orig() const { return ang_orig.Buildang(); }
|
||||
int int_i_last_ang() const { return last_ang.Buildang(); }
|
||||
int int_i_spin_ang() const { return spin_ang.Buildang(); }
|
||||
int int_i_spin_speed() const { return spin_speed.Buildang(); }
|
||||
void set_int_i_spin_speed(int i) { spin_speed = DAngle::fromBuild(i); }
|
||||
void set_int_i_last_ang(int i) { last_ang = DAngle::fromBuild(i); }
|
||||
void set_int_i_spin_ang(int i) { spin_ang = DAngle::fromBuild(i); }
|
||||
void set_int_i_ang(int i) { ang = DAngle::fromBuild(i); }
|
||||
void set_int_i_ang_tgt(int i) { ang_tgt = DAngle::fromBuild(i); }
|
||||
void set_int_i_ang_moving(int i) { ang_moving = DAngle::fromBuild(i); }
|
||||
void set_int_i_ang_orig(int i) { ang_orig = DAngle::fromBuild(i); }
|
||||
|
||||
|
||||
int16_t clipbox_num,
|
||||
__i_ang, // angle facing
|
||||
__i_ang_moving, // angle the SO is facing
|
||||
__i_ang_tgt, // target angle
|
||||
__i_ang_orig, // original angle
|
||||
__i_last_ang, // last angle before started spinning
|
||||
__i_spin_speed, // spin_speed
|
||||
__i_spin_ang, // spin angle
|
||||
turn_speed, // shift value determines how fast SO turns to match new angle
|
||||
int16_t clipbox_num;
|
||||
DAngle ang; // angle facing
|
||||
DAngle ang_moving; // angle the SO is facing
|
||||
DAngle ang_tgt; // target angle
|
||||
DAngle ang_orig; // original angle
|
||||
DAngle last_ang, // last angle before started spinning
|
||||
old_ang; // holding variable for the old angle
|
||||
DAngle spin_speed, // spin_speed
|
||||
save_spin_speed, // save spin speed
|
||||
spin_ang; // spin angle
|
||||
int16_t turn_speed, // shift value determines how fast SO turns to match new angle
|
||||
bob_sine_ndx, // index into sine table
|
||||
bob_speed, // shift value for speed
|
||||
save_vel, // save velocity
|
||||
save_spin_speed, // save spin speed
|
||||
match_event, // match number
|
||||
// SO Scaling Vector Info
|
||||
scale_type, // type of scaling - enum controled
|
||||
|
|
|
@ -125,11 +125,11 @@ short DoSOevent(short match, short state)
|
|||
{
|
||||
if ((sop->flags & SOBJ_WAIT_FOR_EVENT))
|
||||
{
|
||||
if (sop->save_vel > 0 || sop->save_spin_speed > 0)
|
||||
if (sop->save_vel > 0 || sop->save_spin_speed > nullAngle)
|
||||
{
|
||||
sop->flags &= ~(SOBJ_WAIT_FOR_EVENT);
|
||||
sop->vel = sop->save_vel;
|
||||
sop->set_int_i_spin_speed(sop->save_spin_speed);
|
||||
sop->spin_speed = sop->save_spin_speed;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -659,14 +659,14 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, SECTOR_OBJECT& w,
|
|||
("point", w.point, def->point)
|
||||
("vel_rate", w.vel_rate, def->vel_rate)
|
||||
("dir", w.dir, def->dir)
|
||||
("ang", w.__i_ang, def->__i_ang)
|
||||
("ang_moving", w.__i_ang_moving, def->__i_ang_moving)
|
||||
("ang", w.ang, def->ang)
|
||||
("ang_moving", w.ang_moving, def->ang_moving)
|
||||
("clipdist", w.clipdist, def->clipdist)
|
||||
("ang_tgt", w.__i_ang_tgt, def->__i_ang_tgt)
|
||||
("ang_orig", w.__i_ang_orig, def->__i_ang_orig)
|
||||
("last_ang", w.__i_last_ang, def->__i_last_ang)
|
||||
("spin_speed", w.__i_spin_speed, def->__i_spin_speed)
|
||||
("spin_ang", w.__i_spin_ang, def->__i_spin_ang)
|
||||
("ang_tgt", w.ang_tgt, def->ang_tgt)
|
||||
("ang_orig", w.ang_orig, def->ang_orig)
|
||||
("last_ang", w.last_ang, def->last_ang)
|
||||
("spin_speed", w.spin_speed, def->spin_speed)
|
||||
("spin_ang", w.spin_ang, def->spin_ang)
|
||||
("turn_speed", w.turn_speed, def->turn_speed)
|
||||
("bob_sine_ndx", w.bob_sine_ndx, def->bob_sine_ndx)
|
||||
("bob_speed", w.bob_speed, def->bob_speed)
|
||||
|
|
|
@ -2392,7 +2392,7 @@ DVector2 DoTrack(SECTOR_OBJECT* sop, short locktics)
|
|||
|
||||
sop->flags |= (SOBJ_WAIT_FOR_EVENT);
|
||||
sop->save_vel = sop->vel;
|
||||
sop->save_spin_speed = sop->int_i_spin_speed();
|
||||
sop->save_spin_speed = sop->spin_speed;
|
||||
|
||||
sop->vel = 0;
|
||||
sop->set_int_i_spin_speed(0);
|
||||
|
@ -2639,7 +2639,7 @@ void DoTornadoObject(SECTOR_OBJECT* sop)
|
|||
// this made them move together more or less - cool!
|
||||
//static short ang = 1024;
|
||||
int ret;
|
||||
short ang = sop->__i_ang_moving;
|
||||
short ang = sop->int_i_ang_moving();
|
||||
|
||||
xvect = sop->vel * bcos(ang);
|
||||
yvect = sop->vel * bcos(ang);
|
||||
|
|
Loading…
Reference in a new issue