1
0
mirror of https://github.com/blupi-games/planetblupi synced 2024-12-30 10:15:36 +01:00

Import initial sources and assets

This commit is contained in:
Mathieu Schroeter 2017-01-21 17:27:46 +01:00
parent 08c8d15368
commit b0270ab432
660 changed files with 39942 additions and 0 deletions

2778
action.cpp Normal file

File diff suppressed because it is too large Load Diff

18
action.h Normal file
View File

@ -0,0 +1,18 @@
// Action.h
//
extern
BOOL Action(short action, short direct,
short &phase, short &step,
short &channel, short &icon, POINT &pos, short &posZ,
short &sound);
extern
BOOL Rotate(short &icon, short direct);
extern
int GetIconDirect(short icon);
extern
int GetAmplitude(short action);

1
actions.h Normal file

File diff suppressed because one or more lines are too long

977
arrange.cpp Normal file
View File

@ -0,0 +1,977 @@
// Arrange.cpp
//
#include "DECOR.H"
#include "MISC.H"
// Cette table indique les quarts de cases contenant de
// l'eau lorsque la valeur est à un.
// 0 1
// 2 3
static char tableSee[14*4] =
{
0,0,0,0, // 1
0,1,0,1, // 2
0,0,1,1, // 3
1,0,1,0, // 4
1,1,0,0, // 5
0,0,0,1, // 6
0,0,1,0, // 7
1,0,0,0, // 8
0,1,0,0, // 9
0,1,1,1, // 10
1,0,1,1, // 11
1,1,1,0, // 12
1,1,0,1, // 13
1,1,1,1, // 14
};
// Cette table indique les quarts de cases contenant de
// la mousse ou de la terre lorsque la valeur est à un.
// 0 1
// 2 3
static char tableDark[13*4] =
{
1,1,1,1, // 20
0,1,0,1, // 21
0,0,1,1, // 22
1,0,1,0, // 23
1,1,0,0, // 24
0,0,0,1, // 25
0,0,1,0, // 26
1,0,0,0, // 27
0,1,0,0, // 28
1,1,1,0, // 29
1,1,0,1, // 30
0,1,1,1, // 31
1,0,1,1, // 32
};
// Retourne les bits contenant de l'eau.
BOOL CDecor::GetSeeBits(POINT cel, char *pBits, int index)
{
int icon;
pBits[0] = 0;
pBits[1] = 0;
pBits[2] = 0;
pBits[3] = 0;
if ( cel.x < 0 || cel.x >= MAXCELX ||
cel.y < 0 || cel.y >= MAXCELY ) return FALSE;
icon = m_decor[cel.x/2][cel.y/2].floorIcon;
if ( index == 0 ) // eau ?
{
if ( icon < 1 || icon > 14 ) return TRUE;
icon -= 1;
pBits[0] = tableSee[icon*4+0];
pBits[1] = tableSee[icon*4+1];
pBits[2] = tableSee[icon*4+2];
pBits[3] = tableSee[icon*4+3];
}
if ( index == 1 ) // mousse ?
{
if ( icon >= 2 && icon <= 14 ) return FALSE; // eau ?
if ( icon == 66 || icon == 79 ) // mousse spéciale ?
{
pBits[0] = 1;
pBits[1] = 1;
pBits[2] = 1;
pBits[3] = 1;
return TRUE;
}
if ( icon < 20 || icon > 32 ) return TRUE;
icon -= 20;
pBits[0] = tableDark[icon*4+0];
pBits[1] = tableDark[icon*4+1];
pBits[2] = tableDark[icon*4+2];
pBits[3] = tableDark[icon*4+3];
}
if ( index == 2 ) // terre ?
{
if ( icon >= 2 && icon <= 14 ) return FALSE; // eau ?
if ( (icon >= 46 && icon <= 48) || // terre spéciale ?
icon == 71 ) // terre à fer ?
{
pBits[0] = 1;
pBits[1] = 1;
pBits[2] = 1;
pBits[3] = 1;
return TRUE;
}
if ( icon < 33 || icon > 45 ) return TRUE;
icon -= 33;
pBits[0] = tableDark[icon*4+0];
pBits[1] = tableDark[icon*4+1];
pBits[2] = tableDark[icon*4+2];
pBits[3] = tableDark[icon*4+3];
}
return TRUE;
}
void CopyBits(char *pDst, char *pSrc)
{
for ( int i=0 ; i<4 ; i++ )
{
*pDst++ = *pSrc++;
}
}
BOOL ChangeBits(char *pDst, char *pSrc)
{
for ( int i=0 ; i<4 ; i++ )
{
if ( *pDst++ != *pSrc++ ) return TRUE;
}
return FALSE;
}
// Retourne l'icône correspondant aux bits d'eaux.
int CDecor::GetSeeIcon(char *pBits, int index)
{
int i;
if ( index == 0 ) // eau ?
{
for ( i=0 ; i<14 ; i++ )
{
if ( tableSee[i*4+0] == pBits[0] &&
tableSee[i*4+1] == pBits[1] &&
tableSee[i*4+2] == pBits[2] &&
tableSee[i*4+3] == pBits[3] ) return i+1;
}
}
if ( index == 1 ) // mousse ?
{
for ( i=0 ; i<13 ; i++ )
{
if ( tableDark[i*4+0] == pBits[0] &&
tableDark[i*4+1] == pBits[1] &&
tableDark[i*4+2] == pBits[2] &&
tableDark[i*4+3] == pBits[3] ) return i+20;
}
}
if ( index == 2 ) // terre ?
{
for ( i=0 ; i<13 ; i++ )
{
if ( tableDark[i*4+0] == pBits[0] &&
tableDark[i*4+1] == pBits[1] &&
tableDark[i*4+2] == pBits[2] &&
tableDark[i*4+3] == pBits[3] ) return i+33;
}
}
if ( pBits[0] == 0 &&
pBits[1] == 0 &&
pBits[2] == 0 &&
pBits[3] == 0 ) return 1; // herbe
return -1;
}
// Arrange le sol après une modification.
void CDecor::ArrangeFloor(POINT cel)
{
POINT test;
int max, index, icon;
char here[4], bits[4], init[4];
BOOL bModif = FALSE;
icon = m_decor[cel.x/2][cel.y/2].floorIcon;
if ( icon >= 59 && icon <= 64 ) return; // pont ?
max = 3;
if ( icon >= 15 && icon <= 18 ) // dalle spéciale ?
{
max = 1; // s'occupe que de l'eau !
}
for ( index=0 ; index<max ; index++ )
{
if ( !GetSeeBits(cel, here, index) ) continue;
test.x = cel.x -2; // en bas à gauche
test.y = cel.y +2;
if ( GetSeeBits(test, bits, index) )
{
if ( bits[2] == here[2] &&
bits[0] != here[2] &&
bits[1] != here[2] &&
bits[3] != here[2] )
{
here[2] = bits[1];
bModif = TRUE;
}
}
test.x = cel.x -2; // en haut à gauche
test.y = cel.y -2;
if ( GetSeeBits(test, bits, index) )
{
if ( bits[0] == here[0] &&
bits[1] != here[0] &&
bits[2] != here[0] &&
bits[3] != here[0] )
{
here[0] = bits[3];
bModif = TRUE;
}
}
test.x = cel.x +2; // en haut à droite
test.y = cel.y -2;
if ( GetSeeBits(test, bits, index) )
{
if ( bits[1] == here[1] &&
bits[0] != here[1] &&
bits[2] != here[1] &&
bits[3] != here[1] )
{
here[1] = bits[2];
bModif = TRUE;
}
}
test.x = cel.x +2; // en bas à droite
test.y = cel.y +2;
if ( GetSeeBits(test, bits, index) )
{
if ( bits[3] == here[3] &&
bits[0] != here[3] &&
bits[1] != here[3] &&
bits[2] != here[3] )
{
here[3] = bits[0];
bModif = TRUE;
}
}
if ( bModif )
{
icon = GetSeeIcon(here, index);
if ( icon != -1 ) m_decor[cel.x/2][cel.y/2].floorIcon = icon;
}
test.x = cel.x -2; // à gauche
test.y = cel.y;
if ( GetSeeBits(test, bits, index) )
{
CopyBits(init, bits);
bits[1] = here[0]?1:0;
bits[3] = here[2]?1:0;
icon = GetSeeIcon(bits, index);
if ( ChangeBits(init, bits) && icon != -1 )
{
m_decor[test.x/2][test.y/2].floorIcon = icon;
}
}
test.x = cel.x -2; // en haut à gauche
test.y = cel.y -2;
if ( GetSeeBits(test, bits, index) )
{
CopyBits(init, bits);
bits[3] = here[0]?1:0;
icon = GetSeeIcon(bits, index);
if ( ChangeBits(init, bits) && icon != -1 )
{
m_decor[test.x/2][test.y/2].floorIcon = icon;
}
}
test.x = cel.x; // en haut
test.y = cel.y -2;
if ( GetSeeBits(test, bits, index) )
{
CopyBits(init, bits);
bits[2] = here[0]?1:0;
bits[3] = here[1]?1:0;
icon = GetSeeIcon(bits, index);
if ( ChangeBits(init, bits) && icon != -1 )
{
m_decor[test.x/2][test.y/2].floorIcon = icon;
}
}
test.x = cel.x +2; // en haut à droite
test.y = cel.y -2;
if ( GetSeeBits(test, bits, index) )
{
CopyBits(init, bits);
bits[2] = here[1]?1:0;
icon = GetSeeIcon(bits, index);
if ( ChangeBits(init, bits) && icon != -1 )
{
m_decor[test.x/2][test.y/2].floorIcon = icon;
}
}
test.x = cel.x +2; // à droite
test.y = cel.y;
if ( GetSeeBits(test, bits, index) )
{
CopyBits(init, bits);
bits[0] = here[1]?1:0;
bits[2] = here[3]?1:0;
icon = GetSeeIcon(bits, index);
if ( ChangeBits(init, bits) && icon != -1 )
{
m_decor[test.x/2][test.y/2].floorIcon = icon;
}
}
test.x = cel.x +2; // en bas à droite
test.y = cel.y +2;
if ( GetSeeBits(test, bits, index) )
{
CopyBits(init, bits);
bits[0] = here[3]?1:0;
icon = GetSeeIcon(bits, index);
if ( ChangeBits(init, bits) && icon != -1 )
{
m_decor[test.x/2][test.y/2].floorIcon = icon;
}
}
test.x = cel.x; // en bas
test.y = cel.y +2;
if ( GetSeeBits(test, bits, index) )
{
CopyBits(init, bits);
bits[0] = here[2]?1:0;
bits[1] = here[3]?1:0;
icon = GetSeeIcon(bits, index);
if ( ChangeBits(init, bits) && icon != -1 )
{
m_decor[test.x/2][test.y/2].floorIcon = icon;
}
}
test.x = cel.x -2; // en bas à gauche
test.y = cel.y +2;
if ( GetSeeBits(test, bits, index) )
{
CopyBits(init, bits);
bits[1] = here[2]?1:0;
icon = GetSeeIcon(bits, index);
if ( ChangeBits(init, bits) && icon != -1 )
{
m_decor[test.x/2][test.y/2].floorIcon = icon;
}
}
}
}
// Cette table donne les directions dans l'ordre
// est-sud-ouest-nord pour les murs.
static char tableMur[5*15] =
{
20, 1,0,1,0,
21, 0,1,0,1,
22, 1,1,0,0,
23, 0,1,1,0,
24, 0,0,1,1,
25, 1,0,0,1,
26, 1,1,1,1,
26, 0,1,1,1,
26, 1,0,1,1,
26, 1,1,0,1,
26, 1,1,1,0,
20, 1,0,0,0,
20, 0,0,1,0,
21, 0,1,0,0,
21, 0,0,0,1,
};
static short tableMurDir[4*2] =
{
+2, 0, // est
0,+2, // sur
-2, 0, // ouest
0,-2, // nord
};
// Arrange un mur en fonction des autres murs dans toutes
// les directions.
// index=0 si mur (20..26)
// index=1 si palissade (65..71)
// index=2 si barrière (106..112)
void CDecor::ArrangeMur(POINT cel, int &icon, int index)
{
int i, x, y, channel;
int first, last, matiere;
int icons[4];
char murs[4];
if ( index == 0 )
{
first = 20;
last = 26;
matiere = 44; // pierres
}
if ( index == 1 )
{
first = 65;
last = 71;
matiere = 36; // planches
}
if ( index == 2 )
{
first = 106;
last = 112;
matiere = 36; // planches
}
for ( i=0 ; i<4 ; i++ )
{
x = cel.x + tableMurDir[i*2+0];
y = cel.y + tableMurDir[i*2+1];
if ( IsValid(GetCel(x,y)) )
{
icons[i] = m_decor[x/2][y/2].objectIcon;
if ( icons[i] == matiere ) // pierres/planches ?
{
MoveGetObject(GetCel(x,y), channel, icons[i]);
}
if ( icons[i] < first || icons[i] > last )
{
icons[i] = -1;
}
}
else
{
icons[i] = -1;
}
}
for ( i=0 ; i<4 ; i++ )
{
if ( icons[i] == -1 )
{
murs[i] = 0;
}
else
{
murs[i] = tableMur[(icons[i]-first)*5+1+((i+2)%4)];
}
}
for ( i=0 ; i<15 ; i++ )
{
if ( murs[0] == tableMur[i*5+1] &&
murs[1] == tableMur[i*5+2] &&
murs[2] == tableMur[i*5+3] &&
murs[3] == tableMur[i*5+4] )
{
icon = tableMur[i*5+0];
icon += first-20;
return;
}
}
icon = -1;
}
// Arrange les objets avant une construction.
void CDecor::ArrangeBuild(POINT cel, int &channel, int &icon)
{
int index, i, x, y;
int first, last, matiere;
int oldChannel, oldIcon;
for ( index=0 ; index<3 ; index++ )
{
if ( index == 0 )
{
first = 20;
last = 26;
matiere = 44; // pierres
}
if ( index == 1 )
{
first = 65;
last = 71;
matiere = 36; // planches
}
if ( index == 2 )
{
first = 106;
last = 112;
matiere = 36; // planches
}
// Rien à faire si pas mur.
if ( channel != CHOBJECT || icon != last ) continue;
oldChannel = m_decor[cel.x/2][cel.y/2].objectChannel;
oldIcon = m_decor[cel.x/2][cel.y/2].objectIcon;
m_decor[cel.x/2][cel.y/2].objectChannel = channel;
m_decor[cel.x/2][cel.y/2].objectIcon = icon;
for ( i=0 ; i<4 ; i++ )
{
x = cel.x + tableMurDir[i*2+0];
y = cel.y + tableMurDir[i*2+1];
if ( IsValid(GetCel(x,y)) )
{
icon = m_decor[x/2][y/2].objectIcon;
if ( icon == matiere ) // pierres/planches ?
{
MoveGetObject(GetCel(x,y), channel, icon);
}
if ( icon >= first && icon <= last )
{
ArrangeMur(GetCel(x,y), icon, index);
if ( icon != -1 )
{
if ( !MovePutObject(GetCel(x,y), channel, icon) )
{
m_decor[x/2][y/2].objectChannel = channel;
m_decor[x/2][y/2].objectIcon = icon;
}
}
}
}
}
m_decor[cel.x/2][cel.y/2].objectChannel = oldChannel;
m_decor[cel.x/2][cel.y/2].objectIcon = oldIcon;
ArrangeMur(cel, icon, index);
if ( icon == -1 ) icon = last;
}
}
// Arrange les objets après une modification.
void CDecor::ArrangeObject(POINT cel)
{
int channel, icon;
int first, last;
int index, i, j, k, x, y;
POINT vector, test, pos;
BOOL bTour;
for ( index=0 ; index<3 ; index++ )
{
if ( index == 0 )
{
first = 20; // murs
last = 26;
}
if ( index == 1 )
{
first = 65; // palissades
last = 71;
}
if ( index == 2 )
{
first = 106; // barrière
last = 112;
}
for ( i=0 ; i<4 ; i++ )
{
x = cel.x + tableMurDir[i*2+0];
y = cel.y + tableMurDir[i*2+1];
if ( IsValid(GetCel(x,y)) )
{
icon = m_decor[x/2][y/2].objectIcon;
if ( icon >= first && icon <= last )
{
ArrangeMur(GetCel(x,y), icon, index);
if ( icon != -1 )
{
m_decor[x/2][y/2].objectChannel = CHOBJECT;
m_decor[x/2][y/2].objectIcon = icon;
}
}
}
}
if ( m_decor[cel.x/2][cel.y/2].objectIcon == last )
{
ArrangeMur(cel, icon, index);
if ( icon == -1 ) icon = last;
m_decor[cel.x/2][cel.y/2].objectChannel = CHOBJECT;
m_decor[cel.x/2][cel.y/2].objectIcon = icon;
}
}
// Arrange les rayons entre les tours.
if ( m_decor[cel.x/2][cel.y/2].objectIcon == 27 || // tour ?
m_decor[cel.x/2][cel.y/2].objectIcon == -1 ) // rien ?
{
for ( i=0 ; i<4 ; i++ )
{
vector = GetVector(i*2*16);
test = cel;
bTour = FALSE;
j = 0;
while ( TRUE )
{
test.x += vector.x*2;
test.y += vector.y*2;
if ( m_decor[test.x/2][test.y/2].objectIcon == 27 ) // tour ?
{
bTour = TRUE;
break;
}
if ( m_decor[test.x/2][test.y/2].objectIcon != -1 &&
m_decor[test.x/2][test.y/2].objectIcon != 10001-i%2 )
{
break;
}
j ++;
if ( j >= 2+1 ) break;
}
if ( m_decor[cel.x/2][cel.y/2].objectIcon != 27 ) // pas tour ?
{
bTour = FALSE;
}
test = cel;
for ( k=0 ; k<j ; k++ )
{
test.x += vector.x*2;
test.y += vector.y*2;
if ( bTour )
{
channel = CHOBJECT;
icon = 10001-i%2; // rayon e-o (10001) ou n-s (10000)
}
else
{
channel = -1;
icon = -1;
}
m_decor[test.x/2][test.y/2].objectChannel = channel;
m_decor[test.x/2][test.y/2].objectIcon = icon;
if ( !m_bBuild && bTour )
{
if ( MoveCreate(test, -1, FALSE, CHOBJECT,-1,
-1,-1, 9999,1,0, TRUE) )
{
MoveAddIcons(test, 5-i%2, TRUE); // éclairs
}
pos = ConvCelToPos(test);
m_pSound->PlayImage(SOUND_RAYON1, pos);
}
if ( !m_bBuild && !bTour )
{
MoveFinish(test);
}
}
}
}
}
// Test s'il faut remplir le sol ici.
BOOL CDecor::ArrangeFillTestFloor(POINT cel1, POINT cel2)
{
POINT cel;
int icon1, icon2;
icon1 = m_fillSearchIcon;
icon2 = m_fillSearchIcon;
if ( m_fillPutChannel == CHFLOOR &&
m_fillPutIcon == 1 && // met de l'herbe..
m_fillSearchIcon == 14 ) // ..sur de l'eau ?
{
icon1 = 2;
icon2 = 14; // eau & rives
}
if ( m_fillPutChannel == CHFLOOR &&
m_fillPutIcon == 14 && // met de l'eau..
m_fillSearchIcon == 1 ) // ..sur de l'herbe ?
{
icon1 = 1;
icon2 = 13; // herbe & rives
}
for ( cel.x=cel1.x ; cel.x<=cel2.x ; cel.x+=2 )
{
for ( cel.y=cel1.y ; cel.y<=cel2.y ; cel.y+=2 )
{
if ( !IsValid(cel) ) continue;
if ( m_decor[cel.x/2][cel.y/2].floorChannel != m_fillSearchChannel ||
m_decor[cel.x/2][cel.y/2].floorIcon < icon1 ||
m_decor[cel.x/2][cel.y/2].floorIcon > icon2 )
{
return FALSE;
}
if ( m_fillPutChannel == CHFLOOR &&
m_fillPutIcon == 14 && // met de l'eau ?
m_decor[cel.x/2][cel.y/2].objectIcon != -1 )
{
return FALSE;
}
}
}
if ( m_fillPutChannel == CHFLOOR &&
m_fillPutIcon == 14 && // met de l'eau ?
IsBlupiHereEx(cel1, cel2, -1, FALSE) )
{
return FALSE;
}
return TRUE;
}
// Test s'il faut remplir ici.
BOOL CDecor::ArrangeFillTest(POINT pos)
{
POINT cel1, cel2;
if ( m_pFillMap[(pos.x/2)+(pos.y/2)*(MAXCELX/2)] == 1 )
{
return FALSE;
}
if ( m_bFillFloor )
{
cel1.x = pos.x-2;
cel1.y = pos.y-2;
cel2.x = pos.x+3;
cel2.y = pos.y+3;
return ArrangeFillTestFloor(cel1, cel2);
}
else
{
if ( m_decor[pos.x/2][pos.y/2].objectChannel == m_fillSearchChannel &&
m_decor[pos.x/2][pos.y/2].objectIcon == m_fillSearchIcon &&
!IsBlupiHereEx(GetCel(pos.x+0,pos.y+0),
GetCel(pos.x+1,pos.y+1), -1, FALSE) )
{
if ( m_decor[pos.x/2][pos.y/2].floorChannel == CHFLOOR &&
m_decor[pos.x/2][pos.y/2].floorIcon >= 2 &&
m_decor[pos.x/2][pos.y/2].floorIcon <= 14 ) // rive ou eau ?
{
return FALSE;
}
return TRUE;
}
}
return FALSE;
}
// Modifie le décor lors d'un remplissage.
void CDecor::ArrangeFillPut(POINT pos, int channel, int icon)
{
if ( m_bFillFloor )
{
PutFloor(pos, channel, icon);
ArrangeFloor(pos);
}
else
{
if ( icon >= 0 && icon <= 5 ) // plantes ?
{
icon = Random(0,5);
}
if ( icon >= 6 && icon <= 11 ) // arbres ?
{
icon = Random(6,11);
}
if ( icon >= 37 && icon <= 43 ) // rochers ?
{
icon = Random(37,43);
}
PutObject(pos, channel, icon);
ArrangeObject(pos);
}
}
// Rempli un sol à partir d'une position donnée.
void CDecor::ArrangeFillSearch(POINT pos)
{
int startX, endX;
// Cherche la borne gauche.
startX = pos.x;
endX = pos.x;
while ( pos.x > 0 && ArrangeFillTest(pos) )
{
pos.x -= 2;
}
startX = pos.x+2;
// Cherche la borne droite.
pos.x = endX;
while ( pos.x < MAXCELX-2 && ArrangeFillTest(pos) )
{
pos.x += 2;
}
endX = pos.x-2;
// Rempli toute la ligne trouvée.
pos.x = startX;
while ( pos.x <= endX )
{
m_pFillMap[(pos.x/2)+(pos.y/2)*(MAXCELX/2)] = 1;
pos.x += 2;
}
// Cherche la ligne au-dessus.
if ( pos.y > 0 )
{
pos.y -= 2;
pos.x = startX;
while ( pos.x <= endX )
{
while ( pos.x <= endX && !ArrangeFillTest(pos) )
{
pos.x += 2;
}
if ( pos.x > endX ) break;
if ( ArrangeFillTest(pos) )
{
ArrangeFillSearch(pos); // appel récursif
}
while ( pos.x <= endX && ArrangeFillTest(pos) )
{
pos.x += 2;
}
}
pos.y += 2;
}
// Cherche la ligne au-dessous.
if ( pos.y < MAXCELY-2 )
{
pos.y += 2;
pos.x = startX;
while ( pos.x <= endX )
{
while ( pos.x <= endX && !ArrangeFillTest(pos) )
{
pos.x += 2;
}
if ( pos.x > endX ) break;
if ( ArrangeFillTest(pos) )
{
ArrangeFillSearch(pos); // appel récursif
}
while ( pos.x <= endX && ArrangeFillTest(pos) )
{
pos.x += 2;
}
}
}
}
// Rempli un sol à partir d'une position donnée.
void CDecor::ArrangeFill(POINT pos, int channel, int icon, BOOL bFloor)
{
m_bFillFloor = bFloor;
pos.x = (pos.x/2)*2;
pos.y = (pos.y/2)*2;
m_fillPutChannel = channel;
m_fillPutIcon = icon;
if ( bFloor )
{
GetFloor(pos, m_fillSearchChannel, m_fillSearchIcon);
}
else
{
GetObject(pos, m_fillSearchChannel, m_fillSearchIcon);
}
m_pFillMap = (char*)malloc(MAXCELX*MAXCELY*sizeof(char)/4);
if ( m_pFillMap == NULL ) return;
memset(m_pFillMap, 0, MAXCELX*MAXCELY*sizeof(char)/4);
ArrangeFillSearch(pos);
for ( pos.x=0 ; pos.x<MAXCELX ; pos.x+=2 )
{
for ( pos.y=0 ; pos.y<MAXCELY ; pos.y+=2 )
{
if ( m_pFillMap[(pos.x/2)+(pos.y/2)*(MAXCELX/2)] == 1 )
{
ArrangeFillPut(pos, channel, icon);
}
}
}
free(m_pFillMap);
}
// Supprime tous les personnages bloqués dans des murs
// ou debout sur l'eau.
void CDecor::ArrangeBlupi()
{
int rank;
for ( rank=0 ; rank<MAXBLUPI ; rank++ )
{
if ( m_blupi[rank].bExist )
{
if ( !IsFreeCel(m_blupi[rank].cel, rank) )
{
m_blupi[rank].bExist = FALSE;
}
}
}
}

BIN
arrow.cur Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

BIN
arrowdl.cur Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

BIN
arrowdow.cur Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

BIN
arrowdr.cur Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

BIN
arrowlef.cur Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

BIN
arrowrig.cur Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

BIN
arrowul.cur Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

BIN
arrowup.cur Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

BIN
arrowur.cur Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

489
blupi-d.rc Normal file
View File

@ -0,0 +1,489 @@
//Microsoft Developer Studio generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// French (Switzerland) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRS)
#ifdef _WIN32
LANGUAGE LANG_FRENCH, SUBLANG_FRENCH_SWISS
#pragma code_page(1252)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDR_MAINFRAME ICON DISCARDABLE "blupi.ico"
#ifndef _MAC
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 0,4,0,0
PRODUCTVERSION 0,4,0,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x40004L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "100c04b0"
BEGIN
VALUE "CompanyName", "EPSITEC\0"
VALUE "FileDescription", "Blupi\0"
VALUE "FileVersion", "0, 4, 0, 0\0"
VALUE "InternalName", "Planet Blupi\0"
VALUE "LegalCopyright", "Copyright © 1997\0"
VALUE "OriginalFilename", "Blupi.exe\0"
VALUE "ProductName", "EPSITEC Planet Blupi\0"
VALUE "ProductVersion", "0, 4, 0, 0\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x100c, 1200
END
END
#endif // !_MAC
/////////////////////////////////////////////////////////////////////////////
//
// Cursor
//
IDC_POINTER CURSOR DISCARDABLE "cursor1.cur"
IDC_MAP CURSOR DISCARDABLE "map.cur"
IDC_ARROWU CURSOR DISCARDABLE "arrowup.cur"
IDC_ARROWD CURSOR DISCARDABLE "arrowdow.cur"
IDC_ARROWL CURSOR DISCARDABLE "arrowlef.cur"
IDC_ARROWR CURSOR DISCARDABLE "arrowrig.cur"
IDC_ARROWUL CURSOR DISCARDABLE "arrowul.cur"
IDC_ARROWUR CURSOR DISCARDABLE "arrowur.cur"
IDC_ARROWDR CURSOR DISCARDABLE "arrowdr.cur"
IDC_ARROWDL CURSOR DISCARDABLE "arrowdl.cur"
IDC_WAIT CURSOR DISCARDABLE "wait.cur"
IDC_EMPTY CURSOR DISCARDABLE "empty.cur"
IDC_FILL CURSOR DISCARDABLE "fill.cur"
IDC_ARROW CURSOR DISCARDABLE "arrow.cur"
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE DISCARDABLE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE DISCARDABLE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE DISCARDABLE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE DISCARDABLE
BEGIN
TX_ACTION_GO "Gehen"
TX_ACTION_STOP "Halt"
TX_ACTION_MANGE "Essen"
TX_ACTION_CARRY "Nehmen"
TX_ACTION_DEPOSE "Hinlegen"
TX_ACTION_ABAT "Baum fällen"
TX_ACTION_ROC "Stein bearbeiten"
TX_ACTION_CULTIVE "Garten anlegen"
TX_ACTION_BUILD1 "Gartenhäuschen"
TX_ACTION_BUILD2 "Brutplatz"
TX_ACTION_BUILD3 "Labor"
TX_ACTION_BUILD4 "Bergwerk"
TX_ACTION_BUILD5 "Werkstatt"
TX_ACTION_BUILD6 "Beamgerät"
TX_ACTION_MUR "Mauer"
END
STRINGTABLE DISCARDABLE
BEGIN
TX_ACTION_PALIS "Palisade"
TX_ACTION_ABATn "Bäume fällen"
TX_ACTION_ROCn "Steine bearbeiten"
TX_ACTION_PONT "Brücke"
TX_ACTION_TOUR "Wachturm"
TX_ACTION_BOIT "Trinken"
TX_ACTION_LABO "Verarbeiten"
TX_ACTION_FLEUR "Blumenstrauss machen"
TX_ACTION_FLEURn "Blumensträusse machen"
TX_ACTION_DYNAMITE "Zünden"
TX_ACTION_BATEAU "Boot"
TX_ACTION_DJEEP "Aussteigen"
TX_ACTION_DRAPEAU "Eisen suchen"
TX_ACTION_EXTRAIT "Eisen abbauen"
TX_ACTION_FABJEEP "Jeep bauen"
TX_ACTION_FABMINE "Zeitbombe bauen"
END
STRINGTABLE DISCARDABLE
BEGIN
TX_ERROR_MISC "Hier nicht möglich"
TX_ERROR_GROUND "Untergrund nicht geeignet"
TX_ERROR_FREE "Untergrund schon besetzt"
TX_ERROR_PONTOP "Anderes Ufer nicht OK"
TX_ERROR_PONTTERM "Brücke schon fertig"
TX_ERROR_TOURISOL "(Alleinstehender Wachturm)"
TX_ERROR_TOUREAU "Zu nahe am Wasser"
TX_ERROR_TELE2 "Es gibt schon 2 Beammaschinen"
END
STRINGTABLE DISCARDABLE
BEGIN
TX_IONAMEEX "Training %d, Zeit %d"
TX_IOFREE "frei"
TX_TERMMIN "Verloren sobald weniger als %d Blupis"
TX_TERMMAX "Gewinnen unmöglich wenn weniger als %d Blupis"
TX_BUTTON_JOUER "Missionen"
TX_BUTTON_APPRENDRE "Training"
TX_BUTTON_QUITTER "BLUPI beenden"
TX_BUTTON_PREVP "Vorhergehende Mission"
TX_BUTTON_NEXTP "Nächste Mission"
TX_BUTTON_PLAYP "Diese Mission spielen"
TX_BUTTON_BUILDP "Diese Mission konstruieren"
TX_BUTTON_TERM "Beenden"
END
STRINGTABLE DISCARDABLE
BEGIN
TX_BUTTON_READP "Gespeicherte Mission öffnen"
TX_BUTTON_WRITEP "Mission speichern"
TX_BUTTON_CANCELP "Mission aufgeben"
TX_BUTTON_CONTP "Mission weiterspielen"
TX_BUTTON_REPEAT "Neu Anfangen"
TX_BUTTON_BUTTON "Zur Verfügung stehende Knöpfe"
TX_BUTTON_CTERM "Bedingungen für Ende der Mission"
TX_BUTTON_TERMC "Konstruktion beenden"
TX_BUTTON_TERMHBLUPI "Blupi auf gestreiften Quadraten"
TX_BUTTON_TERMHPLANCHE "Bretter auf gestreiften Quadraten"
TX_BUTTON_TERMFIRE "Feuer ausgegangen"
TX_BUTTON_TERMDEC "(-)"
TX_BUTTON_TERMINC "(+)"
TX_PAUSE "Pause"
TX_JAUGE1 "Blupis Energie"
TX_JAUGE2 "Arbeitsfortschritt"
END
STRINGTABLE DISCARDABLE
BEGIN
TX_BUTTON_SETUP "Einstellungen"
TX_BUTTON_MUSIC "Auswahl der Musik"
TX_BUTTON_SETUP1 "Langsamer"
TX_BUTTON_SETUP2 "Schneller"
TX_BUTTON_SETUP3 "Leiser"
TX_BUTTON_SETUP4 "Lauter"
TX_BUTTON_MUSIC1 "Keine Musik"
TX_BUTTON_MUSIC2 "Musik Nummer 1"
TX_BUTTON_MUSIC3 "Musik Nummer 2"
TX_BUTTON_MUSIC4 "Musik Nummer 3"
TX_BUTTON_MUSIC5 "Musik Nummer 4"
TX_BUTTON_MUSIC6 "Musik Nummer 5"
TX_BUTTON_MUSIC7 "Musik Nummer 6"
TX_BUTTON_MUSIC8 "Musik Nummer 7"
TX_BUTTON_MUSIC9 "Musik Nummer 8"
TX_BUTTON_MUSIC10 "Musik Nummer 9"
END
STRINGTABLE DISCARDABLE
BEGIN
TX_BUTTON_REGION "Auswahl der Umgebung"
TX_BUTTON_TERMMBLUPI "Blupi im Haus"
TX_BUTTON_TERMKILL "Keine Feinde mehr"
TX_TERM "Bedingungen für\ndas Ende der Mission"
TX_BUTTON "Zur Verfügung\nstehende Knöpfe"
TX_MUSIC "Auswahl der Musik"
TX_SCHOOL "Training Nummer"
TX_MISSION "Mission Nummer"
TX_IONAMEMI "Mission %d, Zeit %d"
TX_BUTTON_TERMHTOMATE "Tomaten auf gestreiften Quadraten"
TX_BUTTON_SETUP5 "Leiser"
TX_BUTTON_SETUP6 "Lauter"
TX_BUTTON_SETUP7 "Keine Videosequenzen"
TX_BUTTON_SETUP8 "Zeigt die Videosequenzen"
TX_OUI "Ja"
TX_NON "Nein"
END
STRINGTABLE DISCARDABLE
BEGIN
TX_OBJ_BLUPIm "Kranker Blupi"
TX_OBJ_BLUPIf "Erschöpfter Blupi"
TX_OBJ_BLUPI "Blupi"
TX_OBJ_BATEAU "Boot"
TX_OBJ_JEEP "Jeep"
TX_OBJ_PIEGE "Klebefalle"
TX_OBJ_POISON "Gift"
TX_OBJ_DYNAMITE "Dynamitstangen"
TX_OBJ_MINE "Zeitbombe"
TX_OBJ_TOMATE "Tomaten"
TX_OBJ_POTION "Medikament"
TX_OBJ_PLANCHE "Bretter"
TX_OBJ_PIERRE "Steine"
TX_OBJ_DRAPEAU "Wimpel"
TX_OBJ_FER "Eisenerz"
TX_OBJ_FLEUR1 "Blumen"
END
STRINGTABLE DISCARDABLE
BEGIN
TX_OBJ_FLEUR2 "Blumen"
TX_OBJ_FLEUR3 "Blumen"
TX_OBJ_CABANE "Gartenhäuschen"
TX_OBJ_LABO "Labor"
TX_OBJ_MINEFER "Bergwerk"
TX_OBJ_USINE "Werkstatt"
TX_OBJ_TOUR "Wachturm"
TX_OBJ_FEU "Feuer"
TX_OBJ_ROBOT "Roboterchef"
TX_OBJ_TRACKS "Planierraupe"
TX_OBJ_BOMBE "Springende Bombe"
TX_OBJ_ARAIGNEE "Spinne"
TX_OBJ_VIRUS "Virus"
TX_OBJ_ELECTRO "Elektrisiermaschine"
TX_OBJ_ARBRE "Bäume"
TX_OBJ_MUR "Mauer"
END
STRINGTABLE DISCARDABLE
BEGIN
TX_OBJ_ARBREb "Baumstämme"
TX_OBJ_ROC "Felsen"
TX_OBJ_OEUF "Eier"
TX_OBJ_PALISSADE "Palisade"
TX_OBJ_ENNEMIp "Verklebter Feind"
TX_OBJ_ENNEMI "Feindliche Einrichtung"
TX_OBJ_HERBE "Normaler Untergrund"
TX_OBJ_MOUSSE "Brennbarer Untergrund"
TX_OBJ_TERRE "Karger Untergrund"
TX_OBJ_EAU "Wasser"
TX_OBJ_RIVE "Ufer"
TX_OBJ_MIXTE "Gemischter Untergrund"
TX_OBJ_PONT "Brücke"
TX_OBJ_COUVEUSE "Brutplatz"
TX_OBJ_GLACE "Eis"
TX_OBJ_MAISON "Blupis Haus"
END
STRINGTABLE DISCARDABLE
BEGIN
TX_OBJ_HACHURE "Gestreifte Quadrate"
TX_OBJ_MOUSSEb "Verbrannter Untergrund"
TX_OBJ_BOUQUET1 "Blumenstrauss"
TX_OBJ_BOUQUET2 "Blumenstrauss"
TX_OBJ_BOUQUET3 "Blumenstrauss"
TX_OBJ_DALLE "Platten"
TX_OBJ_ENNEMIs "Feindesgrund"
TX_OBJ_DISCIPLE "Hilfsroboter"
TX_OBJ_METAL "Platinium"
TX_OBJ_FUSEE "Feindliche Rakete"
TX_OBJ_TELEPORTE "Beammaschine"
TX_OBJ_ARMURE "Rüstung"
TX_OBJ_DALLESPEC "Spezialplatten"
TX_OBJ_COUVTELE "Brutplatz oder Beammaschine"
TX_OBJ_BATIMENT "Gebäude"
TX_OBJ_BATENNEMIS "Feindliches Gebäude"
END
STRINGTABLE DISCARDABLE
BEGIN
TX_WIN1 "Toll, Du hast es geschafft"
TX_WIN2 "Ja, super"
TX_WIN3 "Sehr gut"
TX_WIN4 "Ausgezeichnet"
TX_WIN5 "Auftrag erfüllt"
END
STRINGTABLE DISCARDABLE
BEGIN
TX_LOST1 "Das war nichts, probier es noch einmal !"
TX_LOST2 "Nein, so geht das leider nicht !"
TX_LOST3 "Das war mal wieder nichts !"
TX_LOST4 "Das war leider nicht die richtige Lösung !"
END
STRINGTABLE DISCARDABLE
BEGIN
TX_LOST5 "Aber nein, doch nicht so..."
END
STRINGTABLE DISCARDABLE
BEGIN
TX_LASTWIN1 "Du kannst jetzt mit den Missionen beginnen."
TX_LASTWIN2 "Bravo, das Spiel ist beendet !"
TX_LASTWIN3 "Letzte konstruierte Mission beendet."
END
STRINGTABLE DISCARDABLE
BEGIN
TX_BUTTON_SETUP9 "Langsamer"
TX_BUTTON_SETUP10 "Schneller"
TX_INFO_SETUP1 "Globale\nGeschwindigkeit\ndes Spiels"
TX_INFO_SETUP2 "Lautstärke der\nGeräuscheffekte"
TX_INFO_SETUP3 "Lautstärke\nder Musik"
TX_INFO_SETUP4 "Videosequenzen"
TX_INFO_SETUP5 "Geschwindigkeit\nder Bildschirm-\nverschiebungen\nmit der Maus"
TX_INFO_NOSCROLL "Keine"
TX_BUTTON_REGION1 "Wiese"
TX_BUTTON_REGION2 "Wüste"
END
STRINGTABLE DISCARDABLE
BEGIN
TX_BUTTON_REGION3 "Verschneiter Wald"
TX_BUTTON_REGION4 "Wald"
TX_REGION "Auswahl\nder Umgebung"
TX_BUTTON_PLAY_STOP "Halt"
TX_BUTTON_PLAY_SETUP "Einstellungen"
TX_BUTTON_PLAY_WRITE "Speichern"
TX_INSERT "Füge die Planet Blupi CD-Rom in das Laufwerk ein und warte einige Sekunden ..."
TX_BUTTON_PREVH "Vorhergehende Seite"
TX_BUTTON_NEXTH "Nächste Seite"
TX_BUTTON_TERMHMETAL "Platinium auf gestreiften Quadraten"
TX_BUTTON_HELP "Hilfe"
TX_HELP "Hilfe Nummer"
TX_BUTTON_PRIVE "Konstruktion"
TX_PRIVATE "Konstruktion Nummer"
TX_IONAMEPR "Konstruktion %d, Zeit %d"
TX_PRIVATE_HACHBLUPI "1|Auf die gestreiften Quadrate gehen."
END
STRINGTABLE DISCARDABLE
BEGIN
TX_ACTION_FABDISC "Roboter bauen"
TX_ACTION_REPEAT "Wiederholen"
TX_ACTION_QARMURE "Aussteigen"
TX_ACTION_FABARMURE "Rüstung bauen"
END
STRINGTABLE DISCARDABLE
BEGIN
TX_PRIVATE_HACHPLANCHE "1|Bretter auf die\n1|gestreiften Quadrate legen."
TX_PRIVATE_HACHTOMATE "1|Tomaten auf die\n1|gestreiften Quadrate legen."
TX_PRIVATE_HACHMETAL "1|Platinium auf die\n1|gestreiften Quadrate legen."
TX_PRIVATE_STOPFIRE "1|Solange überleben bis\n1|das Feuer ausgegangen ist."
TX_PRIVATE_HOMEBLUPI "1|Jeder Blupi\n1|in seinem Haus."
TX_PRIVATE_KILLROBOTS "1|Alle Feinde\n1|zerstören !"
TX_BUTTON_UNDO "Letzten Befehl rückgängig machen"
TX_DEMO_END1 "Sie haben soeben mit der DEMO Version von Planet Blupi gespielt."
TX_DEMO_END2 "Hoffentlich hatten Sie genau soviel Spass beim Spielen wie wir beim herstellen des Spiels !"
TX_DEMO_END3 "Dieses Spiel wurde entwickelt von Epsitec SA, CH-1092 Belmont"
TX_DEMO_END4 "http://www.blupi.com blupi@epsitec.ch"
TX_FULL_END1 "Sie haben soeben mit PLANET BLUPI gespielt."
TX_FULL_END2 "Hoffentlich hatten Sie genau soviel Spass beim Spielen wie wir beim herstellen des Spiels !"
TX_FULL_END3 "Herausgegeben von WG Verlag & Lizenzen AG"
TX_FULL_END4 "Entwickelt von EPSITEC SA"
TX_PRIVATE_OBJECTIF "1|Ziel :"
END
STRINGTABLE DISCARDABLE
BEGIN
TX_PRIVATE_NBBLUPI "1|Die Blupibevölkerung muss mindestens %d Blupi(s) betragen."
TX_BUTTON_SKILL "Schwierigkeitsgrad"
TX_SKILL1 "Leicht"
TX_SKILL2 "Schwer"
TX_BUTTON_DEMO "Demo"
TX_DEMOREC "REC"
TX_DEMOPLAY "Demo"
TX_BUTTON_TERMHROBOT "Roboter auf gestreiften Quadraten"
TX_PRIVATE_HACHROBOT "1|Der Roboter muss die\n1|gestreiften Quadrate erreichen."
END
STRINGTABLE DISCARDABLE
BEGIN
TX_REPEAT_CULTIVE "1: Tomaten anbauen...\n2: Essen"
TX_REPEAT_FLEUR "1: Blumenstrauss binden\n2: Verarbeiten"
TX_REPEAT_FLEURQ "1: Nehmen\n2: Verarbeiten"
TX_REPEAT_FABMINE "1: Eisen abbauen\n2: Zeitbombe bauen"
TX_REPEAT_FABJEEP "1: Eisen abbauen\n2: Jeep bauen"
TX_REPEAT_PALIS "1: Baum fällen\n2: Palissade bauen"
TX_REPEAT_PALISQ "1: Nehmen\n2: Palissade bauen"
TX_REPEAT_PONT "1: Baum fällen\n2: Brücke bauen"
TX_REPEAT_PONTQ "1: Nehmen\n2: Brücke bauen"
TX_REPEAT_BATEAU "1: Baum fällen\n2: Boot bauen"
TX_REPEAT_BATEAUQ "1: Bretter nehmen\n2: Boot bauen"
TX_REPEAT_FABARMURE "1: Eisen abbauen\n2: Rüstung bauen"
END
STRINGTABLE DISCARDABLE
BEGIN
TX_OBJ_MURPAL "Mauer oder Palissade"
TX_OBJ_OBJET "Gegenstände"
TX_OBJ_ARME "Waffen"
TX_OBJ_VEHICULE "Transportmittel"
TX_OBJ_STARTFEU "Feuer"
TX_OBJ_DELOBJ "Gegenstand löschen"
TX_OBJ_DELPERSO "Figur löschen"
TX_OBJ_DELFEU "Feuer löschen"
TX_OBJ_PLANTE "Pflanzen"
TX_OBJ_BARENNEMIS "Feindlicher Zaun"
END
STRINGTABLE DISCARDABLE
BEGIN
TX_DIRECT_N "N"
TX_DIRECT_S "S"
TX_DIRECT_E "O"
TX_DIRECT_O "W"
END
#endif // French (Switzerland) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

489
blupi-e.rc Normal file
View File

@ -0,0 +1,489 @@
//Microsoft Developer Studio generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// French (Switzerland) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRS)
#ifdef _WIN32
LANGUAGE LANG_FRENCH, SUBLANG_FRENCH_SWISS
#pragma code_page(1252)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDR_MAINFRAME ICON DISCARDABLE "blupi.ico"
#ifndef _MAC
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 0,4,0,0
PRODUCTVERSION 0,4,0,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x40004L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "100c04b0"
BEGIN
VALUE "CompanyName", "EPSITEC\0"
VALUE "FileDescription", "Blupi\0"
VALUE "FileVersion", "0, 4, 0, 0\0"
VALUE "InternalName", "Planet Blupi\0"
VALUE "LegalCopyright", "Copyright © 1997\0"
VALUE "OriginalFilename", "Blupi.exe\0"
VALUE "ProductName", "EPSITEC Planet Blupi\0"
VALUE "ProductVersion", "0, 4, 0, 0\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x100c, 1200
END
END
#endif // !_MAC
/////////////////////////////////////////////////////////////////////////////
//
// Cursor
//
IDC_POINTER CURSOR DISCARDABLE "cursor1.cur"
IDC_MAP CURSOR DISCARDABLE "map.cur"
IDC_ARROWU CURSOR DISCARDABLE "arrowup.cur"
IDC_ARROWD CURSOR DISCARDABLE "arrowdow.cur"
IDC_ARROWL CURSOR DISCARDABLE "arrowlef.cur"
IDC_ARROWR CURSOR DISCARDABLE "arrowrig.cur"
IDC_ARROWUL CURSOR DISCARDABLE "arrowul.cur"
IDC_ARROWUR CURSOR DISCARDABLE "arrowur.cur"
IDC_ARROWDR CURSOR DISCARDABLE "arrowdr.cur"
IDC_ARROWDL CURSOR DISCARDABLE "arrowdl.cur"
IDC_WAIT CURSOR DISCARDABLE "wait.cur"
IDC_EMPTY CURSOR DISCARDABLE "empty.cur"
IDC_FILL CURSOR DISCARDABLE "fill.cur"
IDC_ARROW CURSOR DISCARDABLE "arrow.cur"
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE DISCARDABLE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE DISCARDABLE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE DISCARDABLE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE DISCARDABLE
BEGIN
TX_ACTION_GO "Go"
TX_ACTION_STOP "Stop"
TX_ACTION_MANGE "Eat"
TX_ACTION_CARRY "Take"
TX_ACTION_DEPOSE "Drop"
TX_ACTION_ABAT "Cut down a tree"
TX_ACTION_ROC "Carve a rock"
TX_ACTION_CULTIVE "Grow tomatoes"
TX_ACTION_BUILD1 "Garden shed"
TX_ACTION_BUILD2 "Incubator"
TX_ACTION_BUILD3 "Laboratory"
TX_ACTION_BUILD4 "Mine"
TX_ACTION_BUILD5 "Workshop"
TX_ACTION_BUILD6 "Teleporter"
TX_ACTION_MUR "Wall"
END
STRINGTABLE DISCARDABLE
BEGIN
TX_ACTION_PALIS "Palisade"
TX_ACTION_ABATn "Cut down trees"
TX_ACTION_ROCn "Carve rocks"
TX_ACTION_PONT "Bridge"
TX_ACTION_TOUR "Protection tower"
TX_ACTION_BOIT "Drink"
TX_ACTION_LABO "Transform"
TX_ACTION_FLEUR "Make bunch of flowers"
TX_ACTION_FLEURn "Make bunches of flowers"
TX_ACTION_DYNAMITE "Blow up"
TX_ACTION_BATEAU "Boat"
TX_ACTION_DJEEP "Leave Jeep"
TX_ACTION_DRAPEAU "Prospect for iron"
TX_ACTION_EXTRAIT "Extract iron"
TX_ACTION_FABJEEP "Make a Jeep"
TX_ACTION_FABMINE "Make a time bomb"
END
STRINGTABLE DISCARDABLE
BEGIN
TX_ERROR_MISC "Impossible"
TX_ERROR_GROUND "Inadequate ground"
TX_ERROR_FREE "Occupied ground"
TX_ERROR_PONTOP "Opposite bank no good"
TX_ERROR_PONTTERM "Bridge finished"
TX_ERROR_TOURISOL "(isolated tower)"
TX_ERROR_TOUREAU "Too close to water"
TX_ERROR_TELE2 "Already two teleporters"
END
STRINGTABLE DISCARDABLE
BEGIN
TX_IONAMEEX "training %d, time %d"
TX_IOFREE "free slot"
TX_TERMMIN "Lost if less than %d Blupis"
TX_TERMMAX "Impossible to win if less than %d Blupis"
TX_BUTTON_JOUER "Missions"
TX_BUTTON_APPRENDRE "Training"
TX_BUTTON_QUITTER "Quit BLUPI"
TX_BUTTON_PREVP "Previous game"
TX_BUTTON_NEXTP "Next game"
TX_BUTTON_PLAYP "Play this game"
TX_BUTTON_BUILDP "Construct this game"
TX_BUTTON_TERM "Finish"
END
STRINGTABLE DISCARDABLE
BEGIN
TX_BUTTON_READP "Open another game "
TX_BUTTON_WRITEP "Save this game"
TX_BUTTON_CANCELP "Quit this game"
TX_BUTTON_CONTP "Continue this game"
TX_BUTTON_REPEAT "Restart this game"
TX_BUTTON_BUTTON "Available buttons"
TX_BUTTON_CTERM "Ending conditions"
TX_BUTTON_TERMC "Quit construction"
TX_BUTTON_TERMHBLUPI "Blupi on striped paving stones"
TX_BUTTON_TERMHPLANCHE "Planks on striped paving stones"
TX_BUTTON_TERMFIRE "Fire out"
TX_BUTTON_TERMDEC "(-)"
TX_BUTTON_TERMINC "(+)"
TX_PAUSE "Game paused"
TX_JAUGE1 "Blupi's energy"
TX_JAUGE2 "Work done"
END
STRINGTABLE DISCARDABLE
BEGIN
TX_BUTTON_SETUP "Settings"
TX_BUTTON_MUSIC "Music choice"
TX_BUTTON_SETUP1 "Slower"
TX_BUTTON_SETUP2 "Faster"
TX_BUTTON_SETUP3 "Reduce volume"
TX_BUTTON_SETUP4 "Increase volume"
TX_BUTTON_MUSIC1 "No music"
TX_BUTTON_MUSIC2 "Music number 1"
TX_BUTTON_MUSIC3 "Music number 2"
TX_BUTTON_MUSIC4 "Music number 3"
TX_BUTTON_MUSIC5 "Music number 4"
TX_BUTTON_MUSIC6 "Music number 5"
TX_BUTTON_MUSIC7 "Music number 6"
TX_BUTTON_MUSIC8 "Music number 7"
TX_BUTTON_MUSIC9 "Music number 8"
TX_BUTTON_MUSIC10 "Music number 9"
END
STRINGTABLE DISCARDABLE
BEGIN
TX_BUTTON_REGION "Scenery choice"
TX_BUTTON_TERMMBLUPI "Blupi in house"
TX_BUTTON_TERMKILL "No more enemies"
TX_TERM "Ending conditions"
TX_BUTTON "Available buttons"
TX_MUSIC "Music choice"
TX_SCHOOL "Training number"
TX_MISSION "Mission number"
TX_IONAMEMI "mission %d, time %d"
TX_BUTTON_TERMHTOMATE "Tomatoes on striped paving stones"
TX_BUTTON_SETUP5 "Reduce volume"
TX_BUTTON_SETUP6 "Increase volume"
TX_BUTTON_SETUP7 "No video"
TX_BUTTON_SETUP8 "Show videos"
TX_OUI "Yes"
TX_NON "No"
END
STRINGTABLE DISCARDABLE
BEGIN
TX_OBJ_BLUPIm "Sick Blupi"
TX_OBJ_BLUPIf "Tired Blupi"
TX_OBJ_BLUPI "Blupi"
TX_OBJ_BATEAU "Boat"
TX_OBJ_JEEP "Jeep"
TX_OBJ_PIEGE "Sticky trap"
TX_OBJ_POISON "Poison"
TX_OBJ_DYNAMITE "Dynamite"
TX_OBJ_MINE "Time bomb"
TX_OBJ_TOMATE "Tomatoes"
TX_OBJ_POTION "Medical potion"
TX_OBJ_PLANCHE "Planks"
TX_OBJ_PIERRE "Stones"
TX_OBJ_DRAPEAU "Flag"
TX_OBJ_FER "Iron"
TX_OBJ_FLEUR1 "Flowers"
END
STRINGTABLE DISCARDABLE
BEGIN
TX_OBJ_FLEUR2 "Flowers"
TX_OBJ_FLEUR3 "Flowers"
TX_OBJ_CABANE "Garden shed"
TX_OBJ_LABO "Laboratory"
TX_OBJ_MINEFER "Mine"
TX_OBJ_USINE "Workshop"
TX_OBJ_TOUR "Protection tower"
TX_OBJ_FEU "Fire"
TX_OBJ_ROBOT "Master robot"
TX_OBJ_TRACKS "Bulldozer"
TX_OBJ_BOMBE "Bouncing bomb"
TX_OBJ_ARAIGNEE "Spider"
TX_OBJ_VIRUS "Virus"
TX_OBJ_ELECTRO "Electrocutor"
TX_OBJ_ARBRE "Tree"
TX_OBJ_MUR "Wall"
END
STRINGTABLE DISCARDABLE
BEGIN
TX_OBJ_ARBREb "Tree trunks"
TX_OBJ_ROC "Rocks"
TX_OBJ_OEUF "Eggs"
TX_OBJ_PALISSADE "Palisade"
TX_OBJ_ENNEMIp "Trapped enemy"
TX_OBJ_ENNEMI "Enemy construction"
TX_OBJ_HERBE "Normal ground"
TX_OBJ_MOUSSE "Inflammable ground"
TX_OBJ_TERRE "Sterile ground"
TX_OBJ_EAU "Water"
TX_OBJ_RIVE "Bank"
TX_OBJ_MIXTE "Miscellaneous ground"
TX_OBJ_PONT "Bridge"
TX_OBJ_COUVEUSE "Incubator"
TX_OBJ_GLACE "Ice"
TX_OBJ_MAISON "Blupi's house"
END
STRINGTABLE DISCARDABLE
BEGIN
TX_OBJ_HACHURE "Striped paving stones"
TX_OBJ_MOUSSEb "Burnt ground"
TX_OBJ_BOUQUET1 "Bunch of flowers"
TX_OBJ_BOUQUET2 "Bunch of flowers"
TX_OBJ_BOUQUET3 "Bunch of flowers"
TX_OBJ_DALLE "Paving stones"
TX_OBJ_ENNEMIs "Enemy ground "
TX_OBJ_DISCIPLE "Helper robot"
TX_OBJ_METAL "Platinium"
TX_OBJ_FUSEE "Enemy rocket"
TX_OBJ_TELEPORTE "Teleporter"
TX_OBJ_ARMURE "Armour"
TX_OBJ_DALLESPEC "Special pavings"
TX_OBJ_COUVTELE "Incubator or teleporter"
TX_OBJ_BATIMENT "Buildings"
TX_OBJ_BATENNEMIS "Enemy buildings"
END
STRINGTABLE DISCARDABLE
BEGIN
TX_WIN1 "Well done !"
TX_WIN2 "Yes, great ..."
TX_WIN3 "Very good."
TX_WIN4 "Excellent..."
TX_WIN5 "Mission over..."
END
STRINGTABLE DISCARDABLE
BEGIN
TX_LOST1 "You have failed, try again..."
TX_LOST2 "No, wrong way ..."
TX_LOST3 "Bang, failed again !"
TX_LOST4 "Another mistake..."
END
STRINGTABLE DISCARDABLE
BEGIN
TX_LOST5 "No, not that way !"
END
STRINGTABLE DISCARDABLE
BEGIN
TX_LASTWIN1 "Now go on mission."
TX_LASTWIN2 "Very good, success on all missions !"
TX_LASTWIN3 "Last construction resolved !"
END
STRINGTABLE DISCARDABLE
BEGIN
TX_BUTTON_SETUP9 "Slower"
TX_BUTTON_SETUP10 "Faster"
TX_INFO_SETUP1 "Global game\nspeed"
TX_INFO_SETUP2 "Sound effect\nvolume"
TX_INFO_SETUP3 "Music\nvolume"
TX_INFO_SETUP4 "Video\nsequences"
TX_INFO_SETUP5 "Scroll speed\nwith mouse"
TX_INFO_NOSCROLL "None"
TX_BUTTON_REGION1 "Prairie"
TX_BUTTON_REGION2 "Desert"
END
STRINGTABLE DISCARDABLE
BEGIN
TX_BUTTON_REGION3 "Forest under snow"
TX_BUTTON_REGION4 "Forest"
TX_REGION "Scenery choice"
TX_BUTTON_PLAY_STOP "Interrupt"
TX_BUTTON_PLAY_SETUP "Settings"
TX_BUTTON_PLAY_WRITE "Save"
TX_INSERT "Insert CD-Rom Planet Blupi and wait a few seconds..."
TX_BUTTON_PREVH "Previous page"
TX_BUTTON_NEXTH "Next page"
TX_BUTTON_TERMHMETAL "Platinium on striped paving stones"
TX_BUTTON_HELP "Help"
TX_HELP "Help number"
TX_BUTTON_PRIVE "Construction"
TX_PRIVATE "Construction number"
TX_IONAMEPR "Construction %d, time %d"
TX_PRIVATE_HACHBLUPI "1|Go on striped\n1| paving stones."
END
STRINGTABLE DISCARDABLE
BEGIN
TX_ACTION_FABDISC "Make a helper robot"
TX_ACTION_REPEAT "Repeat"
TX_ACTION_QARMURE "Quit"
TX_ACTION_FABARMURE "Make armour"
END
STRINGTABLE DISCARDABLE
BEGIN
TX_PRIVATE_HACHPLANCHE "1|Drop planks on striped \n1|paving stones."
TX_PRIVATE_HACHTOMATE "1|Drop tomatoes on striped \n1|paving stones."
TX_PRIVATE_HACHMETAL "1|Drop platinium on striped \n1|paving stones."
TX_PRIVATE_STOPFIRE "1|Resist until\n1|fire extinction ..."
TX_PRIVATE_HOMEBLUPI "1|Each Blupi in\n1|his house."
TX_PRIVATE_KILLROBOTS "1|Kill all\n1|enemies !"
TX_BUTTON_UNDO "Cancel last operation"
TX_DEMO_END1 "You have played the DEMO version of Planet Blupi."
TX_DEMO_END2 "We hope you have had as much fun playing the game as we had making it !"
TX_DEMO_END3 "This game is an original creation of EPSITEC SA, CH-1092 Belmont"
TX_DEMO_END4 "http://www.blupi.com blupi@epsitec.ch"
TX_FULL_END1 "You have played Planet Blupi."
TX_FULL_END2 "We hope you have had as much fun playing the game as we had making it !"
TX_FULL_END3 "This game is an original creation of EPSITEC SA, CH-1092 Belmont"
TX_FULL_END4 "http://www.blupi.com blupi@epsitec.ch"
TX_PRIVATE_OBJECTIF "1|Goal :"
END
STRINGTABLE DISCARDABLE
BEGIN
TX_PRIVATE_NBBLUPI "1|The Blupi population must \n1|be of at least %d Blupis."
TX_BUTTON_SKILL "Skill level"
TX_SKILL1 "Easy"
TX_SKILL2 "Difficult"
TX_BUTTON_DEMO "Demo"
TX_DEMOREC "REC"
TX_DEMOPLAY "Demo"
TX_BUTTON_TERMHROBOT "Robot on striped paving stones"
TX_PRIVATE_HACHROBOT "1|The robot must reach\n1|the striped paving stones."
END
STRINGTABLE DISCARDABLE
BEGIN
TX_REPEAT_CULTIVE "1: Grow tomatoes\n2: Eat"
TX_REPEAT_FLEUR "1: Make a bunch\n2: Transform"
TX_REPEAT_FLEURQ "1: Take\n2: Transform"
TX_REPEAT_FABMINE "1: Extract iron\n2: Make a bomb"
TX_REPEAT_FABJEEP "1: Extract iron\n2: Make a Jeep"
TX_REPEAT_PALIS "1: Cut down a tree \n2: Make a palisade"
TX_REPEAT_PALISQ "1: Take\n2: Build palisade"
TX_REPEAT_PONT "1: Cut down a tree \n2: Build a bridge"
TX_REPEAT_PONTQ "1: Take\n2: Build a bridge"
TX_REPEAT_BATEAU "1: Cut down a tree \n2: Make a boat"
TX_REPEAT_BATEAUQ "1: Take\n2: Make a boat"
TX_REPEAT_FABARMURE "1: Extract iron\n2: Make an armour"
END
STRINGTABLE DISCARDABLE
BEGIN
TX_OBJ_MURPAL "Wall or palisade"
TX_OBJ_OBJET "Items"
TX_OBJ_ARME "Weapons"
TX_OBJ_VEHICULE "Transport"
TX_OBJ_STARTFEU "Starting fire"
TX_OBJ_DELOBJ "Delete item"
TX_OBJ_DELPERSO "Delete figure"
TX_OBJ_DELFEU "Delete fire"
TX_OBJ_PLANTE "Decorative plants"
TX_OBJ_BARENNEMIS "Enemy barrier"
END
STRINGTABLE DISCARDABLE
BEGIN
TX_DIRECT_N "N"
TX_DIRECT_S "S"
TX_DIRECT_E "E"
TX_DIRECT_O "W"
END
#endif // French (Switzerland) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

489
blupi-f.rc Normal file
View File

@ -0,0 +1,489 @@
//Microsoft Developer Studio generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// French (Switzerland) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRS)
#ifdef _WIN32
LANGUAGE LANG_FRENCH, SUBLANG_FRENCH_SWISS
#pragma code_page(1252)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDR_MAINFRAME ICON DISCARDABLE "blupi.ico"
#ifndef _MAC
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 0,4,0,0
PRODUCTVERSION 0,4,0,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x40004L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "100c04b0"
BEGIN
VALUE "CompanyName", "EPSITEC\0"
VALUE "FileDescription", "Blupi\0"
VALUE "FileVersion", "0, 4, 0, 0\0"
VALUE "InternalName", "Planet Blupi\0"
VALUE "LegalCopyright", "Copyright © 1997\0"
VALUE "OriginalFilename", "Blupi.exe\0"
VALUE "ProductName", "EPSITEC Planet Blupi\0"
VALUE "ProductVersion", "0, 4, 0, 0\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x100c, 1200
END
END
#endif // !_MAC
/////////////////////////////////////////////////////////////////////////////
//
// Cursor
//
IDC_POINTER CURSOR DISCARDABLE "cursor1.cur"
IDC_MAP CURSOR DISCARDABLE "map.cur"
IDC_ARROWU CURSOR DISCARDABLE "arrowup.cur"
IDC_ARROWD CURSOR DISCARDABLE "arrowdow.cur"
IDC_ARROWL CURSOR DISCARDABLE "arrowlef.cur"
IDC_ARROWR CURSOR DISCARDABLE "arrowrig.cur"
IDC_ARROWUL CURSOR DISCARDABLE "arrowul.cur"
IDC_ARROWUR CURSOR DISCARDABLE "arrowur.cur"
IDC_ARROWDR CURSOR DISCARDABLE "arrowdr.cur"
IDC_ARROWDL CURSOR DISCARDABLE "arrowdl.cur"
IDC_WAIT CURSOR DISCARDABLE "wait.cur"
IDC_EMPTY CURSOR DISCARDABLE "empty.cur"
IDC_FILL CURSOR DISCARDABLE "fill.cur"
IDC_ARROW CURSOR DISCARDABLE "arrow.cur"
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE DISCARDABLE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE DISCARDABLE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE DISCARDABLE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE DISCARDABLE
BEGIN
TX_ACTION_GO "Va"
TX_ACTION_STOP "Stoppe"
TX_ACTION_MANGE "Mange"
TX_ACTION_CARRY "Prend"
TX_ACTION_DEPOSE "Dépose"
TX_ACTION_ABAT "Abat un arbre"
TX_ACTION_ROC "Taille un rocher"
TX_ACTION_CULTIVE "Cultive un jardin"
TX_ACTION_BUILD1 "Cabane de jardin"
TX_ACTION_BUILD2 "Couveuse"
TX_ACTION_BUILD3 "Laboratoire"
TX_ACTION_BUILD4 "Mine de fer"
TX_ACTION_BUILD5 "Usine"
TX_ACTION_BUILD6 "Téléporteur"
TX_ACTION_MUR "Mur anti-feu"
END
STRINGTABLE DISCARDABLE
BEGIN
TX_ACTION_PALIS "Palissade"
TX_ACTION_ABATn "Abat des arbres"
TX_ACTION_ROCn "Taille des rochers"
TX_ACTION_PONT "Pont"
TX_ACTION_TOUR "Tour de protection"
TX_ACTION_BOIT "Boit"
TX_ACTION_LABO "Transforme"
TX_ACTION_FLEUR "Fait un bouquet"
TX_ACTION_FLEURn "Fait des bouquets"
TX_ACTION_DYNAMITE "Explose"
TX_ACTION_BATEAU "Bateau"
TX_ACTION_DJEEP "Descend"
TX_ACTION_DRAPEAU "Cherche du fer"
TX_ACTION_EXTRAIT "Extrait du fer"
TX_ACTION_FABJEEP "Farbique une jeep"
TX_ACTION_FABMINE "Fabrique une bombe"
END
STRINGTABLE DISCARDABLE
BEGIN
TX_ERROR_MISC "Impossible ici"
TX_ERROR_GROUND "Terrain pas adapté"
TX_ERROR_FREE "Terrain occupé"
TX_ERROR_PONTOP "Autre rive pas ok"
TX_ERROR_PONTTERM "Pont terminé"
TX_ERROR_TOURISOL "(tour isolée)"
TX_ERROR_TOUREAU "Trop près de l'eau"
TX_ERROR_TELE2 "Déjà 2 téléporteurs"
END
STRINGTABLE DISCARDABLE
BEGIN
TX_IONAMEEX "entraînement %d, temps %d"
TX_IOFREE "libre"
TX_TERMMIN "Perdu si moins de %d blupi"
TX_TERMMAX "Impossible de gagner si moins de %d blupi"
TX_BUTTON_JOUER "Missions"
TX_BUTTON_APPRENDRE "Entraînement"
TX_BUTTON_QUITTER "Quitter BLUPI"
TX_BUTTON_PREVP "Partie précédente"
TX_BUTTON_NEXTP "Partie suivante"
TX_BUTTON_PLAYP "Jouer cette partie"
TX_BUTTON_BUILDP "Construire cette partie"
TX_BUTTON_TERM "Terminer"
END
STRINGTABLE DISCARDABLE
BEGIN
TX_BUTTON_READP "Ouvrir une autre partie"
TX_BUTTON_WRITEP "Enregistrer la partie en cours"
TX_BUTTON_CANCELP "Abandonner la partie"
TX_BUTTON_CONTP "Continuer la partie"
TX_BUTTON_REPEAT "Recommencer"
TX_BUTTON_BUTTON "Boutons disponibles"
TX_BUTTON_CTERM "Conditions de fin"
TX_BUTTON_TERMC "Terminer la construction"
TX_BUTTON_TERMHBLUPI "Blupi sur dalles hachurées"
TX_BUTTON_TERMHPLANCHE "Planches sur dalles hachurées"
TX_BUTTON_TERMFIRE "Feu stoppé"
TX_BUTTON_TERMDEC "(-)"
TX_BUTTON_TERMINC "(+)"
TX_PAUSE "Partie interrompue"
TX_JAUGE1 "Energie de Blupi"
TX_JAUGE2 "Travail en cours"
END
STRINGTABLE DISCARDABLE
BEGIN
TX_BUTTON_SETUP "Réglages"
TX_BUTTON_MUSIC "Choix de la musique"
TX_BUTTON_SETUP1 "Diminue la vitesse"
TX_BUTTON_SETUP2 "Augmente la vitesse"
TX_BUTTON_SETUP3 "Diminue le volume"
TX_BUTTON_SETUP4 "Augmente le volume"
TX_BUTTON_MUSIC1 "Pas de musique"
TX_BUTTON_MUSIC2 "Musique numéro 1"
TX_BUTTON_MUSIC3 "Musique numéro 2"
TX_BUTTON_MUSIC4 "Musique numéro 3"
TX_BUTTON_MUSIC5 "Musique numéro 4"
TX_BUTTON_MUSIC6 "Musique numéro 5"
TX_BUTTON_MUSIC7 "Musique numéro 6"
TX_BUTTON_MUSIC8 "Musique numéro 7"
TX_BUTTON_MUSIC9 "Musique numéro 8"
TX_BUTTON_MUSIC10 "Musique numéro 9"
END
STRINGTABLE DISCARDABLE
BEGIN
TX_BUTTON_REGION "Choix des décors"
TX_BUTTON_TERMMBLUPI "Blupi dans sa maison"
TX_BUTTON_TERMKILL "Plus d'ennemis"
TX_TERM "Conditions de fin"
TX_BUTTON "Boutons disponibles"
TX_MUSIC "Choix des musiques"
TX_SCHOOL "Entraînement numéro"
TX_MISSION "Mission numéro"
TX_IONAMEMI "mission %d, temps %d"
TX_BUTTON_TERMHTOMATE "Tomates sur dalles hachurées"
TX_BUTTON_SETUP5 "Diminue le volume"
TX_BUTTON_SETUP6 "Augmente le volume"
TX_BUTTON_SETUP7 "Pas de vidéo"
TX_BUTTON_SETUP8 "Montre les vidéos"
TX_OUI "Oui"
TX_NON "Non"
END
STRINGTABLE DISCARDABLE
BEGIN
TX_OBJ_BLUPIm "Blupi malade"
TX_OBJ_BLUPIf "Blupi fatigué"
TX_OBJ_BLUPI "Blupi"
TX_OBJ_BATEAU "Bateau"
TX_OBJ_JEEP "Jeep"
TX_OBJ_PIEGE "Piège à glu"
TX_OBJ_POISON "Poison"
TX_OBJ_DYNAMITE "Dynamite"
TX_OBJ_MINE "Bombe à retardement"
TX_OBJ_TOMATE "Tomates"
TX_OBJ_POTION "Potion"
TX_OBJ_PLANCHE "Planches"
TX_OBJ_PIERRE "Pierres"
TX_OBJ_DRAPEAU "Drapeau"
TX_OBJ_FER "Minerai de fer"
TX_OBJ_FLEUR1 "Fleurs"
END
STRINGTABLE DISCARDABLE
BEGIN
TX_OBJ_FLEUR2 "Fleurs"
TX_OBJ_FLEUR3 "Fleurs"
TX_OBJ_CABANE "Cabane de jardin"
TX_OBJ_LABO "Laboratoire"
TX_OBJ_MINEFER "Mine de fer"
TX_OBJ_USINE "Usine"
TX_OBJ_TOUR "Tour de protection"
TX_OBJ_FEU "Feu"
TX_OBJ_ROBOT "Robot-maître"
TX_OBJ_TRACKS "Bulldozer"
TX_OBJ_BOMBE "Bombe sauteuse"
TX_OBJ_ARAIGNEE "Araignée"
TX_OBJ_VIRUS "Virus"
TX_OBJ_ELECTRO "Electrocuteur"
TX_OBJ_ARBRE "Arbres"
TX_OBJ_MUR "Mur anti-feu"
END
STRINGTABLE DISCARDABLE
BEGIN
TX_OBJ_ARBREb "Troncs"
TX_OBJ_ROC "Rochers"
TX_OBJ_OEUF "Oeufs"
TX_OBJ_PALISSADE "Palissade"
TX_OBJ_ENNEMIp "Ennemi piégé"
TX_OBJ_ENNEMI "Construction ennemie"
TX_OBJ_HERBE "Sol normal"
TX_OBJ_MOUSSE "Sol inflammable"
TX_OBJ_TERRE "Sol improductif"
TX_OBJ_EAU "Eau"
TX_OBJ_RIVE "Rive"
TX_OBJ_MIXTE "Sol mixte"
TX_OBJ_PONT "Pont"
TX_OBJ_COUVEUSE "Couveuse"
TX_OBJ_GLACE "Glace"
TX_OBJ_MAISON "Maison de blupi"
END
STRINGTABLE DISCARDABLE
BEGIN
TX_OBJ_HACHURE "Dalles hachurées"
TX_OBJ_MOUSSEb "Mousse brûlée"
TX_OBJ_BOUQUET1 "Bouquet de fleurs"
TX_OBJ_BOUQUET2 "Bouquet de fleurs"
TX_OBJ_BOUQUET3 "Bouquet de fleurs"
TX_OBJ_DALLE "Dalles"
TX_OBJ_ENNEMIs "Sol ennemi"
TX_OBJ_DISCIPLE "Robot-aide"
TX_OBJ_METAL "Platinium"
TX_OBJ_FUSEE "Fusée ennemie"
TX_OBJ_TELEPORTE "Téléporteur"
TX_OBJ_ARMURE "Armure"
TX_OBJ_DALLESPEC "Dalles spéciales"
TX_OBJ_COUVTELE "Couveuse ou téléporteur"
TX_OBJ_BATIMENT "Bâtiments"
TX_OBJ_BATENNEMIS "Bâtiments ennemis"
END
STRINGTABLE DISCARDABLE
BEGIN
TX_WIN1 "Bravo, c'est réussi !"
TX_WIN2 "Oui, super ..."
TX_WIN3 "Très bien."
TX_WIN4 "Magnifique, excellent ..."
TX_WIN5 "Mission accomplie."
END
STRINGTABLE DISCARDABLE
BEGIN
TX_LOST1 "C'est raté, essaie encore une fois"
TX_LOST2 "Et non, ce n'est pas ça ..."
TX_LOST3 "Paf, c'est raté !"
TX_LOST4 "Caramba, encore raté ..."
END
STRINGTABLE DISCARDABLE
BEGIN
TX_LOST5 "Mais non, pas comme ça !"
END
STRINGTABLE DISCARDABLE
BEGIN
TX_LASTWIN1 "Passe maintenant aux missions."
TX_LASTWIN2 "Magnifique, le jeu est terminé !"
TX_LASTWIN3 "Dernière construction résolue !"
END
STRINGTABLE DISCARDABLE
BEGIN
TX_BUTTON_SETUP9 "Diminue la vitesse"
TX_BUTTON_SETUP10 "Augmente la vitesse"
TX_INFO_SETUP1 "Vitesse globale\ndu jeu"
TX_INFO_SETUP2 "Volume\ndes bruitages"
TX_INFO_SETUP3 "Volume\ndes musiques"
TX_INFO_SETUP4 "Séquences\nvidéo"
TX_INFO_SETUP5 "Vitesse\ndes décalages\navec la souris"
TX_INFO_NOSCROLL "Aucun"
TX_BUTTON_REGION1 "Prairie"
TX_BUTTON_REGION2 "Désert"
END
STRINGTABLE DISCARDABLE
BEGIN
TX_BUTTON_REGION3 "Forêt enneigée"
TX_BUTTON_REGION4 "Forêt"
TX_REGION "Choix de la région"
TX_BUTTON_PLAY_STOP "Interrompre"
TX_BUTTON_PLAY_SETUP "Réglages"
TX_BUTTON_PLAY_WRITE "Enregistrer"
TX_INSERT "Veuillez insérer le CD-Rom Planète Blupi, puis attendre quelques secondes ..."
TX_BUTTON_PREVH "Page précédente"
TX_BUTTON_NEXTH "Page suivante"
TX_BUTTON_TERMHMETAL "Platinium sur dalles hachurées"
TX_BUTTON_HELP "Aide"
TX_HELP "Aide numéro"
TX_BUTTON_PRIVE "Construction"
TX_PRIVATE "Construction numéro"
TX_IONAMEPR "construction %d, temps %d"
TX_PRIVATE_HACHBLUPI "1|Aller sur les dalles\n1|hachurées."
END
STRINGTABLE DISCARDABLE
BEGIN
TX_ACTION_FABDISC "Fabrique un robot"
TX_ACTION_REPEAT "Répète"
TX_ACTION_QARMURE "Quitte"
TX_ACTION_FABARMURE "Fabrique une armure"
END
STRINGTABLE DISCARDABLE
BEGIN
TX_PRIVATE_HACHPLANCHE "1|Déposer des planches\n1|sur les dalles hachurées."
TX_PRIVATE_HACHTOMATE "1|Déposer des tomates\n1|sur les dalles hachurées."
TX_PRIVATE_HACHMETAL "1|Déposer du platinium\n1|sur les dalles hachurées."
TX_PRIVATE_STOPFIRE "1|Résister jusqu'à\n1|l'extinction du feu ..."
TX_PRIVATE_HOMEBLUPI "1|Chaque Blupi dans\n1|sa maison."
TX_PRIVATE_KILLROBOTS "1|Supprimer tous les\n1|ennemis !"
TX_BUTTON_UNDO "Annuler la dernière opération"
TX_DEMO_END1 "Vous avez joué à la version DEMO de Planète Blupi."
TX_DEMO_END2 "Nous espérons que vous avez eu autant de plaisir à y jouer que nous à le réaliser !"
TX_DEMO_END3 "Ce jeu est une création originale d'EPSITEC SA, CH-1092 Belmont"
TX_DEMO_END4 "http://www.blupi.com blupi@epsitec.ch"
TX_FULL_END1 "Vous avez joué à Planète Blupi."
TX_FULL_END2 "Nous espérons que vous avez eu autant de plaisir à y jouer que nous à le réaliser !"
TX_FULL_END3 "Ce jeu est une création originale d'EPSITEC SA, CH-1092 Belmont"
TX_FULL_END4 "http://www.blupi.com blupi@epsitec.ch"
TX_PRIVATE_OBJECTIF "1|Objectif :"
END
STRINGTABLE DISCARDABLE
BEGIN
TX_PRIVATE_NBBLUPI "1|La population doit être\n1|d'au moins %d Blupi."
TX_BUTTON_SKILL "Niveau de difficulté"
TX_SKILL1 "Facile"
TX_SKILL2 "Difficile"
TX_BUTTON_DEMO "Démo"
TX_DEMOREC "REC"
TX_DEMOPLAY "Démo"
TX_BUTTON_TERMHROBOT "Robot sur dalles hachurées"
TX_PRIVATE_HACHROBOT "1|Le robot doit atteindre\n1|les dalles hachurées."
END
STRINGTABLE DISCARDABLE
BEGIN
TX_REPEAT_CULTIVE "1: Cultive ...\n2: Mange"
TX_REPEAT_FLEUR "1: Fait un bouquet\n2: Transforme"
TX_REPEAT_FLEURQ "1: Prend\n2: Transforme"
TX_REPEAT_FABMINE "1: Extrait du fer\n2: Fabrique bombe"
TX_REPEAT_FABJEEP "1: Extrait du fer\n2: Fabrique jeep"
TX_REPEAT_PALIS "1: Abat un arbre\n2: Construit palissade"
TX_REPEAT_PALISQ "1: Prend\n2: Construit palissade"
TX_REPEAT_PONT "1: Abat un arbre\n2: Construit pont"
TX_REPEAT_PONTQ "1: Prend\n2: Construit pont"
TX_REPEAT_BATEAU "1: Abat un arbre\n2: Construit bateau"
TX_REPEAT_BATEAUQ "1: Prend\n2: Construit bateau"
TX_REPEAT_FABARMURE "1: Extrait du fer\n2: Fabrique armure"
END
STRINGTABLE DISCARDABLE
BEGIN
TX_OBJ_MURPAL "Mur ou palissade"
TX_OBJ_OBJET "Objets"
TX_OBJ_ARME "Armes"
TX_OBJ_VEHICULE "Moyens de transport"
TX_OBJ_STARTFEU "Début d'incendie"
TX_OBJ_DELOBJ "Supprime objet"
TX_OBJ_DELPERSO "Supprime personnage"
TX_OBJ_DELFEU "Supprime feu"
TX_OBJ_PLANTE "Plantes ornementales"
TX_OBJ_BARENNEMIS "Barrière ennemie"
END
STRINGTABLE DISCARDABLE
BEGIN
TX_DIRECT_N "N"
TX_DIRECT_S "S"
TX_DIRECT_E "E"
TX_DIRECT_O "O"
END
#endif // French (Switzerland) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

856
blupi.cpp Normal file
View File

@ -0,0 +1,856 @@
// blupi.cpp
//
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <windowsx.h>
#include <stdlib.h>
#include <stdio.h>
#include <ddraw.h>
#include <mmsystem.h> // link WINMM.LIB as well
#include "def.h"
#include "resource.h"
#include "ddutil.h"
#include "pixmap.h"
#include "sound.h"
#include "decor.h"
#include "movie.h"
#include "button.h"
#include "menu.h"
#include "jauge.h"
#include "event.h"
#include "misc.h"
// Définitions globales
#define NAME "Blupi"
#define TITLE "Blupi"
// Variables globales
HWND g_hWnd; // handle à la fenêtre
CEvent* g_pEvent = NULL;
CPixmap* g_pPixmap = NULL; // pixmap principal
CSound* g_pSound = NULL; // sound principal
CMovie* g_pMovie = NULL; // movie principal
CDecor* g_pDecor = NULL;
char g_CDPath[MAX_PATH]; // chemin d'accès au CD-Rom
BOOL g_bFullScreen = FALSE; // FALSE si mode de test
int g_speedRate = 1;
int g_timerInterval = 50; // inverval = 50ms
int g_mouseType = MOUSETYPEGRA;
MMRESULT g_updateTimer; // timer général
BOOL g_bActive = TRUE; // is application active ?
BOOL g_bTermInit = FALSE; // initialisation en cours
UINT g_lastPhase = 999;
// Lit un numéro décimal.
int GetNum(char *p)
{
int n = 0;
while ( *p >= '0' && *p <= '9' )
{
n *= 10;
n += (*p++)-'0';
}
return n;
}
// Lit le fichier de configuration.
BOOL ReadConfig(LPSTR lpCmdLine)
{
FILE* file = NULL;
char buffer[200];
char* pText;
int nb;
file = fopen("data\\config.def", "rb");
if ( file == NULL ) return FALSE;
nb = fread(buffer, sizeof(char), 200-1, file);
buffer[nb] = 0;
fclose(file);
#if 0
pText = strstr(buffer, "CD-Rom=");
if ( pText == NULL )
{
#if _DEMO
GetCurrentDirectory(MAX_PATH, g_CDPath);
i = strlen(g_CDPath);
if ( i > 0 && g_CDPath[i-1] != '\\' )
{
g_CDPath[i++] = '\\';
g_CDPath[i] = 0; // met le terminateur
}
#else
return FALSE;
#endif
}
else
{
pText += 7;
i = 0;
while ( pText[i] != 0 && pText[i] != '\n' && pText[i] != '\r' )
{
g_CDPath[i] = pText[i];
i ++;
}
if ( i > 0 && g_CDPath[i-1] != '\\' )
{
g_CDPath[i++] = '\\';
}
g_CDPath[i] = 0; // met le terminateur
}
#if !_DEMO & !_EGAMES
if ( strstr(lpCmdLine, "-nocd") == NULL )
{
char drive[10];
drive[0] = g_CDPath[0];
drive[1] = ':';
drive[2] = '\\';
drive[3] = 0;
nb = GetDriveType(drive);
if ( nb != DRIVE_CDROM ) return FALSE;
}
#endif
#endif
pText = strstr(buffer, "SpeedRate=");
if ( pText != NULL )
{
g_speedRate = GetNum(pText+10);
if ( g_speedRate < 1 ) g_speedRate = 1;
if ( g_speedRate > 2 ) g_speedRate = 2;
}
pText = strstr(buffer, "Timer=");
if ( pText != NULL )
{
g_timerInterval = GetNum(pText+6);
if ( g_timerInterval < 10 ) g_timerInterval = 10;
if ( g_timerInterval > 1000 ) g_timerInterval = 1000;
}
pText = strstr(buffer, "FullScreen=");
if ( pText != NULL )
{
g_bFullScreen = GetNum(pText+11);
if ( g_bFullScreen != 0 ) g_bFullScreen = 1;
}
pText = strstr(buffer, "MouseType=");
if ( pText != NULL )
{
g_mouseType = GetNum(pText+10);
if ( g_mouseType < 1 ) g_mouseType = 1;
if ( g_mouseType > 9 ) g_mouseType = 9;
}
return TRUE;
}
// Mise à jour principale.
void UpdateFrame(void)
{
RECT clip, rcRect;
UINT phase;
POINT posMouse;
int i, term, speed;
g_pPixmap->MouseBackClear(); // enlève la souris dans "back"
posMouse = g_pEvent->GetLastMousePos();
phase = g_pEvent->GetPhase();
if ( phase == g_lastPhase &&
phase == WM_PHASE_PLAY )
{
//? rcRect.left = POSDRAWX;
//? rcRect.top = POSDRAWY;
//? rcRect.right = POSDRAWX+DIMDRAWX;
//? rcRect.bottom = POSDRAWY+DIMDRAWY;
//? g_pPixmap->DrawImage(-1, CHBACK, rcRect, 1); // dessine le fond
}
else
{
rcRect.left = 0;
rcRect.top = 0;
rcRect.right = LXIMAGE;
rcRect.bottom = LYIMAGE;
g_pPixmap->DrawImage(-1, CHBACK, rcRect, 1); // dessine le fond
}
if ( phase == WM_PHASE_INTRO1 ||
phase == WM_PHASE_INTRO2 )
{
g_pEvent->IntroStep();
}
if ( phase == WM_PHASE_PLAY )
{
clip.left = POSDRAWX;
clip.top = POSDRAWY+g_pDecor->GetInfoHeight();
clip.right = POSDRAWX+DIMDRAWX;
clip.bottom = POSDRAWY+DIMDRAWY;
if ( g_pEvent->IsShift() ) // shift en cours ?
{
g_pEvent->DecorAutoShift(posMouse);
g_pDecor->Build(clip, posMouse); // construit juste le décor
}
else
{
if ( !g_pEvent->GetPause() )
{
speed = g_pEvent->GetSpeed() * g_speedRate;
for ( i=0 ; i<speed ; i++ )
{
g_pDecor->BlupiStep(i==0); // avance tous les blupi
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écor
g_pDecor->NextPhase(1); // refait la carte de temps en temps
}
}
if ( phase == WM_PHASE_BUILD )
{
clip.left = POSDRAWX;
clip.top = POSDRAWY;
clip.right = POSDRAWX+DIMDRAWX;
clip.bottom = POSDRAWY+DIMDRAWY;
g_pEvent->DecorAutoShift(posMouse);
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émarre év. démo automatique
}
g_pEvent->DrawButtons();
g_lastPhase = phase;
if ( phase == WM_PHASE_H0MOVIE ||
phase == WM_PHASE_H1MOVIE ||
phase == WM_PHASE_H2MOVIE ||
phase == WM_PHASE_PLAYMOVIE ||
phase == WM_PHASE_WINMOVIE )
{
g_pEvent->MovieToStart(); // fait démarrer un film si nécessaire
}
if ( phase == WM_PHASE_INSERT )
{
g_pEvent->TryInsert();
}
if ( phase == WM_PHASE_PLAY )
{
term = g_pDecor->IsTerminated();
if ( term == 1 ) g_pEvent->ChangePhase(WM_PHASE_LOST); // perdu
if ( term == 2 ) g_pEvent->ChangePhase(WM_PHASE_WINMOVIE); // gagné
}
g_pPixmap->MouseBackDraw(); // remet la souris dans "back"
}
void Benchmark()
{
int i;
POINT pos = { 0, 0 };
g_pPixmap->DrawIcon(-1, 2, 10, pos, 0);
pos.x = 300;
pos.y = 350;
for ( i=0 ; i<10000 ; i++ )
{
g_pPixmap->DrawIcon(-1, 2, i%4, pos, 0);
}
g_pPixmap->DrawIcon(-1, 2, 10, pos, 0);
g_pSound->Play(0);
}
// Restitue le jeu après une activation en mode fullScreen.
BOOL RestoreGame()
{
if ( g_pPixmap == NULL ) return FALSE;
g_pEvent->RestoreGame();
return g_pPixmap->Restore();
}
// Libère le jeu avant une désactivation en mode fullScreen.
BOOL FlushGame()
{
if ( g_pPixmap == NULL ) return FALSE;
return g_pPixmap->Flush();
}
// Finished with all objects we use; release them.
static void FinishObjects(void)
{
if ( g_pMovie != NULL )
{
g_pEvent->StopMovie();
delete g_pMovie;
g_pMovie = NULL;
}
if ( g_pEvent != NULL )
{
delete g_pEvent;
g_pEvent = NULL;
}
if ( g_pDecor != NULL )
{
delete g_pDecor;
g_pDecor = NULL;
}
if ( g_pSound != NULL )
{
g_pSound->StopMusic(); // stoppe la musique Midi
delete g_pSound;
g_pSound = NULL;
}
if ( g_pPixmap != NULL )
{
delete g_pPixmap;
g_pPixmap = NULL;
}
}
LRESULT CALLBACK WindowProc (HWND hWnd, UINT message,
WPARAM wParam, LPARAM lParam)
{
static HINSTANCE hInstance;
POINT mousePos, totalDim, iconDim;
#if 0
if ( message != WM_TIMER )
{
char s[100];
sprintf(s, "message=%d,%d\n", message, wParam);
OutputDebug(s);
}
#endif
// La touche F10 envoie un autre message pour activer
// le menu dans les applications Windows standard !
if ( message == WM_SYSKEYDOWN && wParam == VK_F10 )
{
message = WM_KEYDOWN;
}
if ( message == WM_SYSKEYUP && wParam == VK_F10 )
{
message = WM_KEYUP;
}
if ( g_pEvent != NULL &&
g_pEvent->TreatEvent(message, wParam, lParam) ) return 0;
switch( message )
{
case WM_TIMER:
case WM_UPDATE:
if ( !g_pEvent->IsMovie() ) // pas de film en cours ?
{
if ( g_bActive )
{
UpdateFrame();
}
g_pPixmap->Display();
}
break;
case WM_CREATE:
hInstance = ((LPCREATESTRUCT)lParam)->hInstance;
return 0;
case WM_ACTIVATEAPP:
g_bActive = (wParam != 0);
if ( g_bActive ) // active ?
{
if ( g_bFullScreen )
{
RestoreGame();
g_lastPhase = 999;
}
if ( !g_bFullScreen && g_bTermInit )
{
totalDim.x = 64;
totalDim.y = 66;
iconDim.x = 64;
iconDim.y = 66/2;
g_pPixmap->Cache(CHHILI, "image\\hili.blp", totalDim, iconDim, TRUE);
g_pPixmap->SetTransparent(CHHILI, RGB(0,0,255)); // bleu
g_pPixmap->SavePalette();
g_pPixmap->InitSysPalette();
}
SetWindowText(hWnd, "Blupi");
if ( g_pSound != NULL ) g_pSound->RestartMusic();
}
else // désactive ?
{
if ( g_bFullScreen )
{
FlushGame();
}
SetWindowText(hWnd, "Blupi -- stop");
if ( g_pSound != NULL ) g_pSound->SuspendMusic();
}
return 0;
case WM_SYSCOLORCHANGE:
OutputDebug("Event WM_SYSCOLORCHANGE\n");
break;
case WM_QUERYNEWPALETTE:
OutputDebug("Event WM_QUERYNEWPALETTE\n");
break;
case WM_PALETTECHANGED:
OutputDebug("Event WM_PALETTECHANGED\n");
break;
case WM_DISPLAYCHANGE:
OutputDebug("Event WM_DISPLAYCHANGE\n");
break;
case MM_MCINOTIFY:
OutputDebug("Event MM_MCINOTIFY\n");
if ( g_pEvent->IsMovie() ) // film en cours ?
{
if ( wParam == MCI_NOTIFY_SUCCESSFUL )
{
g_pEvent->StopMovie();
}
}
else
{
// music over, play it again
g_pSound->SuspendMusic();
// if music finished, play it again. Otherwise assume that
// it was aborted by the user or otherwise
if ( wParam == MCI_NOTIFY_SUCCESSFUL )
{
OutputDebug("Event MCI_NOTIFY_SUCCESSFUL\n");
g_pSound->RestartMusic();
}
else
{
char s[50];
sprintf(s, "wParam=%d\n", wParam);
OutputDebug(s);
}
}
break;
case WM_SETCURSOR:
// ChangeSprite();
// SetCursor(NULL); // pas de souris visible !
return TRUE;
case WM_LBUTTONDOWN:
//? Benchmark();
GetCursorPos(&mousePos);
ScreenToClient(hWnd, &mousePos);
break;
case WM_RBUTTONDOWN:
break;
case WM_MOUSEMOVE:
break;
case WM_KEYDOWN:
switch( wParam )
{
case VK_F5:
g_pEvent->SetSpeed(1);
break;
case VK_F6:
g_pEvent->SetSpeed(2);
break;
case VK_F7:
g_pEvent->SetSpeed(4);
break;
case VK_F8:
g_pEvent->SetSpeed(8);
break;
#if 0
case VK_F2:
KillTimer(g_hWnd, 1);
SetTimer(g_hWnd, 1, g_timerInterval/2, NULL);
break;
case VK_F3:
KillTimer(g_hWnd, 1);
SetTimer(g_hWnd, 1, g_timerInterval, NULL);
break;
case VK_F4:
KillTimer(g_hWnd, 1);
SetTimer(g_hWnd, 1, g_timerInterval*2, NULL);
break;
#endif
}
break;
case WM_DESTROY:
KillTimer(g_hWnd, 1);
FinishObjects();
PostQuitMessage(0);
break;
}
return DefWindowProc(hWnd, message, wParam, lParam);
}
// Erreur dans DoInit.
BOOL InitFail(char *msg, BOOL bDirectX)
{
char buffer[100];
if ( bDirectX ) strcpy(buffer, "DirectX Init FAILED\n(while ");
else strcpy(buffer, "Error (");
strcat(buffer, msg);
strcat(buffer, ")");
MessageBox(g_hWnd, buffer, TITLE, MB_OK);
FinishObjects();
DestroyWindow(g_hWnd);
return FALSE;
}
// Initialisation de l'application.
static BOOL DoInit(HINSTANCE hInstance, LPSTR lpCmdLine, int nCmdShow)
{
WNDCLASS wc;
POINT totalDim, iconDim;
RECT rcRect;
BOOL bOK;
bOK = ReadConfig(lpCmdLine); // lit le fichier config.def
InitHInstance(hInstance);
// Set up and register window class.
wc.style = CS_HREDRAW|CS_VREDRAW;
wc.lpfnWndProc = WindowProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = hInstance;
//? wc.hIcon = LoadIcon(hInstance, IDI_APPLICATION);
wc.hIcon = LoadIcon(hInstance, "IDR_MAINFRAME");
wc.hCursor = LoadCursor(hInstance, "IDC_POINTER");
wc.hbrBackground = GetStockBrush(BLACK_BRUSH);
wc.lpszMenuName = NAME;
wc.lpszClassName = NAME;
RegisterClass(&wc);
// Create a window.
if ( g_bFullScreen )
{
g_hWnd = CreateWindowEx
(
WS_EX_TOPMOST,
NAME,
TITLE,
WS_POPUP,
0, 0,
GetSystemMetrics(SM_CXSCREEN),
GetSystemMetrics(SM_CYSCREEN),
NULL,
NULL,
hInstance,
NULL
);
}
else
{
int sx, sy;
RECT WindowRect;
sx = GetSystemMetrics(SM_CXSCREEN);
sy = GetSystemMetrics(SM_CYSCREEN);
SetRect(&WindowRect, (sx-LXIMAGE)/2, (sy-LYIMAGE)/2,
(sx+LXIMAGE)/2, (sy+LYIMAGE)/2);
AdjustWindowRect(&WindowRect, WS_POPUPWINDOW|WS_CAPTION, TRUE);
WindowRect.top += GetSystemMetrics(SM_CYCAPTION);
g_hWnd = CreateWindow
(
NAME,
TITLE,
WS_POPUPWINDOW|WS_CAPTION|WS_VISIBLE,
(sx-LXIMAGE)/2, (sy-LYIMAGE)/2,
WindowRect.right - WindowRect.left,
WindowRect.bottom - WindowRect.top,
HWND_DESKTOP,
NULL,
hInstance,
NULL
);
}
if ( !g_hWnd ) return FALSE;
ShowWindow(g_hWnd, nCmdShow);
UpdateWindow(g_hWnd);
SetFocus(g_hWnd);
ChangeSprite(SPRITE_WAIT); // met le sablier maison
if ( !bOK ) // config.def pas correct ?
{
return InitFail("Game not correctly installed", FALSE);
}
// Crée le pixmap principal.
g_pPixmap = new CPixmap;
if ( g_pPixmap == NULL ) return InitFail("New pixmap", TRUE);
totalDim.x = LXIMAGE;
totalDim.y = LYIMAGE;
if ( !g_pPixmap->Create(g_hWnd, totalDim, g_bFullScreen, g_mouseType) )
return InitFail("Create pixmap", TRUE);
OutputDebug("Image: init\n");
totalDim.x = LXIMAGE;
totalDim.y = LYIMAGE;
iconDim.x = 0;
iconDim.y = 0;
#if _INTRO
if ( !g_pPixmap->Cache(CHBACK, "image\\intro1.blp", totalDim, iconDim, TRUE) )
#else
if ( !g_pPixmap->Cache(CHBACK, "image\\init.blp", totalDim, iconDim, TRUE) )
#endif
return FALSE;
OutputDebug("SavePalette\n");
g_pPixmap->SavePalette();
OutputDebug("InitSysPalette\n");
g_pPixmap->InitSysPalette();
OutputDebug("Image: init\n");
totalDim.x = LXIMAGE;
totalDim.y = LYIMAGE;
iconDim.x = 0;
iconDim.y = 0;
if ( !g_pPixmap->Cache(CHGROUND, "image\\init.blp", totalDim, iconDim, TRUE) )
return FALSE;
g_pPixmap->SetDebug(FALSE);
rcRect.left = 0;
rcRect.top = 0;
rcRect.right = LXIMAGE;
rcRect.bottom = LYIMAGE;
g_pPixmap->DrawImage(-1, CHBACK, rcRect, 1); // dessine le fond
g_pPixmap->Display();
totalDim.x = DIMCELX*2*16;
totalDim.y = DIMCELY*2*6;
iconDim.x = DIMCELX*2;
iconDim.y = DIMCELY*2;
if ( !g_pPixmap->Cache(CHFLOOR, "image\\floor000.blp", totalDim, iconDim, FALSE) )
return InitFail("Cache floor000.blp", TRUE);
g_pPixmap->SetTransparent(CHFLOOR, RGB(0,0,255)); // bleu
totalDim.x = DIMOBJX*16;
totalDim.y = DIMOBJY*8;
iconDim.x = DIMOBJX;
iconDim.y = DIMOBJY;
if ( !g_pPixmap->Cache(CHOBJECT, "image\\obj000.blp", totalDim, iconDim, FALSE) )
return InitFail("Cache obj000.blp", TRUE);
g_pPixmap->SetTransparent(CHOBJECT, RGB(0,0,255)); // bleu
if ( !g_pPixmap->Cache(CHOBJECTo, "image\\obj-o000.blp", totalDim, iconDim, FALSE) )
return InitFail("Cache obj-o000.blp", TRUE);
g_pPixmap->SetTransparent(CHOBJECTo, RGB(255,255,255)); // blanc
totalDim.x = DIMBLUPIX*16;
totalDim.y = DIMBLUPIY*23;
iconDim.x = DIMBLUPIX;
iconDim.y = DIMBLUPIY;
if ( !g_pPixmap->Cache(CHBLUPI, "image\\blupi.blp", totalDim, iconDim, FALSE) )
return InitFail("Cache blupi.blp", TRUE);
g_pPixmap->SetTransparent(CHBLUPI, RGB(0,0,255)); // bleu
totalDim.x = 64;
totalDim.y = 66;
iconDim.x = 64;
iconDim.y = 66/2;
if ( !g_pPixmap->Cache(CHHILI, "image\\hili.blp", totalDim, iconDim, FALSE) )
return InitFail("Cache hili.blp", TRUE);
g_pPixmap->SetTransparent(CHHILI, RGB(0,0,255)); // bleu
totalDim.x = DIMCELX*2*3;
totalDim.y = DIMCELY*2*5;
iconDim.x = DIMCELX*2;
iconDim.y = DIMCELY*2;
if ( !g_pPixmap->Cache(CHFOG, "image\\fog.blp", totalDim, iconDim, FALSE) )
return InitFail("Cache fog.blp", TRUE);
g_pPixmap->SetTransparent(CHFOG, RGB(255,255,255)); // blanc
totalDim.x = DIMCELX*2*16;
totalDim.y = DIMCELY*2*1;
iconDim.x = DIMCELX*2;
iconDim.y = DIMCELY*2;
if ( !g_pPixmap->Cache(CHMASK1, "image\\mask1.blp", totalDim, iconDim, FALSE) )
return InitFail("Cache mask1.blp", TRUE);
g_pPixmap->SetTransparent(CHMASK1, RGB(0,0,0)); // noir
totalDim.x = DIMBUTTONX*6;
totalDim.y = DIMBUTTONY*21;
iconDim.x = DIMBUTTONX;
iconDim.y = DIMBUTTONY;
if ( !g_pPixmap->Cache(CHBUTTON, "image\\button00.blp", totalDim, iconDim, FALSE) )
return InitFail("Cache button00.blp", TRUE);
g_pPixmap->SetTransparent(CHBUTTON, RGB(0,0,255)); // bleu
totalDim.x = DIMJAUGEX*1;
totalDim.y = DIMJAUGEY*4;
iconDim.x = DIMJAUGEX;
iconDim.y = DIMJAUGEY;
if ( !g_pPixmap->Cache(CHJAUGE, "image\\jauge.blp", totalDim, iconDim, FALSE) )
return InitFail("Cache jauge.blp", TRUE);
g_pPixmap->SetTransparent(CHJAUGE, RGB(0,0,255)); // bleu
totalDim.x = DIMTEXTX*16;
totalDim.y = DIMTEXTY*8*3;
iconDim.x = DIMTEXTX;
iconDim.y = DIMTEXTY;
if ( !g_pPixmap->Cache(CHTEXT, "image\\text.blp", totalDim, iconDim, FALSE) )
return InitFail("Cache text.blp", TRUE);
g_pPixmap->SetTransparent(CHTEXT, RGB(0,0,255)); // bleu
totalDim.x = DIMLITTLEX*16;
totalDim.y = DIMLITTLEY*8;
iconDim.x = DIMLITTLEX;
iconDim.y = DIMLITTLEY;
if ( !g_pPixmap->Cache(CHLITTLE, "image\\little.blp", totalDim, iconDim, FALSE) )
return InitFail("Cache little.blp", TRUE);
g_pPixmap->SetTransparent(CHLITTLE, RGB(0,0,255)); // bleu
totalDim.x = 426;
totalDim.y = 52;
iconDim.x = 426;
iconDim.y = 52;
if ( !g_pPixmap->Cache(CHBIGNUM, "image\\bignum.blp", totalDim, iconDim, FALSE) )
return InitFail("Cache bignum.blp", TRUE);
g_pPixmap->SetTransparent(CHBIGNUM, RGB(0,0,255)); // bleu
// Crée le gestionnaire de son.
g_pSound = new CSound;
if ( g_pSound == NULL ) return InitFail("New sound", TRUE);
g_pSound->Create(g_hWnd);
g_pSound->CacheAll();
g_pSound->SetState(TRUE);
// Crée le gestionnaire de films.
g_pMovie = new CMovie;
if ( g_pMovie == NULL ) return InitFail("New movie", FALSE);
g_pMovie->Create();
// Crée le gestionnaire de décors.
g_pDecor = new CDecor;
if ( g_pDecor == NULL ) return InitFail("New decor", FALSE);
g_pDecor->Create(g_hWnd, g_pSound, g_pPixmap);
g_pDecor->MapInitColors();
// Crée le gestionnaire d'événements.
g_pEvent = new CEvent;
if ( g_pEvent == NULL ) return InitFail("New event", FALSE);
g_pEvent->Create(g_hWnd, g_pPixmap, g_pDecor, g_pSound, g_pMovie);
g_pEvent->SetFullScreen(g_bFullScreen);
g_pEvent->SetMouseType(g_mouseType);
#if _INTRO
g_pEvent->ChangePhase(WM_PHASE_INTRO1);
#else
g_pEvent->ChangePhase(WM_PHASE_TESTCD);
#endif
g_bTermInit = TRUE; // initialisation terminée
return TRUE;
}
// Programme principal.
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow)
{
MSG msg;
if ( !DoInit(hInstance, lpCmdLine, nCmdShow) )
{
return FALSE;
}
SetTimer(g_hWnd, 1, g_timerInterval, NULL);
while ( TRUE )
{
if ( PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE) )
{
if ( !GetMessage(&msg, NULL, 0, 0) )
{
return msg.wParam;
}
TranslateMessage(&msg);
DispatchMessage(&msg);
}
else
{
// make sure we go to sleep if we have nothing else to do
if ( !g_bActive ) WaitMessage();
}
}
return msg.wParam;
}

BIN
blupi.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

426
button.cpp Normal file
View File

@ -0,0 +1,426 @@
// Button.cpp
//
#include <windows.h>
#include <stdlib.h>
#include <stdio.h>
#include <ddraw.h>
#include "def.h"
#include "pixmap.h"
#include "sound.h"
#include "decor.h"
#include "button.h"
#include "misc.h"
/////////////////////////////////////////////////////////////////////////////
// Constructeur.
CButton::CButton()
{
m_type = 0;
m_bEnable = TRUE;
m_bHide = FALSE;
m_state = 0;
m_mouseState = 0;
m_nbMenu = 0;
m_nbToolTips = 0;
m_selMenu = 0;
m_bMouseDown = FALSE;
m_bMinimizeRedraw = FALSE;
m_bRedraw = FALSE;
}
// Destructeur.
CButton::~CButton()
{
}
// Crée un nouveau bouton.
BOOL CButton::Create(HWND hWnd, CPixmap *pPixmap, CSound *pSound,
POINT pos, int type, BOOL bMinimizeRedraw,
int *pMenu, int nbMenu,
int *pToolTips, int nbToolTips,
int region, UINT message)
{
POINT iconDim;
int i, icon;
static int ttypes[] =
{
DIMBUTTONX,DIMBUTTONY, // button00.bmp
};
if ( type < 0 || type > 0 ) return FALSE;
iconDim.x = ttypes[type*2+0];
iconDim.y = ttypes[type*2+1];
m_hWnd = hWnd;
m_pPixmap = pPixmap;
m_pSound = pSound;
m_type = type;
m_bMinimizeRedraw = bMinimizeRedraw;
m_bEnable = TRUE;
m_bHide = FALSE;
m_message = message;
m_pos = pos;
m_dim = iconDim;
m_nbMenu = nbMenu;
m_nbToolTips = nbToolTips;
m_selMenu = 0;
m_state = 0;
m_mouseState = 0;
m_bMouseDown = FALSE;
m_bRedraw = TRUE;
for ( i=0 ; i<nbMenu ; i++ )
{
icon = pMenu[i];
if ( region == 1 ) // palmiers ?
{
if ( icon == 0 ) icon = 90; // sol normal
if ( icon == 1 ) icon = 91; // sol inflammable
if ( icon == 2 ) icon = 92; // sol inculte
if ( icon == 7 ) icon = 9; // plante
if ( icon == 8 ) icon = 10; // arbre
}
if ( region == 2 ) // hiver ?
{
if ( icon == 0 ) icon = 96; // sol normal
if ( icon == 1 ) icon = 97; // sol inflammable
if ( icon == 2 ) icon = 98; // sol inculte
if ( icon == 8 ) icon = 99; // arbre
}
if ( region == 3 ) // sapin ?
{
if ( icon == 0 ) icon = 102; // sol normal
if ( icon == 1 ) icon = 103; // sol inflammable
if ( icon == 2 ) icon = 104; // sol inculte
if ( icon == 8 ) icon = 105; // arbre
}
m_iconMenu[i] = icon;
}
for ( i=0 ; i<nbToolTips ; i++ )
{
m_toolTips[i] = pToolTips[i];
}
return TRUE;
}
// Dessine un bouton dans son état.
void CButton::Draw()
{
int i;
POINT pos;
RECT rect;
if ( m_bMinimizeRedraw && !m_bRedraw ) return;
m_bRedraw = FALSE;
if ( m_bHide ) // bouton caché ?
{
rect.left = m_pos.x;
rect.right = m_pos.x+m_dim.x;
rect.top = m_pos.y;
rect.bottom = m_pos.y+m_dim.y;
m_pPixmap->DrawPart(-1, CHBACK, m_pos, rect, 1); // dessine le fond
return;
}
if ( m_bEnable ) // bouton actif ?
{
m_pPixmap->DrawIcon(-1, CHBUTTON+m_type, m_mouseState, m_pos);
}
else
{
m_pPixmap->DrawIcon(-1, CHBUTTON+m_type, 4, m_pos);
}
if ( m_nbMenu == 0 ) return;
pos = m_pos;
if ( m_nbMenu > 0 )
{
m_pPixmap->DrawIcon(-1, CHBUTTON+m_type,
m_iconMenu[m_selMenu]+6, pos);
}
if ( m_nbMenu == 1 || !m_bEnable || !m_bMouseDown ) return;
pos = m_pos;
pos.x += m_dim.x+2;
for ( i=0 ; i<m_nbMenu ; i++ )
{
m_pPixmap->DrawIcon(-1, CHBUTTON+m_type, i==m_selMenu?1:0, pos);
m_pPixmap->DrawIcon(-1, CHBUTTON+m_type, m_iconMenu[i]+6, pos);
pos.x += m_dim.x-1;
}
}
void CButton::Redraw()
{
m_bRedraw = TRUE;
}
int CButton::GetState()
{
return m_state;
}
void CButton::SetState(int state)
{
if ( m_state != state ||
m_mouseState != state )
{
m_bRedraw = TRUE;
}
m_state = state;
m_mouseState = state;
}
int CButton::GetMenu()
{
return m_selMenu;
}
void CButton::SetMenu(int menu)
{
if ( m_selMenu != menu )
{
m_bRedraw = TRUE;
}
m_selMenu = menu;
}
BOOL CButton::GetEnable()
{
return m_bEnable;
}
void CButton::SetEnable(BOOL bEnable)
{
if ( m_bEnable != bEnable )
{
m_bRedraw = TRUE;
}
m_bEnable = bEnable;
}
BOOL CButton::GetHide()
{
return m_bHide;
}
void CButton::SetHide(BOOL bHide)
{
if ( m_bHide != bHide )
{
m_bRedraw = TRUE;
}
m_bHide = bHide;
}
// Traitement d'un événement.
BOOL CButton::TreatEvent(UINT message, WPARAM wParam, LPARAM lParam)
{
POINT pos;
if ( m_bHide || !m_bEnable ) return FALSE;
pos = ConvLongToPos(lParam);
switch( message )
{
case WM_LBUTTONDOWN:
case WM_RBUTTONDOWN:
if ( MouseDown(pos) ) return TRUE;
break;
case WM_MOUSEMOVE:
if ( MouseMove(pos) ) return TRUE;
break;
case WM_LBUTTONUP:
case WM_RBUTTONUP:
if ( MouseUp(pos) ) return FALSE; // (*)
break;
}
return FALSE;
}
// (*) Tous les boutons doivent recevoir l'événement BUTTONUP !
// Indique si la souris est sur ce bouton.
BOOL CButton::MouseOnButton(POINT pos)
{
return Detect(pos);
}
// Retourne le tooltips pour un bouton, en fonction
// de la position de la souris.
int CButton::GetToolTips(POINT pos)
{
int width = m_dim.x;
int rank;
if ( m_bHide || !m_bEnable ) return -1;
if ( m_nbMenu > 1 && m_bMouseDown ) // sous-menu déroulé ?
{
width += 2+(m_dim.x-1)*m_nbMenu;
}
if ( pos.x < m_pos.x ||
pos.x > m_pos.x+width ||
pos.y < m_pos.y ||
pos.y > m_pos.y+m_dim.y ) return -1;
rank = (pos.x-(m_pos.x+2+1))/(m_dim.x-1);
if ( rank < 0 ) rank = 0;
if ( rank > m_nbToolTips ) return -1;
if ( m_nbMenu > 1 )
{
if ( m_bMouseDown && rank > 0 )
{
rank --;
}
else
{
rank = m_selMenu;
}
}
return m_toolTips[rank];
}
// Détecte si la souris est dans le bouton.
BOOL CButton::Detect(POINT pos)
{
int width = m_dim.x;
if ( m_bHide || !m_bEnable ) return FALSE;
if ( m_nbMenu > 1 && m_bMouseDown ) // sous-menu déroulé ?
{
width += 2+(m_dim.x-1)*m_nbMenu;
}
if ( pos.x < m_pos.x ||
pos.x > m_pos.x+width ||
pos.y < m_pos.y ||
pos.y > m_pos.y+m_dim.y ) return FALSE;
return TRUE;
}
// Bouton de la souris pressé.
BOOL CButton::MouseDown(POINT pos)
{
if ( !Detect(pos) ) return FALSE;
m_mouseState = 1;
m_bMouseDown = TRUE;
m_bRedraw = TRUE;
PostMessage(m_hWnd, WM_UPDATE, 0, 0);
m_pSound->PlayImage(SOUND_CLICK, pos);
return TRUE;
}
// Souris déplacés.
BOOL CButton::MouseMove(POINT pos)
{
BOOL bDetect;
int iState, iMenu;
iState = m_mouseState;
iMenu = m_selMenu;
bDetect = Detect(pos);
if ( m_bMouseDown )
{
if ( bDetect ) m_mouseState = 1; // pressé
else m_mouseState = m_state;
}
else
{
if ( bDetect ) m_mouseState = m_state+2; // survollé
else m_mouseState = m_state;
}
if ( m_nbMenu > 1 &&
m_bMouseDown &&
pos.x > m_pos.x+m_dim.x+2 ) // dans sous-menu ?
{
m_selMenu = (pos.x-(m_pos.x+m_dim.x+2))/(m_dim.x-1);
if ( m_selMenu >= m_nbMenu )
{
m_selMenu = m_nbMenu-1;
}
}
if ( iState != m_mouseState ||
iMenu != m_selMenu )
{
m_bRedraw = TRUE;
PostMessage(m_hWnd, WM_UPDATE, 0, 0);
}
return m_bMouseDown;
}
// Bouton de la souris relâché.
BOOL CButton::MouseUp(POINT pos)
{
BOOL bDetect;
bDetect = Detect(pos);
m_mouseState = m_state;
m_bMouseDown = FALSE;
m_bRedraw = TRUE;
if ( !bDetect ) return FALSE;
if ( m_message != -1 )
{
PostMessage(m_hWnd, m_message, 0, 0);
}
return TRUE;
}

67
button.h Normal file
View File

@ -0,0 +1,67 @@
// Button.h
/////////////////////////////////////////////////////////////////////////////
class CButton
{
public:
CButton();
~CButton();
BOOL Create(HWND hWnd, CPixmap *pPixmap, CSound *pSound,
POINT pos, int type, BOOL bMinimizeRedraw,
int *pMenu, int nbMenu,
int *pTooltips, int nbToolTips,
int region, UINT message);
void Draw();
void Redraw();
int GetState();
void SetState(int state);
int GetMenu();
void SetMenu(int menu);
BOOL GetEnable();
void SetEnable(BOOL bEnable);
BOOL GetHide();
void SetHide(BOOL bHide);
BOOL TreatEvent(UINT message, WPARAM wParam, LPARAM lParam);
BOOL MouseOnButton(POINT pos);
int GetToolTips(POINT pos);
protected:
BOOL Detect(POINT pos);
BOOL MouseDown(POINT pos);
BOOL MouseMove(POINT pos);
BOOL MouseUp(POINT pos);
protected:
HWND m_hWnd;
CPixmap* m_pPixmap;
CDecor* m_pDecor;
CSound* m_pSound;
int m_type; // type de bouton
BOOL m_bEnable; // TRUE si bouton actif
BOOL m_bHide; // TRUE si bouton caché
UINT 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_toolTips[20]; // 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é
BOOL m_bMinimizeRedraw;
BOOL m_bRedraw; // TRUE -> doit être redessiné
};
/////////////////////////////////////////////////////////////////////////////

369
chemin.cpp Normal file
View File

@ -0,0 +1,369 @@
// chemin.cpp
// (c) 1997, Denis Dumoulin
#include "DECOR.H"
#include "FIFO.H"
#include "ACTION.H"
// Mémorise toutes les positions des blupi.
void CDecor::CheminMemPos(int exRank)
{
int rank, index;
m_cheminNbPos = 0;
index = 0;
for ( rank=0 ; rank<MAXBLUPI ; rank++ )
{
if ( m_blupi[rank].bExist &&
m_blupi[rank].perso != 6 && // pas le détonnateur de mine
rank != exRank )
{
m_cheminPos[index] = m_blupi[rank].cel;
m_cheminRank[index] = rank;
m_cheminNbPos ++;
index ++;
if ( m_blupi[rank].destCel.x != m_blupi[rank].cel.x ||
m_blupi[rank].destCel.y != m_blupi[rank].cel.y )
{
m_cheminPos[index] = m_blupi[rank].destCel;
m_cheminRank[index] = rank;
m_cheminNbPos ++;
index ++;
}
}
}
}
// Teste si une positiion est occupée par un blupi.
BOOL CDecor::CheminTestPos(POINT pos, int &rank)
{
int i;
for ( i=0 ; i<m_cheminNbPos ; i++ )
{
if ( pos.x == m_cheminPos[i].x &&
pos.y == m_cheminPos[i].y )
{
rank = m_cheminRank[i];
return TRUE;
}
}
return FALSE;
}
// une fois le but trouvé, reprend en arrière
// à la recherche du chemin le plus court
// retourne la direction à prendre
int CDecor::CheminARebours(int rank)
{
int pos, rebours, last, dir, set;
POINT v;
pos = m_blupi[rank].goalCel.y*MAXCELX + m_blupi[rank].goalCel.x;
rebours = m_cheminWork[pos];
if ( rebours == 0 ) return -1;
while ( TRUE )
{
bis:
for ( set=0 ; set<2 ; set++ )
{
for ( dir=set ; dir<8 ; dir+=2 )
{
v = GetVector(dir*16);
last = pos + v.y*MAXCELX+v.x;
if ( m_cheminWork[last] > 0 &&
m_cheminWork[last] < rebours )
{
pos = last;
rebours = m_cheminWork[pos];
if (rebours==1) return (dir>=4) ? dir-4 : dir+4;
goto bis; // interrompt le for...
}
}
}
// ne devrait jamais arriver !
return -1;
}
}
// 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)
{
long pos, last, dest, dist;
int step, dir, cout, action, max, next, ampli;
int dx, dy;
int but = 1000;
if ( m_blupi[rank].cel.x == m_blupi[rank].goalCel.x &&
m_blupi[rank].cel.y == m_blupi[rank].goalCel.y ) return;
pos = m_blupi[rank].cel.y*MAXCELX + m_blupi[rank].cel.x;
dest = m_blupi[rank].goalCel.y*MAXCELX + m_blupi[rank].goalCel.x;
CPileTriee fifo(2*MAXCELX+2*MAXCELY); // les variantes possibles
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
max = 500;
while ( max-- > 0 )
{
// reprend une variante de chemin
pos = fifo.get();
if ( pos < 0 ) break;
step = m_cheminWork[pos];
// on est arrivé au but ?
//? if ( pos == dest ) return;
if ( pos == dest )
{
but = step; // hélas trop lent !
max = 50;
}
// est-ce vraiment trop loin ?
if ( step > 200 ) return;
// marque les cases autour du point
if ( step < but ) for ( dir=0 ; dir<8 ; dir++ )
{
if ( CheminTestDirection(rank, pos, dir, next, ampli, cout, action) )
{
last = pos + ampli*next;
if ( last<0 || last>=MAXCELX*MAXCELY ) continue;
if ( m_cheminWork[last] == 0 ||
m_cheminWork[last] > step+cout )
{
// marque les cases sautées
for (int i=1; i<ampli;i++)
{
m_cheminWork[pos+i*next] = step+cout-ampli+i;
}
m_cheminWork[last] = step+cout;
//? char buffer[50];
//? sprintf(buffer, "word = %d;%d %d\n", last%200, last/200, step+cout);
//? OutputDebug(buffer);
dx = m_blupi[rank].goalCel.x - last%MAXCELX;
dy = m_blupi[rank].goalCel.y - last/MAXCELX;
//? dist = dy*dy + dx*dx;
dist = (long)(dy*dy) + (long)(dx*dx);
fifo.put(last, dist);
}
}
}
}
}
// 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 &ampli,
int &cout, int &action)
{
POINT cel, vector, newCel;
BOOL bFree;
int tryDirect, workBlupi, rankHere;
cel.x = pos%MAXCELX;
cel.y = pos/MAXCELX;
tryDirect = dir*16;
vector = GetVector(tryDirect);
// Peut-on glisser dans cette direction ?
bFree = IsFreeGlisse(cel, tryDirect, rank, action);
cout = 5; // coût élevé
if ( !bFree )
{
// Peut-on marcher normalement ?
bFree = IsFreeDirect(cel, tryDirect, rank);
action = ACTION_MARCHE;
cout = 1; // coût minimal
}
if ( !bFree )
{
// Peut-on sauter ?
bFree = IsFreeJump(cel, tryDirect, rank, action);
cout = 3; // coût élevé
}
ampli = GetAmplitude(action); // a <- amplitude (1..5)
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 )
{
newCel = m_blupi[rank].passCel;
workBlupi = m_decor[newCel.x/2][newCel.y/2].workBlupi;
if ( m_blupi[rank].passCel.x/2 == (cel.x+vector.x*ampli)/2 &&
m_blupi[rank].passCel.y/2 == (cel.y+vector.y*ampli)/2 &&
(workBlupi < 0 || workBlupi == rank) )
{
bFree = TRUE;
cout = 1;
}
}
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
if ( m_blupi[rank].perso == 3 ) // tracks ?
{
// Le tracks peut aller sur les blupi
// pour les écraser !
if ( IsTracksHere(newCel, FALSE) ) // autre perso ici ?
{
return FALSE;
}
}
else
{
//? if ( IsBlupiHere(newCel, FALSE) ) // autre perso ici ?
if ( CheminTestPos(newCel, rankHere) ) // autre perso ici ?
{
// Si blupi immobile, comme si obstacle qq.
//? 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é.
cout = 20;
}
}
next = vector.y*MAXCELX + vector.x;
return TRUE;
}
return FALSE;
}
// 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 ?
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 ?
if ( IsBlupiHereEx(m_blupi[rank].goalCel, rank, FALSE) )
{
return FALSE;
}
memset(m_cheminWork, 0, (BYTE)MAXCELX*(BYTE)MAXCELY);
CheminMemPos(rank);
// fait un remplissage du map de travail
// autour du point de départ
CheminFillTerrain(rank);
// cherche le chemin à partir de la destination
dir = CheminARebours(rank);
if ( dir < 0 ) return FALSE;
pos = m_blupi[rank].cel.y*MAXCELX + m_blupi[rank].cel.x;
if ( CheminTestDirection(rank, pos, dir, next, ampli, cout, action) &&
cout < 20 )
{
m_blupi[rank].sDirect = 16*dir;
return TRUE;
}
// ne devrait jamais arriver !
return FALSE;
}
// Teste s'il est possible de se rendre à un endroit donné.
BOOL CDecor::IsCheminFree(int rank, POINT dest, int button)
{
int action, sDirect;
POINT goalCel, passCel, limit;
BOOL bOK;
if ( button == BUTTON_STOP ) return TRUE;
goalCel = m_blupi[rank].goalCel;
passCel = m_blupi[rank].passCel;
sDirect = m_blupi[rank].sDirect;
if ( IsFreeCelEmbarque(dest, rank, action, limit) )
{
dest = limit;
}
if ( IsFreeCelDebarque(dest, rank, action, limit) )
{
dest = limit;
}
if ( button == BUTTON_GO &&
m_decor[dest.x/2][dest.y/2].objectChannel == CHOBJECT &&
(m_decor[dest.x/2][dest.y/2].objectIcon == 118 || // jeep ?
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
}
if ( button == BUTTON_GO &&
m_decor[dest.x/2][dest.y/2].objectChannel == CHOBJECT &&
m_decor[dest.x/2][dest.y/2].objectIcon == 113 ) // maison ?
{
dest.x = (dest.x/2)*2+1;
dest.y = (dest.y/2)*2+1; // sous la porte
}
if ( m_blupi[rank].cel.x == dest.x &&
m_blupi[rank].cel.y == dest.y ) return TRUE;
m_blupi[rank].goalCel = dest;
if ( m_decor[dest.x/2][dest.y/2].objectChannel == CHOBJECT &&
button != BUTTON_GO )
{
m_blupi[rank].passCel = dest; // si arbres/fleurs/bateau/etc.
}
bOK = CheminCherche(rank, action);
m_blupi[rank].goalCel = goalCel;
m_blupi[rank].passCel = passCel;
m_blupi[rank].sDirect = sDirect;
return bOK;
}

BIN
cursor1.cur Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

6
data/config.def Normal file
View File

@ -0,0 +1,6 @@
CD-Rom=i:\daniel\blupi
FullScreen=0
MouseType=1
SpeedRate=1
Timer=50ms
Language=F

BIN
data/demo000.blp Normal file

Binary file not shown.

BIN
data/demo001.blp Normal file

Binary file not shown.

BIN
data/demo002.blp Normal file

Binary file not shown.

BIN
data/demo003.blp Normal file

Binary file not shown.

1261
data/enigmes.blp Normal file

File diff suppressed because it is too large Load Diff

BIN
data/info.blp Normal file

Binary file not shown.

BIN
data/user000.blp Normal file

Binary file not shown.

BIN
data/user001.blp Normal file

Binary file not shown.

BIN
data/user002.blp Normal file

Binary file not shown.

BIN
data/user003.blp Normal file

Binary file not shown.

BIN
data/user004.blp Normal file

Binary file not shown.

BIN
data/user005.blp Normal file

Binary file not shown.

BIN
data/user006.blp Normal file

Binary file not shown.

BIN
data/user007.blp Normal file

Binary file not shown.

BIN
data/user008.blp Normal file

Binary file not shown.

BIN
data/user009.blp Normal file

Binary file not shown.

BIN
data/world000.blp Normal file

Binary file not shown.

BIN
data/world001.blp Normal file

Binary file not shown.

BIN
data/world002.blp Normal file

Binary file not shown.

BIN
data/world003.blp Normal file

Binary file not shown.

BIN
data/world004.blp Normal file

Binary file not shown.

BIN
data/world005.blp Normal file

Binary file not shown.

BIN
data/world100.blp Normal file

Binary file not shown.

BIN
data/world101.blp Normal file

Binary file not shown.

BIN
data/world102.blp Normal file

Binary file not shown.

BIN
data/world103.blp Normal file

Binary file not shown.

BIN
data/world104.blp Normal file

Binary file not shown.

BIN
data/world105.blp Normal file

Binary file not shown.

BIN
data/world106.blp Normal file

Binary file not shown.

BIN
data/world107.blp Normal file

Binary file not shown.

BIN
data/world108.blp Normal file

Binary file not shown.

BIN
data/world109.blp Normal file

Binary file not shown.

BIN
data/world110.blp Normal file

Binary file not shown.

BIN
data/world111.blp Normal file

Binary file not shown.

BIN
data/world112.blp Normal file

Binary file not shown.

BIN
data/world113.blp Normal file

Binary file not shown.

BIN
data/world114.blp Normal file

Binary file not shown.

BIN
data/world115.blp Normal file

Binary file not shown.

BIN
data/world116.blp Normal file

Binary file not shown.

BIN
data/world117.blp Normal file

Binary file not shown.

BIN
data/world118.blp Normal file

Binary file not shown.

BIN
data/world119.blp Normal file

Binary file not shown.

BIN
data/world120.blp Normal file

Binary file not shown.

BIN
data/world121.blp Normal file

Binary file not shown.

BIN
data/world122.blp Normal file

Binary file not shown.

BIN
data/world123.blp Normal file

Binary file not shown.

BIN
data/world124.blp Normal file

Binary file not shown.

BIN
data/world125.blp Normal file

Binary file not shown.

BIN
data/world126.blp Normal file

Binary file not shown.

BIN
data/world127.blp Normal file

Binary file not shown.

BIN
data/world128.blp Normal file

Binary file not shown.

BIN
data/world129.blp Normal file

Binary file not shown.

BIN
data/world130.blp Normal file

Binary file not shown.

BIN
data/world131.blp Normal file

Binary file not shown.

BIN
data/world132.blp Normal file

Binary file not shown.

BIN
data/world133.blp Normal file

Binary file not shown.

BIN
data/world134.blp Normal file

Binary file not shown.

BIN
data/world135.blp Normal file

Binary file not shown.

BIN
data/world136.blp Normal file

Binary file not shown.

BIN
data/world137.blp Normal file

Binary file not shown.

BIN
data/world139.blp Normal file

Binary file not shown.

BIN
data/world140.blp Normal file

Binary file not shown.

BIN
data/world141.blp Normal file

Binary file not shown.

BIN
data/world142.blp Normal file

Binary file not shown.

BIN
data/world148.blp Normal file

Binary file not shown.

BIN
data/world150.blp Normal file

Binary file not shown.

BIN
data/world151.blp Normal file

Binary file not shown.

BIN
data/world152.blp Normal file

Binary file not shown.

BIN
data/world153.blp Normal file

Binary file not shown.

BIN
data/world200.blp Normal file

Binary file not shown.

BIN
data/world201.blp Normal file

Binary file not shown.

BIN
data/world202.blp Normal file

Binary file not shown.

BIN
data/world203.blp Normal file

Binary file not shown.

BIN
data/world204.blp Normal file

Binary file not shown.

BIN
data/world205.blp Normal file

Binary file not shown.

BIN
data/world206.blp Normal file

Binary file not shown.

BIN
data/world207.blp Normal file

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More