Skip to content

Commit

Permalink
-replaced tspritetype::set_int_x/y.
Browse files Browse the repository at this point in the history
  • Loading branch information
coelckers committed Aug 10, 2022
1 parent a5f1f28 commit 936e5c6
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 14 deletions.
7 changes: 7 additions & 0 deletions source/core/binaryangle.h
Expand Up @@ -90,6 +90,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
//
//---------------------------------------------------------------------------

Expand Down
8 changes: 0 additions & 8 deletions source/core/maptypes.h
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions source/games/duke/src/animatesprites_d.cpp
Expand Up @@ -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;
Expand Down
6 changes: 2 additions & 4 deletions source/games/duke/src/animatesprites_r.cpp
Expand Up @@ -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;
Expand Down

0 comments on commit 936e5c6

Please sign in to comment.