diff --git a/source/core/binaryangle.h b/source/core/binaryangle.h index 6857e4a44..9b0a13db9 100644 --- a/source/core/binaryangle.h +++ b/source/core/binaryangle.h @@ -91,6 +91,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 // //--------------------------------------------------------------------------- diff --git a/source/core/maptypes.h b/source/core/maptypes.h index 33d35dae9..5a6cf0aa3 100644 --- a/source/core/maptypes.h +++ b/source/core/maptypes.h @@ -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; diff --git a/source/games/duke/src/animatesprites_d.cpp b/source/games/duke/src/animatesprites_d.cpp index 032b0fbc6..826048e11 100644 --- a/source/games/duke/src/animatesprites_d.cpp +++ b/source/games/duke/src/animatesprites_d.cpp @@ -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; diff --git a/source/games/duke/src/animatesprites_r.cpp b/source/games/duke/src/animatesprites_r.cpp index 50f33d0f5..aded4f1f3 100644 --- a/source/games/duke/src/animatesprites_r.cpp +++ b/source/games/duke/src/animatesprites_r.cpp @@ -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; diff --git a/source/games/sw/src/draw.cpp b/source/games/sw/src/draw.cpp index 888c4a92b..710763d3a 100644 --- a/source/games/sw/src/draw.cpp +++ b/source/games/sw/src/draw.cpp @@ -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))