1
0
mirror of https://github.com/jummy0/sb2-decomp synced 2025-03-15 04:24:48 +01:00

IT COMPILED

clap emoji clap emoji clap emoji clap emoji clap emoji clap emoji clap emoji clap emoji clap emoji clap emoji clap emoji clap emoji clap emoji clap emoji clap emoji clap emoji clap emoji clap emoji clap emoji clap emoji clap emoji clap emoji clap emoji clap emoji clap emoji clap emoji clap emoji
This commit is contained in:
jummy 2024-09-07 14:32:38 -05:00
parent 19a0234c74
commit 69f38d3524
6 changed files with 195 additions and 616 deletions

View File

@ -30,27 +30,27 @@
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries> <UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140_xp</PlatformToolset> <PlatformToolset>v140_xp</PlatformToolset>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>NotSet</CharacterSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140_xp</PlatformToolset> <PlatformToolset>v140_xp</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>NotSet</CharacterSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries> <UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140_xp</PlatformToolset> <PlatformToolset>v140_xp</PlatformToolset>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>NotSet</CharacterSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140_xp</PlatformToolset> <PlatformToolset>v140_xp</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>NotSet</CharacterSet>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings"> <ImportGroup Label="ExtensionSettings">
@ -87,6 +87,9 @@
<AdditionalLibraryDirectories>dxsdk3\sdk\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> <AdditionalLibraryDirectories>dxsdk3\sdk\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<TreatLinkerWarningAsErrors>false</TreatLinkerWarningAsErrors> <TreatLinkerWarningAsErrors>false</TreatLinkerWarningAsErrors>
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<LinkTimeCodeGeneration>UseFastLinkTimeCodeGeneration</LinkTimeCodeGeneration>
<OptimizeReferences>true</OptimizeReferences>
<ForceFileOutput>UndefinedSymbolOnly</ForceFileOutput>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@ -101,11 +104,12 @@
<UndefinePreprocessorDefinitions>UNICODE;_UNICODE</UndefinePreprocessorDefinitions> <UndefinePreprocessorDefinitions>UNICODE;_UNICODE</UndefinePreprocessorDefinitions>
</ClCompile> </ClCompile>
<Link> <Link>
<SubSystem>Console</SubSystem> <SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding> <EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences> <OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>dxsdk3\sdk\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> <AdditionalLibraryDirectories>dxsdk3\sdk\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ForceFileOutput>UndefinedSymbolOnly</ForceFileOutput>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
@ -118,9 +122,12 @@
<UndefinePreprocessorDefinitions>UNICODE;_UNICODE</UndefinePreprocessorDefinitions> <UndefinePreprocessorDefinitions>UNICODE;_UNICODE</UndefinePreprocessorDefinitions>
</ClCompile> </ClCompile>
<Link> <Link>
<SubSystem>Console</SubSystem> <SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>dxsdk3\sdk\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> <AdditionalLibraryDirectories>dxsdk3\sdk\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<LinkTimeCodeGeneration>UseFastLinkTimeCodeGeneration</LinkTimeCodeGeneration>
<OptimizeReferences>true</OptimizeReferences>
<ForceFileOutput>UndefinedSymbolOnly</ForceFileOutput>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
@ -135,11 +142,12 @@
<UndefinePreprocessorDefinitions>UNICODE;_UNICODE</UndefinePreprocessorDefinitions> <UndefinePreprocessorDefinitions>UNICODE;_UNICODE</UndefinePreprocessorDefinitions>
</ClCompile> </ClCompile>
<Link> <Link>
<SubSystem>Console</SubSystem> <SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding> <EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences> <OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>dxsdk3\sdk\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> <AdditionalLibraryDirectories>dxsdk3\sdk\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ForceFileOutput>UndefinedSymbolOnly</ForceFileOutput>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemGroup> <ItemGroup>

View File

@ -370,6 +370,7 @@ void CDecor::PlaceItemFromMenu6(POINT cel, int index, BYTE flags, int currentIco
case 10: // Moving bomb case 10: // Moving bomb
case 11: // Heliported ennemy case 11: // Heliported ennemy
case 12: // Motorized ennemy case 12: // Motorized ennemy
break;
} }
} }
@ -604,6 +605,7 @@ void CDecor::PlaceItemFromMenu8(POINT cel, int index, BYTE flags, int currentIco
case 7: // Fragile bridge case 7: // Fragile bridge
case 8: // Wooden case case 8: // Wooden case
case 9: // Secret wooden case case 9: // Secret wooden case
break;
} }
} }
@ -621,6 +623,7 @@ void CDecor::PlaceItemFromMenu9(POINT cel, int index, BYTE flags, int currentIco
case 2: // Skateboard case 2: // Skateboard
case 3: // Jeep case 3: // Jeep
case 4: // Glue tank case 4: // Glue tank
break;
} }
} }
@ -641,6 +644,7 @@ void CDecor::PlaceItemFromMenu10(POINT cel, int index, BYTE flags, int currentIc
case 5: // Door case 5: // Door
case 6: // Level start case 6: // Level start
case 7: // Key case 7: // Key
break;
} }
} }

View File

@ -145,13 +145,13 @@ void CDecor::MoveObjectBlup(POINT pos)
POINT tinyPoint = pos; POINT tinyPoint = pos;
while (tinyPoint.y > 0) while (tinyPoint.y > 0)
{ {
int icon = m_decor[(tinyPoint.x + 16) / 64, tinyPoint.y / 64].icon; int icon = m_decor[(tinyPoint.x + 16) / DIMOBJX][tinyPoint.y / DIMOBJY].icon;
if (icon != 91 && icon != 92) if (icon != 91 && icon != 92)
{ {
break; break;
} }
num++; num++;
tinyPoint.y -= 64; tinyPoint.y -= DIMOBJY;
} }
num--; num--;
if (num <= 0) if (num <= 0)
@ -169,7 +169,7 @@ void CDecor::MoveObjectBlup(POINT pos)
m_moveObject[num2].posCurrent.y = pos.y; m_moveObject[num2].posCurrent.y = pos.y;
m_moveObject[num2].posStart = m_moveObject[num2].posCurrent; m_moveObject[num2].posStart = m_moveObject[num2].posCurrent;
m_moveObject[num2].posEnd.x = pos.x; m_moveObject[num2].posEnd.x = pos.x;
m_moveObject[num2].posEnd.y = pos.y - num * 64; m_moveObject[num2].posEnd.y = pos.y - num * DIMOBJY;
m_moveObject[num2].timeStopStart = 0; m_moveObject[num2].timeStopStart = 0;
m_moveObject[num2].stepAdvance = num * 10; m_moveObject[num2].stepAdvance = num * 10;
m_moveObject[num2].step = 2; m_moveObject[num2].step = 2;
@ -200,12 +200,9 @@ void CDecor::SetBalleTraj(POINT pos)
BOOL CDecor::IsBalleTraj(POINT pos) BOOL CDecor::IsBalleTraj(POINT pos)
{ {
pos.x = (pos.x + 32) / 64; pos.x = (pos.x + DIMOBJX / 2) / DIMOBJX;
pos.y = (pos.y + 32) / 64; pos.y = (pos.y + DIMOBJY / 2) / DIMOBJY;
if (pos.x < 0 || pos.x >= 100 || pos.y < 0 || pos.y >= 100) if (!IsValidCel(pos)) return FALSE;
{
return FALSE;
}
int num = pos.y * 13; int num = pos.y * 13;
num += pos.x / 8; num += pos.x / 8;
int num2 = pos.x & 7; int num2 = pos.x & 7;
@ -309,19 +306,24 @@ void CDecor::StartSploutchGlu(POINT pos)
PlaySound(51, pos); PlaySound(51, pos);
} }
int CDecor::ObjectStart(POINT pos, int type, int speed) BOOL CDecor::ObjectStart(POINT pos, int type, int speed)
{
return ObjectStart(pos, type, speed, FALSE);
}
BOOL CDecor::ObjectStart(POINT pos, int type, int speed, BOOL bMulti)
{ {
int num = MoveObjectFree(); int num = MoveObjectFree();
if (num == -1) if (num == -1)
{ {
return -1; return FALSE;
} }
m_moveObject[num].type = type; m_moveObject[num].type = type;
m_moveObject[num].phase = 0; m_moveObject[num].phase = 0;
m_moveObject[num].posCurrent = pos; m_moveObject[num].posCurrent = pos;
m_moveObject[num].posStart = pos; m_moveObject[num].posStart = pos;
m_moveObject[num].posEnd = pos; m_moveObject[num].posEnd = pos;
MoveObjectStopIcon(num); MoveObjectStepIcon(num);
if (speed != 0) if (speed != 0)
{ {
POINT tinyPoint = pos; POINT tinyPoint = pos;
@ -363,10 +365,10 @@ int CDecor::ObjectStart(POINT pos, int type, int speed)
} }
if (num3 == 0) if (num3 == 0)
{ {
if (type == 23) if (type == TYPE_BALLE)
{ {
m_moveObject[num].type = 0; m_moveObject[num].type = 0;
return num; return TRUE;
} }
} }
else else
@ -374,12 +376,22 @@ int CDecor::ObjectStart(POINT pos, int type, int speed)
m_moveObject[num].posEnd = tinyPoint; m_moveObject[num].posEnd = tinyPoint;
m_moveObject[num].timeStopStart = 0; m_moveObject[num].timeStopStart = 0;
m_moveObject[num].stepAdvance = abs(num2 * num3 / 64); m_moveObject[num].stepAdvance = abs(num2 * num3 / 64);
m_moveObject[num].step = 2; m_moveObject[num].step = STEP_ADVANCE;
m_moveObject[num].time = 0; m_moveObject[num].time = 0;
} }
} }
MoveObjectPriority(num); MoveObjectPriority(num);
return num; if (bMulti)
{
NetMessage msg;
msg.data1 = speed;
msg.type = MESS_OBJECTSTART;
msg.x = pos.x;
msg.y = pos.y;
msg.channel = type;
NetMessagePush(&msg);
}
return TRUE;
} }
BOOL CDecor::ObjectDelete(POINT pos, int type) BOOL CDecor::ObjectDelete(POINT pos, int type)
@ -420,8 +432,7 @@ BOOL CDecor::ObjectDelete(POINT pos, int type)
void CDecor::MoveObjectStep() void CDecor::MoveObjectStep()
{ {
m_blupiVector.x = 0; m_blupiVector = { 0, 0 };
m_blupiVector.y = 0;
m_blupiTransport = -1; m_blupiTransport = -1;
for (int i = 0; i < MAXMOVEOBJECT; i++) for (int i = 0; i < MAXMOVEOBJECT; i++)
{ {
@ -429,34 +440,36 @@ void CDecor::MoveObjectStep()
{ {
MoveObjectStepLine(i); MoveObjectStepLine(i);
MoveObjectStepIcon(i); MoveObjectStepIcon(i);
if (m_moveObject[i].type == 4 || if (m_moveObject[i].type == TYPE_BULLDOZER ||
m_moveObject[i].type == 33 || m_moveObject[i].type == TYPE_BLUPITANK ||
m_moveObject[i].type == 32) m_moveObject[i].type == TYPE_BLUPIHELICO)
{
int num = MovePersoDetect(m_moveObject[i].posCurrent); int num = MovePersoDetect(m_moveObject[i].posCurrent);
if (num != -1) if (num != -1)
{ {
POINT posCurrent = m_moveObject[i].posCurrent; POINT posCurrent = m_moveObject[i].posCurrent;
posCurrent.x -= 34; posCurrent.x -= 34;
posCurrent.y -= 34; posCurrent.y -= 34;
ObjectStart(posCurrent, 8, 0); ObjectStart(posCurrent, TYPE_EXPLO1, 0, TRUE);
PlaySound(10, m_moveObject[i].posCurrent); PlaySound(10, m_moveObject[i].posCurrent);
m_decorAction = 1; m_decorAction = 1;
m_decorPhase = 0; m_decorPhase = 0;
posCurrent = m_moveObject[i].posCurrent; posCurrent = m_moveObject[i].posCurrent;
posCurrent.x += 2; posCurrent.x += 2;
posCurrent.y += BLUPIOFFY; posCurrent.y += BLUPIOFFY;
ObjectDelete(m_moveObject[i].posCurrent, m_moveObject[i].type); ObjectDelete(m_moveObject[i].posCurrent, m_moveObject[i].type);
ObjectStart(posCurrent, 37, 0); ObjectStart(posCurrent, 37, 0);
ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type); ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type);
} }
if (BlupiElectro(m_moveObject[i].posCurrent)) if (BlupiElectro(m_moveObject[i].posCurrent))
{ {
POINT posCurrent = m_moveObject[i].posCurrent; POINT posCurrent = m_moveObject[i].posCurrent;
posCurrent.x += 2; posCurrent.x += 2;
posCurrent.y += BLUPIOFFY; posCurrent.y += BLUPIOFFY;
ObjectDelete(m_moveObject[i].posCurrent, m_moveObject[i].type); ObjectDelete(m_moveObject[i].posCurrent, m_moveObject[i].type);
ObjectStart(posCurrent, 38, 55); ObjectStart(posCurrent, 38, 55);
PlaySound(59, posCurrent); PlaySound(59, posCurrent);
}
} }
} }
} }
@ -542,7 +555,7 @@ void CDecor::MoveObjectStepLine(int i)
{ {
if (m_moveObject[i].posCurrent.x != m_moveObject[i].posEnd.x || m_moveObject[i].posCurrent.x != m_moveObject[i].posEnd.y) if (m_moveObject[i].posCurrent.x != m_moveObject[i].posEnd.x || m_moveObject[i].posCurrent.x != m_moveObject[i].posEnd.y)
{ {
m_moveObject[i].time = moveOm_moveObjectbject2[i].time + 1; m_moveObject[i].time ++;
if (m_moveObject[i].stepAdvance != 0) if (m_moveObject[i].stepAdvance != 0)
{ {
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.x = (m_moveObject[i].posEnd.x - m_moveObject[i].posStart.x) * m_moveObject[i].time / m_moveObject[i].stepAdvance + m_moveObject[i].posStart.x;
@ -571,7 +584,7 @@ void CDecor::MoveObjectStepLine(int i)
{ {
if (m_moveObject[i].time < m_moveObject[i].timeStopEnd) if (m_moveObject[i].time < m_moveObject[i].timeStopEnd)
{ {
m_moveObject[i].time = moveObject3[i].time + 1; m_moveObject[i].time ++;
} }
else else
{ {
@ -583,7 +596,7 @@ void CDecor::MoveObjectStepLine(int i)
{ {
if (m_moveObject[i].posCurrent.x != m_moveObject[i].posStart.x || m_moveObject[i].posCurrent.y != m_moveObject[i].posStart.y) if (m_moveObject[i].posCurrent.x != m_moveObject[i].posStart.x || m_moveObject[i].posCurrent.y != m_moveObject[i].posStart.y)
{ {
m_moveObject[i].time = moveObject4[i].time + 1; m_moveObject[i].time ++;
if (m_moveObject[i].stepRecede != 0) if (m_moveObject[i].stepRecede != 0)
{ {
m_moveObject[i].posCurrent.x = (m_moveObject[i].posStart.x - m_moveObject[i].posEnd.x) * m_moveObject[i].posCurrent.x = (m_moveObject[i].posStart.x - m_moveObject[i].posEnd.x) *
@ -836,7 +849,7 @@ void CDecor::MoveObjectStepIcon(int i)
} }
if (m_moveObject[i].type == 8) if (m_moveObject[i].type == 8)
{ {
if (m_moveObject[i].phase >= table_explo1->length) if (m_moveObject[i].phase >= table_explo1[0])
{ {
m_moveObject[i].type = 0; m_moveObject[i].type = 0;
} }
@ -978,7 +991,6 @@ void CDecor::MoveObjectStepIcon(int i)
m_moveObject[i].channel = 9; m_moveObject[i].channel = 9;
} }
} }
TinyPoint pos;
if (m_moveObject[i].type == 52) if (m_moveObject[i].type == 52)
{ {
if (m_moveObject[i].phase == 0) if (m_moveObject[i].phase == 0)
@ -1479,8 +1491,7 @@ void CDecor::MoveObjectStepIcon(int i)
m_moveObject[i].icon = 178; m_moveObject[i].icon = 178;
m_moveObject[i].channel = 10; m_moveObject[i].channel = 10;
} }
MoveObject[] moveObject = m_moveObject; m_moveObject[i].phase ++;
moveObject[i].phase = moveObject[i].phase + 1;
if (m_moveObject[i].phase > 32700) if (m_moveObject[i].phase > 32700)
{ {
m_moveObject[i].phase = 0; m_moveObject[i].phase = 0;
@ -1514,7 +1525,7 @@ void CDecor::DynamiteStart(int i, int dx, int dy)
{ {
if (tinyPoint.x >= 0 && tinyPoint.x < 100 && tinyPoint.y >= 0 && tinyPoint.y < 100) if (tinyPoint.x >= 0 && tinyPoint.x < 100 && tinyPoint.y >= 0 && tinyPoint.y < 100)
{ {
int icon = m_decor[tinyPoint.x, tinyPoint.y].icon; int icon = m_decor[tinyPoint.x][tinyPoint.y].icon;
if (icon == 378 || icon == 379 || icon == 404 || icon == 410) if (icon == 378 || icon == 379 || icon == 404 || icon == 410)
{ {
POINT pos; POINT pos;
@ -1553,11 +1564,10 @@ void CDecor::DynamiteStart(int i, int dx, int dy)
int icon2 = m_moveObject[m_linkCaisse[l]].icon; int icon2 = m_moveObject[m_linkCaisse[l]].icon;
POINT posCurrent = m_moveObject[m_linkCaisse[l]].posCurrent; POINT posCurrent = m_moveObject[m_linkCaisse[l]].posCurrent;
double num = (double)Random(7, 23); double num = (double)Random(7, 23);
if (m_random->next(0, 100) % 2 == 0) if (rand() % 2 == 0)
{ {
num = -num; num = -num;
} }
ByeByeAdd(channel, icon2, posCurrent, num, 1.0);
m_moveObject[m_linkCaisse[l]].type = 0; m_moveObject[m_linkCaisse[l]].type = 0;
} }
ObjectDelete(m_moveObject[i].posCurrent, m_moveObject[i].type); ObjectDelete(m_moveObject[i].posCurrent, m_moveObject[i].type);
@ -1636,29 +1646,30 @@ int CDecor::AscenseurDetect(RECT rect, POINT oldpos, POINT newpos)
void CDecor::AscenseurVertigo(int i, BOOL* pbVertigoLeft, BOOL* pbVertigoRight) void CDecor::AscenseurVertigo(int i, BOOL* pbVertigoLeft, BOOL* pbVertigoRight)
{ {
pbVertigoLeft = FALSE; *pbVertigoLeft = FALSE;
pbVertigoRight = FALSE;
*pbVertigoRight = FALSE;
if (m_blupiPos.x + 20 + 4 < m_moveObject[i].posCurrent.x) if (m_blupiPos.x + 20 + 4 < m_moveObject[i].posCurrent.x)
{ {
pbVertigoLeft = TRUE; *pbVertigoLeft = TRUE;
} }
if (m_blupiPos.x + 60 - 20 - 4 > m_moveObject[i].posCurrent.x + 64) if (m_blupiPos.x + 60 - 20 - 4 > m_moveObject[i].posCurrent.x + 64)
{ {
pbVertigoRight = TRUE; *pbVertigoRight = TRUE;
} }
if (AscenseurShift(i)) if (AscenseurShift(i))
{ {
if (pbVertigoLeft) if (*pbVertigoLeft)
{ {
pbVertigoLeft = FALSE; *pbVertigoLeft = FALSE;
pbVertigoRight = TRUE; *pbVertigoRight = TRUE;
m_blupiTimeNoAsc = 10; m_blupiTimeNoAsc = 10;
return; return;
} }
if (pbVertigoRight) if (*pbVertigoRight)
{ {
pbVertigoRight = FALSE; *pbVertigoRight = FALSE;
pbVertigoLeft = TRUE; *pbVertigoLeft = TRUE;
m_blupiTimeNoAsc = 10; m_blupiTimeNoAsc = 10;
} }
} }
@ -1722,14 +1733,15 @@ BOOL CDecor::TestPushCaisse(int i, POINT pos, BOOL bPop)
BOOL CDecor::TestPushOneCaisse(int i, POINT move, int b) BOOL CDecor::TestPushOneCaisse(int i, POINT move, int b)
{ {
// TODO
return FALSE;
} }
void CDecor::SearchLinkCaisse(int rank, BOOL bPop) void CDecor::SearchLinkCaisse(int rank, BOOL bPop)
{ {
m_nbLinkCaisse = 0; m_nbLinkCaisse = 0;
AddLinkCaisse(rank); AddLinkCaisse(rank);
POINT posCurrent = m_moveObject; POINT posCurrent = m_moveObject[rank].posCurrent;
BOOL flag; BOOL flag;
do do
@ -1740,15 +1752,15 @@ void CDecor::SearchLinkCaisse(int rank, BOOL bPop)
int num = m_linkCaisse[i]; int num = m_linkCaisse[i];
if (m_moveObject[num].posCurrent.y <= if (m_moveObject[num].posCurrent.y <=
posCurrent.y && (!bPop || (m_moveObject posCurrent.y && (!bPop || (m_moveObject
[num].posCurrent.x >= posCurrent.x - 32 && [num].posCurrent.x >= posCurrent.x - DIMOBJX / 2 &&
m_moveObject[num].posCurrent.x <= m_moveObject[num].posCurrent.x <=
posCurrent.x + 32))) posCurrent.x + DIMOBJX / 2)))
{ {
RECT src; RECT src;
src.left = m_moveObject[num].posCurrent.x - 1; src.left = m_moveObject[num].posCurrent.x - 1;
src.top = m_moveObject[num].posCurrent.y - 1; src.top = m_moveObject[num].posCurrent.y - 1;
src.right = src.left + 64 + 1; src.right = src.left + DIMOBJX + 1;
src.bottom = src.top + 64 + 1; src.bottom = src.top + DIMOBJY + 1;
for (int j = 0; j < m_nbRankCaisse; j++) for (int j = 0; j < m_nbRankCaisse; j++)
{ {
int num2 = m_rankCaisse[j]; int num2 = m_rankCaisse[j];
@ -1845,9 +1857,9 @@ int CDecor::MockeryDetect(POINT pos)
POINT tinyPoint; POINT tinyPoint;
tinyPoint.x = pos.x + 30; tinyPoint.x = pos.x + 30;
tinyPoint.y = pos.y + 30 + 64; tinyPoint.y = pos.y + 30 + 64;
if (tinyPoint.x >= 0 && tinyPoint.x < 6400 && tinyPoint.y >= 0 && tinyPoint.y < 6400) if (tinyPoint.x >= 0 && tinyPoint.x < DIMOBJX*MAXCELX && tinyPoint.y >= 0 && tinyPoint.y < DIMOBJY*MAXCELY)
{ {
int icon = m_decor[tinyPoint.x / 64, tinyPoint.y / 64].icon; int icon = m_decor[tinyPoint.x / DIMOBJX][tinyPoint.y / DIMOBJY].icon;
if (icon == 68 || icon == 317) if (icon == 68 || icon == 317)
{ {
return 64; return 64;
@ -1992,9 +2004,10 @@ int CDecor::MoveObjectDetect(POINT pos, BOOL* pbNear)
m_moveObject[i].type != 12) m_moveObject[i].type != 12)
{ {
RECT src3; RECT src3;
// TODO
} }
} }
return -1;
} }
int CDecor::MoveAscenseurDetect(POINT pos, int height) int CDecor::MoveAscenseurDetect(POINT pos, int height)
@ -2081,7 +2094,8 @@ int CDecor::MovePersoDetect(POINT pos)
int CDecor::MoveBalleDetect(POINT pos) int CDecor::MoveBalleDetect(POINT pos)
{ {
// TODO
return -1;
} }
int CDecor::MoveObjectDelete(POINT cel) int CDecor::MoveObjectDelete(POINT cel)
@ -2134,7 +2148,7 @@ int CDecor::SortGetType(int type)
void CDecor::MoveObjectSort() void CDecor::MoveObjectSort()
{ {
MoveObject src = default(MoveObject); MoveObject src;
int num = 0; int num = 0;
for (int i = 0; i < MAXMOVEOBJECT; i++) for (int i = 0; i < MAXMOVEOBJECT; i++)
{ {

View File

@ -27,6 +27,11 @@ inline BOOL IsValidCel(POINT cel)
return cel.x >= 0 && cel.x < MAXCELX && cel.y >= 0 && cel.y < MAXCELY; return cel.x >= 0 && cel.x < MAXCELX && cel.y >= 0 && cel.y < MAXCELY;
} }
inline void MoveObjectCopy(MoveObject src, MoveObject dest)
{
memcpy(&dest, &src, sizeof(dest));
}
inline void CDecor::StopVehicleSound() inline void CDecor::StopVehicleSound()
{ {
StopSound(SOUND_HELICOHIGH); StopSound(SOUND_HELICOHIGH);

View File

@ -213,10 +213,11 @@ public:
int SearchDistRight(POINT pos, POINT dir, int type); int SearchDistRight(POINT pos, POINT dir, int type);
void StartSploutchGlu(POINT pos); void StartSploutchGlu(POINT pos);
BOOL ObjectStart(POINT pos, int type, int speed); BOOL ObjectStart(POINT pos, int type, int speed);
BOOL ObjectStart(POINT pos, int type, int speed, BOOL bMulti);
BOOL ObjectDelete(POINT pos, int type); BOOL ObjectDelete(POINT pos, int type);
void MoveObjectStep(); void MoveObjectStep();
void MoveObjectStepLine(int i); void MoveObjectStepLine(int i);
void* MoveObjectStepIcon(int i); void MoveObjectStepIcon(int i);
void DynamiteStart(int i, int dx, int dy); void DynamiteStart(int i, int dx, int dy);
int AscenseurDetect(RECT rect, POINT oldpos, POINT newpos); int AscenseurDetect(RECT rect, POINT oldpos, POINT newpos);
void AscenseurVertigo(int i, BOOL *pbVertigoLeft, BOOL *pbVertigoRight); void AscenseurVertigo(int i, BOOL *pbVertigoLeft, BOOL *pbVertigoRight);
@ -430,4 +431,5 @@ protected:
POINT GetCel(int x, int y); POINT GetCel(int x, int y);
POINT GetCel(POINT cel, int x, int y); POINT GetCel(POINT cel, int x, int y);
inline BOOL IsValidCel(POINT cel); inline BOOL IsValidCel(POINT cel);
inline void MoveObjectCopy(MoveObject src, MoveObject dest);
POINT GetVector(int direct); POINT GetVector(int direct);

View File

@ -266,536 +266,52 @@ extern int table_cle[12]
extern int table_cle1[12] extern int table_cle1[12]
{ {
209, 210, 211, 212, 213, 214, 215, 214, 213, 212, 209, 210, 211, 212, 213, 214, 215, 214, 213, 212, 211, 210
211, 210
}; };
extern int table_cle2[12] extern int table_cle2[12]
{ {
220, 221, 222, 221, 220, 219, 218, 217, 216, 217, 220, 221, 222, 221, 220, 219, 218, 217, 216, 217, 218, 219
218, 219 };
extern int table_cle3[12]
{
229, 228, 227, 226, 225, 224, 223, 224, 225, 226, 227, 228
}; };
extern int table_decor_action[] extern int table_decor_action[]
{ {
1, 1,32,
32, -4,4, 4,-3, -4,2, 4,5, -4,-1, 4,2, -4,-4, 4,-3, -3,2, 3,2,
-4, -3,-5, 3,4, -3,5, 3,-2, -3,5, 3,4, -2,-2, 2,4, -2,-2, 2,-2,
4, -2,-4, 2,2, -2,-2, 2,-3, -1,-3, 1,-2, -1,-1, 1,2, -1,-2, 1,-1,
4, -1,1, 1,2,
-3, 2,32,
-4, -4,0, 4,0, -4,0, 4,0, -4,0, 4,0, -4,0, 4,0, -3,0, 3,0,
2, -3,0, 3,0, -3,0, 3,0, -3,0, 3,0, -2,0, 2,0, -2,0, 2,0,
4, -2,0, 2,0, -2,0, 2,0, -1,0, 1,0, -1,0, 1,0, -1,0, 1,0,
5, -1,0, 1,0,
-4, 5,192,
-1, 0,-32, 0,32, 0,-16, 0,6, 0,-8, 0,8, 0,-4, 0,4, 0,-2, 0,2,
4, -7,0, -6,0, -5,0, -4,0, -2,0, 0,0, 2,0, 4,0, 5,0,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-7,
0,
-6,
0,
-5,
0,
-4,
0,
-2,
0,
0,
0,
2,
0,
4,
0,
5,
0,
6,
0,
7,
0,
7,
0,
6,
0,
5,
0,
4,
0,
2,
0,
0,
0,
-2,
0,
-4,
0,
-5,
0,
-6,
0,
-7,
0,
-7,
0,
-6,
0,
-5,
0,
-4,
0,
-2,
0,
0,
0,
2,
0,
4,
0,
5,
0,
6,
0,
7,
0,
7,
0,
6,
0,
5,
0,
4,
0,
2,
0,
0,
0,
-2,
0,
-4,
0,
-5,
0,
-6,
0,
-7,
0,
-7,
0,
-6,
0,
-5,
0,
-4,
0,
-2,
0,
0,
0,
2,
0,
4,
0,
5,
0,
6,
0,
7,
0,
7,
0,
6,
0,
5,
0,
4,
0,
2,
0,
0,
0,
-2,
0,
-4,
0,
-5,
0,
-6,
0,
-7,
0,
-7,
0,
-6,
0,
-5,
0,
-4,
0,
-2,
0,
-1,
0,
0 0
}; };
@ -938,8 +454,6 @@ extern int table_tresortrack[]
166 166
}; };
extern int table_decor_lave[]{ 8, 68, 69, 70, 71, 72, 71, 70, 69 };
extern int table_decor_piege1[] extern int table_decor_piege1[]
{ {
16, 16,
@ -974,7 +488,7 @@ extern int table_decor_eau1[]{ 6, 92, 93, 94, 95, 94, 93 };
extern int table_decor_eau2[]{ 6, 91, 96, 97, 98, 97, 96 }; extern int table_decor_eau2[]{ 6, 91, 96, 97, 98, 97, 96 };
extern int table_decor_ventillog[]{ 3, 126, 127, 128 };
extern int table_decor_ventillod[]{ 3, 129, 130, 131 }; extern int table_decor_ventillod[]{ 3, 129, 130, 131 };
@ -982,7 +496,7 @@ extern int table_decor_ventilloh[]{ 3, 132, 133, 134 };
extern int table_decor_ventillob[]{ 3, 135, 136, 137 }; extern int table_decor_ventillob[]{ 3, 135, 136, 137 };
extern int table_decor_ventg[]{ 4, 110, 111, 112, 113 };
extern int table_decor_ventd[]{ 4, 114, 115, 116, 117 }; extern int table_decor_ventd[]{ 4, 114, 115, 116, 117 };
@ -992,14 +506,46 @@ extern int table_decor_ventb[]{ 4, 122, 123, 124, 125 };
extern int table_marine[] extern int table_marine[]
{ {
0, 0, 2, 5, 8, 3, 0
2,
5,
8,
3,
0
}; };
extern int table_36418[]{ 14, 10, 2, 3, 4, 5, 6, 7, 8, 9, 1, 11, 12, 13, 14 };
extern int table_36458[]{ 10, 19, 20, 21, 23, 24, 25, 26, 27, 28, 29 };
extern int table_36488[]{ 4, 15, 16, 17, 18 };
extern int table_364a0[]{ 2, 73, 22 };
extern int table_364b0[]{ 7, 78, 79, 80, 81, 82, 83, 84 };
extern int table_364d0[]{ 4, 87, 88, 89, 90 };
extern int table_364e8[]{ 2, 85, 86 };
extern int table_364f8[]{ 5, 396, 388, 389, 390, 391 };
extern int table_36510[]{ 3, 398, 399, 400 };
extern int table_36520[]{ 3, 87, 88, 89 };
extern int table_36530[]{ 1, 0x99 };
extern int table_36538[]{ 2, 0x9a, 0x9b };
extern int table_36548[]{ 1, 0xb9 };
extern int table_36550[]{ 7, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f };
extern int table_36570[]{ 12, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xe6, 0xe7, 0xe9, 0xea };
extern int table_365a8[]{ 8, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe8 };
extern int table_365d0[]{ 1, 0x9d };
extern int table_365d8[]{ 5, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f };
extern int table_365f0[]{ 7, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0xc0 };
extern int table_36610[]{ 5, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5 };
extern int table_decor_lave[]{ 8, 68, 69, 70, 71, 72, 71, 70, 69 };
extern int table_36630[]{ 2, 0x5b, 0x5c };
extern int table_decor_ventillog[]{ 3, 126, 127, 128 };
extern int table_decor_ventg[]{ 4, 110, 111, 112, 113 };
extern int table_36670[]{ 11, 0x4c, 0x4d, 0xc7, 0xc6, 0xc8, 0xc9, 0xeb, 0xec, 0x177, 0x178, 0x179 };
extern int table_366a0[]{ 3, 0x193, 0x191, 0x192 };
extern int table_366b0[]{ 3, 20, 21, 22 };
extern int table_366c0[]{ 4, 16, 17, 18, 19 };
extern int table_366d8[]{ 3, 23, 24, 25 };
extern int table_366e8[]{ 2, 0x1a, 0x1b };
extern int table_366f8[]{ 4, 0x1c, 0x1d, 0x1e, 0x1f };
extern int table_36710[]{ 12, 0x2d, 0x2e, 0x2f, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c};
extern int table_36748[]{ 4, 0x42, 0x43, 0x44, 0x45 };
extern int table_ressort[] // i dont really care to look this up right now so heres some bs extern int table_ressort[] // i dont really care to look this up right now so heres some bs
{ {
8,1,2,3,4,5,5,6,7,7 8,1,2,3,4,5,5,6,7,7