[0061] Use fabs instead of abs for float type.

On some platforms abs has only int overload exists.

Signed-off-by: stfx <stfx@hotmail.de>
This commit is contained in:
Shauren 2012-07-06 00:06:33 +02:00 committed by Antz
parent 7ce7fd8ab1
commit a004c7b50c
2 changed files with 3 additions and 5 deletions

View file

@ -28,7 +28,6 @@ template<> struct BoundsTrait<VMAP::GroupModel>
static void getBounds(const VMAP::GroupModel& obj, G3D::AABox& out) { out = obj.GetBound(); } static void getBounds(const VMAP::GroupModel& obj, G3D::AABox& out) { out = obj.GetBound(); }
}; };
namespace VMAP namespace VMAP
{ {
bool IntersectTriangle(const MeshTriangle& tri, std::vector<Vector3>::const_iterator points, const G3D::Ray& ray, float& distance) bool IntersectTriangle(const MeshTriangle& tri, std::vector<Vector3>::const_iterator points, const G3D::Ray& ray, float& distance)
@ -42,7 +41,7 @@ namespace VMAP
const Vector3 p(ray.direction().cross(e2)); const Vector3 p(ray.direction().cross(e2));
const float a = e1.dot(p); const float a = e1.dot(p);
if (abs(a) < EPS) if (fabs(a) < EPS)
{ {
// Determinant is ill-conditioned; abort early // Determinant is ill-conditioned; abort early
return false; return false;
@ -508,9 +507,8 @@ namespace VMAP
if (!wf) if (!wf)
return false; return false;
bool result = true;
uint32 chunkSize, count; uint32 chunkSize, count;
result = fwrite(VMAP_MAGIC, 1, 8, wf) == 8; bool result = fwrite(VMAP_MAGIC, 1, 8, wf) == 8;
if (result && fwrite("WMOD", 1, 4, wf) != 4) result = false; if (result && fwrite("WMOD", 1, 4, wf) != 4) result = false;
chunkSize = sizeof(uint32) + sizeof(uint32); chunkSize = sizeof(uint32) + sizeof(uint32);
if (result && fwrite(&chunkSize, sizeof(uint32), 1, wf) != 1) result = false; if (result && fwrite(&chunkSize, sizeof(uint32), 1, wf) != 1) result = false;

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "0060" #define REVISION_NR "0061"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__