diff --git a/Speedy Eggbert 2 Source.vcxproj b/Speedy Eggbert 2 Source.vcxproj
index dbe9885..d1bc820 100644
--- a/Speedy Eggbert 2 Source.vcxproj
+++ b/Speedy Eggbert 2 Source.vcxproj
@@ -80,10 +80,10 @@
dxsdk3\sdk\inc;bass\inc
UNICODE;_UNICODE
- MaxSpeed
- true
- Speed
- Default
+ Disabled
+ Neither
+ EnableFastChecks
+ false
Windows
diff --git a/src/decblock.cpp b/src/decblock.cpp
index 71d21b1..b4600e8 100644
--- a/src/decblock.cpp
+++ b/src/decblock.cpp
@@ -218,20 +218,20 @@ int CDecor::GetTypeBarre(POINT pos)
BOOL CDecor::IsLave(POINT pos)
{
- pos.x += 30;
+ pos.x += DIMBLUPIX / 2;
return pos.x >= 0 && pos.x < 6400 && pos.y >= 0 && pos.y < 6400 && m_decor[pos.x / DIMOBJX][pos.y / DIMOBJY].icon == 68;
}
BOOL CDecor::IsPiege(POINT pos)
{
- pos.x += 30;
- pos.y += 60;
+ pos.x += DIMBLUPIX / 2;
+ pos.y += DIMBLUPIY;
return pos.x % 64 >= 15 && pos.x % 64 <= 49 && pos.x >= 0 && pos.x < 6400 && pos.y >= 0 && pos.y < 6400 && m_decor[pos.x / DIMOBJX][pos.y / DIMOBJY].icon == 373;
}
BOOL CDecor::IsGoutte(POINT pos, BOOL bAlways)
{
- pos.x += 30;
+ pos.x += DIMBLUPIX / 2;
if (pos.x % 64 < 15 || pos.x % 64 > 49)
{
return FALSE;
@@ -250,23 +250,23 @@ BOOL CDecor::IsGoutte(POINT pos, BOOL bAlways)
BOOL CDecor::IsScie(POINT pos)
{
- pos.x += 30;
+ pos.x += DIMBLUPIX / 2;
return pos.x % 64 >= 4 && pos.x % 64 <= 60 && pos.x >= 0 && pos.x < 6400 && pos.y >= 0 && pos.y < 6400 && m_decor[pos.x / DIMOBJX][pos.y / DIMOBJY].icon == 378;
}
-BOOL CDecor::IsSwitch(POINT pos, POINT celSwitch)
+BOOL CDecor::IsSwitch(POINT pos, POINT *outCelSwitch)
{
- pos.x += 30;
- if (pos.x % 64 < 4 || pos.x % 64 > 60)
+ pos.x += DIMBLUPIX / 2;
+ if (pos.x % DIMOBJX < 4 || pos.x % DIMOBJX > DIMOBJX - 4)
{
return FALSE;
}
- if (pos.x < 0 || pos.x >= 6400 || pos.y < 0 || pos.y >= 6400)
+ if (pos.x < 0 || pos.x >= DIMOBJX * MAXCELX || pos.y < 0 || pos.y >= DIMOBJY * MAXCELY)
{
return FALSE;
}
- celSwitch.x = pos.x / DIMOBJX;
- celSwitch.y = pos.y / DIMOBJY;
+ outCelSwitch->x = pos.x / DIMOBJX;
+ outCelSwitch->y = pos.y / DIMOBJY;
return m_decor[pos.x / DIMOBJX][pos.y / DIMOBJY].icon == 384 || m_decor[pos.x / DIMOBJX][pos.y / DIMOBJY].icon == 385;
}
@@ -372,7 +372,7 @@ int CDecor::IsTeleporte(POINT pos)
return -1;
}
-BOOL CDecor::SearchTeleporte(POINT pos, POINT newpos)
+BOOL CDecor::SearchTeleporte(POINT pos, POINT *newpos)
{
int num = IsTeleporte(pos);
if (num == -1)
@@ -385,9 +385,9 @@ BOOL CDecor::SearchTeleporte(POINT pos, POINT newpos)
{
if (num == m_decor[i][j].icon)
{
- newpos.x = i * 64;
- newpos.y = j * 64 + 60;
- if (newpos.x < pos.x - 40 || newpos.x > pos.x + 40 || newpos.y < pos.y - 40 || newpos.y > pos.y + 40)
+ newpos->x = i * 64;
+ newpos->y = j * 64 + 60;
+ if (newpos->x < pos.x - 40 || newpos->x > pos.x + 40 || newpos->y < pos.y - 40 || newpos->y > pos.y + 40)
{
return TRUE;
}
@@ -462,7 +462,7 @@ BOOL CDecor::IsBlocIcon(int icon)
return FALSE;
}
}
- return FALSE;
+ return TRUE;
}
BOOL CDecor::IsVentillo(POINT pos)
diff --git a/src/decblupi.cpp b/src/decblupi.cpp
index 000a2f5..6367b4b 100644
--- a/src/decblupi.cpp
+++ b/src/decblupi.cpp
@@ -155,11 +155,11 @@ void CDecor::BlupiSearchIcon()
PlaySound(SOUND_PATIENT, m_blupiPos, FALSE);
}
}
- if ((action == 0x1f) && (((phase = m_blupiPhase % 328, phase == 0x76 || (phase == 0xe6)) || (phase == 0x116))))
+ if (action == ACTION_STOPSUSPEND && (((phase = m_blupiPhase % 328, phase == 0x76 || (phase == 0xe6)) || (phase == 0x116))))
{
PlaySound(SOUND_SINGE, m_blupiPos, FALSE);
}
- if ((((action == 0x15) || (action == 0x16)) && (m_blupiPhase % 0xc == 0)) && (m_blupiSurf))
+ if ((action == ACTION_STOPSURF || action == ACTION_MARCHSURF) && m_blupiPhase % 12 == 0 && m_blupiSurf)
{
MoveObjectTiplouf(m_blupiPos);
}
@@ -176,45 +176,40 @@ void CDecor::BlupiSearchIcon()
break;
}
}
- if ((action == 0xb || action == 0x4b || action == 0x4c || action == 0x36 || action == 0x39) && icon < 0x10a)
+ if ((action == ACTION_CLEAR1 ||
+ action == ACTION_CLEAR2 ||
+ action == ACTION_CLEAR3 ||
+ action == ACTION_GLU ||
+ action == ACTION_ELECTRO) && icon < 0x10a)
{
- m_blupiChannel = 10;
+ m_blupiChannel = CHELEMENT;
}
else
{
- m_blupiChannel = 2;
+ m_blupiChannel = CHBLUPI;
}
if (m_blupiDir == DIR_LEFT || (m_blupiDir == DIR_RIGHT && m_blupiInvert))
{
- if (m_blupiChannel == 2)
+ if (m_blupiChannel == CHBLUPI)
{
- if (action == 0x1f)
+ if (action == ACTION_STOPSUSPEND)
{
- if (icon == 0x90)
- {
- icon = 0x9e;
- }
- if (icon == 0x8f)
- {
- icon = 0x91;
- }
- if (icon == 0x97)
- {
- icon = 0x92;
- }
+ if (icon == 0x90) icon = 0x9e;
+ if (icon == 0x8f) icon = 0x91;
+ if (icon == 0x97) icon = 0x92;
}
- if ((-1 < icon) && (icon < 0x14f))
+ if (icon > -1 && icon < 0x14f)
{
icon = table_mirror[icon];
}
}
- if (true && m_blupiChannel == 10 && 0xa7 < icon && icon < 0xac)
+ if (true && m_blupiChannel == CHELEMENT && icon > 0xa7 && icon < 0xac)
{
icon = (icon + 4);
}
}
m_blupiIcon = icon;
- m_blupiPhase = m_blupiPhase + 1;
+ m_blupiPhase++;
}
BOOL CDecor::BlupiIsGround()
@@ -510,9 +505,20 @@ void CDecor::BlupiStep()
m_blupiAction = ACTION_AIR;
m_blupiPhase = 0;
}
- if (m_keyPress & KEY_LEFT && m_blupiFocus) // this is wrong
+ if (m_keyPress & KEY_JUMP && m_blupiFocus)
{
- m_blupiVitesse.y = (m_blupiPower ? -25 : -19);
+ if (m_keyPress & KEY_UP)
+ {
+ m_blupiVitesse.y = (m_blupiPower ? -29 : -25);
+ }
+ else if (m_keyPress & KEY_DOWN)
+ {
+ m_blupiVitesse.y = (m_blupiPower ? -19 : -16);
+ }
+ else
+ {
+ m_blupiVitesse.y = (m_blupiPower ? -25 : -19);
+ }
}
else
{
@@ -677,9 +683,9 @@ void CDecor::BlupiStep()
tinyPoint.y += m_blupiVitesse.y * 4;
}
m_blupiVitesse.y -= 10;
- if (ObjectStart(tinyPoint, 23, 55) != -1)
+ if (ObjectStart(tinyPoint, TYPE_BALLE, 55) != -1)
{
- PlaySound(52, m_blupiPos);
+ PlaySound(SOUND_FIREOK, m_blupiPos);
m_blupiTimeFire = 10;
m_blupiBullet--;
}
@@ -1360,17 +1366,17 @@ void CDecor::BlupiStep()
{
tinyPoint.x = m_blupiPos.x;
tinyPoint.y = m_blupiPos.y - BLUPIFLOOR;
- ObjectStart(tinyPoint, 13, 0);
+ ObjectStart(tinyPoint, TYPE_HELICO, 0);
m_blupiHelico = FALSE;
StopBlupi(TRUE);
m_blupiPosHelico = m_blupiPos;
- StopSound(16);
- StopSound(18);
- PlaySound(17, m_blupiPos);
+ StopSound(SOUND_HELICOHIGH);
+ StopSound(SOUND_HELICOLOW);
+ PlaySound(SOUND_HELICOSTOP, m_blupiPos);
}
}
}
- if (m_blupiOver && (m_blupiFocus || m_blupiAction == 58))
+ if (m_blupiOver && (m_blupiFocus || m_blupiAction == ACTION_HELICOGLU))
{
////m_blupiMotorHigh = bCanUseLift;
if (m_blupiAction != ACTION_TURN)
@@ -1478,13 +1484,13 @@ void CDecor::BlupiStep()
{
tinyPoint.x = m_blupiPos.x;
tinyPoint.y = m_blupiPos.y - BLUPIFLOOR;
- ObjectStart(tinyPoint, 46, 0);
+ ObjectStart(tinyPoint, TYPE_OVER, 0);
m_blupiOver = FALSE;
StopBlupi(TRUE);
m_blupiPosHelico = m_blupiPos;
- StopSound(16);
- StopSound(18);
- PlaySound(17, m_blupiPos);
+ StopSound(SOUND_HELICOHIGH);
+ StopSound(SOUND_HELICOLOW);
+ PlaySound(SOUND_HELICOSTOP, m_blupiPos);
}
}
}
@@ -1656,7 +1662,7 @@ void CDecor::BlupiStep()
{
if (m_blupiVitesse.y != 0)
{
- PlaySound(3, m_blupiPos);
+ PlaySound(SOUND_JUMPEND, m_blupiPos);
}
m_blupiVitesse.y = 0;
}
@@ -1672,7 +1678,7 @@ void CDecor::BlupiStep()
{
m_blupiTransport = num;
bAirStart = FALSE;
- PlaySound(3, end);
+ PlaySound(SOUND_JUMPEND, end);
end.y = m_moveObject[num].posCurrent.y - 64 + BLUPIOFFY;
}
}
@@ -1735,13 +1741,13 @@ void CDecor::BlupiStep()
{
tinyPoint.x = m_blupiPos.x;
tinyPoint.y = m_blupiPos.y - BLUPIFLOOR;
- ObjectStart(tinyPoint, 19, 0);
+ ObjectStart(tinyPoint, TYPE_JEEP, 0);
m_blupiJeep = FALSE;
StopBlupi();
m_blupiPosHelico = m_blupiPos;
- StopSound(29);
- StopSound(31);
- PlaySound(30, m_blupiPos);
+ StopSound(SOUND_JEEPHIGH);
+ StopSound(SOUND_JEEPLOW);
+ PlaySound(SOUND_JEEPSTOP, m_blupiPos);
}
}
if (m_blupiTank && m_blupiFocus)
@@ -1754,7 +1760,7 @@ void CDecor::BlupiStep()
{
if (m_blupiBullet == 0)
{
- PlaySound(53, m_blupiPos);
+ PlaySound(SOUND_FIREKO, m_blupiPos);
}
else
{
@@ -1772,11 +1778,11 @@ void CDecor::BlupiStep()
num4 = 5;
m_blupiVitesse.x -= 12;
}
- if (ObjectStart(tinyPoint, 23, num4) != -1)
+ if (ObjectStart(tinyPoint, TYPE_BALLE, num4) != -1)
{
m_blupiAction = 53;
m_blupiPhase = 0;
- PlaySound(52, m_blupiPos);
+ PlaySound(SOUND_FIREOK, m_blupiPos);
m_blupiTimeFire = 10;
m_blupiBullet--;
}
@@ -1798,7 +1804,7 @@ void CDecor::BlupiStep()
{
if (m_blupiVitesse.y != 0)
{
- PlaySound(3, m_blupiPos);
+ PlaySound(SOUND_JUMPEND, m_blupiPos);
}
m_blupiVitesse.y = 0;
}
@@ -1814,7 +1820,7 @@ void CDecor::BlupiStep()
{
m_blupiTransport = num;
bAirStart = FALSE;
- PlaySound(3, end);
+ PlaySound(SOUND_JUMPEND, end);
end.y = m_moveObject[num].posCurrent.y - 64 + BLUPIOFFY;
}
}
@@ -1862,13 +1868,13 @@ void CDecor::BlupiStep()
tinyPoint.x = m_blupiPos.x;
tinyPoint.y = m_blupiPos.y;
- ObjectStart(tinyPoint, 28, 0);
+ ObjectStart(tinyPoint, TYPE_TANK, 0);
m_blupiTank = FALSE;
StopBlupi();
m_blupiPosHelico = m_blupiPos;
- StopSound(29);
- StopSound(31);
- PlaySound(30, m_blupiPos);
+ StopSound(SOUND_JEEPHIGH);
+ StopSound(SOUND_JEEPLOW);
+ PlaySound(SOUND_JEEPSTOP, m_blupiPos);
}
}
if (m_blupiSkate && m_blupiFocus)
@@ -1946,7 +1952,7 @@ void CDecor::BlupiStep()
{
tinyPoint.x = m_blupiPos.x;
tinyPoint.y = m_blupiPos.y - BLUPIFLOOR + 1;
- ObjectStart(tinyPoint, 24, 0);
+ ObjectStart(tinyPoint, TYPE_SKATE, 0);
}
if (m_blupiPhase == 20)
{
@@ -2039,12 +2045,12 @@ void CDecor::BlupiStep()
}
if (m_blupiLevel == 25)
{
- //m_jauges[JAUGE_AIR].SetMode(1);
+ m_jauges[JAUGE_AIR].SetType(1);
}
m_jauges[JAUGE_AIR].SetLevel(m_blupiLevel);
if (m_blupiLevel == 0)
{
- m_blupiAction = 24;
+ m_blupiAction = ACTION_DROWN;
m_blupiPhase = 0;
m_blupiFocus = FALSE;
m_blupiHelico = FALSE;
@@ -2068,7 +2074,7 @@ void CDecor::BlupiStep()
m_blupiActionOuf = 0;
m_jauges[JAUGE_AIR].SetHide(TRUE);
m_jauges[JAUGE_POWER].SetHide(TRUE);
- PlaySound(26, end);
+ PlaySound(SOUND_DROWN, end);
}
}
}
@@ -2227,7 +2233,7 @@ void CDecor::BlupiStep()
rect.top = end.y + 60 - 2;
rect.bottom = end.y + 60;
bIsOpen2 = !DecorDetect(rect);
- if (!bIsOpen && !bIsOpen2 && ObjectStart(end, 56, 0) != -1)
+ if (!bIsOpen && !bIsOpen2 && ObjectStart(end, TYPE_DYNAMITEf, 0) != -1)
{
m_blupiAction = ACTION_PUTDYNAMITE;
m_blupiPhase = 0;
@@ -2768,7 +2774,7 @@ void CDecor::BlupiStep()
m_blupiNage = TRUE;
m_blupiLevel = 100;
m_jauges[JAUGE_AIR].SetLevel(m_blupiLevel);
- //m_jauges[JAUGE_AIR].SetMode(2);
+ m_jauges[JAUGE_AIR].SetType(2);
m_jauges[JAUGE_AIR].SetHide(FALSE);
}
if (m_blupiNage && IsSurfWater(m_blupiPos))
@@ -2904,7 +2910,7 @@ void CDecor::BlupiStep()
m_decorAction = 2;
m_decorPhase = 0;
StopVehicleSound();
- PlaySound(10, m_blupiPos);
+ PlaySound(SOUND_BOUM, m_blupiPos);
}
if (m_blupiAction != ACTION_STOPTANK && m_blupiFocus)
{
@@ -2942,7 +2948,7 @@ void CDecor::BlupiStep()
BlupiDead(ACTION_GLU, -1);
m_blupiRestart = TRUE;
m_blupiAir = TRUE;
- ObjectStart(m_blupiPos, 53, 0);
+ ObjectStart(m_blupiPos, TYPE_TENTACULE, 0);
PlaySound(SOUND_GLU, m_blupiPos);
}
if (IsGoutte(m_blupiPos, FALSE) && !m_blupiOver && !m_blupiJeep && !m_blupiTank && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi && m_blupiFocus)
@@ -2959,7 +2965,7 @@ void CDecor::BlupiStep()
m_blupiRestart = TRUE;
m_blupiAir = TRUE;
}
- if ( (num27 == -1 || !bNear) && IsSwitch(m_blupiPos, tinyPoint) && !m_blupiOver && !m_blupiBalloon && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi && m_blupiFocus)
+ if ( (num27 == -1 || !bNear) && IsSwitch(m_blupiPos, &tinyPoint) && !m_blupiOver && !m_blupiBalloon && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi && m_blupiFocus)
{
ActiveSwitch(m_decor[tinyPoint.x][tinyPoint.y].icon == 385, tinyPoint);
@@ -3027,7 +3033,7 @@ void CDecor::BlupiStep()
PlaySound(SOUND_TELEPORTE, m_blupiPos);
tinyPoint.x = m_blupiPos.x;
tinyPoint.y = m_blupiPos.y - 5;
- ObjectStart(tinyPoint, 92, 0);
+ ObjectStart(tinyPoint, TYPE_EXPLO7, 0);
}
if (IsBridge(m_blupiPos, &tinyPoint2) && m_blupiFocus)
{
@@ -3036,10 +3042,10 @@ void CDecor::BlupiStep()
ObjectStart(tinyPoint2, TYPE_BRIDGE, 0);
}
int num2 = IsDoor(m_blupiPos, &tinyPoint2);
- if (num2 != -1 && (m_blupiCle & 1 << num2 - 334) != 0)
+ if (num2 != -1 && (m_blupiCle & (1 << num2) - 334) != 0)
{
OpenDoor(tinyPoint2);
- m_blupiCle &= ~(1 << num2 - 334);
+ m_blupiCle &= ~((1 << num2) - 334);
tinyPoint.x = 520;
tinyPoint.y = 418;
tinyPoint5.x = tinyPoint2.x * 64 - m_posDecor.x;
@@ -3058,14 +3064,21 @@ void CDecor::BlupiStep()
}
MoveObjectFollow(m_blupiPos);
num = num27;
- if (num != -1 && !bNear && m_moveObject[num].type == 2 && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && !m_blupiShield && !m_bSuperBlupi && m_blupiFocus)
+ if (num != -1 && !bNear && m_moveObject[num].type == TYPE_BOMBEDOWN && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && !m_blupiShield && !m_bSuperBlupi && m_blupiFocus)
{
m_blupiActionOuf = 48;
m_blupiTimeOuf = 0;
}
if (num != -1 && bNear)
{
- if (m_moveObject[num].type == 13 && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus)
+ if (m_moveObject[num].type == TYPE_HELICO &&
+ !IsBlupiVehicle() &&
+ !m_blupiBalloon &&
+ !m_blupiEcrase &&
+ !m_blupiNage &&
+ !m_blupiSurf &&
+ !m_blupiSuspend &&
+ m_blupiFocus)
{
ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type);
m_scrollAdd.x = 0;
@@ -3080,7 +3093,14 @@ void CDecor::BlupiStep()
m_jauges[JAUGE_POWER].SetHide(TRUE);
}
}
- if (m_moveObject[num].type == 46 && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus)
+ if (m_moveObject[num].type == TYPE_OVER &&
+ !IsBlupiVehicle() &&
+ !m_blupiBalloon &&
+ !m_blupiEcrase &&
+ !m_blupiNage &&
+ !m_blupiSurf &&
+ !m_blupiSuspend &&
+ m_blupiFocus)
{
ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type);
m_scrollAdd.x = 0;
@@ -3095,7 +3115,14 @@ void CDecor::BlupiStep()
m_jauges[JAUGE_POWER].SetHide(TRUE);
}
}
- if (m_moveObject[num].type == 19 && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus)
+ if (m_moveObject[num].type == TYPE_JEEP &&
+ !IsBlupiVehicle() &&
+ !m_blupiBalloon &&
+ !m_blupiEcrase &&
+ !m_blupiNage &&
+ !m_blupiSurf &&
+ !m_blupiSuspend &&
+ m_blupiFocus)
{
ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type);
m_scrollAdd.x = 0;
@@ -3111,7 +3138,14 @@ void CDecor::BlupiStep()
m_jauges[JAUGE_POWER].SetHide(TRUE);
}
}
- if ( m_moveObject[num].type == 28 && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus)
+ if ( m_moveObject[num].type == TYPE_TANK &&
+ !IsBlupiVehicle() &&
+ !m_blupiBalloon &&
+ !m_blupiEcrase &&
+ !m_blupiNage &&
+ !m_blupiSurf &&
+ !m_blupiSuspend &&
+ m_blupiFocus)
{
ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type);
@@ -3128,7 +3162,7 @@ void CDecor::BlupiStep()
m_jauges[JAUGE_POWER].SetHide(TRUE);
}
}
- if (m_moveObject[num].type == 29 && m_blupiFocus && m_blupiBullet < 10)
+ if (m_moveObject[num].type == TYPE_BULLET && m_blupiFocus && m_blupiBullet < 10)
{
ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type);
tinyPoint.x = m_moveObject[num].posCurrent.x - m_posDecor.x;
@@ -3142,12 +3176,18 @@ void CDecor::BlupiStep()
m_blupiBullet = 10;
}
}
- if ( m_moveObject[num].type == 24 && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus)
+ if ( m_moveObject[num].type == TYPE_SKATE &&
+ !IsBlupiVehicle() &&
+ !m_blupiBalloon &&
+ !m_blupiEcrase &&
+ !m_blupiNage &&
+ !m_blupiSurf &&
+ !m_blupiSuspend &&
+ m_blupiFocus)
{
-
m_scrollAdd.x = 0;
m_scrollAdd.y = 0;
- m_blupiAction = 42;
+ m_blupiAction = ACTION_TAKESKATE;
m_blupiPhase = 0;
m_blupiPos.y = m_moveObject[num].posCurrent.y / DIMOBJY * DIMOBJY + BLUPIOFFY;
m_blupiFocus = FALSE;
@@ -3161,7 +3201,12 @@ void CDecor::BlupiStep()
m_jauges[JAUGE_POWER].SetHide(TRUE);
}
}
- if ((m_moveObject[num].type == 3 || m_moveObject[num].type == 16 || m_moveObject[num].type == 96 || m_moveObject[num].type == 97) && m_blupiBalloon && m_blupiPosHelico.x == -1)
+ if ((m_moveObject[num].type == TYPE_BOMBEUP ||
+ m_moveObject[num].type == TYPE_BOMBEMOVE ||
+ m_moveObject[num].type == TYPE_BOMBEFOLLOW1 ||
+ m_moveObject[num].type == TYPE_BOMBEFOLLOW2) &&
+ m_blupiBalloon &&
+ m_blupiPosHelico.x == -1)
{
m_blupiBalloon = FALSE;
m_blupiAir = TRUE;
@@ -3170,29 +3215,42 @@ void CDecor::BlupiStep()
m_decorAction = 0;
tinyPoint.x = m_blupiPos.x - 34;
tinyPoint.y = m_blupiPos.y - 34;
- ObjectStart(tinyPoint, 91, 0);
- PlaySound(41, m_blupiPos);
+ ObjectStart(tinyPoint, TYPE_EXPLO6, 0);
+ PlaySound(SOUND_RESSORT, m_blupiPos);
m_blupiPos.y = m_blupiPos.y + 4;
m_blupiVitesse.y = 0;
m_blupiPosHelico = m_blupiPos;
}
- else if ((m_moveObject[num].type == 2 || m_moveObject[num].type == 3 || m_moveObject[num].type == 96 || m_moveObject[num].type == 97 || m_moveObject[num].type == 16 || m_moveObject[num].type == 4 || m_moveObject[num].type == 17 || m_moveObject[num].type == 20) && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi && m_blupiPosHelico.x == -1)
+ else if ((m_moveObject[num].type == TYPE_BOMBEDOWN ||
+ m_moveObject[num].type == TYPE_BOMBEUP ||
+ m_moveObject[num].type == TYPE_BOMBEFOLLOW1 ||
+ m_moveObject[num].type == TYPE_BOMBEFOLLOW2 ||
+ m_moveObject[num].type == TYPE_BOMBEMOVE ||
+ m_moveObject[num].type == TYPE_BULLDOZER ||
+ m_moveObject[num].type == TYPE_POISSON ||
+ m_moveObject[num].type == TYPE_OISEAU) &&
+ !m_blupiShield &&
+ !m_bSuperBlupi &&
+ m_blupiPosHelico.x == -1)
{
- if (!m_blupiJeep && !m_blupiTank && !m_blupiSkate && (m_blupiFocus || m_blupiAction == 5 || m_blupiAction == 36))
+ if (!m_blupiJeep &&
+ !m_blupiTank &&
+ !m_blupiSkate &&
+ (m_blupiFocus || m_blupiAction == ACTION_AIR || m_blupiAction == ACTION_JUMPAIE))
{
if (m_blupiHelico || m_blupiOver || m_blupiBalloon || m_blupiEcrase)
{
m_blupiAir = TRUE;
}
- BlupiDead(11, 75);
+ BlupiDead(ACTION_CLEAR1, ACTION_CLEAR2);
}
- if (m_moveObject[num].type == 17 || m_moveObject[num].type == 20)
+ if (m_moveObject[num].type == TYPE_POISSON || m_moveObject[num].type == TYPE_OISEAU)
{
tinyPoint = m_moveObject[num].posCurrent;
ObjectDelete(tinyPoint, m_moveObject[num].type);
tinyPoint.x -= 34;
tinyPoint.y -= 34;
- ObjectStart(tinyPoint, 10, 0);
+ ObjectStart(tinyPoint, TYPE_EXPLO3, 0);
m_decorAction = 2;
m_decorPhase = 0;
}
@@ -3202,7 +3260,7 @@ void CDecor::BlupiStep()
ObjectDelete(tinyPoint, m_moveObject[num].type);
tinyPoint.x -= 34;
tinyPoint.y -= 34;
- ObjectStart(tinyPoint, 8, 0);
+ ObjectStart(tinyPoint, TYPE_EXPLO1, 0);
m_decorAction = 1;
m_decorPhase = 0;
}
@@ -3210,11 +3268,14 @@ void CDecor::BlupiStep()
{
StopVehicleSound();
}
- PlaySound(10, m_moveObject[num].posCurrent);
+ PlaySound(SOUND_BOUM, m_moveObject[num].posCurrent);
}
- if (m_moveObject[num].type == 44 && m_blupiFocus && !m_blupiBalloon && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi)
+ if (m_moveObject[num].type == TYPE_GUEPE &&
+ m_blupiFocus &&
+ !m_blupiBalloon &&
+ !m_blupiShield &&
+ !m_bSuperBlupi)
{
-
StopBlupi();
m_blupiVitesse.x = 0;
m_blupiVitesse.y = 0;
@@ -3241,20 +3302,26 @@ void CDecor::BlupiStep()
{
StopVehicleSound();
}
- PlaySound(40, m_moveObject[num].posCurrent);
+ PlaySound(SOUND_JUMPAIE, m_moveObject[num].posCurrent);
tinyPoint.x = m_blupiPos.x - 34;
tinyPoint.y = m_blupiPos.y - 34;
- ObjectStart(tinyPoint, 90, 0);
+ ObjectStart(tinyPoint, TYPE_EXPLO5, 0);
m_decorAction = 5;
m_decorPhase = 0;
}
- if (m_moveObject[num].type == 54 && m_moveObject[num].step != 2 && m_moveObject[num].step != 4 && m_blupiFocus && !m_blupiBalloon && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi)
+ if (m_moveObject[num].type == TYPE_CREATURE &&
+ m_moveObject[num].step != STEP_ADVANCE &&
+ m_moveObject[num].step != STEP_RECEDE &&
+ m_blupiFocus &&
+ !m_blupiBalloon &&
+ !m_blupiShield &&
+ !m_bSuperBlupi)
{
tinyPoint.x = m_blupiPos.x;
- tinyPoint.y = (m_blupiPos.y + 64 - 10) / 64 * 64 + 4;
- ObjectStart(tinyPoint, 53, 0);
- m_blupiAction = 54;
+ tinyPoint.y = (m_blupiPos.y + DIMOBJY - 10) / DIMOBJY * DIMOBJY + 4;
+ ObjectStart(tinyPoint, TYPE_TENTACULE, 0);
+ m_blupiAction = ACTION_GLU;
m_blupiPhase = 0;
m_blupiSuspend = FALSE;
m_blupiJumpAie = FALSE;
@@ -3264,7 +3331,9 @@ void CDecor::BlupiStep()
{
m_blupiAir = TRUE;
}
- if (m_blupiHelico || m_blupiOver || m_blupiBalloon || m_blupiEcrase || m_blupiJeep || m_blupiTank || m_blupiSkate)
+ if (IsBlupiVehicle() ||
+ m_blupiBalloon ||
+ m_blupiEcrase)
{
m_blupiHelico = FALSE;
m_blupiOver = FALSE;
@@ -3276,26 +3345,34 @@ void CDecor::BlupiStep()
tinyPoint = m_moveObject[num].posCurrent;
tinyPoint.x -= 34;
tinyPoint.y -= 34;
- ObjectStart(tinyPoint, 10, 0);
+ ObjectStart(tinyPoint, TYPE_EXPLO3, 0);
StopVehicleSound();
- PlaySound(10, m_moveObject[num].posCurrent);
+ PlaySound(SOUND_BOUM, m_moveObject[num].posCurrent);
m_decorAction = 1;
m_decorPhase = 0;
}
else
{
- PlaySound(51, m_moveObject[num].posCurrent);
+ PlaySound(SOUND_GLU, m_moveObject[num].posCurrent);
}
m_blupiCloud = FALSE;
m_blupiHide = FALSE;
m_jauges[JAUGE_POWER].SetHide(TRUE);
}
- if (m_moveObject[num].type == 23 && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi && m_blupiAction != 13 && m_blupiAction != ACTION_BYE && m_blupiAction != 11 && m_blupiAction != 75 && m_blupiAction != 76 && m_blupiAction != 77 && m_blupiAction != 78 && m_blupiAction != 79 && m_blupiAction != ACTION_CLEAR7 && m_blupiAction != ACTION_CLEAR8 && m_blupiAction != ACTION_GLU && m_blupiAction != ACTION_ELECTRO && m_blupiAction != ACTION_HIDE)
+ if (m_moveObject[num].type == TYPE_BALLE &&
+ !m_blupiShield &&
+ !m_bSuperBlupi &&
+ m_blupiAction != ACTION_WIN &&
+ m_blupiAction != ACTION_BYE &&
+ !IsDeadAction(m_blupiAction) &&
+ m_blupiAction != ACTION_GLU &&
+ m_blupiAction != ACTION_ELECTRO &&
+ m_blupiAction != ACTION_HIDE)
{
tinyPoint = m_moveObject[num].posCurrent;
ObjectDelete(tinyPoint, m_moveObject[num].type);
- m_blupiAction = 54;
+ m_blupiAction = ACTION_GLU;
m_blupiPhase = 0;
m_blupiSuspend = FALSE;
m_blupiJumpAie = FALSE;
@@ -3305,7 +3382,9 @@ void CDecor::BlupiStep()
{
m_blupiAir = TRUE;
}
- if (m_blupiHelico || m_blupiOver || m_blupiBalloon || m_blupiEcrase || m_blupiJeep || m_blupiTank || m_blupiSkate)
+ if (IsBlupiVehicle() ||
+ m_blupiBalloon ||
+ m_blupiEcrase)
{
m_blupiHelico = FALSE;
m_blupiOver = FALSE;
@@ -3320,7 +3399,7 @@ void CDecor::BlupiStep()
m_blupiHide = FALSE;
m_jauges[JAUGE_POWER].SetHide(TRUE);
}
- if (m_moveObject[num].type == 5)
+ if (m_moveObject[num].type == TYPE_TRESOR)
{
ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type);
tinyPoint.x = m_moveObject[num].posCurrent.x - m_posDecor.x;
@@ -3328,13 +3407,15 @@ void CDecor::BlupiStep()
POINT end;
end.x = 430;
end.y = 430;
- VoyageInit(tinyPoint, end, 6, 10);
- ObjectStart(m_moveObject[num].posCurrent, 39, -60);
- ObjectStart(m_moveObject[num].posCurrent, 39, 60);
- ObjectStart(m_moveObject[num].posCurrent, 39, 10);
- ObjectStart(m_moveObject[num].posCurrent, 39, -10);
+ VoyageInit(tinyPoint, end, 6, CHELEMENT);
+ ObjectStart(m_moveObject[num].posCurrent, TYPE_TRESORTRACK, -60);
+ ObjectStart(m_moveObject[num].posCurrent, TYPE_TRESORTRACK, 60);
+ ObjectStart(m_moveObject[num].posCurrent, TYPE_TRESORTRACK, 10);
+ ObjectStart(m_moveObject[num].posCurrent, TYPE_TRESORTRACK, -10);
}
- if (m_moveObject[num].type == 49 && (m_voyageIcon != 215 || m_voyageChannel != 10) && (m_blupiCle & 1) == 0)
+ if (m_moveObject[num].type == TYPE_CLE1 &&
+ (m_voyageIcon != 215 || m_voyageChannel != CHELEMENT) &&
+ !(m_blupiCle & CLE_RED))
{
ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type);
tinyPoint.x = m_moveObject[num].posCurrent.x - m_posDecor.x;
@@ -3342,13 +3423,15 @@ void CDecor::BlupiStep()
POINT end2;
end2.x = 520;
end2.y = 418;
- VoyageInit(tinyPoint, end2, 215, 10);
- ObjectStart(m_moveObject[num].posCurrent, 39, -60);
- ObjectStart(m_moveObject[num].posCurrent, 39, 60);
- ObjectStart(m_moveObject[num].posCurrent, 39, 10);
- ObjectStart(m_moveObject[num].posCurrent, 39, -10);
+ VoyageInit(tinyPoint, end2, 215, CHELEMENT);
+ ObjectStart(m_moveObject[num].posCurrent, TYPE_TRESORTRACK, -60);
+ ObjectStart(m_moveObject[num].posCurrent, TYPE_TRESORTRACK, 60);
+ ObjectStart(m_moveObject[num].posCurrent, TYPE_TRESORTRACK, 10);
+ ObjectStart(m_moveObject[num].posCurrent, TYPE_TRESORTRACK, -10);
}
- if (m_moveObject[num].type == 50 && (m_voyageIcon != 222 || m_voyageChannel != 10) && (m_blupiCle & 2) == 0)
+ if (m_moveObject[num].type == TYPE_CLE2 &&
+ (m_voyageIcon != 222 || m_voyageChannel != CHELEMENT) &&
+ !(m_blupiCle & CLE_GREEN))
{
ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type);
tinyPoint.x = m_moveObject[num].posCurrent.x - m_posDecor.x;
@@ -3356,13 +3439,15 @@ void CDecor::BlupiStep()
POINT end3;
end3.x = 530;
end3.y = 418;
- VoyageInit(tinyPoint, end3, 222, 10);
- ObjectStart(m_moveObject[num].posCurrent, 39, -60);
- ObjectStart(m_moveObject[num].posCurrent, 39, 60);
- ObjectStart(m_moveObject[num].posCurrent, 39, 10);
- ObjectStart(m_moveObject[num].posCurrent, 39, -10);
+ VoyageInit(tinyPoint, end3, 222, CHELEMENT);
+ ObjectStart(m_moveObject[num].posCurrent, TYPE_TRESORTRACK, -60);
+ ObjectStart(m_moveObject[num].posCurrent, TYPE_TRESORTRACK, 60);
+ ObjectStart(m_moveObject[num].posCurrent, TYPE_TRESORTRACK, 10);
+ ObjectStart(m_moveObject[num].posCurrent, TYPE_TRESORTRACK, -10);
}
- if (m_moveObject[num].type == 51 && (m_voyageIcon != 229 || m_voyageChannel != 10) && (m_blupiCle & 4) == 0)
+ if (m_moveObject[num].type == TYPE_CLE3 &&
+ (m_voyageIcon != 229 || m_voyageChannel != CHELEMENT) &&
+ !(m_blupiCle & CLE_BLUE))
{
ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type);
tinyPoint.x = m_moveObject[num].posCurrent.x - m_posDecor.x;
@@ -3370,22 +3455,22 @@ void CDecor::BlupiStep()
POINT end4;
end4.x = 540;
end4.y = 418;
- VoyageInit(tinyPoint, end4, 229, 10);
- ObjectStart(m_moveObject[num].posCurrent, 39, -60);
- ObjectStart(m_moveObject[num].posCurrent, 39, 60);
- ObjectStart(m_moveObject[num].posCurrent, 39, 10);
- ObjectStart(m_moveObject[num].posCurrent, 39, -10);
+ VoyageInit(tinyPoint, end4, 229, CHELEMENT);
+ ObjectStart(m_moveObject[num].posCurrent, TYPE_TRESORTRACK, -60);
+ ObjectStart(m_moveObject[num].posCurrent, TYPE_TRESORTRACK, 60);
+ ObjectStart(m_moveObject[num].posCurrent, TYPE_TRESORTRACK, 10);
+ ObjectStart(m_moveObject[num].posCurrent, TYPE_TRESORTRACK, -10);
}
- if (m_moveObject[num].type == 6 && m_nbVies < 10 && m_blupiFocus)
+ if (m_moveObject[num].type == TYPE_EGG && m_nbVies < 10 && m_blupiFocus)
{
ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type);
tinyPoint.x = m_moveObject[num].posCurrent.x - m_posDecor.x;
tinyPoint.y = m_moveObject[num].posCurrent.y - m_posDecor.y;
- VoyageInit(tinyPoint, VoyageGetPosVie(m_nbVies + 1), 21, 10);
+ VoyageInit(tinyPoint, VoyageGetPosVie(m_nbVies + 1), 21, CHELEMENT);
}
- if (m_moveObject[num].type == 25 && !m_blupiShield && !m_blupiHide && !m_blupiPower && m_blupiFocus)
+ if (m_moveObject[num].type == TYPE_SHIELD && !m_blupiShield && !m_blupiHide && !m_blupiPower && m_blupiFocus)
{
- PlaySound(42, m_moveObject[num].posCurrent);
+ PlaySound(SOUND_STARTSHIELD, m_moveObject[num].posCurrent);
m_blupiShield = TRUE;
m_blupiPower = FALSE;
m_blupiCloud = FALSE;
@@ -3394,45 +3479,62 @@ void CDecor::BlupiStep()
m_blupiPosMagic = m_blupiPos;
m_jauges[JAUGE_POWER].SetHide(FALSE);
}
- if ( m_moveObject[num].type == 26 && !m_blupiShield && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && m_blupiFocus)
+ if ( m_moveObject[num].type == TYPE_POWER &&
+ !m_blupiShield &&
+ !IsBlupiVehicle() &&
+ !m_blupiBalloon &&
+ !m_blupiEcrase &&
+ m_blupiFocus)
{
-
ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type);
- m_blupiAction = 49;
+ m_blupiAction = ACTION_SUCETTE;
m_blupiPhase = 0;
m_blupiCloud = FALSE;
m_blupiHide = FALSE;
m_blupiFocus = FALSE;
- PlaySound(50, end);
+ PlaySound(SOUND_SUCETTE, end);
}
- if (m_moveObject[num].type == 40 && !m_blupiHide && m_blupiFocus)
+ if (m_moveObject[num].type == TYPE_INVERT && !m_blupiHide && m_blupiFocus)
{
ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type);
m_blupiInvert = TRUE;
m_blupiTimeShield = 100;
m_blupiPosMagic = m_blupiPos;
m_jauges[JAUGE_POWER].SetHide(FALSE);
- PlaySound(66, end);
- ObjectStart(m_blupiPos, 41, -60);
- ObjectStart(m_blupiPos, 41, 60);
- ObjectStart(m_blupiPos, 41, 10);
- ObjectStart(m_blupiPos, 41, -10);
+ PlaySound(SOUND_INVERTSTART, end);
+ ObjectStart(m_blupiPos, TYPE_INVERTSTART, -60);
+ ObjectStart(m_blupiPos, TYPE_INVERTSTART, 60);
+ ObjectStart(m_blupiPos, TYPE_INVERTSTART, 10);
+ ObjectStart(m_blupiPos, TYPE_INVERTSTART, -10);
}
- if ( m_moveObject[num].type == 30 && !m_blupiShield && !m_blupiCloud && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && m_blupiFocus)
+ if ( m_moveObject[num].type == TYPE_DRINK &&
+ !m_blupiShield &&
+ !m_blupiCloud &&
+ !IsBlupiVehicle() &&
+ !m_blupiBalloon &&
+ !m_blupiEcrase &&
+ m_blupiFocus)
{
-
ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type);
- m_blupiAction = 55;
+ m_blupiAction = ACTION_DRINK;
m_blupiPhase = 0;
m_blupiShield = FALSE;
m_blupiPower = FALSE;
m_blupiJumpAie = FALSE;
m_blupiFocus = FALSE;
- PlaySound(57, end);
+ PlaySound(SOUND_DRINK, end);
}
- if (m_moveObject[num].type == 31 && !m_blupiShield && !m_blupiHide && !m_blupiPower && !m_blupiCloud && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && m_blupiFocus)
+ if (m_moveObject[num].type == TYPE_CHARGE &&
+ !m_blupiShield &&
+ !m_blupiHide &&
+ !m_blupiPower &&
+ !m_blupiCloud &&
+ !IsBlupiVehicle() &&
+ !m_blupiBalloon &&
+ !m_blupiEcrase &&
+ m_blupiFocus)
{
- m_blupiAction = 56;
+ m_blupiAction = ACTION_CHARGE;
m_blupiPhase = 0;
m_blupiShield = FALSE;
m_blupiPower = FALSE;
@@ -3440,16 +3542,18 @@ void CDecor::BlupiStep()
m_blupiFocus = FALSE;
m_blupiCloud = TRUE;
m_blupiTimeShield = 100;
- PlaySound(58, end);
+ PlaySound(SOUND_CHARGE, end);
if (m_blupiHide)
{
m_blupiHide = FALSE;
m_jauges[JAUGE_POWER].SetHide(TRUE);
}
}
- if (m_moveObject[num].type >= 200 && m_moveObject[num].type <= 203 && m_blupiFocus)
+ if (m_moveObject[num].type >= TYPE_BOMBEPERSO1 &&
+ m_moveObject[num].type <= TYPE_BOMBEPERSO4 &&
+ m_blupiFocus)
{
- if (m_moveObject[num].type == 200)
+ if (m_moveObject[num].type == TYPE_BOMBEPERSO1)
{
if (m_blupiPerso < 5 )
{
@@ -3459,23 +3563,26 @@ void CDecor::BlupiStep()
tinyPoint.y = m_moveObject[num].posCurrent.y - m_posDecor.y;
tinyPoint5.x = 0;
tinyPoint5.y = 438;
- VoyageInit(tinyPoint, tinyPoint5, 108, 4);
+ VoyageInit(tinyPoint, tinyPoint5, 108, CHBUTTON);
}
}
- else if (!m_blupiShield && !m_blupiHide && !m_bSuperBlupi)
+ else if (!m_blupiShield && !m_bSuperBlupi)
{
ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type);
- BlupiDead(11, 75);
+ BlupiDead(ACTION_CLEAR1, ACTION_CLEAR2);
tinyPoint = m_moveObject[num].posCurrent;
tinyPoint.x -= 34;
tinyPoint.y -= 34;
- ObjectStart(tinyPoint, 10, 0);
- PlaySound(10, m_moveObject[num].posCurrent);
+ ObjectStart(tinyPoint, TYPE_EXPLO3, 0);
+ PlaySound(SOUND_BOUM, m_moveObject[num].posCurrent);
m_decorAction = 1;
m_decorPhase = 0;
}
}
- if (m_moveObject[num].type == 55 && m_blupiFocus && m_blupiDynamite == 0 && (m_voyageIcon != 252 || m_voyageChannel != 10) )
+ if (m_moveObject[num].type == TYPE_DYNAMITE &&
+ m_blupiFocus &&
+ m_blupiDynamite == 0 &&
+ (m_voyageIcon != 252 || m_voyageChannel != CHELEMENT) )
{
ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type);
@@ -3483,30 +3590,38 @@ void CDecor::BlupiStep()
tinyPoint.y = m_moveObject[num].posCurrent.y - m_posDecor.y;
tinyPoint5.x = 505;
tinyPoint5.y = 414;
- VoyageInit(tinyPoint, tinyPoint5, 252, 10);
- m_blupiAction = 86;
+ VoyageInit(tinyPoint, tinyPoint5, 252, CHELEMENT);
+ m_blupiAction = ACTION_TAKEDYNAMITE;
m_blupiPhase = 0;
m_blupiFocus = FALSE;
}
- if (m_moveObject[num].type == 12 && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus && m_blupiAction == 2)
+ if (m_moveObject[num].type == 12 &&
+ !IsBlupiVehicle() &&
+ !m_blupiBalloon &&
+ !m_blupiEcrase &&
+ !m_blupiNage &&
+ !m_blupiSurf &&
+ !m_blupiSuspend &&
+ m_blupiFocus &&
+ m_blupiAction == ACTION_MARCH)
{
end = m_moveObject[num].posCurrent;
if (m_blupiDir == DIR_LEFT && m_blupiPos.x > end.x)
{
end.x = m_blupiPos.x - 59;
- PlaySound(38, end);
- m_blupiActionOuf = 45;
+ PlaySound(SOUND_PUSH, end);
+ m_blupiActionOuf = ACTION_OUF1b;
m_blupiTimeOuf = 0;
- m_blupiAction = 14;
+ m_blupiAction = ACTION_PUSH;
m_blupiPhase = 0;
}
if (m_blupiDir == DIR_RIGHT && m_blupiPos.x < end.x)
{
end.x = m_blupiPos.x + 55;
- PlaySound(38, end);
- m_blupiActionOuf = 45;
+ PlaySound(SOUND_PUSH, end);
+ m_blupiActionOuf = ACTION_OUF1b;
m_blupiTimeOuf = 0;
- m_blupiAction = 14;
+ m_blupiAction = ACTION_PUSH;
m_blupiPhase = 0;
}
if (!TestPushCaisse(num, end, FALSE))
@@ -3514,19 +3629,19 @@ void CDecor::BlupiStep()
m_blupiPos.x = blupiPos.x;
}
}
- if ((m_moveObject[num].type == 7 || m_moveObject[num].type == 21) && m_blupiFocus)
+ if ((m_moveObject[num].type == TYPE_GOAL || m_moveObject[num].type == TYPE_CLE) && m_blupiFocus)
{
if (m_goalPhase == 0)
{
if (m_nbTresor >= m_totalTresor)
{
- if (m_moveObject[num].type == 21)
+ if (m_moveObject[num].type == TYPE_CLE)
{
m_bFoundCle = TRUE;
}
StopVehicleSound();
- PlaySound(14, m_moveObject[num].posCurrent);
- m_blupiAction = 13;
+ PlaySound(SOUND_ENDOK, m_moveObject[num].posCurrent);
+ m_blupiAction = ACTION_WIN;
m_blupiPhase = 0;
m_blupiFocus = FALSE;
m_blupiFront = TRUE;
@@ -3534,7 +3649,7 @@ void CDecor::BlupiStep()
}
else
{
- PlaySound(13, m_moveObject[num].posCurrent);
+ PlaySound(SOUND_ENDKO, m_moveObject[num].posCurrent);
}
m_goalPhase = 50;
}
@@ -3552,7 +3667,7 @@ void CDecor::BlupiStep()
{
m_goalPhase = 0;
}
- if (m_blupiAction == 14 && m_blupiFocus)
+ if (m_blupiAction == ACTION_PUSH && m_blupiFocus)
{
num = CaisseInFront();
if (num != -1)
@@ -3576,7 +3691,7 @@ void CDecor::BlupiStep()
StopBlupi();
}
}
- if (m_blupiAction == 29 && m_blupiFocus)
+ if (m_blupiAction == ACTION_POP && m_blupiFocus)
{
num = CaisseInFront();
if (num != -1)
@@ -3600,19 +3715,24 @@ void CDecor::BlupiStep()
StopBlupi();
}
}
- if (!m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && m_blupiFocus)
+ if (!IsBlupiVehicle() &&
+ !m_blupiBalloon &&
+ !m_blupiEcrase &&
+ !m_blupiNage &&
+ !m_blupiSurf &&
+ m_blupiFocus)
{
- if (m_blupiActionOuf == 44 && m_blupiAction == 1)
+ if (m_blupiActionOuf == ACTION_OUF1a && m_blupiAction == ACTION_STOP)
{
if (m_blupiTimeOuf > 50)
{
m_blupiAction = m_blupiActionOuf;
m_blupiPhase = 0;
- PlaySound(46, m_blupiPos);
+ PlaySound(SOUND_OUF1, m_blupiPos);
}
m_blupiActionOuf = 0;
}
- if (m_blupiActionOuf == 45 && m_blupiAction == 1)
+ if (m_blupiActionOuf == ACTION_OUF1b && m_blupiAction == ACTION_STOP)
{
if (m_blupiTimeOuf > 50)
{
@@ -3621,11 +3741,11 @@ void CDecor::BlupiStep()
}
m_blupiActionOuf = 0;
}
- if (m_blupiAction == 45 && m_blupiPhase == 4)
+ if (m_blupiAction == ACTION_OUF1b && m_blupiPhase == ACTION_JUMP)
{
- PlaySound(46, m_blupiPos);
+ PlaySound(SOUND_OUF1, m_blupiPos);
}
- if (m_blupiActionOuf == 65 && m_blupiAction == 1)
+ if (m_blupiActionOuf == ACTION_OUF5 && m_blupiAction == ACTION_STOP)
{
if (m_blupiTimeOuf > 10 && m_blupiTimeOuf < 50)
{
@@ -3634,27 +3754,30 @@ void CDecor::BlupiStep()
}
m_blupiActionOuf = 0;
}
- if (m_blupiActionOuf == 47 && m_blupiAction == 1)
+ if (m_blupiActionOuf == ACTION_OUF3 && m_blupiAction == ACTION_STOP)
{
if (m_blupiTimeOuf > 60)
{
m_blupiAction = m_blupiActionOuf;
m_blupiPhase = 0;
- PlaySound(48, m_blupiPos);
+ PlaySound(SOUND_OUF3, m_blupiPos);
}
m_blupiActionOuf = 0;
}
- if (m_blupiActionOuf == 48 && m_blupiAction == 1)
+ if (m_blupiActionOuf == ACTION_OUF4 && m_blupiAction == ACTION_STOP)
{
if (m_blupiTimeOuf < 10)
{
m_blupiAction = m_blupiActionOuf;
m_blupiPhase = 0;
- PlaySound(49, m_blupiPos);
+ PlaySound(SOUND_OUF4, m_blupiPos);
}
m_blupiActionOuf = 0;
}
- if ((m_blupiActionOuf == 63 || m_blupiActionOuf == 64 || m_blupiActionOuf == 83) && m_blupiAction == 1)
+ if ((m_blupiActionOuf == ACTION_MOCKERY ||
+ m_blupiActionOuf == ACTION_MOCKERYi ||
+ m_blupiActionOuf == ACTION_MOCKERYp)
+ && m_blupiAction == ACTION_STOP)
{
if (m_blupiTimeOuf < 20)
{
@@ -3664,7 +3787,12 @@ void CDecor::BlupiStep()
m_blupiActionOuf = 0;
}
}
- if (m_blupiAction == 2 && m_blupiActionOuf != 63 && m_blupiActionOuf != 64 && m_blupiActionOuf != 83 && !m_blupiSurf && !m_blupiNage)
+ if (m_blupiAction == ACTION_MARCH &&
+ m_blupiActionOuf != ACTION_MOCKERY &&
+ m_blupiActionOuf != ACTION_MOCKERYi &&
+ m_blupiActionOuf != ACTION_MOCKERYp &&
+ !m_blupiSurf &&
+ !m_blupiNage)
{
m_blupiActionOuf = 0;
}
@@ -3676,11 +3804,11 @@ void CDecor::BlupiStep()
{
m_blupiTimeMockery--;
}
- if (m_blupiAction == 86 && m_blupiPhase == 18)
+ if (m_blupiAction == ACTION_TAKEDYNAMITE && m_blupiPhase == 18)
{
StopBlupi(TRUE);
}
- if (m_blupiAction == 87 && m_blupiPhase == 26)
+ if (m_blupiAction == ACTION_PUTDYNAMITE && m_blupiPhase == 26)
{
StopBlupi(TRUE);
}
@@ -3692,53 +3820,54 @@ void CDecor::BlupiStep()
{
m_blupiTimeFire--;
}
- if (m_blupiAction == 74 && m_blupiPhase == 128)
+ if (m_blupiAction == ACTION_TELEPORTE && m_blupiPhase == 128)
{
- POINT blupiPos2 = { 0,0 };
- if (SearchTeleporte(m_blupiPos, blupiPos2))
+ POINT blupiPos2;
+ if (SearchTeleporte(m_blupiPos, &blupiPos2))
{
m_blupiPos = blupiPos2;
- ObjectStart(m_blupiPos, 27, 20);
- ObjectStart(m_blupiPos, 27, -20);
+ ObjectStart(m_blupiPos, TYPE_MAGICTRACK, 20);
+ ObjectStart(m_blupiPos, TYPE_MAGICTRACK, -20);
}
m_blupiFocus = TRUE;
m_blupiPosHelico = m_blupiPos;
}
- if (m_blupiAction == 82 && m_blupiPhase == 10)
+ if (m_blupiAction == ACTION_SWITCH && m_blupiPhase == 10)
{
StopBlupi(TRUE);
}
- if (m_keyPress & KEY_FIRE && m_blupiAction == 1)
- {
- m_blupiAction = 84;
- m_blupiPhase = 0;
- PlaySound(27, m_blupiPos);
- }
- if ((m_blupiAction == 11 && m_blupiPhase == 70) ||
- (m_blupiAction == 75 && m_blupiPhase == 100) ||
- (m_blupiAction == 76 && m_blupiPhase == 70) ||
- (m_blupiAction == 77 && m_blupiPhase == 110) ||
- (m_blupiAction == 78 && m_blupiPhase == 90) ||
- (m_blupiAction == 79 && m_blupiPhase == 90) ||
- (m_blupiAction == 80 && m_blupiPhase == 90) ||
- (m_blupiAction == 81 && m_blupiPhase == 90) ||
- (m_blupiAction == 24 && m_blupiPhase == 90) ||
- (m_blupiAction == 54 && m_blupiPhase == 100) ||
- (m_blupiAction == 57 && m_blupiPhase == 90))
+ //// winphone ?
+ //if (m_keyPress & KEY_FIRE && m_blupiAction == ACTION_STOP)
+ //{
+ // m_blupiAction = ACTION_NON;
+ // m_blupiPhase = 0;
+ // PlaySound(SOUND_ERROR, m_blupiPos);
+ //}
+ if ((m_blupiAction == ACTION_CLEAR1 && m_blupiPhase == 70) ||
+ (m_blupiAction == ACTION_CLEAR2 && m_blupiPhase == 100) ||
+ (m_blupiAction == ACTION_CLEAR3 && m_blupiPhase == 70) ||
+ (m_blupiAction == ACTION_CLEAR4 && m_blupiPhase == 110) ||
+ (m_blupiAction == ACTION_CLEAR5 && m_blupiPhase == 90) ||
+ (m_blupiAction == ACTION_CLEAR6 && m_blupiPhase == 90) ||
+ (m_blupiAction == ACTION_CLEAR7 && m_blupiPhase == 90) ||
+ (m_blupiAction == ACTION_CLEAR8 && m_blupiPhase == 90) ||
+ (m_blupiAction == ACTION_DROWN && m_blupiPhase == 90) ||
+ (m_blupiAction == ACTION_GLU && m_blupiPhase == 100) ||
+ (m_blupiAction == ACTION_ELECTRO && m_blupiPhase == 90))
{
if (m_nbVies > 0)
{
- m_blupiAction = 35;
+ m_blupiAction = ACTION_HIDE;
m_blupiIcon = -1;
m_blupiPhase = 0;
- if (m_blupiRestart)
+ if (m_blupiRestart || m_bMulti)
{
m_blupiPos = m_blupiValidPos;
}
POINT posDecor = GetPosDecor(m_blupiPos);
tinyPoint.x = m_blupiPos.x - posDecor.x - 30;
tinyPoint.y = m_blupiPos.y - posDecor.y;
- VoyageInit(VoyageGetPosVie(m_nbVies), tinyPoint, 48, 2);
+ VoyageInit(VoyageGetPosVie(m_nbVies), tinyPoint, 48, GetBlupiChannelActual());
NetSendBarePacket(PK_DIE, m_nbVies);
}
else
@@ -3750,6 +3879,43 @@ void CDecor::BlupiStep()
}
m_blupiFront = FALSE;
}
+ if (m_bMulti && m_blupiAction != ACTION_WIN)
+ {
+ int num = 0;
+ for (int i = 0; i < MAXNETPLAYER; i++)
+ {
+ if (m_pNetwork->m_players[i].bIsPresent) num++;
+ }
+ if (num < 2)
+ {
+ char str[100];
+ StopVehicleSound();
+ PlaySound(14, m_blupiPos, FALSE);
+ m_blupiAction = ACTION_WIN;
+ m_blupiPhase = 0;
+ m_blupiFocus = FALSE;
+ m_blupiFront = TRUE;
+ m_blupiAir = FALSE;
+ m_blupiHelico = FALSE;
+ m_blupiOver = FALSE;
+ m_blupiJeep = FALSE;
+ m_blupiTank = FALSE;
+ m_blupiSkate = FALSE;
+ m_blupiNage = FALSE;
+ m_blupiSurf = FALSE;
+ m_blupiVent = FALSE;
+ m_blupiSuspend = FALSE;
+ m_blupiShield = FALSE;
+ m_blupiPower = FALSE;
+ m_blupiCloud = FALSE;
+ m_blupiHide = FALSE;
+ m_blupiInvert = FALSE;
+ m_blupiBalloon = FALSE;
+ m_blupiEcrase = FALSE;
+ LoadString(287, str, 100);
+ NotifPush(str);
+ }
+ }
if (m_dimDecor.y == 0)
{
num3 = LYIMAGE;
@@ -3794,7 +3960,6 @@ void CDecor::BlupiStep()
}
if (m_blupiAction == ACTION_BYE && m_blupiPhase == 50)
{
- ;
num = IsWorld(m_blupiPos);
if (num != -1)
{
@@ -3812,19 +3977,42 @@ void CDecor::BlupiStep()
}
}
}
- if (lastBlupiAction == 63 && m_blupiAction != 63)
+ if (lastBlupiAction == ACTION_MOCKERY && m_blupiAction != ACTION_MOCKERY)
{
- StopSound(65);
+ StopSound(SOUND_MOCKERY);
+ NetStopSound(SOUND_MOCKERY);
}
- if (lastBlupiAction == 64 && m_blupiAction != 64)
+ if (lastBlupiAction == ACTION_MOCKERYi && m_blupiAction != ACTION_MOCKERYi)
{
- StopSound(65);
+ StopSound(SOUND_MOCKERY);
+ NetStopSound(SOUND_MOCKERY);
}
- if (lastBlupiAction == 83 && m_blupiAction != ACTION_MOCKERYp)
+ if (lastBlupiAction == ACTION_MOCKERYp && m_blupiAction != ACTION_MOCKERYp)
{
- StopSound(47);
+ StopSound(SOUND_OUF2);
+ NetStopSound(SOUND_OUF2);
}
- if (m_blupiFocus && !m_blupiAir && (!m_blupiHelico || BlupiIsGround()) && (!m_blupiOver || BlupiIsGround()) && !m_blupiBalloon && !m_blupiEcrase && !m_blupiShield && !m_blupiHide && !bIsOpen && !bIsOpen2 && m_blupiTransport == -1 && !IsLave(m_blupiPos) && !IsPiege(m_blupiPos) && !IsGoutte(m_blupiPos, TRUE) && !IsScie(m_blupiPos) && !IsBridge(m_blupiPos, &tinyPoint) && IsTeleporte(m_blupiPos) == -1 && !IsBlitz(m_blupiPos, TRUE) && !IsTemp(m_blupiPos) && !IsBalleTraj(m_blupiPos) && !IsMoveTraj(m_blupiPos))
+ if (m_blupiFocus &&
+ !m_blupiAir &&
+ (!m_blupiHelico || BlupiIsGround()) &&
+ (!m_blupiOver || BlupiIsGround()) &&
+ !m_blupiBalloon &&
+ !m_blupiEcrase &&
+ !m_blupiShield &&
+ !m_blupiHide &&
+ !bIsOpen &&
+ !bIsOpen2 &&
+ m_blupiTransport == -1 &&
+ !IsLave(m_blupiPos) &&
+ !IsPiege(m_blupiPos) &&
+ !IsGoutte(m_blupiPos, TRUE) &&
+ !IsScie(m_blupiPos) &&
+ !IsBridge(m_blupiPos, &tinyPoint) &&
+ IsTeleporte(m_blupiPos) == -1 &&
+ !IsBlitz(m_blupiPos, TRUE) &&
+ !IsTemp(m_blupiPos) &&
+ !IsBalleTraj(m_blupiPos) &&
+ !IsMoveTraj(m_blupiPos))
{
if (m_blupiFifoNb > 0)
{
@@ -3832,8 +4020,8 @@ void CDecor::BlupiStep()
}
BlupiAddFifo(m_blupiPos);
}
- end.x = m_blupiPos.x + 30 + m_scrollAdd.x;
- end.y = m_blupiPos.y + 30 + m_scrollAdd.y;
+ end.x = m_blupiPos.x + DIMBLUPIX / 2 + m_scrollAdd.x;
+ end.y = m_blupiPos.y + DIMBLUPIY / 2 + m_scrollAdd.y;
int num28 = abs(m_scrollPoint.x - end.x);
int num29 = abs(m_scrollPoint.y - end.y);
num4 = SCROLL_SPEED;
@@ -3877,13 +4065,15 @@ void CDecor::BlupiStep()
m_scrollPoint.y = end.y;
}
}
- if (m_blupiAction != 75 && m_blupiAction != 76)
+ if ((m_phase == WM_PHASE_PLAY || m_phase == WM_PHASE_PLAYTEST) &&
+ m_blupiAction != ACTION_CLEAR2 &&
+ m_blupiAction != ACTION_CLEAR3)
{
m_posDecor = GetPosDecor(m_scrollPoint);
}
if (m_time % 4 == 0)
{
- //PosSound(m_blupiPos);
+ AdaptMotorVehicleSound(m_blupiPos);
}
VoyageStep();
@@ -3943,7 +4133,7 @@ void CDecor::BlupiDead(int action1, int action2)
pos.y = m_blupiPos.y - m_posDecor.y;
pos2.x = m_blupiPos.x - m_posDecor.x;
pos2.y = m_blupiPos.y - m_posDecor.y - 300;
- VoyageInit(pos, pos2, 230, 10);
+ VoyageInit(pos, pos2, 230, CHELEMENT);
PlaySound(SOUND_ANGEL, m_blupiPos);
}
if (m_blupiAction == ACTION_CLEAR3)
@@ -3952,7 +4142,7 @@ void CDecor::BlupiDead(int action1, int action2)
pos.y = m_blupiPos.y - m_posDecor.y;
pos2.x = m_blupiPos.x - m_posDecor.x;
pos2.y = m_blupiPos.y - m_posDecor.y - 2000;
- VoyageInit(pos, pos2, 40, 10);
+ VoyageInit(pos, pos2, 40, CHELEMENT);
PlaySound(SOUND_ANGEL, m_blupiPos);
}
if (m_blupiAction == ACTION_CLEAR4)
diff --git a/src/decmove.cpp b/src/decmove.cpp
index 96fa7e0..0c4592f 100644
--- a/src/decmove.cpp
+++ b/src/decmove.cpp
@@ -13,13 +13,13 @@ void CDecor::MoveObjectPollution()
BOOL bPollution;
int num = 20;
bPollution = FALSE;
- if (m_blupiAction == 3)
+ if (m_blupiAction == ACTION_TURN)
{
return;
}
if (m_blupiHelico)
{
- if (m_blupiVitesse.y < -5.0)
+ if (m_blupiVitesse.y < -5)
{
if (m_time % 20 != 0 &&
m_time % 20 != 2 &&
@@ -33,7 +33,7 @@ void CDecor::MoveObjectPollution()
return;
}
}
- else if (m_blupiVitesse.x == 0.0)
+ else if (m_blupiVitesse.x == 0)
{
if (m_time % 50 != 0 &&
m_time % 50 != 12 &&
@@ -63,26 +63,26 @@ void CDecor::MoveObjectPlouf(POINT pos)
{
for (int i = 0; i < MAXMOVEOBJECT; i++)
{
- if (m_moveObject[i].type == 14)
+ if (m_moveObject[i].type == TYPE_PLOUF)
{
return;
}
}
pos.y -= 45;
- PlaySound(23, pos);
- ObjectStart(pos, 14, 0);
+ PlaySound(SOUND_PLOUF, pos);
+ ObjectStart(pos, TYPE_PLOUF, 0);
}
void CDecor::MoveObjectTiplouf(POINT pos)
{
for (int i = 0; i < MAXMOVEOBJECT; i++)
{
- if (m_moveObject[i].type == 35)
+ if (m_moveObject[i].type == TYPE_TIPLOUF)
{
return;
}
}
- if (m_blupiDir == 2)
+ if (m_blupiDir == DIR_RIGHT)
{
pos.x += 5;
}
@@ -91,13 +91,13 @@ void CDecor::MoveObjectTiplouf(POINT pos)
pos.x -= 5;
}
pos.y -= 45;
- PlaySound(64, pos);
- ObjectStart(pos, 35, 0);
+ PlaySound(SOUND_TIPLOUF, pos);
+ ObjectStart(pos, TYPE_TIPLOUF, 0);
}
void CDecor::MoveObjectBlup(POINT pos)
{
- PlaySound(24, pos);
+ PlaySound(SOUND_BLUP, pos);
pos.y -= 20;
int num = 0;
POINT tinyPoint = pos;
@@ -121,7 +121,7 @@ void CDecor::MoveObjectBlup(POINT pos)
{
return;
}
- m_moveObject[num2].type = 15;
+ m_moveObject[num2].type = TYPE_BLUP;
m_moveObject[num2].phase = 0;
m_moveObject[num2].posCurrent.x = pos.x;
m_moveObject[num2].posCurrent.y = pos.y;
@@ -130,7 +130,7 @@ void CDecor::MoveObjectBlup(POINT pos)
m_moveObject[num2].posEnd.y = pos.y - num * DIMOBJY;
m_moveObject[num2].timeStopStart = 0;
m_moveObject[num2].stepAdvance = num * 10;
- m_moveObject[num2].step = 2;
+ m_moveObject[num2].step = STEP_ADVANCE;
m_moveObject[num2].time = 0;
MoveObjectStepIcon(num2);
}
@@ -138,32 +138,29 @@ void CDecor::MoveObjectBlup(POINT pos)
void CDecor::FlushBalleTraj()
{
- for (int i = 0; i < 1300; i++)
- {
- m_balleTraj[i] = 0;
- }
+ ZeroMemory(m_balleTraj, sizeof(m_balleTraj));
}
-void CDecor::SetBalleTraj(POINT pos)
+void CDecor::SetBalleTraj(POINT cel)
{
- if (pos.x < 0 || pos.x >= 100 || pos.y < 0 || pos.y >= 100)
- {
- return;
- }
- int num = pos.y * 13;
- num += pos.x / 8;
- int num2 = pos.x & 7;
+ if (!IsValidCel(cel)) return;
+ int num = cel.y * TRAJBYTEX;
+ num += cel.x / 8;
+ int num2 = cel.x & 7;
m_balleTraj[num] |= 1 << num2;
}
BOOL CDecor::IsBalleTraj(POINT pos)
{
+ POINT cel;
pos.x = (pos.x + DIMOBJX / 2) / DIMOBJX;
pos.y = (pos.y + DIMOBJY / 2) / DIMOBJY;
- if (!IsValidCel(pos)) return FALSE;
- int num = pos.y * 13;
- num += pos.x / 8;
- int num2 = pos.x & 7;
+ cel.x = pos.x / DIMOBJX;
+ cel.y = pos.y / DIMOBJY;
+ if (!IsValidCel(cel)) return FALSE;
+ int num = cel.y * TRAJBYTEX;
+ num += cel.x / 8;
+ int num2 = cel.x & 7;
return (m_balleTraj[num] & 1 << num2) != 0;
}
@@ -172,57 +169,59 @@ void CDecor::FlushMoveTraj()
memset(m_moveTraj, 0, sizeof(m_moveTraj));
}
-void CDecor::SetMoveTraj(POINT pos)
+void CDecor::SetMoveTraj(POINT cel)
{
- if (pos.x < 0 || pos.x >= 100 || pos.y < 0 || pos.y >= 100)
- {
- return;
- }
- int num = pos.y * 13;
- num += pos.x / 8;
- int num2 = pos.x & 7;
+ if (!IsValidCel(cel)) return;
+ int num = cel.y * TRAJBYTEX;
+ num += cel.x / 8;
+ int num2 = cel.x & 7;
m_moveTraj[num] |= 1 << num2;
}
BOOL CDecor::IsMoveTraj(POINT pos)
{
- pos.x = (pos.x + 32) / 64;
- pos.y = (pos.y + 32) / 64;
- if (pos.x < 0 || pos.x >= 100 || pos.y < 0 || pos.y >= 100)
- {
- return FALSE;
- }
- int num = pos.y * 13;
- num += pos.x / 8;
- int num2 = pos.x & 7;
+ POINT cel;
+ pos.x = (pos.x + DIMOBJX / 2) / DIMOBJX;
+ pos.y = (pos.y + DIMOBJY / 2) / DIMOBJY;
+ cel.x = pos.x / DIMOBJX;
+ cel.y = pos.y / DIMOBJY;
+ if (!IsValidCel(cel)) return FALSE;
+ int num = cel.y * TRAJBYTEX;
+ num += cel.x / 8;
+ int num2 = cel.x & 7;
return (m_moveTraj[num] & 1 << num2) != 0;
}
int CDecor::SearchDistRight(POINT pos, POINT dir, int type)
{
+ POINT cel;
int num = 0;
- if (type == 36 || type == 39 || type == 41 || type == 42 || type == 93)
+ if (type == TYPE_POLLUTION ||
+ type == TYPE_TRESORTRACK ||
+ type == TYPE_INVERTSTART ||
+ type == TYPE_INVERTSTOP ||
+ type == TYPE_INVERTSPIN ||
+ type == TYPE_EXPLO8)
{
return 500;
}
- pos.x = (pos.x + 32) / 64;
- pos.y = (pos.y + 32) / 64;
- while (pos.x >= 0 && pos.x < 100 && pos.y >= 0 && pos.y < 100 && !IsBlocIcon(m_decor[pos.x][pos.y].icon))
+ cel.x = (pos.x + DIMOBJX / 2) / DIMOBJX;
+ cel.y = (pos.y + DIMOBJY / 2) / DIMOBJY;
+ while (IsValidCel(cel) && !IsBlocIcon(m_decor[cel.x][cel.y].icon))
{
- if (type == 23)
+ if (type == TYPE_BALLE)
{
- SetBalleTraj(pos);
+ SetBalleTraj(cel);
}
- num += 64;
- pos.x += dir.x;
- pos.y += dir.y;
+ num += DIMOBJX;
+ cel += dir;
}
- if ((type == 34 || type == 38) && num >= 64)
+ if ((type == TYPE_GLU || type == TYPE_ELECTRO) && num >= DIMOBJX)
{
- num -= 64;
+ num -= DIMOBJX;
}
- if (type == 23 && num >= 10)
+ if (type == TYPE_BALLE && num >= 10)
{
num -= 10;
}
@@ -235,30 +234,27 @@ void CDecor::StartSploutchGlu(POINT pos)
POINT pos2;
pos2.x = pos.x;
pos2.y = pos.y;
- ObjectStart(pos2, 98, 0);
+ ObjectStart(pos2, TYPE_SPLOUTCH1, 0);
pos2.x = pos.x + 15;
pos2.y = pos.y + 20;
- ObjectStart(pos2, 99, 0);
+ ObjectStart(pos2, TYPE_SPLOUTCH2, 0);
pos2.x = pos.x - 20;
pos2.y = pos.y + 18;
- ObjectStart(pos2, 99, 0);
+ ObjectStart(pos2, TYPE_SPLOUTCH2, 0);
pos2.x = pos.x + 23;
pos2.y = pos.y - 18;
- ObjectStart(pos2, 99, 0);
+ ObjectStart(pos2, TYPE_SPLOUTCH2, 0);
pos2.x = pos.x - 15;
pos2.y = pos.y - 18;
- ObjectStart(pos2, 99, 0);
+ ObjectStart(pos2, TYPE_SPLOUTCH2, 0);
pos2.x = pos.x + 32;
pos2.y = pos.y + 10;
- ObjectStart(pos2, 100, 0);
+ ObjectStart(pos2, TYPE_SPLOUTCH3, 0);
pos2.x = pos.x - 28;
pos2.y = pos.y + 15;
- ObjectStart(pos2, 100, 0);
- StopSound(16);
- StopSound(18);
- StopSound(29);
- StopSound(31);
- PlaySound(51, pos);
+ ObjectStart(pos2, TYPE_SPLOUTCH3, 0);
+ StopVehicleSound();
+ PlaySound(SOUND_GLU, pos);
}
BOOL CDecor::ObjectStart(POINT pos, int type, int speed)
@@ -330,7 +326,7 @@ BOOL CDecor::ObjectStart(POINT pos, int type, int speed, BOOL bMulti)
{
m_moveObject[num].posEnd = tinyPoint;
m_moveObject[num].timeStopStart = 0;
- m_moveObject[num].stepAdvance = abs(dist * num2 / 64);
+ m_moveObject[num].stepAdvance = abs(dist * num2 / DIMOBJX);
m_moveObject[num].step = STEP_ADVANCE;
m_moveObject[num].time = 0;
}
@@ -400,7 +396,7 @@ void CDecor::MoveObjectStep()
posCurrent.x += 2;
posCurrent.y += BLUPIOFFY;
ObjectDelete(m_moveObject[i].posCurrent, m_moveObject[i].type);
- ObjectStart(posCurrent, 37, 0);
+ ObjectStart(posCurrent, TYPE_CLEAR, 0);
ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type);
}
if (BlupiElectro(m_moveObject[i].posCurrent))
@@ -409,8 +405,8 @@ void CDecor::MoveObjectStep()
posCurrent.x += 2;
posCurrent.y += BLUPIOFFY;
ObjectDelete(m_moveObject[i].posCurrent, m_moveObject[i].type);
- ObjectStart(posCurrent, 38, 55);
- PlaySound(59, posCurrent);
+ ObjectStart(posCurrent, TYPE_ELECTRO, 55);
+ PlaySound(SOUND_ELECTRO, posCurrent);
}
}
}
@@ -503,9 +499,7 @@ void CDecor::MoveObjectStepLine(int i)
m_moveObject[i].time ++;
if (m_moveObject[i].stepAdvance != 0)
{
- //m_moveObject[i].posCurrent = (m_moveObject[i].posEnd - m_moveObject[i].posStart) * m_moveObject[i].time / m_moveObject[i].stepAdvance + m_moveObject[i].posStart;
- m_moveObject[i].posCurrent.x = (m_moveObject[i].posEnd.x - m_moveObject[i].posStart.x) * m_moveObject[i].time / m_moveObject[i].stepAdvance + m_moveObject[i].posStart.x;
- m_moveObject[i].posCurrent.y = (m_moveObject[i].posEnd.y - m_moveObject[i].posStart.y) * m_moveObject[i].time / m_moveObject[i].stepAdvance + m_moveObject[i].posStart.y;
+ m_moveObject[i].posCurrent = (m_moveObject[i].posEnd - m_moveObject[i].posStart) * m_moveObject[i].time / m_moveObject[i].stepAdvance + m_moveObject[i].posStart;
}
}
@@ -545,11 +539,7 @@ void CDecor::MoveObjectStepLine(int i)
m_moveObject[i].time ++;
if (m_moveObject[i].stepRecede != 0)
{
- //m_moveObject[i].posCurrent = (m_moveObject[i].posStart - m_moveObject[i].posEnd) * m_moveObject[i].time / m_moveObject[i].stepRecede + m_moveObject[i].posEnd;
- m_moveObject[i].posCurrent.x = (m_moveObject[i].posStart.x - m_moveObject[i].posEnd.x) *
- m_moveObject[i].time / m_moveObject[i].stepRecede + m_moveObject[i].posEnd.x;
- m_moveObject[i].posCurrent.y = (m_moveObject[i].posStart.y - m_moveObject[i].posEnd.y) *
- m_moveObject[i].time / m_moveObject[i].stepRecede + m_moveObject[i].posEnd.y;
+ m_moveObject[i].posCurrent = (m_moveObject[i].posStart - m_moveObject[i].posEnd) * m_moveObject[i].time / m_moveObject[i].stepRecede + m_moveObject[i].posEnd;
}
}
else
@@ -798,7 +788,7 @@ void CDecor::MoveObjectStepIcon(int i)
}
if (m_moveObject[i].type == TYPE_EXPLO1)
{
- if (m_moveObject[i].phase >= table_explo1[0])
+ if (m_moveObject[i].phase >= 36)
{
m_moveObject[i].type = 0;
}
@@ -1112,7 +1102,7 @@ void CDecor::MoveObjectStepIcon(int i)
}
m_moveObject[i].channel = CHELEMENT;
}
- if (m_moveObject[i].type == 20)
+ if (m_moveObject[i].type == TYPE_OISEAU)
{
if (m_moveObject[i].posStart.x > m_moveObject[i].posEnd.x)
{
@@ -1202,11 +1192,11 @@ void CDecor::MoveObjectStepIcon(int i)
{
if (m_moveObject[i].step == STEP_STOPSTART)
{
- m_moveObject[i].icon = table_creature_turn2[m_moveObject[i].time % 152];
+ m_moveObject[i].icon = table_creature_turn2[m_moveObject[i].time % 200];
}
if (m_moveObject[i].step == STEP_STOPEND)
{
- m_moveObject[i].icon = table_creature_turn2[m_moveObject[i].time % 152];
+ m_moveObject[i].icon = table_creature_turn2[m_moveObject[i].time % 200];
}
if (m_moveObject[i].step == STEP_ADVANCE)
{
@@ -1221,11 +1211,11 @@ void CDecor::MoveObjectStepIcon(int i)
{
if (m_moveObject[i].step == STEP_STOPSTART)
{
- m_moveObject[i].icon = table_creature_turn2[m_moveObject[i].time % 152];
+ m_moveObject[i].icon = table_creature_turn2[m_moveObject[i].time % 200];
}
if (m_moveObject[i].step == STEP_STOPEND)
{
- m_moveObject[i].icon = table_creature_turn2[m_moveObject[i].time % 152];
+ m_moveObject[i].icon = table_creature_turn2[m_moveObject[i].time % 200];
}
if (m_moveObject[i].step == STEP_ADVANCE)
{
@@ -1457,7 +1447,7 @@ void CDecor::DynamiteStart(int i, int dx, int dy)
ObjectStart(posStart, TYPE_EXPLO1, 0);
if (dx == 0 && dy == 0)
{
- PlaySound(10, posStart);
+ PlaySound(SOUND_BOUM, posStart);
m_decorAction = 1;
m_decorPhase = 0;
}
@@ -1495,7 +1485,7 @@ void CDecor::DynamiteStart(int i, int dx, int dy)
m_moveObject[i].type == TYPE_BOMBEFOLLOW1 ||
m_moveObject[i].type == TYPE_BOMBEFOLLOW2 ||
m_moveObject[i].type == TYPE_BULLDOZER ||
- m_moveObject[i].type == TYPE_EGG |
+ m_moveObject[i].type == TYPE_EGG ||
m_moveObject[i].type == TYPE_CAISSE ||
m_moveObject[i].type == TYPE_HELICO ||
m_moveObject[i].type == TYPE_BOMBEMOVE ||
@@ -1852,7 +1842,7 @@ int CDecor::MockeryDetect(POINT pos)
int icon = m_decor[tinyPoint.x / DIMOBJX][tinyPoint.y / DIMOBJY].icon;
if (icon == 68 || icon == 317)
{
- return 64;
+ return ACTION_MOCKERYi;
}
}
}
@@ -1889,31 +1879,31 @@ int CDecor::MockeryDetect(POINT pos)
{
if (m_moveObject[i].type == TYPE_CREATURE)
{
- return 83;
+ return ACTION_MOCKERYp;
}
if (m_blupiDir == DIR_RIGHT)
{
if (pos.x >= src2.left)
{
- return 64;
+ return ACTION_MOCKERYi;
}
if (m_moveObject[i].type == TYPE_BOMBEDOWN)
{
return 0;
}
- return 63;
+ return ACTION_MOCKERY;
}
else
{
if (pos.x < src2.left)
{
- return 64;
+ return ACTION_MOCKERYi;
}
if (m_moveObject[i].type == TYPE_BOMBEDOWN)
{
return 0;
}
- return 63;
+ return ACTION_MOCKERY;
}
}
}
@@ -1949,7 +1939,7 @@ void CDecor::MoveObjectFollow(POINT pos)
src.right = pos.x + DIMBLUPIX - 16;
for (int i = 0; i < MAXMOVEOBJECT; i++)
{
- if (m_moveObject[i].type == 96)
+ if (m_moveObject[i].type == TYPE_BOMBEFOLLOW1)
{
RECT src2;
src2.left = m_moveObject[i].posCurrent.x - 100;
@@ -1999,18 +1989,18 @@ int CDecor::MoveObjectDetect(POINT pos, BOOL* pbNear)
{
if (m_blupiAction == ACTION_DOWN)
{
- //goto IL_427;
+ continue;
}
src3.top = m_moveObject[i].posCurrent.y;
src3.bottom = m_moveObject[i].posCurrent.y + 69 - 36;
}
- if (m_moveObject[i].type == TYPE_HELICO)
+ if (m_moveObject[i].type == TYPE_CAISSE)
{
src3.left = m_moveObject[i].posCurrent.x - 16;
src3.right = m_moveObject[i].posCurrent.x + DIMOBJX + 16;
src3.top = m_moveObject[i].posCurrent.y;
src3.bottom = m_moveObject[i].posCurrent.y + DIMOBJY;
- if (m_blupiDir == 1)
+ if (m_blupiDir == DIR_LEFT)
{
src3.left += 20;
}
@@ -2030,7 +2020,7 @@ int CDecor::MoveObjectDetect(POINT pos, BOOL* pbNear)
if (m_moveObject[i].type == TYPE_BALLE)
{
src3.left = m_moveObject[i].posCurrent.x + 24;
- src3.right = m_moveObject[i].posCurrent.x + DIMOBJX - 24;
+ src3.right = m_moveObject[i].posCurrent.x + DIMBLUPIX - 24;
src3.top = m_moveObject[i].posCurrent.y + 10;
src3.bottom = m_moveObject[i].posCurrent.y + DIMBLUPIY - 32;
}
@@ -2141,7 +2131,7 @@ int CDecor::MoveBalleDetect(POINT pos)
int i;
if (m_phase == WM_PHASE_BUILD)
return -1;
- rcSrc2.right = pos.x + 44;
+ rcSrc2.right = pos.x + DIMBLUPIX - 16;
rcSrc2.left = pos.x + 20;
rcSrc2.top = pos.y + 10;
rcSrc2.bottom = pos.y + 28;
@@ -2154,9 +2144,9 @@ int CDecor::MoveBalleDetect(POINT pos)
m_moveObject->type == TYPE_BLUPIHELICO ||
m_moveObject->type == TYPE_BLUPITANK)
{
- rcSrc1.right = m_moveObject->posCurrent.x + 44;
+ rcSrc1.right = m_moveObject->posCurrent.x + DIMBLUPIX - 16;
rcSrc1.left = m_moveObject->posCurrent.x + 16;
- rcSrc1.bottom = m_moveObject->posCurrent.y + 50;
+ rcSrc1.bottom = m_moveObject->posCurrent.y + DIMBLUPIY - 10;
rcSrc1.top = m_moveObject->posCurrent.y + 16;
rcDst = RECT( 0, 0, 0, 0 );
if (IntersectRect(&rcDst, &rcSrc1, &rcSrc2))
@@ -2219,7 +2209,7 @@ int CDecor::SortGetType(int type)
void CDecor::MoveObjectSort()
{
- MoveObject src;
+ MoveObject dst;
int i;
int num = 0;
@@ -2246,9 +2236,9 @@ void CDecor::MoveObjectSort()
{
if (SortGetType(m_moveObject[i].type) > SortGetType(m_moveObject[i + 1].type))
{
- MoveObjectCopy(&src, &m_moveObject[i]);
+ MoveObjectCopy(&dst, &m_moveObject[i]);
MoveObjectCopy(&m_moveObject[i], &m_moveObject[i + 1]);
- MoveObjectCopy(&m_moveObject[i + 1], &src);
+ MoveObjectCopy(&m_moveObject[i + 1], &dst);
flag = TRUE;
}
}
@@ -2260,25 +2250,21 @@ void CDecor::MoveObjectSort()
void CDecor::MoveObjectPriority(int rank)
{
MoveObject tempMob;
-
- if (rank != 0)
+ int i;
+ if (rank)
{
- if (m_moveObject[rank].type == TYPE_BALLE)
+ for (i = 0; i < MAXMOVEOBJECT; i++)
{
- int i = 0;
- for (int i = 0; i < MAXMOVEOBJECT; i++)
+ if (m_moveObject[i].type == TYPE_BALLE) return;
+ }
+ if (i <= rank)
+ {
+ MoveObjectCopy(&tempMob, &m_moveObject[rank]);
+ MoveObjectCopy(&m_moveObject[rank], &m_moveObject[i]);
+ MoveObjectCopy(&m_moveObject[i], &tempMob);
+ if (m_moveObject[rank].type == TYPE_CAISSE || m_moveObject[i].type == TYPE_CAISSE)
{
- if (m_moveObject[i].type != TYPE_BALLE) break;
- }
- if (i <= rank)
- {
- MoveObjectCopy(&tempMob, &m_moveObject[rank]);
- MoveObjectCopy(&m_moveObject[rank], &m_moveObject[i]);
- MoveObjectCopy(&m_moveObject[i], &tempMob);
- if (m_moveObject[rank].type == TYPE_CAISSE || tempMob.type == TYPE_CAISSE)
- {
- UpdateCaisse();
- }
+ UpdateCaisse();
}
}
}
diff --git a/src/decor.cpp b/src/decor.cpp
index 4ca950f..9d32896 100644
--- a/src/decor.cpp
+++ b/src/decor.cpp
@@ -75,10 +75,10 @@ void CDecor::Create(HWND hWnd, CSound* pSound, CPixmap* pPixmap, CNetwork* pNetw
m_bJeepStop = FALSE;
InitDecor();
- m_jauges[0].Create(m_hWnd, m_pPixmap, m_pSound, POINT( 169, 450 ), 1, FALSE);
- m_jauges[0].SetHide(TRUE);
- m_jauges[1].Create(m_hWnd, m_pPixmap, m_pSound, POINT( 171, 450 ), 3, FALSE);
- m_jauges[1].SetHide(TRUE);
+ m_jauges[JAUGE_AIR].Create(m_hWnd, m_pPixmap, m_pSound, POINT( 169, 450 ), 1, FALSE);
+ m_jauges[JAUGE_AIR].SetHide(TRUE);
+ m_jauges[JAUGE_POWER].Create(m_hWnd, m_pPixmap, m_pSound, POINT( 171, 450 ), 3, FALSE);
+ m_jauges[JAUGE_POWER].SetHide(TRUE);
NetMessageIndexFlush();
NotifFlush();
}
@@ -332,8 +332,8 @@ void CDecor::PlayPrepare(BOOL bTest)
NetDataFlush();
NotifFlush();
m_voyageIcon = -1;
- m_jauges[0].SetHide(TRUE);
- m_jauges[1].SetHide(TRUE);
+ m_jauges[JAUGE_AIR].SetHide(TRUE);
+ m_jauges[JAUGE_POWER].SetHide(TRUE);
m_bFoundCle = FALSE;
m_term = 0;
m_time = 0;
@@ -582,13 +582,13 @@ void CDecor::Build(RECT rect)
tinyPoint.x += 2;
tinyPoint.y += BLUPIOFFY;
}
- if (m_moveObject[i].type == 54)
+ if (m_moveObject[i].type == TYPE_CREATURE)
{
tinyPoint.y += BLUPIOFFY;
}
// get the winphone opacity stuff out of here
m_pPixmap->QuickIcon(m_moveObject[i].channel, m_moveObject[i].icon, tinyPoint);
- if (m_moveObject[i].type == 30)
+ if (m_moveObject[i].type == TYPE_DRINK)
{
for (int L = 0; L < sizeof(table_drinkoffset) / sizeof(int); L++)
{
@@ -599,7 +599,7 @@ void CDecor::Build(RECT rect)
m_pPixmap->QuickIcon(10, rank, pos2);
}
}
- if (m_bDrawSecret && m_moveObject[i].type == 12 && m_moveObject[i].icon != 32 && m_moveObject[i].icon != 33 && m_moveObject[i].icon != 34)
+ if (m_bDrawSecret && m_moveObject[i].type == TYPE_CAISSE && m_moveObject[i].icon != 32 && m_moveObject[i].icon != 33 && m_moveObject[i].icon != 34)
{
m_pPixmap->QuickIcon(1, 214, tinyPoint);
}
@@ -686,17 +686,23 @@ void CDecor::Build(RECT rect)
}
for (int num3 = 0; num3 < MAXMOVEOBJECT; num3++)
{
- if ((m_moveObject[num3].type == 1 || m_moveObject[num3].type == 47 || m_moveObject[num3].type == 48) && m_moveObject[num3].posCurrent.x >= posDecor.x - 64 && m_moveObject[num3].posCurrent.y >= posDecor.y - 64 && m_moveObject[num3].posCurrent.x <= posDecor.x + LXIMAGE && m_moveObject[num3].posCurrent.y <= posDecor.y + LYIMAGE)
+ if ((m_moveObject[num3].type == TYPE_ASCENSEUR ||
+ m_moveObject[num3].type == TYPE_ASCENSEURs ||
+ m_moveObject[num3].type == TYPE_ASCENSEURsi) &&
+ m_moveObject[num3].posCurrent.x >= posDecor.x - DIMOBJX &&
+ m_moveObject[num3].posCurrent.y >= posDecor.y - DIMOBJY &&
+ m_moveObject[num3].posCurrent.x <= posDecor.x + LXIMAGE &&
+ m_moveObject[num3].posCurrent.y <= posDecor.y + LYIMAGE)
{
tinyPoint.x = 0 + m_moveObject[num3].posCurrent.x - posDecor.x;
tinyPoint.y = 0 + m_moveObject[num3].posCurrent.y - posDecor.y;
m_pPixmap->QuickIcon(m_moveObject[num3].channel, m_moveObject[num3].icon, tinyPoint);
}
}
- tinyPoint.x = 0 - posDecor.x % 64;
+ tinyPoint.x = 0 - posDecor.x % DIMOBJX;
for (i = posDecor.x / DIMOBJX; i < posDecor.x / DIMOBJX + LXIMAGE / DIMOBJX + 2; i++)
{
- tinyPoint.y = 0 - posDecor.y % 64;
+ tinyPoint.y = 0 - posDecor.y % DIMOBJY;
for (j = posDecor.y / DIMOBJY; j < posDecor.y / DIMOBJY + LYIMAGE / DIMOBJY + 2; j++)
{
if (i >= 0 && i < MAXCELX && j >= 0 && j < MAXCELY && m_decor[i][j].icon != -1)
@@ -805,7 +811,15 @@ void CDecor::Build(RECT rect)
}
for (i = 0; i < MAXMOVEOBJECT; i++)
{
- if (m_moveObject[i].type != 0 && m_moveObject[i].posCurrent.x >= posDecor.x - 64 && m_moveObject[i].posCurrent.y >= posDecor.y - 64 && m_moveObject[i].posCurrent.x <= posDecor.x + LXIMAGE && m_moveObject[i].posCurrent.y <= posDecor.y + LYIMAGE && ((m_moveObject[i].type >= 8 && m_moveObject[i].type <= 11) || (m_moveObject[i].type >= 90 && m_moveObject[i].type <= 95) || (m_moveObject[i].type >= 98 && m_moveObject[i].type <= 100) || m_moveObject[i].type == 53))
+ if (m_moveObject[i].type != 0 &&
+ m_moveObject[i].posCurrent.x >= posDecor.x - DIMOBJX &&
+ m_moveObject[i].posCurrent.y >= posDecor.y - DIMOBJY &&
+ m_moveObject[i].posCurrent.x <= posDecor.x + LXIMAGE &&
+ m_moveObject[i].posCurrent.y <= posDecor.y + LYIMAGE &&
+ ((m_moveObject[i].type >= TYPE_EXPLO1 && m_moveObject[i].type <= TYPE_EXPLO3) ||
+ (m_moveObject[i].type >= TYPE_EXPLO5 && m_moveObject[i].type <= TYPE_EXPLO10) ||
+ (m_moveObject[i].type >= TYPE_SPLOUTCH1 && m_moveObject[i].type <= TYPE_SPLOUTCH3) ||
+ m_moveObject[i].type == TYPE_TENTACULE))
{
tinyPoint = m_moveObject[i].posCurrent - posDecor;
m_pPixmap->QuickIcon(m_moveObject[i].channel, m_moveObject[i].icon, tinyPoint);
@@ -1056,7 +1070,7 @@ void CDecor::SetJoystickEnable(BOOL bJoystick)
void CDecor::SetDemoPlay(BOOL param)
{
- m_bD814 = param;
+ m_bDemoPlay = param;
}
void CDecor::PlaySound(int sound, POINT pos, BOOL bLocal)
@@ -1354,7 +1368,7 @@ void CDecor::CheatAction(int cheat)
m_blupiHide = FALSE;
m_blupiTimeShield = 100;
m_blupiPosMagic = m_blupiPos;
- m_jauges[1].SetHide(FALSE);
+ m_jauges[JAUGE_POWER].SetHide(FALSE);
break;
case 13: // quicklollipop
m_blupiAction = ACTION_SUCETTE;
@@ -1450,7 +1464,7 @@ void CDecor::CheatAction(int cheat)
}
if (!m_blupiShield && !m_blupiHide && !m_blupiCloud && !m_blupiPower)
{
- m_jauges[1].SetHide(TRUE);
+ m_jauges[JAUGE_POWER].SetHide(TRUE);
}
if (!m_blupiHelico && !m_blupiOver)
{
@@ -1647,13 +1661,13 @@ void CDecor::VoyageStep()
++m_nbVies;
v17.y = y;
v17.x = m_voyageEnd.x;
- m_pSound->PlayImage(3, v17, -1);
+ m_pSound->PlayImage(SOUND_JUMPEND, v17, -1);
}
if (m_voyageIcon == 6 && m_voyageChannel == 10)
{
++m_nbTresor;
CDecor::OpenDoorsTresor();
- m_pSound->PlayImage(3, m_voyageEnd, -1);
+ m_pSound->PlayImage(SOUND_JUMPEND, m_voyageEnd, -1);
}
if (m_voyageIcon == 215 && m_voyageChannel == 10)
{
@@ -1662,47 +1676,47 @@ void CDecor::VoyageStep()
m_blupiCle |= CLE_RED;
v16.y = m_voyageEnd.y;
v16.x = x;
- m_pSound->PlayImage(3, v16, -1);
+ m_pSound->PlayImage(SOUND_JUMPEND, v16, -1);
}
- if (m_voyageIcon == 222 && m_voyageChannel == 10)
+ if (m_voyageIcon == 222 && m_voyageChannel == CHELEMENT)
{
v7 = m_voyageEnd.x;
m_blupiCle |= CLE_GREEN;
v15.y = m_voyageEnd.y;
v15.x = v7;
- m_pSound->PlayImage(3, v15, -1);
+ m_pSound->PlayImage(SOUND_JUMPEND, v15, -1);
}
- if (m_voyageIcon == 229 && m_voyageChannel == 10)
+ if (m_voyageIcon == 229 && m_voyageChannel == CHELEMENT)
{
v8 = m_voyageEnd.y;
m_blupiCle |= CLE_BLUE;
v14.y = v8;
v14.x = m_voyageEnd.x;
- m_pSound->PlayImage(3, v14, -1);
+ m_pSound->PlayImage(SOUND_JUMPEND, v14, -1);
}
- if (m_voyageIcon == GetIconPerso() && m_voyageChannel == 4)
+ if (m_voyageIcon == GetIconPerso() && m_voyageChannel == CHBUTTON)
{
v9 = m_voyageEnd.x;
++m_blupiPerso;
v13.y = m_voyageEnd.y;
v13.x = v9;
- m_pSound->PlayImage(3, v13, -1);
+ m_pSound->PlayImage(SOUND_JUMPEND, v13, -1);
}
- if (m_voyageIcon == 252 && m_voyageChannel == 10)
+ if (m_voyageIcon == 252 && m_voyageChannel == CHELEMENT)
{
v11 = m_voyageEnd.x;
++m_blupiDynamite;
v12.y = m_voyageEnd.y;
v12.x = v11;
- m_pSound->PlayImage(3, v12, -1);
+ m_pSound->PlayImage(SOUND_JUMPEND, v12, -1);
}
- if (m_voyageIcon == 177 && m_voyageChannel == 10)
+ if (m_voyageIcon == 177 && m_voyageChannel == CHELEMENT)
{
- m_pSound->PlayImage(3, m_voyageEnd, -1);
+ m_pSound->PlayImage(SOUND_JUMPEND, m_voyageEnd, -1);
}
m_voyageIcon = -1;
}
- else if (!(m_time % 2) && m_voyageIcon >= 230 && m_voyageIcon <= 241 && m_voyageChannel == 10)
+ else if (!(m_time % 2) && m_voyageIcon >= 230 && m_voyageIcon <= 241 && m_voyageChannel == CHELEMENT)
{
m_voyageIcon = m_voyageIcon + 1;
if (m_voyageIcon + 1 > 241)
@@ -1762,7 +1776,7 @@ void CDecor::VoyageDraw()
}
v11.y = v10 + v8;
v11.x = pos;
- ObjectStart(v11, 93, v9, 1);
+ ObjectStart(v11, TYPE_EXPLO8, v9, TRUE);
}
}
}
@@ -1948,7 +1962,7 @@ void CDecor::OpenDoor(POINT cel)
m_moveObject[num].phase = 0;
m_moveObject[num].channel = CHOBJECT;
m_moveObject[num].icon = icon;
- PlaySound(33, m_moveObject[num].posStart, FALSE);
+ PlaySound(SOUND_DOOR, m_moveObject[num].posStart, FALSE);
}
void CDecor::OpenDoorsWin()
diff --git a/src/decor.h b/src/decor.h
index bc9b266..b0b4fe5 100644
--- a/src/decor.h
+++ b/src/decor.h
@@ -291,7 +291,7 @@ public:
BOOL IsPiege(POINT pos);
BOOL IsGoutte(POINT pos, BOOL bAlways);
BOOL IsScie(POINT pos);
- BOOL IsSwitch(POINT pos, POINT celSwitch);
+ BOOL IsSwitch(POINT pos, POINT *outCelSwitch);
BOOL IsEcraseur(POINT pos);
BOOL IsBlitz(POINT pos, BOOL bAlways);
BOOL IsRessort(POINT pos);
@@ -299,7 +299,7 @@ public:
BOOL IsBridge(POINT pos, POINT *outCelBridge);
int IsDoor(POINT pos, POINT *outCelPorte);
int IsTeleporte(POINT pos);
- BOOL SearchTeleporte(POINT pos, POINT newpos);
+ BOOL SearchTeleporte(POINT pos, POINT *newpos);
BOOL IsSurfWater(POINT pos);
BOOL IsDeepWater(POINT pos);
BOOL IsOutWater(POINT pos);
@@ -561,7 +561,7 @@ protected:
BOOL m_bNetMovePredict; // ynosmooth
BOOL m_bNetDebug; // znetdebug
BOOL m_bJoystick;
- int m_bD814;
+ int m_bDemoPlay;
int m_mission;
BYTE m_doors[200];
int m_nbVies;
diff --git a/src/dectables.h b/src/dectables.h
index e827f30..1d17db5 100644
--- a/src/dectables.h
+++ b/src/dectables.h
@@ -87,22 +87,73 @@ extern int table_creature_right[] = { 247, 248, 249, 250, 251, 250, 249, 248 };
extern int table_creature_turn2[] =
{
- 244, 244, 244, 244, 244, 244, 244, 244, 243, 243,
- 242, 242, 242, 242, 242, 242, 242, 242, 243, 243,
- 244, 244, 245, 245, 246, 246, 246, 246, 246, 246,
- 246, 246, 245, 245, 244, 244, 243, 243, 242, 242,
- 242, 242, 242, 242, 243, 243, 244, 244, 245, 245,
- 246, 246, 246, 246, 246, 246, 245, 245, 244, 244,
- 243, 243, 242, 242, 242, 242, 243, 243, 244, 244,
- 245, 245, 246, 246, 246, 246, 245, 245, 244, 244,
- 243, 243, 242, 242, 243, 243, 244, 244, 245, 245,
- 246, 246, 245, 245, 244, 244, 243, 243, 242, 242,
- 242, 242, 243, 243, 244, 244, 245, 245, 246, 246,
- 246, 246, 245, 245, 244, 244, 243, 243, 242, 242,
- 242, 242, 242, 242, 243, 243, 244, 244, 245, 245,
- 246, 246, 246, 246, 246, 246, 245, 245, 244, 244,
- 244, 244, 244, 244, 244, 244, 244, 244, 244, 244,
- 244, 244
+ 0xF4, 0xF4, 0xF4,
+ 0xF4, 0xF4, 0xF4,
+ 0xF4, 0xF4, 0xF3,
+ 0xF3, 0xF2, 0xF2,
+ 0xF2, 0xF2, 0xF2,
+ 0xF2, 0xF2, 0xF2,
+ 0xF3, 0xF3, 0xF4,
+ 0xF4, 0xF5, 0xF5,
+ 0xF6, 0xF6, 0xF6,
+ 0xF6, 0xF6, 0xF6,
+ 0xF6, 0xF6, 0xF5,
+ 0xF5, 0xF4, 0xF4,
+ 0xF3, 0xF3, 0xF2,
+ 0xF2, 0xF2, 0xF2,
+ 0xF2, 0xF2, 0xF3,
+ 0xF3, 0xF4, 0xF4,
+ 0xF5, 0xF5, 0xF6,
+ 0xF6, 0xF6, 0xF6,
+ 0xF6, 0xF6, 0xF5,
+ 0xF5, 0xF4, 0xF4,
+ 0xF3, 0xF3, 0xF2,
+ 0xF2, 0xF2, 0xF2,
+ 0xF3, 0xF3, 0xF4,
+ 0xF4, 0xF5, 0xF5,
+ 0xF6, 0xF6, 0xF6,
+ 0xF6, 0xF5, 0xF5,
+ 0xF4, 0xF4, 0xF3,
+ 0xF3, 0xF2, 0xF2,
+ 0xF3, 0xF3, 0xF4,
+ 0xF4, 0xF5, 0xF5,
+ 0xF6, 0xF6, 0xF5,
+ 0xF5, 0xF4, 0xF4,
+ 0xF3, 0xF3, 0xF2,
+ 0xF2, 0xF3, 0xF3,
+ 0xF4, 0xF4, 0xF5,
+ 0xF5, 0xF6, 0xF6,
+ 0xF5, 0xF5, 0xF4,
+ 0xF4, 0xF4, 0xF4,
+ 0xF7, 0xF7, 0xF8,
+ 0xF8, 0xF9, 0xF9,
+ 0xFA, 0xFA, 0xFB,
+ 0xFB, 0xFA, 0xFA,
+ 0xF9, 0xF9, 0xF8,
+ 0xF8, 0xF2, 0xF2,
+ 0xF3, 0xF3, 0xF4,
+ 0xF4, 0xF5, 0xF5,
+ 0xF6, 0xF6, 0xF5,
+ 0xF5, 0xF4, 0xF4,
+ 0xF3, 0xF3, 0xF2,
+ 0xF2, 0xF2, 0xF2,
+ 0xF3, 0xF3, 0xF4,
+ 0xF4, 0xF5, 0xF5,
+ 0xF6, 0xF6, 0xF6,
+ 0xF6, 0xF5, 0xF5,
+ 0xF4, 0xF4, 0xF3,
+ 0xF3, 0xF2, 0xF2,
+ 0xF2, 0xF2, 0xF2,
+ 0xF2, 0xF3, 0xF3,
+ 0xF4, 0xF4, 0xF5,
+ 0xF5, 0xF6, 0xF6,
+ 0xF6, 0xF6, 0xF6,
+ 0xF6, 0xF5, 0xF5,
+ 0xF4, 0xF4, 0xF4,
+ 0xF4, 0xF4, 0xF4,
+ 0xF4, 0xF4, 0xF4,
+ 0xF4, 0xF4, 0xF4,
+ 0xF4, 0xF4
};
extern int table_blupih_left[] = { 66, 67, 68, 67, 66, 69, 70, 69 };
@@ -499,7 +550,7 @@ extern int table_decor_ventb[] = { 122, 123, 124, 125 };
extern int table_marine[] =
{
- 0, 2, 5, 8, 3, 0
+ 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xcf, 0xce, 0xcd, 0xcc, 0xcb
};
extern int table_36418[] = { 10, 2, 3, 4, 5, 6, 7, 8, 9, 1, 11, 12, 13, 14 };
diff --git a/src/def.h b/src/def.h
index 95c2d1b..1436084 100644
--- a/src/def.h
+++ b/src/def.h
@@ -5,6 +5,7 @@
#define DEF_H
#include
+#include // ceil
// prevent WinAPI from overriding our functions
#undef PlaySound
@@ -73,6 +74,8 @@
#define DIMDECORX 640
#define DIMDECORY 480
+#define TRAJBYTEX ceil(MAXCELX / 8.0) // bytes to store one row of traj data
+
enum {
CHBACK = 0,
CHOBJECT,
@@ -367,6 +370,7 @@ static char debugMobTypeNames[204][20] =
#define TYPE_INVERT 40
#define TYPE_INVERTSTART 41
#define TYPE_INVERTSTOP 42
+#define TYPE_INVERTSPIN 43
#define TYPE_GUEPE 44 // wasp
#define TYPE_OVER 46 // hovercraft
#define TYPE_ASCENSEURs 47 // conveyor belt right
@@ -1357,32 +1361,32 @@ POINT operator/(POINT p, const int& a)
return POINT( p.x / a, p.y / a );
}
-POINT operator+=(POINT p, const POINT& a)
+POINT& operator+=(POINT& p, const POINT& a)
{
return POINT( p.x += a.x, p.y += a.y );
}
-POINT operator-=(POINT p, const POINT& a)
+POINT& operator-=(POINT& p, const POINT& a)
{
return POINT( p.x -= a.x, p.y -= a.y );
}
-POINT operator*=(POINT p, const POINT& a)
+POINT& operator*=(POINT& p, const POINT& a)
{
return POINT( p.x *= a.x, p.y *= a.y );
}
-POINT operator/=(POINT p, const POINT& a)
+POINT& operator/=(POINT& p, const POINT& a)
{
return POINT( p.x /= a.x, p.y /= a.y );
}
-POINT operator*=(POINT p, const int& a)
+POINT& operator*=(POINT& p, const int& a)
{
return POINT( p.x *= a, p.y *= a );
}
-POINT operator/=(POINT p, const int& a)
+POINT& operator/=(POINT& p, const int& a)
{
return POINT( p.x /= a, p.y /= a );
}
diff --git a/src/event.cpp b/src/event.cpp
index 07e2163..53a76fb 100644
--- a/src/event.cpp
+++ b/src/event.cpp
@@ -2300,7 +2300,7 @@ void CEvent::ChatPush(char *str)
pText = this->m_chatZone[i];
LABEL_5:
strcpy(pText, str);
- m_pSound->PlayImage(11, POINT( LXIMAGE / 2, LYIMAGE / 2 ), -1);
+ m_pSound->PlayImage(SOUND_TRESOR, POINT( LXIMAGE / 2, LYIMAGE / 2 ), -1);
}
void CEvent::ChatFlush()
@@ -5305,7 +5305,7 @@ void CEvent::DemoRecEvent()
if (m_bDemoRec)
{
m_pDemoBuffer[m_demoIndex].time = m_demoTime;
- m_pDemoBuffer[m_demoIndex].input == m_keyPress;
+ m_pDemoBuffer[m_demoIndex].input = m_keyPress;
m_demoIndex++;
if (m_demoIndex > MAXDEMO)
{