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/graphics/common/blitz.cpp | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'src/graphics/common/blitz.cpp') diff --git a/src/graphics/common/blitz.cpp b/src/graphics/common/blitz.cpp index 43f4fed..9bf5a93 100644 --- a/src/graphics/common/blitz.cpp +++ b/src/graphics/common/blitz.cpp @@ -14,14 +14,14 @@ // * You should have received a copy of the GNU General Public License // * along with this program. If not, see http://www.gnu.org/licenses/. -#define STRICT -#define D3D_OVERLOADS #include #include #include #include "common/struct.h" +#include "math/const.h" +#include "math/geometry.h" #include "graphics/d3d/d3dengine.h" #include "math/old/d3dmath.h" #include "graphics/d3d/d3dutil.h" @@ -75,7 +75,7 @@ void CBlitz::Flush() for ( i=0 ; i= 1.0f ) { #if 1 - m_pos.x = (Rand()-0.5f)*(3200.0f-200.0f); - m_pos.z = (Rand()-0.5f)*(3200.0f-200.0f); + m_pos.x = (Math::Rand()-0.5f)*(3200.0f-200.0f); + m_pos.z = (Math::Rand()-0.5f)*(3200.0f-200.0f); #else - m_pos.x = (Rand()-0.5f)*(3200.0f-2800.0f); - m_pos.z = (Rand()-0.5f)*(3200.0f-2800.0f); + m_pos.x = (Math::Rand()-0.5f)*(3200.0f-2800.0f); + m_pos.z = (Math::Rand()-0.5f)*(3200.0f-2800.0f); #endif m_pos.y = 0.0f; @@ -179,15 +179,15 @@ bool CBlitz::EventFrame(const Event &event) { max += 0.4f; - m_shift[i].x += (Rand()-0.5f)*max*2.0f; + m_shift[i].x += (Math::Rand()-0.5f)*max*2.0f; if ( m_shift[i].x < -max ) m_shift[i].x = -max; if ( m_shift[i].x > max ) m_shift[i].x = max; - m_shift[i].y += (Rand()-0.5f)*max*2.0f; + m_shift[i].y += (Math::Rand()-0.5f)*max*2.0f; if ( m_shift[i].y < -max ) m_shift[i].y = -max; if ( m_shift[i].y > max ) m_shift[i].y = max; - m_width[i] += (Rand()-0.5f)*2.0f; + m_width[i] += (Math::Rand()-0.5f)*2.0f; if ( m_width[i] < 1.0f ) m_width[i] = 1.0f; if ( m_width[i] > 6.0f ) m_width[i] = 6.0f; } @@ -199,7 +199,7 @@ bool CBlitz::EventFrame(const Event &event) { m_phase = BPH_WAIT; m_progress = 0.0f; - m_speed = 1.0f/(1.0f+Rand()*m_delay); + m_speed = 1.0f/(1.0f+Math::Rand()*m_delay); } } @@ -215,7 +215,7 @@ void CBlitz::Draw() D3DVERTEX2 vertex[4]; // 2 triangles D3DVECTOR corner[4], eye, n, p, p1, p2; D3DMATRIX matrix; - FPOINT texInf, texSup, rot; + Math::Point texInf, texSup, rot; float a; int i; @@ -237,7 +237,7 @@ void CBlitz::Draw() p1 = m_pos; eye = m_engine->RetEyePt(); - a = RotateAngle(eye.x-p1.x, eye.z-p1.z); + a = Math::RotateAngle(eye.x-p1.x, eye.z-p1.z); n = Normalize(p1-eye); for ( i=0 ; i