From b735913debff93c1a6444ec731cd4bf99ae2a5c2 Mon Sep 17 00:00:00 2001 From: Piotr Dziwinski Date: Wed, 13 Jun 2012 22:48:35 +0200 Subject: FPOINT -> Math::Point & other math functions - changed FPOINT to Math::Point and some functions from math module to the new implementation - moved old function and FPOINT struct declarations to math3d.cpp - removed some unused functions in math module - fixed some #include dependencies - moved #define STRICT and #define D3D_OVERLOADS to compile options --- src/common/modfile.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src/common/modfile.cpp') diff --git a/src/common/modfile.cpp b/src/common/modfile.cpp index ddda0d8..79d6612 100644 --- a/src/common/modfile.cpp +++ b/src/common/modfile.cpp @@ -16,8 +16,6 @@ // modfile.cpp -#define STRICT -#define D3D_OVERLOADS #include #include @@ -671,20 +669,20 @@ float CModFile::RetHeight(D3DVECTOR pos) { if ( !m_triangleTable[i].bUsed ) continue; - if ( Abs(pos.x-m_triangleTable[i].p1.x) < limit && - Abs(pos.z-m_triangleTable[i].p1.z) < limit ) + if ( fabs(pos.x-m_triangleTable[i].p1.x) < limit && + fabs(pos.z-m_triangleTable[i].p1.z) < limit ) { return m_triangleTable[i].p1.y; } - if ( Abs(pos.x-m_triangleTable[i].p2.x) < limit && - Abs(pos.z-m_triangleTable[i].p2.z) < limit ) + if ( fabs(pos.x-m_triangleTable[i].p2.x) < limit && + fabs(pos.z-m_triangleTable[i].p2.z) < limit ) { return m_triangleTable[i].p2.y; } - if ( Abs(pos.x-m_triangleTable[i].p3.x) < limit && - Abs(pos.z-m_triangleTable[i].p3.z) < limit ) + if ( fabs(pos.x-m_triangleTable[i].p3.x) < limit && + fabs(pos.z-m_triangleTable[i].p3.z) < limit ) { return m_triangleTable[i].p3.y; } -- cgit v1.2.3-1-g7c22