summaryrefslogtreecommitdiffstats
path: root/src/object/auto/autorepair.cpp
diff options
context:
space:
mode:
authorPiotr Dziwinski <piotrdz@gmail.com>2012-06-13 22:48:35 +0200
committerPiotr Dziwinski <piotrdz@gmail.com>2012-06-13 22:48:35 +0200
commitb735913debff93c1a6444ec731cd4bf99ae2a5c2 (patch)
treeefa532d3b4231e5ffd6df8eddcb0ec8cf5d4b28b /src/object/auto/autorepair.cpp
parentb5d16ef340208bbe1a76f33f7498fb168f6405b6 (diff)
downloadcolobot-b735913debff93c1a6444ec731cd4bf99ae2a5c2.tar.gz
colobot-b735913debff93c1a6444ec731cd4bf99ae2a5c2.tar.bz2
colobot-b735913debff93c1a6444ec731cd4bf99ae2a5c2.zip
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
Diffstat (limited to 'src/object/auto/autorepair.cpp')
-rw-r--r--src/object/auto/autorepair.cpp26
1 files changed, 12 insertions, 14 deletions
diff --git a/src/object/auto/autorepair.cpp b/src/object/auto/autorepair.cpp
index 05469c4..79bccc8 100644
--- a/src/object/auto/autorepair.cpp
+++ b/src/object/auto/autorepair.cpp
@@ -14,8 +14,6 @@
// * 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 <windows.h>
#include <stdio.h>
@@ -93,7 +91,7 @@ bool CAutoRepair::EventProcess(const Event &event)
{
CObject* vehicule;
D3DVECTOR pos, speed;
- FPOINT dim;
+ Math::Point dim;
float angle, shield;
CAuto::EventProcess(event);
@@ -108,7 +106,7 @@ bool CAutoRepair::EventProcess(const Event &event)
{
if ( m_timeVirus <= 0.0f )
{
- m_timeVirus = 0.1f+Rand()*0.3f;
+ m_timeVirus = 0.1f+Math::Rand()*0.3f;
}
return true;
}
@@ -138,7 +136,7 @@ bool CAutoRepair::EventProcess(const Event &event)
{
if ( m_progress < 1.0f )
{
- angle = -m_progress*(PI/2.0f)+PI/2.0f;
+ angle = -m_progress*(Math::PI/2.0f)+Math::PI/2.0f;
m_object->SetAngleZ(1, angle);
}
else
@@ -171,13 +169,13 @@ bool CAutoRepair::EventProcess(const Event &event)
m_lastParticule = m_time;
pos = m_object->RetPosition(0);
- pos.x += (Rand()-0.5f)*5.0f;
- pos.z += (Rand()-0.5f)*5.0f;
+ pos.x += (Math::Rand()-0.5f)*5.0f;
+ pos.z += (Math::Rand()-0.5f)*5.0f;
pos.y += 1.0f;
- speed.x = (Rand()-0.5f)*12.0f;
- speed.z = (Rand()-0.5f)*12.0f;
- speed.y = Rand()*15.0f;
- dim.x = Rand()*6.0f+4.0f;
+ speed.x = (Math::Rand()-0.5f)*12.0f;
+ speed.z = (Math::Rand()-0.5f)*12.0f;
+ speed.y = Math::Rand()*15.0f;
+ dim.x = Math::Rand()*6.0f+4.0f;
dim.y = dim.x;
m_particule->CreateParticule(pos, speed, dim, PARTIBLUE, 1.0f, 0.0f, 0.0f);
}
@@ -196,12 +194,12 @@ bool CAutoRepair::EventProcess(const Event &event)
{
if ( m_progress < 1.0f )
{
- angle = -(1.0f-m_progress)*(PI/2.0f)+PI/2.0f;
+ angle = -(1.0f-m_progress)*(Math::PI/2.0f)+Math::PI/2.0f;
m_object->SetAngleZ(1, angle);
}
else
{
- m_object->SetAngleZ(1, PI/2.0f);
+ m_object->SetAngleZ(1, Math::PI/2.0f);
m_phase = ARP_WAIT;
m_progress = 0.0f;
@@ -218,7 +216,7 @@ bool CAutoRepair::EventProcess(const Event &event)
bool CAutoRepair::CreateInterface(bool bSelect)
{
CWindow* pw;
- FPOINT pos, ddim;
+ Math::Point pos, ddim;
float ox, oy, sx, sy;
CAuto::CreateInterface(bSelect);