-replaced tspritetype::set_int_x/y.

This commit is contained in:
Christoph Oelckers 2022-02-07 09:20:51 +01:00
parent d654f23613
commit 022f22cd10
5 changed files with 13 additions and 16 deletions

View file

@ -92,6 +92,13 @@ inline double bsinf(const double ang, const int shift = 0)
//
// Build cosine inline functions.
//
// About shifts:
// -6 -> * 16
// -7 -> * 8
// -8 -> * 4
// -9 -> * 2
// -10 -> * 1
//
//---------------------------------------------------------------------------
inline int bcos(const int ang, int shift = 0)

View file

@ -520,18 +520,10 @@ struct tspritetype : public spritetypebase
{
pos.X += x * inttoworld;
}
void set_int_x(int x)
{
pos.X = x * inttoworld;
}
void add_int_y(int x)
{
pos.Y += x * inttoworld;
}
void set_int_y(int x)
{
pos.Y = x * inttoworld;
}
void add_int_z(int x)
{
pos.Z += x * zinttoworld;

View file

@ -220,8 +220,8 @@ void animatesprites_d(tspriteArray& tsprites, int x, int y, int a, int smoothrat
else
{
t->ang = getangle(x - t->int_pos().X, y - t->int_pos().Y);
t->set_int_x(OwnerAc->int_pos().X + bcos(t->ang, -10));
t->set_int_y(OwnerAc->int_pos().Y + bsin(t->ang, -10));
t->pos.X = OwnerAc->spr.pos.X + buildang(t->ang).fcos();
t->pos.Y = OwnerAc->spr.pos.Y + buildang(t->ang).fsin();
}
}
break;

View file

@ -214,10 +214,8 @@ void animatesprites_r(tspriteArray& tsprites, int x, int y, int a, int smoothrat
else
{
t->ang = getangle(x - t->int_pos().X, y - t->int_pos().Y);
t->set_int_x(OwnerAc->int_pos().X);
t->set_int_y(OwnerAc->int_pos().Y);
t->add_int_x(bcos(t->ang, -10));
t->add_int_y(bsin(t->ang, -10));
t->pos.X = OwnerAc->spr.pos.X + buildang(t->ang).fcos();
t->pos.Y = OwnerAc->spr.pos.Y + buildang(t->ang).fsin();
}
}
break;

View file

@ -909,8 +909,8 @@ void post_analyzesprites(tspriteArray& tsprites)
continue;
}
tsp->set_int_x(atsp->int_pos().X);
tsp->set_int_y(atsp->int_pos().Y);
tsp->pos.X = atsp->pos.X;
tsp->pos.Y = atsp->pos.Y;
// statnum is priority - draw this ALWAYS first at 0
// statnum is priority - draw this ALWAYS last at MAXSTATUS
if ((atsp->extra & SPRX_BURNABLE))