mirror of
https://github.com/blupi-games/planetblupi
synced 2024-12-30 10:15:36 +01:00
Convert to UTF-8
This commit is contained in:
parent
0af18aa9eb
commit
0e338b45db
@ -1365,7 +1365,7 @@ static DescAction action_table[] =
|
||||
{0},
|
||||
},
|
||||
{
|
||||
ACTION_MISC1, // hausse les épaules
|
||||
ACTION_MISC1, // hausse les épaules
|
||||
CHBLUPI,
|
||||
{
|
||||
{1, 140}, // e
|
||||
@ -1465,7 +1465,7 @@ static DescAction action_table[] =
|
||||
{0},
|
||||
},
|
||||
{
|
||||
ACTION_MISC5, // ohé
|
||||
ACTION_MISC5, // ohé
|
||||
CHBLUPI,
|
||||
{
|
||||
{8, 110,110,111,111,110,110,112,112},
|
||||
@ -1844,7 +1844,7 @@ static DescAction action_table[] =
|
||||
{0},
|
||||
},
|
||||
|
||||
// Araignée :
|
||||
// Araignée :
|
||||
|
||||
{
|
||||
ACTION_A_STOP,
|
||||
@ -2443,7 +2443,7 @@ static DescAction action_table[] =
|
||||
-1,-1,SOUND_B_SAUT,-1,-1,-1,-1,-1,-1,-1},
|
||||
},
|
||||
|
||||
// Détonnateur de mine.
|
||||
// Détonnateur de mine.
|
||||
|
||||
{
|
||||
ACTION_D_DELAY,
|
||||
@ -2568,7 +2568,7 @@ static DescAction action_table[] =
|
||||
|
||||
|
||||
// Calcule l'action suivante.
|
||||
// Retourne false lorsque l'action est terminée.
|
||||
// Retourne false lorsque l'action est terminée.
|
||||
|
||||
bool Action(short action, short direct,
|
||||
short &phase, short &step,
|
||||
@ -2656,7 +2656,7 @@ static short rotate_table[] =
|
||||
-1
|
||||
};
|
||||
|
||||
// Tourne une icône dans une direction donnée.
|
||||
// Tourne une icône dans une direction donnée.
|
||||
|
||||
bool Rotate(short &icon, short direct)
|
||||
{
|
||||
@ -2717,7 +2717,7 @@ bool Rotate(short &icon, short direct)
|
||||
return false;
|
||||
}
|
||||
|
||||
// Retourne la direction d'une icône.
|
||||
// Retourne la direction d'une icône.
|
||||
|
||||
int GetIconDirect(short icon)
|
||||
{
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include "misc.h"
|
||||
|
||||
// Cette table indique les quarts de cases contenant de
|
||||
// l'eau lorsque la valeur est à un.
|
||||
// l'eau lorsque la valeur est à un.
|
||||
// 0 1
|
||||
// 2 3
|
||||
static char tableSee[14*4] =
|
||||
@ -27,7 +27,7 @@ static char tableSee[14*4] =
|
||||
};
|
||||
|
||||
// Cette table indique les quarts de cases contenant de
|
||||
// la mousse ou de la terre lorsque la valeur est à un.
|
||||
// la mousse ou de la terre lorsque la valeur est à un.
|
||||
// 0 1
|
||||
// 2 3
|
||||
static char tableDark[13*4] =
|
||||
@ -76,7 +76,7 @@ bool CDecor::GetSeeBits(POINT cel, char *pBits, int index)
|
||||
if ( index == 1 ) // mousse ?
|
||||
{
|
||||
if ( icon >= 2 && icon <= 14 ) return false; // eau ?
|
||||
if ( icon == 66 || icon == 79 ) // mousse spéciale ?
|
||||
if ( icon == 66 || icon == 79 ) // mousse spéciale ?
|
||||
{
|
||||
pBits[0] = 1;
|
||||
pBits[1] = 1;
|
||||
@ -95,8 +95,8 @@ bool CDecor::GetSeeBits(POINT cel, char *pBits, int index)
|
||||
if ( index == 2 ) // terre ?
|
||||
{
|
||||
if ( icon >= 2 && icon <= 14 ) return false; // eau ?
|
||||
if ( (icon >= 46 && icon <= 48) || // terre spéciale ?
|
||||
icon == 71 ) // terre à fer ?
|
||||
if ( (icon >= 46 && icon <= 48) || // terre spéciale ?
|
||||
icon == 71 ) // terre à fer ?
|
||||
{
|
||||
pBits[0] = 1;
|
||||
pBits[1] = 1;
|
||||
@ -132,7 +132,7 @@ bool ChangeBits(char *pDst, char *pSrc)
|
||||
return false;
|
||||
}
|
||||
|
||||
// Retourne l'icône correspondant aux bits d'eaux.
|
||||
// Retourne l'icône correspondant aux bits d'eaux.
|
||||
|
||||
int CDecor::GetSeeIcon(char *pBits, int index)
|
||||
{
|
||||
@ -179,7 +179,7 @@ int CDecor::GetSeeIcon(char *pBits, int index)
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Arrange le sol après une modification.
|
||||
// Arrange le sol après une modification.
|
||||
|
||||
void CDecor::ArrangeFloor(POINT cel)
|
||||
{
|
||||
@ -193,7 +193,7 @@ void CDecor::ArrangeFloor(POINT cel)
|
||||
if ( icon >= 59 && icon <= 64 ) return; // pont ?
|
||||
|
||||
max = 3;
|
||||
if ( icon >= 15 && icon <= 18 ) // dalle spéciale ?
|
||||
if ( icon >= 15 && icon <= 18 ) // dalle spéciale ?
|
||||
{
|
||||
max = 1; // s'occupe que de l'eau !
|
||||
}
|
||||
@ -202,7 +202,7 @@ void CDecor::ArrangeFloor(POINT cel)
|
||||
{
|
||||
if ( !GetSeeBits(cel, here, index) ) continue;
|
||||
|
||||
test.x = cel.x -2; // en bas à gauche
|
||||
test.x = cel.x -2; // en bas à gauche
|
||||
test.y = cel.y +2;
|
||||
if ( GetSeeBits(test, bits, index) )
|
||||
{
|
||||
@ -216,7 +216,7 @@ void CDecor::ArrangeFloor(POINT cel)
|
||||
}
|
||||
}
|
||||
|
||||
test.x = cel.x -2; // en haut à gauche
|
||||
test.x = cel.x -2; // en haut à gauche
|
||||
test.y = cel.y -2;
|
||||
if ( GetSeeBits(test, bits, index) )
|
||||
{
|
||||
@ -230,7 +230,7 @@ void CDecor::ArrangeFloor(POINT cel)
|
||||
}
|
||||
}
|
||||
|
||||
test.x = cel.x +2; // en haut à droite
|
||||
test.x = cel.x +2; // en haut à droite
|
||||
test.y = cel.y -2;
|
||||
if ( GetSeeBits(test, bits, index) )
|
||||
{
|
||||
@ -244,7 +244,7 @@ void CDecor::ArrangeFloor(POINT cel)
|
||||
}
|
||||
}
|
||||
|
||||
test.x = cel.x +2; // en bas à droite
|
||||
test.x = cel.x +2; // en bas à droite
|
||||
test.y = cel.y +2;
|
||||
if ( GetSeeBits(test, bits, index) )
|
||||
{
|
||||
@ -265,7 +265,7 @@ void CDecor::ArrangeFloor(POINT cel)
|
||||
}
|
||||
|
||||
|
||||
test.x = cel.x -2; // à gauche
|
||||
test.x = cel.x -2; // à gauche
|
||||
test.y = cel.y;
|
||||
if ( GetSeeBits(test, bits, index) )
|
||||
{
|
||||
@ -279,7 +279,7 @@ void CDecor::ArrangeFloor(POINT cel)
|
||||
}
|
||||
}
|
||||
|
||||
test.x = cel.x -2; // en haut à gauche
|
||||
test.x = cel.x -2; // en haut à gauche
|
||||
test.y = cel.y -2;
|
||||
if ( GetSeeBits(test, bits, index) )
|
||||
{
|
||||
@ -306,7 +306,7 @@ void CDecor::ArrangeFloor(POINT cel)
|
||||
}
|
||||
}
|
||||
|
||||
test.x = cel.x +2; // en haut à droite
|
||||
test.x = cel.x +2; // en haut à droite
|
||||
test.y = cel.y -2;
|
||||
if ( GetSeeBits(test, bits, index) )
|
||||
{
|
||||
@ -319,7 +319,7 @@ void CDecor::ArrangeFloor(POINT cel)
|
||||
}
|
||||
}
|
||||
|
||||
test.x = cel.x +2; // à droite
|
||||
test.x = cel.x +2; // à droite
|
||||
test.y = cel.y;
|
||||
if ( GetSeeBits(test, bits, index) )
|
||||
{
|
||||
@ -333,7 +333,7 @@ void CDecor::ArrangeFloor(POINT cel)
|
||||
}
|
||||
}
|
||||
|
||||
test.x = cel.x +2; // en bas à droite
|
||||
test.x = cel.x +2; // en bas à droite
|
||||
test.y = cel.y +2;
|
||||
if ( GetSeeBits(test, bits, index) )
|
||||
{
|
||||
@ -360,7 +360,7 @@ void CDecor::ArrangeFloor(POINT cel)
|
||||
}
|
||||
}
|
||||
|
||||
test.x = cel.x -2; // en bas à gauche
|
||||
test.x = cel.x -2; // en bas à gauche
|
||||
test.y = cel.y +2;
|
||||
if ( GetSeeBits(test, bits, index) )
|
||||
{
|
||||
@ -412,7 +412,7 @@ static short tableMurDir[4*2] =
|
||||
// les directions.
|
||||
// index=0 si mur (20..26)
|
||||
// index=1 si palissade (65..71)
|
||||
// index=2 si barrière (106..112)
|
||||
// index=2 si barrière (106..112)
|
||||
|
||||
void CDecor::ArrangeMur(POINT cel, int &icon, int index)
|
||||
{
|
||||
@ -521,7 +521,7 @@ void CDecor::ArrangeBuild(POINT cel, int &channel, int &icon)
|
||||
matiere = 36; // planches
|
||||
}
|
||||
|
||||
// Rien à faire si pas mur.
|
||||
// Rien à faire si pas mur.
|
||||
if ( channel != CHOBJECT || icon != last ) continue;
|
||||
|
||||
oldChannel = m_decor[cel.x/2][cel.y/2].objectChannel;
|
||||
@ -567,7 +567,7 @@ void CDecor::ArrangeBuild(POINT cel, int &channel, int &icon)
|
||||
}
|
||||
}
|
||||
|
||||
// Arrange les objets après une modification.
|
||||
// Arrange les objets après une modification.
|
||||
|
||||
void CDecor::ArrangeObject(POINT cel)
|
||||
{
|
||||
@ -591,7 +591,7 @@ void CDecor::ArrangeObject(POINT cel)
|
||||
}
|
||||
if ( index == 2 )
|
||||
{
|
||||
first = 106; // barrière
|
||||
first = 106; // barrière
|
||||
last = 112;
|
||||
}
|
||||
|
||||
@ -687,7 +687,7 @@ void CDecor::ArrangeObject(POINT cel)
|
||||
if ( MoveCreate(test, -1, false, CHOBJECT,-1,
|
||||
-1,-1, 9999,1,0, true) )
|
||||
{
|
||||
MoveAddIcons(test, 5-i%2, true); // éclairs
|
||||
MoveAddIcons(test, 5-i%2, true); // éclairs
|
||||
}
|
||||
|
||||
pos = ConvCelToPos(test);
|
||||
@ -803,7 +803,7 @@ bool CDecor::ArrangeFillTest(POINT pos)
|
||||
return false;
|
||||
}
|
||||
|
||||
// Modifie le décor lors d'un remplissage.
|
||||
// Modifie le décor lors d'un remplissage.
|
||||
|
||||
void CDecor::ArrangeFillPut(POINT pos, int channel, int icon)
|
||||
{
|
||||
@ -831,7 +831,7 @@ void CDecor::ArrangeFillPut(POINT pos, int channel, int icon)
|
||||
}
|
||||
}
|
||||
|
||||
// Rempli un sol à partir d'une position donnée.
|
||||
// Rempli un sol à partir d'une position donnée.
|
||||
|
||||
void CDecor::ArrangeFillSearch(POINT pos)
|
||||
{
|
||||
@ -854,7 +854,7 @@ void CDecor::ArrangeFillSearch(POINT pos)
|
||||
}
|
||||
endX = pos.x-2;
|
||||
|
||||
// Rempli toute la ligne trouvée.
|
||||
// Rempli toute la ligne trouvée.
|
||||
pos.x = startX;
|
||||
while ( pos.x <= endX )
|
||||
{
|
||||
@ -877,7 +877,7 @@ void CDecor::ArrangeFillSearch(POINT pos)
|
||||
|
||||
if ( ArrangeFillTest(pos) )
|
||||
{
|
||||
ArrangeFillSearch(pos); // appel récursif
|
||||
ArrangeFillSearch(pos); // appel récursif
|
||||
}
|
||||
|
||||
while ( pos.x <= endX && ArrangeFillTest(pos) )
|
||||
@ -903,7 +903,7 @@ void CDecor::ArrangeFillSearch(POINT pos)
|
||||
|
||||
if ( ArrangeFillTest(pos) )
|
||||
{
|
||||
ArrangeFillSearch(pos); // appel récursif
|
||||
ArrangeFillSearch(pos); // appel récursif
|
||||
}
|
||||
|
||||
while ( pos.x <= endX && ArrangeFillTest(pos) )
|
||||
@ -914,7 +914,7 @@ void CDecor::ArrangeFillSearch(POINT pos)
|
||||
}
|
||||
}
|
||||
|
||||
// Rempli un sol à partir d'une position donnée.
|
||||
// Rempli un sol à partir d'une position donnée.
|
||||
|
||||
void CDecor::ArrangeFill(POINT pos, int channel, int icon, bool bFloor)
|
||||
{
|
||||
@ -956,7 +956,7 @@ void CDecor::ArrangeFill(POINT pos, int channel, int icon, bool bFloor)
|
||||
}
|
||||
|
||||
|
||||
// Supprime tous les personnages bloqués dans des murs
|
||||
// Supprime tous les personnages bloqués dans des murs
|
||||
// ou debout sur l'eau.
|
||||
|
||||
void CDecor::ArrangeBlupi()
|
||||
|
@ -17,7 +17,7 @@
|
||||
#include "misc.h"
|
||||
|
||||
|
||||
// D<EFBFBD>finitions globales
|
||||
// D�finitions globales
|
||||
|
||||
#define NAME "Blupi"
|
||||
#define TITLE "Blupi"
|
||||
@ -44,7 +44,7 @@ unsigned int g_lastPhase = 999;
|
||||
|
||||
|
||||
|
||||
// Lit un num<EFBFBD>ro d<>cimal.
|
||||
// Lit un num�ro d�cimal.
|
||||
|
||||
int GetNum(char *p)
|
||||
{
|
||||
@ -111,7 +111,7 @@ bool ReadConfig(int argc, char *argv[])
|
||||
}
|
||||
|
||||
|
||||
// Mise <EFBFBD> jour principale.
|
||||
// Mise � jour principale.
|
||||
|
||||
void UpdateFrame(void)
|
||||
{
|
||||
@ -149,7 +149,7 @@ void UpdateFrame(void)
|
||||
if ( g_pEvent->IsShift() ) // shift en cours ?
|
||||
{
|
||||
g_pEvent->DecorAutoShift(posMouse);
|
||||
g_pDecor->Build(clip, posMouse); // construit juste le d<EFBFBD>cor
|
||||
g_pDecor->Build(clip, posMouse); // construit juste le d�cor
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -159,13 +159,13 @@ void UpdateFrame(void)
|
||||
for ( i=0 ; i<speed ; i++ )
|
||||
{
|
||||
g_pDecor->BlupiStep(i==0); // avance tous les blupi
|
||||
g_pDecor->MoveStep(i==0); // avance tous les d<EFBFBD>cors
|
||||
g_pDecor->MoveStep(i==0); // avance tous les d�cors
|
||||
g_pEvent->DemoStep(); // avance enregistrement/reproduction
|
||||
}
|
||||
}
|
||||
|
||||
g_pEvent->DecorAutoShift(posMouse);
|
||||
g_pDecor->Build(clip, posMouse); // construit le d<EFBFBD>cor
|
||||
g_pDecor->Build(clip, posMouse); // construit le d�cor
|
||||
g_pDecor->NextPhase(1); // refait la carte de temps en temps
|
||||
}
|
||||
}
|
||||
@ -177,13 +177,13 @@ void UpdateFrame(void)
|
||||
clip.right = POSDRAWX+DIMDRAWX;
|
||||
clip.bottom = POSDRAWY+DIMDRAWY;
|
||||
g_pEvent->DecorAutoShift(posMouse);
|
||||
g_pDecor->Build(clip, posMouse); // construit le d<EFBFBD>cor
|
||||
g_pDecor->Build(clip, posMouse); // construit le d�cor
|
||||
g_pDecor->NextPhase(-1); // refait la carte chaque fois
|
||||
}
|
||||
|
||||
if ( phase == WM_PHASE_INIT )
|
||||
{
|
||||
g_pEvent->DemoStep(); // d<EFBFBD>marre <20>v. d<>mo automatique
|
||||
g_pEvent->DemoStep(); // d�marre �v. d�mo automatique
|
||||
}
|
||||
|
||||
g_pEvent->DrawButtons();
|
||||
@ -196,7 +196,7 @@ void UpdateFrame(void)
|
||||
phase == WM_PHASE_PLAYMOVIE ||
|
||||
phase == WM_PHASE_WINMOVIE )
|
||||
{
|
||||
g_pEvent->MovieToStart(); // fait d<EFBFBD>marrer un film si n<>cessaire
|
||||
g_pEvent->MovieToStart(); // fait d�marrer un film si n�cessaire
|
||||
}
|
||||
|
||||
if ( phase == WM_PHASE_INSERT )
|
||||
@ -208,7 +208,7 @@ void UpdateFrame(void)
|
||||
{
|
||||
term = g_pDecor->IsTerminated();
|
||||
if ( term == 1 ) g_pEvent->ChangePhase(WM_PHASE_LOST); // perdu
|
||||
if ( term == 2 ) g_pEvent->ChangePhase(WM_PHASE_WINMOVIE); // gagn<EFBFBD>
|
||||
if ( term == 2 ) g_pEvent->ChangePhase(WM_PHASE_WINMOVIE); // gagn�
|
||||
}
|
||||
}
|
||||
|
||||
@ -232,7 +232,7 @@ void Benchmark()
|
||||
}
|
||||
|
||||
|
||||
// Restitue le jeu apr<EFBFBD>s une activation en mode fullScreen.
|
||||
// Restitue le jeu apr�s une activation en mode fullScreen.
|
||||
|
||||
bool RestoreGame()
|
||||
{
|
||||
@ -242,7 +242,7 @@ bool RestoreGame()
|
||||
return true;
|
||||
}
|
||||
|
||||
// Lib<EFBFBD>re le jeu avant une d<>sactivation en mode fullScreen.
|
||||
// Lib�re le jeu avant une d�sactivation en mode fullScreen.
|
||||
|
||||
bool FlushGame()
|
||||
{
|
||||
@ -449,7 +449,7 @@ static bool DoInit(int argc, char *argv[])
|
||||
return InitFail("Game not correctly installed", false);
|
||||
}
|
||||
|
||||
// Cr<EFBFBD>e le pixmap principal.
|
||||
// Cr�e le pixmap principal.
|
||||
g_pPixmap = new CPixmap;
|
||||
if ( g_pPixmap == nullptr ) return InitFail("New pixmap", true);
|
||||
|
||||
@ -569,7 +569,7 @@ static bool DoInit(int argc, char *argv[])
|
||||
g_pPixmap->LoadCursors ();
|
||||
g_pPixmap->ChangeSprite (SPRITE_WAIT); // met le sablier maison
|
||||
|
||||
// Cr<EFBFBD>e le gestionnaire de son.
|
||||
// Cr�e le gestionnaire de son.
|
||||
g_pSound = new CSound;
|
||||
if ( g_pSound == nullptr ) return InitFail("New sound", true);
|
||||
|
||||
@ -577,20 +577,20 @@ static bool DoInit(int argc, char *argv[])
|
||||
g_pSound->CacheAll();
|
||||
g_pSound->SetState(true);
|
||||
|
||||
// Cr<EFBFBD>e le gestionnaire de films.
|
||||
// Cr�e le gestionnaire de films.
|
||||
g_pMovie = new CMovie;
|
||||
if ( g_pMovie == nullptr ) return InitFail("New movie", false);
|
||||
|
||||
g_pMovie->Create();
|
||||
|
||||
// Cr<EFBFBD>e le gestionnaire de d<>cors.
|
||||
// Cr�e le gestionnaire de d�cors.
|
||||
g_pDecor = new CDecor;
|
||||
if ( g_pDecor == nullptr ) return InitFail("New decor", false);
|
||||
|
||||
g_pDecor->Create(g_pSound, g_pPixmap);
|
||||
g_pDecor->MapInitColors();
|
||||
|
||||
// Cr<EFBFBD>e le gestionnaire d'<27>v<EFBFBD>nements.
|
||||
// Cr�e le gestionnaire d'�v�nements.
|
||||
g_pEvent = new CEvent;
|
||||
if ( g_pEvent == nullptr ) return InitFail("New event", false);
|
||||
|
||||
@ -603,7 +603,7 @@ static bool DoInit(int argc, char *argv[])
|
||||
g_pEvent->ChangePhase(WM_PHASE_TESTCD);
|
||||
#endif
|
||||
|
||||
g_bTermInit = true; // initialisation termin<EFBFBD>e
|
||||
g_bTermInit = true; // initialisation termin�e
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -40,7 +40,7 @@ CButton::~CButton()
|
||||
}
|
||||
|
||||
|
||||
// Crée un nouveau bouton.
|
||||
// Crée un nouveau bouton.
|
||||
|
||||
bool CButton::Create(CPixmap *pPixmap, CSound *pSound,
|
||||
POINT pos, int type, bool bMinimizeRedraw,
|
||||
@ -118,7 +118,7 @@ bool CButton::Create(CPixmap *pPixmap, CSound *pSound,
|
||||
return true;
|
||||
}
|
||||
|
||||
// Dessine un bouton dans son état.
|
||||
// Dessine un bouton dans son état.
|
||||
|
||||
void CButton::Draw()
|
||||
{
|
||||
@ -129,7 +129,7 @@ void CButton::Draw()
|
||||
if ( m_bMinimizeRedraw && !m_bRedraw ) return;
|
||||
m_bRedraw = false;
|
||||
|
||||
if ( m_bHide ) // bouton caché ?
|
||||
if ( m_bHide ) // bouton caché ?
|
||||
{
|
||||
rect.left = m_pos.x;
|
||||
rect.right = m_pos.x+m_dim.x;
|
||||
@ -239,7 +239,7 @@ void CButton::SetHide(bool bHide)
|
||||
}
|
||||
|
||||
|
||||
// Traitement d'un événement.
|
||||
// Traitement d'un événement.
|
||||
|
||||
bool CButton::TreatEvent(const SDL_Event &event)
|
||||
{
|
||||
@ -281,7 +281,7 @@ bool CButton::TreatEvent(const SDL_Event &event)
|
||||
return false;
|
||||
}
|
||||
|
||||
// (*) Tous les boutons doivent recevoir l'événement BUTTONUP !
|
||||
// (*) Tous les boutons doivent recevoir l'événement BUTTONUP !
|
||||
|
||||
|
||||
// Indique si la souris est sur ce bouton.
|
||||
@ -303,7 +303,7 @@ const char *CButton::GetToolTips(POINT pos)
|
||||
if (m_bHide || !m_bEnable)
|
||||
return nullptr;
|
||||
|
||||
if ( m_nbMenu > 1 && m_bMouseDown ) // sous-menu déroulé ?
|
||||
if ( m_nbMenu > 1 && m_bMouseDown ) // sous-menu déroulé ?
|
||||
{
|
||||
width += 2+(m_dim.x-1)*m_nbMenu;
|
||||
}
|
||||
@ -335,7 +335,7 @@ const char *CButton::GetToolTips(POINT pos)
|
||||
}
|
||||
|
||||
|
||||
// Détecte si la souris est dans le bouton.
|
||||
// Détecte si la souris est dans le bouton.
|
||||
|
||||
bool CButton::Detect(POINT pos)
|
||||
{
|
||||
@ -343,7 +343,7 @@ bool CButton::Detect(POINT pos)
|
||||
|
||||
if ( m_bHide || !m_bEnable ) return false;
|
||||
|
||||
if ( m_nbMenu > 1 && m_bMouseDown ) // sous-menu déroulé ?
|
||||
if ( m_nbMenu > 1 && m_bMouseDown ) // sous-menu déroulé ?
|
||||
{
|
||||
width += 2+(m_dim.x-1)*m_nbMenu;
|
||||
}
|
||||
@ -356,7 +356,7 @@ bool CButton::Detect(POINT pos)
|
||||
return true;
|
||||
}
|
||||
|
||||
// Bouton de la souris pressé.
|
||||
// Bouton de la souris pressé.
|
||||
|
||||
bool CButton::MouseDown(POINT pos)
|
||||
{
|
||||
@ -371,7 +371,7 @@ bool CButton::MouseDown(POINT pos)
|
||||
return true;
|
||||
}
|
||||
|
||||
// Souris déplacés.
|
||||
// Souris déplacés.
|
||||
|
||||
bool CButton::MouseMove(POINT pos)
|
||||
{
|
||||
@ -385,12 +385,12 @@ bool CButton::MouseMove(POINT pos)
|
||||
|
||||
if ( m_bMouseDown )
|
||||
{
|
||||
if ( bDetect ) m_mouseState = 1; // pressé
|
||||
if ( bDetect ) m_mouseState = 1; // pressé
|
||||
else m_mouseState = m_state;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( bDetect ) m_mouseState = m_state+2; // survollé
|
||||
if ( bDetect ) m_mouseState = m_state+2; // survollé
|
||||
else m_mouseState = m_state;
|
||||
}
|
||||
|
||||
@ -415,7 +415,7 @@ bool CButton::MouseMove(POINT pos)
|
||||
return m_bMouseDown;
|
||||
}
|
||||
|
||||
// Bouton de la souris relâché.
|
||||
// Bouton de la souris relâché.
|
||||
|
||||
bool CButton::MouseUp(POINT pos)
|
||||
{
|
||||
|
16
src/button.h
16
src/button.h
@ -49,20 +49,20 @@ protected:
|
||||
CSound* m_pSound;
|
||||
int m_type; // type de bouton
|
||||
bool m_bEnable; // true si bouton actif
|
||||
bool m_bHide; // true si bouton caché
|
||||
unsigned int m_message; // message envoyé si bouton actionné
|
||||
bool m_bHide; // true si bouton caché
|
||||
unsigned int m_message; // message envoyé si bouton actionné
|
||||
POINT m_pos; // coin sup/gauche
|
||||
POINT m_dim; // dimensions
|
||||
int m_state; // 0=relâché, 1=pressé, +2=survollé
|
||||
int m_mouseState; // 0=relâché, 1=pressé, +2=survollé
|
||||
int m_iconMenu[20]; // icônes du sous-menu
|
||||
int m_state; // 0=relâché, 1=pressé, +2=survollé
|
||||
int m_mouseState; // 0=relâché, 1=pressé, +2=survollé
|
||||
int m_iconMenu[20]; // icônes du sous-menu
|
||||
const char **m_toolTips; // info-bulles
|
||||
int m_nbMenu; // nb de case du sous-menu
|
||||
int m_nbToolTips; // nb d'info-bulles
|
||||
int m_selMenu; // sous-menu sélectionné
|
||||
bool m_bMouseDown; // true -> bouton souris pressé
|
||||
int m_selMenu; // sous-menu sélectionné
|
||||
bool m_bMouseDown; // true -> bouton souris pressé
|
||||
bool m_bMinimizeRedraw;
|
||||
bool m_bRedraw; // true -> doit être redessiné
|
||||
bool m_bRedraw; // true -> doit être redessiné
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include "fifo.h"
|
||||
#include "action.h"
|
||||
|
||||
// Mémorise toutes les positions des blupi.
|
||||
// Mémorise toutes les positions des blupi.
|
||||
|
||||
void CDecor::CheminMemPos(int exRank)
|
||||
{
|
||||
@ -17,7 +17,7 @@ void CDecor::CheminMemPos(int exRank)
|
||||
for ( rank=0 ; rank<MAXBLUPI ; rank++ )
|
||||
{
|
||||
if ( m_blupi[rank].bExist &&
|
||||
m_blupi[rank].perso != 6 && // pas le détonnateur de mine
|
||||
m_blupi[rank].perso != 6 && // pas le détonnateur de mine
|
||||
rank != exRank )
|
||||
{
|
||||
m_cheminPos[index] = m_blupi[rank].cel;
|
||||
@ -37,7 +37,7 @@ void CDecor::CheminMemPos(int exRank)
|
||||
}
|
||||
}
|
||||
|
||||
// Teste si une positiion est occupée par un blupi.
|
||||
// Teste si une positiion est occupée par un blupi.
|
||||
|
||||
bool CDecor::CheminTestPos(POINT pos, int &rank)
|
||||
{
|
||||
@ -57,10 +57,10 @@ bool CDecor::CheminTestPos(POINT pos, int &rank)
|
||||
}
|
||||
|
||||
|
||||
// une fois le but trouvé, reprend en arrière
|
||||
// à la recherche du chemin le plus court
|
||||
// une fois le but trouvé, reprend en arrière
|
||||
// à la recherche du chemin le plus court
|
||||
|
||||
// retourne la direction à prendre
|
||||
// retourne la direction à prendre
|
||||
int CDecor::CheminARebours(int rank)
|
||||
{
|
||||
int pos, rebours, last, dir, set;
|
||||
@ -99,9 +99,9 @@ int CDecor::CheminARebours(int rank)
|
||||
}
|
||||
|
||||
|
||||
// troisième méthode de recherche
|
||||
// semblable à la précédente,
|
||||
// mais les points à explorer sont classés selon leur distance à la cible
|
||||
// troisième méthode de recherche
|
||||
// semblable à la précédente,
|
||||
// mais les points à explorer sont classés selon leur distance à la cible
|
||||
|
||||
void CDecor::CheminFillTerrain(int rank)
|
||||
{
|
||||
@ -118,10 +118,10 @@ void CDecor::CheminFillTerrain(int rank)
|
||||
|
||||
CPileTriee fifo(2*MAXCELX+2*MAXCELY); // les variantes possibles
|
||||
|
||||
fifo.put(pos, 0); // position de départ
|
||||
m_cheminWork[pos] = 1; // première position
|
||||
fifo.put(pos, 0); // position de départ
|
||||
m_cheminWork[pos] = 1; // première position
|
||||
|
||||
// répète jusqu'à trouvé ou plus de possibilités
|
||||
// répète jusqu'à trouvé ou plus de possibilités
|
||||
max = 500;
|
||||
while ( max-- > 0 )
|
||||
{
|
||||
@ -131,11 +131,11 @@ void CDecor::CheminFillTerrain(int rank)
|
||||
|
||||
step = m_cheminWork[pos];
|
||||
|
||||
// on est arrivé au but ?
|
||||
// on est arrivé au but ?
|
||||
//? if ( pos == dest ) return;
|
||||
if ( pos == dest )
|
||||
{
|
||||
but = step; // hélas trop lent !
|
||||
but = step; // hélas trop lent !
|
||||
max = 50;
|
||||
}
|
||||
|
||||
@ -153,7 +153,7 @@ void CDecor::CheminFillTerrain(int rank)
|
||||
if ( m_cheminWork[last] == 0 ||
|
||||
m_cheminWork[last] > step+cout )
|
||||
{
|
||||
// marque les cases sautées
|
||||
// marque les cases sautées
|
||||
for (int i=1; i<ampli;i++)
|
||||
{
|
||||
m_cheminWork[pos+i*next] = step+cout-ampli+i;
|
||||
@ -175,10 +175,10 @@ void CDecor::CheminFillTerrain(int rank)
|
||||
}
|
||||
|
||||
|
||||
// routine déterninant si une direction est possible
|
||||
// retourne l'incrément pour passer à la nouvelle case
|
||||
// et le "prix à payer" pour aller dans cette direction
|
||||
// coût doit être déterminé en sortie
|
||||
// routine déterninant si une direction est possible
|
||||
// retourne l'incrément pour passer à la nouvelle case
|
||||
// et le "prix à payer" pour aller dans cette direction
|
||||
// coût doit être déterminé en sortie
|
||||
|
||||
bool CDecor::CheminTestDirection(int rank, int pos, int dir,
|
||||
int &next, int &li,
|
||||
@ -196,25 +196,25 @@ bool CDecor::CheminTestDirection(int rank, int pos, int dir,
|
||||
|
||||
// Peut-on glisser dans cette direction ?
|
||||
bFree = IsFreeGlisse(cel, tryDirect, rank, action);
|
||||
cout = 5; // coût élevé
|
||||
cout = 5; // coût élevé
|
||||
|
||||
if ( !bFree )
|
||||
{
|
||||
// Peut-on marcher normalement ?
|
||||
bFree = IsFreeDirect(cel, tryDirect, rank);
|
||||
action = ACTION_MARCHE;
|
||||
cout = 1; // coût minimal
|
||||
cout = 1; // coût minimal
|
||||
}
|
||||
|
||||
if ( !bFree )
|
||||
{
|
||||
// Peut-on sauter ?
|
||||
bFree = IsFreeJump(cel, tryDirect, rank, action);
|
||||
cout = 3; // coût élevé
|
||||
cout = 3; // coût élevé
|
||||
}
|
||||
|
||||
ampli = GetAmplitude(action); // a <- amplitude (1..5)
|
||||
cout *= ampli; // coût plus élevé si grande amplitude
|
||||
cout *= ampli; // coût plus élevé si grande amplitude
|
||||
|
||||
// Blupi peut aller sur le lieu de la construction.
|
||||
if ( !bFree && m_blupi[rank].passCel.x != -1 )
|
||||
@ -234,12 +234,12 @@ bool CDecor::CheminTestDirection(int rank, int pos, int dir,
|
||||
if ( bFree ) // chemin libre (sans tenir compte des perso) ?
|
||||
{
|
||||
newCel.x = cel.x + vector.x*ampli;
|
||||
newCel.y = cel.y + vector.y*ampli; // newCel <- arrivée suposée
|
||||
newCel.y = cel.y + vector.y*ampli; // newCel <- arrivée suposée
|
||||
|
||||
if ( m_blupi[rank].perso == 3 ) // tracks ?
|
||||
{
|
||||
// Le tracks peut aller sur les blupi
|
||||
// pour les écraser !
|
||||
// pour les écraser !
|
||||
if ( IsTracksHere(newCel, false) ) // autre perso ici ?
|
||||
{
|
||||
return false;
|
||||
@ -254,7 +254,7 @@ bool CDecor::CheminTestDirection(int rank, int pos, int dir,
|
||||
//? if ( m_blupi[m_blupiHere].goalCel.x == -1 ) return false;
|
||||
if ( m_blupi[rankHere].goalCel.x == -1 ) return false;
|
||||
|
||||
// Si blupi mobile, possible mais coût élevé.
|
||||
// Si blupi mobile, possible mais coût élevé.
|
||||
cout = 20;
|
||||
}
|
||||
}
|
||||
@ -267,20 +267,20 @@ bool CDecor::CheminTestDirection(int rank, int pos, int dir,
|
||||
|
||||
|
||||
|
||||
// Retourne true si on a assigné une nouvelle direction à blupi.
|
||||
// Retourne true si on a assigné une nouvelle direction à blupi.
|
||||
bool CDecor::CheminCherche(int rank, int &action)
|
||||
{
|
||||
int cout; // prix pour aller dans une direction
|
||||
int pos, dir, next, ampli;
|
||||
|
||||
// Déjà à destination ?
|
||||
// Déjà à destination ?
|
||||
if ( m_blupi[rank].cel.x == m_blupi[rank].goalCel.x &&
|
||||
m_blupi[rank].cel.y == m_blupi[rank].goalCel.y )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Destination occupée ?
|
||||
// Destination occupée ?
|
||||
if ( IsBlupiHereEx(m_blupi[rank].goalCel, rank, false) )
|
||||
{
|
||||
return false;
|
||||
@ -290,10 +290,10 @@ bool CDecor::CheminCherche(int rank, int &action)
|
||||
CheminMemPos(rank);
|
||||
|
||||
// fait un remplissage du map de travail
|
||||
// autour du point de départ
|
||||
// autour du point de départ
|
||||
CheminFillTerrain(rank);
|
||||
|
||||
// cherche le chemin à partir de la destination
|
||||
// cherche le chemin à partir de la destination
|
||||
dir = CheminARebours(rank);
|
||||
if ( dir < 0 ) return false;
|
||||
|
||||
@ -310,7 +310,7 @@ bool CDecor::CheminCherche(int rank, int &action)
|
||||
}
|
||||
|
||||
|
||||
// Teste s'il est possible de se rendre à un endroit donné.
|
||||
// Teste s'il est possible de se rendre à un endroit donné.
|
||||
|
||||
bool CDecor::IsCheminFree(int rank, POINT dest, int button)
|
||||
{
|
||||
@ -338,7 +338,7 @@ bool CDecor::IsCheminFree(int rank, POINT dest, int button)
|
||||
m_decor[dest.x/2][dest.y/2].objectIcon == 16 ) && // armure ?
|
||||
dest.x%2 == 1 && dest.y%2 == 1 )
|
||||
{
|
||||
dest.y --; // va à côté jeep/armure
|
||||
dest.y --; // va à côté jeep/armure
|
||||
}
|
||||
if ( button == BUTTON_GO &&
|
||||
m_decor[dest.x/2][dest.y/2].objectChannel == CHOBJECT &&
|
||||
|
416
src/decblupi.cpp
416
src/decblupi.cpp
File diff suppressed because it is too large
Load Diff
104
src/decgoal.cpp
104
src/decgoal.cpp
@ -614,7 +614,7 @@ static short table_goal_build1[] =
|
||||
GOAL_GOBLUPI, +1,0, true,
|
||||
GOAL_ACTION, ACTION_PIOCHE, DIRECT_E,
|
||||
//? GOAL_ENERGY, MAXENERGY/4,
|
||||
// échaffaudage
|
||||
// échaffaudage
|
||||
GOAL_BUILDOBJECT, -1,0, CHOBJECT,62, -1,-1, DIMOBJY/10,18,10*100,
|
||||
GOAL_ACTION, ACTION_SCIE, DIRECT_S,
|
||||
GOAL_GOBLUPI, 0,-1, true,
|
||||
@ -663,7 +663,7 @@ static short table_goal_build2[] =
|
||||
GOAL_ACTION, ACTION_PIOCHE, DIRECT_E,
|
||||
GOAL_GOBLUPI, +1,0, true,
|
||||
GOAL_ACTION, ACTION_PIOCHE, DIRECT_E,
|
||||
GOAL_PUTOBJECT, -1,0, -1,-1, // enlève les planches
|
||||
GOAL_PUTOBJECT, -1,0, -1,-1, // enlève les planches
|
||||
GOAL_GOBLUPI, -1,+1, true,
|
||||
GOAL_ACTION, ACTION_BUILDSEC, DIRECT_S,
|
||||
GOAL_GOBLUPI, +1,0, true,
|
||||
@ -726,7 +726,7 @@ static short table_goal_build4[] =
|
||||
GOAL_GROUP, 2,
|
||||
GOAL_INTERRUPT, 0, // prioritaire
|
||||
GOAL_WORK, 0,-1,
|
||||
// échaffaudage
|
||||
// échaffaudage
|
||||
GOAL_BUILDOBJECT, 0,-1, CHOBJECT,126, -1,-1, DIMOBJY/10,18,10*100,
|
||||
GOAL_ACTION, ACTION_BUILDSEC, DIRECT_S,
|
||||
GOAL_GOBLUPI, +1,-1, true,
|
||||
@ -794,7 +794,7 @@ static short table_goal_build5[] =
|
||||
0
|
||||
};
|
||||
|
||||
// Construction d'un téléporteur.
|
||||
// Construction d'un téléporteur.
|
||||
static short table_goal_build6[] =
|
||||
{
|
||||
WM_ACTION_BUILD6,
|
||||
@ -804,7 +804,7 @@ static short table_goal_build6[] =
|
||||
GOAL_GROUP, 3,
|
||||
GOAL_INTERRUPT, 0, // prioritaire
|
||||
GOAL_WORK, 0,-1,
|
||||
GOAL_BUILDFLOOR, 0,-1, CHFLOOR,80, CHMASK1,0, 16,14,1*100, // téléporteur
|
||||
GOAL_BUILDFLOOR, 0,-1, CHFLOOR,80, CHMASK1,0, 16,14,1*100, // téléporteur
|
||||
GOAL_ACTION, ACTION_PIOCHE, DIRECT_E,
|
||||
GOAL_ACTION, ACTION_PIOCHE, DIRECT_E,
|
||||
GOAL_GOBLUPI, +1,-1, true,
|
||||
@ -813,7 +813,7 @@ static short table_goal_build6[] =
|
||||
GOAL_ACTION, ACTION_PIOCHE, DIRECT_E,
|
||||
GOAL_GOBLUPI, +1,0, true,
|
||||
GOAL_ACTION, ACTION_PIOCHE, DIRECT_E,
|
||||
GOAL_PUTOBJECT, -1,0, -1,-1, // enlève les planches
|
||||
GOAL_PUTOBJECT, -1,0, -1,-1, // enlève les planches
|
||||
GOAL_GOBLUPI, -1,+1, true,
|
||||
GOAL_ACTION, ACTION_BUILDSEC, DIRECT_S,
|
||||
GOAL_GOBLUPI, +1,0, true,
|
||||
@ -850,7 +850,7 @@ static short table_goal_mur[] =
|
||||
GOAL_ACTION, ACTION_PIOCHEPIERRE, DIRECT_E,
|
||||
GOAL_ACTION, ACTION_PIOCHEPIERRE, DIRECT_E,
|
||||
GOAL_ACTION, ACTION_PIOCHEPIERRE, DIRECT_E,
|
||||
GOAL_PUTOBJECT, 0,0, -1,-1, // enlève les pierres
|
||||
GOAL_PUTOBJECT, 0,0, -1,-1, // enlève les pierres
|
||||
GOAL_GOBLUPI, +1,+1, true,
|
||||
GOAL_ACTION, ACTION_PIOCHEPIERRE, DIRECT_E,
|
||||
GOAL_ACTION, ACTION_PIOCHEPIERRE, DIRECT_E,
|
||||
@ -890,7 +890,7 @@ static short table_goal_tour[] =
|
||||
GOAL_GOBLUPI, +1,-1, true,
|
||||
GOAL_ACTION, ACTION_PIOCHEPIERRE, DIRECT_E,
|
||||
GOAL_ACTION, ACTION_PIOCHEPIERRE, DIRECT_E,
|
||||
GOAL_PUTOBJECT, -1,0, -1,-1, // enlève les pierres
|
||||
GOAL_PUTOBJECT, -1,0, -1,-1, // enlève les pierres
|
||||
GOAL_GOBLUPI, 0,+1, true,
|
||||
GOAL_ACTION, ACTION_BUILDBREF, DIRECT_O,
|
||||
GOAL_ACTION, ACTION_PIOCHEPIERRE, DIRECT_E,
|
||||
@ -924,7 +924,7 @@ static short table_goal_palis[] =
|
||||
GOAL_ACTION, ACTION_PIOCHE, DIRECT_E,
|
||||
GOAL_GOBLUPI, 0,-1, true,
|
||||
GOAL_ACTION, ACTION_PIOCHE, DIRECT_E,
|
||||
GOAL_PUTOBJECT, 0,0, -1,-1, // enlève les planches
|
||||
GOAL_PUTOBJECT, 0,0, -1,-1, // enlève les planches
|
||||
GOAL_GOBLUPI, +1,+1, true,
|
||||
GOAL_ACTION, ACTION_PIOCHESOURD, DIRECT_E,
|
||||
GOAL_ACTION, ACTION_PIOCHESOURD, DIRECT_E,
|
||||
@ -983,7 +983,7 @@ static short table_goal_depose[] =
|
||||
GOAL_IFTERM, +1,0, // emplacement libre ?
|
||||
GOAL_INTERRUPT, 0, // prioritaire
|
||||
GOAL_WORK, 0,-1,
|
||||
GOAL_PUTOBJECT, 0,-1, -3,-3, // l'objet transporté
|
||||
GOAL_PUTOBJECT, 0,-1, -3,-3, // l'objet transporté
|
||||
GOAL_BUILDOBJECT, 0,-1, -2,-2, -1,-1, 11,1,1*100,
|
||||
GOAL_ADDMOVES, 0,-1, 4,
|
||||
GOAL_DEPOSE,
|
||||
@ -1003,7 +1003,7 @@ static short table_goal_depose2[] =
|
||||
GOAL_IFTERM, 0,+1, // emplacement libre ?
|
||||
GOAL_INTERRUPT, 0, // prioritaire
|
||||
GOAL_WORK, -1,0,
|
||||
GOAL_PUTOBJECT, -1,0, -3,-3, // l'objet transporté
|
||||
GOAL_PUTOBJECT, -1,0, -3,-3, // l'objet transporté
|
||||
GOAL_BUILDOBJECT, -1,0, -2,-2, -1,-1, 11,1,1*100,
|
||||
GOAL_ADDMOVES, -1,0, 5,
|
||||
GOAL_DEPOSE,
|
||||
@ -1022,7 +1022,7 @@ static short table_goal_newblupi[] =
|
||||
GOAL_GROUP, 5,
|
||||
GOAL_INTERRUPT, 0, // prioritaire
|
||||
GOAL_WORK, 0,-1,
|
||||
GOAL_PUTOBJECT, 0,-1, -3,-3, // l'objet transporté
|
||||
GOAL_PUTOBJECT, 0,-1, -3,-3, // l'objet transporté
|
||||
GOAL_BUILDOBJECT, 0,-1, -2,-2, -1,-1, 11,1,1*100,
|
||||
GOAL_ADDMOVES, 0,-1, 4,
|
||||
GOAL_DEPOSE,
|
||||
@ -1159,7 +1159,7 @@ static short table_goal_mange2[] =
|
||||
0
|
||||
};
|
||||
|
||||
// Boit à la bouteille (est).
|
||||
// Boit à la bouteille (est).
|
||||
static short table_goal_boit[] =
|
||||
{
|
||||
WM_ACTION_BOIT,
|
||||
@ -1178,7 +1178,7 @@ static short table_goal_boit[] =
|
||||
0
|
||||
};
|
||||
|
||||
// Boit à la bouteille (sud).
|
||||
// Boit à la bouteille (sud).
|
||||
static short table_goal_boit2[] =
|
||||
{
|
||||
WM_ACTION_BOIT2,
|
||||
@ -1323,7 +1323,7 @@ static short table_goal_labo[] =
|
||||
0
|
||||
};
|
||||
|
||||
// Blupi fait péter la dynamite.
|
||||
// Blupi fait péter la dynamite.
|
||||
static short table_goal_dynamite[] =
|
||||
{
|
||||
WM_ACTION_DYNAMITE,
|
||||
@ -1335,7 +1335,7 @@ static short table_goal_dynamite[] =
|
||||
GOAL_WORK, 0,-1,
|
||||
GOAL_PUTOBJECT, 0,-1, -1,-1,
|
||||
GOAL_BUILDOBJECT, 0,-1, CHOBJECT,-1, -1,-1, DIMOBJY,1,-1*100,
|
||||
GOAL_ADDICONS, 0,-1, 7, // mèche
|
||||
GOAL_ADDICONS, 0,-1, 7, // mèche
|
||||
GOAL_ACTION, ACTION_MECHE, DIRECT_E,
|
||||
GOAL_SOUND, SOUND_DYNAMITE,
|
||||
GOAL_GROUP, 4,
|
||||
@ -1373,7 +1373,7 @@ static short table_goal_dynamite[] =
|
||||
0
|
||||
};
|
||||
|
||||
// Blupi fait péter la dynamite très fort.
|
||||
// Blupi fait péter la dynamite très fort.
|
||||
static short table_goal_dynamite2[] =
|
||||
{
|
||||
WM_ACTION_DYNAMITE2,
|
||||
@ -1385,7 +1385,7 @@ static short table_goal_dynamite2[] =
|
||||
GOAL_WORK, 0,-1,
|
||||
GOAL_PUTOBJECT, 0,-1, -1,-1,
|
||||
GOAL_BUILDOBJECT, 0,-1, CHOBJECT,-1, -1,-1, DIMOBJY,1,-1*100,
|
||||
GOAL_ADDICONS, 0,-1, 7, // mèche
|
||||
GOAL_ADDICONS, 0,-1, 7, // mèche
|
||||
GOAL_ACTION, ACTION_MECHE, DIRECT_E,
|
||||
GOAL_SOUND, SOUND_DYNAMITE,
|
||||
GOAL_GROUP, 5,
|
||||
@ -1486,7 +1486,7 @@ static short table_goal_dynamite2[] =
|
||||
0
|
||||
};
|
||||
|
||||
// Tracks fait péter la dynamite.
|
||||
// Tracks fait péter la dynamite.
|
||||
static short table_goal_t_dynamite[] =
|
||||
{
|
||||
WM_ACTION_T_DYNAMITE,
|
||||
@ -1548,7 +1548,7 @@ static short table_goal_mine[] =
|
||||
0
|
||||
};
|
||||
|
||||
// Détonnateur de mine créé par GOAL_AMORCE (blupi invisible).
|
||||
// Détonnateur de mine créé par GOAL_AMORCE (blupi invisible).
|
||||
static short table_goal_mine2[] =
|
||||
{
|
||||
WM_ACTION_MINE2,
|
||||
@ -2006,7 +2006,7 @@ static short table_goal_bateaun[] =
|
||||
0
|
||||
};
|
||||
|
||||
// Départ en bateau.
|
||||
// Départ en bateau.
|
||||
static short table_goal_bateaude[] =
|
||||
{
|
||||
WM_ACTION_BATEAUDE,
|
||||
@ -2023,7 +2023,7 @@ static short table_goal_bateaude[] =
|
||||
GOAL_ACTION, ACTION_STOP, DIRECT_E,
|
||||
GOAL_ACTION, ACTION_STOP, DIRECT_E,
|
||||
GOAL_GROUP, 2,
|
||||
GOAL_PUTOBJECT, -1,-1, -1,-1, // enlève le bateau
|
||||
GOAL_PUTOBJECT, -1,-1, -1,-1, // enlève le bateau
|
||||
GOAL_VEHICULE, 1, // en bateau
|
||||
GOAL_ACTION, ACTION_STOP, DIRECT_E,
|
||||
GOAL_GOBLUPI, +1,0, true,
|
||||
@ -2047,7 +2047,7 @@ static short table_goal_bateauds[] =
|
||||
GOAL_ACTION, ACTION_STOP, DIRECT_E,
|
||||
GOAL_ACTION, ACTION_STOP, DIRECT_E,
|
||||
GOAL_GROUP, 2,
|
||||
GOAL_PUTOBJECT, -1,-1, -1,-1, // enlève le bateau
|
||||
GOAL_PUTOBJECT, -1,-1, -1,-1, // enlève le bateau
|
||||
GOAL_VEHICULE, 1, // en bateau
|
||||
GOAL_GOBLUPI, 0,+1, true,
|
||||
GOAL_TERM,
|
||||
@ -2070,7 +2070,7 @@ static short table_goal_bateaudo[] =
|
||||
GOAL_ACTION, ACTION_STOP, DIRECT_E,
|
||||
GOAL_ACTION, ACTION_STOP, DIRECT_E,
|
||||
GOAL_GROUP, 2,
|
||||
GOAL_PUTOBJECT, -1,-1, -1,-1, // enlève le bateau
|
||||
GOAL_PUTOBJECT, -1,-1, -1,-1, // enlève le bateau
|
||||
GOAL_VEHICULE, 1, // en bateau
|
||||
GOAL_GOBLUPI, -1,0, true,
|
||||
GOAL_TERM,
|
||||
@ -2093,14 +2093,14 @@ static short table_goal_bateaudn[] =
|
||||
GOAL_ACTION, ACTION_STOP, DIRECT_E,
|
||||
GOAL_ACTION, ACTION_STOP, DIRECT_E,
|
||||
GOAL_GROUP, 2,
|
||||
GOAL_PUTOBJECT, -1,-1, -1,-1, // enlève le bateau
|
||||
GOAL_PUTOBJECT, -1,-1, -1,-1, // enlève le bateau
|
||||
GOAL_VEHICULE, 1, // en bateau
|
||||
GOAL_GOBLUPI, 0,-1, true,
|
||||
GOAL_TERM,
|
||||
0
|
||||
};
|
||||
|
||||
// Arrivée en bateau.
|
||||
// Arrivée en bateau.
|
||||
static short table_goal_bateauae[] =
|
||||
{
|
||||
WM_ACTION_BATEAUAE,
|
||||
@ -2114,7 +2114,7 @@ static short table_goal_bateauae[] =
|
||||
GOAL_ACTION, ACTION_STOP, DIRECT_E,
|
||||
GOAL_GROUP, 2,
|
||||
GOAL_PUTOBJECT, -1,-1, CHOBJECT,117, // remet le bateau
|
||||
GOAL_VEHICULE, 0, // à pied
|
||||
GOAL_VEHICULE, 0, // à pied
|
||||
GOAL_ACTION, ACTION_STOP, DIRECT_E,
|
||||
GOAL_ACTION, ACTION_STOP, DIRECT_E,
|
||||
GOAL_ACTION, ACTION_STOP, DIRECT_E,
|
||||
@ -2141,7 +2141,7 @@ static short table_goal_bateauas[] =
|
||||
GOAL_ACTION, ACTION_STOP, DIRECT_E,
|
||||
GOAL_GROUP, 2,
|
||||
GOAL_PUTOBJECT, -1,-1, CHOBJECT,117, // remet le bateau
|
||||
GOAL_VEHICULE, 0, // à pied
|
||||
GOAL_VEHICULE, 0, // à pied
|
||||
GOAL_GOBLUPI, 0,-2, true,
|
||||
GOAL_TERM,
|
||||
0
|
||||
@ -2160,7 +2160,7 @@ static short table_goal_bateauao[] =
|
||||
GOAL_ACTION, ACTION_STOP, DIRECT_E,
|
||||
GOAL_GROUP, 2,
|
||||
GOAL_PUTOBJECT, -1,-1, CHOBJECT,117, // remet le bateau
|
||||
GOAL_VEHICULE, 0, // à pied
|
||||
GOAL_VEHICULE, 0, // à pied
|
||||
GOAL_GOBLUPI, +1,0, true,
|
||||
GOAL_TERM,
|
||||
0
|
||||
@ -2179,7 +2179,7 @@ static short table_goal_bateauan[] =
|
||||
GOAL_ACTION, ACTION_STOP, DIRECT_E,
|
||||
GOAL_GROUP, 2,
|
||||
GOAL_PUTOBJECT, -1,-1, CHOBJECT,117, // remet le bateau
|
||||
GOAL_VEHICULE, 0, // à pied
|
||||
GOAL_VEHICULE, 0, // à pied
|
||||
GOAL_GOBLUPI, 0,+1, true,
|
||||
GOAL_TERM,
|
||||
0
|
||||
@ -2223,7 +2223,7 @@ static short table_goal_r_build1[] =
|
||||
0
|
||||
};
|
||||
|
||||
// Le robot construit une usine à araignées.
|
||||
// Le robot construit une usine à araignées.
|
||||
static short table_goal_r_build2[] =
|
||||
{
|
||||
WM_ACTION_R_BUILD2,
|
||||
@ -2261,7 +2261,7 @@ static short table_goal_r_build2[] =
|
||||
0
|
||||
};
|
||||
|
||||
// Le robot construit une usine à virus.
|
||||
// Le robot construit une usine à virus.
|
||||
static short table_goal_r_build3[] =
|
||||
{
|
||||
WM_ACTION_R_BUILD3,
|
||||
@ -2299,7 +2299,7 @@ static short table_goal_r_build3[] =
|
||||
0
|
||||
};
|
||||
|
||||
// Le robot construit une usine à tracks.
|
||||
// Le robot construit une usine à tracks.
|
||||
static short table_goal_r_build4[] =
|
||||
{
|
||||
WM_ACTION_R_BUILD4,
|
||||
@ -2337,7 +2337,7 @@ static short table_goal_r_build4[] =
|
||||
0
|
||||
};
|
||||
|
||||
// Le robot construit une usine à bombe.
|
||||
// Le robot construit une usine à bombe.
|
||||
static short table_goal_r_build5[] =
|
||||
{
|
||||
WM_ACTION_R_BUILD5,
|
||||
@ -2375,7 +2375,7 @@ static short table_goal_r_build5[] =
|
||||
0
|
||||
};
|
||||
|
||||
// Le robot construit une usine à électro.
|
||||
// Le robot construit une usine à électro.
|
||||
static short table_goal_r_build6[] =
|
||||
{
|
||||
WM_ACTION_R_BUILD6,
|
||||
@ -2436,7 +2436,7 @@ static short table_goal_r_make1[] =
|
||||
0
|
||||
};
|
||||
|
||||
// Le robot construit une araignée.
|
||||
// Le robot construit une araignée.
|
||||
static short table_goal_r_make2[] =
|
||||
{
|
||||
WM_ACTION_R_MAKE2,
|
||||
@ -2477,7 +2477,7 @@ static short table_goal_r_make2[] =
|
||||
GOAL_GROUP, 2,
|
||||
GOAL_FINISHMOVE,
|
||||
GOAL_PUTOBJECT, 0,-1, CHOBJECT,101, // ouvre la porte
|
||||
GOAL_NEWPERSO, +1,0, 1, // araignée (qui sortira)
|
||||
GOAL_NEWPERSO, +1,0, 1, // araignée (qui sortira)
|
||||
GOAL_ACTION, ACTION_R_DELAY, DIRECT_E,
|
||||
GOAL_ACTION, ACTION_R_DELAY, DIRECT_E,
|
||||
GOAL_SOUND, SOUND_PORTE,
|
||||
@ -2693,7 +2693,7 @@ static short table_goal_r_make5[] =
|
||||
0
|
||||
};
|
||||
|
||||
// Le robot construit un électro.
|
||||
// Le robot construit un électro.
|
||||
static short table_goal_r_make6[] =
|
||||
{
|
||||
WM_ACTION_R_MAKE6,
|
||||
@ -2734,7 +2734,7 @@ static short table_goal_r_make6[] =
|
||||
GOAL_GROUP, 2,
|
||||
GOAL_FINISHMOVE,
|
||||
GOAL_PUTOBJECT, 0,-1, CHOBJECT,18, // ouvre la porte
|
||||
GOAL_NEWPERSO, +1,0, 7, // électro (qui sortira)
|
||||
GOAL_NEWPERSO, +1,0, 7, // électro (qui sortira)
|
||||
GOAL_ACTION, ACTION_R_DELAY, DIRECT_E,
|
||||
GOAL_SOUND, SOUND_PORTE,
|
||||
GOAL_PUTOBJECT, 0,-1, CHOBJECT,17, // ferme la porte
|
||||
@ -2770,7 +2770,7 @@ static short table_goal_mjeep[] =
|
||||
GOAL_WORK, -1,0,
|
||||
GOAL_ACTION, ACTION_SAUTE1, DIRECT_S,
|
||||
GOAL_GROUP, 2,
|
||||
GOAL_PUTOBJECT, -1,-1, -1,-1, // enlève la jeep
|
||||
GOAL_PUTOBJECT, -1,-1, -1,-1, // enlève la jeep
|
||||
GOAL_VEHICULE, 2, // en jeep
|
||||
GOAL_ACTION, ACTION_STOP, DIRECT_E,
|
||||
GOAL_ACTION, ACTION_STOP, DIRECT_E,
|
||||
@ -2796,7 +2796,7 @@ static short table_goal_djeep[] =
|
||||
GOAL_INTERRUPT, 0, // prioritaire
|
||||
GOAL_WORK, -1,-1,
|
||||
GOAL_PUTOBJECT, -1,-1, CHOBJECT,118, // remet la jeep
|
||||
GOAL_VEHICULE, 0, // à pied
|
||||
GOAL_VEHICULE, 0, // à pied
|
||||
GOAL_ACTUALISE,
|
||||
GOAL_ACTION, ACTION_SAUTE1, DIRECT_N,
|
||||
GOAL_ACTION, ACTION_STOP, DIRECT_N,
|
||||
@ -2825,7 +2825,7 @@ static short table_goal_marmure[] =
|
||||
GOAL_ACTION, ACTION_STOP, DIRECT_E,
|
||||
GOAL_ACTION, ACTION_STOP, DIRECT_E,
|
||||
GOAL_GROUP, 2,
|
||||
GOAL_PUTOBJECT, -1,-1, -1,-1, // enlève l'armure
|
||||
GOAL_PUTOBJECT, -1,-1, -1,-1, // enlève l'armure
|
||||
GOAL_ACTION, ACTION_ARMURECLOSE, DIRECT_E,
|
||||
GOAL_VEHICULE, 3, // en armure
|
||||
GOAL_ACTION, ACTION_STOP, DIRECT_E,
|
||||
@ -2867,13 +2867,13 @@ static short table_goal_darmure[] =
|
||||
GOAL_GROUP, 3,
|
||||
GOAL_WORK, -1,-1,
|
||||
GOAL_PUTOBJECT, -1,-1, CHOBJECT,16, // remet l'armure
|
||||
GOAL_VEHICULE, 0, // à pied
|
||||
GOAL_VEHICULE, 0, // à pied
|
||||
GOAL_GOBLUPI, 0,-1, true,
|
||||
GOAL_TERM,
|
||||
0
|
||||
};
|
||||
|
||||
// Blupi cherche où planter des drapeaux.
|
||||
// Blupi cherche où planter des drapeaux.
|
||||
static short table_goal_drapeau[] =
|
||||
{
|
||||
WM_ACTION_DRAPEAU,
|
||||
@ -3164,7 +3164,7 @@ static short table_goal_fabdisc[] =
|
||||
0
|
||||
};
|
||||
|
||||
// L'électro va sur un blupi puis lance ses rayons.
|
||||
// L'électro va sur un blupi puis lance ses rayons.
|
||||
static short table_goal_e_rayon[] =
|
||||
{
|
||||
WM_ACTION_E_RAYON,
|
||||
@ -3254,7 +3254,7 @@ static short table_goal_e_rayon[] =
|
||||
0
|
||||
};
|
||||
|
||||
// Blupi s'électrocute.
|
||||
// Blupi s'électrocute.
|
||||
static short table_goal_electro[] =
|
||||
{
|
||||
WM_ACTION_ELECTRO,
|
||||
@ -3307,7 +3307,7 @@ static short table_goal_grille[] =
|
||||
0
|
||||
};
|
||||
|
||||
// L'araignée meurt.
|
||||
// L'araignée meurt.
|
||||
static short table_goal_a_mort[] =
|
||||
{
|
||||
WM_ACTION_A_MORT,
|
||||
@ -3318,12 +3318,12 @@ static short table_goal_a_mort[] =
|
||||
GOAL_ACTION, ACTION_A_MORT1, DIRECT_E,
|
||||
GOAL_ACTION, ACTION_A_MORT2, DIRECT_E,
|
||||
GOAL_ACTION, ACTION_A_MORT3, DIRECT_E,
|
||||
GOAL_DELETE, // l'araignée meurt brutalement
|
||||
GOAL_DELETE, // l'araignée meurt brutalement
|
||||
GOAL_TERM,
|
||||
0
|
||||
};
|
||||
|
||||
// Blupi se prépare à répéter une liste.
|
||||
// Blupi se prépare à répéter une liste.
|
||||
static short table_goal_repeat[] =
|
||||
{
|
||||
WM_ACTION_REPEAT,
|
||||
@ -3331,7 +3331,7 @@ static short table_goal_repeat[] =
|
||||
0
|
||||
};
|
||||
|
||||
// Blupi se téléporte d'un endroit à un autre.
|
||||
// Blupi se téléporte d'un endroit à un autre.
|
||||
static short table_goal_teleporte00[] =
|
||||
{
|
||||
WM_ACTION_TELEPORTE00,
|
||||
@ -3528,7 +3528,7 @@ static short* table_pGoal[] =
|
||||
nullptr
|
||||
};
|
||||
|
||||
// Retourne le pointeur à la table table_goal_*.
|
||||
// Retourne le pointeur à la table table_goal_*.
|
||||
|
||||
short* GetTableGoal(int action)
|
||||
{
|
||||
@ -3538,7 +3538,7 @@ short* GetTableGoal(int action)
|
||||
{
|
||||
if ( **ppTable == action )
|
||||
{
|
||||
return *ppTable+1; // après WM_ACTION_*
|
||||
return *ppTable+1; // après WM_ACTION_*
|
||||
}
|
||||
|
||||
ppTable ++;
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
// Méta opérations (goal).
|
||||
// Méta opérations (goal).
|
||||
|
||||
#define GOAL_TERM 0 //
|
||||
#define GOAL_GOHILI 1 // dx,dy, bPass
|
||||
|
@ -32,26 +32,26 @@ DescFile;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int bExist; // true -> utilisé
|
||||
int bHili; // true -> sélectionné
|
||||
int bExist; // true -> utilisé
|
||||
int bHili; // true -> sélectionné
|
||||
|
||||
short perso; // personnage, voir (*)
|
||||
|
||||
short goalAction; // action (long terme)
|
||||
short goalPhase; // phase (long terme)
|
||||
POINT goalCel; // cellule visée (long terme)
|
||||
POINT goalCel; // cellule visée (long terme)
|
||||
POINT passCel; // cellule tranversante
|
||||
|
||||
short energy; // énergie restante
|
||||
short energy; // énergie restante
|
||||
|
||||
POINT cel; // cellule actuelle
|
||||
POINT destCel; // cellule destination
|
||||
short action; // action en cours
|
||||
short aDirect; // direction actuelle
|
||||
short sDirect; // direction souhaitée
|
||||
short sDirect; // direction souhaitée
|
||||
|
||||
POINT pos; // position relative à partir de la cellule
|
||||
short posZ; // déplacement z
|
||||
POINT pos; // position relative à partir de la cellule
|
||||
short posZ; // déplacement z
|
||||
short channel;
|
||||
short lastIcon;
|
||||
short icon;
|
||||
@ -60,12 +60,12 @@ typedef struct
|
||||
short interrupt; // 0=prioritaire, 1=normal, 2=misc
|
||||
short clipLeft;
|
||||
|
||||
int nbUsed; // nb de points déjà visités
|
||||
int nbUsed; // nb de points déjà visités
|
||||
char nextRankUsed;
|
||||
POINT posUsed[MAXUSED];
|
||||
char rankUsed[MAXUSED];
|
||||
|
||||
short takeChannel; // objet transporté
|
||||
short takeChannel; // objet transporté
|
||||
short takeIcon;
|
||||
|
||||
POINT fix; // point fixe (cultive, pont)
|
||||
@ -73,15 +73,15 @@ typedef struct
|
||||
short jaugePhase;
|
||||
short jaugeMax;
|
||||
short stop; // 1 -> devra stopper
|
||||
short bArrow; // true -> flèche en dessus de blupi
|
||||
short bRepeat; // true -> répète l'action
|
||||
short bArrow; // true -> flèche en dessus de blupi
|
||||
short bRepeat; // true -> répète l'action
|
||||
short nLoop; // nb de boucles pour GOAL_OTHERLOOP
|
||||
short cLoop; // boucle en cours
|
||||
short vIcon; // icône variable
|
||||
POINT goalHili; // but visé
|
||||
short vIcon; // icône variable
|
||||
POINT goalHili; // but visé
|
||||
short bMalade; // true -> blupi malade
|
||||
short bCache; // true -> caché (pas dessiné)
|
||||
short vehicule; // véhicule utilisé par blupi, voir (**)
|
||||
short bCache; // true -> caché (pas dessiné)
|
||||
short vehicule; // véhicule utilisé par blupi, voir (**)
|
||||
char busyCount;
|
||||
char busyDelay;
|
||||
char clicCount;
|
||||
@ -91,7 +91,7 @@ typedef struct
|
||||
OldBlupi;
|
||||
|
||||
|
||||
// Sauve le décor sur disque.
|
||||
// Sauve le décor sur disque.
|
||||
|
||||
bool CDecor::Write(int rank, bool bUser, int world, int time, int total)
|
||||
{
|
||||
@ -170,7 +170,7 @@ bool CDecor::Write(int rank, bool bUser, int world, int time, int total)
|
||||
return false;
|
||||
}
|
||||
|
||||
// Lit le décor sur disque.
|
||||
// Lit le décor sur disque.
|
||||
|
||||
bool CDecor::Read(int rank, bool bUser, int &world, int &time, int &total)
|
||||
{
|
||||
@ -297,7 +297,7 @@ bool CDecor::Read(int rank, bool bUser, int &world, int &time, int &total)
|
||||
InitDrapeau();
|
||||
}
|
||||
|
||||
BlupiDeselect(); // désélectionne tous les blupi
|
||||
BlupiDeselect(); // désélectionne tous les blupi
|
||||
|
||||
free(pBuffer);
|
||||
fclose(file);
|
||||
@ -307,7 +307,7 @@ bool CDecor::Read(int rank, bool bUser, int &world, int &time, int &total)
|
||||
if ( pBuffer != nullptr ) free(pBuffer);
|
||||
if ( file != nullptr ) fclose(file);
|
||||
|
||||
Flush(); // initialise un décor neutre
|
||||
Flush(); // initialise un décor neutre
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -381,7 +381,7 @@ bool CDecor::FileExist(int rank, bool bUser, int &world, int &time, int &total)
|
||||
|
||||
#define MARG 18
|
||||
|
||||
// Initialise un décor neutre.
|
||||
// Initialise un décor neutre.
|
||||
|
||||
void CDecor::Flush()
|
||||
{
|
||||
|
@ -56,10 +56,10 @@ void CDecor::MapInitColors()
|
||||
m_colors[MAP_FIRE] = MapRGB (255, 0, 0); // rouge
|
||||
m_colors[MAP_TOMAT] = MapRGB (255, 0, 0); // rouge
|
||||
m_colors[MAP_BUILD] = MapRGB (0, 0, 0); // noir
|
||||
m_colors[MAP_ENNEMI]= MapRGB (0, 192, 255); // bleu métal
|
||||
m_colors[MAP_ENNEMI]= MapRGB (0, 192, 255); // bleu métal
|
||||
m_colors[MAP_FLEUR] = MapRGB (255, 206, 0); // jaune
|
||||
|
||||
m_colors[MAP_TREE] = MapRGB (0 ,102, 0); // vert foncé
|
||||
m_colors[MAP_TREE] = MapRGB (0 ,102, 0); // vert foncé
|
||||
m_colors[MAP_HERB1] = MapRGB (0 ,204, 51); // vert clair
|
||||
m_colors[MAP_HERB2] = MapRGB (0 ,156, 8); // vert moyen
|
||||
m_colors[MAP_TERRE] = MapRGB (94, 78, 12); // brun
|
||||
@ -124,7 +124,7 @@ POINT CDecor::ConvMapToCel(POINT pos)
|
||||
}
|
||||
|
||||
|
||||
// Déplace le décor suite ŕ un clic dans la carte.
|
||||
// Déplace le décor suite à un clic dans la carte.
|
||||
|
||||
bool CDecor::MapMove(POINT pos)
|
||||
{
|
||||
@ -343,7 +343,7 @@ static char color_object[] =
|
||||
MAP_FLEUR, MAP_FLEUR, MAP_FLEUR, MAP_FLEUR,
|
||||
MAP_FLEUR, MAP_FLEUR, MAP_FLEUR, MAP_FLEUR,
|
||||
|
||||
MAP_HERB1, MAP_HERB1, MAP_HERB1, MAP_HERB1, // ennemi piégé
|
||||
MAP_HERB1, MAP_HERB1, MAP_HERB1, MAP_HERB1, // ennemi piégé
|
||||
MAP_HERB1, MAP_HERB1, MAP_HERB1, MAP_HERB1,
|
||||
MAP_HERB1, MAP_HERB1, MAP_HERB1, MAP_HERB1,
|
||||
|
||||
@ -355,7 +355,7 @@ static char color_object[] =
|
||||
MAP_ENNEMI,MAP_ENNEMI,MAP_ENNEMI,MAP_ENNEMI,
|
||||
MAP_ENNEMI,MAP_ENNEMI,MAP_ENNEMI,MAP_ENNEMI,
|
||||
|
||||
MAP_ENNEMI,MAP_ENNEMI,MAP_ENNEMI,MAP_ENNEMI, // barričre
|
||||
MAP_ENNEMI,MAP_ENNEMI,MAP_ENNEMI,MAP_ENNEMI, // barrière
|
||||
MAP_ENNEMI,MAP_ENNEMI,MAP_ENNEMI,MAP_ENNEMI,
|
||||
MAP_ENNEMI,MAP_ENNEMI,MAP_ENNEMI,MAP_ENNEMI,
|
||||
MAP_ENNEMI,MAP_ENNEMI,MAP_ENNEMI,MAP_ENNEMI,
|
||||
@ -364,7 +364,7 @@ static char color_object[] =
|
||||
MAP_ENNEMI,MAP_ENNEMI,MAP_ENNEMI,MAP_ENNEMI,
|
||||
|
||||
MAP_BUILD, MAP_BUILD, MAP_BUILD, MAP_BUILD, // maison
|
||||
MAP_HERB1, MAP_HERB1, MAP_HERB1, MAP_HERB1, // ennemi piégé
|
||||
MAP_HERB1, MAP_HERB1, MAP_HERB1, MAP_HERB1, // ennemi piégé
|
||||
|
||||
MAP_ENNEMI,MAP_ENNEMI,MAP_ENNEMI,MAP_ENNEMI,
|
||||
MAP_ENNEMI,MAP_ENNEMI,MAP_ENNEMI,MAP_ENNEMI,
|
||||
@ -433,7 +433,7 @@ void CDecor::MapPutCel(POINT pos)
|
||||
fogCel.y = (fogCel.y/4)*4;
|
||||
if ( fogCel.x < 0 || fogCel.x >= MAXCELX ||
|
||||
fogCel.y < 0 || fogCel.y >= MAXCELY ||
|
||||
m_decor[fogCel.x/2][fogCel.y/2].fog == FOGHIDE ) // caché ?
|
||||
m_decor[fogCel.x/2][fogCel.y/2].fog == FOGHIDE ) // caché ?
|
||||
{
|
||||
pColors = color_deffog;
|
||||
goto color;
|
||||
@ -474,7 +474,7 @@ void CDecor::MapPutCel(POINT pos)
|
||||
}
|
||||
|
||||
|
||||
// Génčre la carte.
|
||||
// Génère la carte.
|
||||
|
||||
bool CDecor::GenerateMap()
|
||||
{
|
||||
@ -483,7 +483,7 @@ bool CDecor::GenerateMap()
|
||||
|
||||
if ( m_phase != -1 && m_phase%20 != 0 ) return true;
|
||||
|
||||
// Dessine le décor (sol, objets et brouillard).
|
||||
// Dessine le décor (sol, objets et brouillard).
|
||||
for ( pos.y=0 ; pos.y<DIMMAPY ; pos.y++ )
|
||||
{
|
||||
dx = pos.y%2;
|
||||
|
@ -77,7 +77,7 @@ static short table_move3[] =
|
||||
30,-56,
|
||||
};
|
||||
|
||||
// Mouvement pour déposer un objet (est) sur blupi
|
||||
// Mouvement pour déposer un objet (est) sur blupi
|
||||
// (synchrone avec ACTION_DEPOSE).
|
||||
static short table_move4[] =
|
||||
{
|
||||
@ -94,7 +94,7 @@ static short table_move4[] =
|
||||
0,-10,
|
||||
};
|
||||
|
||||
// Mouvement pour déposer un objet (sud) sur blupi
|
||||
// Mouvement pour déposer un objet (sud) sur blupi
|
||||
// (synchrone avec ACTION_DEPOSE2).
|
||||
static short table_move5[] =
|
||||
{
|
||||
@ -443,7 +443,7 @@ static short table_icon6[] =
|
||||
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
|
||||
};
|
||||
|
||||
// Mèche de la dynamite.
|
||||
// Mèche de la dynamite.
|
||||
static short table_icon7[] =
|
||||
{
|
||||
12*4, // nb
|
||||
@ -453,7 +453,7 @@ static short table_icon7[] =
|
||||
86,87,86,87,86,87,86,87,86,87,86,87,
|
||||
};
|
||||
|
||||
// Rayons de l'électrocuteur.
|
||||
// Rayons de l'électrocuteur.
|
||||
static short table_icon8[] =
|
||||
{
|
||||
10*10, // nb
|
||||
@ -469,7 +469,7 @@ static short table_icon8[] =
|
||||
-1,-1,-1,-1,-1,-1,-1,-1,-1,74,
|
||||
};
|
||||
|
||||
// Blupi écrasé.
|
||||
// Blupi écrasé.
|
||||
static short table_icon9[] =
|
||||
{
|
||||
10*10, // nb
|
||||
@ -485,7 +485,7 @@ static short table_icon9[] =
|
||||
76,76,76,76,76,76,76,76,76,76,
|
||||
};
|
||||
|
||||
// Blupi malade écrasé.
|
||||
// Blupi malade écrasé.
|
||||
static short table_icon10[] =
|
||||
{
|
||||
10*10, // nb
|
||||
@ -501,7 +501,7 @@ static short table_icon10[] =
|
||||
77,77,77,77,77,77,77,77,77,77,
|
||||
};
|
||||
|
||||
// Eclairs de la dalle téléporteur.
|
||||
// Eclairs de la dalle téléporteur.
|
||||
static short table_icon11[] =
|
||||
{
|
||||
4, // nb
|
||||
@ -528,7 +528,7 @@ short* GetListIcons(int rank)
|
||||
|
||||
|
||||
|
||||
// Supprime tous les décors animés.
|
||||
// Supprime tous les décors animés.
|
||||
|
||||
void CDecor::MoveFlush()
|
||||
{
|
||||
@ -548,7 +548,7 @@ void CDecor::MoveFlush()
|
||||
}
|
||||
}
|
||||
|
||||
// Retourne la durée du feu.
|
||||
// Retourne la durée du feu.
|
||||
|
||||
int CDecor::MoveMaxFire()
|
||||
{
|
||||
@ -556,7 +556,7 @@ int CDecor::MoveMaxFire()
|
||||
return MAXFIRE;
|
||||
}
|
||||
|
||||
// Initialise tous les mouvements perpétuels du décor.
|
||||
// Initialise tous les mouvements perpétuels du décor.
|
||||
|
||||
void CDecor::MoveFixInit()
|
||||
{
|
||||
@ -568,37 +568,37 @@ void CDecor::MoveFixInit()
|
||||
{
|
||||
for ( y=0 ; y<MAXCELY ; y+=2 )
|
||||
{
|
||||
// Démarre le feu.
|
||||
// Démarre le feu.
|
||||
if ( m_decor[x/2][y/2].fire > 0 &&
|
||||
m_decor[x/2][y/2].fire < MoveMaxFire() )
|
||||
{
|
||||
MoveStartFire(GetCel(x,y));
|
||||
}
|
||||
|
||||
// Démarre les éclairs entre les tours.
|
||||
if ( m_decor[x/2][y/2].objectIcon == 10000 ) // éclair n-s
|
||||
// Démarre les éclairs entre les tours.
|
||||
if ( m_decor[x/2][y/2].objectIcon == 10000 ) // éclair n-s
|
||||
{
|
||||
if ( MoveCreate(GetCel(x,y), -1, false, CHOBJECT,-1,
|
||||
-1,-1, 9999,1,0, true) )
|
||||
{
|
||||
MoveAddIcons(GetCel(x,y), 4, true); // éclairs n-s
|
||||
MoveAddIcons(GetCel(x,y), 4, true); // éclairs n-s
|
||||
}
|
||||
}
|
||||
|
||||
if ( m_decor[x/2][y/2].objectIcon == 10001 ) // éclair e-o
|
||||
if ( m_decor[x/2][y/2].objectIcon == 10001 ) // éclair e-o
|
||||
{
|
||||
if ( MoveCreate(GetCel(x,y), -1, false, CHOBJECT,-1,
|
||||
-1,-1, 9999,1,0, true) )
|
||||
{
|
||||
MoveAddIcons(GetCel(x,y), 5, true); // éclairs e-o
|
||||
MoveAddIcons(GetCel(x,y), 5, true); // éclairs e-o
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Crée un nouveau décor animé.
|
||||
// Si bMisc=true, on garde 10 mouvements en réserve pour
|
||||
// Crée un nouveau décor animé.
|
||||
// Si bMisc=true, on garde 10 mouvements en réserve pour
|
||||
// des actions importantes (bMisc=false).
|
||||
|
||||
bool CDecor::MoveCreate(POINT cel, int rankBlupi, bool bFloor,
|
||||
@ -691,7 +691,7 @@ bool CDecor::MoveAddIcons(POINT cel, int rankIcons, bool bContinue)
|
||||
m_move[rank].rankIcons = rankIcons;
|
||||
if ( !bContinue ) m_move[rank].phase = 0;
|
||||
|
||||
if ( rankIcons == 4 || rankIcons == 5 ) // éclairs entre tours ?
|
||||
if ( rankIcons == 4 || rankIcons == 5 ) // éclairs entre tours ?
|
||||
{
|
||||
m_move[rank].cTotal = Random(0,10);
|
||||
}
|
||||
@ -703,7 +703,7 @@ bool CDecor::MoveAddIcons(POINT cel, int rankIcons, bool bContinue)
|
||||
return false;
|
||||
}
|
||||
|
||||
// Démarre le feu sur une cellule.
|
||||
// Démarre le feu sur une cellule.
|
||||
// Retourne true si c'est possible.
|
||||
|
||||
bool CDecor::MoveStartFire(POINT cel)
|
||||
@ -742,7 +742,7 @@ bool CDecor::MoveStartFire(POINT cel)
|
||||
icon = m_decor[cel.x/2][cel.y/2].floorIcon;
|
||||
|
||||
if ( channel == CHFLOOR &&
|
||||
(icon == 20 || // herbe foncée ?
|
||||
(icon == 20 || // herbe foncée ?
|
||||
(icon >= 59 && icon <= 64)) ) // pont ?
|
||||
{
|
||||
if ( !MoveCreate(cel, -1, false, CHOBJECT,-1,
|
||||
@ -756,7 +756,7 @@ bool CDecor::MoveStartFire(POINT cel)
|
||||
return false;
|
||||
}
|
||||
|
||||
// Démarre le feu si c'est possible par proximité.
|
||||
// Démarre le feu si c'est possible par proximité.
|
||||
|
||||
void CDecor::MoveProxiFire(POINT cel)
|
||||
{
|
||||
@ -787,7 +787,7 @@ void CDecor::MoveProxiFire(POINT cel)
|
||||
if ( x < 0 || x >= MAXCELX ||
|
||||
y < 0 || y >= MAXCELX ) continue;
|
||||
|
||||
if ( m_decor[x/2][y/2].fire != 0 ) continue; // brule déjà ?
|
||||
if ( m_decor[x/2][y/2].fire != 0 ) continue; // brule déjà ?
|
||||
|
||||
x = ((cel.x + xx)/2)*2;
|
||||
y = ((cel.y + yy)/2)*2;
|
||||
@ -809,13 +809,13 @@ void CDecor::MoveProxiFire(POINT cel)
|
||||
((icon >= 20 && icon <= 26)||
|
||||
(icon >= 37 && icon <= 43)) ) continue;
|
||||
|
||||
// Démarre éventuellement un seul foyer.
|
||||
// Démarre éventuellement un seul foyer.
|
||||
if ( MoveStartFire(GetCel(x,y)) ) return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Fait évoluer le feu.
|
||||
// Fait évoluer le feu.
|
||||
|
||||
void CDecor::MoveFire(int rank)
|
||||
{
|
||||
@ -841,25 +841,25 @@ void CDecor::MoveFire(int rank)
|
||||
MoveProxiFire(GetCel(x,y)); // boutte le feu
|
||||
}
|
||||
|
||||
// Début petites flammes.
|
||||
// Début petites flammes.
|
||||
if ( m_decor[x/2][y/2].fire == 2 )
|
||||
{
|
||||
MoveStartFire(GetCel(x,y));
|
||||
}
|
||||
|
||||
// Début grandes flammes.
|
||||
// Début grandes flammes.
|
||||
if ( m_decor[x/2][y/2].fire == (MoveMaxFire()-DIMOBJY*2)/2 )
|
||||
{
|
||||
MoveAddIcons(GetCel(x,y), 2, true); // grandes flammes
|
||||
}
|
||||
|
||||
// Début objet squelette.
|
||||
// Début objet squelette.
|
||||
if ( m_decor[x/2][y/2].fire == MoveMaxFire()-DIMOBJY*2 )
|
||||
{
|
||||
icon = m_decor[x/2][y/2].floorIcon;
|
||||
if ( icon == 20 ) // herbe foncée ?
|
||||
if ( icon == 20 ) // herbe foncée ?
|
||||
{
|
||||
PutFloor(GetCel(x,y), CHFLOOR, 19); // herbe brulée
|
||||
PutFloor(GetCel(x,y), CHFLOOR, 19); // herbe brulée
|
||||
}
|
||||
|
||||
icon = m_decor[x/2][y/2].objectIcon;
|
||||
@ -894,7 +894,7 @@ void CDecor::MoveFire(int rank)
|
||||
m_decor[x/2][y/2].objectChannel = -1;
|
||||
m_decor[x/2][y/2].objectIcon = -1;
|
||||
}
|
||||
m_decor[x/2][y/2].fire = MoveMaxFire(); // déjà brulé
|
||||
m_decor[x/2][y/2].fire = MoveMaxFire(); // déjà brulé
|
||||
}
|
||||
}
|
||||
else // sol qui brule ?
|
||||
@ -905,7 +905,7 @@ void CDecor::MoveFire(int rank)
|
||||
MoveProxiFire(GetCel(x,y)); // boutte le feu
|
||||
}
|
||||
|
||||
// Début petites flammes.
|
||||
// Début petites flammes.
|
||||
if ( m_decor[x/2][y/2].fire == 2 )
|
||||
{
|
||||
MoveStartFire(GetCel(x,y));
|
||||
@ -915,9 +915,9 @@ void CDecor::MoveFire(int rank)
|
||||
if ( m_decor[x/2][y/2].fire == DIMOBJY )
|
||||
{
|
||||
icon = m_decor[x/2][y/2].floorIcon;
|
||||
if ( icon == 20 ) // herbe foncée ?
|
||||
if ( icon == 20 ) // herbe foncée ?
|
||||
{
|
||||
PutFloor(GetCel(x,y), CHFLOOR, 19); // herbe brulée
|
||||
PutFloor(GetCel(x,y), CHFLOOR, 19); // herbe brulée
|
||||
}
|
||||
if ( icon == 59 ) // pont ?
|
||||
{
|
||||
@ -947,12 +947,12 @@ void CDecor::MoveFire(int rank)
|
||||
MoveFinish(GetCel(x,y));
|
||||
m_decor[x/2][y/2].objectChannel = -1;
|
||||
m_decor[x/2][y/2].objectIcon = -1;
|
||||
m_decor[x/2][y/2].fire = MoveMaxFire(); // déjà brulé
|
||||
m_decor[x/2][y/2].fire = MoveMaxFire(); // déjà brulé
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Fait évoluer tous les décors animés.
|
||||
// Fait évoluer tous les décors animés.
|
||||
|
||||
void CDecor::MoveStep(bool bFirst)
|
||||
{
|
||||
@ -963,7 +963,7 @@ void CDecor::MoveStep(bool bFirst)
|
||||
if ( m_move[rank].bExist )
|
||||
{
|
||||
if ( !bFirst &&
|
||||
(m_move[rank].rankIcons == 4 || // éclair entre tours ?
|
||||
(m_move[rank].rankIcons == 4 || // éclair entre tours ?
|
||||
m_move[rank].rankIcons == 5 ) )
|
||||
{
|
||||
continue;
|
||||
@ -971,8 +971,8 @@ void CDecor::MoveStep(bool bFirst)
|
||||
|
||||
MoveFire(rank);
|
||||
|
||||
// Si le blupi travaillant ici est stoppé, on
|
||||
// arrête aussi la construction.
|
||||
// Si le blupi travaillant ici est stoppé, on
|
||||
// arrête aussi la construction.
|
||||
rankBlupi = m_move[rank].rankBlupi;
|
||||
if ( rankBlupi != -1 )
|
||||
{
|
||||
@ -987,7 +987,7 @@ void CDecor::MoveStep(bool bFirst)
|
||||
}
|
||||
|
||||
m_move[rank].cDelai ++;
|
||||
if ( m_move[rank].cDelai >= m_move[rank].delai ) // délai écoulé ?
|
||||
if ( m_move[rank].cDelai >= m_move[rank].delai ) // délai écoulé ?
|
||||
{
|
||||
m_move[rank].cDelai = 0;
|
||||
|
||||
@ -1007,7 +1007,7 @@ void CDecor::MoveStep(bool bFirst)
|
||||
}
|
||||
}
|
||||
|
||||
// Termine un mouvement pour une cellule donnée.
|
||||
// Termine un mouvement pour une cellule donnée.
|
||||
|
||||
void CDecor::MoveFinish(POINT cel)
|
||||
{
|
||||
@ -1038,7 +1038,7 @@ void CDecor::MoveFinish(POINT cel)
|
||||
}
|
||||
}
|
||||
|
||||
// Termine un mouvement, d'après le rang du blupi.
|
||||
// Termine un mouvement, d'après le rang du blupi.
|
||||
|
||||
void CDecor::MoveFinish(int rankBlupi)
|
||||
{
|
||||
@ -1054,7 +1054,7 @@ void CDecor::MoveFinish(int rankBlupi)
|
||||
}
|
||||
}
|
||||
|
||||
// Vérifie si une cellule est déjà utilisée.
|
||||
// Vérifie si une cellule est déjà utilisée.
|
||||
|
||||
bool CDecor::MoveIsUsed(POINT cel)
|
||||
{
|
||||
@ -1073,7 +1073,7 @@ bool CDecor::MoveIsUsed(POINT cel)
|
||||
return false;
|
||||
}
|
||||
|
||||
// Retourne l'objet en construction à un endroit donné.
|
||||
// Retourne l'objet en construction à un endroit donné.
|
||||
|
||||
bool CDecor::MoveGetObject(POINT cel, int &channel, int &icon)
|
||||
{
|
||||
@ -1095,7 +1095,7 @@ bool CDecor::MoveGetObject(POINT cel, int &channel, int &icon)
|
||||
return false;
|
||||
}
|
||||
|
||||
// Modifie un objet en construction à un endroit donné.
|
||||
// Modifie un objet en construction à un endroit donné.
|
||||
|
||||
bool CDecor::MovePutObject(POINT cel, int channel, int icon)
|
||||
{
|
||||
|
224
src/decor.cpp
224
src/decor.cpp
@ -21,7 +21,7 @@
|
||||
|
||||
|
||||
|
||||
#define TEXTDELAY 10 // délai avant apparition tooltips
|
||||
#define TEXTDELAY 10 // délai avant apparition tooltips
|
||||
|
||||
POINT GetCel(int x, int y)
|
||||
{
|
||||
@ -41,9 +41,9 @@ POINT GetCel(POINT cel, int x, int y)
|
||||
return cel;
|
||||
}
|
||||
|
||||
// Indique si une coordonnée de cellule est valide.
|
||||
// On ne peut pas aller dans la dernière cellule tout au
|
||||
// bord (-2) pour permettre de gérer le brouillard proprement
|
||||
// Indique si une coordonnée de cellule est valide.
|
||||
// On ne peut pas aller dans la dernière cellule tout au
|
||||
// bord (-2) pour permettre de gérer le brouillard proprement
|
||||
// jusque dans les bords !
|
||||
|
||||
bool IsValid(POINT cel)
|
||||
@ -53,7 +53,7 @@ bool IsValid(POINT cel)
|
||||
return true;
|
||||
}
|
||||
|
||||
// Retourne un vecteur orienté dans une direction donnée.
|
||||
// Retourne un vecteur orienté dans une direction donnée.
|
||||
|
||||
POINT GetVector(int direct)
|
||||
{
|
||||
@ -110,7 +110,7 @@ CDecor::CDecor()
|
||||
m_celOutline1.x = -1;
|
||||
m_celOutline2.x = -1;
|
||||
|
||||
m_bHiliRect = false; // pas de rectangle de sélection
|
||||
m_bHiliRect = false; // pas de rectangle de sélection
|
||||
m_shiftHili = 0;
|
||||
|
||||
m_shiftOffset.x = 0;
|
||||
@ -143,11 +143,11 @@ CDecor::CDecor()
|
||||
|
||||
CDecor::~CDecor()
|
||||
{
|
||||
UndoClose(); // libère le buffer du undo
|
||||
UndoClose(); // libère le buffer du undo
|
||||
}
|
||||
|
||||
|
||||
// Initialisation générale.
|
||||
// Initialisation générale.
|
||||
|
||||
void CDecor::Create(CSound *pSound, CPixmap *pPixmap)
|
||||
{
|
||||
@ -156,7 +156,7 @@ void CDecor::Create(CSound *pSound, CPixmap *pPixmap)
|
||||
m_bOutline = false;
|
||||
}
|
||||
|
||||
// Initialise le décor avec un sol plat partout.
|
||||
// Initialise le décor avec un sol plat partout.
|
||||
|
||||
void CDecor::Init(int channel, int icon)
|
||||
{
|
||||
@ -172,7 +172,7 @@ void CDecor::Init(int channel, int icon)
|
||||
m_decor[x][y].objectChannel = -1;
|
||||
m_decor[x][y].objectIcon = -1;
|
||||
|
||||
m_decor[x][y].fog = FOGHIDE; // caché
|
||||
m_decor[x][y].fog = FOGHIDE; // caché
|
||||
m_decor[x][y].rankMove = -1;
|
||||
m_decor[x][y].workBlupi = -1;
|
||||
m_decor[x][y].fire = 0;
|
||||
@ -191,7 +191,7 @@ void CDecor::Init(int channel, int icon)
|
||||
m_bGroundRedraw = true;
|
||||
}
|
||||
|
||||
// Initialise le décor après une modification.
|
||||
// Initialise le décor après une modification.
|
||||
|
||||
void CDecor::InitAfterBuild()
|
||||
{
|
||||
@ -202,7 +202,7 @@ void CDecor::InitAfterBuild()
|
||||
BlupiDeselect();
|
||||
}
|
||||
|
||||
// Initialise les mises en évidence, avant de jouer.
|
||||
// Initialise les mises en évidence, avant de jouer.
|
||||
|
||||
void CDecor::ResetHili()
|
||||
{
|
||||
@ -210,7 +210,7 @@ void CDecor::ResetHili()
|
||||
InitOutlineRect();
|
||||
}
|
||||
|
||||
// Charge les images nécessaires au décor.
|
||||
// Charge les images nécessaires au décor.
|
||||
|
||||
bool CDecor::LoadImages()
|
||||
{
|
||||
@ -256,7 +256,7 @@ void CDecor::ClearFog()
|
||||
{
|
||||
for ( y=0 ; y<MAXCELY/2 ; y++ )
|
||||
{
|
||||
m_decor[x][y].fog = FOGHIDE; // caché
|
||||
m_decor[x][y].fog = FOGHIDE; // caché
|
||||
}
|
||||
}
|
||||
|
||||
@ -271,7 +271,7 @@ void CDecor::ClearFog()
|
||||
m_bOutline = false;
|
||||
}
|
||||
|
||||
// Permet de nouveau aux cellules brulées de bruler.
|
||||
// Permet de nouveau aux cellules brulées de bruler.
|
||||
|
||||
void CDecor::ClearFire()
|
||||
{
|
||||
@ -281,14 +281,14 @@ void CDecor::ClearFire()
|
||||
{
|
||||
for ( y=0 ; y<MAXCELY/2 ; y++ )
|
||||
{
|
||||
if ( m_decor[x][y].fire >= MoveMaxFire() ) // déjà brulé ?
|
||||
if ( m_decor[x][y].fire >= MoveMaxFire() ) // déjà brulé ?
|
||||
{
|
||||
m_decor[x][y].fire = 0; // pourra de nouveau bruler
|
||||
}
|
||||
|
||||
if ( m_decor[x][y].fire > 1 ) // en train de bruler ?
|
||||
{
|
||||
m_decor[x][y].fire = 1; // début du feu
|
||||
m_decor[x][y].fire = 1; // début du feu
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -422,7 +422,7 @@ void CDecor::SetShiftOffset(POINT offset)
|
||||
m_bGroundRedraw = true;
|
||||
}
|
||||
|
||||
// Convertit la position d'une cellule en coordonnée graphique.
|
||||
// Convertit la position d'une cellule en coordonnée graphique.
|
||||
|
||||
POINT CDecor::ConvCelToPos(POINT cel)
|
||||
{
|
||||
@ -437,7 +437,7 @@ POINT CDecor::ConvCelToPos(POINT cel)
|
||||
return pos;
|
||||
}
|
||||
|
||||
// Convertit une coordonnée graphique en cellule.
|
||||
// Convertit une coordonnée graphique en cellule.
|
||||
|
||||
POINT CDecor::ConvPosToCel(POINT pos, bool bMap)
|
||||
{
|
||||
@ -467,7 +467,7 @@ POINT CDecor::ConvPosToCel(POINT pos, bool bMap)
|
||||
return cel;
|
||||
}
|
||||
|
||||
// Convertit une coordonnée graphique en grande cellule (2x2).
|
||||
// Convertit une coordonnée graphique en grande cellule (2x2).
|
||||
|
||||
POINT CDecor::ConvPosToCel2(POINT pos)
|
||||
{
|
||||
@ -507,7 +507,7 @@ POINT CDecor::ConvPosToCel2(POINT pos)
|
||||
|
||||
|
||||
|
||||
// Attribution des blupi aux différentes cellules.
|
||||
// Attribution des blupi aux différentes cellules.
|
||||
// Lorsque un blupi a deux positions (courante et destination),
|
||||
// il faut toujours mettre blupi le plus au fond possible
|
||||
// (minimiser x et y).
|
||||
@ -517,7 +517,7 @@ void CDecor::BuildPutBlupi()
|
||||
int x, y, dx, dy, xMin, yMin, rank, clipLeft;
|
||||
POINT pos;
|
||||
|
||||
#if 0 // déjà fait au point (1), voir Build
|
||||
#if 0 // déjà fait au point (1), voir Build
|
||||
for ( x=0 ; x<MAXCELX ; x++ )
|
||||
{
|
||||
for ( y=0 ; y<MAXCELY ; y++ )
|
||||
@ -539,7 +539,7 @@ void CDecor::BuildPutBlupi()
|
||||
if ( yMin > m_blupi[rank].cel.y ) yMin = m_blupi[rank].cel.y;
|
||||
|
||||
// Si blupi entre dans une maison, il faut initialiser
|
||||
// le clipping à gauche.
|
||||
// le clipping à gauche.
|
||||
m_blupi[rank].clipLeft = 0; // pas de clipping
|
||||
|
||||
if ( !m_bOutline &&
|
||||
@ -568,12 +568,12 @@ void CDecor::BuildPutBlupi()
|
||||
dx = m_blupi[rank].destCel.x - x;
|
||||
dy = m_blupi[rank].destCel.y - y;
|
||||
|
||||
if ( dx != -dy ) // déplacement non horizontal (ne/so) ?
|
||||
if ( dx != -dy ) // déplacement non horizontal (ne/so) ?
|
||||
{
|
||||
if ( dx < 0 ) x = m_blupi[rank].destCel.x;
|
||||
if ( dy < 0 ) y = m_blupi[rank].destCel.y;
|
||||
}
|
||||
if ( dx == -1 && dy == 1 ) // déplacement "so" ?
|
||||
if ( dx == -1 && dy == 1 ) // déplacement "so" ?
|
||||
{
|
||||
x = m_blupi[rank].destCel.x;
|
||||
y = m_blupi[rank].destCel.y;
|
||||
@ -595,7 +595,7 @@ void CDecor::BuildPutBlupi()
|
||||
if ( !IsFreeCelObstacle(GetCel(x+1,y-1)) ) x ++;
|
||||
}
|
||||
|
||||
if ( m_rankBlupi[x][y] != -1 ) // déjà occupé ?
|
||||
if ( m_rankBlupi[x][y] != -1 ) // déjà occupé ?
|
||||
{
|
||||
if ( x == m_blupi[rank].cel.x )
|
||||
{
|
||||
@ -606,7 +606,7 @@ void CDecor::BuildPutBlupi()
|
||||
x = m_blupi[rank].cel.x;
|
||||
}
|
||||
|
||||
if ( m_rankBlupi[x][y] != -1 ) // déjà occupé ?
|
||||
if ( m_rankBlupi[x][y] != -1 ) // déjà occupé ?
|
||||
{
|
||||
if ( y == m_blupi[rank].cel.y )
|
||||
{
|
||||
@ -617,7 +617,7 @@ void CDecor::BuildPutBlupi()
|
||||
y = m_blupi[rank].cel.y;
|
||||
}
|
||||
|
||||
if ( m_rankBlupi[x][y] != -1 ) // déjà occupé ?
|
||||
if ( m_rankBlupi[x][y] != -1 ) // déjà occupé ?
|
||||
{
|
||||
//? OutputDebug(">>> Manque un blupi <<<\n");
|
||||
continue; // que faire d'autre ?
|
||||
@ -629,7 +629,7 @@ void CDecor::BuildPutBlupi()
|
||||
}
|
||||
}
|
||||
|
||||
// Dessine une cellule du décor contenant un sol animé.
|
||||
// Dessine une cellule du décor contenant un sol animé.
|
||||
|
||||
void CDecor::BuildMoveFloor(int x, int y, POINT pos, int rank)
|
||||
{
|
||||
@ -668,7 +668,7 @@ void CDecor::BuildMoveFloor(int x, int y, POINT pos, int rank)
|
||||
}
|
||||
}
|
||||
|
||||
// Dessine une cellule du décor contenant un objet animé.
|
||||
// Dessine une cellule du décor contenant un objet animé.
|
||||
|
||||
void CDecor::BuildMoveObject(int x, int y, POINT pos, int rank)
|
||||
{
|
||||
@ -720,7 +720,7 @@ void CDecor::BuildMoveObject(int x, int y, POINT pos, int rank)
|
||||
if ( hBuild < -DIMOBJY ) hBuild = -DIMOBJY;
|
||||
}
|
||||
|
||||
// Dessine l'objet actuellement dans le décor.
|
||||
// Dessine l'objet actuellement dans le décor.
|
||||
if ( m_decor[x/2][y/2].objectChannel >= 0 )
|
||||
{
|
||||
if ( hBuild >= 0 )
|
||||
@ -781,7 +781,7 @@ void CDecor::BuildMoveObject(int x, int y, POINT pos, int rank)
|
||||
}
|
||||
}
|
||||
|
||||
// Déplace l'objet transporté par blupi.
|
||||
// Déplace l'objet transporté par blupi.
|
||||
|
||||
void BuildMoveTransport(int icon, POINT &pos)
|
||||
{
|
||||
@ -839,13 +839,13 @@ void BuildMoveTransport(int icon, POINT &pos)
|
||||
pos.y += 1;
|
||||
}
|
||||
|
||||
if ( icon == 106 ) // se penche (mèche dynamite) ?
|
||||
if ( icon == 106 ) // se penche (mèche dynamite) ?
|
||||
{
|
||||
pos.x += 8;
|
||||
pos.y += 10;
|
||||
}
|
||||
|
||||
if ( icon == 194 ) // se penche (mèche dynamite) ?
|
||||
if ( icon == 194 ) // se penche (mèche dynamite) ?
|
||||
{
|
||||
pos.x += 9;
|
||||
pos.y += 9;
|
||||
@ -869,7 +869,7 @@ void BuildMoveTransport(int icon, POINT &pos)
|
||||
pos.y += offset_jeep[(icon-250)*2+1];
|
||||
}
|
||||
|
||||
if ( icon == 270 ) pos.y += 3; // blupi électrocuté
|
||||
if ( icon == 270 ) pos.y += 3; // blupi électrocuté
|
||||
if ( icon == 271 ) pos.y -= 2;
|
||||
if ( icon == 272 ) pos.y -= 7;
|
||||
}
|
||||
@ -965,7 +965,7 @@ void CDecor::BuildGround(RECT clip)
|
||||
icon = 78; // losange noir
|
||||
}
|
||||
|
||||
if ( !m_bBuild && icon == 71 ) // terre à fer ?
|
||||
if ( !m_bBuild && icon == 71 ) // terre à fer ?
|
||||
{
|
||||
icon = 33; // terre normale !
|
||||
}
|
||||
@ -1002,7 +1002,7 @@ void CDecor::BuildGround(RECT clip)
|
||||
m_bGroundRedraw = false;
|
||||
}
|
||||
|
||||
// Construit le décor dans un pixmap.
|
||||
// Construit le décor dans un pixmap.
|
||||
|
||||
void CDecor::Build(RECT clip, POINT posMouse)
|
||||
{
|
||||
@ -1102,7 +1102,7 @@ void CDecor::Build(RECT clip, POINT posMouse)
|
||||
{
|
||||
icon = m_decor[x/2][y/2].floorIcon;
|
||||
|
||||
if ( !m_bBuild && icon == 71 ) // terre à fer ?
|
||||
if ( !m_bBuild && icon == 71 ) // terre à fer ?
|
||||
{
|
||||
icon = 33; // terre normale !
|
||||
}
|
||||
@ -1125,7 +1125,7 @@ void CDecor::Build(RECT clip, POINT posMouse)
|
||||
}
|
||||
|
||||
rank = m_decor[x/2][y/2].rankMove;
|
||||
if ( rank != -1 && // décor animé ?
|
||||
if ( rank != -1 && // décor animé ?
|
||||
m_move[rank].bFloor )
|
||||
{
|
||||
pos.x = cPos.x-DIMCELX/2;
|
||||
@ -1149,7 +1149,7 @@ void CDecor::Build(RECT clip, POINT posMouse)
|
||||
}
|
||||
}
|
||||
|
||||
if ( m_bHiliRect ) // rectangle de sélection existe ?
|
||||
if ( m_bHiliRect ) // rectangle de sélection existe ?
|
||||
{
|
||||
if ( (m_p1Hili.x == x && m_p1Hili.y == y) ||
|
||||
(m_p2Hili.x == x && m_p2Hili.y == y) )
|
||||
@ -1202,7 +1202,7 @@ void CDecor::Build(RECT clip, POINT posMouse)
|
||||
}
|
||||
}
|
||||
|
||||
BlupiDrawHili(); // dessine le rectangle de sélection
|
||||
BlupiDrawHili(); // dessine le rectangle de sélection
|
||||
|
||||
// Construit les objets et les blupi.
|
||||
BuildPutBlupi(); // m_rankBlupi[x][y] <- rangs des blupi
|
||||
@ -1240,7 +1240,7 @@ void CDecor::Build(RECT clip, POINT posMouse)
|
||||
{
|
||||
tPos.y -= 6;
|
||||
}
|
||||
// Dessine la sélection/énergie
|
||||
// Dessine la sélection/énergie
|
||||
if ( m_blupi[rank].clipLeft == 0 )
|
||||
{
|
||||
m_pPixmap->DrawIconDemi(-1, CHBLUPI, icon, tPos);
|
||||
@ -1255,7 +1255,7 @@ void CDecor::Build(RECT clip, POINT posMouse)
|
||||
}
|
||||
}
|
||||
|
||||
// Dessine la flèche ronde "répète" sous blupi.
|
||||
// Dessine la flèche ronde "répète" sous blupi.
|
||||
if ( m_blupi[rank].repeatLevel != -1 )
|
||||
{
|
||||
tPos = pos;
|
||||
@ -1264,7 +1264,7 @@ void CDecor::Build(RECT clip, POINT posMouse)
|
||||
{
|
||||
tPos.y -= 6;
|
||||
}
|
||||
// Dessine la sélection/énergie
|
||||
// Dessine la sélection/énergie
|
||||
if ( m_blupi[rank].clipLeft == 0 )
|
||||
{
|
||||
m_pPixmap->DrawIconDemi(-1, CHBLUPI, 116, tPos);
|
||||
@ -1279,7 +1279,7 @@ void CDecor::Build(RECT clip, POINT posMouse)
|
||||
}
|
||||
}
|
||||
|
||||
// Dessine la flèche jaune sur blupi.
|
||||
// Dessine la flèche jaune sur blupi.
|
||||
if ( m_blupi[rank].bArrow )
|
||||
{
|
||||
tPos = pos;
|
||||
@ -1311,7 +1311,7 @@ void CDecor::Build(RECT clip, POINT posMouse)
|
||||
m_pPixmap->DrawIcon(-1, m_blupi[rank].channel,
|
||||
m_blupi[rank].icon, pos);
|
||||
|
||||
// Dessine l'objet transporté.
|
||||
// Dessine l'objet transporté.
|
||||
if ( m_blupi[rank].takeChannel != -1 )
|
||||
{
|
||||
BuildMoveTransport(m_blupi[rank].icon, pos);
|
||||
@ -1327,7 +1327,7 @@ void CDecor::Build(RECT clip, POINT posMouse)
|
||||
m_pPixmap->DrawIcon(-1, m_blupi[rank].channel,
|
||||
m_blupi[rank].icon, pos);
|
||||
|
||||
// Dessine l'objet transporté.
|
||||
// Dessine l'objet transporté.
|
||||
if ( m_blupi[rank].takeChannel != -1 )
|
||||
{
|
||||
BuildMoveTransport(m_blupi[rank].icon, pos);
|
||||
@ -1347,7 +1347,7 @@ void CDecor::Build(RECT clip, POINT posMouse)
|
||||
pos.y = cPos.y-(DIMOBJY-DIMCELY*2);
|
||||
|
||||
// Dessine l'objet
|
||||
if ( rank == -1 || // décor fixe ?
|
||||
if ( rank == -1 || // décor fixe ?
|
||||
m_move[rank].bFloor ||
|
||||
m_bBuild )
|
||||
{
|
||||
@ -1367,20 +1367,20 @@ void CDecor::Build(RECT clip, POINT posMouse)
|
||||
m_decor[x/2][y/2].objectIcon,
|
||||
pos);
|
||||
|
||||
if ( m_decor[x/2][y/2].objectIcon == 12 ) // fusée ?
|
||||
if ( m_decor[x/2][y/2].objectIcon == 12 ) // fusée ?
|
||||
{
|
||||
pos.y -= DIMOBJY;
|
||||
m_pPixmap->DrawIcon(-1, channel, 13, pos);
|
||||
}
|
||||
}
|
||||
else // décor animé ?
|
||||
else // décor animé ?
|
||||
{
|
||||
BuildMoveObject(x, y, pos, rank);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( rank != -1 && // décor animé ?
|
||||
if ( rank != -1 && // décor animé ?
|
||||
!m_move[rank].bFloor &&
|
||||
!m_bBuild )
|
||||
{
|
||||
@ -1424,22 +1424,22 @@ void CDecor::Build(RECT clip, POINT posMouse)
|
||||
// Construit le brouillard.
|
||||
if ( !m_bFog ) goto term;
|
||||
|
||||
if ( m_shiftOffset.x < 0 ) // décalage à droite ?
|
||||
if ( m_shiftOffset.x < 0 ) // décalage à droite ?
|
||||
{
|
||||
nbx += 2;
|
||||
}
|
||||
if ( m_shiftOffset.y < 0 ) // décalage en bas ?
|
||||
if ( m_shiftOffset.y < 0 ) // décalage en bas ?
|
||||
{
|
||||
nby += 2;
|
||||
}
|
||||
if ( m_shiftOffset.x > 0 ) // décalage à gauche ?
|
||||
if ( m_shiftOffset.x > 0 ) // décalage à gauche ?
|
||||
{
|
||||
nbx += 2;
|
||||
iCel.x --;
|
||||
iCel.y ++;
|
||||
iPos = ConvCelToPos(iCel);
|
||||
}
|
||||
if ( m_shiftOffset.y > 0 ) // décalage en haut ?
|
||||
if ( m_shiftOffset.y > 0 ) // décalage en haut ?
|
||||
{
|
||||
nby += 2;
|
||||
iCel.x --;
|
||||
@ -1464,7 +1464,7 @@ void CDecor::Build(RECT clip, POINT posMouse)
|
||||
}
|
||||
else
|
||||
{
|
||||
icon = FOGHIDE; // caché
|
||||
icon = FOGHIDE; // caché
|
||||
}
|
||||
|
||||
if ( abs(x)%4 == abs(y)%4 &&
|
||||
@ -1497,7 +1497,7 @@ void CDecor::Build(RECT clip, POINT posMouse)
|
||||
}
|
||||
|
||||
term:
|
||||
// Dessine la flèche jaune sur un objet.
|
||||
// Dessine la flèche jaune sur un objet.
|
||||
if ( m_celArrow.x != -1 )
|
||||
{
|
||||
tPos = ConvCelToPos(m_celArrow);
|
||||
@ -1512,7 +1512,7 @@ void CDecor::Build(RECT clip, POINT posMouse)
|
||||
m_pPixmap->DrawIcon(-1, CHBLUPI,132, tPos);
|
||||
}
|
||||
|
||||
// Dessine le nom de l'objet pointé par la souris.
|
||||
// Dessine le nom de l'objet pointé par la souris.
|
||||
if ( posMouse.x == m_textLastPos.x &&
|
||||
posMouse.y == m_textLastPos.y )
|
||||
{
|
||||
@ -1545,9 +1545,9 @@ void CDecor::Build(RECT clip, POINT posMouse)
|
||||
|
||||
|
||||
// Augmente la phase.
|
||||
// -1 mise à jour continue
|
||||
// 0 début de mise à jour périodique
|
||||
// 1 mise à jour périodique suivante
|
||||
// -1 mise à jour continue
|
||||
// 0 début de mise à jour périodique
|
||||
// 1 mise à jour périodique suivante
|
||||
|
||||
void CDecor::NextPhase(int mode)
|
||||
{
|
||||
@ -1569,14 +1569,14 @@ void CDecor::NextPhase(int mode)
|
||||
m_totalTime ++;
|
||||
}
|
||||
|
||||
// Modifie le temps total passé dans cette partie.
|
||||
// Modifie le temps total passé dans cette partie.
|
||||
|
||||
void CDecor::SetTotalTime(int total)
|
||||
{
|
||||
m_totalTime = total;
|
||||
}
|
||||
|
||||
// Retourne le temps total passé dans cette partie.
|
||||
// Retourne le temps total passé dans cette partie.
|
||||
|
||||
int CDecor::GetTotalTime()
|
||||
{
|
||||
@ -1584,7 +1584,7 @@ int CDecor::GetTotalTime()
|
||||
}
|
||||
|
||||
|
||||
// Compte le nombre total de sols contenus dans les décors.
|
||||
// Compte le nombre total de sols contenus dans les décors.
|
||||
|
||||
int CDecor::CountFloor(int channel, int icon)
|
||||
{
|
||||
@ -1604,8 +1604,8 @@ int CDecor::CountFloor(int channel, int icon)
|
||||
}
|
||||
|
||||
// Indique si une cellule est ok pour une action.
|
||||
// Le rang du blupi qui effectuera le travail est donnée dans rank.
|
||||
// action = 0 sélection jeu
|
||||
// Le rang du blupi qui effectuera le travail est donnée dans rank.
|
||||
// action = 0 sélection jeu
|
||||
// 1 construction d'une cellule 1x1
|
||||
// 2 construction d'une cellule 2x2
|
||||
// WM_ACTION* action
|
||||
@ -1657,11 +1657,11 @@ int CDecor::CelOkForAction(POINT cel, int action, int rank,
|
||||
{
|
||||
bTransport = true;
|
||||
}
|
||||
if ( m_blupi[rank].vehicule != 0 ) // pas à pied ?
|
||||
if ( m_blupi[rank].vehicule != 0 ) // pas à pied ?
|
||||
{
|
||||
bVehicule = true;
|
||||
}
|
||||
if ( m_blupi[rank].vehicule != 0 && // pas à pied ?
|
||||
if ( m_blupi[rank].vehicule != 0 && // pas à pied ?
|
||||
m_blupi[rank].vehicule != 3 ) // pas armure ?
|
||||
{
|
||||
bVehiculeA = true;
|
||||
@ -1754,7 +1754,7 @@ int CDecor::CelOkForAction(POINT cel, int action, int rank,
|
||||
IsFreeCelGo(GetCel(cel.x+x,cel.y+y), rank) &&
|
||||
!IsBlupiHere(GetCel(cel.x+x,cel.y+y), true) )
|
||||
{
|
||||
//? icons[1+x][1+y] = ICON_HILI_GO; // flèche
|
||||
//? icons[1+x][1+y] = ICON_HILI_GO; // flèche
|
||||
icons[1+x][1+y] = ICON_HILI_OP; // action
|
||||
error = 0;
|
||||
}
|
||||
@ -1841,30 +1841,30 @@ int CDecor::CelOkForAction(POINT cel, int action, int rank,
|
||||
|
||||
if ( action == WM_ACTION_BUILD1 || // cabane ?
|
||||
action == WM_ACTION_BUILD2 || // couveuse ?
|
||||
action == WM_ACTION_BUILD6 ) // téléporteur ?
|
||||
action == WM_ACTION_BUILD6 ) // téléporteur ?
|
||||
{
|
||||
GetFloor(cel, channel, icon);
|
||||
if ( channel != CHFLOOR ||
|
||||
(icon != 1 && // herbe claire ?
|
||||
(icon < 19 || icon > 32)) ) // herbe foncée ?
|
||||
(icon < 19 || icon > 32)) ) // herbe foncée ?
|
||||
{
|
||||
error = ERROR_GROUND; // sol pas adéquat
|
||||
error = ERROR_GROUND; // sol pas adéquat
|
||||
}
|
||||
}
|
||||
|
||||
if ( action == WM_ACTION_BUILD4 ) // mine ?
|
||||
{
|
||||
GetFloor(cel, channel, icon);
|
||||
if ( channel != CHFLOOR || icon != 71 ) // terre à fer ?
|
||||
if ( channel != CHFLOOR || icon != 71 ) // terre à fer ?
|
||||
{
|
||||
error = ERROR_GROUND; // sol pas adéquat
|
||||
error = ERROR_GROUND; // sol pas adéquat
|
||||
}
|
||||
}
|
||||
|
||||
if ( action == WM_ACTION_BUILD6 && // téléporteur ?
|
||||
CountFloor(CHFLOOR, 80) >= 2 ) // déjà 2 ?
|
||||
if ( action == WM_ACTION_BUILD6 && // téléporteur ?
|
||||
CountFloor(CHFLOOR, 80) >= 2 ) // déjà 2 ?
|
||||
{
|
||||
error = ERROR_TELE2; // déjà 2 téléporteurs
|
||||
error = ERROR_TELE2; // déjà 2 téléporteurs
|
||||
}
|
||||
|
||||
if ( action == WM_ACTION_BUILD3 ||
|
||||
@ -1978,9 +1978,9 @@ int CDecor::CelOkForAction(POINT cel, int action, int rank,
|
||||
// GetFloor(cel, channel, icon);
|
||||
// if ( channel != CHFLOOR ||
|
||||
// (icon != 1 && // herbe claire ?
|
||||
// (icon < 19 || icon > 32)) ) // herbe foncée ?
|
||||
// (icon < 19 || icon > 32)) ) // herbe foncée ?
|
||||
// {
|
||||
// error = ERROR_GROUND; // sol pas adéquat
|
||||
// error = ERROR_GROUND; // sol pas adéquat
|
||||
// }
|
||||
|
||||
GetObject(cel, channel, icon);
|
||||
@ -2002,7 +2002,7 @@ int CDecor::CelOkForAction(POINT cel, int action, int rank,
|
||||
{
|
||||
for ( y=-1 ; y<3 ; y++ )
|
||||
{
|
||||
if ( x<0 || x>1 || y<0 || y>1 ) // périphérie ?
|
||||
if ( x<0 || x>1 || y<0 || y>1 ) // périphérie ?
|
||||
{
|
||||
GetFloor(GetCel(cel,x,y), channel, icon);
|
||||
if ( channel == CHFLOOR &&
|
||||
@ -2160,7 +2160,7 @@ int CDecor::CelOkForAction(POINT cel, int action, int rank,
|
||||
GetObject(GetCel(cel,-1,-1), channel, icon);
|
||||
if ( bStrong && !bTransport && !bVehiculeA &&
|
||||
channel == CHOBJECT &&
|
||||
(icon == 14 || // métal ?
|
||||
(icon == 14 || // métal ?
|
||||
icon == 36 || // planches ?
|
||||
icon == 44 || // pierres ?
|
||||
icon == 60 || // tomates ?
|
||||
@ -2171,7 +2171,7 @@ int CDecor::CelOkForAction(POINT cel, int action, int rank,
|
||||
icon == 95 || // fleurs ?
|
||||
icon == 85 || // dynamite ?
|
||||
icon == 92 || // poison ?
|
||||
icon == 93 || // piège ?
|
||||
icon == 93 || // piège ?
|
||||
icon == 123 || // fer ?
|
||||
icon == 125) && // mine ?
|
||||
(!IsBlupiHereEx(GetCel(cel,-1,0), rank, false) ||
|
||||
@ -2522,7 +2522,7 @@ int CDecor::CelOkForAction(POINT cel, int action, int rank,
|
||||
error = ERROR_MISC;
|
||||
if ( m_blupi[rank].vehicule == 2 && // en jeep ?
|
||||
m_decor[cel.x/2][cel.y/2].objectIcon == -1 &&
|
||||
m_decor[cel.x/2][cel.y/2].floorIcon != 80 ) // pas téléporteur ?
|
||||
m_decor[cel.x/2][cel.y/2].floorIcon != 80 ) // pas téléporteur ?
|
||||
{
|
||||
if ( IsFreeCelGo(GetCel(cel,+1, 0), rank) &&
|
||||
IsFreeCelGo(GetCel(cel,+1,+1), rank) &&
|
||||
@ -2553,7 +2553,7 @@ int CDecor::CelOkForAction(POINT cel, int action, int rank,
|
||||
if ( m_blupi[rank].vehicule == 3 && // armure ?
|
||||
!bTransport &&
|
||||
m_decor[cel.x/2][cel.y/2].objectIcon == -1 &&
|
||||
m_decor[cel.x/2][cel.y/2].floorIcon != 80 ) // pas téléporteur ?
|
||||
m_decor[cel.x/2][cel.y/2].floorIcon != 80 ) // pas téléporteur ?
|
||||
{
|
||||
if ( IsFreeCelGo(GetCel(cel,+1, 0), rank) &&
|
||||
IsFreeCelGo(GetCel(cel,+1,+1), rank) &&
|
||||
@ -2587,13 +2587,13 @@ int CDecor::CelOkForAction(POINT cel, int action, int rank,
|
||||
if ( (icon < 33 || icon > 48) &&
|
||||
icon != 71 ) // pas terre ?
|
||||
{
|
||||
error = ERROR_MISC; // terrain pas adapté
|
||||
error = ERROR_MISC; // terrain pas adapté
|
||||
}
|
||||
|
||||
GetObject(cel, channel, icon);
|
||||
if ( channel == CHOBJECT ) // y a-t-il un objet ?
|
||||
{
|
||||
error = ERROR_MISC; // terrain pas adapté
|
||||
error = ERROR_MISC; // terrain pas adapté
|
||||
}
|
||||
|
||||
for ( x=0 ; x<2 ; x++ )
|
||||
@ -2712,7 +2712,7 @@ int CDecor::CelOkForAction(POINT cel, int action, int rank,
|
||||
GetObject(cel, channel, icon);
|
||||
if ( channel != CHOBJECT || icon != 120 || // usine ?
|
||||
m_blupi[rank].takeChannel != CHOBJECT ||
|
||||
m_blupi[rank].takeIcon != 14 ) // métal ?
|
||||
m_blupi[rank].takeIcon != 14 ) // métal ?
|
||||
{
|
||||
error = ERROR_MISC; // pas d'usine !
|
||||
}
|
||||
@ -2743,7 +2743,7 @@ int CDecor::CelOkForAction(POINT cel, int action, int rank,
|
||||
}
|
||||
|
||||
// Indique si une cellule est ok pour une action.
|
||||
// Le rang du blupi qui effectuera le travail est donnée dans rank.
|
||||
// Le rang du blupi qui effectuera le travail est donnée dans rank.
|
||||
|
||||
int CDecor::CelOkForAction(POINT cel, int action, int rank)
|
||||
{
|
||||
@ -2754,7 +2754,7 @@ int CDecor::CelOkForAction(POINT cel, int action, int rank)
|
||||
celOutline1, celOutline2);
|
||||
}
|
||||
|
||||
// Retourne le rang du nième blupi sélectionné.
|
||||
// Retourne le rang du nième blupi sélectionné.
|
||||
|
||||
int CDecor::GetHiliRankBlupi(int nb)
|
||||
{
|
||||
@ -2780,8 +2780,8 @@ int CDecor::GetHiliRankBlupi(int nb)
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Marque la cellule visée par la souris.
|
||||
// action = 0 sélection jeu
|
||||
// Marque la cellule visée par la souris.
|
||||
// action = 0 sélection jeu
|
||||
// 1 construction d'une cellule 1x1
|
||||
// 2 construction d'une cellule 2x2
|
||||
|
||||
@ -2802,7 +2802,7 @@ void CDecor::CelHili(POINT pos, int action)
|
||||
m_celOutline2.x = -1;
|
||||
m_rankHili = -1;
|
||||
|
||||
if ( action == 0 ) // sélection pendant jeu ?
|
||||
if ( action == 0 ) // sélection pendant jeu ?
|
||||
{
|
||||
rank = GetTargetBlupi(pos);
|
||||
if ( rank >= 0 )
|
||||
@ -2852,7 +2852,7 @@ void CDecor::CelHili(POINT pos, int action)
|
||||
m_celOutline1.y = (m_celHili.y/2)*2;
|
||||
GetObject(m_celOutline1, channel, icon);
|
||||
if ( channel == CHOBJECT &&
|
||||
(icon == 14 || // métal ?
|
||||
(icon == 14 || // métal ?
|
||||
icon == 36 || // planches ?
|
||||
icon == 44 || // pierres ?
|
||||
icon == 60 || // tomates ?
|
||||
@ -2863,7 +2863,7 @@ void CDecor::CelHili(POINT pos, int action)
|
||||
icon == 95 || // fleurs ?
|
||||
icon == 85 || // dynamite ?
|
||||
icon == 92 || // poison ?
|
||||
icon == 93 || // piège ?
|
||||
icon == 93 || // piège ?
|
||||
icon == 123 || // fer ?
|
||||
icon == 125 ) ) // mine ?
|
||||
{
|
||||
@ -2896,7 +2896,7 @@ void CDecor::CelHili(POINT pos, int action)
|
||||
}
|
||||
}
|
||||
|
||||
// Marque la cellule visée par la souris pour un bouton donné.
|
||||
// Marque la cellule visée par la souris pour un bouton donné.
|
||||
|
||||
void CDecor::CelHiliButton(POINT cel, int button)
|
||||
{
|
||||
@ -2941,7 +2941,7 @@ void CDecor::CelHiliButton(POINT cel, int button)
|
||||
}
|
||||
}
|
||||
|
||||
// Marque la cellule visée par la souris pour une répétition donnée.
|
||||
// Marque la cellule visée par la souris pour une répétition donnée.
|
||||
|
||||
void CDecor::CelHiliRepeat(int list)
|
||||
{
|
||||
@ -3007,14 +3007,14 @@ void CDecor::CelHiliRepeat(int list)
|
||||
m_celHili = cel;
|
||||
}
|
||||
|
||||
// Retourne l'identificateur du texte correspondant à
|
||||
// l'objet ou au blupi visé par la souris.
|
||||
// Retourne l'identificateur du texte correspondant à
|
||||
// l'objet ou au blupi visé par la souris.
|
||||
|
||||
const char *CDecor::GetResHili(POINT posMouse)
|
||||
{
|
||||
int icon;
|
||||
|
||||
// Les valeurs `corner == true` correspondent aux objets placés
|
||||
// Les valeurs `corner == true` correspondent aux objets placés
|
||||
// au coin inf/droit de la cellule.
|
||||
struct object_t
|
||||
{
|
||||
@ -3213,7 +3213,7 @@ const char *CDecor::GetResHili(POINT posMouse)
|
||||
};
|
||||
|
||||
if (m_bHideTooltips)
|
||||
return nullptr; // rien si menu présent
|
||||
return nullptr; // rien si menu présent
|
||||
|
||||
if ( posMouse.x < POSDRAWX
|
||||
|| posMouse.x > POSDRAWX + DIMDRAWX
|
||||
@ -3223,7 +3223,7 @@ const char *CDecor::GetResHili(POINT posMouse)
|
||||
|
||||
if ( m_celHili.x != -1 )
|
||||
{
|
||||
if ( m_rankHili != -1 ) // blupi visé ?
|
||||
if ( m_rankHili != -1 ) // blupi visé ?
|
||||
{
|
||||
switch (m_blupi[m_rankHili].perso)
|
||||
{
|
||||
@ -3233,7 +3233,7 @@ const char *CDecor::GetResHili(POINT posMouse)
|
||||
if (m_blupi[m_rankHili].bMalade)
|
||||
return gettext ("Sick Blupi");
|
||||
return gettext ("Blupi");
|
||||
case 1: // araignée ?
|
||||
case 1: // araignée ?
|
||||
return gettext ("Spider");
|
||||
case 2: // virus ?
|
||||
return gettext ("Virus");
|
||||
@ -3279,8 +3279,8 @@ const char *CDecor::GetResHili(POINT posMouse)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Indique si le menu est présent et qu'il faut cacher
|
||||
// les tooltips du décor.
|
||||
// Indique si le menu est présent et qu'il faut cacher
|
||||
// les tooltips du décor.
|
||||
|
||||
void CDecor::HideTooltips(bool bHide)
|
||||
{
|
||||
@ -3288,7 +3288,7 @@ void CDecor::HideTooltips(bool bHide)
|
||||
}
|
||||
|
||||
|
||||
// Modifie l'origine supérieure/gauche du décor.
|
||||
// Modifie l'origine supérieure/gauche du décor.
|
||||
|
||||
void CDecor::SetCoin(POINT coin, bool bCenter)
|
||||
{
|
||||
@ -3320,7 +3320,7 @@ POINT CDecor::GetHome()
|
||||
}
|
||||
|
||||
|
||||
// Mémoirise une position pendant le jeu.
|
||||
// Mémoirise une position pendant le jeu.
|
||||
|
||||
void CDecor::MemoPos(int rank, bool bRecord)
|
||||
{
|
||||
@ -3380,7 +3380,7 @@ int CDecor::GetMusic()
|
||||
}
|
||||
|
||||
|
||||
// Gestion de la difficulté.
|
||||
// Gestion de la difficulté.
|
||||
|
||||
void CDecor::SetSkill(int skill)
|
||||
{
|
||||
@ -3393,7 +3393,7 @@ int CDecor::GetSkill()
|
||||
}
|
||||
|
||||
|
||||
// Gestion de la région.
|
||||
// Gestion de la région.
|
||||
// 0 = normal
|
||||
// 1 = palmier
|
||||
// 2 = hiver
|
||||
@ -3436,7 +3436,7 @@ int CDecor::GetInfoHeight()
|
||||
}
|
||||
|
||||
|
||||
// Retourne le pointeur à la liste des boutons existants.
|
||||
// Retourne le pointeur à la liste des boutons existants.
|
||||
|
||||
char* CDecor::GetButtonExist()
|
||||
{
|
||||
@ -3466,11 +3466,11 @@ void CDecor::UndoClose()
|
||||
}
|
||||
}
|
||||
|
||||
// Copie le décor dans le buffer pour le undo.
|
||||
// Copie le décor dans le buffer pour le undo.
|
||||
|
||||
void CDecor::UndoCopy()
|
||||
{
|
||||
UndoOpen(); // ouvre le buffer du undo si nécessaire
|
||||
UndoOpen(); // ouvre le buffer du undo si nécessaire
|
||||
|
||||
if ( m_pUndoDecor != nullptr )
|
||||
{
|
||||
@ -3478,7 +3478,7 @@ void CDecor::UndoCopy()
|
||||
}
|
||||
}
|
||||
|
||||
// Revient en arrière pour tout le décor.
|
||||
// Revient en arrière pour tout le décor.
|
||||
|
||||
void CDecor::UndoBack()
|
||||
{
|
||||
|
100
src/decor.h
100
src/decor.h
@ -21,7 +21,7 @@
|
||||
#define ICON_HILI_BUILD 118
|
||||
#define ICON_HILI_ERR 119
|
||||
|
||||
// Descripteur d'une cellule du décor.
|
||||
// Descripteur d'une cellule du décor.
|
||||
typedef struct
|
||||
{
|
||||
short floorChannel;
|
||||
@ -34,36 +34,36 @@ typedef struct
|
||||
short fire;
|
||||
}
|
||||
Cellule;
|
||||
// Cette structure doit être la plus petite possible, car
|
||||
// Cette structure doit être la plus petite possible, car
|
||||
// il en existe un tableau de 100x100 = 10'000 cellules !
|
||||
|
||||
// Descripteur d'un blupi animé.
|
||||
// Descripteur d'un blupi animé.
|
||||
#define MAXBLUPI 100
|
||||
#define MAXUSED 50
|
||||
#define MAXLIST 10
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int bExist; // true -> utilisé
|
||||
int bHili; // true -> sélectionné
|
||||
int bExist; // true -> utilisé
|
||||
int bHili; // true -> sélectionné
|
||||
|
||||
short perso; // personnage, voir (*)
|
||||
|
||||
short goalAction; // action (long terme)
|
||||
short goalPhase; // phase (long terme)
|
||||
POINT goalCel; // cellule visée (long terme)
|
||||
POINT goalCel; // cellule visée (long terme)
|
||||
POINT passCel; // cellule tranversante
|
||||
|
||||
short energy; // énergie restante
|
||||
short energy; // énergie restante
|
||||
|
||||
POINT cel; // cellule actuelle
|
||||
POINT destCel; // cellule destination
|
||||
short action; // action en cours
|
||||
short aDirect; // direction actuelle
|
||||
short sDirect; // direction souhaitée
|
||||
short sDirect; // direction souhaitée
|
||||
|
||||
POINT pos; // position relative à partir de la cellule
|
||||
short posZ; // déplacement z
|
||||
POINT pos; // position relative à partir de la cellule
|
||||
short posZ; // déplacement z
|
||||
short channel;
|
||||
short lastIcon;
|
||||
short icon;
|
||||
@ -72,12 +72,12 @@ typedef struct
|
||||
short interrupt; // 0=prioritaire, 1=normal, 2=misc
|
||||
short clipLeft;
|
||||
|
||||
int nbUsed; // nb de points déjà visités
|
||||
int nbUsed; // nb de points déjà visités
|
||||
char nextRankUsed;
|
||||
POINT posUsed[MAXUSED];
|
||||
char rankUsed[MAXUSED];
|
||||
|
||||
short takeChannel; // objet transporté
|
||||
short takeChannel; // objet transporté
|
||||
short takeIcon;
|
||||
|
||||
POINT fix; // point fixe (cultive, pont)
|
||||
@ -85,15 +85,15 @@ typedef struct
|
||||
short jaugePhase;
|
||||
short jaugeMax;
|
||||
short stop; // 1 -> devra stopper
|
||||
short bArrow; // true -> flèche en dessus de blupi
|
||||
short bRepeat; // true -> répète l'action
|
||||
short bArrow; // true -> flèche en dessus de blupi
|
||||
short bRepeat; // true -> répète l'action
|
||||
short nLoop; // nb de boucles pour GOAL_OTHERLOOP
|
||||
short cLoop; // boucle en cours
|
||||
short vIcon; // icône variable
|
||||
POINT goalHili; // but visé
|
||||
short vIcon; // icône variable
|
||||
POINT goalHili; // but visé
|
||||
short bMalade; // true -> blupi malade
|
||||
short bCache; // true -> caché (pas dessiné)
|
||||
short vehicule; // véhicule utilisé par blupi, voir (**)
|
||||
short bCache; // true -> caché (pas dessiné)
|
||||
short vehicule; // véhicule utilisé par blupi, voir (**)
|
||||
char busyCount;
|
||||
char busyDelay;
|
||||
char clicCount;
|
||||
@ -110,31 +110,31 @@ Blupi;
|
||||
|
||||
// (*) Personnages :
|
||||
// 0 -> blupi
|
||||
// 1 -> araignée
|
||||
// 1 -> araignée
|
||||
// 2 -> virus
|
||||
// 3 -> tracks
|
||||
// 4 -> robot
|
||||
// 5 -> bombe
|
||||
// 6 -> détonnateur de mine (invisible)
|
||||
// 7 -> électro
|
||||
// 6 -> détonnateur de mine (invisible)
|
||||
// 7 -> électro
|
||||
// 8 -> disciple (robot2)
|
||||
|
||||
// (**) Véhicule :
|
||||
// 0 -> à pied
|
||||
// (**) Véhicule :
|
||||
// 0 -> à pied
|
||||
// 1 -> en bateau
|
||||
// 2 -> en jeep
|
||||
// 3 -> armure
|
||||
|
||||
|
||||
// Descripteur d'un décor animé.
|
||||
// Descripteur d'un décor animé.
|
||||
#define MAXMOVE 100
|
||||
#define MOVEICONNB 1000
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int bExist; // true -> utilisé
|
||||
int bExist; // true -> utilisé
|
||||
|
||||
POINT cel; // cellule du décor
|
||||
POINT cel; // cellule du décor
|
||||
short rankBlupi; // blupi travaillant ici
|
||||
|
||||
int bFloor; // true -> floor, false -> object
|
||||
@ -146,8 +146,8 @@ typedef struct
|
||||
short rankMoves; // *nb,dx,dy,...
|
||||
short rankIcons; // *nb,i,i,...
|
||||
|
||||
short total; // nb total d'étapes
|
||||
short delai; // délai entre deux pas
|
||||
short total; // nb total d'étapes
|
||||
short delai; // délai entre deux pas
|
||||
short stepY; // pas vertical *100
|
||||
|
||||
short cTotal;
|
||||
@ -455,13 +455,13 @@ protected:
|
||||
POINT m_celOutline2;
|
||||
POINT m_shiftOffset;
|
||||
int m_iconHili[4][4];
|
||||
int m_rankHili; // rang du blupi visé
|
||||
int m_rankHili; // rang du blupi visé
|
||||
bool m_bHiliRect;
|
||||
POINT m_p1Hili; // coins rectangle de sélection
|
||||
POINT m_p1Hili; // coins rectangle de sélection
|
||||
POINT m_p2Hili;
|
||||
int m_shiftHili;
|
||||
int m_nbBlupiHili; // nb de blupi sélectionnés
|
||||
int m_rankBlupiHili; // rang blupi sélectionné
|
||||
int m_nbBlupiHili; // nb de blupi sélectionnés
|
||||
int m_rankBlupiHili; // rang blupi sélectionné
|
||||
bool m_bFog; // true -> brouillard (jeu)
|
||||
bool m_bBuild; // true -> construction
|
||||
bool m_bInvincible; // true -> cheat code
|
||||
@ -470,30 +470,30 @@ protected:
|
||||
int m_time; // temps relatif global
|
||||
int m_timeConst; // temps relatif global constant
|
||||
int m_timeFlipOutline; // temps quand basculer mode outline
|
||||
int m_totalTime; // temps total passé sur une partie
|
||||
int m_totalTime; // temps total passé sur une partie
|
||||
int m_phase; // phase pour la carte
|
||||
POINT m_celArrow; // cellule avec flèche
|
||||
POINT m_celArrow; // cellule avec flèche
|
||||
bool m_bOutline;
|
||||
bool m_bGroundRedraw;
|
||||
char m_buttonExist[MAXBUTTON];
|
||||
int m_statNb; // nb de statistiques
|
||||
int m_statFirst; // première statistique visible
|
||||
int m_bStatUp; // flèche up statistique
|
||||
int m_bStatDown; // flèche down statistique
|
||||
int m_statHili; // statistique survolée
|
||||
int m_statFirst; // première statistique visible
|
||||
int m_bStatUp; // flèche up statistique
|
||||
int m_bStatDown; // flèche down statistique
|
||||
int m_statHili; // statistique survolée
|
||||
bool m_bStatRecalc; // true -> recalcule les statistiques
|
||||
bool m_bStatRedraw; // true -> redessine les statistiques
|
||||
int m_nbStatHach; // nb de hachures
|
||||
int m_nbStatHachBlupi; // hachures occupées par blupi
|
||||
int m_nbStatHachPlanche;// hachures occupées par planches
|
||||
int m_nbStatHachTomate; // hachures occupées par tomates
|
||||
int m_nbStatHachMetal; // hachures occupées par métal
|
||||
int m_nbStatHachRobot; // hachures occupées par robot
|
||||
int m_nbStatHachBlupi; // hachures occupées par blupi
|
||||
int m_nbStatHachPlanche;// hachures occupées par planches
|
||||
int m_nbStatHachTomate; // hachures occupées par tomates
|
||||
int m_nbStatHachMetal; // hachures occupées par métal
|
||||
int m_nbStatHachRobot; // hachures occupées par robot
|
||||
int m_nbStatHome; // nb de maisons
|
||||
int m_nbStatHomeBlupi; // maisons occupées par blupi
|
||||
int m_nbStatHomeBlupi; // maisons occupées par blupi
|
||||
int m_nbStatRobots; // nb d'ennemis
|
||||
Term m_term; // conditions pour gagner
|
||||
int m_winCount; // compteur avant gagné
|
||||
int m_winCount; // compteur avant gagné
|
||||
int m_winLastHachBlupi; // dernier nombre atteint
|
||||
int m_winLastHachPlanche;// dernier nombre atteint
|
||||
int m_winLastHachTomate;// dernier nombre atteint
|
||||
@ -502,12 +502,12 @@ protected:
|
||||
int m_winLastHome; // dernier nombre atteint
|
||||
int m_winLastHomeBlupi; // dernier nombre atteint
|
||||
int m_winLastRobots; // dernier nombre atteint
|
||||
int m_music; // numéro musique
|
||||
int m_region; // numéro région (*)
|
||||
int m_lastRegion; // numéro dernière région
|
||||
int m_music; // numéro musique
|
||||
int m_region; // numéro région (*)
|
||||
int m_lastRegion; // numéro dernière région
|
||||
int m_blupiHere;
|
||||
POINT m_lastDrapeau[MAXLASTDRAPEAU];
|
||||
bool m_bHideTooltips; // true -> menu présent
|
||||
bool m_bHideTooltips; // true -> menu présent
|
||||
char m_text[50];
|
||||
POINT m_textLastPos;
|
||||
int m_textCount;
|
||||
@ -529,7 +529,7 @@ protected:
|
||||
char* m_pFillMap;
|
||||
};
|
||||
|
||||
// (*) Régions :
|
||||
// (*) Régions :
|
||||
// 0 -> normal
|
||||
// 1 -> palmier
|
||||
// 2 -> hiver
|
||||
|
@ -25,9 +25,9 @@
|
||||
typedef struct
|
||||
{
|
||||
short bExist;
|
||||
short perso; // -1=objet, -2=feu, -3=flèche
|
||||
short firstIcon; // négatif si sol
|
||||
short lastIcon; // négatif si sol
|
||||
short perso; // -1=objet, -2=feu, -3=flèche
|
||||
short firstIcon; // négatif si sol
|
||||
short lastIcon; // négatif si sol
|
||||
short drawIcon;
|
||||
short bBigIcon;
|
||||
const char *text;
|
||||
@ -50,7 +50,7 @@ static Statistic table_statistic[] =
|
||||
},
|
||||
{ // STATBLUPIf = 1
|
||||
true,
|
||||
0, // blupi fatigué
|
||||
0, // blupi fatigué
|
||||
0,0, //
|
||||
13,
|
||||
false,
|
||||
@ -59,7 +59,7 @@ static Statistic table_statistic[] =
|
||||
},
|
||||
{ // STATBLUPI = 2
|
||||
true,
|
||||
0, // blupi énergique
|
||||
0, // blupi énergique
|
||||
0,0, //
|
||||
14,
|
||||
false,
|
||||
@ -105,7 +105,7 @@ static Statistic table_statistic[] =
|
||||
{ // 7
|
||||
true,
|
||||
-1, // objet
|
||||
93,93, // piège
|
||||
93,93, // piège
|
||||
70,
|
||||
false,
|
||||
translate ("Sticky trap"),
|
||||
@ -240,7 +240,7 @@ static Statistic table_statistic[] =
|
||||
{ // 22
|
||||
true,
|
||||
-1, // objet
|
||||
-80,-84, // téléporteur
|
||||
-80,-84, // téléporteur
|
||||
101,
|
||||
false,
|
||||
translate ("Teleporter"),
|
||||
@ -320,7 +320,7 @@ static Statistic table_statistic[] =
|
||||
},
|
||||
{ // STATARAIGNEE = 31
|
||||
true,
|
||||
1, // araignée
|
||||
1, // araignée
|
||||
0,0, //
|
||||
15,
|
||||
false,
|
||||
@ -338,7 +338,7 @@ static Statistic table_statistic[] =
|
||||
},
|
||||
{ // STATELECTRO = 33
|
||||
true,
|
||||
7, // électro
|
||||
7, // électro
|
||||
0,0, //
|
||||
75,
|
||||
false,
|
||||
@ -358,7 +358,7 @@ static Statistic table_statistic[] =
|
||||
};
|
||||
|
||||
|
||||
// Retourne la statistique correspondant à un rang donné.
|
||||
// Retourne la statistique correspondant à un rang donné.
|
||||
|
||||
Statistic* StatisticGet(int rank)
|
||||
{
|
||||
@ -385,7 +385,7 @@ Statistic* StatisticGet(int rank)
|
||||
|
||||
|
||||
|
||||
// Réinitialise les statistiques.
|
||||
// Réinitialise les statistiques.
|
||||
|
||||
void CDecor::StatisticInit()
|
||||
{
|
||||
@ -408,7 +408,7 @@ void CDecor::StatisticInit()
|
||||
}
|
||||
|
||||
|
||||
// Met à jour tous les compteurs des statistiques.
|
||||
// Met à jour tous les compteurs des statistiques.
|
||||
|
||||
void CDecor::StatisticUpdate()
|
||||
{
|
||||
@ -457,7 +457,7 @@ void CDecor::StatisticUpdate()
|
||||
x = (m_blupi[rank].cel.x/2)*2;
|
||||
y = (m_blupi[rank].cel.y/2)*2;
|
||||
if ( m_decor[x/2][y/2].floorChannel == CHFLOOR &&
|
||||
m_decor[x/2][y/2].floorIcon == 17 ) // dalle hachurée ?
|
||||
m_decor[x/2][y/2].floorIcon == 17 ) // dalle hachurée ?
|
||||
{
|
||||
m_nbStatHachBlupi ++;
|
||||
}
|
||||
@ -478,7 +478,7 @@ void CDecor::StatisticUpdate()
|
||||
x = (m_blupi[rank].cel.x/2)*2;
|
||||
y = (m_blupi[rank].cel.y/2)*2;
|
||||
if ( m_decor[x/2][y/2].floorChannel == CHFLOOR &&
|
||||
m_decor[x/2][y/2].floorIcon == 17 ) // dalle hachurée ?
|
||||
m_decor[x/2][y/2].floorIcon == 17 ) // dalle hachurée ?
|
||||
{
|
||||
m_nbStatHachRobot ++;
|
||||
}
|
||||
@ -491,7 +491,7 @@ void CDecor::StatisticUpdate()
|
||||
m_nbStatRobots ++;
|
||||
}
|
||||
}
|
||||
if ( m_blupi[rank].perso == 1 ) // araignée ?
|
||||
if ( m_blupi[rank].perso == 1 ) // araignée ?
|
||||
{
|
||||
table_statistic[STATARAIGNEE].nb ++;
|
||||
if ( !m_term.bHachRobot ) // pas robot sur hachures ?
|
||||
@ -511,7 +511,7 @@ void CDecor::StatisticUpdate()
|
||||
m_nbStatRobots ++;
|
||||
}
|
||||
}
|
||||
if ( m_blupi[rank].perso == 7 ) // électro ?
|
||||
if ( m_blupi[rank].perso == 7 ) // électro ?
|
||||
{
|
||||
table_statistic[STATELECTRO].nb ++;
|
||||
if ( !m_term.bHachRobot ) // pas robot sur hachures ?
|
||||
@ -528,7 +528,7 @@ void CDecor::StatisticUpdate()
|
||||
{
|
||||
bHach = false;
|
||||
if ( m_decor[x/2][y/2].floorChannel == CHFLOOR &&
|
||||
m_decor[x/2][y/2].floorIcon == 17 ) // dalle hachurée ?
|
||||
m_decor[x/2][y/2].floorIcon == 17 ) // dalle hachurée ?
|
||||
{
|
||||
bHach = true;
|
||||
m_nbStatHach ++;
|
||||
@ -566,7 +566,7 @@ void CDecor::StatisticUpdate()
|
||||
{
|
||||
m_nbStatHachTomate ++;
|
||||
}
|
||||
if ( icon == 14 && bHach ) // métal ?
|
||||
if ( icon == 14 && bHach ) // métal ?
|
||||
{
|
||||
m_nbStatHachMetal ++;
|
||||
}
|
||||
@ -577,7 +577,7 @@ void CDecor::StatisticUpdate()
|
||||
icon = m_decor[x/2][y/2].floorIcon;
|
||||
|
||||
if ( (icon >= 52 && icon <= 56) || // couveuse ?
|
||||
(icon >= 80 && icon <= 84) ) // téléporteur ?
|
||||
(icon >= 80 && icon <= 84) ) // téléporteur ?
|
||||
{
|
||||
pStatistic = table_statistic;
|
||||
while ( pStatistic->bExist )
|
||||
@ -621,7 +621,7 @@ void CDecor::StatisticUpdate()
|
||||
}
|
||||
else
|
||||
{
|
||||
// nb <- nb de pages nécessaires
|
||||
// nb <- nb de pages nécessaires
|
||||
nb = (m_statNb+STATNB-5)/(STATNB-2);
|
||||
|
||||
m_bStatUp = true;
|
||||
@ -637,7 +637,7 @@ void CDecor::StatisticUpdate()
|
||||
}
|
||||
}
|
||||
|
||||
m_bStatRecalc = false; // c'est calculé
|
||||
m_bStatRecalc = false; // c'est calculé
|
||||
m_bStatRedraw = true; // faudra tout redessiner
|
||||
}
|
||||
|
||||
@ -700,28 +700,28 @@ void CDecor::StatisticDraw()
|
||||
|
||||
if ( rank == 0 && m_bStatUp )
|
||||
{
|
||||
icon = 6+66; // flèche up
|
||||
if ( rank == m_statHili ) // statistique survolée ?
|
||||
icon = 6+66; // flèche up
|
||||
if ( rank == m_statHili ) // statistique survolée ?
|
||||
{
|
||||
icon ++;
|
||||
}
|
||||
pos.x -= 3;
|
||||
pos.y -= 5;
|
||||
if ( pStatistic->drawIcon == 68 ) pos.x += 26;
|
||||
m_pPixmap->DrawIcon(-1, CHBUTTON, icon, pos); // flèche up
|
||||
m_pPixmap->DrawIcon(-1, CHBUTTON, icon, pos); // flèche up
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( rank == STATNB-1 && m_bStatDown )
|
||||
{
|
||||
icon = 6+68; // flèche down
|
||||
if ( rank == m_statHili ) // statistique survolée ?
|
||||
icon = 6+68; // flèche down
|
||||
if ( rank == m_statHili ) // statistique survolée ?
|
||||
{
|
||||
icon ++;
|
||||
}
|
||||
pos.x += 23;
|
||||
pos.y -= 5;
|
||||
m_pPixmap->DrawIcon(-1, CHBUTTON, icon, pos); // flèche down
|
||||
m_pPixmap->DrawIcon(-1, CHBUTTON, icon, pos); // flèche down
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -729,7 +729,7 @@ void CDecor::StatisticDraw()
|
||||
|
||||
icon = 6+pStatistic->drawIcon;
|
||||
|
||||
if ( rank == m_statHili ) // statistique survolée ?
|
||||
if ( rank == m_statHili ) // statistique survolée ?
|
||||
{
|
||||
m_pPixmap->DrawIconDemi(-1, CHBLUPI, ICON_HILI_STAT, pos);
|
||||
textRes = gettext (pStatistic->text);
|
||||
@ -764,7 +764,7 @@ void CDecor::StatisticDraw()
|
||||
if ( m_statHili == 102 ) textRes = gettext ("Save");
|
||||
}
|
||||
|
||||
// Dessine le nom de la statistique survolée.
|
||||
// Dessine le nom de la statistique survolée.
|
||||
pos.x = 0;
|
||||
pos.y = 404;
|
||||
rect.left = pos.x;
|
||||
@ -780,10 +780,10 @@ void CDecor::StatisticDraw()
|
||||
DrawText(m_pPixmap, pos, textRes);
|
||||
}
|
||||
|
||||
m_bStatRedraw = false; // dessin plus nécessaire
|
||||
m_bStatRedraw = false; // dessin plus nécessaire
|
||||
}
|
||||
|
||||
// Génère les statistiques.
|
||||
// Génère les statistiques.
|
||||
|
||||
void CDecor::GenerateStatictic()
|
||||
{
|
||||
@ -791,7 +791,7 @@ void CDecor::GenerateStatictic()
|
||||
|
||||
if ( m_bStatRecalc || m_phase%20 == 10 )
|
||||
{
|
||||
StatisticUpdate(); // met à jour les compteurs
|
||||
StatisticUpdate(); // met à jour les compteurs
|
||||
}
|
||||
|
||||
if ( m_bStatRedraw )
|
||||
@ -801,7 +801,7 @@ void CDecor::GenerateStatictic()
|
||||
}
|
||||
|
||||
|
||||
// Bouton pressé dans les statistiques.
|
||||
// Bouton pressé dans les statistiques.
|
||||
|
||||
bool CDecor::StatisticDown(POINT pos)
|
||||
{
|
||||
@ -814,7 +814,7 @@ bool CDecor::StatisticDown(POINT pos)
|
||||
hili = StatisticDetect(pos);
|
||||
if ( hili < 0 ) return false;
|
||||
|
||||
if ( m_bStatUp && hili == 0 ) // flèche up ?
|
||||
if ( m_bStatUp && hili == 0 ) // flèche up ?
|
||||
{
|
||||
m_statFirst -= STATNB-2;
|
||||
if ( m_statFirst < STATNB-1 )
|
||||
@ -828,7 +828,7 @@ bool CDecor::StatisticDown(POINT pos)
|
||||
return true;
|
||||
}
|
||||
|
||||
if ( m_bStatDown && hili == STATNB-1 ) // flèche down ?
|
||||
if ( m_bStatDown && hili == STATNB-1 ) // flèche down ?
|
||||
{
|
||||
if ( m_statFirst == 0 )
|
||||
{
|
||||
@ -853,7 +853,7 @@ bool CDecor::StatisticDown(POINT pos)
|
||||
show = pStatistic->lastShow % pStatistic->nb;
|
||||
pStatistic->lastShow ++;
|
||||
|
||||
if ( pStatistic->perso >= 0 ) // blupi/araignée ?
|
||||
if ( pStatistic->perso >= 0 ) // blupi/araignée ?
|
||||
{
|
||||
for ( rank=0 ; rank<MAXBLUPI ; rank++ )
|
||||
{
|
||||
@ -867,9 +867,9 @@ bool CDecor::StatisticDown(POINT pos)
|
||||
pStatistic->drawIcon == 76) || // malade ?
|
||||
(!m_blupi[rank].bMalade &&
|
||||
m_blupi[rank].energy <= MAXENERGY/4 &&
|
||||
pStatistic->drawIcon == 13) || // fatigué ?
|
||||
pStatistic->drawIcon == 13) || // fatigué ?
|
||||
(m_blupi[rank].energy > MAXENERGY/4 &&
|
||||
pStatistic->drawIcon == 14) ) // énergique ?
|
||||
pStatistic->drawIcon == 14) ) // énergique ?
|
||||
{
|
||||
if ( show == 0 )
|
||||
{
|
||||
@ -878,7 +878,7 @@ bool CDecor::StatisticDown(POINT pos)
|
||||
{
|
||||
BlupiDeselect();
|
||||
m_blupi[rank].bHili = true;
|
||||
m_rankBlupiHili = rank; // sélectionne
|
||||
m_rankBlupiHili = rank; // sélectionne
|
||||
m_nbBlupiHili = 1;
|
||||
}
|
||||
BlupiSetArrow(rank, true);
|
||||
@ -910,7 +910,7 @@ bool CDecor::StatisticDown(POINT pos)
|
||||
cel = GetCel(x,y);
|
||||
if ( pStatistic->bBigIcon )
|
||||
{
|
||||
// Flèche plus haute.
|
||||
// Flèche plus haute.
|
||||
m_celArrow = GetCel(cel,-2,-2);
|
||||
}
|
||||
else
|
||||
@ -945,7 +945,7 @@ bool CDecor::StatisticDown(POINT pos)
|
||||
cel = GetCel(x,y);
|
||||
if ( pStatistic->bBigIcon )
|
||||
{
|
||||
// Flèche plus haute.
|
||||
// Flèche plus haute.
|
||||
m_celArrow = GetCel(cel,-2,-2);
|
||||
}
|
||||
else
|
||||
@ -990,7 +990,7 @@ bool CDecor::StatisticDown(POINT pos)
|
||||
return true;
|
||||
}
|
||||
|
||||
// Souris déplacée dans les statistiques.
|
||||
// Souris déplacée dans les statistiques.
|
||||
|
||||
bool CDecor::StatisticMove(POINT pos)
|
||||
{
|
||||
@ -998,7 +998,7 @@ bool CDecor::StatisticMove(POINT pos)
|
||||
|
||||
rank = StatisticDetect(pos);
|
||||
|
||||
if ( rank != m_statHili ) // autre mise en évidence ?
|
||||
if ( rank != m_statHili ) // autre mise en évidence ?
|
||||
{
|
||||
m_statHili = rank;
|
||||
m_bStatRedraw = true; // faudra tout redessiner
|
||||
@ -1007,14 +1007,14 @@ bool CDecor::StatisticMove(POINT pos)
|
||||
return false;
|
||||
}
|
||||
|
||||
// Bouton relâché dans les statistiques.
|
||||
// Bouton relâché dans les statistiques.
|
||||
|
||||
bool CDecor::StatisticUp(POINT pos)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Détecte dans quelle statistique est la souris.
|
||||
// Détecte dans quelle statistique est la souris.
|
||||
|
||||
int CDecor::StatisticDetect(POINT pos)
|
||||
{
|
||||
|
106
src/def.h
106
src/def.h
@ -6,7 +6,7 @@
|
||||
#define _INTRO false // true si images d'introduction
|
||||
|
||||
|
||||
#define LXIMAGE 640 // dimensions de la fenêtre de jeu
|
||||
#define LXIMAGE 640 // dimensions de la fenêtre de jeu
|
||||
#define LYIMAGE 480
|
||||
|
||||
#define POSDRAWX 144 // surface de dessin
|
||||
@ -22,7 +22,7 @@
|
||||
#define MAXCELX 200 // nb max de cellules d'un monde
|
||||
#define MAXCELY 200
|
||||
|
||||
#define DIMCELX 60 // dimensions d'une cellule (décor)
|
||||
#define DIMCELX 60 // dimensions d'une cellule (décor)
|
||||
#define DIMCELY 30
|
||||
|
||||
#define DIMOBJX 120 // dimensions d'un objet
|
||||
@ -30,7 +30,7 @@
|
||||
|
||||
#define DIMBLUPIX 60 // dimensions de blupi
|
||||
#define DIMBLUPIY 60
|
||||
#define SHIFTBLUPIY 5 // petit décalage vers le haut
|
||||
#define SHIFTBLUPIY 5 // petit décalage vers le haut
|
||||
|
||||
#define DIMBUTTONX 40 // dimensions d'un button
|
||||
#define DIMBUTTONY 40
|
||||
@ -43,10 +43,10 @@
|
||||
#define DIMSTATX 60
|
||||
#define DIMSTATY 30
|
||||
|
||||
#define DIMTEXTX 16 // dimensions max d'un caractère
|
||||
#define DIMTEXTX 16 // dimensions max d'un caractère
|
||||
#define DIMTEXTY 16
|
||||
|
||||
#define DIMLITTLEX 16 // dimensions max d'un petit caractère
|
||||
#define DIMLITTLEX 16 // dimensions max d'un petit caractère
|
||||
#define DIMLITTLEY 12
|
||||
|
||||
#define CHBACK 0
|
||||
@ -95,15 +95,15 @@
|
||||
|
||||
// Actions :
|
||||
|
||||
#define ACTION_STOP 0 // arrêt
|
||||
#define ACTION_STOPf 1 // arrêt fatigué
|
||||
#define ACTION_STOP 0 // arrêt
|
||||
#define ACTION_STOPf 1 // arrêt fatigué
|
||||
#define ACTION_MARCHE 2 // marche
|
||||
#define ACTION_MARCHEf 3 // marche fatigué
|
||||
#define ACTION_MARCHEf 3 // marche fatigué
|
||||
#define ACTION_BUILD 4 // construit
|
||||
#define ACTION_PIOCHE 5 // pioche
|
||||
#define ACTION_ENERGY 6 // prend de l'énergie
|
||||
#define ACTION_TAKE 8 // fait sauter un objet sur la tête (est)
|
||||
#define ACTION_DEPOSE 9 // repose l'objet sur la tête (est)
|
||||
#define ACTION_ENERGY 6 // prend de l'énergie
|
||||
#define ACTION_TAKE 8 // fait sauter un objet sur la tête (est)
|
||||
#define ACTION_DEPOSE 9 // repose l'objet sur la tête (est)
|
||||
#define ACTION_SCIE 10 // scie du bois
|
||||
#define ACTION_BRULE 11 // blupi crame !
|
||||
#define ACTION_TCHAO 12 // blupi disparait !
|
||||
@ -114,30 +114,30 @@
|
||||
#define ACTION_SAUTE4 17 // saute par-dessus un obstacle
|
||||
#define ACTION_SAUTE5 18 // saute par-dessus un obstacle
|
||||
#define ACTION_PONT 19 // pousse un pont
|
||||
#define ACTION_MISC1 20 // divers 1 (hausse les épaules)
|
||||
#define ACTION_MISC1 20 // divers 1 (hausse les épaules)
|
||||
#define ACTION_MISC2 21 // divers 2 (grat-grat)
|
||||
#define ACTION_MISC3 22 // divers 3 (yoyo)
|
||||
#define ACTION_MISC1f 23 // divers 1 fatigué (bof-bof)
|
||||
#define ACTION_MISC1f 23 // divers 1 fatigué (bof-bof)
|
||||
#define ACTION_GLISSE 24 // glisse en marchant
|
||||
#define ACTION_BOIT 25 // blupi boit
|
||||
#define ACTION_LABO 26 // blupi travaille dans son laboratoire
|
||||
#define ACTION_DYNAMITE 27 // blupi fait péter la dynamite
|
||||
#define ACTION_DYNAMITE 27 // blupi fait péter la dynamite
|
||||
#define ACTION_DELAY 28 // blupi attend un frame
|
||||
#define ACTION_CUEILLE1 29 // blupi cueille des fleurs
|
||||
#define ACTION_CUEILLE2 30 // blupi cueille des fleurs
|
||||
#define ACTION_MECHE 31 // blupi se bouche les oreilles
|
||||
#define ACTION_STOPb 32 // arrêt en bateau
|
||||
#define ACTION_STOPb 32 // arrêt en bateau
|
||||
#define ACTION_MARCHEb 33 // avance en bateau
|
||||
#define ACTION_STOPj 34 // arrêt en jeep
|
||||
#define ACTION_STOPj 34 // arrêt en jeep
|
||||
#define ACTION_MARCHEj 35 // avance en jeep
|
||||
#define ACTION_ELECTRO 36 // blupi électrocuté
|
||||
#define ACTION_ELECTRO 36 // blupi électrocuté
|
||||
#define ACTION_GRILLE1 37 // blupi grille (phase 1)
|
||||
#define ACTION_GRILLE2 38 // blupi grille (phase 2)
|
||||
#define ACTION_GRILLE3 39 // blupi grille (phase 3)
|
||||
#define ACTION_MISC4 40 // divers 4 (ferme les yeux)
|
||||
#define ACTION_CONTENT 41 // blupi est content
|
||||
#define ACTION_ARROSE 42 // blupi arrose
|
||||
#define ACTION_BECHE 43 // blupi bèche
|
||||
#define ACTION_BECHE 43 // blupi bèche
|
||||
#define ACTION_CUEILLE3 44 // blupi cueille des fleurs
|
||||
#define ACTION_BUILDBREF 45 // construit
|
||||
#define ACTION_BUILDSEC 46 // construit
|
||||
@ -145,53 +145,53 @@
|
||||
#define ACTION_BUILDPIERRE 48 // construit
|
||||
#define ACTION_PIOCHEPIERRE 49 // pioche
|
||||
#define ACTION_PIOCHESOURD 50 // pioche
|
||||
#define ACTION_MISC5 51 // divers 5 (ohé)
|
||||
#define ACTION_TELEPORTE1 52 // téléporte
|
||||
#define ACTION_TELEPORTE2 53 // téléporte
|
||||
#define ACTION_TELEPORTE3 54 // téléporte
|
||||
#define ACTION_STOPa 55 // arrêt armure
|
||||
#define ACTION_MISC5 51 // divers 5 (ohé)
|
||||
#define ACTION_TELEPORTE1 52 // téléporte
|
||||
#define ACTION_TELEPORTE2 53 // téléporte
|
||||
#define ACTION_TELEPORTE3 54 // téléporte
|
||||
#define ACTION_STOPa 55 // arrêt armure
|
||||
#define ACTION_MARCHEa 56 // marche armure
|
||||
#define ACTION_ARMUREOPEN 57 // ouvre armure
|
||||
#define ACTION_ARMURECLOSE 58 // ferme armure
|
||||
#define ACTION_SAUTE1 59 // saute dans la jeep
|
||||
#define ACTION_MISC6 60 // divers 6 (diabolo)
|
||||
|
||||
#define ACTION_A_STOP 100 // araignée: arrêt
|
||||
#define ACTION_A_MARCHE 101 // araignée: marche
|
||||
#define ACTION_A_SAUT 102 // araignée: saute
|
||||
#define ACTION_A_GRILLE 103 // araignée: grille dans rayon
|
||||
#define ACTION_A_POISON 105 // araignée: empoisonée
|
||||
#define ACTION_A_MORT1 106 // araignée: meurt
|
||||
#define ACTION_A_MORT2 107 // araignée: meurt
|
||||
#define ACTION_A_MORT3 108 // araignée: meurt
|
||||
#define ACTION_A_STOP 100 // araignée: arrêt
|
||||
#define ACTION_A_MARCHE 101 // araignée: marche
|
||||
#define ACTION_A_SAUT 102 // araignée: saute
|
||||
#define ACTION_A_GRILLE 103 // araignée: grille dans rayon
|
||||
#define ACTION_A_POISON 105 // araignée: empoisonée
|
||||
#define ACTION_A_MORT1 106 // araignée: meurt
|
||||
#define ACTION_A_MORT2 107 // araignée: meurt
|
||||
#define ACTION_A_MORT3 108 // araignée: meurt
|
||||
|
||||
#define ACTION_V_STOP 200 // virus: arrêt
|
||||
#define ACTION_V_STOP 200 // virus: arrêt
|
||||
#define ACTION_V_MARCHE 201 // virus: marche
|
||||
#define ACTION_V_GRILLE 202 // virus: grille dans rayon
|
||||
|
||||
#define ACTION_T_STOP 300 // tracks: arrêt
|
||||
#define ACTION_T_STOP 300 // tracks: arrêt
|
||||
#define ACTION_T_MARCHE 301 // tracks: marche
|
||||
#define ACTION_T_ECRASE 302 // tracks: écrase un objet
|
||||
#define ACTION_T_ECRASE 302 // tracks: écrase un objet
|
||||
|
||||
#define ACTION_R_STOP 400 // robot: arrêt
|
||||
#define ACTION_R_STOP 400 // robot: arrêt
|
||||
#define ACTION_R_MARCHE 401 // robot: marche
|
||||
#define ACTION_R_APLAT 402 // robot: applatit
|
||||
#define ACTION_R_BUILD 403 // robot: construit
|
||||
#define ACTION_R_DELAY 404 // robot: construit
|
||||
#define ACTION_R_CHARGE 405 // robot: recharge
|
||||
#define ACTION_R_ECRASE 406 // robot: écrase un objet
|
||||
#define ACTION_R_ECRASE 406 // robot: écrase un objet
|
||||
|
||||
#define ACTION_B_STOP 500 // bombe: arrêt
|
||||
#define ACTION_B_STOP 500 // bombe: arrêt
|
||||
#define ACTION_B_MARCHE 501 // bombe: marche
|
||||
|
||||
#define ACTION_D_DELAY 600 // détonnateur: attend
|
||||
#define ACTION_D_DELAY 600 // détonnateur: attend
|
||||
|
||||
#define ACTION_E_STOP 700 // électro: arrêt
|
||||
#define ACTION_E_MARCHE 701 // électro: marche
|
||||
#define ACTION_E_DEBUT 702 // électro: débute
|
||||
#define ACTION_E_RAYON 703 // électro: rayonne
|
||||
#define ACTION_E_STOP 700 // électro: arrêt
|
||||
#define ACTION_E_MARCHE 701 // électro: marche
|
||||
#define ACTION_E_DEBUT 702 // électro: débute
|
||||
#define ACTION_E_RAYON 703 // électro: rayonne
|
||||
|
||||
#define ACTION_D_STOP 800 // disciple: arrêt
|
||||
#define ACTION_D_STOP 800 // disciple: arrêt
|
||||
#define ACTION_D_MARCHE 801 // disciple: marche
|
||||
#define ACTION_D_BUILD 802 // disciple: construit
|
||||
#define ACTION_D_PIOCHE 803 // disciple: pioche
|
||||
@ -201,7 +201,7 @@
|
||||
#define ACTION_D_CUEILLE2 807 // disciple: cueille des fleurs
|
||||
#define ACTION_D_MECHE 808 // disciple: se bouche les oreilles
|
||||
#define ACTION_D_ARROSE 809 // disciple: arrose
|
||||
#define ACTION_D_BECHE 810 // disciple: bèche
|
||||
#define ACTION_D_BECHE 810 // disciple: bèche
|
||||
|
||||
|
||||
// Sons :
|
||||
@ -603,16 +603,16 @@ enum MouseSprites
|
||||
|
||||
typedef struct
|
||||
{
|
||||
short bHachBlupi; // blupi sur dalle hachurée
|
||||
short bHachPlanche; // planches sur dalle hachurée
|
||||
short bStopFire; // feu éteint
|
||||
short nbMinBlupi; // nb de blupi nécessaires
|
||||
short nbMaxBlupi; // nb de blupi nécessaires
|
||||
short bHomeBlupi; // blupi à la maison
|
||||
short bHachBlupi; // blupi sur dalle hachurée
|
||||
short bHachPlanche; // planches sur dalle hachurée
|
||||
short bStopFire; // feu éteint
|
||||
short nbMinBlupi; // nb de blupi nécessaires
|
||||
short nbMaxBlupi; // nb de blupi nécessaires
|
||||
short bHomeBlupi; // blupi à la maison
|
||||
short bKillRobots; // plus d'ennemis
|
||||
short bHachTomate; // tomates sur dalle hachurée
|
||||
short bHachMetal; // métal sur dalle hachurée
|
||||
short bHachRobot; // robot sur dalle hachurée
|
||||
short bHachTomate; // tomates sur dalle hachurée
|
||||
short bHachMetal; // métal sur dalle hachurée
|
||||
short bHachRobot; // robot sur dalle hachurée
|
||||
short reserve[14];
|
||||
}
|
||||
Term;
|
||||
|
232
src/event.cpp
232
src/event.cpp
@ -41,7 +41,7 @@ typedef struct
|
||||
short mission; // mission en cours (0..n)
|
||||
short speed;
|
||||
short bMovie;
|
||||
short maxMission; // dernière mission effectuée (0..n)
|
||||
short maxMission; // dernière mission effectuée (0..n)
|
||||
short scrollSpeed;
|
||||
short audioVolume;
|
||||
short midiVolume;
|
||||
@ -54,8 +54,8 @@ DescInfo;
|
||||
|
||||
|
||||
|
||||
// Toutes les premières lettres doivent
|
||||
// être différentes !
|
||||
// Toutes les premières lettres doivent
|
||||
// être différentes !
|
||||
|
||||
static char cheat_code[9][20] =
|
||||
{
|
||||
@ -960,7 +960,7 @@ static Phase table[] =
|
||||
{ translate ("Drop") },
|
||||
},
|
||||
{
|
||||
WM_BUTTON32, // répète
|
||||
WM_BUTTON32, // répète
|
||||
0, {1,100},
|
||||
170+42*6, 30+52*0,
|
||||
{ translate ("Repeat") },
|
||||
@ -1028,7 +1028,7 @@ static Phase table[] =
|
||||
{ translate ("Boat") },
|
||||
},
|
||||
{
|
||||
WM_BUTTON13, // build6 (téléporteur)
|
||||
WM_BUTTON13, // build6 (téléporteur)
|
||||
0, {1,101},
|
||||
170+42*4, 30+52*2,
|
||||
{ translate ("Teleporter") },
|
||||
@ -1192,7 +1192,7 @@ static Phase table[] =
|
||||
{ translate ("Tomatoes on striped paving stones") },
|
||||
},
|
||||
{
|
||||
WM_BUTTON11, // hach métal
|
||||
WM_BUTTON11, // hach métal
|
||||
0, {1,84},
|
||||
170+42*3, 30+42*2,
|
||||
{ translate ("Platinium on striped paving stones") },
|
||||
@ -1548,7 +1548,7 @@ void CEvent::SetMouseType(int mouseType)
|
||||
m_mouseType = mouseType;
|
||||
}
|
||||
|
||||
// Crée le gestionnaire d'événements.
|
||||
// Crée le gestionnaire d'événements.
|
||||
|
||||
void CEvent::Create(CPixmap *pPixmap, CDecor *pDecor,
|
||||
CSound *pSound, CMovie *pMovie)
|
||||
@ -1671,7 +1671,7 @@ void CEvent::SetMenu(int button, int menu)
|
||||
|
||||
|
||||
|
||||
// Restitue le jeu après une activation en mode fullScreen.
|
||||
// Restitue le jeu après une activation en mode fullScreen.
|
||||
|
||||
void CEvent::RestoreGame()
|
||||
{
|
||||
@ -1698,7 +1698,7 @@ void CEvent::RestoreGame()
|
||||
}
|
||||
|
||||
|
||||
// Crée tous les boutons nécessaires à la phase en cours.
|
||||
// Crée tous les boutons nécessaires à la phase en cours.
|
||||
|
||||
bool CEvent::CreateButtons()
|
||||
{
|
||||
@ -1764,7 +1764,7 @@ void AddCheatCode(char *pDst, char *pSrc)
|
||||
pDst[j] = 0;
|
||||
}
|
||||
|
||||
// Dessine un texte multi-lignes centré.
|
||||
// Dessine un texte multi-lignes centré.
|
||||
|
||||
void CEvent::DrawTextCenter(const char *text, int x, int y, int font)
|
||||
{
|
||||
@ -1948,11 +1948,11 @@ bool CEvent::DrawButtons()
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( m_bDemoRec ) // démo en enregistrement ?
|
||||
if ( m_bDemoRec ) // démo en enregistrement ?
|
||||
{
|
||||
DrawTextCenter(gettext ("REC"), (10+134)/2, 20, FONTRED);
|
||||
}
|
||||
if ( m_bDemoPlay ) // démo en restitution ?
|
||||
if ( m_bDemoPlay ) // démo en restitution ?
|
||||
{
|
||||
DrawTextCenter(gettext ("Demo"), (10+134)/2, 20, FONTRED);
|
||||
}
|
||||
@ -2026,7 +2026,7 @@ bool CEvent::DrawButtons()
|
||||
m_pPixmap->DrawIcon(-1, CHBUTTON, icon, m_posHelpButton);
|
||||
}
|
||||
}
|
||||
else // infos cachées ?
|
||||
else // infos cachées ?
|
||||
{
|
||||
pos.x = POSDRAWX+DIMDRAWX/2-DIMBUTTONX/2;
|
||||
pos.y = -12;
|
||||
@ -2078,7 +2078,7 @@ bool CEvent::DrawButtons()
|
||||
}
|
||||
}
|
||||
|
||||
// Dessine les réglages pour la fin de la partie.
|
||||
// Dessine les réglages pour la fin de la partie.
|
||||
if ( m_phase == WM_PHASE_TERM )
|
||||
{
|
||||
Term* pTerm = m_pDecor->GetTerminated();
|
||||
@ -2108,13 +2108,13 @@ bool CEvent::DrawButtons()
|
||||
DrawTextCenter(gettext ("Music choice"), (10+134)/2, 20);
|
||||
}
|
||||
|
||||
// Dessine les textes pour le choix de la région.
|
||||
// Dessine les textes pour le choix de la région.
|
||||
if ( m_phase == WM_PHASE_REGION )
|
||||
{
|
||||
DrawTextCenter(gettext ("Scenery choice"), (10+134)/2, 20);
|
||||
}
|
||||
|
||||
// Ajoute "Mission numéro".
|
||||
// Ajoute "Mission numéro".
|
||||
if ( m_phase == WM_PHASE_INFO )
|
||||
{
|
||||
if (m_bSchool)
|
||||
@ -2147,7 +2147,7 @@ bool CEvent::DrawButtons()
|
||||
DrawText(m_pPixmap, pos, text, FONTRED);
|
||||
}
|
||||
|
||||
// Ajoute le texte "Informations complémentaires".
|
||||
// Ajoute le texte "Informations complémentaires".
|
||||
if ( m_phase == WM_PHASE_HELP )
|
||||
{
|
||||
char *text = gettext ("Help number");
|
||||
@ -2160,7 +2160,7 @@ bool CEvent::DrawButtons()
|
||||
DrawText(m_pPixmap, pos, text, FONTRED);
|
||||
}
|
||||
|
||||
// Ajoute le numéro du monde.
|
||||
// Ajoute le numéro du monde.
|
||||
if ( m_phase == WM_PHASE_INFO ||
|
||||
m_phase == WM_PHASE_STOP ||
|
||||
m_phase == WM_PHASE_HELP )
|
||||
@ -2215,7 +2215,7 @@ bool CEvent::DrawButtons()
|
||||
}
|
||||
}
|
||||
|
||||
// Affiche le libellé de l'énigme.
|
||||
// Affiche le libellé de l'énigme.
|
||||
if ( m_phase == WM_PHASE_INFO ||
|
||||
m_phase == WM_PHASE_STOP ||
|
||||
m_phase == WM_PHASE_HELP ||
|
||||
@ -2235,7 +2235,7 @@ bool CEvent::DrawButtons()
|
||||
DrawTextRect(m_pPixmap, pos, m_libelle, pente, FONTSLIM);
|
||||
}
|
||||
|
||||
// Affiche le texte lorsque c'est raté.
|
||||
// Affiche le texte lorsque c'est raté.
|
||||
if ( m_phase == WM_PHASE_LOST )
|
||||
{
|
||||
static char *list[] = {
|
||||
@ -2251,7 +2251,7 @@ bool CEvent::DrawButtons()
|
||||
DrawText(m_pPixmap, pos, list[GetWorld () % 5]);
|
||||
}
|
||||
|
||||
// Affiche le texte lorsque c'est réussi.
|
||||
// Affiche le texte lorsque c'est réussi.
|
||||
if ( m_phase == WM_PHASE_WIN )
|
||||
{
|
||||
static char *list[] = {
|
||||
@ -2284,7 +2284,7 @@ bool CEvent::DrawButtons()
|
||||
DrawText(m_pPixmap, pos, text);
|
||||
}
|
||||
|
||||
// Dessine les réglages.
|
||||
// Dessine les réglages.
|
||||
if ( m_phase == WM_PHASE_SETUP ||
|
||||
m_phase == WM_PHASE_SETUPp )
|
||||
{
|
||||
@ -2364,7 +2364,7 @@ bool CEvent::DrawButtons()
|
||||
DrawText(m_pPixmap, pos, text);
|
||||
}
|
||||
|
||||
// Affiche le texte lorsqu'il faut insérer le CD-Rom.
|
||||
// Affiche le texte lorsqu'il faut insérer le CD-Rom.
|
||||
if ( m_phase == WM_PHASE_INSERT )
|
||||
{
|
||||
DrawTextCenter(gettext ("Insert CD-Rom Planet Blupi and wait a few seconds..."), LXIMAGE/2, 20);
|
||||
@ -2384,7 +2384,7 @@ bool CEvent::DrawButtons()
|
||||
return true;
|
||||
}
|
||||
|
||||
// Retourne le lutin à utiliser à une position donnée.
|
||||
// Retourne le lutin à utiliser à une position donnée.
|
||||
|
||||
MouseSprites CEvent::MousePosToSprite(POINT pos)
|
||||
{
|
||||
@ -2454,17 +2454,17 @@ MouseSprites CEvent::MousePosToSprite(POINT pos)
|
||||
}
|
||||
}
|
||||
|
||||
if ( m_bFillMouse && // bidon présent ?
|
||||
if ( m_bFillMouse && // bidon présent ?
|
||||
pos.x >= POSDRAWX && pos.x <= POSDRAWX+DIMDRAWX &&
|
||||
pos.y >= POSDRAWY && pos.y <= POSDRAWY+DIMDRAWY )
|
||||
{
|
||||
sprite = SPRITE_FILL;
|
||||
}
|
||||
if ( m_bWaitMouse ) // sablier présent ?
|
||||
if ( m_bWaitMouse ) // sablier présent ?
|
||||
{
|
||||
sprite = SPRITE_WAIT;
|
||||
}
|
||||
if ( m_bHideMouse ) // souris cachée ?
|
||||
if ( m_bHideMouse ) // souris cachée ?
|
||||
{
|
||||
sprite = SPRITE_EMPTY;
|
||||
}
|
||||
@ -2472,7 +2472,7 @@ MouseSprites CEvent::MousePosToSprite(POINT pos)
|
||||
return sprite;
|
||||
}
|
||||
|
||||
// Gère le lutin de la souris.
|
||||
// Gère le lutin de la souris.
|
||||
|
||||
void CEvent::MouseSprite(POINT pos)
|
||||
{
|
||||
@ -2480,7 +2480,7 @@ void CEvent::MouseSprite(POINT pos)
|
||||
m_pPixmap->ChangeSprite(m_mouseSprite);
|
||||
}
|
||||
|
||||
// Met ou enlève le sablier de la souris.
|
||||
// Met ou enlève le sablier de la souris.
|
||||
|
||||
void CEvent::WaitMouse(bool bWait)
|
||||
{
|
||||
@ -2516,14 +2516,14 @@ void CEvent::HideMouse(bool bHide)
|
||||
m_pPixmap->ChangeSprite(m_mouseSprite);
|
||||
}
|
||||
|
||||
// Traite les événements pour tous les boutons.
|
||||
// Traite les événements pour tous les boutons.
|
||||
|
||||
bool CEvent::EventButtons(const SDL_Event &event, POINT pos)
|
||||
{
|
||||
POINT test;
|
||||
int lg, oldx, sound;
|
||||
|
||||
// Cherche le tool tips à utiliser pour la souris.
|
||||
// Cherche le tool tips à utiliser pour la souris.
|
||||
m_textToolTips[0] = 0;
|
||||
oldx = m_posToolTips.x;
|
||||
m_posToolTips.x = -1;
|
||||
@ -2649,7 +2649,7 @@ bool CEvent::EventButtons(const SDL_Event &event, POINT pos)
|
||||
&& ( event.button.button == SDL_BUTTON_LEFT
|
||||
|| event.button.button == SDL_BUTTON_RIGHT))
|
||||
{
|
||||
m_pDecor->HideTooltips(true); // plus de tooltips pour décor
|
||||
m_pDecor->HideTooltips(true); // plus de tooltips pour décor
|
||||
}
|
||||
if (event.type == SDL_MOUSEBUTTONUP
|
||||
&& ( event.button.button == SDL_BUTTON_LEFT
|
||||
@ -2693,7 +2693,7 @@ bool CEvent::MouseOnButton(POINT pos)
|
||||
}
|
||||
|
||||
|
||||
// Retourne l'index dans table pour une phase donnée.
|
||||
// Retourne l'index dans table pour une phase donnée.
|
||||
|
||||
int CEvent::SearchPhase(unsigned int phase)
|
||||
{
|
||||
@ -2708,7 +2708,7 @@ int CEvent::SearchPhase(unsigned int phase)
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Donne le numéro du monde.
|
||||
// Donne le numéro du monde.
|
||||
|
||||
int CEvent::GetWorld()
|
||||
{
|
||||
@ -2717,7 +2717,7 @@ int CEvent::GetWorld()
|
||||
else return m_mission;
|
||||
}
|
||||
|
||||
// Donne le numéro physique du monde.
|
||||
// Donne le numéro physique du monde.
|
||||
|
||||
int CEvent::GetPhysicalWorld()
|
||||
{
|
||||
@ -2798,17 +2798,17 @@ bool CEvent::ChangePhase(unsigned int phase)
|
||||
}
|
||||
if ( phase == WM_PHASE_PLAY &&
|
||||
!m_bDemoPlay &&
|
||||
GetPhysicalWorld() >= 150 && // mission spéciale démo ?
|
||||
GetPhysicalWorld() >= 150 && // mission spéciale démo ?
|
||||
GetPhysicalWorld() < 200 )
|
||||
{
|
||||
DemoRecStart(); // début enregistrement
|
||||
DemoRecStart(); // début enregistrement
|
||||
}
|
||||
if ( phase != WM_PHASE_PLAY )
|
||||
{
|
||||
DemoRecStop(); // stoppe l'enregistrement d'une démo
|
||||
DemoRecStop(); // stoppe l'enregistrement d'une démo
|
||||
}
|
||||
|
||||
m_pDecor->UndoClose(); // libère le buffer undo
|
||||
m_pDecor->UndoClose(); // libère le buffer undo
|
||||
|
||||
index = SearchPhase(phase);
|
||||
if ( index < 0 ) return false;
|
||||
@ -2826,7 +2826,7 @@ bool CEvent::ChangePhase(unsigned int phase)
|
||||
phase == WM_PHASE_INFO ) // quitte construction ?
|
||||
{
|
||||
m_pDecor->Write(GetPhysicalWorld(), false,
|
||||
GetPhysicalWorld(), 0, 0); // écrit le monde
|
||||
GetPhysicalWorld(), 0, 0); // écrit le monde
|
||||
}
|
||||
|
||||
// FIXME: pause is better if the game is not stop but just interrupted
|
||||
@ -2847,10 +2847,10 @@ bool CEvent::ChangePhase(unsigned int phase)
|
||||
iconDim.y = 0;
|
||||
if ( !m_pPixmap->Cache(CHBACK, filename, totalDim, iconDim) )
|
||||
{
|
||||
WaitMouse(false); // enlève le sablier
|
||||
WaitMouse(false); // enlève le sablier
|
||||
m_tryInsertCount = 40;
|
||||
m_tryPhase = m_phase;
|
||||
return ChangePhase(WM_PHASE_INSERT); // insérez le CD-Rom ...
|
||||
return ChangePhase(WM_PHASE_INSERT); // insérez le CD-Rom ...
|
||||
}
|
||||
|
||||
if ( m_phase == WM_PHASE_READ ||
|
||||
@ -2882,7 +2882,7 @@ bool CEvent::ChangePhase(unsigned int phase)
|
||||
{
|
||||
m_tryInsertCount = 40;
|
||||
m_tryPhase = m_phase;
|
||||
return ChangePhase(WM_PHASE_INSERT); // insérez le CD-Rom ...
|
||||
return ChangePhase(WM_PHASE_INSERT); // insérez le CD-Rom ...
|
||||
}
|
||||
m_pDecor->SetTime(0);
|
||||
m_pDecor->SetTotalTime(0);
|
||||
@ -2934,18 +2934,18 @@ bool CEvent::ChangePhase(unsigned int phase)
|
||||
{
|
||||
m_tryInsertCount = 40;
|
||||
m_tryPhase = m_phase;
|
||||
return ChangePhase(WM_PHASE_INSERT); // insérez le CD-Rom ...
|
||||
return ChangePhase(WM_PHASE_INSERT); // insérez le CD-Rom ...
|
||||
}
|
||||
}
|
||||
|
||||
m_jauges[0].SetHide(true); // cache les jauges
|
||||
m_jauges[1].SetHide(true);
|
||||
CreateButtons(); // crée les boutons selon la phase
|
||||
CreateButtons(); // crée les boutons selon la phase
|
||||
m_bMenu = false;
|
||||
m_pDecor->HideTooltips(false);
|
||||
m_menu.Delete();
|
||||
m_pDecor->BlupiSetArrow(0, false); // enlève toutes les flèches
|
||||
m_pDecor->ResetHili(); // enlève les mises en évidence
|
||||
m_pDecor->BlupiSetArrow(0, false); // enlève toutes les flèches
|
||||
m_pDecor->ResetHili(); // enlève les mises en évidence
|
||||
|
||||
if ( m_phase == WM_PHASE_PLAY )
|
||||
{
|
||||
@ -3151,7 +3151,7 @@ bool CEvent::ChangePhase(unsigned int phase)
|
||||
}
|
||||
}
|
||||
|
||||
WaitMouse(false); // enlève le sablier
|
||||
WaitMouse(false); // enlève le sablier
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -3176,11 +3176,11 @@ void CEvent::TryInsert()
|
||||
}
|
||||
}
|
||||
|
||||
// Fait démarrer un film si nécessaire.
|
||||
// Fait démarrer un film si nécessaire.
|
||||
|
||||
void CEvent::MovieToStart()
|
||||
{
|
||||
if ( m_movieToStart[0] != 0 ) // y a-t-il un film à démarrer ?
|
||||
if ( m_movieToStart[0] != 0 ) // y a-t-il un film à démarrer ?
|
||||
{
|
||||
HideMouse(true); // cache la souris
|
||||
|
||||
@ -3198,7 +3198,7 @@ void CEvent::MovieToStart()
|
||||
}
|
||||
|
||||
|
||||
// Décale le décor.
|
||||
// Décale le décor.
|
||||
|
||||
void CEvent::DecorShift(int dx, int dy)
|
||||
{
|
||||
@ -3216,7 +3216,7 @@ void CEvent::DecorShift(int dx, int dy)
|
||||
//? m_pDecor->NextPhase(0); // faudra refaire la carte tout de suite
|
||||
}
|
||||
|
||||
// Décale le décor lorsque la souris touche un bord.
|
||||
// Décale le décor lorsque la souris touche un bord.
|
||||
|
||||
void CEvent::DecorAutoShift(POINT pos)
|
||||
{
|
||||
@ -3235,7 +3235,7 @@ void CEvent::DecorAutoShift(POINT pos)
|
||||
if ( m_phase == WM_PHASE_PLAY ||
|
||||
m_phase == WM_PHASE_BUILD )
|
||||
{
|
||||
if ( m_shiftPhase == 0 ) // début du shift ?
|
||||
if ( m_shiftPhase == 0 ) // début du shift ?
|
||||
{
|
||||
m_shiftOffset.x = 0;
|
||||
m_shiftOffset.y = 0;
|
||||
@ -3322,7 +3322,7 @@ void CEvent::DecorAutoShift(POINT pos)
|
||||
offset.y = m_shiftOffset.y*(max-m_shiftPhase)*(DIMCELY/2/max);
|
||||
m_pDecor->SetShiftOffset(offset);
|
||||
|
||||
if ( m_shiftPhase == 0 ) // dernière phase ?
|
||||
if ( m_shiftPhase == 0 ) // dernière phase ?
|
||||
{
|
||||
offset.x = 0;
|
||||
offset.y = 0;
|
||||
@ -3341,7 +3341,7 @@ bool CEvent::IsShift()
|
||||
}
|
||||
|
||||
|
||||
// Modifie le décor lorsque le bouton de la souris est pressé.
|
||||
// Modifie le décor lorsque le bouton de la souris est pressé.
|
||||
|
||||
bool CEvent::PlayDown(POINT pos, const SDL_Event &event)
|
||||
{
|
||||
@ -3350,7 +3350,7 @@ bool CEvent::PlayDown(POINT pos, const SDL_Event &event)
|
||||
int rank, button, h;
|
||||
POINT cel;
|
||||
|
||||
m_pDecor->BlupiSetArrow(0, false); // enlève toutes les flèches
|
||||
m_pDecor->BlupiSetArrow(0, false); // enlève toutes les flèches
|
||||
|
||||
m_bMouseDown = false;
|
||||
|
||||
@ -3418,7 +3418,7 @@ bool CEvent::PlayDown(POINT pos, const SDL_Event &event)
|
||||
return true;
|
||||
}
|
||||
|
||||
// Modifie le décor lorsque la souris est déplacée.
|
||||
// Modifie le décor lorsque la souris est déplacée.
|
||||
|
||||
bool CEvent::PlayMove(POINT pos, Uint16 mod)
|
||||
{
|
||||
@ -3435,7 +3435,7 @@ bool CEvent::PlayMove(POINT pos, Uint16 mod)
|
||||
|
||||
m_pDecor->StatisticMove(pos);
|
||||
|
||||
if ( m_bMouseDown ) // bouton souris pressé ?
|
||||
if ( m_bMouseDown ) // bouton souris pressé ?
|
||||
{
|
||||
if ( m_bHili )
|
||||
{
|
||||
@ -3454,7 +3454,7 @@ bool CEvent::PlayMove(POINT pos, Uint16 mod)
|
||||
return true;
|
||||
}
|
||||
|
||||
// Modifie le décor lorsque le bouton de la souris est relâché.
|
||||
// Modifie le décor lorsque le bouton de la souris est relâché.
|
||||
|
||||
bool CEvent::PlayUp(POINT pos, Uint16 mod)
|
||||
{
|
||||
@ -3467,7 +3467,7 @@ bool CEvent::PlayUp(POINT pos, Uint16 mod)
|
||||
|
||||
m_pDecor->StatisticUp(pos);
|
||||
|
||||
if ( m_bMouseDown ) // bouton souris pressé ?
|
||||
if ( m_bMouseDown ) // bouton souris pressé ?
|
||||
{
|
||||
if ( m_bHili )
|
||||
{
|
||||
@ -3489,7 +3489,7 @@ bool CEvent::PlayUp(POINT pos, Uint16 mod)
|
||||
pos, m_menuNb, m_menuButtons, m_menuErrors,
|
||||
m_menuTexts, m_menuPerso);
|
||||
m_bMenu = true;
|
||||
m_pDecor->HideTooltips(true); // plus de tooltips pour décor
|
||||
m_pDecor->HideTooltips(true); // plus de tooltips pour décor
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3522,7 +3522,7 @@ void CEvent::ChangeButtons(int message)
|
||||
state = GetState(message);
|
||||
if ( state == 0 ) state = 1;
|
||||
else state = 0;
|
||||
SetState(message, state); // pressé <-> relâché
|
||||
SetState(message, state); // pressé <-> relâché
|
||||
|
||||
pButtonExist[message-WM_BUTTON0] = state;
|
||||
pButtonExist[BUTTON_DJEEP] = true;
|
||||
@ -3545,7 +3545,7 @@ void CEvent::ChangeButtons(int message)
|
||||
state = GetState(message);
|
||||
if ( state == 0 ) state = 1;
|
||||
else state = 0;
|
||||
SetState(message, state); // pressé <-> relâché
|
||||
SetState(message, state); // pressé <-> relâché
|
||||
|
||||
if ( message == WM_BUTTON1 ) pTerm->bHachBlupi = state;
|
||||
if ( message == WM_BUTTON2 ) pTerm->bHachPlanche = state;
|
||||
@ -3672,7 +3672,7 @@ void CEvent::ChangeButtons(int message)
|
||||
|
||||
|
||||
|
||||
// Met un sol si nécessaire sous un objet.
|
||||
// Met un sol si nécessaire sous un objet.
|
||||
|
||||
void CEvent::BuildFloor(POINT cel, int insIcon)
|
||||
{
|
||||
@ -3693,7 +3693,7 @@ void CEvent::BuildFloor(POINT cel, int insIcon)
|
||||
insIcon == 113 || // maison ?
|
||||
insIcon == 120 ) // usine ?
|
||||
{
|
||||
iFloor = 16; // sol brun foncé
|
||||
iFloor = 16; // sol brun foncé
|
||||
}
|
||||
|
||||
if ( insIcon == 122 ) // mine de fer ?
|
||||
@ -3705,10 +3705,10 @@ void CEvent::BuildFloor(POINT cel, int insIcon)
|
||||
insIcon == 100 || // usine ennemie ?
|
||||
insIcon == 102 || // usine ennemie ?
|
||||
insIcon == 104 || // usine ennemie ?
|
||||
(insIcon >= 106 && insIcon <= 112) || // barrière ?
|
||||
(insIcon >= 106 && insIcon <= 112) || // barrière ?
|
||||
insIcon == 115 || // usine ennemie ?
|
||||
insIcon == 17 || // usine ennemie ?
|
||||
insIcon == 12 ) // fusée ?
|
||||
insIcon == 12 ) // fusée ?
|
||||
{
|
||||
iFloor = 67; // sol bleu ennemi
|
||||
}
|
||||
@ -3723,31 +3723,31 @@ void CEvent::BuildFloor(POINT cel, int insIcon)
|
||||
}
|
||||
}
|
||||
|
||||
// Enlève si nécessaire un objet sur l'eau.
|
||||
// Enlève si nécessaire un objet sur l'eau.
|
||||
|
||||
void CEvent::BuildWater(POINT cel, int insIcon)
|
||||
{
|
||||
int channel, icon;
|
||||
|
||||
if ( insIcon != 14 ) return; // rien à faire si pas eau
|
||||
if ( insIcon != 14 ) return; // rien à faire si pas eau
|
||||
|
||||
m_pDecor->GetObject(cel, channel, icon);
|
||||
if ( channel == CHOBJECT &&
|
||||
icon >= 6 && // objet (pas petite plante) ?
|
||||
icon != 117 ) // pas bateau ?
|
||||
{
|
||||
m_pDecor->PutObject(cel, -1, -1); // enlève l'objet
|
||||
m_pDecor->PutObject(cel, -1, -1); // enlève l'objet
|
||||
m_pDecor->ArrangeObject(cel);
|
||||
}
|
||||
}
|
||||
|
||||
// Cette table donne les objets à construire en fonction
|
||||
// Cette table donne les objets à construire en fonction
|
||||
// du choix dans le menu.
|
||||
|
||||
static int tableFloor[] =
|
||||
{
|
||||
1,49,50,51,0,0,0,0,0,0, // 0 herbe
|
||||
20,66,79,0,0,0,0,0,0,0, // 1 foncé
|
||||
20,66,79,0,0,0,0,0,0,0, // 1 foncé
|
||||
33,46,47,48,71,0,0,0,0,0, // 2 terre
|
||||
14,0,0,0,0,0,0,0,0,0, // 3 mer
|
||||
15,16,17,18,19,65,67,0,0,0, // 4 dalles
|
||||
@ -3756,7 +3756,7 @@ static int tableFloor[] =
|
||||
|
||||
static int tableObject[] =
|
||||
{
|
||||
-1,0,0,0,0,0,0,0,0,0, // 0 détruit
|
||||
-1,0,0,0,0,0,0,0,0,0, // 0 détruit
|
||||
0,4,1,2,3,5,0,0,0,0, // 1 plantes
|
||||
6,7,8,9,10,11,0,0,0,0, // 2 arbres
|
||||
81,83,94,0,0,0,0,0,0,0, // 5 fleurs
|
||||
@ -3764,20 +3764,20 @@ static int tableObject[] =
|
||||
|
||||
static int tableHome[] =
|
||||
{
|
||||
-1,0,0,0,0,0,0,0,0,0, // 0 détruit
|
||||
-1,0,0,0,0,0,0,0,0,0, // 0 détruit
|
||||
113,61,28,120,0,0,0,0,0,0, // 1 maison
|
||||
27,0,0,0,0,0,0,0,0,0, // 2 tour de protection
|
||||
122,0,0,0,0,0,0,0,0,0, // 3 mine de fer
|
||||
99,100,102,104,115,17,12,0,0,0, // 4 ennemi
|
||||
112,0,0,0,0,0,0,0,0,0, // 5 barrière
|
||||
112,0,0,0,0,0,0,0,0,0, // 5 barrière
|
||||
26,71,0,0,0,0,0,0,0,0, // 6 palissade
|
||||
37,38,39,40,41,42,43,0,0,0, // 7 rochers
|
||||
36,44,60,63,80,123,14,0,0,0, // 8 matières
|
||||
85,125,93,92,0,0,0,0,0,0, // 9 pièges
|
||||
117,118,16,0,0,0,0,0,0,0, // 10 véhicules
|
||||
36,44,60,63,80,123,14,0,0,0, // 8 matières
|
||||
85,125,93,92,0,0,0,0,0,0, // 9 pièges
|
||||
117,118,16,0,0,0,0,0,0,0, // 10 véhicules
|
||||
};
|
||||
|
||||
// Modifie le décor lorsque le bouton de la souris est pressé.
|
||||
// Modifie le décor lorsque le bouton de la souris est pressé.
|
||||
|
||||
bool CEvent::BuildDown(POINT pos, Uint16 mod, bool bMix)
|
||||
{
|
||||
@ -3791,7 +3791,7 @@ bool CEvent::BuildDown(POINT pos, Uint16 mod, bool bMix)
|
||||
|
||||
if ( bMix )
|
||||
{
|
||||
m_pDecor->UndoCopy(); // copie le décor pour undo év.
|
||||
m_pDecor->UndoCopy(); // copie le décor pour undo év.
|
||||
}
|
||||
|
||||
if ( GetState(WM_DECOR1) == 1 ) // pose d'un sol
|
||||
@ -3810,7 +3810,7 @@ bool CEvent::BuildDown(POINT pos, Uint16 mod, bool bMix)
|
||||
}
|
||||
}
|
||||
|
||||
if (mod & KMOD_CTRL) // touche Ctrl enfoncée ?
|
||||
if (mod & KMOD_CTRL) // touche Ctrl enfoncée ?
|
||||
{
|
||||
WaitMouse(true);
|
||||
m_pDecor->ArrangeFill(cel, CHFLOOR, tableFloor[menu*10+m_lastFloor[menu]], true);
|
||||
@ -3821,7 +3821,7 @@ bool CEvent::BuildDown(POINT pos, Uint16 mod, bool bMix)
|
||||
icon = tableFloor[menu*10+m_lastFloor[menu]];
|
||||
if ( menu >= 1 ) // met un sol ?
|
||||
{
|
||||
BuildWater(cel, icon); // enlève les objets
|
||||
BuildWater(cel, icon); // enlève les objets
|
||||
}
|
||||
m_pDecor->PutFloor(cel, CHFLOOR, icon);
|
||||
m_pDecor->ArrangeFloor(cel);
|
||||
@ -3844,7 +3844,7 @@ bool CEvent::BuildDown(POINT pos, Uint16 mod, bool bMix)
|
||||
}
|
||||
}
|
||||
|
||||
if (mod & KMOD_CTRL) // touche Ctrl enfoncée ?
|
||||
if (mod & KMOD_CTRL) // touche Ctrl enfoncée ?
|
||||
{
|
||||
WaitMouse(true);
|
||||
m_pDecor->ArrangeFill(cel, CHOBJECT, tableObject[menu*10+m_lastObject[menu]], false);
|
||||
@ -3853,7 +3853,7 @@ bool CEvent::BuildDown(POINT pos, Uint16 mod, bool bMix)
|
||||
else
|
||||
{
|
||||
icon = tableObject[menu*10+m_lastObject[menu]];
|
||||
BuildFloor(cel, icon); // met un sol si nécessaire
|
||||
BuildFloor(cel, icon); // met un sol si nécessaire
|
||||
m_pDecor->PutObject(cel, CHOBJECT, icon);
|
||||
m_pDecor->ArrangeObject(cel);
|
||||
}
|
||||
@ -3875,7 +3875,7 @@ bool CEvent::BuildDown(POINT pos, Uint16 mod, bool bMix)
|
||||
}
|
||||
}
|
||||
|
||||
if (mod & KMOD_CTRL) // touche Ctrl enfoncée ?
|
||||
if (mod & KMOD_CTRL) // touche Ctrl enfoncée ?
|
||||
{
|
||||
WaitMouse(true);
|
||||
m_pDecor->ArrangeFill(cel, CHOBJECT, tableHome[menu*10+m_lastHome[menu]], false);
|
||||
@ -3884,7 +3884,7 @@ bool CEvent::BuildDown(POINT pos, Uint16 mod, bool bMix)
|
||||
else
|
||||
{
|
||||
icon = tableHome[menu*10+m_lastHome[menu]];
|
||||
BuildFloor(cel, icon); // met un sol si nécessaire
|
||||
BuildFloor(cel, icon); // met un sol si nécessaire
|
||||
m_pDecor->PutObject(cel, CHOBJECT, icon);
|
||||
m_pDecor->ArrangeObject(cel);
|
||||
}
|
||||
@ -3899,11 +3899,11 @@ bool CEvent::BuildDown(POINT pos, Uint16 mod, bool bMix)
|
||||
{
|
||||
m_pDecor->BlupiDelete(cel);
|
||||
}
|
||||
if ( menu == 1 ) // ajoute blupi-fatigué ?
|
||||
if ( menu == 1 ) // ajoute blupi-fatigué ?
|
||||
{
|
||||
m_pDecor->BlupiCreate(cel, ACTION_STOP, DIRECT_S, 0, MAXENERGY/4);
|
||||
}
|
||||
if ( menu == 2 ) // ajoute blupi-énergique ?
|
||||
if ( menu == 2 ) // ajoute blupi-énergique ?
|
||||
{
|
||||
m_pDecor->BlupiCreate(cel, ACTION_STOP, DIRECT_S, 0, MAXENERGY);
|
||||
}
|
||||
@ -3911,7 +3911,7 @@ bool CEvent::BuildDown(POINT pos, Uint16 mod, bool bMix)
|
||||
{
|
||||
m_pDecor->BlupiCreate(cel, ACTION_STOP, DIRECT_S, 8, MAXENERGY);
|
||||
}
|
||||
if ( menu == 4 ) // ajoute araignée ?
|
||||
if ( menu == 4 ) // ajoute araignée ?
|
||||
{
|
||||
m_pDecor->BlupiCreate(cel, ACTION_STOP, DIRECT_S, 1, MAXENERGY);
|
||||
}
|
||||
@ -3927,7 +3927,7 @@ bool CEvent::BuildDown(POINT pos, Uint16 mod, bool bMix)
|
||||
{
|
||||
m_pDecor->BlupiCreate(cel, ACTION_STOP, DIRECT_S, 5, MAXENERGY);
|
||||
}
|
||||
if ( menu == 8 ) // ajoute électro ?
|
||||
if ( menu == 8 ) // ajoute électro ?
|
||||
{
|
||||
m_pDecor->BlupiCreate(cel, ACTION_STOP, DIRECT_S, 7, MAXENERGY);
|
||||
}
|
||||
@ -3952,16 +3952,16 @@ bool CEvent::BuildDown(POINT pos, Uint16 mod, bool bMix)
|
||||
}
|
||||
}
|
||||
|
||||
m_pDecor->ArrangeBlupi(); // supprime les blupi bloqués
|
||||
m_pDecor->ArrangeBlupi(); // supprime les blupi bloqués
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Modifie le décor lorsque la souris est déplacée.
|
||||
// Modifie le décor lorsque la souris est déplacée.
|
||||
|
||||
bool CEvent::BuildMove(POINT pos, Uint16 mod, const SDL_Event &event)
|
||||
{
|
||||
if (event.motion.state & SDL_BUTTON (SDL_BUTTON_LEFT)) // bouton souris pressé ?
|
||||
if (event.motion.state & SDL_BUTTON (SDL_BUTTON_LEFT)) // bouton souris pressé ?
|
||||
{
|
||||
BuildDown(pos, mod, false);
|
||||
}
|
||||
@ -3978,7 +3978,7 @@ bool CEvent::BuildMove(POINT pos, Uint16 mod, const SDL_Event &event)
|
||||
return true;
|
||||
}
|
||||
|
||||
// Modifie le décor lorsque le bouton de la souris est relâché.
|
||||
// Modifie le décor lorsque le bouton de la souris est relâché.
|
||||
|
||||
bool CEvent::BuildUp(POINT pos)
|
||||
{
|
||||
@ -3986,7 +3986,7 @@ bool CEvent::BuildUp(POINT pos)
|
||||
}
|
||||
|
||||
|
||||
// Démarre un film non interractif.
|
||||
// Démarre un film non interractif.
|
||||
|
||||
bool CEvent::StartMovie(const char *pFilename)
|
||||
{
|
||||
@ -3997,7 +3997,7 @@ bool CEvent::StartMovie(const char *pFilename)
|
||||
|
||||
if ( !m_pMovie->IsExist(pFilename) ) return false;
|
||||
|
||||
rect.left = 1; // mystère: plante avec 0,0,LXIMAGE,LYIMAGE !!!
|
||||
rect.left = 1; // mystère: plante avec 0,0,LXIMAGE,LYIMAGE !!!
|
||||
rect.top = 1;
|
||||
rect.right = LXIMAGE-2;
|
||||
rect.bottom = LYIMAGE-2;
|
||||
@ -4070,7 +4070,7 @@ void CEvent::Write(int message)
|
||||
}
|
||||
|
||||
|
||||
// Initialise le libellé d'une mission privée.
|
||||
// Initialise le libellé d'une mission privée.
|
||||
|
||||
void CEvent::PrivateLibelle()
|
||||
{
|
||||
@ -4152,7 +4152,7 @@ void CEvent::PrivateLibelle()
|
||||
m_pDecor->SetInfoHeight(POSDRAWY+h1+10);
|
||||
}
|
||||
|
||||
// Lit le libellé d'un monde.
|
||||
// Lit le libellé d'un monde.
|
||||
|
||||
bool CEvent::ReadLibelle(int world, bool bSchool, bool bHelp)
|
||||
{
|
||||
@ -4325,7 +4325,7 @@ bool CEvent::GetPause()
|
||||
}
|
||||
|
||||
|
||||
// Début de l'enregistrement d'une démo.
|
||||
// Début de l'enregistrement d'une démo.
|
||||
|
||||
void CEvent::DemoRecStart()
|
||||
{
|
||||
@ -4343,7 +4343,7 @@ void CEvent::DemoRecStart()
|
||||
m_speed = 1;
|
||||
}
|
||||
|
||||
// Fin de l'enregistrement d'une démo.
|
||||
// Fin de l'enregistrement d'une démo.
|
||||
// Sauve le fichier sur disque.
|
||||
|
||||
void CEvent::DemoRecStop()
|
||||
@ -4378,7 +4378,7 @@ void CEvent::DemoRecStop()
|
||||
m_demoTime = 0;
|
||||
}
|
||||
|
||||
// Début de la reproduction d'une démo.
|
||||
// Début de la reproduction d'une démo.
|
||||
// Lit le fichier sur disque.
|
||||
|
||||
bool CEvent::DemoPlayStart()
|
||||
@ -4432,7 +4432,7 @@ bool CEvent::DemoPlayStart()
|
||||
return true;
|
||||
}
|
||||
|
||||
// Fin de la reproduction d'une démo.
|
||||
// Fin de la reproduction d'une démo.
|
||||
|
||||
void CEvent::DemoPlayStop()
|
||||
{
|
||||
@ -4551,14 +4551,14 @@ void CEvent::DemoStep()
|
||||
|
||||
if ( m_phase == WM_PHASE_INIT )
|
||||
{
|
||||
if ( m_demoTime > DEF_TIME_DEMO ) // ~30 secondes écoulées ?
|
||||
if ( m_demoTime > DEF_TIME_DEMO ) // ~30 secondes écoulées ?
|
||||
{
|
||||
m_demoNumber = 0;
|
||||
DemoPlayStart(); // démarre une démo automatique
|
||||
DemoPlayStart(); // démarre une démo automatique
|
||||
}
|
||||
}
|
||||
|
||||
if ( m_bDemoPlay && // démo en lecture ?
|
||||
if ( m_bDemoPlay && // démo en lecture ?
|
||||
m_pDemoBuffer != nullptr )
|
||||
{
|
||||
while ( true )
|
||||
@ -4583,11 +4583,11 @@ void CEvent::DemoStep()
|
||||
|
||||
if ( m_demoIndex >= m_demoEnd )
|
||||
{
|
||||
m_demoNumber ++; // démo suivante
|
||||
if ( !DemoPlayStart() ) // démarre la démo suivante
|
||||
m_demoNumber ++; // démo suivante
|
||||
if ( !DemoPlayStart() ) // démarre la démo suivante
|
||||
{
|
||||
m_demoNumber = 0; // première démo
|
||||
DemoPlayStart(); // démarre la démo
|
||||
m_demoNumber = 0; // première démo
|
||||
DemoPlayStart(); // démarre la démo
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -4597,7 +4597,7 @@ void CEvent::DemoStep()
|
||||
m_demoTime ++;
|
||||
}
|
||||
|
||||
// Mémorise un événement.
|
||||
// Mémorise un événement.
|
||||
|
||||
void CEvent::DemoRecEvent(unsigned int message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
@ -4635,14 +4635,14 @@ void CEvent::DemoRecEvent(unsigned int message, WPARAM wParam, LPARAM lParam)
|
||||
}
|
||||
|
||||
|
||||
// Retourne la dernière position de la souris.
|
||||
// Retourne la dernière position de la souris.
|
||||
|
||||
POINT CEvent::GetLastMousePos()
|
||||
{
|
||||
return m_oldMousePos;
|
||||
}
|
||||
|
||||
// Traitement d'un événement.
|
||||
// Traitement d'un événement.
|
||||
|
||||
bool CEvent::TreatEvent(const SDL_Event &event)
|
||||
{
|
||||
@ -4663,7 +4663,7 @@ bool CEvent::TreatEvent(const SDL_Event &event)
|
||||
return TreatEventBase(event);
|
||||
}
|
||||
|
||||
// Traitement d'un événement.
|
||||
// Traitement d'un événement.
|
||||
|
||||
bool CEvent::TreatEventBase(const SDL_Event &event)
|
||||
{
|
||||
@ -4679,7 +4679,7 @@ bool CEvent::TreatEventBase(const SDL_Event &event)
|
||||
case SDL_KEYDOWN:
|
||||
if ( event.key.keysym.sym >= SDLK_a && event.key.keysym.sym <= SDLK_z )
|
||||
{
|
||||
if ( m_posCheat == 0 ) // première lettre ?
|
||||
if ( m_posCheat == 0 ) // première lettre ?
|
||||
{
|
||||
m_rankCheat = -1;
|
||||
for ( i=0 ; i<9 ; i++ )
|
||||
@ -5085,7 +5085,7 @@ bool CEvent::TreatEventBase(const SDL_Event &event)
|
||||
case WM_PHASE_MISSION:
|
||||
m_bSchool = false;
|
||||
m_bPrivate = false;
|
||||
if ( m_mission == 0 ) // première mission ?
|
||||
if ( m_mission == 0 ) // première mission ?
|
||||
{
|
||||
if ( ChangePhase(WM_PHASE_H0MOVIE) ) return true;
|
||||
}
|
||||
@ -5130,7 +5130,7 @@ bool CEvent::TreatEventBase(const SDL_Event &event)
|
||||
break;
|
||||
|
||||
case WM_PHASE_UNDO:
|
||||
m_pDecor->UndoBack(); // revient en arrière
|
||||
m_pDecor->UndoBack(); // revient en arrière
|
||||
break;
|
||||
|
||||
case WM_PREV:
|
||||
|
10
src/fifo.cpp
10
src/fifo.cpp
@ -4,8 +4,8 @@
|
||||
#include "fifo.h"
|
||||
|
||||
|
||||
// gestion d'une pile classée en valeur croissantes
|
||||
// typiquement reprend les coordonnées les plus proches
|
||||
// gestion d'une pile classée en valeur croissantes
|
||||
// typiquement reprend les coordonnées les plus proches
|
||||
// du but en premier lieu
|
||||
|
||||
CPileTriee::CPileTriee(long taille)
|
||||
@ -36,10 +36,10 @@ void CPileTriee::put(long pos, long dist)
|
||||
|
||||
while (i!=m_max)
|
||||
{
|
||||
// le point est-il plus proche que celui-là ?
|
||||
// le point est-il plus proche que celui-là ?
|
||||
if (dist<m_data[i].dist)
|
||||
{
|
||||
// oui, insert et décale le suivant
|
||||
// oui, insert et décale le suivant
|
||||
p = m_data[i].pos;
|
||||
d = m_data[i].dist;
|
||||
m_data[i].pos = pos;
|
||||
@ -51,7 +51,7 @@ void CPileTriee::put(long pos, long dist)
|
||||
if (i>=m_taille) i=0;
|
||||
}
|
||||
|
||||
// ajoute le point éloigné à la suite
|
||||
// ajoute le point éloigné à la suite
|
||||
m = m_max+1;
|
||||
if (m>=m_taille) m=0;
|
||||
if (m!=m_out)
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
|
||||
// stucture pour enpiler des positions
|
||||
// en fonction de leur distance à la cible
|
||||
// en fonction de leur distance à la cible
|
||||
typedef struct
|
||||
{
|
||||
long pos;
|
||||
@ -14,7 +14,7 @@ typedef struct
|
||||
Element;
|
||||
|
||||
|
||||
// traitement d'une pile triée
|
||||
// traitement d'une pile triée
|
||||
|
||||
class CPileTriee
|
||||
{
|
||||
@ -22,7 +22,7 @@ private:
|
||||
long m_taille; // nombre de polongs max
|
||||
long m_max; // position limite
|
||||
long m_out; // position pour reprendre
|
||||
Element* m_data; // données
|
||||
Element* m_data; // données
|
||||
|
||||
public:
|
||||
CPileTriee(long taille);
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include "decor.h"
|
||||
|
||||
// Cette table indique les quarts de cases contenant du
|
||||
// brouillard lorsque la valeur est à un.
|
||||
// brouillard lorsque la valeur est à un.
|
||||
// 0 1
|
||||
// 2 3
|
||||
static char tableFog[15*4] =
|
||||
@ -44,7 +44,7 @@ bool GetFogBits(int icon, char *pBits)
|
||||
return true;
|
||||
}
|
||||
|
||||
// Retourne l'icône correspondant aux bits de brouillard.
|
||||
// Retourne l'icône correspondant aux bits de brouillard.
|
||||
|
||||
int GetFogIcon(char *pBits)
|
||||
{
|
||||
@ -140,7 +140,7 @@ void CDecor::BlupiPushFog(int rank)
|
||||
|
||||
for ( i=0 ; i<4 ; i++ )
|
||||
{
|
||||
nBits[i] &= cBits[i]; // "ou" visibilité
|
||||
nBits[i] &= cBits[i]; // "ou" visibilité
|
||||
}
|
||||
|
||||
m_decor[cel.x/2][cel.y/2].fog = GetFogIcon(nBits);
|
||||
|
@ -31,7 +31,7 @@ CJauge::~CJauge()
|
||||
}
|
||||
|
||||
|
||||
// Crée un nouveau bouton.
|
||||
// Crée un nouveau bouton.
|
||||
|
||||
bool CJauge::Create(CPixmap *pPixmap, CSound *pSound,
|
||||
POINT pos, int type, bool bMinimizeRedraw)
|
||||
@ -50,7 +50,7 @@ bool CJauge::Create(CPixmap *pPixmap, CSound *pSound,
|
||||
return true;
|
||||
}
|
||||
|
||||
// Dessine un bouton dans son état.
|
||||
// Dessine un bouton dans son état.
|
||||
|
||||
void CJauge::Draw()
|
||||
{
|
||||
@ -60,7 +60,7 @@ void CJauge::Draw()
|
||||
if ( m_bMinimizeRedraw && !m_bRedraw ) return;
|
||||
m_bRedraw = false;
|
||||
|
||||
if ( m_bHide ) // bouton caché ?
|
||||
if ( m_bHide ) // bouton caché ?
|
||||
{
|
||||
rect.left = m_pos.x;
|
||||
rect.right = m_pos.x+m_dim.x;
|
||||
@ -84,7 +84,7 @@ void CJauge::Draw()
|
||||
rect.right = 6+part;
|
||||
rect.top = DIMJAUGEY*m_type;
|
||||
rect.bottom = DIMJAUGEY*(m_type+1);
|
||||
m_pPixmap->DrawPart(-1, CHJAUGE, m_pos, rect); // partie colorée
|
||||
m_pPixmap->DrawPart(-1, CHJAUGE, m_pos, rect); // partie colorée
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -32,13 +32,13 @@ protected:
|
||||
CPixmap* m_pPixmap;
|
||||
CDecor* m_pDecor;
|
||||
CSound* m_pSound;
|
||||
bool m_bHide; // true si bouton caché
|
||||
bool m_bHide; // true si bouton caché
|
||||
POINT m_pos; // coin sup/gauche
|
||||
POINT m_dim; // dimensions
|
||||
int m_type;
|
||||
int m_level;
|
||||
bool m_bMinimizeRedraw;
|
||||
bool m_bRedraw; // true -> doit être redessiné
|
||||
bool m_bRedraw; // true -> doit être redessiné
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
38
src/menu.cpp
38
src/menu.cpp
@ -37,7 +37,7 @@ static const short table_button_icon[] =
|
||||
35, // build3 (laboratoire)
|
||||
61, // build4 (mine)
|
||||
59, // build5 (usine)
|
||||
101, // build6 (téléporteur)
|
||||
101, // build6 (téléporteur)
|
||||
20, // mur
|
||||
26, // palis
|
||||
42, // abat n
|
||||
@ -138,7 +138,7 @@ CMenu::~CMenu()
|
||||
}
|
||||
|
||||
|
||||
// Crée un nouveau bouton.
|
||||
// Crée un nouveau bouton.
|
||||
|
||||
bool CMenu::Create(CPixmap *pPixmap, CSound *pSound,
|
||||
POINT pos, int nb, int *pButtons, int *pErrors,
|
||||
@ -175,7 +175,7 @@ bool CMenu::Create(CPixmap *pPixmap, CSound *pSound,
|
||||
return true;
|
||||
}
|
||||
|
||||
// Met à jour le menu.
|
||||
// Met à jour le menu.
|
||||
|
||||
void CMenu::Update(int nb, int *pButtons, int *pErrors,
|
||||
std::unordered_map<int, const char *> &texts)
|
||||
@ -200,7 +200,7 @@ void CMenu::Update(int nb, int *pButtons, int *pErrors,
|
||||
m_texts = texts;
|
||||
}
|
||||
|
||||
// Détruit le menu.
|
||||
// Détruit le menu.
|
||||
|
||||
void CMenu::Delete()
|
||||
{
|
||||
@ -208,7 +208,7 @@ void CMenu::Delete()
|
||||
m_selRank = -1;
|
||||
}
|
||||
|
||||
// Dessine un bouton dans son état.
|
||||
// Dessine un bouton dans son état.
|
||||
|
||||
void CMenu::Draw()
|
||||
{
|
||||
@ -246,7 +246,7 @@ void CMenu::Draw()
|
||||
if ( m_perso == 8 ) // disciple ?
|
||||
{
|
||||
if ( icon == 30 ) icon = 88; // prend
|
||||
if ( icon == 31 ) icon = 89; // dépose
|
||||
if ( icon == 31 ) icon = 89; // dépose
|
||||
}
|
||||
m_pPixmap->DrawIcon(-1, CHBUTTON, icon+6, pos);
|
||||
}
|
||||
@ -282,7 +282,7 @@ void CMenu::Draw()
|
||||
{
|
||||
// if ( bLeft )
|
||||
// {
|
||||
pos.x = m_pos.x-4-GetTextWidth(text); // texte à gauche
|
||||
pos.x = m_pos.x-4-GetTextWidth(text); // texte à gauche
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
@ -293,7 +293,7 @@ void CMenu::Draw()
|
||||
{
|
||||
// if ( bRight )
|
||||
// {
|
||||
pos.x = m_pos.x+m_dim.x+4; // texte à droite
|
||||
pos.x = m_pos.x+m_dim.x+4; // texte à droite
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
@ -321,7 +321,7 @@ void CMenu::Draw()
|
||||
{
|
||||
// if ( bLeft )
|
||||
// {
|
||||
pos.x = m_pos.x-4-GetTextWidth(text); // texte à gauche
|
||||
pos.x = m_pos.x-4-GetTextWidth(text); // texte à gauche
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
@ -332,7 +332,7 @@ void CMenu::Draw()
|
||||
{
|
||||
// if ( bRight )
|
||||
// {
|
||||
pos.x = m_pos.x+m_dim.x+4; // texte à droite
|
||||
pos.x = m_pos.x+m_dim.x+4; // texte à droite
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
@ -355,7 +355,7 @@ void CMenu::Draw()
|
||||
m_pPixmap->SetClipping(oldClip);
|
||||
}
|
||||
|
||||
// Retourne le bouton sélectionné.
|
||||
// Retourne le bouton sélectionné.
|
||||
|
||||
int CMenu::GetSel()
|
||||
{
|
||||
@ -364,14 +364,14 @@ int CMenu::GetSel()
|
||||
return m_buttons[m_selRank];
|
||||
}
|
||||
|
||||
// Retourne le rang sélectionné.
|
||||
// Retourne le rang sélectionné.
|
||||
|
||||
int CMenu::GetRank()
|
||||
{
|
||||
return m_selRank;
|
||||
}
|
||||
|
||||
// Retourne true si le bouton sélectionné a une erreur.
|
||||
// Retourne true si le bouton sélectionné a une erreur.
|
||||
|
||||
bool CMenu::IsError()
|
||||
{
|
||||
@ -392,7 +392,7 @@ bool CMenu::IsExist()
|
||||
}
|
||||
|
||||
|
||||
// Traitement d'un événement.
|
||||
// Traitement d'un événement.
|
||||
|
||||
bool CMenu::TreatEvent(const SDL_Event &event)
|
||||
{
|
||||
@ -434,7 +434,7 @@ bool CMenu::TreatEvent(const SDL_Event &event)
|
||||
return false;
|
||||
}
|
||||
|
||||
// Détecte dans quel bouton est la souris.
|
||||
// Détecte dans quel bouton est la souris.
|
||||
|
||||
int CMenu::Detect(POINT pos)
|
||||
{
|
||||
@ -450,14 +450,14 @@ int CMenu::Detect(POINT pos)
|
||||
return rank;
|
||||
}
|
||||
|
||||
// Bouton de la souris pressé.
|
||||
// Bouton de la souris pressé.
|
||||
|
||||
bool CMenu::MouseDown(POINT pos)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Souris déplacés.
|
||||
// Souris déplacés.
|
||||
|
||||
bool CMenu::MouseMove(POINT pos)
|
||||
{
|
||||
@ -468,13 +468,13 @@ bool CMenu::MouseMove(POINT pos)
|
||||
pos.y < m_pos.y-(DIMBUTTONY+MARGMENU) ||
|
||||
pos.y > m_pos.y+m_dim.y+(DIMBUTTONY+MARGMENU) )
|
||||
{
|
||||
Delete(); // enlève le menu si souris trop loin !
|
||||
Delete(); // enlève le menu si souris trop loin !
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Bouton de la souris relâché.
|
||||
// Bouton de la souris relâché.
|
||||
|
||||
bool CMenu::MouseUp(POINT pos)
|
||||
{
|
||||
|
@ -50,14 +50,14 @@ POINT ConvLongToPos(LPARAM lParam)
|
||||
}
|
||||
|
||||
|
||||
// R<EFBFBD>initialise le g<>n<EFBFBD>rateur al<61>atoire.
|
||||
// R�initialise le g�n�rateur al�atoire.
|
||||
|
||||
void InitRandom()
|
||||
{
|
||||
srand(1);
|
||||
}
|
||||
|
||||
// Retourne un nombre al<EFBFBD>atoire compris entre
|
||||
// Retourne un nombre al�atoire compris entre
|
||||
// deux bornes (inclues).
|
||||
|
||||
int Random(int min, int max)
|
||||
|
@ -183,7 +183,7 @@ bool CMovie::Create()
|
||||
}
|
||||
}
|
||||
|
||||
// Retourne l'état de DirectMovie.
|
||||
// Retourne l'état de DirectMovie.
|
||||
|
||||
bool CMovie::GetEnable()
|
||||
{
|
||||
|
284
src/obstacle.cpp
284
src/obstacle.cpp
@ -562,7 +562,7 @@ static char tableObstacleObject[] =
|
||||
1,1,1,1,1,
|
||||
0,1,1,1,1,
|
||||
|
||||
0,1,1,1,0, // 12 (fusée)
|
||||
0,1,1,1,0, // 12 (fusée)
|
||||
1,1,1,1,1,
|
||||
1,1,1,1,1,
|
||||
1,1,1,1,1,
|
||||
@ -574,7 +574,7 @@ static char tableObstacleObject[] =
|
||||
0,0,0,0,0,
|
||||
0,0,0,0,0,
|
||||
|
||||
0,0,0,0,0, // 14 (métal)
|
||||
0,0,0,0,0, // 14 (métal)
|
||||
0,0,0,0,0,
|
||||
0,0,1,1,1,
|
||||
0,0,1,1,1,
|
||||
@ -604,7 +604,7 @@ static char tableObstacleObject[] =
|
||||
1,0,0,0,0,
|
||||
1,1,1,1,1,
|
||||
|
||||
0,0,0,0,0, // 19 (électro piégé)
|
||||
0,0,0,0,0, // 19 (électro piégé)
|
||||
0,0,0,0,0,
|
||||
0,0,1,1,1,
|
||||
0,0,1,1,1,
|
||||
@ -1053,7 +1053,7 @@ static char tableObstacleObject[] =
|
||||
0,0,1,1,1,
|
||||
0,0,1,1,1,
|
||||
|
||||
0,0,0,0,0, // 93 (piège)
|
||||
0,0,0,0,0, // 93 (piège)
|
||||
0,0,0,0,0,
|
||||
0,0,0,0,0,
|
||||
0,0,0,1,0,
|
||||
@ -1071,19 +1071,19 @@ static char tableObstacleObject[] =
|
||||
0,0,1,1,1,
|
||||
0,0,1,1,1,
|
||||
|
||||
0,0,0,0,0, // 96 (araignée dans piège)
|
||||
0,0,0,0,0, // 96 (araignée dans piège)
|
||||
0,0,0,0,0,
|
||||
0,0,1,1,1,
|
||||
0,0,1,1,1,
|
||||
0,0,1,1,1,
|
||||
|
||||
0,0,0,0,0, // 97 (tracks dans piège)
|
||||
0,0,0,0,0, // 97 (tracks dans piège)
|
||||
0,0,0,0,0,
|
||||
0,0,1,1,1,
|
||||
0,0,1,1,1,
|
||||
0,0,1,1,1,
|
||||
|
||||
0,0,0,0,0, // 98 (robot dans piège)
|
||||
0,0,0,0,0, // 98 (robot dans piège)
|
||||
0,0,0,0,0,
|
||||
0,0,1,1,1,
|
||||
0,0,1,1,1,
|
||||
@ -1131,7 +1131,7 @@ static char tableObstacleObject[] =
|
||||
1,0,0,0,0,
|
||||
1,1,1,1,1,
|
||||
|
||||
1,1,1,1,1, // 106 (barrière)
|
||||
1,1,1,1,1, // 106 (barrière)
|
||||
1,1,1,1,1,
|
||||
1,1,1,1,1,
|
||||
1,1,1,1,1,
|
||||
@ -1179,7 +1179,7 @@ static char tableObstacleObject[] =
|
||||
1,1,1,0,0,
|
||||
1,1,1,1,1,
|
||||
|
||||
0,0,0,0,0, // 114 (bombe dans piège)
|
||||
0,0,0,0,0, // 114 (bombe dans piège)
|
||||
0,0,0,0,0,
|
||||
0,0,1,1,1,
|
||||
0,0,1,1,1,
|
||||
@ -1251,7 +1251,7 @@ static char tableObstacleObject[] =
|
||||
0,0,1,1,1,
|
||||
0,0,1,1,1,
|
||||
|
||||
0,0,0,0,0, // 126 (mine de fer, échaffaudage)
|
||||
0,0,0,0,0, // 126 (mine de fer, échaffaudage)
|
||||
0,0,0,0,0,
|
||||
0,0,0,0,0,
|
||||
0,0,0,0,0,
|
||||
@ -1404,12 +1404,12 @@ void CDecor::AjustFloor(int rank, int icon, POINT cel, int *pBits)
|
||||
lock:
|
||||
for ( i=0 ; i<9 ; i++ )
|
||||
{
|
||||
*pBits++ = 1; // bloqué
|
||||
*pBits++ = 1; // bloqué
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// (*) Blupi est passe muraille lorsqu'il embarque ou débarque
|
||||
// (*) Blupi est passe muraille lorsqu'il embarque ou débarque
|
||||
// du bateau. Dans ce cas, tous les sols (rivages) doivent
|
||||
// permettre de passer. En revanche, pas les obstacles !
|
||||
|
||||
@ -1423,7 +1423,7 @@ void CDecor::AjustObject(int rank, int icon, POINT cel, int *pBits)
|
||||
|
||||
if ( m_blupi[rank].perso == 0 ) // blupi ?
|
||||
{
|
||||
if ( m_blupi[rank].vehicule != 0 && // pas à pied ?
|
||||
if ( m_blupi[rank].vehicule != 0 && // pas à pied ?
|
||||
cel.x%2 == 1 && cel.y%2 == 1 &&
|
||||
m_decor[cel.x/2][cel.y/2].objectIcon == 117 ) // bateau ?
|
||||
{
|
||||
@ -1455,12 +1455,12 @@ void CDecor::AjustObject(int rank, int icon, POINT cel, int *pBits)
|
||||
return;
|
||||
}
|
||||
|
||||
if ( m_blupi[rank].perso == 1 ) // araignée ?
|
||||
if ( m_blupi[rank].perso == 1 ) // araignée ?
|
||||
{
|
||||
// if ( cel.x%2 != 0 && cel.y%2 != 0 &&
|
||||
if ( IsSpiderObject(icon) ) // tomate ou poison ?
|
||||
{
|
||||
goto pass; // l'araignée peut aller dans les tomates
|
||||
goto pass; // l'araignée peut aller dans les tomates
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -1469,8 +1469,8 @@ void CDecor::AjustObject(int rank, int icon, POINT cel, int *pBits)
|
||||
{
|
||||
if ( icon == 81 ||
|
||||
icon == 83 ||
|
||||
icon == 94 || // fleurs non-coupées ?
|
||||
(icon >= 106 && icon <= 112) ) // barrières ennemies ?
|
||||
icon == 94 || // fleurs non-coupées ?
|
||||
(icon >= 106 && icon <= 112) ) // barrières ennemies ?
|
||||
{
|
||||
goto pass; // le virus peut aller
|
||||
}
|
||||
@ -1495,7 +1495,7 @@ void CDecor::AjustObject(int rank, int icon, POINT cel, int *pBits)
|
||||
|
||||
if ( m_blupi[rank].perso == 4 ) // robot ?
|
||||
{
|
||||
if ( IsRobotObject(icon) ) // piège ou dynamite ?
|
||||
if ( IsRobotObject(icon) ) // piège ou dynamite ?
|
||||
{
|
||||
goto pass; // le robot peut aller
|
||||
}
|
||||
@ -1504,25 +1504,25 @@ void CDecor::AjustObject(int rank, int icon, POINT cel, int *pBits)
|
||||
|
||||
if ( m_blupi[rank].perso == 5 ) // bombe ?
|
||||
{
|
||||
if ( icon == 93 ) // piège ?
|
||||
if ( icon == 93 ) // piège ?
|
||||
{
|
||||
goto pass; // la bombe peut aller
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if ( m_blupi[rank].perso == 7 ) // électro ?
|
||||
if ( m_blupi[rank].perso == 7 ) // électro ?
|
||||
{
|
||||
if ( icon == 93 ) // piège ?
|
||||
if ( icon == 93 ) // piège ?
|
||||
{
|
||||
goto pass; // l'électro peut aller
|
||||
goto pass; // l'électro peut aller
|
||||
}
|
||||
if ( icon == 113 || // maison ?
|
||||
icon == 28 || icon == 29 || // laboratoire ?
|
||||
icon == 119 || icon == 120 || // usine ?
|
||||
icon == 121 || icon == 122 ) // mine de fer ?
|
||||
{
|
||||
goto lock; // l'électro ne peut pas aller dans la maison
|
||||
goto lock; // l'électro ne peut pas aller dans la maison
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -1560,7 +1560,7 @@ void CDecor::AjustObject(int rank, int icon, POINT cel, int *pBits)
|
||||
lock:
|
||||
for ( i=0 ; i<9 ; i++ )
|
||||
{
|
||||
*pBits++ = 1; // bloqué
|
||||
*pBits++ = 1; // bloqué
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -1580,7 +1580,7 @@ void Copy33To99(int *pSrc33, int *pDst99, int dx, int dy)
|
||||
}
|
||||
}
|
||||
|
||||
// Indique s'il est possible d'avancer dans une direction donnée.
|
||||
// Indique s'il est possible d'avancer dans une direction donnée.
|
||||
|
||||
bool CDecor::IsFreeDirect(POINT cel, int direct, int rank)
|
||||
{
|
||||
@ -1596,14 +1596,14 @@ bool CDecor::IsFreeDirect(POINT cel, int direct, int rank)
|
||||
if ( m_decor[test.x/2][test.y/2].fire > 0 &&
|
||||
m_decor[test.x/2][test.y/2].fire < MoveMaxFire() ) return false;
|
||||
|
||||
// Cellule bloquée (un blupi travaille ici) ?
|
||||
// Cellule bloquée (un blupi travaille ici) ?
|
||||
if ( m_blupi[rank].perso != 3 ) // pas tracks ?
|
||||
{
|
||||
workBlupi = m_decor[test.x/2][test.y/2].workBlupi;
|
||||
if ( workBlupi >= 0 && workBlupi != rank ) return false;
|
||||
}
|
||||
|
||||
// Déplacement possible par-rapport au sol ?
|
||||
// Déplacement possible par-rapport au sol ?
|
||||
// icon = m_decor[cel.x/2][cel.y/2].floorIcon;
|
||||
// SearchFloor(rank, icon, cel, bits);
|
||||
// AjustFloor(rank, icon, cel, bits);
|
||||
@ -1615,7 +1615,7 @@ bool CDecor::IsFreeDirect(POINT cel, int direct, int rank)
|
||||
if ( bits[1+1*3] == 1 ) return false;
|
||||
if ( bits[(1-vector.x)+(1-vector.y)*3] == 1 ) return false;
|
||||
|
||||
// Déplacement possible par-rapport aux obstacles ?
|
||||
// Déplacement possible par-rapport aux obstacles ?
|
||||
icon = m_decor[cel.x/2][cel.y/2].objectIcon;
|
||||
SearchObject(rank, icon, cel, bits);
|
||||
AjustObject(rank, icon, cel, bits);
|
||||
@ -1627,7 +1627,7 @@ bool CDecor::IsFreeDirect(POINT cel, int direct, int rank)
|
||||
if ( bits[(1-vector.x)+(1-vector.y)*3] == 1 ) return false;
|
||||
if ( bits[1+1*3] == 1 ) return false;
|
||||
|
||||
if ( vector.x != 0 && vector.y != 0 ) // déplacement diagonal ?
|
||||
if ( vector.x != 0 && vector.y != 0 ) // déplacement diagonal ?
|
||||
{
|
||||
test.x = cel.x;
|
||||
test.y = cel.y+vector.y;
|
||||
@ -1651,7 +1651,7 @@ bool CDecor::IsFreeDirect(POINT cel, int direct, int rank)
|
||||
}
|
||||
|
||||
// Indique si une cellule contient un objet.
|
||||
// Est utilisé lors du dessin (BuildPutBlupi), pour savoir
|
||||
// Est utilisé lors du dessin (BuildPutBlupi), pour savoir
|
||||
// si blupi est devant un objet.
|
||||
|
||||
bool CDecor::IsFreeCelObstacle(POINT cel)
|
||||
@ -1675,7 +1675,7 @@ bool CDecor::IsFreeCelObstacle(POINT cel)
|
||||
}
|
||||
|
||||
// Indique si une cellule contient un sol.
|
||||
// Est utilisé pour savoir si blupi peut aller sur une cellule
|
||||
// Est utilisé pour savoir si blupi peut aller sur une cellule
|
||||
// en tenant compte uniquement des sols.
|
||||
// Retourne true si blupi peut y aller !
|
||||
|
||||
@ -1698,8 +1698,8 @@ bool CDecor::IsFreeCelFloor(POINT cel, int rank)
|
||||
}
|
||||
|
||||
// Indique si une cellule est libre.
|
||||
// Est utilisé pour savoir si blupi peut venir ici
|
||||
// débarquer en bateau ou monter dans sa jeep.
|
||||
// Est utilisé pour savoir si blupi peut venir ici
|
||||
// débarquer en bateau ou monter dans sa jeep.
|
||||
|
||||
bool CDecor::IsFreeCelGo(POINT cel, int rank)
|
||||
{
|
||||
@ -1739,7 +1739,7 @@ bool CDecor::IsFreeCelGo(POINT cel, int rank)
|
||||
if ( bOK ) return true;
|
||||
|
||||
if ( !m_blupi[rank].bMalade &&
|
||||
m_blupi[rank].vehicule == 0 && // à pied ?
|
||||
m_blupi[rank].vehicule == 0 && // à pied ?
|
||||
m_blupi[rank].perso != 8 && // pas le disciple ?
|
||||
channel == CHOBJECT &&
|
||||
icon == 118 ) // jeep ?
|
||||
@ -1748,7 +1748,7 @@ bool CDecor::IsFreeCelGo(POINT cel, int rank)
|
||||
}
|
||||
|
||||
if ( !m_blupi[rank].bMalade &&
|
||||
m_blupi[rank].vehicule == 0 && // à pied ?
|
||||
m_blupi[rank].vehicule == 0 && // à pied ?
|
||||
m_blupi[rank].perso != 8 && // pas le disciple ?
|
||||
m_blupi[rank].energy > MAXENERGY/4 && // fort ?
|
||||
m_blupi[rank].takeChannel == -1 && // porte rien ?
|
||||
@ -1762,8 +1762,8 @@ bool CDecor::IsFreeCelGo(POINT cel, int rank)
|
||||
}
|
||||
|
||||
// Indique si on peut faire qq chose sur une cellule.
|
||||
// Est utilisé pour savoir comment est la mise en évidence (hili)
|
||||
// à cet endroit.
|
||||
// Est utilisé pour savoir comment est la mise en évidence (hili)
|
||||
// à cet endroit.
|
||||
|
||||
bool CDecor::IsFreeCelHili(POINT cel, int rank)
|
||||
{
|
||||
@ -1780,9 +1780,9 @@ bool CDecor::IsFreeCelHili(POINT cel, int rank)
|
||||
icon = m_decor[cel.x/2][cel.y/2].objectIcon;
|
||||
|
||||
if ( channel == CHOBJECT &&
|
||||
(icon == 12 || // fusée ?
|
||||
(icon == 12 || // fusée ?
|
||||
(icon >= 20 && icon <= 26) || // mur ?
|
||||
(icon >= 106 && icon <= 112) || // barrière ?
|
||||
(icon >= 106 && icon <= 112) || // barrière ?
|
||||
(icon >= 99 && icon <= 105) || // batiment ennemi ?
|
||||
(icon >= 115 && icon <= 116) || // idem ?
|
||||
(icon >= 17 && icon <= 18)) ) // idem ?
|
||||
@ -1806,7 +1806,7 @@ bool CDecor::IsFreeCelHili(POINT cel, int rank)
|
||||
}
|
||||
|
||||
// Indique si une cellule est libre.
|
||||
// Est utilisé pour savoir si blupi peut venir ici.
|
||||
// Est utilisé pour savoir si blupi peut venir ici.
|
||||
|
||||
bool CDecor::IsFreeCel(POINT cel, int rank)
|
||||
{
|
||||
@ -1818,7 +1818,7 @@ bool CDecor::IsFreeCel(POINT cel, int rank)
|
||||
if ( m_decor[cel.x/2][cel.y/2].fire > 0 &&
|
||||
m_decor[cel.x/2][cel.y/2].fire < MoveMaxFire() ) return false;
|
||||
|
||||
// Cellule bloquée (un blupi travaille ici) ?
|
||||
// Cellule bloquée (un blupi travaille ici) ?
|
||||
if ( rank != -1 && m_blupi[rank].perso != 3 ) // pas tracks ?
|
||||
{
|
||||
workBlupi = m_decor[cel.x/2][cel.y/2].workBlupi;
|
||||
@ -1838,7 +1838,7 @@ bool CDecor::IsFreeCel(POINT cel, int rank)
|
||||
return true; // pas d'obstacle
|
||||
}
|
||||
|
||||
// Indique si blupi peut déposer un objet ici.
|
||||
// Indique si blupi peut déposer un objet ici.
|
||||
|
||||
bool CDecor::IsFreeCelDepose(POINT cel, int rank)
|
||||
{
|
||||
@ -1847,14 +1847,14 @@ bool CDecor::IsFreeCelDepose(POINT cel, int rank)
|
||||
if ( !IsFreeCel(cel, rank) ) return false;
|
||||
|
||||
icon = m_decor[cel.x/2][cel.y/2].objectIcon;
|
||||
if ( icon == 10000 || icon == 10001 || // éclairs entre tours ?
|
||||
if ( icon == 10000 || icon == 10001 || // éclairs entre tours ?
|
||||
icon == 18 ) // dalle glissante ?
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
icon = m_decor[cel.x/2][cel.y/2].floorIcon;
|
||||
if ( icon == 80 ) // téléporteur ?
|
||||
if ( icon == 80 ) // téléporteur ?
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -1863,7 +1863,7 @@ bool CDecor::IsFreeCelDepose(POINT cel, int rank)
|
||||
}
|
||||
|
||||
// Indique s'il est possible d'embarquer ici.
|
||||
// Le point retourné dans "limit" indique jusqu'où il est
|
||||
// Le point retourné dans "limit" indique jusqu'où il est
|
||||
// possible de marcher normalement (sans passe muraille).
|
||||
|
||||
bool CDecor::IsFreeCelEmbarque(POINT cel, int rank,
|
||||
@ -1872,12 +1872,12 @@ bool CDecor::IsFreeCelEmbarque(POINT cel, int rank,
|
||||
bool bOK;
|
||||
int channel, icon;
|
||||
|
||||
// Impossible si blupi n'est pas à pied,
|
||||
// Impossible si blupi n'est pas à pied,
|
||||
// ou s'il s'agit d'un disciple.
|
||||
if ( rank == -1 || m_blupi[rank].vehicule != 0 ||
|
||||
m_blupi[rank].perso == 8 ) return false;
|
||||
|
||||
// A-t-on cliqué sur un bateau ?
|
||||
// A-t-on cliqué sur un bateau ?
|
||||
if ( cel.x%2 != 1 || cel.y%2 != 1 ) return false;
|
||||
GetObject(cel, channel, icon);
|
||||
if ( channel != CHOBJECT || icon != 117 ) return false;
|
||||
@ -1941,8 +1941,8 @@ bool CDecor::IsFreeCelEmbarque(POINT cel, int rank,
|
||||
return false;
|
||||
}
|
||||
|
||||
// Indique s'il est possible de débarquer ici.
|
||||
// Le point retourné dans "limit" indique jusqu'où il est
|
||||
// Indique s'il est possible de débarquer ici.
|
||||
// Le point retourné dans "limit" indique jusqu'où il est
|
||||
// possible de naviguer normalement (sans passe muraille).
|
||||
|
||||
bool CDecor::IsFreeCelDebarque(POINT cel, int rank,
|
||||
@ -1956,14 +1956,14 @@ bool CDecor::IsFreeCelDebarque(POINT cel, int rank,
|
||||
if ( rank == -1 || m_blupi[rank].vehicule != 1 ) return false;
|
||||
|
||||
m_blupi[rank].vehicule = 0;
|
||||
bOK = IsFreeCel(cel, rank); // libre (à pied) ?
|
||||
bOK = IsFreeCel(cel, rank); // libre (à pied) ?
|
||||
m_blupi[rank].vehicule = 1;
|
||||
if ( !bOK ) return false;
|
||||
|
||||
GetFloor(GetCel(cel,+2,0), channel1, icon1);
|
||||
GetObject(GetCel(cel,+2,0), channel2, icon2);
|
||||
if ( channel1 == CHFLOOR && icon1 == 2 && // rive ?
|
||||
channel2 == -1 && icon2 == -1 && // pas de bateau amarré ?
|
||||
channel2 == -1 && icon2 == -1 && // pas de bateau amarré ?
|
||||
cel.x%2 == 1 && cel.y%2 == 1 )
|
||||
{
|
||||
limit = GetCel(cel,+3,0);
|
||||
@ -1974,7 +1974,7 @@ bool CDecor::IsFreeCelDebarque(POINT cel, int rank,
|
||||
GetFloor(GetCel(cel,0,+2), channel1, icon1);
|
||||
GetObject(GetCel(cel,0,+2), channel2, icon2);
|
||||
if ( channel1 == CHFLOOR && icon1 == 3 && // rive ?
|
||||
channel2 == -1 && icon2 == -1 && // pas de bateau amarré ?
|
||||
channel2 == -1 && icon2 == -1 && // pas de bateau amarré ?
|
||||
cel.x%2 == 1 && cel.y%2 == 1 )
|
||||
{
|
||||
limit = GetCel(cel,0,+3);
|
||||
@ -1985,7 +1985,7 @@ bool CDecor::IsFreeCelDebarque(POINT cel, int rank,
|
||||
GetFloor(GetCel(cel,-2,0), channel1, icon1);
|
||||
GetObject(GetCel(cel,-2,0), channel2, icon2);
|
||||
if ( channel1 == CHFLOOR && icon1 == 4 && // rive ?
|
||||
channel2 == -1 && icon2 == -1 && // pas de bateau amarré ?
|
||||
channel2 == -1 && icon2 == -1 && // pas de bateau amarré ?
|
||||
cel.x%2 == 0 && cel.y%2 == 1 )
|
||||
{
|
||||
limit = GetCel(cel,-2,0);
|
||||
@ -1996,7 +1996,7 @@ bool CDecor::IsFreeCelDebarque(POINT cel, int rank,
|
||||
GetFloor(GetCel(cel,0,-2), channel1, icon1);
|
||||
GetObject(GetCel(cel,0,-2), channel2, icon2);
|
||||
if ( channel1 == CHFLOOR && icon1 == 5 && // rive ?
|
||||
channel2 == -1 && icon2 == -1 && // pas de bateau amarré ?
|
||||
channel2 == -1 && icon2 == -1 && // pas de bateau amarré ?
|
||||
cel.x%2 == 1 && cel.y%2 == 0 )
|
||||
{
|
||||
limit = GetCel(cel,0,-2);
|
||||
@ -2015,13 +2015,13 @@ bool CDecor::IsFreeJump(POINT cel, int direct, int rank, int &action)
|
||||
int i, icon;
|
||||
int bits[3*3];
|
||||
|
||||
// Refuse de sauter si blupi n'est pas à pied !
|
||||
// Refuse de sauter si blupi n'est pas à pied !
|
||||
if ( m_blupi[rank].vehicule != 0 ) return false;
|
||||
|
||||
// Refuse de sauter dans les directions se, so, no, ne.
|
||||
if ( (direct/16)%2 != 0 ) return false;
|
||||
|
||||
// Refuse de sauter si peu d'énergie ou si porte qq chose.
|
||||
// Refuse de sauter si peu d'énergie ou si porte qq chose.
|
||||
if ( m_blupi[rank].perso != 0 ||
|
||||
m_blupi[rank].energy <= MAXENERGY/4 ||
|
||||
m_blupi[rank].takeChannel != -1 ) return false;
|
||||
@ -2041,13 +2041,13 @@ bool CDecor::IsFreeJump(POINT cel, int direct, int rank, int &action)
|
||||
}
|
||||
if ( i == 0 ) return false;
|
||||
|
||||
// Départ possible par-rapport aux obstacles ?
|
||||
// Départ possible par-rapport aux obstacles ?
|
||||
icon = m_decor[depart.x/2][depart.y/2].objectIcon;
|
||||
SearchObject(rank, icon, depart, bits);
|
||||
AjustObject(rank, icon, depart, bits);
|
||||
if ( bits[(1+vector.x)+(1+vector.y)*3] == 1 ) return false;
|
||||
|
||||
// Arrivée possible par-rapport aux obstacles ?
|
||||
// Arrivée possible par-rapport aux obstacles ?
|
||||
icon = m_decor[cel.x/2][cel.y/2].objectIcon;
|
||||
SearchObject(rank, icon, cel, bits);
|
||||
AjustObject(rank, icon, cel, bits);
|
||||
@ -2083,7 +2083,7 @@ bool CDecor::IsFreeGlisse(POINT cel, int direct, int rank, int &action)
|
||||
|
||||
|
||||
// Cherche la meilleure direction pour atteindre un but.
|
||||
// Retourne -1 si on est déjà sur le but.
|
||||
// Retourne -1 si on est déjà sur le but.
|
||||
|
||||
int CDecor::DirectSearch(POINT cel, POINT goal)
|
||||
{
|
||||
@ -2120,7 +2120,7 @@ int CDecor::DirectSearch(POINT cel, POINT goal)
|
||||
}
|
||||
#endif
|
||||
|
||||
// Cherche le huitième de cadrant correspondant à
|
||||
// Cherche le huitième de cadrant correspondant à
|
||||
// la direction.
|
||||
// 41 = 100*tan(22.5)
|
||||
// 241 = 100*tan(67.5)
|
||||
@ -2169,7 +2169,7 @@ int CDecor::DirectSearch(POINT cel, POINT goal)
|
||||
}
|
||||
|
||||
|
||||
// Vide les positions déjà essayées.
|
||||
// Vide les positions déjà essayées.
|
||||
|
||||
void CDecor::FlushUsed(int rank)
|
||||
{
|
||||
@ -2177,16 +2177,16 @@ void CDecor::FlushUsed(int rank)
|
||||
m_blupi[rank].nextRankUsed = 0;
|
||||
}
|
||||
|
||||
// Ajoute une position déjà été essayée.
|
||||
// Ajoute une position déjà été essayée.
|
||||
|
||||
void CDecor::AddUsedPos(int rank, POINT pos)
|
||||
{
|
||||
int i, j, old;
|
||||
|
||||
// Un virus est bête.
|
||||
// Un virus est bête.
|
||||
if ( m_blupi[rank].perso == 2 ) return;
|
||||
|
||||
// Déjà dans la liste ?
|
||||
// Déjà dans la liste ?
|
||||
for ( i=0 ; i<m_blupi[rank].nbUsed ; i++ )
|
||||
{
|
||||
if ( pos.x == m_blupi[rank].posUsed[i].x &&
|
||||
@ -2217,7 +2217,7 @@ void CDecor::AddUsedPos(int rank, POINT pos)
|
||||
return;
|
||||
}
|
||||
|
||||
// Ajoute à la suite de la liste.
|
||||
// Ajoute à la suite de la liste.
|
||||
i = m_blupi[rank].nbUsed;
|
||||
|
||||
m_blupi[rank].posUsed[i] = pos;
|
||||
@ -2227,7 +2227,7 @@ void CDecor::AddUsedPos(int rank, POINT pos)
|
||||
return;
|
||||
}
|
||||
|
||||
// Cherche si une position a déjà été essayée.
|
||||
// Cherche si une position a déjà été essayée.
|
||||
|
||||
bool CDecor::IsUsedPos(int rank, POINT pos)
|
||||
{
|
||||
@ -2302,7 +2302,7 @@ bool CDecor::SearchBestBase(int rank, int &action, POINT &newCel, int &direct)
|
||||
if ( m_blupi[rank].perso == 3 ) // tracks ?
|
||||
{
|
||||
// Le tracks peut aller sur les blupi
|
||||
// pour les écraser !
|
||||
// pour les écraser !
|
||||
if ( IsTracksHere(newCel, false) )
|
||||
{
|
||||
continue;
|
||||
@ -2348,10 +2348,10 @@ bool CDecor::SearchBestPass(int rank, int &action)
|
||||
POINT iCel, lCel, cel;
|
||||
|
||||
if ( m_blupi[rank].perso == 0 || // blupi ?
|
||||
m_blupi[rank].perso == 7 || // électro ?
|
||||
m_blupi[rank].perso == 7 || // électro ?
|
||||
m_blupi[rank].perso == 8 || // disciple ?
|
||||
(m_blupi[rank].perso == 4 && // robot ?
|
||||
m_term.bHachRobot ) ) // robot sur dalles hachurées ?
|
||||
m_term.bHachRobot ) ) // robot sur dalles hachurées ?
|
||||
{
|
||||
if ( m_blupi[rank].busyDelay > 0 )
|
||||
{
|
||||
@ -2363,20 +2363,20 @@ bool CDecor::SearchBestPass(int rank, int &action)
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if ( CheminCherche(rank, action) ) // recherche futée selon DD ...
|
||||
if ( CheminCherche(rank, action) ) // recherche futée selon DD ...
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Si la destination est occupée pendant une répétition,
|
||||
// il faut attendre à l'infini !
|
||||
// Si la destination est occupée pendant une répétition,
|
||||
// il faut attendre à l'infini !
|
||||
if ( m_blupi[rank].repeatLevel != -1 &&
|
||||
IsBlupiHereEx(m_blupi[rank].goalCel, rank, false) )
|
||||
{
|
||||
m_blupi[rank].busyCount ++;
|
||||
}
|
||||
m_blupi[rank].busyDelay = Random(8,12); // délai avant réessai
|
||||
m_blupi[rank].busyDelay = Random(8,12); // délai avant réessai
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -2404,8 +2404,8 @@ bool CDecor::SearchBestPass(int rank, int &action)
|
||||
m_blupi[rank].cel = cel;
|
||||
lCel = cel;
|
||||
|
||||
// Est-on revenu juste à côté de la position
|
||||
// de départ ? Si oui, simplifie le mouvement.
|
||||
// Est-on revenu juste à côté de la position
|
||||
// de départ ? Si oui, simplifie le mouvement.
|
||||
if ( i > 1 &&
|
||||
abs(m_blupi[rank].cel.x-iCel.x) <= 1 &&
|
||||
abs(m_blupi[rank].cel.y-iCel.y) <= 1 )
|
||||
@ -2450,9 +2450,9 @@ bool CDecor::SearchBestPass(int rank, int &action)
|
||||
}
|
||||
|
||||
|
||||
// Vérifie si un objet est utilisable pour travailler dessus.
|
||||
// Vérifie si un objet est utilisable pour travailler dessus.
|
||||
// Le sol doit permettre d'aller aux 4 coins, et il ne doit
|
||||
// pas y avoir un autre blupi que soi-même.
|
||||
// pas y avoir un autre blupi que soi-même.
|
||||
|
||||
bool CDecor::IsWorkableObject(POINT cel, int rank)
|
||||
{
|
||||
@ -2621,7 +2621,7 @@ bool CDecor::SearchOtherDrapeau(int rank, POINT initCel, int distMax,
|
||||
if ( m_decor[x/2][y/2].objectIcon == -1 &&
|
||||
((icon >= 33 && icon <= 48) || // terre ?
|
||||
icon == 71 ) &&
|
||||
!TestDrapeau(GetCel(x,y)) ) // pas encore sondé ?
|
||||
!TestDrapeau(GetCel(x,y)) ) // pas encore sondé ?
|
||||
{
|
||||
cel.x = x;
|
||||
cel.y = y;
|
||||
@ -2644,7 +2644,7 @@ bool CDecor::SearchOtherDrapeau(int rank, POINT initCel, int distMax,
|
||||
return true;
|
||||
}
|
||||
|
||||
// Cherche un autre sol permettant de déposer du bois
|
||||
// Cherche un autre sol permettant de déposer du bois
|
||||
// pour construire un bateau.
|
||||
|
||||
bool CDecor::SearchOtherBateau(int rank, POINT initCel, int distMax,
|
||||
@ -2686,16 +2686,16 @@ bool CDecor::SearchOtherBateau(int rank, POINT initCel, int distMax,
|
||||
}
|
||||
|
||||
|
||||
// Vérifie si l'objet peut être détruit par l'araignée.
|
||||
// Vérifie si l'objet peut être détruit par l'araignée.
|
||||
|
||||
bool CDecor::IsSpiderObject(int icon)
|
||||
{
|
||||
return ( icon == 60 || // tomates ?
|
||||
icon == 92 || // poison ?
|
||||
icon == 93 ); // piège ?
|
||||
icon == 93 ); // piège ?
|
||||
}
|
||||
|
||||
// Cherche un autre objet pour l'araignée.
|
||||
// Cherche un autre objet pour l'araignée.
|
||||
|
||||
bool CDecor::SearchSpiderObject(int rank, POINT initCel, int distMax,
|
||||
POINT &foundCel, int &foundIcon)
|
||||
@ -2727,8 +2727,8 @@ bool CDecor::SearchSpiderObject(int rank, POINT initCel, int distMax,
|
||||
|
||||
dist = abs(initCel.x-x) + abs(initCel.y-y);
|
||||
|
||||
if ( m_decor[x/2][y/2].objectIcon == 93 && //piège ?
|
||||
dist > 4 ) continue; // si piège loin -> ignore
|
||||
if ( m_decor[x/2][y/2].objectIcon == 93 && //piège ?
|
||||
dist > 4 ) continue; // si piège loin -> ignore
|
||||
|
||||
if ( dist <= min )
|
||||
{
|
||||
@ -2747,7 +2747,7 @@ bool CDecor::SearchSpiderObject(int rank, POINT initCel, int distMax,
|
||||
}
|
||||
|
||||
|
||||
// Vérifie si l'objet peut être détruit par le tracks.
|
||||
// Vérifie si l'objet peut être détruit par le tracks.
|
||||
|
||||
bool CDecor::IsTracksObject(int icon)
|
||||
{
|
||||
@ -2758,8 +2758,8 @@ bool CDecor::IsTracksObject(int icon)
|
||||
icon == 80 || // bouteille ?
|
||||
icon == 85 || // dynamite ?
|
||||
icon == 92 || // poison ?
|
||||
icon == 93 || // piège ?
|
||||
icon == 123 || // piège ?
|
||||
icon == 93 || // piège ?
|
||||
icon == 123 || // piège ?
|
||||
icon == 125 || // mine ?
|
||||
icon == 127 || // mine ?
|
||||
(icon >= 81 && icon <= 84) || // fleurs ?
|
||||
@ -2809,12 +2809,12 @@ bool CDecor::SearchTracksObject(int rank, POINT initCel, int distMax,
|
||||
}
|
||||
}
|
||||
|
||||
// Le tracks peut écraser blupi.
|
||||
// Le tracks peut écraser blupi.
|
||||
for ( rank=0 ; rank<MAXBLUPI ; rank++ )
|
||||
{
|
||||
if ( m_blupi[rank].bExist &&
|
||||
m_blupi[rank].perso == 0 && // blupi ?
|
||||
m_blupi[rank].vehicule == 0 ) // à pied ?
|
||||
m_blupi[rank].vehicule == 0 ) // à pied ?
|
||||
{
|
||||
//? if ( BlupiIsGoalUsed(m_blupi[rank].cel) ) continue;
|
||||
|
||||
@ -2847,12 +2847,12 @@ bool CDecor::SearchTracksObject(int rank, POINT initCel, int distMax,
|
||||
}
|
||||
|
||||
|
||||
// Vérifie si l'objet peut être détruit par le robot.
|
||||
// Vérifie si l'objet peut être détruit par le robot.
|
||||
|
||||
bool CDecor::IsRobotObject(int icon)
|
||||
{
|
||||
return ( icon == 85 || // dynamite ?
|
||||
icon == 93 || // piège ?
|
||||
icon == 93 || // piège ?
|
||||
icon == 125 || // mine ?
|
||||
icon == 127 ); // mine ?
|
||||
}
|
||||
@ -2871,7 +2871,7 @@ bool CDecor::SearchRobotObject(int rank, POINT initCel, int distMax,
|
||||
int nbPerso[10];
|
||||
int i, r, d, dd, icon, index, nb;
|
||||
|
||||
if ( m_term.bHachRobot ) // robot sur dalles hachurées ?
|
||||
if ( m_term.bHachRobot ) // robot sur dalles hachurées ?
|
||||
{
|
||||
foundAction = WM_ACTION_GO;
|
||||
return SearchOtherObject(rank, initCel, WM_ACTION_GO,
|
||||
@ -2880,7 +2880,7 @@ bool CDecor::SearchRobotObject(int rank, POINT initCel, int distMax,
|
||||
}
|
||||
|
||||
initCel.x = (initCel.x/2)*2;
|
||||
initCel.y = (initCel.y/2)*2; // bâtiments très espacés !
|
||||
initCel.y = (initCel.y/2)*2; // bâtiments très espacés !
|
||||
|
||||
startx = ((initCel.x-distMax/2)/2)*2;
|
||||
endx = ((initCel.x+distMax/2)/2)*2;
|
||||
@ -2905,15 +2905,15 @@ bool CDecor::SearchRobotObject(int rank, POINT initCel, int distMax,
|
||||
|
||||
if ( icon == 99 ) nbUsine[0] ++; // recharge ?
|
||||
if ( icon == 104 ) nbUsine[1] ++; // usine tracks ?
|
||||
if ( icon == 100 ) nbUsine[2] ++; // usine araignée ?
|
||||
if ( icon == 100 ) nbUsine[2] ++; // usine araignée ?
|
||||
if ( icon == 102 ) nbUsine[3] ++; // usine virus ?
|
||||
if ( icon == 115 ) nbUsine[4] ++; // usine bombe ?
|
||||
if ( icon == 17 ) nbUsine[5] ++; // usine électro ?
|
||||
if ( icon == 17 ) nbUsine[5] ++; // usine électro ?
|
||||
|
||||
dist = abs(initCel.x-x) + abs(initCel.y-y);
|
||||
|
||||
if ( IsRobotObject(icon) && // piège/dynamite ?
|
||||
dist <= 4 ) // très proche ?
|
||||
if ( IsRobotObject(icon) && // piège/dynamite ?
|
||||
dist <= 4 ) // très proche ?
|
||||
{
|
||||
if ( dist <= min )
|
||||
{
|
||||
@ -2928,7 +2928,7 @@ bool CDecor::SearchRobotObject(int rank, POINT initCel, int distMax,
|
||||
|
||||
if ( min < distMax )
|
||||
{
|
||||
foundAction = -1; // robot passe tout prèt d'un piège/dynamite
|
||||
foundAction = -1; // robot passe tout prèt d'un piège/dynamite
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -2956,7 +2956,7 @@ bool CDecor::SearchRobotObject(int rank, POINT initCel, int distMax,
|
||||
//? goto search;
|
||||
//? }
|
||||
|
||||
if ( min == 0 ) // encore une usine à construire ?
|
||||
if ( min == 0 ) // encore une usine à construire ?
|
||||
{
|
||||
// Libre juste ici ?
|
||||
if ( IsUsineBuild(rank, initCel) )
|
||||
@ -2965,10 +2965,10 @@ bool CDecor::SearchRobotObject(int rank, POINT initCel, int distMax,
|
||||
build:
|
||||
if ( index == 0 ) foundAction = WM_ACTION_R_BUILD1; // recharge
|
||||
if ( index == 1 ) foundAction = WM_ACTION_R_BUILD4; // tracks
|
||||
if ( index == 2 ) foundAction = WM_ACTION_R_BUILD2; // araignée
|
||||
if ( index == 2 ) foundAction = WM_ACTION_R_BUILD2; // araignée
|
||||
if ( index == 3 ) foundAction = WM_ACTION_R_BUILD3; // virus
|
||||
if ( index == 4 ) foundAction = WM_ACTION_R_BUILD5; // bombe
|
||||
if ( index == 5 ) foundAction = WM_ACTION_R_BUILD6; // électro
|
||||
if ( index == 5 ) foundAction = WM_ACTION_R_BUILD6; // électro
|
||||
return true;
|
||||
}
|
||||
// Cherche un emplacement libre.
|
||||
@ -2980,9 +2980,9 @@ bool CDecor::SearchRobotObject(int rank, POINT initCel, int distMax,
|
||||
{
|
||||
for ( dd=0 ; dd<=d ; dd++ )
|
||||
{
|
||||
if ( i == 0 ) x -= 6; // à gauche
|
||||
if ( i == 0 ) x -= 6; // à gauche
|
||||
if ( i == 1 ) y += 6; // descend
|
||||
if ( i == 2 ) x += 6; // à droite
|
||||
if ( i == 2 ) x += 6; // à droite
|
||||
if ( i == 3 ) y -= 6; // monte
|
||||
|
||||
if ( IsUsineBuild(rank, GetCel(x,y)) )
|
||||
@ -2996,7 +2996,7 @@ bool CDecor::SearchRobotObject(int rank, POINT initCel, int distMax,
|
||||
}
|
||||
}
|
||||
|
||||
// Cherche l'ennemi le moins répandu.
|
||||
// Cherche l'ennemi le moins répandu.
|
||||
for ( i=0 ; i<10 ; i++ )
|
||||
{
|
||||
nbPerso[i] = 0;
|
||||
@ -3011,7 +3011,7 @@ bool CDecor::SearchRobotObject(int rank, POINT initCel, int distMax,
|
||||
{
|
||||
nbPerso[0] += 1;
|
||||
}
|
||||
if ( m_blupi[r].perso == 1 ) // araignée ?
|
||||
if ( m_blupi[r].perso == 1 ) // araignée ?
|
||||
{
|
||||
nbPerso[1] += 1;
|
||||
}
|
||||
@ -3023,14 +3023,14 @@ bool CDecor::SearchRobotObject(int rank, POINT initCel, int distMax,
|
||||
{
|
||||
nbPerso[3] += 2;
|
||||
}
|
||||
if ( m_blupi[r].perso == 7 ) // électro ?
|
||||
if ( m_blupi[r].perso == 7 ) // électro ?
|
||||
{
|
||||
nbPerso[4] += 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( nb > MAXBLUPI-10 ) return false; // rien si trop peuplé !
|
||||
// Cherche l'ennemi le moins répandu.
|
||||
if ( nb > MAXBLUPI-10 ) return false; // rien si trop peuplé !
|
||||
// Cherche l'ennemi le moins répandu.
|
||||
min = 999;
|
||||
index = 0;
|
||||
for ( i=0 ; i<5 ; i++ )
|
||||
@ -3047,12 +3047,12 @@ bool CDecor::SearchRobotObject(int rank, POINT initCel, int distMax,
|
||||
index = 0; // station de recharge
|
||||
}
|
||||
if ( m_skill >= 1 ) maxUsine *= 2; // 2 ennemis par batiment
|
||||
if ( min >= maxUsine ) // assez peuplé ?
|
||||
if ( min >= maxUsine ) // assez peuplé ?
|
||||
{
|
||||
index = 0; // station de recharge
|
||||
}
|
||||
|
||||
// Cherche l'usine pour fabriquer l'ennemi le moins rédandu.
|
||||
// Cherche l'usine pour fabriquer l'ennemi le moins rédandu.
|
||||
//? search:
|
||||
min = distMax;
|
||||
for ( y=starty ; y<endy ; y+=2 )
|
||||
@ -3063,10 +3063,10 @@ bool CDecor::SearchRobotObject(int rank, POINT initCel, int distMax,
|
||||
|
||||
if ( (index == 0 && icon == 99) || // recharge ?
|
||||
(index == 1 && icon == 104) || // tracks ?
|
||||
(index == 2 && icon == 100) || // araignée ?
|
||||
(index == 2 && icon == 100) || // araignée ?
|
||||
(index == 3 && icon == 102) || // virus ?
|
||||
(index == 4 && icon == 115) || // bombe ?
|
||||
(index == 5 && icon == 17) ) // électro ?
|
||||
(index == 5 && icon == 17) ) // électro ?
|
||||
{
|
||||
if ( IsUsineFree(rank, GetCel(x,y)) )
|
||||
{
|
||||
@ -3086,10 +3086,10 @@ bool CDecor::SearchRobotObject(int rank, POINT initCel, int distMax,
|
||||
{
|
||||
if ( index == 0 ) foundAction = WM_ACTION_R_MAKE1; // recharge
|
||||
if ( index == 1 ) foundAction = WM_ACTION_R_MAKE4; // tracks
|
||||
if ( index == 2 ) foundAction = WM_ACTION_R_MAKE2; // araignée
|
||||
if ( index == 2 ) foundAction = WM_ACTION_R_MAKE2; // araignée
|
||||
if ( index == 3 ) foundAction = WM_ACTION_R_MAKE3; // virus
|
||||
if ( index == 4 ) foundAction = WM_ACTION_R_MAKE5; // bombe
|
||||
if ( index == 5 ) foundAction = WM_ACTION_R_MAKE6; // électro
|
||||
if ( index == 5 ) foundAction = WM_ACTION_R_MAKE6; // électro
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -3101,11 +3101,11 @@ bool CDecor::SearchRobotObject(int rank, POINT initCel, int distMax,
|
||||
{
|
||||
icon = m_decor[x/2][y/2].objectIcon;
|
||||
|
||||
if ( (icon == 100 && nbPerso[1] <= maxUsine) || // araignée ?
|
||||
if ( (icon == 100 && nbPerso[1] <= maxUsine) || // araignée ?
|
||||
(icon == 102 && nbPerso[2] <= maxUsine) || // virus ?
|
||||
(icon == 104 && nbPerso[0] <= maxUsine) || // tracks ?
|
||||
(icon == 115 && nbPerso[3] <= maxUsine) || // bombe ?
|
||||
(icon == 17 && nbPerso[4] <= maxUsine) ) // électro ?
|
||||
(icon == 17 && nbPerso[4] <= maxUsine) ) // électro ?
|
||||
{
|
||||
if ( IsUsineFree(rank, GetCel(x,y)) )
|
||||
{
|
||||
@ -3123,25 +3123,25 @@ bool CDecor::SearchRobotObject(int rank, POINT initCel, int distMax,
|
||||
}
|
||||
if ( min < distMax )
|
||||
{
|
||||
if ( foundIcon == 100 ) foundAction = WM_ACTION_R_MAKE2; // araignée
|
||||
if ( foundIcon == 100 ) foundAction = WM_ACTION_R_MAKE2; // araignée
|
||||
if ( foundIcon == 102 ) foundAction = WM_ACTION_R_MAKE3; // virus
|
||||
if ( foundIcon == 104 ) foundAction = WM_ACTION_R_MAKE4; // tracks
|
||||
if ( foundIcon == 115 ) foundAction = WM_ACTION_R_MAKE5; // bombe
|
||||
if ( foundIcon == 17 ) foundAction = WM_ACTION_R_MAKE6; // électro
|
||||
if ( foundIcon == 17 ) foundAction = WM_ACTION_R_MAKE6; // électro
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Teste si un emplacement est ok pour bâtir une usine.
|
||||
// Teste si un emplacement est ok pour bâtir une usine.
|
||||
|
||||
bool CDecor::IsUsineBuild(int rank, POINT cel)
|
||||
{
|
||||
int icon, channel;
|
||||
int x, y;
|
||||
|
||||
// Pas sur les dalles hachurées !
|
||||
// Pas sur les dalles hachurées !
|
||||
GetFloor(cel, channel, icon);
|
||||
if ( channel == CHFLOOR &&
|
||||
(icon < 65 || icon > 67) ) return false;
|
||||
@ -3162,7 +3162,7 @@ bool CDecor::IsUsineBuild(int rank, POINT cel)
|
||||
}
|
||||
|
||||
// Teste s'il est possible d'entrer dans une usine.
|
||||
// L'usine doit être libre devant (lieu de stationnement
|
||||
// L'usine doit être libre devant (lieu de stationnement
|
||||
// pour l'ennemi qui sera construit).
|
||||
|
||||
bool CDecor::IsUsineFree(int rank, POINT cel)
|
||||
@ -3171,7 +3171,7 @@ bool CDecor::IsUsineFree(int rank, POINT cel)
|
||||
|
||||
GetObject(cel, channel, icon);
|
||||
|
||||
if ( channel == CHOBJECT && icon == 115 ) // usine à bombes ?
|
||||
if ( channel == CHOBJECT && icon == 115 ) // usine à bombes ?
|
||||
{
|
||||
return ( !IsBlupiHereEx(GetCel(cel,0,1), rank, false) &&
|
||||
!IsBlupiHereEx(GetCel(cel,1,1), rank, false) &&
|
||||
@ -3188,7 +3188,7 @@ bool CDecor::IsUsineFree(int rank, POINT cel)
|
||||
}
|
||||
|
||||
|
||||
// Vérifie si l'objet peut être détruit par une bombe.
|
||||
// Vérifie si l'objet peut être détruit par une bombe.
|
||||
|
||||
bool CDecor::IsBombeObject(int icon)
|
||||
{
|
||||
@ -3196,7 +3196,7 @@ bool CDecor::IsBombeObject(int icon)
|
||||
icon == 61 || // cabane ?
|
||||
icon == 121 || icon == 122 || // mine de fer ?
|
||||
(icon >= 65 && icon <= 71) || // palissade ?
|
||||
icon == 93 || // piège ?
|
||||
icon == 93 || // piège ?
|
||||
icon == 117 ); // bateau ?
|
||||
}
|
||||
|
||||
@ -3232,8 +3232,8 @@ bool CDecor::SearchBombeObject(int rank, POINT initCel, int distMax,
|
||||
|
||||
dist = abs(initCel.x-x) + abs(initCel.y-y);
|
||||
|
||||
if ( m_decor[x/2][y/2].objectIcon == 93 && //piège ?
|
||||
dist > 8 ) continue; // si piège loin -> ignore
|
||||
if ( m_decor[x/2][y/2].objectIcon == 93 && //piège ?
|
||||
dist > 8 ) continue; // si piège loin -> ignore
|
||||
|
||||
if ( dist <= min )
|
||||
{
|
||||
@ -3251,7 +3251,7 @@ bool CDecor::SearchBombeObject(int rank, POINT initCel, int distMax,
|
||||
return true;
|
||||
}
|
||||
|
||||
// Cherche un autre objet pour un électro.
|
||||
// Cherche un autre objet pour un électro.
|
||||
|
||||
bool CDecor::SearchElectroObject(int rank, POINT initCel, int distMax,
|
||||
POINT &foundCel, int &foundIcon)
|
||||
@ -3275,7 +3275,7 @@ bool CDecor::SearchElectroObject(int rank, POINT initCel, int distMax,
|
||||
{
|
||||
for ( x=startx ; x<endx ; x+=2 )
|
||||
{
|
||||
if ( m_decor[x/2][y/2].objectIcon == 93 ) // piège ?
|
||||
if ( m_decor[x/2][y/2].objectIcon == 93 ) // piège ?
|
||||
{
|
||||
cel.x = x;
|
||||
cel.y = y;
|
||||
@ -3327,9 +3327,9 @@ bool CDecor::SearchElectroObject(int rank, POINT initCel, int distMax,
|
||||
{
|
||||
for ( dd=0 ; dd<=d ; dd++ )
|
||||
{
|
||||
if ( i == 0 ) x -= 1; // à gauche
|
||||
if ( i == 0 ) x -= 1; // à gauche
|
||||
if ( i == 1 ) y += 1; // descend
|
||||
if ( i == 2 ) x += 1; // à droite
|
||||
if ( i == 2 ) x += 1; // à droite
|
||||
if ( i == 3 ) y -= 1; // monte
|
||||
|
||||
if ( IsFreeCel(GetCel(x,y), rank) &&
|
||||
@ -3347,7 +3347,7 @@ bool CDecor::SearchElectroObject(int rank, POINT initCel, int distMax,
|
||||
}
|
||||
|
||||
|
||||
// Teste si une position est très proche du feu.
|
||||
// Teste si une position est très proche du feu.
|
||||
// Si oui, retourne true.
|
||||
|
||||
bool CDecor::IsFireCel(POINT cel)
|
||||
@ -3375,7 +3375,7 @@ bool CDecor::IsFireCel(POINT cel)
|
||||
return false;
|
||||
}
|
||||
|
||||
// Teste si une position est très proche d'un virus.
|
||||
// Teste si une position est très proche d'un virus.
|
||||
// Si oui, retourne true.
|
||||
|
||||
bool CDecor::IsVirusCel(POINT cel)
|
||||
@ -3398,8 +3398,8 @@ bool CDecor::IsVirusCel(POINT cel)
|
||||
}
|
||||
|
||||
|
||||
// Regarde s'il est possible de construire un pont à partir
|
||||
// d'une cellule donnée (cel).
|
||||
// Regarde s'il est possible de construire un pont à partir
|
||||
// d'une cellule donnée (cel).
|
||||
// Retourne 0 si c'est possible, ou une erreur autrement !
|
||||
|
||||
int CDecor::IsBuildPont(POINT &cel, int &iconBuild)
|
||||
@ -3497,7 +3497,7 @@ int CDecor::IsBuildPont(POINT &cel, int &iconBuild)
|
||||
if ( nb == 1 ) iconBuild = p1;
|
||||
else iconBuild = p2;
|
||||
|
||||
// Avance jusqu'à la rive opposée.
|
||||
// Avance jusqu'à la rive opposée.
|
||||
rest = 0;
|
||||
do
|
||||
{
|
||||
@ -3528,8 +3528,8 @@ int CDecor::IsBuildPont(POINT &cel, int &iconBuild)
|
||||
return error;
|
||||
}
|
||||
|
||||
// Regarde s'il est possible de construire un bateau à partir
|
||||
// d'une cellule donnée (cel).
|
||||
// Regarde s'il est possible de construire un bateau à partir
|
||||
// d'une cellule donnée (cel).
|
||||
|
||||
bool CDecor::IsBuildBateau(POINT cel, int &direct)
|
||||
{
|
||||
@ -3577,7 +3577,7 @@ bool CDecor::IsBuildBateau(POINT cel, int &direct)
|
||||
}
|
||||
|
||||
|
||||
// Vide toutes les positions visitées.
|
||||
// Vide toutes les positions visitées.
|
||||
|
||||
void CDecor::InitDrapeau()
|
||||
{
|
||||
@ -3590,13 +3590,13 @@ void CDecor::InitDrapeau()
|
||||
}
|
||||
}
|
||||
|
||||
// Mémorise une cellule visitée (ne contenant pas de fer).
|
||||
// Mémorise une cellule visitée (ne contenant pas de fer).
|
||||
|
||||
void CDecor::AddDrapeau(POINT cel)
|
||||
{
|
||||
int i;
|
||||
|
||||
if ( TestDrapeau(cel) ) return; // déjà dans la liste
|
||||
if ( TestDrapeau(cel) ) return; // déjà dans la liste
|
||||
|
||||
for ( i=MAXLASTDRAPEAU-1 ; i>0 ; i-- )
|
||||
{
|
||||
@ -3606,7 +3606,7 @@ void CDecor::AddDrapeau(POINT cel)
|
||||
m_lastDrapeau[0] = cel;
|
||||
}
|
||||
|
||||
// Supprime une cellule visitée (ne contenant pas de fer).
|
||||
// Supprime une cellule visitée (ne contenant pas de fer).
|
||||
|
||||
void CDecor::SubDrapeau(POINT cel)
|
||||
{
|
||||
@ -3623,7 +3623,7 @@ void CDecor::SubDrapeau(POINT cel)
|
||||
}
|
||||
}
|
||||
|
||||
// Teste si une cellule a déjà été visitée.
|
||||
// Teste si une cellule a déjà été visitée.
|
||||
|
||||
bool CDecor::TestDrapeau(POINT cel)
|
||||
{
|
||||
|
@ -72,7 +72,7 @@ CPixmap::~CPixmap()
|
||||
}
|
||||
}
|
||||
|
||||
// Cr<EFBFBD>e l'objet DirectDraw principal.
|
||||
// Cr�e l'objet DirectDraw principal.
|
||||
// Retourne false en cas d'erreur.
|
||||
|
||||
bool CPixmap::Create(POINT dim,
|
||||
@ -90,7 +90,7 @@ bool CPixmap::Create(POINT dim,
|
||||
return true;
|
||||
}
|
||||
|
||||
// Lib<EFBFBD>re les bitmaps.
|
||||
// Lib�re les bitmaps.
|
||||
|
||||
bool CPixmap::Flush()
|
||||
{
|
||||
@ -101,7 +101,7 @@ bool CPixmap::Flush()
|
||||
|
||||
void CPixmap::Fill(RECT rect, COLORREF color)
|
||||
{
|
||||
// <EFBFBD> faire si n<>cessaire ...
|
||||
// � faire si n�cessaire ...
|
||||
}
|
||||
|
||||
// Effectue un appel BltFast.
|
||||
@ -192,7 +192,7 @@ int CPixmap::BltFast(SDL_Texture *lpSDL, int channel, POINT dst, RECT rcRect)
|
||||
return res;
|
||||
}
|
||||
|
||||
// Cache une image contenant des ic<EFBFBD>nes.
|
||||
// Cache une image contenant des ic�nes.
|
||||
|
||||
bool CPixmap::Cache(int channel, const char *pFilename, POINT totalDim, POINT iconDim)
|
||||
{
|
||||
@ -284,14 +284,14 @@ bool CPixmap::Cache(int channel, SDL_Surface *surface, POINT totalDim)
|
||||
return true;
|
||||
}
|
||||
|
||||
// Modifie la r<EFBFBD>gion de clipping.
|
||||
// Modifie la r�gion de clipping.
|
||||
|
||||
void CPixmap::SetClipping(RECT clip)
|
||||
{
|
||||
m_clipRect = clip;
|
||||
}
|
||||
|
||||
// Retourne la r<EFBFBD>gion de clipping.
|
||||
// Retourne la r�gion de clipping.
|
||||
|
||||
RECT CPixmap::GetClipping()
|
||||
{
|
||||
@ -299,7 +299,7 @@ RECT CPixmap::GetClipping()
|
||||
}
|
||||
|
||||
|
||||
// Teste si un point fait partie d'une ic<EFBFBD>ne.
|
||||
// Teste si un point fait partie d'une ic�ne.
|
||||
|
||||
bool CPixmap::IsIconPixel(int channel, int rank, POINT pos)
|
||||
{
|
||||
@ -427,7 +427,7 @@ bool CPixmap::DrawIconPart(int chDst, int channel, int rank, POINT pos,
|
||||
return !BltFast (chDst, channel, pos, rect);
|
||||
}
|
||||
|
||||
// Dessine une partie d'image n'importe o<EFBFBD>.
|
||||
// Dessine une partie d'image n'importe o�.
|
||||
|
||||
bool CPixmap::DrawPart(int chDst, int channel, POINT dest, RECT rect, bool bMask)
|
||||
{
|
||||
@ -464,7 +464,7 @@ bool CPixmap::DrawImage(int chDst, int channel, RECT rect)
|
||||
}
|
||||
|
||||
|
||||
// Construit une ic<EFBFBD>ne en utilisant un masque.
|
||||
// Construit une ic�ne en utilisant un masque.
|
||||
|
||||
bool CPixmap::BuildIconMask(int channelMask, int rankMask,
|
||||
int channel, int rankSrc, int rankDst)
|
||||
@ -514,7 +514,7 @@ bool CPixmap::BuildIconMask(int channelMask, int rankMask,
|
||||
}
|
||||
|
||||
|
||||
// Affiche le pixmap <EFBFBD> l'<27>cran.
|
||||
// Affiche le pixmap � l'�cran.
|
||||
// Retourne false en cas d'erreur.
|
||||
|
||||
bool CPixmap::Display()
|
||||
|
@ -70,7 +70,7 @@ protected:
|
||||
|
||||
char m_filename[MAXIMAGE][20];
|
||||
POINT m_totalDim[MAXIMAGE]; // dimensions totale image
|
||||
POINT m_iconDim[MAXIMAGE]; // dimensions d'une ic<EFBFBD>ne
|
||||
POINT m_iconDim[MAXIMAGE]; // dimensions d'une ic�ne
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -84,7 +84,7 @@ bool CSound::Create()
|
||||
}
|
||||
|
||||
|
||||
// Retourne l'<EFBFBD>tat de DirectSound.
|
||||
// Retourne l'�tat de DirectSound.
|
||||
|
||||
bool CSound::GetEnable()
|
||||
{
|
||||
@ -92,7 +92,7 @@ bool CSound::GetEnable()
|
||||
}
|
||||
|
||||
|
||||
// Enclenche ou d<EFBFBD>clenche le son.
|
||||
// Enclenche ou d�clenche le son.
|
||||
|
||||
void CSound::SetState(bool bState)
|
||||
{
|
||||
@ -163,7 +163,7 @@ bool CSound::Cache(int channel, const char *pFilename)
|
||||
return true;
|
||||
}
|
||||
|
||||
// D<EFBFBD>charge un son.
|
||||
// D�charge un son.
|
||||
|
||||
void CSound::Flush(int channel)
|
||||
{
|
||||
@ -206,7 +206,7 @@ bool CSound::Play(int channel, int volume, Uint8 panLeft, Uint8 panRight)
|
||||
|
||||
// Fait entendre un son dans une image.
|
||||
// Si rank != -1, il indique le rang du blupi dont il faudra
|
||||
// <EFBFBD>ventuellement stopper le dernier son en cours !
|
||||
// �ventuellement stopper le dernier son en cours !
|
||||
|
||||
bool CSound::PlayImage(int channel, POINT pos, int rank)
|
||||
{
|
||||
@ -347,7 +347,7 @@ bool CSound::IsStoppedOnDemand ()
|
||||
return m_bStopped;
|
||||
}
|
||||
|
||||
// Adapte le volume de la musique en cours, si n<EFBFBD>cessaire.
|
||||
// Adapte le volume de la musique en cours, si n�cessaire.
|
||||
|
||||
void CSound::AdaptVolumeMusic()
|
||||
{
|
||||
@ -358,7 +358,7 @@ void CSound::AdaptVolumeMusic()
|
||||
}
|
||||
}
|
||||
|
||||
// Indique le nombre de suspend <EFBFBD> sauter.
|
||||
// Indique le nombre de suspend � sauter.
|
||||
|
||||
void CSound::SetSuspendSkip(int nb)
|
||||
{
|
||||
|
22
src/text.cpp
22
src/text.cpp
@ -10,7 +10,7 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// Retourne l'offset pour un caractère donné.
|
||||
// Retourne l'offset pour un caractère donné.
|
||||
|
||||
int GetOffset(char c)
|
||||
{
|
||||
@ -29,12 +29,12 @@ int GetOffset(char c)
|
||||
return 15+i;
|
||||
}
|
||||
}
|
||||
if ( c<0 || c>128 ) return 1; // carré
|
||||
if ( c<0 || c>128 ) return 1; // carré
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
// Retourne la longueur d'un caractère.
|
||||
// Retourne la longueur d'un caractère.
|
||||
|
||||
int GetCharWidth(char c, int font)
|
||||
{
|
||||
@ -101,7 +101,7 @@ void DrawText(CPixmap *pPixmap, POINT pos, const char *pText, int font)
|
||||
}
|
||||
}
|
||||
|
||||
// Affiche un texte penché.
|
||||
// Affiche un texte penché.
|
||||
|
||||
void DrawTextPente(CPixmap *pPixmap, POINT pos, char *pText,
|
||||
int pente, int font)
|
||||
@ -123,8 +123,8 @@ void DrawTextPente(CPixmap *pPixmap, POINT pos, char *pText,
|
||||
}
|
||||
}
|
||||
|
||||
// Affiche un pavé de texte.
|
||||
// Une ligne vide est affichée avec un demi interligne !
|
||||
// Affiche un pavé de texte.
|
||||
// Une ligne vide est affichée avec un demi interligne !
|
||||
// Si part != -1, n'affiche que les lignes qui commencent
|
||||
// par "n|", avec n=part.
|
||||
|
||||
@ -175,13 +175,13 @@ void DrawTextRect(CPixmap *pPixmap, POINT pos, char *pText,
|
||||
}
|
||||
else
|
||||
{
|
||||
pos.y += itl; // passe à la ligne suivante
|
||||
pos.y += itl; // passe à la ligne suivante
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Affiche un texte centré pouvant éventuellement
|
||||
// contenir plusieurs lignes séparées par des '\n'.
|
||||
// Affiche un texte centré pouvant éventuellement
|
||||
// contenir plusieurs lignes séparées par des '\n'.
|
||||
|
||||
void DrawTextCenter(CPixmap *pPixmap, POINT pos, const char *pText, int font)
|
||||
{
|
||||
@ -215,7 +215,7 @@ void DrawTextCenter(CPixmap *pPixmap, POINT pos, const char *pText, int font)
|
||||
}
|
||||
else
|
||||
{
|
||||
pos.y += itl; // passe à la ligne suivante
|
||||
pos.y += itl; // passe à la ligne suivante
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -260,7 +260,7 @@ int GetTextHeight(char *pText, int font, int part)
|
||||
}
|
||||
else
|
||||
{
|
||||
h += itl; // passe à la ligne suivante
|
||||
h += itl; // passe à la ligne suivante
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user