[9330] Fixed msvc compile warnings.

This commit is contained in:
AlexDereka 2010-02-08 16:27:27 +03:00
parent a167fd98d2
commit 696cba9c37
20 changed files with 142 additions and 144 deletions

View file

@ -1349,7 +1349,7 @@ float WorldObject::GetAngle( const float x, const float y ) const
float dy = y - GetPositionY();
float ang = atan2(dy, dx);
ang = (ang >= 0) ? ang : 2 * M_PI + ang;
ang = (ang >= 0) ? ang : 2 * M_PI_F + ang;
return ang;
}
@ -1362,19 +1362,19 @@ bool WorldObject::HasInArc(const float arcangle, const WorldObject* obj) const
float arc = arcangle;
// move arc to range 0.. 2*pi
while( arc >= 2.0f * M_PI )
arc -= 2.0f * M_PI;
while( arc >= 2.0f * M_PI_F )
arc -= 2.0f * M_PI_F;
while( arc < 0 )
arc += 2.0f * M_PI;
arc += 2.0f * M_PI_F;
float angle = GetAngle( obj );
angle -= m_orientation;
// move angle to range -pi ... +pi
while( angle > M_PI)
angle -= 2.0f * M_PI;
while(angle < -M_PI)
angle += 2.0f * M_PI;
while( angle > M_PI_F)
angle -= 2.0f * M_PI_F;
while(angle < -M_PI_F)
angle += 2.0f * M_PI_F;
float lborder = -1 * (arc/2.0f); // in range -pi..0
float rborder = (arc/2.0f); // in range 0..pi
@ -1388,7 +1388,7 @@ bool WorldObject::isInFrontInMap(WorldObject const* target, float distance, flo
bool WorldObject::isInBackInMap(WorldObject const* target, float distance, float arc) const
{
return IsWithinDistInMap(target, distance) && !HasInArc( 2 * M_PI - arc, target );
return IsWithinDistInMap(target, distance) && !HasInArc( 2 * M_PI_F - arc, target );
}
bool WorldObject::isInFront(WorldObject const* target, float distance, float arc) const
@ -1398,7 +1398,7 @@ bool WorldObject::isInFront(WorldObject const* target, float distance, float ar
bool WorldObject::isInBack(WorldObject const* target, float distance, float arc) const
{
return IsWithinDist(target, distance) && !HasInArc( 2 * M_PI - arc, target );
return IsWithinDist(target, distance) && !HasInArc( 2 * M_PI_F - arc, target );
}
void WorldObject::GetRandomPoint( float x, float y, float z, float distance, float &rand_x, float &rand_y, float &rand_z) const
@ -1412,7 +1412,7 @@ void WorldObject::GetRandomPoint( float x, float y, float z, float distance, flo
}
// angle to face `obj` to `this`
float angle = rand_norm()*2*M_PI;
float angle = rand_norm()*2*M_PI_F;
float new_dist = rand_norm()*distance;
rand_x = x + new_dist * cos(angle);
@ -1730,10 +1730,10 @@ namespace MaNGOS
float angle = i_object.GetAngle(u)-i_angle;
// move angle to range -pi ... +pi
while( angle > M_PI)
angle -= 2.0f * M_PI;
while(angle < -M_PI)
angle += 2.0f * M_PI;
while( angle > M_PI_F)
angle -= 2.0f * M_PI_F;
while(angle < -M_PI_F)
angle += 2.0f * M_PI_F;
// dist include size of u
float dist2d = i_object.GetDistance2d(x,y);