summaryrefslogtreecommitdiffstats
path: root/src/taskbuild.cpp
diff options
context:
space:
mode:
authorKrzysztof H <krzys_h@interia.pl>2012-03-09 17:08:05 +0100
committerKrzysztof H <krzys_h@interia.pl>2012-03-09 17:08:05 +0100
commit84d1f79fdf02e0010e4b2d118458e8cd8ce0dd71 (patch)
tree842825145ada8e6f53d1de9f100383cc028d2b46 /src/taskbuild.cpp
parenta4c804b49ec872b71bd5a0167c3ad45704a3cc30 (diff)
downloadcolobot-84d1f79fdf02e0010e4b2d118458e8cd8ce0dd71.tar.gz
colobot-84d1f79fdf02e0010e4b2d118458e8cd8ce0dd71.tar.bz2
colobot-84d1f79fdf02e0010e4b2d118458e8cd8ce0dd71.zip
Added license info using a small program SrcHead.
Diffstat (limited to 'src/taskbuild.cpp')
-rw-r--r--src/taskbuild.cpp72
1 files changed, 43 insertions, 29 deletions
diff --git a/src/taskbuild.cpp b/src/taskbuild.cpp
index d4b7d10..7ec1daf 100644
--- a/src/taskbuild.cpp
+++ b/src/taskbuild.cpp
@@ -1,4 +1,18 @@
-// taskbuild.cpp
+// * This file is part of the COLOBOT source code
+// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
+// *
+// * This program is free software: you can redistribute it and/or modify
+// * it under the terms of the GNU General Public License as published by
+// * the Free Software Foundation, either version 3 of the License, or
+// * (at your option) any later version.
+// *
+// * This program is distributed in the hope that it will be useful,
+// * but WITHOUT ANY WARRANTY; without even the implied warranty of
+// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// * GNU General Public License for more details.
+// *
+// * You should have received a copy of the GNU General Public License
+// * along with this program. If not, see .
#define STRICT
#define D3D_OVERLOADS
@@ -73,7 +87,7 @@ CTaskBuild::~CTaskBuild()
}
-// Crée un batiment.
+// Cr�e un batiment.
BOOL CTaskBuild::CreateBuilding(D3DVECTOR pos, float angle)
{
@@ -108,7 +122,7 @@ BOOL CTaskBuild::CreateBuilding(D3DVECTOR pos, float angle)
return TRUE;
}
-// Crée les lumières pour les effets.
+// Cr�e les lumi�res pour les effets.
void CTaskBuild::CreateLight()
{
@@ -172,7 +186,7 @@ void CTaskBuild::CreateLight()
m_bBlack = FALSE;
}
-// Fait passer les lumières du noir au blanc.
+// Fait passer les lumi�res du noir au blanc.
void CTaskBuild::BlackLight()
{
@@ -194,7 +208,7 @@ void CTaskBuild::BlackLight()
m_bBlack = TRUE;
}
-// Gestion d'un événement.
+// Gestion d'un �v�nement.
BOOL CTaskBuild::EventProcess(const Event &event)
{
@@ -209,9 +223,9 @@ BOOL CTaskBuild::EventProcess(const Event &event)
m_time += event.rTime;
- m_progress += event.rTime*m_speed; // ça avance
+ m_progress += event.rTime*m_speed; // �a avance
- if ( m_phase == TBP_TURN ) // rotation préliminaire ?
+ if ( m_phase == TBP_TURN ) // rotation pr�liminaire ?
{
a = m_object->RetAngleY(0);
g = m_angleY;
@@ -219,11 +233,11 @@ BOOL CTaskBuild::EventProcess(const Event &event)
if ( cirSpeed > 1.0f ) cirSpeed = 1.0f;
if ( cirSpeed < -1.0f ) cirSpeed = -1.0f;
- m_physics->SetMotorSpeedZ(cirSpeed); // tourne à gauche/droite
+ m_physics->SetMotorSpeedZ(cirSpeed); // tourne � gauche/droite
return TRUE;
}
- if ( m_phase == TBP_MOVE ) // avance/recule préliminaire ?
+ if ( m_phase == TBP_MOVE ) // avance/recule pr�liminaire ?
{
dist = Length(m_object->RetPosition(0), m_metal->RetPosition(0));
linSpeed = 0.0f;
@@ -244,7 +258,7 @@ BOOL CTaskBuild::EventProcess(const Event &event)
return TRUE;
}
- if ( m_phase == TBP_PREP ) // prépare ?
+ if ( m_phase == TBP_PREP ) // pr�pare ?
{
return TRUE;
}
@@ -254,7 +268,7 @@ BOOL CTaskBuild::EventProcess(const Event &event)
return TRUE;
}
- if ( !m_bBuild ) // batiment à construire ?
+ if ( !m_bBuild ) // batiment � construire ?
{
m_bBuild = TRUE;
@@ -328,7 +342,7 @@ BOOL CTaskBuild::EventProcess(const Event &event)
}
-// Assigne le but à atteindre.
+// Assigne le but � atteindre.
Error CTaskBuild::Start(ObjectType type)
{
@@ -344,7 +358,7 @@ Error CTaskBuild::Start(ObjectType type)
iAngle = NormAngle(iAngle); // 0..2*PI
oAngle = iAngle;
- m_bError = TRUE; // opération impossible
+ m_bError = TRUE; // op�ration impossible
pos = m_object->RetPosition(0);
if ( pos.y < m_water->RetLevel() ) return ERR_BUILD_WATER;
@@ -372,8 +386,8 @@ Error CTaskBuild::Start(ObjectType type)
m_metal->SetLock(TRUE); // plus utilisable
m_camera->StartCentering(m_object, PI*0.15f, 99.9f, 0.0f, 1.0f);
- m_phase = TBP_TURN; // rotation préliminaire nécessaire
- m_angleY = oAngle; // angle à atteindre
+ m_phase = TBP_TURN; // rotation pr�liminaire n�cessaire
+ m_angleY = oAngle; // angle � atteindre
pv = m_object->RetPosition(0);
pv.y += 8.3f;
@@ -387,7 +401,7 @@ Error CTaskBuild::Start(ObjectType type)
return ERR_OK;
}
-// Indique si l'action est terminée.
+// Indique si l'action est termin�e.
Error CTaskBuild::IsEnded()
{
@@ -397,7 +411,7 @@ Error CTaskBuild::IsEnded()
if ( m_engine->RetPause() ) return ERR_CONTINUE;
if ( m_bError ) return ERR_STOP;
- if ( m_phase == TBP_TURN ) // rotation préliminaire ?
+ if ( m_phase == TBP_TURN ) // rotation pr�liminaire ?
{
angle = m_object->RetAngleY(0);
angle = NormAngle(angle); // 0..2*PI
@@ -423,7 +437,7 @@ Error CTaskBuild::IsEnded()
return ERR_CONTINUE;
}
- if ( m_phase == TBP_MOVE ) // avance/recule préliminaire ?
+ if ( m_phase == TBP_MOVE ) // avance/recule pr�liminaire ?
{
dist = Length(m_object->RetPosition(0), m_metal->RetPosition(0));
@@ -462,7 +476,7 @@ Error CTaskBuild::IsEnded()
m_progress = 0.0f;
}
- if ( m_phase == TBP_PREP ) // prépare ?
+ if ( m_phase == TBP_PREP ) // pr�pare ?
{
if ( m_progress < 1.0f ) return ERR_CONTINUE;
@@ -474,7 +488,7 @@ Error CTaskBuild::IsEnded()
m_camera->StartEffect(CE_VIBRATION, m_metal->RetPosition(0), 1.0f);
m_phase = TBP_BUILD;
- m_speed = 1.0f/10.f; // durée de 10s
+ m_speed = 1.0f/10.f; // dur�e de 10s
m_progress = 0.0f;
}
@@ -484,7 +498,7 @@ Error CTaskBuild::IsEnded()
DeleteMark(m_metal->RetPosition(0), 20.0f);
- m_metal->DeleteObject(); // supprime le métal
+ m_metal->DeleteObject(); // supprime le m�tal
delete m_metal;
m_metal = 0;
@@ -554,7 +568,7 @@ BOOL CTaskBuild::Abort()
}
-// Vérifie si le terrain est assez plat et s'il n'y a pas
+// V�rifie si le terrain est assez plat et s'il n'y a pas
// un autre objet trop proche.
Error CTaskBuild::FlatFloor()
@@ -605,7 +619,7 @@ Error CTaskBuild::FlatFloor()
if ( pObj == 0 ) break;
if ( !pObj->RetActif() ) continue; // inactif ?
- if ( pObj->RetTruck() != 0 ) continue; // objet transporté ?
+ if ( pObj->RetTruck() != 0 ) continue; // objet transport� ?
if ( pObj == m_metal ) continue;
if ( pObj == m_object ) continue;
@@ -653,7 +667,7 @@ Error CTaskBuild::FlatFloor()
if ( pObj == 0 ) break;
if ( !pObj->RetActif() ) continue; // inactif ?
- if ( pObj->RetTruck() != 0 ) continue; // objet transporté ?
+ if ( pObj->RetTruck() != 0 ) continue; // objet transport� ?
if ( pObj == m_metal ) continue;
if ( pObj == m_object ) continue;
@@ -674,7 +688,7 @@ Error CTaskBuild::FlatFloor()
type == OBJECT_INFO ||
type == OBJECT_PARA ||
type == OBJECT_SAFE ||
- type == OBJECT_HUSTON ) // bâtiment ?
+ type == OBJECT_HUSTON ) // b�timent ?
{
j = 0;
while ( pObj->GetCrashSphere(j++, oPos, oRadius) )
@@ -699,7 +713,7 @@ Error CTaskBuild::FlatFloor()
return ERR_OK;
}
-// Cherche l'objet métal le plus proche.
+// Cherche l'objet m�tal le plus proche.
CObject* CTaskBuild::SearchMetalObject(float &angle, float dMin, float dMax,
float aLimit, Error &err)
@@ -724,12 +738,12 @@ CObject* CTaskBuild::SearchMetalObject(float &angle, float dMin, float dMax,
if ( pObj == 0 ) break;
if ( !pObj->RetActif() ) continue; // objet inactif ?
- if ( pObj->RetTruck() != 0 ) continue; // objet transporté ?
+ if ( pObj->RetTruck() != 0 ) continue; // objet transport� ?
type = pObj->RetType();
if ( type != OBJECT_METAL ) continue;
- bMetal = TRUE; // métal existe
+ bMetal = TRUE; // m�tal existe
oPos = pObj->RetPosition(0);
distance = Length(oPos, iPos);
@@ -769,7 +783,7 @@ CObject* CTaskBuild::SearchMetalObject(float &angle, float dMin, float dMax,
return pBest;
}
-// Détruit toutes les marques proches.
+// D�truit toutes les marques proches.
void CTaskBuild::DeleteMark(D3DVECTOR pos, float radius)
{