- added conversion macros to convert floating point angles to angle_t, using xs_Float.h, and replaced all occurences in the code with them (let's hope I found everything.)

Converting a floating point value that is out of range for a signed integer will result in 0x80000000 with SSE math, which is used exclusively for this purpose on modern Visual C++ compilers, so this cannot be used anywhere.
On ARM there's problems with float to unsigned int conversions.

xs_Float does not depend on these
This commit is contained in:
Christoph Oelckers 2016-02-08 12:10:53 +01:00
commit 6d0ef7a9da
18 changed files with 58 additions and 46 deletions

View file

@ -1859,7 +1859,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_LookEx)
AActor *targ = NULL; // Shuts up gcc
fixed_t dist;
angle_t fov = (fov_f == 0) ? ANGLE_180 : angle_t(fov_f * ANGLE_90 / 90);
angle_t fov = (fov_f == 0) ? ANGLE_180 : FLOAT2ANGLE(fov_f);
FLookExParams params = { fov, minseedist, maxseedist, maxheardist, flags, seestate };
if (self->flags5 & MF5_INCONVERSATION)
@ -2827,7 +2827,7 @@ void A_Face (AActor *self, AActor *other, angle_t max_turn, angle_t max_pitch, a
double dist_z = target_z - source_z;
double ddist = sqrt(dist.X*dist.X + dist.Y*dist.Y + dist_z*dist_z);
int other_pitch = (int)rad2bam(asin(dist_z / ddist));
int other_pitch = (int)RAD2ANGLE(asin(dist_z / ddist));
if (max_pitch != 0)
{