summaryrefslogtreecommitdiffstats
path: root/src/motiontoto.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/motiontoto.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/motiontoto.cpp')
-rw-r--r--src/motiontoto.cpp80
1 files changed, 47 insertions, 33 deletions
diff --git a/src/motiontoto.cpp b/src/motiontoto.cpp
index 1e4a8ae..37e5d53 100644
--- a/src/motiontoto.cpp
+++ b/src/motiontoto.cpp
@@ -1,4 +1,18 @@
-// motiontoto.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
@@ -28,7 +42,7 @@
-#define START_TIME 1000.0f // début du temps relatif
+#define START_TIME 1000.0f // d�but du temps relatif
@@ -74,7 +88,7 @@ void CMotionToto::DeleteObject(BOOL bAll)
}
-// Crée un véhicule roulant quelconque posé sur le sol.
+// Cr�e un v�hicule roulant quelconque pos� sur le sol.
BOOL CMotionToto::Create(D3DVECTOR pos, float angle, ObjectType type,
float power)
@@ -88,7 +102,7 @@ BOOL CMotionToto::Create(D3DVECTOR pos, float angle, ObjectType type,
m_object->SetType(type);
- // Crée la tête.
+ // Cr�e la t�te.
rank = m_engine->CreateObject();
m_engine->SetObjectType(rank, TYPEVEHICULE); // c'est un objet mobile
m_object->SetObjectRank(0, rank);
@@ -97,7 +111,7 @@ BOOL CMotionToto::Create(D3DVECTOR pos, float angle, ObjectType type,
m_object->SetPosition(0, pos);
m_object->SetAngleY(0, angle);
- // Crée la bouche.
+ // Cr�e la bouche.
rank = m_engine->CreateObject();
m_engine->SetObjectType(rank, TYPEDESCENDANT);
m_object->SetObjectRank(1, rank);
@@ -106,7 +120,7 @@ BOOL CMotionToto::Create(D3DVECTOR pos, float angle, ObjectType type,
pModFile->CreateEngineObject(rank);
m_object->SetPosition(1, D3DVECTOR(1.00f, 0.17f, 0.00f));
- // Crée l'oeil gauche.
+ // Cr�e l'oeil gauche.
rank = m_engine->CreateObject();
m_engine->SetObjectType(rank, TYPEDESCENDANT);
m_object->SetObjectRank(2, rank);
@@ -117,7 +131,7 @@ BOOL CMotionToto::Create(D3DVECTOR pos, float angle, ObjectType type,
m_object->SetPosition(2, D3DVECTOR(0.85f, 1.04f, 0.25f));
m_object->SetAngleY(2, -20.0f*PI/180.0f);
- // Crée l'oeil droite.
+ // Cr�e l'oeil droite.
rank = m_engine->CreateObject();
m_engine->SetObjectType(rank, TYPEDESCENDANT);
m_object->SetObjectRank(3, rank);
@@ -127,7 +141,7 @@ BOOL CMotionToto::Create(D3DVECTOR pos, float angle, ObjectType type,
m_object->SetPosition(3, D3DVECTOR(0.85f, 1.04f, -0.25f));
m_object->SetAngleY(3, 20.0f*PI/180.0f);
- // Crée l'antenne gauche.
+ // Cr�e l'antenne gauche.
rank = m_engine->CreateObject();
m_engine->SetObjectType(rank, TYPEDESCENDANT);
m_object->SetObjectRank(4, rank);
@@ -155,7 +169,7 @@ BOOL CMotionToto::Create(D3DVECTOR pos, float angle, ObjectType type,
m_object->SetPosition(6, D3DVECTOR(0.0f, 0.70f, 0.0f));
m_object->SetAngleX(6, 30.0f*PI/180.0f);
- // Crée l'antenne droite.
+ // Cr�e l'antenne droite.
rank = m_engine->CreateObject();
m_engine->SetObjectType(rank, TYPEDESCENDANT);
m_object->SetObjectRank(7, rank);
@@ -196,7 +210,7 @@ BOOL CMotionToto::Create(D3DVECTOR pos, float angle, ObjectType type,
}
-// Début de l'affichage des informations, avec toto dans la marge gauche.
+// D�but de l'affichage des informations, avec toto dans la marge gauche.
void CMotionToto::StartDisplayInfo()
{
@@ -228,7 +242,7 @@ void CMotionToto::SetMousePos(FPOINT pos)
}
-// Gestion d'un événement.
+// Gestion d'un �v�nement.
BOOL CMotionToto::EventProcess(const Event &event)
{
@@ -242,7 +256,7 @@ BOOL CMotionToto::EventProcess(const Event &event)
return TRUE;
}
-// Gestion d'un événement.
+// Gestion d'un �v�nement.
BOOL CMotionToto::EventFrame(const Event &event)
{
@@ -274,7 +288,7 @@ BOOL CMotionToto::EventFrame(const Event &event)
}
if ( !m_engine->RetTotoMode() )
{
- if ( !m_main->RetEditLock() ) // édition en cours ?
+ if ( !m_main->RetEditLock() ) // �dition en cours ?
{
bHidden = TRUE;
}
@@ -312,7 +326,7 @@ BOOL CMotionToto::EventFrame(const Event &event)
if ( m_progress >= 1.0f )
{
- m_actionType = -1; // action terminée
+ m_actionType = -1; // action termin�e
m_actionTime = 0.0f;
m_progress = 0.0f;
@@ -342,13 +356,13 @@ BOOL CMotionToto::EventFrame(const Event &event)
else
{
#if 0
- distance = 30.0f-progress*24.5f; // éloignement
- shift = 18.0f-progress*15.4f; // décalage à gauche
- verti = 10.0f-progress* 9.6f; // décalage en haut
+ distance = 30.0f-progress*24.5f; // �loignement
+ shift = 18.0f-progress*15.4f; // d�calage � gauche
+ verti = 10.0f-progress* 9.6f; // d�calage en haut
#else
- distance = 30.0f-progress*18.0f; // éloignement
- shift = 18.0f-progress*11.0f; // décalage à gauche
- verti = 10.0f-progress* 8.0f; // décalage en haut
+ distance = 30.0f-progress*18.0f; // �loignement
+ shift = 18.0f-progress*11.0f; // d�calage � gauche
+ verti = 10.0f-progress* 8.0f; // d�calage en haut
#endif
if ( m_actionType == -1 &&
@@ -379,7 +393,7 @@ BOOL CMotionToto::EventFrame(const Event &event)
m_type == OBJECT_MOBILEtt ||
m_type == OBJECT_MOBILEft ||
m_type == OBJECT_MOBILEit ||
- m_type == OBJECT_MOBILEdr ) ) // véhicule ?
+ m_type == OBJECT_MOBILEdr ) ) // v�hicule ?
{
m_clownTime += event.rTime;
if ( m_clownTime >= m_clownDelay )
@@ -481,13 +495,13 @@ BOOL CMotionToto::EventFrame(const Event &event)
}
nAngle = aAngle + (nAngle-aAngle)*event.rTime*4.0f;
- // Penche de côté si tourne.
+ // Penche de c�t� si tourne.
cirSpeed = (aAngle-nAngle)/event.rTime;
angle = cirSpeed*0.3f*(1.0f-progress);
if ( angle > 0.7f ) angle = 0.7f;
if ( angle < -0.7f ) angle = -0.7f;
vibCir.x += angle*1.5f;
- aAntenna.x += Abs(angle)*0.8f; // écarte
+ aAntenna.x += Abs(angle)*0.8f; // �carte
// Penche en avant si avance vite.
angle = linSpeed*0.10f*(1.0f-progress);
@@ -495,7 +509,7 @@ BOOL CMotionToto::EventFrame(const Event &event)
vibCir.z -= angle/2.0f; // penche en avant
aAntenna.z -= angle; // penche en avant
- // Calcule le mouvement résiduel.
+ // Calcule le mouvement r�siduel.
#if 1
vibLin.y += (sinf(m_time*2.00f)*0.5f+
sinf(m_time*2.11f)*0.2f)*(1.0f-progress);
@@ -520,14 +534,14 @@ BOOL CMotionToto::EventFrame(const Event &event)
vibCir.z -= progress*0.5f; // penche en avant
aAntenna.x -= progress*0.4f; // resserre
- aAntenna.z += progress*1.0f; // penche en arrière
+ aAntenna.z += progress*1.0f; // penche en arri�re
}
if ( m_actionType == MT_WARNING ) // avertissement ?
{
vibCir.x += progress*sinf(m_progress*PI*17.0f)*0.5f;
- aAntenna.x += progress*sinf(m_progress*PI*17.0f)*0.5f; // écarte
+ aAntenna.x += progress*sinf(m_progress*PI*17.0f)*0.5f; // �carte
aAntenna.z += progress*cosf(m_progress*PI*17.0f)*0.5f; // tourne
}
@@ -593,7 +607,7 @@ BOOL CMotionToto::EventFrame(const Event &event)
SetLinVibration(vibLin);
SetCirVibration(vibCir);
- // Calcule le mouvement résiduel des antennes.
+ // Calcule le mouvement r�siduel des antennes.
pos = aAntenna*0.40f;
pos.x += sinf(m_time*PI*2.07f)*(PI/50.0f)+
sinf(m_time*PI*2.59f)*(PI/70.0f)+
@@ -718,9 +732,9 @@ BOOL CMotionToto::EventFrame(const Event &event)
m_object->SetAngleX(3, 0.0f);
}
- mat = m_object->RetWorldMatrix(0); // doit être fait chaque fois !
+ mat = m_object->RetWorldMatrix(0); // doit �tre fait chaque fois !
- // Génère les particules.
+ // G�n�re les particules.
if ( m_time-m_lastMotorParticule >= m_engine->ParticuleAdapt(0.05f) )
{
m_lastMotorParticule = m_time;
@@ -814,8 +828,8 @@ BOOL CMotionToto::EventFrame(const Event &event)
r = rand()%4;
if ( r == 0 ) pos.x = 0.21f; // sur le bord gauche
else if ( r == 1 ) pos.x = 0.98f; // sur le bord droite
- else if ( r == 2 ) pos.y = 0.02f; // sur le bord inférieur
- else pos.y = 0.92f; // sur le bord supérieur
+ else if ( r == 2 ) pos.y = 0.02f; // sur le bord inf�rieur
+ else pos.y = 0.92f; // sur le bord sup�rieur
dim.x = (Rand()*0.02f+0.02f);
dim.y = dim.x/0.75f;
m_particule->CreateParticule(pos, speed, dim, PARTIERROR, 0.5f+Rand()*0.5f, 0.0f, 1.0f, SH_INTERFACE);
@@ -836,7 +850,7 @@ BOOL CMotionToto::EventFrame(const Event &event)
}
-// Démarre une action.
+// D�marre une action.
Error CMotionToto::SetAction(int action, float time)
{
@@ -860,7 +874,7 @@ Error CMotionToto::SetAction(int action, float time)
return ERR_OK;
}
-// Spécifie le type de l'objet rattaché à toto.
+// Sp�cifie le type de l'objet rattach� � toto.
void CMotionToto::SetLinkType(ObjectType type)
{