summaryrefslogtreecommitdiffstats
path: root/src/pyro.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/pyro.cpp')
-rw-r--r--src/pyro.cpp150
1 files changed, 75 insertions, 75 deletions
diff --git a/src/pyro.cpp b/src/pyro.cpp
index 5a55819..29689fb 100644
--- a/src/pyro.cpp
+++ b/src/pyro.cpp
@@ -1,4 +1,4 @@
-// * This file is part of the COLOBOT source code
+// * 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
@@ -12,7 +12,7 @@
// * 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 http://www.gnu.org/licenses/.
+// * along with this program. If not, see http://www.gnu.org/licenses/.// pyro.cpp
#define STRICT
#define D3D_OVERLOADS
@@ -75,7 +75,7 @@ CPyro::~CPyro()
}
-// D�truit l'objet.
+// Détruit l'objet.
void CPyro::DeleteObject(BOOL bAll)
{
@@ -87,7 +87,7 @@ void CPyro::DeleteObject(BOOL bAll)
}
-// Cr�e un effet pyrotechnique.
+// Crée un effet pyrotechnique.
BOOL CPyro::Create(PyroType type, CObject* pObj, float force)
{
@@ -110,9 +110,9 @@ BOOL CPyro::Create(PyroType type, CObject* pObj, float force)
m_engine->GetBBox(objRank, min, max);
pos = pObj->RetPosition(0);
- DisplayError(type, pObj); // affiche message �ventuel
+ DisplayError(type, pObj); // affiche message éventuel
- // Copie toutes les sph�res de l'objet.
+ // Copie toutes les sphères de l'objet.
for ( i=0 ; i<50 ; i++ )
{
if ( !pObj->GetCrashSphere(i, m_crashSpherePos[i], m_crashSphereRadius[i]) ) break;
@@ -204,7 +204,7 @@ BOOL CPyro::Create(PyroType type, CObject* pObj, float force)
m_posPower = m_pos;
}
if ( oType == OBJECT_SCRAP4 ||
- oType == OBJECT_SCRAP5 ) // mati�re plastique ?
+ oType == OBJECT_SCRAP5 ) // matière plastique ?
{
m_bPower = TRUE;
m_posPower = m_pos;
@@ -404,9 +404,9 @@ BOOL CPyro::Create(PyroType type, CObject* pObj, float force)
m_speed = 1.0f/15.0f;
LightOperAdd(0.00f, 0.0f, 2.0f, 1.0f, 0.0f); // rouge-orange
- LightOperAdd(0.30f, 1.0f, -0.8f, -0.8f, -0.8f); // gris fonc�
- LightOperAdd(0.80f, 1.0f, -0.8f, -0.8f, -0.8f); // gris fonc�
- LightOperAdd(1.00f, 0.0f, -0.8f, -0.8f, -0.8f); // gris fonc�
+ LightOperAdd(0.30f, 1.0f, -0.8f, -0.8f, -0.8f); // gris foncé
+ LightOperAdd(0.80f, 1.0f, -0.8f, -0.8f, -0.8f); // gris foncé
+ LightOperAdd(1.00f, 0.0f, -0.8f, -0.8f, -0.8f); // gris foncé
CreateLight(m_pos, 40.0f);
return TRUE;
}
@@ -430,32 +430,32 @@ BOOL CPyro::Create(PyroType type, CObject* pObj, float force)
if ( m_type == PT_FRAGO ||
m_type == PT_EXPLOO )
{
- LightOperAdd(0.00f, 0.0f, -1.0f, -0.5f, -1.0f); // vert fonc�
- LightOperAdd(0.05f, 1.0f, -1.0f, -0.5f, -1.0f); // vert fonc�
- LightOperAdd(1.00f, 0.0f, -1.0f, -0.5f, -1.0f); // vert fonc�
+ LightOperAdd(0.00f, 0.0f, -1.0f, -0.5f, -1.0f); // vert foncé
+ LightOperAdd(0.05f, 1.0f, -1.0f, -0.5f, -1.0f); // vert foncé
+ LightOperAdd(1.00f, 0.0f, -1.0f, -0.5f, -1.0f); // vert foncé
}
else if ( m_type == PT_FRAGT ||
m_type == PT_EXPLOT )
{
LightOperAdd(0.00f, 1.0f, 4.0f, 4.0f, 2.0f); // jaune
LightOperAdd(0.02f, 1.0f, 4.0f, 2.0f, 0.0f); // rouge-orange
- LightOperAdd(0.16f, 1.0f, -0.8f, -0.8f, -0.8f); // gris fonc�
- LightOperAdd(1.00f, 0.0f, -0.8f, -0.8f, -0.8f); // gris fonc�
+ LightOperAdd(0.16f, 1.0f, -0.8f, -0.8f, -0.8f); // gris foncé
+ LightOperAdd(1.00f, 0.0f, -0.8f, -0.8f, -0.8f); // gris foncé
h = m_size*2.0f;
}
else if ( m_type == PT_SPIDER )
{
- LightOperAdd(0.00f, 0.0f, -0.5f, -1.0f, -1.0f); // rouge fonc�
- LightOperAdd(0.05f, 1.0f, -0.5f, -1.0f, -1.0f); // rouge fonc�
- LightOperAdd(1.00f, 0.0f, -0.5f, -1.0f, -1.0f); // rouge fonc�
+ LightOperAdd(0.00f, 0.0f, -0.5f, -1.0f, -1.0f); // rouge foncé
+ LightOperAdd(0.05f, 1.0f, -0.5f, -1.0f, -1.0f); // rouge foncé
+ LightOperAdd(1.00f, 0.0f, -0.5f, -1.0f, -1.0f); // rouge foncé
}
else if ( m_type == PT_FRAGW ||
m_type == PT_EXPLOW ||
m_type == PT_SHOTW )
{
- LightOperAdd(0.00f, 0.0f, -0.5f, -0.5f, -1.0f); // jaune fonc�
- LightOperAdd(0.05f, 1.0f, -0.5f, -0.5f, -1.0f); // jaune fonc�
- LightOperAdd(1.00f, 0.0f, -0.5f, -0.5f, -1.0f); // jaune fonc�
+ LightOperAdd(0.00f, 0.0f, -0.5f, -0.5f, -1.0f); // jaune foncé
+ LightOperAdd(0.05f, 1.0f, -0.5f, -0.5f, -1.0f); // jaune foncé
+ LightOperAdd(1.00f, 0.0f, -0.5f, -0.5f, -1.0f); // jaune foncé
}
else if ( m_type == PT_WPCHECK ||
m_type == PT_FLCREATE ||
@@ -468,9 +468,9 @@ BOOL CPyro::Create(PyroType type, CObject* pObj, float force)
}
else
{
- LightOperAdd(0.00f, 0.0f, -0.8f, -0.8f, -0.8f); // gris fonc�
- LightOperAdd(0.05f, 1.0f, -0.8f, -0.8f, -0.8f); // gris fonc�
- LightOperAdd(1.00f, 0.0f, -0.8f, -0.8f, -0.8f); // gris fonc�
+ LightOperAdd(0.00f, 0.0f, -0.8f, -0.8f, -0.8f); // gris foncé
+ LightOperAdd(0.05f, 1.0f, -0.8f, -0.8f, -0.8f); // gris foncé
+ LightOperAdd(1.00f, 0.0f, -0.8f, -0.8f, -0.8f); // gris foncé
}
CreateLight(m_pos, h);
@@ -487,7 +487,7 @@ BOOL CPyro::Create(PyroType type, CObject* pObj, float force)
if ( m_type == PT_SHOTW ) return TRUE;
- // G�n�re les triangles de l'explosion.
+ // Génère les triangles de l'explosion.
if ( m_type == PT_FRAGT ||
m_type == PT_FRAGO ||
m_type == PT_FRAGW ||
@@ -630,7 +630,7 @@ BOOL CPyro::Create(PyroType type, CObject* pObj, float force)
return TRUE;
}
-// Cr�e une explosion sous forme de particules triangulaires.
+// Crée une explosion sous forme de particules triangulaires.
void CPyro::CreateTriangle(CObject* pObj, ObjectType oType, int part)
{
@@ -757,8 +757,8 @@ void CPyro::CreateTriangle(CObject* pObj, ObjectType oType, int part)
}
}
-// Affiche l'erreur ou l'information �ventuelle, li�e � la destruction
-// d'un insecte, d'un v�hicule ou d'un batiment.
+// Affiche l'erreur ou l'information éventuelle, liée à la destruction
+// d'un insecte, d'un véhicule ou d'un batiment.
void CPyro::DisplayError(PyroType type, CObject* pObj)
{
@@ -845,7 +845,7 @@ void CPyro::DisplayError(PyroType type, CObject* pObj)
}
-// Gestion d'un �v�nement.
+// Gestion d'un événement.
BOOL CPyro::EventProcess(const Event &event)
{
@@ -1374,7 +1374,7 @@ BOOL CPyro::EventProcess(const Event &event)
return TRUE;
}
-// Indique que l'objet li� � l'effet n'existe plus, sans le d�truire.
+// Indique que l'objet lié à l'effet n'existe plus, sans le détruire.
void CPyro::CutObjectLink(CObject* pObj)
{
@@ -1384,12 +1384,12 @@ void CPyro::CutObjectLink(CObject* pObj)
}
}
-// Indique si l'effet pyrotechnique est termin�.
+// Indique si l'effet pyrotechnique est terminé.
Error CPyro::IsEnded()
{
- // D�truit l'objet qui explose. Il ne doit pas �tre d�truit � la fin
- // du Create, car c'est parfois l'objet lui-m�me qui fait le Create :
+ // Détruit l'objet qui explose. Il ne doit pas être détruit à la fin
+ // du Create, car c'est parfois l'objet lui-même qui fait le Create :
// pyro->Create(PT_FRAGT, this);
if ( m_type == PT_FRAGT ||
m_type == PT_FRAGO ||
@@ -1422,7 +1422,7 @@ Error CPyro::IsEnded()
}
if ( m_type == PT_BURNT ||
- m_type == PT_BURNO ) // br�le ?
+ m_type == PT_BURNO ) // brûle ?
{
BurnTerminate();
}
@@ -1456,7 +1456,7 @@ Error CPyro::IsEnded()
return ERR_STOP;
}
-// Supprime l'objet li� � l'effet pyrotechnique.
+// Supprime l'objet lié à l'effet pyrotechnique.
void CPyro::DeleteObject(BOOL bPrimary, BOOL bSecondary)
{
@@ -1468,7 +1468,7 @@ void CPyro::DeleteObject(BOOL bPrimary, BOOL bSecondary)
if ( m_object->RetResetCap() == RESET_MOVE ) // objet resetable ?
{
- m_object->SetEnable(FALSE); // objet cach� et inactif
+ m_object->SetEnable(FALSE); // objet caché et inactif
pos = m_object->RetPosition(0);
pos.y = -100.0f;
m_object->SetPosition(0, pos);
@@ -1492,7 +1492,7 @@ void CPyro::DeleteObject(BOOL bPrimary, BOOL bSecondary)
sub = m_object->RetFret();
if ( sub != 0 )
{
- sub->DeleteObject(); // supprime l'objet transport�
+ sub->DeleteObject(); // supprime l'objet transporté
delete sub;
m_object->SetFret(0);
}
@@ -1501,7 +1501,7 @@ void CPyro::DeleteObject(BOOL bPrimary, BOOL bSecondary)
if ( bPrimary )
{
truck = m_object->RetTruck();
- if ( truck != 0 ) // objet port� ?
+ if ( truck != 0 ) // objet porté ?
{
if ( truck->RetPower() == m_object )
{
@@ -1520,18 +1520,18 @@ void CPyro::DeleteObject(BOOL bPrimary, BOOL bSecondary)
}
}
-// (*) CObject::DeleteObject peut remettre � z�ro m_object
+// (*) CObject::DeleteObject peut remettre à zéro m_object
// par le biais de CPyro::CutObjectLink !
-// Vide la table des op�rations d'animation de la lumi�re.
+// Vide la table des opérations d'animation de la lumière.
void CPyro::LightOperFlush()
{
m_lightOperTotal = 0;
}
-// Ajoute une op�ration d'animation de la lumi�re.
+// Ajoute une opération d'animation de la lumière.
void CPyro::LightOperAdd(float progress, float intensity,
float r, float g, float b)
@@ -1549,7 +1549,7 @@ void CPyro::LightOperAdd(float progress, float intensity,
m_lightOperTotal ++;
}
-// Fait �voluer la lumi�re associ�e.
+// Fait évoluer la lumière associée.
void CPyro::LightOperFrame(float rTime)
{
@@ -1576,7 +1576,7 @@ void CPyro::LightOperFrame(float rTime)
}
-// Cr�e la lumi�re pour accompagner un effet pyrotechnique.
+// Crée la lumière pour accompagner un effet pyrotechnique.
BOOL CPyro::CreateLight(D3DVECTOR pos, float height)
{
@@ -1608,14 +1608,14 @@ BOOL CPyro::CreateLight(D3DVECTOR pos, float height)
m_light->SetLight(m_lightRank, light);
m_light->SetLightIntensity(m_lightRank, 0.0f);
- // N'�claire que les objets du terrain.
+ // N'éclaire que les objets du terrain.
m_light->SetLightIncluType(m_lightRank, TYPETERRAIN);
return TRUE;
}
-// D�marre l'explosion d'un v�hicule.
+// Démarre l'explosion d'un véhicule.
void CPyro::ExploStart()
{
@@ -1635,7 +1635,7 @@ void CPyro::ExploStart()
if ( m_object->RetSelect() )
{
- m_object->SetSelect(FALSE); // d�s�lectionne l'objet
+ m_object->SetSelect(FALSE); // désélectionne l'objet
m_camera->SetType(CAMERA_EXPLO);
m_main->DeselectAll();
}
@@ -1675,10 +1675,10 @@ void CPyro::ExploStart()
}
m_engine->LoadTexture("dirty04.tga", 1);
- DeleteObject(FALSE, TRUE); // d�truit l'objet transport� + la pile
+ DeleteObject(FALSE, TRUE); // détruit l'objet transporté + la pile
}
-// Termine l'explosion d'un v�hicule.
+// Termine l'explosion d'un véhicule.
void CPyro::ExploTerminate()
{
@@ -1686,7 +1686,7 @@ void CPyro::ExploTerminate()
}
-// D�marre le feu d'un v�hicule.
+// Démarre le feu d'un véhicule.
void CPyro::BurnStart()
{
@@ -1703,7 +1703,7 @@ void CPyro::BurnStart()
if ( m_object->RetSelect() )
{
- m_object->SetSelect(FALSE); // d�s�lectionne l'objet
+ m_object->SetSelect(FALSE); // désélectionne l'objet
m_camera->SetType(CAMERA_EXPLO);
m_main->DeselectAll();
}
@@ -1816,7 +1816,7 @@ void CPyro::BurnStart()
}
BurnAddPart(0, pos, angle); // mouvement de la partie principale
- m_burnKeepPart[0] = -1; // rien � garder
+ m_burnKeepPart[0] = -1; // rien à garder
if ( m_burnType == OBJECT_DERRICK )
{
@@ -1883,7 +1883,7 @@ void CPyro::BurnStart()
angle.x = (Rand()-0.5f)*0.2f;
angle.y = (Rand()-0.5f)*0.2f;
angle.z = 0.0f;
- BurnAddPart(1, pos, angle); // descend l'an�mom�tre
+ BurnAddPart(1, pos, angle); // descend l'anémomètre
}
if ( m_burnType == OBJECT_RADAR )
@@ -2159,7 +2159,7 @@ void CPyro::BurnStart()
}
}
-// Ajoute une partie � bouger.
+// Ajoute une partie à bouger.
void CPyro::BurnAddPart(int part, D3DVECTOR pos, D3DVECTOR angle)
{
@@ -2175,7 +2175,7 @@ void CPyro::BurnAddPart(int part, D3DVECTOR pos, D3DVECTOR angle)
m_burnPartTotal ++;
}
-// Fait progresser le feu d'un v�hicule.
+// Fait progresser le feu d'un véhicule.
void CPyro::BurnProgress()
{
@@ -2186,7 +2186,7 @@ void CPyro::BurnProgress()
if ( m_burnType == OBJECT_TEEN31 ) // basket ?
{
- m_object->SetZoomY(0, 1.0f-m_progress*0.5f); // l�ger applatissement
+ m_object->SetZoomY(0, 1.0f-m_progress*0.5f); // léger applatissement
}
for ( i=0 ; i<m_burnPartTotal ; i++ )
@@ -2211,7 +2211,7 @@ void CPyro::BurnProgress()
}
}
-// Indique si une partie doit �tre conserv�e.
+// Indique si une partie doit être conservée.
BOOL CPyro::BurnIsKeepPart(int part)
{
@@ -2222,16 +2222,16 @@ BOOL CPyro::BurnIsKeepPart(int part)
{
if ( part == m_burnKeepPart[i++] ) return TRUE; // faut garder
}
- return FALSE; // faut d�truire
+ return FALSE; // faut détruire
}
-// Termine le feu d'un insecte ou d'un v�hicule.
+// Termine le feu d'un insecte ou d'un véhicule.
void CPyro::BurnTerminate()
{
int i, objRank;
- if ( m_type == PT_BURNO ) // br�le objet organique ?
+ if ( m_type == PT_BURNO ) // brûle objet organique ?
{
DeleteObject(TRUE, TRUE); // supprime l'insecte
return;
@@ -2246,7 +2246,7 @@ void CPyro::BurnTerminate()
m_object->DeletePart(i);
}
- DeleteObject(FALSE, TRUE); // d�truit l'objet transport� + la pile
+ DeleteObject(FALSE, TRUE); // détruit l'objet transporté + la pile
if ( m_burnType == OBJECT_DERRICK ||
m_burnType == OBJECT_STATION ||
@@ -2267,20 +2267,20 @@ void CPyro::BurnTerminate()
m_burnType == OBJECT_START ||
m_burnType == OBJECT_END )
{
- m_object->SetType(OBJECT_RUINfactory); // �a devient une ruine
+ m_object->SetType(OBJECT_RUINfactory); // ça devient une ruine
m_object->SetLock(FALSE);
}
else
{
- m_object->SetType(OBJECT_RUINmobilew1); // �a devient une ruine
+ m_object->SetType(OBJECT_RUINmobilew1); // ça devient une ruine
m_object->SetLock(FALSE);
}
- m_object->SetBurn(FALSE); // ruine utilisable (c-�-d. r�cup�rable)
+ m_object->SetBurn(FALSE); // ruine utilisable (c-à-d. récupérable)
}
-// D�but d'un objet fret qui tombe.
+// Début d'un objet fret qui tombe.
void CPyro::FallStart()
{
@@ -2295,7 +2295,7 @@ void CPyro::FallStart()
m_bFallEnding = FALSE;
}
-// Cherche un objet � exploser par le boulet de l'abeille qui tombe.
+// Cherche un objet à exploser par le boulet de l'abeille qui tombe.
CObject* CPyro::FallSearchBeeExplo()
{
@@ -2362,7 +2362,7 @@ CObject* CPyro::FallSearchBeeExplo()
oType != OBJECT_POWER &&
oType != OBJECT_ATOMIC ) continue;
- if ( pObj->RetTruck() != 0 ) continue; // objet transport� ?
+ if ( pObj->RetTruck() != 0 ) continue; // objet transporté ?
oPos = pObj->RetPosition(0);
@@ -2379,12 +2379,12 @@ CObject* CPyro::FallSearchBeeExplo()
if ( distance < 25.0f ) return pObj;
}
- // Test au centre de l'objet, ce qui est n�cessaire pour
- // les objets qui n'ont pas de sph�re au centre (station).
+ // Test au centre de l'objet, ce qui est nécessaire pour
+ // les objets qui n'ont pas de sphère au centre (station).
distance = Length(oPos, iPos)-4.0f;
if ( distance < 5.0f ) return pObj;
- // Test avec toutes les sph�res de l'objet.
+ // Test avec toutes les sphères de l'objet.
j = 0;
while ( pObj->GetCrashSphere(j++, oPos, oRadius) )
{
@@ -2430,14 +2430,14 @@ void CPyro::FallProgress(float rTime)
pObj = FallSearchBeeExplo();
if ( pObj == 0 )
{
- if ( bFloor ) // arriv� au niveau du sol ?
+ if ( bFloor ) // arrivé au niveau du sol ?
{
- m_object->ExploObject(EXPLO_BOUM, 0.0f); // d�marre explosion
+ m_object->ExploObject(EXPLO_BOUM, 0.0f); // démarre explosion
}
}
else
{
- if ( pObj->RetShieldRadius() > 0.0f ) // prot�g� par bouclier ?
+ if ( pObj->RetShieldRadius() > 0.0f ) // protégé par bouclier ?
{
m_particule->CreateParticule(pos, D3DVECTOR(0.0f, 0.0f, 0.0f), FPOINT(6.0f, 6.0f), PARTIGUNDEL, 2.0f, 0.0f, 0.0f);
m_sound->Play(SOUND_GUNDEL);
@@ -2446,13 +2446,13 @@ void CPyro::FallProgress(float rTime)
}
else
{
- if ( pObj->ExploObject(EXPLO_BOUM, 1.0f) ) // d�marre explosion
+ if ( pObj->ExploObject(EXPLO_BOUM, 1.0f) ) // démarre explosion
{
DeleteObject(TRUE, TRUE); // supprime le boulet
}
else
{
- m_object->ExploObject(EXPLO_BOUM, 0.0f); // d�marre explosion
+ m_object->ExploObject(EXPLO_BOUM, 0.0f); // démarre explosion
}
}
}
@@ -2465,7 +2465,7 @@ void CPyro::FallProgress(float rTime)
}
}
-// Indique si la chute est termin�e.
+// Indique si la chute est terminée.
Error CPyro::FallIsEnded()
{