diff --git a/Speedy Eggbert 2 Source.vcxproj b/Speedy Eggbert 2 Source.vcxproj
index 63b06f5..3e3868c 100644
--- a/Speedy Eggbert 2 Source.vcxproj
+++ b/Speedy Eggbert 2 Source.vcxproj
@@ -71,26 +71,14 @@
-
- $(ProjectName)_
-
-
- $(ProjectName)_
-
-
- $(ProjectName)_
-
-
- $(ProjectName)_
-
Level3
false
- WINVER=0x400;WIN32;_CRT_SECURE_NO_WARNINGS;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ _WIN32;WIN32;_CRT_SECURE_NO_WARNINGS;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
true
dxsdk3\sdk\inc
- UNICODE;_UNICODE;_WIN32_WINNT;NTDDI_VERSION
+ UNICODE;_UNICODE
@@ -99,7 +87,7 @@
/DYNAMICBASE "legacy_stdio_definitions.lib" %(AdditionalOptions) /VERBOSE
dxsdk3\sdk\lib;%(AdditionalLibraryDirectories)
false
- dxsdk3/sdk/lib/*.lib;winmm.lib;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)
+ dxsdk3/sdk/lib/*.lib;winmm.lib;kernel32.lib;user32.lib;gdi32.lib;%(AdditionalDependencies)
Default
true
MultiplyDefinedSymbolOnly
@@ -111,10 +99,10 @@
true
true
true
- WINVER=0x400;WIN32;_CRT_SECURE_NO_WARNINGS;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ _WIN32;WIN32;_CRT_SECURE_NO_WARNINGS;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
true
dxsdk3\sdk\inc
- UNICODE;_UNICODE;_WIN32_WINNT;NTDDI_VERSION
+ UNICODE;_UNICODE
Windows
@@ -125,17 +113,17 @@
MultiplyDefinedSymbolOnly
/DYNAMICBASE "legacy_stdio_definitions.lib" %(AdditionalOptions) /VERBOSE
Default
- dxsdk3/sdk/lib/*.lib;winmm.lib;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)
+ dxsdk3/sdk/lib/*.lib;winmm.lib;kernel32.lib;user32.lib;gdi32.lib;%(AdditionalDependencies)
Level3
true
- WINVER=0x400;WIN32;_CRT_SECURE_NO_WARNINGS;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ _WIN32;WIN32;_CRT_SECURE_NO_WARNINGS;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
true
dxsdk3\sdk\inc
- UNICODE;_UNICODE;_WIN32_WINNT;NTDDI_VERSION
+ UNICODE;_UNICODE
Windows
@@ -145,7 +133,7 @@
true
MultiplyDefinedSymbolOnly
/DYNAMICBASE "legacy_stdio_definitions.lib" %(AdditionalOptions) /VERBOSE
- dxsdk3/sdk/lib/*.lib;winmm.lib;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)
+ dxsdk3/sdk/lib/*.lib;winmm.lib;kernel32.lib;user32.lib;gdi32.lib;%(AdditionalDependencies)
@@ -154,10 +142,10 @@
true
true
true
- WINVER=0x400;WIN32;_CRT_SECURE_NO_WARNINGS;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ _WIN32;WIN32;_CRT_SECURE_NO_WARNINGS;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
true
dxsdk3\sdk\inc
- UNICODE;_UNICODE;_WIN32_WINNT;NTDDI_VERSION
+ UNICODE;_UNICODE
Windows
@@ -168,7 +156,7 @@
MultiplyDefinedSymbolOnly
/DYNAMICBASE "legacy_stdio_definitions.lib" %(AdditionalOptions) /VERBOSE
Default
- dxsdk3/sdk/lib/*.lib;winmm.lib;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)
+ dxsdk3/sdk/lib/*.lib;winmm.lib;kernel32.lib;user32.lib;gdi32.lib;%(AdditionalDependencies)
diff --git a/Speedy Eggbert 2 Source.vcxproj.filters b/Speedy Eggbert 2 Source.vcxproj.filters
index 682aa2e..9cd2dc3 100644
--- a/Speedy Eggbert 2 Source.vcxproj.filters
+++ b/Speedy Eggbert 2 Source.vcxproj.filters
@@ -64,6 +64,78 @@
Resource Files
+
+
+ Resource Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+
+
+ Resource Files
+
+
+
+
+ Resource Files
+
+
Source Files
@@ -74,9 +146,24 @@
Source Files
+
+ Source Files
+
Source Files
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
Source Files
@@ -110,92 +197,5 @@
Source Files
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
-
-
- Source Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
-
-
- Resource Files
-
-
-
-
- Resource Files
-
\ No newline at end of file
diff --git a/decblock.cpp b/decblock.cpp
deleted file mode 100644
index 3993097..0000000
--- a/decblock.cpp
+++ /dev/null
@@ -1,776 +0,0 @@
-// DecBlock.cpp
-//
-
-#include "def.h"
-#include "decor.h"
-#include "misc.h"
-#include "obstacle.h"
-#include "dectables.h"
-
-BOOL CDecor::BlitzActif(POINT cel)
-{
- if (m_phase == WM_PHASE_BUILD) {
- //TODO: rewrite this like a human
- int foo = m_time >> 31;
- return 1 - (((m_time ^ foo) - foo & 1 ^ foo) == foo);
- }
-
- POINT pos = { cel.x * DIMOBJX, cel.y * DIMOBJY };
-
- int num = m_time % 100;
-
- if (m_blupiPos.x >= pos.x - 80 && m_blupiPos.x <= pos.x + 80 &&
- m_blupiPos.y >= pos.y - 500 && m_blupiPos.y <= pos.y + 500)
- {
- if (m_time % 100 < 70 && cely > 0 && m_decor[cel.x][cel.y - 1].icon == 0x130)
- {
- PlaySound(SOUND_BLITZ, pos, 0);
- }
-
- for (int i = 0; table_blitz[i] != -1; i++)
- {
- if (m_time % 100 == i) return TRUE;
- }
- }
-
- return FALSE;
-}
-
-int CDecor::SoundEnviron(int sound, int obstacle)
-{
- if ((obstacle >= 32 && obstacle <= 34) || (obstacle >= 41 && obstacle <= 47) || (obstacle >= 139 && obstacle <= 143))
- {
- if (sound == SOUND_JUMPTOC)
- {
- return 79;
- }
- if (sound == SOUND_JUMPEND)
- {
- return 78;
- }
- }
- if ((obstacle >= 1 && obstacle <= 28) || (obstacle >= 78 && obstacle <= 90) || (obstacle >= 250 && obstacle <= 260) || (obstacle >= 311 && obstacle <= 316) || (obstacle >= 324 && obstacle <= 329))
- {
- if (sound == SOUND_JUMPTOC)
- {
- return 81;
- }
- if (sound == SOUND_JUMPEND)
- {
- return 80;
- }
- }
- if ((obstacle >= 284 && obstacle <= 303) || obstacle == 338)
- {
- if (sound == SOUND_JUMPTOC)
- {
- return 83;
- }
- if (sound == SOUND_JUMPEND)
- {
- return 82;
- }
- }
- if (obstacle >= 341 && obstacle <= 363)
- {
- if (sound == SOUND_JUMPTOC)
- {
- return 85;
- }
- if (sound == SOUND_JUMPEND)
- {
- return 84;
- }
- }
- if (obstacle >= 215 && obstacle <= 234)
- {
- if (sound == SOUND_JUMPTOC)
- {
- return 87;
- }
- if (sound == SOUND_JUMPEND)
- {
- return 86;
- }
- }
- if (obstacle >= 246 && obstacle <= 249)
- {
- if (sound == SOUND_JUMPTOC)
- {
- return 89;
- }
- if (sound == SOUND_JUMPEND)
- {
- return 88;
- }
- }
- if (obstacle >= 107 && obstacle <= 109)
- {
- if (sound == SOUND_JUMPTOC)
- {
- return 91;
- }
- if (sound == SOUND_JUMPEND)
- {
- return 90;
- }
- }
- return sound;
-}
-
-
-int CDecor::IsWorld(POINT pos)
-{
- pos.x += 30;
- pos.y += 30;
- if (pos.x < 0 || pos.x >= 6400 || pos.y < 0 || pos.y >= 6400)
- {
- return -1;
- }
- int icon = m_decor[pos.x / DIMOBJX, pos.y / DIMOBJY]->icon;
- if (icon >= 158 && icon <= 165)
- {
- return icon - 158 + 1;
- }
- if (icon >= 166 && icon <= 173)
- {
- return icon - 166 + 1;
- }
- if (icon == 309 || icon == 310)
- {
- return 9;
- }
- if (icon >= 411 && icon <= 415)
- {
- return icon - 411 + 10;
- }
- if (icon >= 416 && icon <= 420)
- {
- return icon - 416 + 10;
- }
- if (icon >= 174 && icon <= 181)
- {
- return icon - 174 + 1;
- }
- if (icon == 184)
- {
- return 199;
- }
- return -1;
-}
-
-void CDecor::ActiveSwitch(BOOL bState, POINT cel)
-{
- POINT pos;
- pos.x = cel.x * DIMOBJX;
- pos.y = cel.y * DIMOBJY;
- ModifDecor(pos, bState ? 384 : 385);
- PlaySound(bState ? 77 : 76, pos);
- cel.x -= 20;
- for (int i = 0; i < 41; i++)
- {
- if (cel.x >= 0 && cel.x < 100 && m_decor[cel.x, cel.y]->icon == (bState ? 379 : 378))
- {
- pos.x = cel.x * DIMOBJX;
- pos.y = cel.y * DIMOBJY;
- ModifDecor(pos, bState ? 378 : 379);
- }
- cel.x++;
- }
-}
-
-int CDecor::GetTypeBarre(POINT pos)
-{
- POINT pos2 = pos;
- pos.x += 30;
- pos.y += 22;
- if (pos.y % 64 > 44)
- {
- return 0;
- }
- if (pos.x < 0 || pos.x >= 6400 || pos.y < 0 || pos.y >= 6400)
- {
- return 0;
- }
- int icon = m_decor[pos.x / DIMOBJX, pos.y / DIMOBJY]->icon;
- if (icon != 138 && icon != 202)
- {
- return 0;
- }
- if (pos.y >= 6336)
- {
- return 1;
- }
- icon = m_decor[pos.x / DIMOBJX, pos.y / DIMOBJY + 1]->icon;
- if (IsPassIcon(icon))
- {
- return 2;
- }
- RECT rect = BlupiRect(pos2);
- rect.top = pos2.y + 60 - 2;
- rect.bottom = pos2.y + 60 - 1;
- if (DecorDetect(rect, TRUE))
- {
- return 2;
- }
- return 1;
-}
-
-BOOL CDecor::IsLave(POINT pos)
-{
- pos.x += 30;
- 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;
- 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;
- if (pos.x % 64 < 15 || pos.x % 64 > 49)
- {
- return FALSE;
- }
- if (pos.x < 0 || pos.x >= 6400 || pos.y < 0 || pos.y >= 6400)
- {
- return FALSE;
- }
- int icon = m_decor[pos.x / DIMOBJX, pos.y / DIMOBJY]->icon;
- if (bAlways)
- {
- return icon == 404 || icon == 410;
- }
- return icon == 404;
-}
-
-BOOL CDecor::IsScie(POINT pos)
-{
- pos.x += 30;
- 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)
-{
- pos.x += 30;
- if (pos.x % 64 < 4 || pos.x % 64 > 60)
- {
- return FALSE;
- }
- if (pos.x < 0 || pos.x >= 6400 || pos.y < 0 || pos.y >= 6400)
- {
- return FALSE;
- }
- celSwitch.x = pos.x / DIMOBJX;
- celSwitch.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;
-}
-
-BOOL CDecor::IsEcraseur(POINT pos)
-{
- if (m_time / 3 % 10 > 2)
- {
- return FALSE;
- }
- pos.x += 30;
- return pos.x >= 0 && pos.x < 6400 && pos.y >= 0 && pos.y < 6400 && m_decor[pos.x / DIMOBJX, pos.y / DIMOBJY]->icon == 317;
-}
-
-BOOL CDecor::IsBlitz(POINT pos, BOOL bAlways)
-{
- pos.x += 30;
- if (pos.x < 0 || pos.x >= 6400 || pos.y < 0 || pos.y >= 6400)
- {
- return FALSE;
- }
- POINT tinyPoint;
- tinyPoint.x = pos.x / DIMOBJX;
- tinyPoint.y = pos.y / DIMOBJY;
- return m_decor[tinyPoint.x, tinyPoint.y]->icon == 305 && (bAlways || BlitzActif(tinyPoint.x, tinyPoint.y));
-}
-
-BOOL CDecor::IsRessort(POINT pos)
-{
- pos.x += 30;
- pos.y += 60;
- return pos.x >= 0 && pos.x < 6400 && pos.y >= 0 && pos.y < 6400 && m_decor[pos.x / DIMOBJX, pos.y / DIMOBJY]->icon == 211;
-}
-
-BOOL CDecor::IsTemp(POINT pos)
-{
- pos.x += 30;
- pos.y += 60;
- return pos.x >= 0 && pos.x < 6400 && pos.y >= 0 && pos.y < 6400 && m_decor[pos.x / DIMOBJX, pos.y / DIMOBJY]->icon == 324;
-}
-
-BOOL CDecor::IsBridge(POINT pos, POINT celBridge)
-{
- pos.x += 30;
- pos.y += 60;
- if (pos.x >= 0 && pos.x < 6400 && pos.y >= 0 && pos.y < 6400 && m_decor[pos.x / DIMOBJX, pos.y / DIMOBJY]->icon == 364)
- {
- celBridge.x = pos.x / DIMOBJX;
- celBridge.y = pos.y / DIMOBJY;
- return TRUE;
- }
- pos.y -= 60;
- if (pos.x >= 0 && pos.x < 6400 && pos.y >= 0 && pos.y < 6400 && m_decor[pos.x / DIMOBJX, pos.y / DIMOBJY]->icon == 364)
- {
- celBridge.x = pos.x / DIMOBJX;
- celBridge.y = pos.y / DIMOBJY;
- return TRUE;
- }
- return FALSE;
-
-}
-
-int CDecor::IsDoor(POINT pos, POINT celPorte)
-{
- int num;
- if (m_blupiDir == 1)
- {
- num = -60;
- }
- else
- {
- num = 60;
- }
- pos.x += 30;
- for (int i = 0; i < 2; i++)
- {
- if (pos.x >= 0 && pos.x < DIMOBJX * MAXCELX && pos.y >= 0 && pos.y < DIMOBJY * MAXCELY && m_decor[pos.x / DIMOBJX, pos.y / DIMOBJY]->icon >= 334 && m_decor[pos.x / DIMOBJX, pos.y / DIMOBJY]->icon <= 336)
- {
- celPorte.x = pos.x / DIMOBJX;
- celPorte.y = pos.y / DIMOBJY;
- return m_decor[pos.x / DIMOBJX, pos.y / DIMOBJY]->icon;
- }
- pos.x += num;
- }
- return -1;
-}
-
-int CDecor::IsTeleporte(POINT pos)
-{
- if (pos.x % DIMOBJX > 6)
- {
- return -1;
- }
- pos.x += 30;
- pos.y -= 60;
- if (pos.x < 0 || pos.x >= DIMOBJX * MAXCELX || pos.y < 0 || pos.y >= DIMOBJY * MAXCELY)
- {
- return -1;
- }
- if (m_decor[pos.x / DIMOBJX, pos.y / DIMOBJY]->icon >= 330 && m_decor[pos.x / DIMOBJX, pos.y / DIMOBJY]->icon <= 333)
- {
- return m_decor[pos.x / DIMOBJX, pos.y / DIMOBJY]->icon;
- }
- return -1;
-}
-
-BOOL CDecor::SearchTeleporte(POINT pos, POINT newpos)
-{
- int num = IsTeleporte(pos);
- if (num == -1)
- {
- return FALSE;
- }
- for (int i = 0; i < 100; i++)
- {
- for (int j = 0; j < 100; j++)
- {
- 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)
- {
- return TRUE;
- }
- }
- }
- }
- return FALSE;
-}
-
-BOOL CDecor::IsSurfWater(POINT pos)
-{
- if (pos.y % 64 < 64 - BLUPISURF)
- {
- return FALSE;
- }
- int icon = m_decor[(pos.x + 30) / 64, pos.y / DIMOBJY]->icon;
- int icon2 = m_decor[(pos.x + 30) / 64, (pos.y + BLUPISURF) / 64]->icon;
- return icon != 92 && icon2 == 92;
-}
-
-BOOL CDecor::IsDeepWater(POINT pos)
-{
- int num = (pos.x + 30) / 64;
- int num2 = pos.y / DIMOBJY;
- if (num < 0 || num >= 100 || num2 < 0 || num2 >= 100)
- {
- return FALSE;
- }
- int icon = m_decor[num, num2]->icon;
- return icon == 91 || icon == 92;
-}
-
-BOOL CDecor::IsOutWater(POINT pos)
-{
- int icon = m_decor[(pos.x + 30) / 64, (pos.y + 30) / 64]->icon;
- return icon != 91 && icon != 92 && IsPassIcon(icon);
-}
-
-BOOL CDecor::IsPassIcon(int icon)
-{
- if (icon == 324 && m_time / 4 % 20 >= 18)
- {
- return TRUE;
- }
- if (icon >= 0 && icon < MAXQUART)
- {
- for (int i = 0; i < 16; i++)
- {
- if (table_decor_quart[icon * 16 + i] != 0)
- {
- return FALSE;
- }
- }
- }
- return TRUE;
-}
-
-BOOL CDecor::IsBlocIcon(int icon)
-{
- if (icon < 0 || icon >= MAXQUART)
- {
- return FALSE;
- }
- if (icon == 324 && m_time / 4 % 20 < 18)
- {
- return FALSE;
- }
- for (int i = 0; i < 16; i++)
- {
- if (table_decor_quart[icon * 16 + i] == 0)
- {
- return FALSE;
- }
- }
- return FALSE;
-}
-
-BOOL CDecor::IsVentillo(POINT pos)
-{
- int num = 0;
- BOOL flag = FALSE;
- POINT tinyPoint;
- pos.x += 30;
- pos.y += 30;
- if (pos.x < 0 || pos.x >= 6400 || pos.y < 0 || pos.y >= 6400)
- {
- return FALSE;
- }
- int icon = m_decor[pos.x / DIMOBJX, pos.y / DIMOBJY]->icon;
- if (icon < 126 || icon > 137)
- {
- return FALSE;
- }
- if (icon == 126)
- {
- if (pos.x % 64 <= 16)
- {
- flag = TRUE;
- }
- tinyPoint.x = -64;
- tinyPoint.y = 0;
- num = 110;
- }
- if (icon == 129)
- {
- if (pos.x % 64 >= 48)
- {
- flag = TRUE;
- }
- tinyPoint.x = 64;
- tinyPoint.y = 0;
- num = 114;
- }
- if (icon == 132)
- {
- if (pos.y % 64 <= 32)
- {
- flag = TRUE;;
- }
- tinyPoint.x = 0;
- tinyPoint.y = -64;
- num = 118;
- }
- if (icon == 135)
- {
- if (pos.y % 64 >= 48)
- {
- flag = TRUE;
- }
- tinyPoint.x = 0;
- tinyPoint.y = 64;
- num = 122;
- }
- if (!flag)
- {
- return FALSE;
- }
- ModifDecor(pos, -1);
- do
- {
- pos.x += tinyPoint.x;
- pos.y += tinyPoint.y;
- if (num != m_decor[pos.x / DIMOBJX, pos.y / DIMOBJY]->icon)
- {
- break;
- }
- ModifDecor(pos, -1);
- } while (pos.x >= 0 && pos.x < 6400 && pos.y >= 0 && pos.y < 6400);
- return TRUE;
-}
-
-void CDecor::ModifDecor(POINT pos, int icon, BOOL bMulti)
-{// TODO: this
- int icon2 = m_decor[pos.x / DIMOBJX, pos.y / DIMOBJY]->icon;
- if (icon == -1 && icon >= 126 && icon2 <= 137)
- {
- ByeByeAdd(1, icon2, pos, 17.0, 1.0);
- }
- m_decor[pos.x / DIMOBJX, pos.y / DIMOBJY]->icon = icon;
-}
-
-BOOL CDecor::IsRightBorder(POINT pos, POINT offset)
-{
-
-}
-
-
-BOOL CDecor::IsFromage(POINT cel)
-{
- if (!IsValidCel(cel)) return FALSE;
-
- int icon = m_decor[cel.x][cel.y].icon;
- return (icon >= 246 && icon <= 249) || icon == 339;
-}
-
-BOOL CDecor::IsGrotte(POINT cel)
-{
- if (!IsValidCel(cel)) return FALSE;
-
- int icon = m_decor[x, y]->icon;
- return icon = 284 || icon == 301 || icon == 337;
-}
-
-void CDecor::AdaptMidBorder(POINT cel)
-{
- if (!IsValidCel(cel)) return;
-
- int num = 15;
- if (!IsRightBorder({ cel.x, cel.y + 1 }, { 0, -1 }))
- {
- num &= -2;
- }
- if (!IsRightBorder({ cel.x, cel.y + 1 }, { 0, 1 }))
- {
- num &= -3;
- }
- if (!IsRightBorder({ cel.x + 1, cel.y }, { -1, 0 }))
- {
- num &= -5;
- }
- if (!IsRightBorder({ cel.x - 1, cel.y }, { 1, 0 }))
- {
- num &= -9;
- }
- int num2 = m_decor[cel.x][cel.y].icon;
- if (num2 == 156)
- {
- num2 = 35;
- }
- if (num2 == 252 || num2 == 253)
- {
- num2 = 251;
- }
- if (num2 == 255)
- {
- num2 = 254;
- }
- if (num2 == 362)
- {
- num2 = 347;
- }
- if (num2 == 363)
- {
- num2 = 348;
- }
- if (num2 >= 341 && num2 <= 346)
- {
- num2 = 341;
- }
- for (int i = 0; i < 144; i++)
- {
- if (num2 == table_adapt_decor[i])
- {
- num2 = table_adapt_decor[i / 16 * 16 + num];
- if (num2 == 35 && m_random->next() % 2 == 0)
- {
- num2 = 156;
- }
- if (num2 == 251)
- {
- num2 = m_random->next(251, 253);
- }
- if (num2 == 254 && m_random->next() % 2 == 0)
- {
- num2 = 255;
- }
- if (num2 == 347 && m_random->next() % 2 == 0)
- {
- num2 = 362;
- }
- if (num2 == 348 && m_random->next() % 2 == 0)
- {
- num2 = 363;
- }
- if (num2 == 341)
- {
- num2 = m_random->next(341, 346);
- }
- m_decor[x, y]->icon = num2;
- return;
- }
- }
- num2 = m_decor[x, y]->icon;
- if (num2 == -1 || (num2 >= 264 && num2 <= 282))
- {
- num = 15;
- if (!IsFromage(x, y + 1))
- {
- num &= -2;
- }
- if (!IsFromage(x, y - 1))
- {
- num &= -3;
- }
- if (!IsFromage(x + 1, y))
- {
- num &= -5;
- }
- if (!IsFromage(x - 1, y))
- {
- num &= -9;
- }
- num2 = table_adapt_fromage[num];
- if (num2 == 268 && m_random->next() % 2 == 0)
- {
- num2 = 279;
- }
- if (num2 == 269 && m_random->next() % 2 == 0)
- {
- num2 = 280;
- }
- if (num2 == 264 && m_random->next() % 2 == 0)
- {
- num2 = 281;
- }
- if (num2 == 265 && m_random->next() % 2 == 0)
- {
- num2 = 282;
- }
- m_decor[x, y]->icon = num2;
- }
- num2 = m_decor[x, y]->icon;
- if (num2 == -1 || (num2 >= 285 && num2 <= 303 && num2 != 301))
- {
- num = 15;
- if (!IsGrotte(x, y + 1))
- {
- num &= -2;
- }
- if (!IsGrotte(x, y - 1))
- {
- num &= -3;
- }
- if (!IsGrotte(x + 1, y))
- {
- num &= -5;
- }
- if (!IsGrotte(x - 1, y))
- {
- num &= -9;
- }
- num2 = table_adapt_fromage[num + 16];
- if (num2 == 289 && m_random->next() % 2 == 0)
- {
- num2 == 300;
- }
- if (num2 == 285 && m_random->next() % 2 == 0)
- {
- num2 = 302;
- }
- if (num2 == 286 && m_random->next() % 2 == 0)
- {
- num2 = 303;
- }
- m_decor[x, y]->icon = num2;
- }
-}
-
-void CDecor::AdaptBorder(POINT cel)
-{
- AdaptMidBorder(cel.x, cel.y);
- AdaptMidBorder(cel.x + 1, cel.y);
- AdaptMidBorder(cel.x - 1, cel.y);
- AdaptMidBorder(cel.x, cel.y + 1);
- AdaptMidBorder(cel.x, cel.y - 1);
- int icon = m_decor[cel.x, cel.y]->icon;
- if (icon != -1 && !IsPassIcon(icon))
- {
- MoveObjectDelete(cel);
- }
- icon = m_decor[cel.x, cel.y]->icon;
- if (icon == 304)
- {
- for (int i = 0; i < 4; i++)
- {
- cel.y++;
- if (cel.y >= 100)
- {
- break;
- }
- icon = m_decor[cel.x, cel.y]->icon;
- if (icon != -1)
- {
- break;
- }
- m_decor[cel.x, cel.y]->icon = 305;
- }
- }
- if (icon == -1)
- {
- for (int i = 0; i < 4; i++)
- {
- cel.y++;
- if (cel.y >= 100)
- {
- return;
- }
- icon = m_decor[cel.x, cel.y]->icon;
- if (icon != 305)
- {
- return;
- }
- m_decor[cel.x, cel.y]->icon = -1;
- }
- }
-}
\ No newline at end of file
diff --git a/decdesign.cpp b/decdesign.cpp
deleted file mode 100644
index cfcaae4..0000000
--- a/decdesign.cpp
+++ /dev/null
@@ -1,654 +0,0 @@
-// DecDesign.cpp
-//
-
-#include "def.h"
-#include "decor.h"
-#include "misc.h"
-
-POINT CDecor::ScreenPosToCelPos(POINT pos)
-{
- if (pos.x >= 0 && pos.x < LXIMAGE && pos.y >= 0 && pos.y < LYIMAGE) {
- return {
- (m_posDecor.x + m_dimCelHili.x * -32 + 32 + pos.x) / 64,
- (m_posDecor.y + m_dimCelHili.y * -32 + 32 + pos.y) / 64
- };
- }
- else return { -1, -1 };
-}
-
-void CDecor::SetCelPosFromScreenPos(POINT pos)
-{
- m_posCelHili = ScreenPosToCelPos(pos);
-}
-
-void CDecor::SetFieldCC38AndStuff(int _foo, int _bar)
-{
- m_dimCelHili = { 1, 1 };
- if (_foo == 2 && _bar != 3 && _bar != 9 && _bar != 10) m_dimCelHili = { 2, 2 };
- if (_foo == 3) m_iconLift = _bar;
- if (_foo == 4) m_iconLift = _bar + 20;
- if (_foo == 5) m_iconLift = _bar + 40;
- m_2ndPositionCalculationSlot = -1;
-}
-
-void CDecor::DeleteCel(POINT cel)
-{
- m_2ndPositionCalculationSlot = -1;
-
- if (!IsValidCel(cel)) return;
-
- m_decor[cel.x][cel.y].icon = -1;
- AdaptBorder(cel);
- m_bigDecor[cel.x][cel.y].icon = -1;
- MoveObjectDelete(cel);
-}
-
-void CDecor::PlaceMenuItem(short *pCel, int *pTable, int lastIndex, BYTE flags, int currentIcon, BOOL bRand)
-{
- if (bRand) {
- *pCel = pTable[rand() % (pTable[0] + 1)];
- }
- else if (!flags & 8) {
- if (flags & 1) {
- lastIndex++;
- if (*pCel == pTable[lastIndex] && currentIcon != 0 && pTable[0] <= lastIndex) {
- lastIndex = 0;
- }
- *pCel = pTable[lastIndex + 1];
- }
- }
- else {
- *pCel = pTable[lastIndex + 1];
- }
-}
-
-void CDecor::PlaceItemFromMenu1(POINT cel, int index, BYTE flags, int currentIcon)
-{
- m_2ndPositionCalculationSlot = -1;
-
- short *pIcon = &m_decor[cel.x][cel.y].icon;
- short *pIconBig = &m_bigDecor[cel.x][cel.y].icon;
-
- if (!IsValidCel(cel)) return;
-
- switch (index) {
- case 0: // Tree
- PlaceMenuItem(pIconBig, table_366b0, m_lastDecorIndexes[0], flags, *pIconBig, TRUE);
- break;
- case 1: // Palmtree
- PlaceMenuItem(pIconBig, table_366c0, m_lastDecorIndexes[1], flags, *pIconBig, TRUE);
- break;
- case 2: // Decorative plant
- PlaceMenuItem(pIconBig, table_366d8, m_lastDecorIndexes[2], flags, *pIconBig, TRUE);
- break;
- case 3: // Marine plant
- *pIcon = Object::Marine_1;
- break;
- case 4: // House
- PlaceMenuItem(pIconBig, table_366e8, m_lastDecorIndexes[3], flags, *pIconBig, TRUE);
- break;
- case 5: // Mechanical background
- PlaceMenuItem(pIconBig, table_366f8, m_lastDecorIndexes[4], flags, *pIconBig, TRUE);
- break;
- case 6: // Kid's stuff background
- PlaceMenuItem(pIconBig, table_36710, m_lastDecorIndexes[5], flags, *pIconBig, TRUE);
- break;
- case 7: // Green slime 2
- PlaceMenuItem(pIconBig, table_36748, m_lastDecorIndexes[6], flags, *pIconBig, TRUE);
- break;
- case 8: // Element for Palace
- PlaceMenuItem(pIconBig, table_36520, m_lastDecorIndexes[7], flags, *pIconBig, TRUE);
- break;
- case 9: // Support
- PlaceMenuItem(pIcon, table_36670, m_lastDecorIndexes[8], flags, *pIcon, TRUE);
- break;
- case 10: // Spider's web
- PlaceMenuItem(pIcon, table_366a0, m_lastDecorIndexes[9], flags, *pIcon, TRUE);
- break;
- }
-}
-
-void CDecor::PlaceItemFromMenu2(POINT cel, int index, BYTE flags, int currentIcon)
-{
- m_2ndPositionCalculationSlot = -1;
-
- short *pIcon = &m_decor[cel.x][cel.y].icon;
-
- if (!IsValidCel(cel)) return;
-
- m_iconLift = index;
-
- switch (index) {
- case 0: // Square tech-blocks
- PlaceMenuItem(pIcon, table_36418, m_lastDecorIndexes[10], flags, *pIcon, TRUE);
- break;
- case 1: // Special tech-blocks
- PlaceMenuItem(pIcon, table_36458, m_lastDecorIndexes[11], flags, *pIcon, TRUE);
- break;
- case 2: // Triangular tech-blocks
- PlaceMenuItem(pIcon, table_36488, m_lastDecorIndexes[12], flags, *pIcon, FALSE);
- break;
- case 3: // Secret tech-block
- PlaceMenuItem(pIcon, table_364a0, m_lastDecorIndexes[13], flags, *pIcon, FALSE);
- break;
- case 4: // Mechanical square
- PlaceMenuItem(pIcon, table_364b0, m_lastDecorIndexes[14], flags, *pIcon, TRUE);
- break;
- case 5: // Special mechanical
- PlaceMenuItem(pIcon, table_364d0, m_lastDecorIndexes[15], flags, *pIcon, FALSE);
- break;
- case 6: // Secret mechanical
- PlaceMenuItem(pIcon, table_364e8, m_lastDecorIndexes[16], flags, *pIcon, FALSE);
- break;
- case 7: // Pipes
- *pIcon = Object::Pipes_1;
- break;
- }
- AdaptBorder(cel);
-}
-
-void CDecor::PlaceItemFromMenu3(POINT cel, int index, BYTE flags, int currentIcon)
-{
- m_2ndPositionCalculationSlot = -1;
-
- short *pIcon = &m_decor[cel.x][cel.y].icon;
-
- if (!IsValidCel(cel)) return;
-
- m_iconLift = index + 20;
-
- switch (index) {
- case 0: // Square rock
- PlaceMenuItem(pIcon, table_36530, m_lastDecorIndexes[20], flags, *pIcon, FALSE);
- break;
- case 1: // Triangular rock
- PlaceMenuItem(pIcon, table_36538, m_lastDecorIndexes[21], flags, *pIcon, FALSE);
- break;
- case 2: // Secret rock
- PlaceMenuItem(pIcon, table_36548, m_lastDecorIndexes[22], flags, *pIcon, FALSE);
- break;
- case 3: // Cave
- // todo
- break;
- case 4: // Secret cave
- *pIcon = Object::CaveSecret;
- break;
- case 5: // Cheese
- *pIcon = Random(Object::CheeseSquare_1, Object::CheeseSquare_4);
- break;
- case 6: // Secret cheese
- *pIcon = Object::CheeseSecret;
- break;
- case 7: // Green slime 2
- *pIcon = Object::Slime_1;
- break;
- case 8: // Grass
- PlaceMenuItem(pIcon, table_365d0, m_lastDecorIndexes[23], flags, *pIcon, FALSE);
- break;
- case 9: // Water
- PlaceMenuItem(pIcon, table_36630, m_lastDecorIndexes[24], flags, *pIcon, FALSE);
- break;
- }
- AdaptBorder(cel);
-}
-
-void CDecor::PlaceItemFromMenu4(POINT cel, int index, BYTE flags, int currentIcon)
-{
- m_2ndPositionCalculationSlot = -1;
-
- short *pIcon = &m_decor[cel.x][cel.y].icon;
-
- if (!IsValidCel(cel)) return;
-
- m_iconLift = index + 40;
-
- switch (index) {
- case 0: // Palace
- break;
- case 1: // Element for Palace
- break;
- case 2: // Building facade
- break;
- case 3: // Roof
- break;
- case 4: // Bricks
- break;
- case 5: // Furniture
- break;
- case 6: // Wooden wall
- break;
- case 7: // Kid's stuff square
- break;
- case 8: // Special Kid's stuff
- break;
- case 9: // Invisible block
- break;
- }
- AdaptBorder(cel);
-}
-
-void CDecor::PlaceItemFromMenu5(POINT cel, int index, BYTE flags, int currentIcon)
-{
- m_2ndPositionCalculationSlot = -1;
-
- int mobId;
- MoveObject* pMob;
-
- short *pIcon = &m_decor[cel.x][cel.y].icon;
-
- if (!IsValidCel(cel)) return;
-
- switch (index) {
- case 0: // Bomb
- MoveObjectDelete(cel);
- mobId = MoveObjectFree();
- if (mobId == -1) return;
- pMob = &m_moveObject[mobId];
- pMob->type = TYPE_BOMBEDOWN;
- pMob->stepAdvance = 1;
- pMob->stepRecede = 1;
- pMob->timeStopStart = 0;
- pMob->timeStopEnd = 0;
- pMob->posStart = { cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 4 };
- pMob->posEnd = pMob->posStart;
- pMob->posCurrent = pMob->posStart;
- pMob->step = STEP_STOPSTART;
- pMob->time = 0;
- pMob->phase = 0;
- pMob->channel = CHELEMENT;
- pMob->icon = 0x0c;
- break;
- case 1: // Hanging bomb
- MoveObjectDelete(cel);
- mobId = MoveObjectFree();
- if (mobId == -1) return;
- pMob = &m_moveObject[mobId];
- pMob->type = TYPE_BOMBEUP;
- pMob->stepAdvance = 1;
- pMob->stepRecede = 1;
- pMob->timeStopStart = 0;
- pMob->timeStopEnd = 0;
- pMob->posStart = { cel.x * DIMOBJX + 2, cel.y * DIMOBJY };
- pMob->posEnd = pMob->posStart;
- pMob->posCurrent = pMob->posStart;
- pMob->step = STEP_STOPSTART;
- pMob->time = 0;
- pMob->phase = 0;
- pMob->channel = CHELEMENT;
- pMob->icon = 0x30;
- break;
- case 2: // Homing bomb
- MoveObjectDelete(cel);
- mobId = MoveObjectFree();
- if (mobId == -1) return;
- pMob = &m_moveObject[mobId];
- pMob->type = TYPE_BOMBEFOLLOW1;
- pMob->stepAdvance = 1;
- pMob->stepRecede = 1;
- pMob->timeStopStart = 0;
- pMob->timeStopEnd = 0;
- pMob->posStart = { cel.x * DIMOBJX, cel.y * DIMOBJY };
- pMob->posEnd = pMob->posStart;
- pMob->posCurrent = pMob->posStart;
- pMob->step = STEP_STOPSTART;
- pMob->time = 0;
- pMob->phase = 0;
- pMob->channel = CHELEMENT;
- pMob->icon = 0x100;
- break;
- case 3: // Lava
- PlaceMenuItem(pIcon, table_decor_lave, m_lastDecorIndexes[40], flags, *pIcon, FALSE);
- break;
- case 4: // Fan
- PlaceMenuItem(pIcon, table_decor_ventillog, m_lastDecorIndexes[41], flags, *pIcon, FALSE);
- break;
- case 5: // Wind
- PlaceMenuItem(pIcon, table_decor_ventg, m_lastDecorIndexes[42], flags, *pIcon, FALSE);
- break;
- case 6: // Slime trap (floor)
- *pIcon = Object::SlimeTrapFloor_1;
- break;
- case 7: // Slime trap (ceiling)
- *pIcon = Object::SlimeTrapCeiling_1;
- break;
- case 8: // Circular saw
- PlaceMenuItem(pIcon, table_decor_scie, m_lastDecorIndexes[43], flags, *pIcon, FALSE);
- break;
- case 9: // Inverter
- MoveObjectDelete(cel);
- mobId = MoveObjectFree();
- if (mobId == -1) return;
- pMob = &m_moveObject[mobId];
- pMob->type = TYPE_INVERT;
- pMob->stepAdvance = 1;
- pMob->stepRecede = 1;
- pMob->timeStopStart = 0;
- pMob->timeStopEnd = 0;
- pMob->posStart = { cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 8 };
- pMob->posEnd = pMob->posStart;
- pMob->posCurrent = pMob->posStart;
- pMob->step = STEP_STOPSTART;
- pMob->time = 0;
- pMob->phase = 0;
- pMob->channel = CHELEMENT;
- pMob->icon = 0xBB;
- break;
- case 10: // Lightning
- *pIcon = Object::LightningMachine;
- break;
- case 11: // Crusher
- *pIcon = Object::Crusher_1;
- break;
- }
- AdaptBorder(cel);
-}
-
-void CDecor::PlaceItemFromMenu6(POINT cel, int index, BYTE flags, int currentIcon)
-{
- m_2ndPositionCalculationSlot = -1;
-
- short *pIcon = &m_decor[cel.x][cel.y].icon;
-
- if (!IsValidCel(cel) || currentIcon == 0) return;
-
- switch (m_iconLift) {
-
- }
-
- switch (index) {
- case 0: // Slow lift
- case 1: // Normal lift
- case 2: // Fast lift
- case 3: // Fast/Slow lift
- case 4: // Lift with conveyor belt
- case 5: // Bulldozer
- case 6: // Fish
- case 7: // Bird
- case 8: // Wasp
- case 9: // Slime creature
- case 10: // Moving bomb
- case 11: // Heliported ennemy
- case 12: // Motorized ennemy
- }
-}
-
-void CDecor::PlaceItemFromMenu7(POINT cel, int index, BYTE flags, int currentIcon)
-{
- m_2ndPositionCalculationSlot = -1;
-
- MoveObject* pMob;
- int mobId;
-
- short *pIcon = &m_decor[cel.x][cel.y].icon;
-
- if (!IsValidCel(cel)) return;
-
- switch (index) {
- case 0: // Chest
- MoveObjectDelete(cel);
- mobId = MoveObjectFree();
- if (mobId == -1) return;
- pMob = &m_moveObject[mobId];
- pMob->type = TYPE_TRESOR;
- pMob->stepAdvance = 1;
- pMob->stepRecede = 1;
- pMob->timeStopStart = 0;
- pMob->timeStopEnd = 0;
- pMob->posStart = { cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 4 };
- pMob->posEnd = pMob->posStart;
- pMob->posCurrent = pMob->posStart;
- pMob->step = STEP_STOPSTART;
- pMob->time = 0;
- pMob->phase = 0;
- pMob->channel = CHELEMENT;
- pMob->icon = 0x00;
- break;
- case 1: // Egg
- MoveObjectDelete(cel);
- mobId = MoveObjectFree();
- if (mobId == -1) return;
- pMob = &m_moveObject[mobId];
- pMob->type = TYPE_EGG;
- pMob->stepAdvance = 1;
- pMob->stepRecede = 1;
- pMob->timeStopStart = 0;
- pMob->timeStopEnd = 0;
- pMob->posStart = { cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 8 };
- pMob->posEnd = pMob->posStart;
- pMob->posCurrent = pMob->posStart;
- pMob->step = STEP_STOPSTART;
- pMob->time = 0;
- pMob->phase = 0;
- pMob->channel = CHELEMENT;
- pMob->icon = 0x15;
- break;
- case 2: // Lollipop
- MoveObjectDelete(cel);
- mobId = MoveObjectFree();
- if (mobId == -1) return;
- pMob = &m_moveObject[mobId];
- pMob->type = TYPE_POWER;
- pMob->stepAdvance = 1;
- pMob->stepRecede = 1;
- pMob->timeStopStart = 0;
- pMob->timeStopEnd = 0;
- pMob->posStart = { cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 8 };
- pMob->posEnd = pMob->posStart;
- pMob->posCurrent = pMob->posStart;
- pMob->step = STEP_STOPSTART;
- pMob->time = 0;
- pMob->phase = 0;
- pMob->channel = CHELEMENT;
- pMob->icon = 0x88;
- break;
- case 3: // Shield
- MoveObjectDelete(cel);
- mobId = MoveObjectFree();
- if (mobId == -1) return;
- pMob = &m_moveObject[mobId];
- pMob->type = TYPE_SHIELD;
- pMob->stepAdvance = 1;
- pMob->stepRecede = 1;
- pMob->timeStopStart = 0;
- pMob->timeStopEnd = 0;
- pMob->posStart = { cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 8 };
- pMob->posEnd = pMob->posStart;
- pMob->posCurrent = pMob->posStart;
- pMob->step = STEP_STOPSTART;
- pMob->time = 0;
- pMob->phase = 0;
- pMob->channel = CHELEMENT;
- pMob->icon = 0x90;
- break;
- case 4: // Invisibility potion
- MoveObjectDelete(cel);
- mobId = MoveObjectFree();
- if (mobId == -1) return;
- pMob = &m_moveObject[mobId];
- pMob->type = TYPE_DRINK;
- pMob->stepAdvance = 1;
- pMob->stepRecede = 1;
- pMob->timeStopStart = 0;
- pMob->timeStopEnd = 0;
- pMob->posStart = { cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 6 };
- pMob->posEnd = pMob->posStart;
- pMob->posCurrent = pMob->posStart;
- pMob->step = STEP_STOPSTART;
- pMob->time = 0;
- pMob->phase = 0;
- pMob->channel = CHELEMENT;
- pMob->icon = 0xB2;
- break;
- case 5: // Glue supply
- MoveObjectDelete(cel);
- mobId = MoveObjectFree();
- if (mobId == -1) return;
- pMob = &m_moveObject[mobId];
- pMob->type = TYPE_BULLET;
- pMob->stepAdvance = 1;
- pMob->stepRecede = 1;
- pMob->timeStopStart = 0;
- pMob->timeStopEnd = 0;
- pMob->posStart = { cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 4 };
- pMob->posEnd = pMob->posStart;
- pMob->posCurrent = pMob->posStart;
- pMob->step = STEP_STOPSTART;
- pMob->time = 0;
- pMob->phase = 0;
- pMob->channel = CHELEMENT;
- pMob->icon = 0xB1;
- break;
- case 6: // Recharging device
- MoveObjectDelete(cel);
- mobId = MoveObjectFree();
- if (mobId == -1) return;
- pMob = &m_moveObject[mobId];
- pMob->type = TYPE_CHARGE;
- pMob->stepAdvance = 1;
- pMob->stepRecede = 1;
- pMob->timeStopStart = 0;
- pMob->timeStopEnd = 0;
- pMob->posStart = { cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 4 };
- pMob->posEnd = pMob->posStart;
- pMob->posCurrent = pMob->posStart;
- pMob->step = STEP_STOPSTART;
- pMob->time = 0;
- pMob->phase = 0;
- pMob->channel = CHELEMENT;
- pMob->icon = 0xEE;
- break;
- case 7: // Personal bomb
- int type;
- mobId = MoveObjectSearch(cel, -1);
- if (mobId != -1 && currentIcon != 0) {
- if (mobId >= TYPE_BOMBEPERSO4) {
- m_lastDecorIndexes[60] = 0;
- }
- else {
- m_lastDecorIndexes[60] = m_moveObject[mobId].type - TYPE_BOMBEPERSO1;
- }
- }
- type = m_lastDecorIndexes[60] + TYPE_BOMBEPERSO1;
- MoveObjectDelete(cel);
- mobId = MoveObjectFree();
- if (mobId == -1) return;
- pMob = &m_moveObject[mobId];
- pMob->type = type;
- pMob->stepAdvance = 1;
- pMob->stepRecede = 1;
- pMob->timeStopStart = 0;
- pMob->timeStopEnd = 0;
- pMob->posStart = { cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 6 };
- pMob->posEnd = pMob->posStart;
- pMob->posCurrent = pMob->posStart;
- pMob->step = STEP_STOPSTART;
- pMob->time = 0;
- pMob->phase = 0;
- switch (type) {
- default:
- case TYPE_BOMBEPERSO1:
- pMob->channel = CHBLUPI;
- break;
- case TYPE_BOMBEPERSO2:
- pMob->channel = CHBLUPI1;
- break;
- case TYPE_BOMBEPERSO3:
- pMob->channel = CHBLUPI2;
- break;
- case TYPE_BOMBEPERSO4:
- pMob->channel = CHBLUPI3;
- break;
- }
- pMob->icon = 0x101;
- break;
- case 8: // Dynamite
- MoveObjectDelete(cel);
- mobId = MoveObjectFree();
- if (mobId == -1) return;
- pMob = &m_moveObject[mobId];
- pMob->type = TYPE_DYNAMITE;
- pMob->stepAdvance = 1;
- pMob->stepRecede = 1;
- pMob->timeStopStart = 0;
- pMob->timeStopEnd = 0;
- pMob->posStart = { cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 6 };
- pMob->posEnd = pMob->posStart;
- pMob->posCurrent = pMob->posStart;
- pMob->step = STEP_STOPSTART;
- pMob->time = 0;
- pMob->phase = 0;
- pMob->channel = CHELEMENT;
- pMob->icon = 0xFC;
- break;
- }
- AdaptBorder(cel);
-}
-
-void CDecor::PlaceItemFromMenu8(POINT cel, int index, BYTE flags, int currentIcon)
-{
- m_2ndPositionCalculationSlot = -1;
-
- short *pIcon = &m_decor[cel.x][cel.y].icon;
-
- if (!IsValidCel(cel)) return;
-
- switch (index) {
- case 0: // Key
- case 1: // Door
- case 2: // Closed while not all chests have been found
- case 3: // Teleporter
- case 4: // Bar to hang from
- case 5: // Spring
- case 6: // Vanishing bloc
- case 7: // Fragile bridge
- case 8: // Wooden case
- case 9: // Secret wooden case
- }
-}
-
-void CDecor::PlaceItemFromMenu9(POINT cel, int index, BYTE flags, int currentIcon)
-{
- m_2ndPositionCalculationSlot = -1;
-
- short *pIcon = &m_decor[cel.x][cel.y].icon;
-
- if (!IsValidCel(cel)) return;
-
- switch (index) {
- case 0: // Hovercraft
- case 1: // Helicopter
- case 2: // Skateboard
- case 3: // Jeep
- case 4: // Glue tank
- }
-}
-
-void CDecor::PlaceItemFromMenu10(POINT cel, int index, BYTE flags, int currentIcon)
-{
- m_2ndPositionCalculationSlot = -1;
-
- short *pIcon = &m_decor[cel.x][cel.y].icon;
-
- if (!IsValidCel(cel)) return;
-
- switch (index) {
- case 0: // Goal
- case 1: // Yellow Blupi
- case 2: // Orange Blupi
- case 3: // Blue Blupi
- case 4: // Green Blupi
- case 5: // Door
- case 6: // Level start
- case 7: // Key
- }
-}
-
-char* CDecor::GetMissionTitle()
-{
- return m_missionTitle;
-}
-
-void CDecor::SetMissionTitle(char *str)
-{
- strcpy(m_missionTitle, str);
-}
diff --git a/decio.cpp b/decio.cpp
deleted file mode 100644
index f977845..0000000
--- a/decio.cpp
+++ /dev/null
@@ -1,218 +0,0 @@
-// DecIO.cpp
-//
-
-#include "def.h"
-#include "decor.h"
-#include "misc.h"
-
-void CDecor::GetMissionPath(char* str, int user, int mission, BOOL bUser)
-{
- if (bUser != 0)
- {
- sprintf(str, "data\%.3d-%.3d.blp", user, mission);
- AddUserPath(str);
- return;
- }
- sprintf(str, "data\world%.3d.blp", mission);
- AddUserPath(str);
- return;
-}
-
-BOOL CDecor::CurrentWrite(int gamer, int mission, BOOL bUser)
-{
- char filename[MAX_PATH];
- FILE* file = NULL;
- DescFile* pBuffer = NULL;
- int nb, i;
-
- InitDecor();
- GetMissionPath(filename, gamer, mission, bUser);
-
- file = fopen(filename, "wb");
- if (file == NULL) goto error;
-
- pBuffer = (DescFile*)malloc(sizeof(DescFile));
- if (pBuffer == NULL) goto error;
- memset(pBuffer, 0, sizeof(DescFile));
-
- pBuffer->cameraPos = m_posDecor;
- pBuffer->worldDim = m_dimDecor;
- pBuffer->music = m_music;
- pBuffer->region = m_region;
-
- for (i = 0; i < MAXBUTTON; i++)
- {
- pBuffer->ButtonExist[i] = m_buttonExist[i];
- }
- for (i = 0; i < 4; i++)
- {
- pBuffer->memoPos[i] = m_memoPos[i];
- }
-
-error:
- if (pBuffer != NULL) free(pBuffer);
- if (file != NULL) fclose(file);
- return FALSE;
-}
-
-BOOL CDecor::CurrentRead(int gamer, int mission, BOOL bUser)
-{
- char filename[MAX_PATH];
- FILE* file = NULL;
- DescFile* pBuffer = NULL;
- int majRev, minRev;
- int nb, i, x, y;
- OldBlupi oldBlupi;
-
- Init(-1, -1);
-
- if (bUser)
- {
- sprintf(filename, "data\\user%.3d.blp", rank);
- AddUserPath(filename);
- }
- else
- {
- sprintf(filename, "data\\world%.3d.blp", rank);
- if (rank < 200)
- {
- AddCDPath(filename);
- }
- }
-
- file = fopen(filename, "rb");
- if (file == NULL) goto error;
-
- pBuffer = (DescFile*)malloc(sizeof(DescFile));
- if (pBuffer == NULL) goto error;
-
- nb = fread(pBuffer, sizeof(DescFile), 1, file);
- if (nb < 1) goto error;
-
- majRev = pBuffer->majRev;
- minRev = pBuffer->minRev;
-
- if (majRev == 1 && minRev == 0) goto error;
-
- if (majRev == 1 && minRev == 3)
- {
- if (pBuffer->nbDecor != MAXCELX * MAXCELY ||
- pBuffer->lgDecor != sizeof(Cellule) ||
- pBuffer->nbBlupi != MAXBLUPI ||
- pBuffer->lgBlupi != sizeof(OldBlupi) ||
- pBuffer->nbMove != MAXMOVE ||
- pBuffer->lgMove != sizeof(Move)) goto error;
- }
- else
- {
- if (pBuffer->nbDecor != MAXCELX * MAXCELY ||
- pBuffer->lgDecor != sizeof(Cellule) ||
- pBuffer->nbBlupi != MAXBLUPI ||
- pBuffer->lgBlupi != sizeof(Blupi) ||
- pBuffer->nbMove != MAXMOVE ||
- pBuffer->lgMove != sizeof(Move)) goto error;
- }
-
- SetCoin(pBuffer->celCoin);
- if (bUser)
- {
- world = pBuffer->world;
- time = pBuffer->time;
- total = pBuffer->totalTime;
- }
- m_celHome = pBuffer->celCoin;
- m_term = pBuffer->term;
- m_music = pBuffer->music;
- m_region = pBuffer->region;
-
- if (bUser)
- {
- m_skill = pBuffer->skill;
- }
-
- for (i = 0; i < MAXBUTTON; i++)
- {
- m_buttonExist[i] = pBuffer->buttonExist[i];
- }
-
- for (i = 0; i < 4; i++)
- {
- m_memoPos[i] = pBuffer->memoPos[i];
- }
-
- nb = fread(m_decor, sizeof(Cellule), MAXCELX * MAXCELY / 4, file);
- if (nb < MAXCELX * MAXCELY / 4) goto error;
- if (majRev == 1 && minRev < 5)
- {
- for (x = 0; x < MAXCELX / 2; x++)
- {
- for (y = 0; y < MAXCELY / 2; y++)
- {
- if (m_decor[x][y].objectIcon >= 128 &&
- m_decor[x][y].objectIcon <= 130)
- {
- m_decor[x][y].objectIcon -= 128 - 17;
- }
- }
- }
- }
-
- if (majRev == 1 && minRev == 3)
- {
- memset(m_blupi, 0, sizeof(Blupi) * MAXBLUPI);
- for (i = 0; i < MAXBLUPI; i++)
- {
- nb = fread(&oldBlupi, sizeof(OldBlupi), 1, file);
- if (nb != 1) goto error;
- memcpy(m_blupi + i, &oldBlupi, sizeof(OldBlupi));
- ListFlush(i);
- }
- }
- else
- {
- nb = fread(m_blupi, sizeof(Blupi), MAXBLUPI, file);
- if (nb < MAXBLUPI) goto error;
- }
-
- nb = fread(m_move, sizeof(Move), MAXMOVE, file);
- if (nb < MAXMOVE) goto error;
-
- nb = fread(m_lastDrapeau, sizeof(POINT), MAXLASTDRAPEAU, file);
- if (nb < MAXLASTDRAPEAU)
- {
- InitDrapeau();
- }
-
- BlupiDeselect();
-
- free(pBuffer);
- fclose(file);
- return TRUE;
-
-error:
- if (pBuffer != NULL) free(pBuffer);
- if (file != NULL) fclose(file);
-
- Flush();
- return FALSE;
-}
-
-BOOL CDecor::SomethingMissionPath(int gamer, int mission, BOOL bUser)
-{
-
-}
-
-BOOL CDecor::MissionStart(int gamer, int mission, BOOL bUser)
-{
-
-}
-
-BOOL CDecor::Read(int gamer, int mission, BOOL *pbMission, BOOL *pbPrivate)
-{
-
-}
-
-BOOL CDecor::Write(int gamer, int mission, char* param3)
-{
-
-}
diff --git a/decmove.cpp b/decmove.cpp
deleted file mode 100644
index a751cb5..0000000
--- a/decmove.cpp
+++ /dev/null
@@ -1,2214 +0,0 @@
-// DecMove.cpp
-//
-
-#include "def.h"
-#include "decor.h"
-#include "misc.h"
-
-BOOL CDecor::TestPath(RECT rect, POINT start, POINT end)
-{
- int num = abs(end.x - start.x);
- int num2 = abs(end.y - start.y);
-
- POINT tinyPoint = start;
- if (num > num2)
- {
- RECT rect2;
- if (end.x > start.x)
- {
- for (int i = 0; i <= num; i++)
- {
- int j = i * (end.y - start.y) / num;
- rect2.left = rect.left + i;
- rect2.right = rect.right + i;
- rect2.top = rect.top + j;
- rect2.bottom = rect.bottom + j;
- if (DecorDetect(rect2))
- {
- end = tinyPoint;
- return FALSE;
- }
- tinyPoint.x = start.x + i;
- tinyPoint.y = start.y + j;
- }
- }
- if (end.x < start.x)
- {
- for (int i = 0; i >= -num; i--)
- {
- int j = i * (start.y - end.y) / num;
- rect2.left = rect.left + i;
- rect2.right = rect.right + i;
- rect2.top = rect.top + j;
- rect2.bottom = rect.bottom + j;
- if (DecorDetect(rect2))
- {
- end = tinyPoint;
- return FALSE;
- }
- tinyPoint.x = start.x + i;
- tinyPoint.y = start.y + j;
- }
- }
- }
- else
- {
- RECT rect2;
- if (end.y > start.y)
- {
- for (int j = 0; j <= num2; j++)
- {
- int i = j * (end.x - start.x) / num2;
- rect2.left = rect.left + i;
- rect2.right = rect.right + i;
- rect2.top = rect.top + j;
- rect2.bottom = rect.bottom + j;
- if (DecorDetect(rect2))
- {
- end = tinyPoint;
- return FALSE;
- }
- tinyPoint.x = start.x + i;
- tinyPoint.y = start.y + j;
- }
- }
- if (end.y < start.y)
- {
- for (int j = 0; j >= -num2; j--)
- {
- int i = j * (start.x - end.x) / num2;
- rect2.left = rect.left + i;
- rect2.right = rect.right + i;
- rect2.top = rect.top + j;
- rect2.bottom = rect.bottom + j;
- if (DecorDetect(rect2))
- {
- end = tinyPoint;
- return FALSE;
- }
- tinyPoint.x = start.x + i;
- tinyPoint.y = start.y + j;
- }
- }
- }
- return TRUE;
-}
-
-
-void CDecor::MoveObjectPollution()
-{
-}
-
-void CDecor::MoveObjectPlouf(POINT pos)
-{
- for (int i = 0; i < MAXMOVEOBJECT; i++)
- {
- if (m_moveObject[i].type == 14)
- {
- return;
- }
- }
- pos.y -= 45;
- PlaySound(23, pos);
- ObjectStart(pos, 14, 0);
-}
-
-void CDecor::MoveObjectTiplouf(POINT pos)
-{
- for (int i = 0; i < MAXMOVEOBJECT; i++)
- {
- if (m_moveObject[i].type == 35)
- {
- return;
- }
- }
- if (m_blupiDir == 2)
- {
- pos.x += 5;
- }
- else
- {
- pos.x -= 5;
- }
- pos.y -= 45;
- PlaySound(64, pos);
- ObjectStart(pos, 35, 0);
-}
-
-void CDecor::MoveObjectBlup(POINT pos)
-{
- PlaySound(24, pos);
- pos.y -= 20;
- int num = 0;
- POINT tinyPoint = pos;
- while (tinyPoint.y > 0)
- {
- int icon = m_decor[(tinyPoint.x + 16) / 64, tinyPoint.y / 64]->icon;
- if (icon != 91 && icon != 92)
- {
- break;
- }
- num++;
- tinyPoint.y -= 64;
- }
- num--;
- if (num <= 0)
- {
- return;
- }
- int num2 = MoveObjectFree();
- if (num2 == -1)
- {
- return;
- }
- m_moveObject[num2]->type = 15;
- m_moveObject[num2]->phase = 0;
- m_moveObject[num2]->posCurrent.x = pos.x;
- m_moveObject[num2]->posCurrent.y = pos.y;
- m_moveObject[num2]->posStart = m_moveObject[num2]->posCurrent;
- m_moveObject[num2]->posEnd.x = pos.x;
- m_moveObject[num2]->posEnd.y = pos.y - num * 64;
- m_moveObject[num2]->timeStopStart = 0;
- m_moveObject[num2]->stepAdvance = num * 10;
- m_moveObject[num2]->step = 2;
- m_moveObject[num2]->time = 0;
- MoveObjectStepIcon(num2);
-}
-
-
-void CDecor::FlushBalleTraj()
-{
- for (int i = 0; i < 1300; i++)
- {
- m_balleTraj[i] = 0;
- }
-}
-
-void CDecor::SetBalleTraj(POINT pos)
-{
- 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;
- m_balleTraj[num] |= 1 << num2;
-}
-
-BOOL CDecor::IsBalleTraj(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;
- return (m_balleTraj[num] & 1 << num2) != 0;
-}
-
-void CDecor::FlushMoveTraj()
-{
- for (int i = 0; i < 1300; i++)
- {
- m_moveTraj[i] = 0;
- }
-}
-
-void CDecor::SetMoveTraj(POINT pos)
-{
-
- 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;
- 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;
- return (m_moveTraj[num] & 1 << num2) != 0;
-}
-
-int CDecor::SearchDistRight(POINT pos, POINT dir, int type)
-{
- int num = 0;
- if (type == 36 || type == 39 || type == 41 || type == 42 || type == 93)
- {
- 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))
- {
- if (type == 23)
- {
- SetBalleTraj(pos);
- }
- num += 64;
- pos.x += dir.x;
- pos.y += dir.y;
- }
- if ((type == 34 || type == 38) && num >= 64)
- {
- num -= 64;
- }
- if (type == 23 && num >= 10)
- {
- num -= 10;
- }
- return num;
-}
-
-
-void CDecor::StartSploutchGlu(POINT pos)
-{
- POINT pos2;
- pos2.x = pos.x;
- pos2.y = pos.y;
- ObjectStart(pos2, 98, 0);
- pos2.x = pos.x + 15;
- pos2.y = pos.y + 20;
- ObjectStart(pos2, 99, 0);
- pos2.x = pos.x - 20;
- pos2.y = pos.y + 18;
- ObjectStart(pos2, 99, 0);
- pos2.x = pos.x + 23;
- pos2.y = pos.y - 18;
- ObjectStart(pos2, 99, 0);
- pos2.x = pos.x - 15;
- pos2.y = pos.y - 18;
- ObjectStart(pos2, 99, 0);
- pos2.x = pos.x + 32;
- pos2.y = pos.y + 10;
- ObjectStart(pos2, 100, 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);
-}
-
-int CDecor::ObjectStart(POINT pos, int type, int speed)
-{
- int num = MoveObjectFree();
- if (num == -1)
- {
- return -1;
- }
- m_moveObject[num].type = type;
- m_moveObject[num].phase = 0;
- m_moveObject[num].posCurrent = pos;
- m_moveObject[num].posStart = pos;
- m_moveObject[num].posEnd = pos;
- MoveObjectStopIcon(num);
- if (speed != 0)
- {
- POINT tinyPoint = pos;
- int num2 = speed;
- int num3 = 0;
- if (num2 > 50)
- {
- num2 -= 50;
- POINT dir;
- dir.x = 0;
- dir.y = 1;
- num3 = SearchDistRight(tinyPoint, dir, type);
- tinyPoint.y += num3;
- }
- else if (num < -50)
- {
- num2 += 50;
- POINT dir;
- dir.x = 0;
- dir.y = -1;
- num3 = SearchDistRight(tinyPoint, dir, type);
- tinyPoint.y -= num3;
- }
- else if (num2 > 0)
- {
- POINT dir;
- dir.x = 1;
- dir.y = 0;
- num3 = SearchDistRight(tinyPoint, dir, type);
- tinyPoint.x += num3;
- }
- else if (num2 < 0)
- {
- POINT dir;
- dir.x = -1;
- dir.y = 0;
- num3 = SearchDistRight(tinyPoint, dir, type);
- tinyPoint.x -= num3;
- }
- if (num3 == 0)
- {
- if (type == 23)
- {
- m_moveObject[num].type = 0;
- return num;
- }
- }
- else
- {
- m_moveObject[num].posEnd = tinyPoint;
- m_moveObject[num].timeStopStart = 0;
- m_moveObject[num].stepAdvance = abs(num2 * num3 / 64);
- m_moveObject[num].step = 2;
- m_moveObject[num].time = 0;
- }
- }
- MoveObjectPriority(num);
- return num;
-}
-
-BOOL CDecor::ObjectDelete(POINT pos, int type)
-{
- int num = MoveObjectSearch(pos, type);
- if (num == -1)
- {
- return FALSE;
- }
- if (m_moveObject[num].type == 4 ||
- m_moveObject[num].type == 12 ||
- m_moveObject[num].type == 16 ||
- m_moveObject[num].type == 17 ||
- m_moveObject[num].type == 20 ||
- m_moveObject[num].type == 40 ||
- m_moveObject[num].type == 96 ||
- m_moveObject[num].type == 97)
- {
- int num2 = 17;
- double animationSpeed = 1.0;
- if (m_moveObject[num].type == 4)
- {
- num2 = 7;
- }
- if (m_moveObject[num].type == 17 || m_moveObject[num].type == 20)
- {
- num2 = 33;
- }
- if (m_moveObject[num].type == 40)
- {
- animationSpeed = 0.5;
- }
- ByeByeAdd(m_moveObject[num].channel, m_moveObject[num].icon, m_moveObject[num].posCurrent, num2, animationSpeed);
- }
- m_moveObject[num].type = 0;
- return TRUE;
-}
-
-void CDecor::MoveObjectStep()
-{
- m_blupiVector.x = 0;
- m_blupiVector.y = 0;
- m_blupiTransport = -1;
- for (int i = 0; i < MAXMOVEOBJECT; i++)
- {
- if (m_moveObject[i].type != 0)
- {
- MoveObjectStepLine(i);
- MoveObjectStepIcon(i);
- if (m_moveObject[i].type == 4 ||
- m_moveObject[i].type == 33 ||
- m_moveObject[i].type == 32)
- int num = MovePersoDetect(m_moveObject[i].posCurrent);
- if (num != -1)
- {
- POINT posCurrent = m_moveObject[i].posCurrent;
- posCurrent.x -= 34;
- posCurrent.y -= 34;
- ObjectStart(posCurrent, 8, 0);
- PlaySound(10, m_moveObject[i].posCurrent);
- m_decorAction = 1;
- m_decorPhase = 0;
- posCurrent = m_moveObject[i].posCurrent;
- posCurrent.x += 2;
- posCurrent.y += BLUPIOFFY;
- ObjectDelete(m_moveObject[i].posCurrent, m_moveObject[i].type);
- ObjectStart(posCurrent, 37, 0);
- ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type);
- }
- if (BlupiElectro(m_moveObject[i].posCurrent))
- {
- POINT posCurrent = m_moveObject[i].posCurrent;
- posCurrent.x += 2;
- posCurrent.y += BLUPIOFFY;
- ObjectDelete(m_moveObject[i].posCurrent, m_moveObject[i].type);
- ObjectStart(posCurrent, 38, 55);
- PlaySound(59, posCurrent);
- }
- }
- }
-}
-
-void CDecor::MoveObjectStepLine(int i)
-{
- MoveObject moveObject;
- POINT tinyPoint;
- BOOL flag = FALSE;
- RECT tinyRect;
- if (m_moveObject[i].type == 1 || m_moveObject[i].type == 47 || m_moveObject[i].type == 48 && !m_blupiSuspend)
- {
- RECT src;
- src.left = m_blupiPos.x + 20;
- src.right = m_blupiPos.x + 60 - 20;
- src.top = m_blupiPos.y + 60 - 2;
- src.bottom = m_blupiPos.y + 60 - 1;
- tinyRect.left = m_moveObject[i].posCurrent.x;
- tinyRect.right = m_moveObject[i].posCurrent.x + 64;
- tinyRect.top = m_moveObject[i].posCurrent.y;
- tinyRect.bottom = m_moveObject[i].posCurrent.y + 16;
- RECT tinyRect2;
- flag = IntersectRect(tinyRect2, tinyRect, src);
- tinyPoint = m_moveObject[i].posCurrent;
- }
- POINT posCurrent;
- if (m_blupiFocus && !m_blupiHide && m_moveObject[i].type == 97)
- {
- posCurrent = m_moveObject[i].posCurrent;
- if (posCurrent.x < m_blupiPos.x)
- {
- posCurrent.x++;
- }
- if (posCurrent.x > m_blupiPos.x)
- {
- posCurrent.x--;
- }
- if (posCurrent.y < m_blupiPos.y)
- {
- posCurrent.y++;
- }
- if (posCurrent.y > m_blupiPos.y)
- {
- posCurrent.y--;
- }
- tinyRect.left = posCurrent.x + 10;
- tinyRect.right = posCurrent.x + 60 - 10;
- tinyRect.top = posCurrent.y + 10;
- tinyRect.bottom = posCurrent.y + 60 - 10;
- if (TestPath(tinyRect, m_moveObject[i].posCurrent, posCurrent))
- {
- m_moveObject[i].posCurrent = posCurrent;
- m_moveObject[i].posStart = posCurrent;
- m_moveObject[i].posEnd = posCurrent;
- }
- else
- {
- ObjectDelete(m_moveObject[i].posCurrent, m_moveObject[i].type);
- posCurrent.x -= 34;
- posCurrent.y -= 34;
- ObjectStart(posCurrent, 9, 0);
- PlaySound(10, posCurrent);
- m_decorAction = 1;
- m_decorPhase = 0;
- }
- }
- if (m_moveObject[i].posStart.x != m_moveObject[i].posEnd.x || m_moveObject[i].posStart.y != m_moveObject[i].posEnd.y)
- {
- if (m_moveObject[i].step == 1)
- {
- if (m_moveObject[i].time < m_moveObject[i].timeStopStart)
- {
- moveObject = m_moveObject;
- moveObject[i]->time = moveObject[i]->time + 1;
- }
- else
- {
- m_moveObject[i].step = 2;
- m_moveObject[i].time = 0;
- }
- }
- else if (m_moveObject[i].step == 2)
- {
- if (m_moveObject[i].posCurrent.x != m_moveObject[i].posEnd.x || m_moveObject[i].posCurrent.x != m_moveObject[i].posEnd.y)
- {
- MoveObject[] moveObject2 = m_moveObject;
- moveObject2[i]->time = moveObject2[i]->time + 1;
- 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.y = (m_moveObject[i].posEnd.y - m_moveObject[i].posStart.y) * m_moveObject[i].time / m_moveObject[i].stepAdvance + m_moveObject[i].posStart.y;
- }
-
- }
- else if (m_moveObject[i].type == 15 || m_moveObject[i].type == 23)
- {
- m_moveObject[i].type = 0;
- }
- else if (m_moveObject[i].type == 34)
- {
- m_moveObject[i].posStart = m_moveObject[i].posCurrent;
- m_moveObject[i].posEnd = m_moveObject[i].posCurrent;
- m_moveObject[i].step = 3;
- m_moveObject[i].time = 0;
- }
- else
- {
- m_moveObject[i].step = 3;
- m_moveObject[i].time = 0;
- }
- }
- else if (m_moveObject[i].step == 3)
- {
- if (m_moveObject[i].time < m_moveObject[i].timeStopEnd)
- {
- MoveObject[] moveObject3 = m_moveObject;
- moveObject3[i]->time = moveObject3[i]->time + 1;
- }
- else
- {
- m_moveObject[i].step = 4;
- m_moveObject[i].time = 0;
- }
- }
- else if (m_moveObject[i].step == 4)
- {
- if (m_moveObject[i].posCurrent.x != m_moveObject[i].posStart.x || m_moveObject[i].posCurrent.y != m_moveObject[i].posStart.y)
- {
- MoveObject[] moveObject4 = m_moveObject;
- moveObject4[i]->time = moveObject4[i]->time + 1;
- if (m_moveObject[i].stepRecede != 0)
- {
- 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;
- }
- }
- else
- {
- m_moveObject[i].step = 1;
- m_moveObject[i].time = 0;
- }
- }
- }
- if (m_moveObject[i].type == 22 && m_moveObject[i].step == 3)
- {
- m_moveObject[i].type = 0;
- }
- posCurrent = m_moveObject[i].posCurrent;
- if (m_moveObject[i].type == 1 || m_moveObject[i].type == 47 || m_moveObject[i].type == 48)
- {
- posCurrent.y -= 64;
- }
- posCurrent.x = (posCurrent.x + 32) / 64;
- posCurrent.y = (posCurrent.y + 32) / 64;
- SetMoveTraj(posCurrent);
- if (flag)
- {
- m_blupiVector.x = m_moveObject[i].posCurrent.x - tinyPoint.x;
- m_blupiVector.y = m_moveObject[i].posCurrent.y - (m_blupiPos.y + 60 - BLUPIFLOOR);
- if (m_moveObject[i].type == 47)
- {
- m_blupiVector.x = m_blupiVector.x + 2;
- }
- if (m_moveObject[i].type == 48)
- {
- m_blupiVector.x = m_blupiVector.x - 2;
- }
- if (m_blupiTimeNoAsc == 0)
- {
- m_blupiTransport = i;
- }
- }
-}
-
-void CDecor::MoveObjectStepIcon(int i)
-{
- if (m_moveObject[i]->type == 47)
- {
- m_moveObject[i]->icon = table_chenille[m_moveObject[i]->phase / 1 % 6];
- }
- if (m_moveObject[i]->type == 48)
- {
- m_moveObject[i]->icon = table_chenillei[m_moveObject[i]->phase / 1 % 6];
- }
- if (m_moveObject[i]->type == 2)
- {
- m_moveObject[i]->icon = 12 + m_moveObject[i]->phase / 2 % 9;
- m_moveObject[i]->channel = 10;
- }
- if (m_moveObject[i]->type == 3)
- {
- m_moveObject[i]->icon = 48 + m_moveObject[i]->phase / 2 % 9;
- m_moveObject[i]->channel = 10;
- }
- if (m_moveObject[i]->type == 16)
- {
- m_moveObject[i]->icon = 69 + m_moveObject[i]->phase / 1 % 9;
- m_moveObject[i]->channel = 10;
- }
- if (m_moveObject[i]->type == 96)
- {
- m_moveObject[i]->icon = table_follow1[m_moveObject[i]->phase / 1 % 26];
- m_moveObject[i]->channel = 10;
- }
- if (m_moveObject[i]->type == 97)
- {
- m_moveObject[i]->icon = table_follow2[m_moveObject[i]->phase / 1 % 5];
- m_moveObject[i]->channel = 10;
- }
- if (m_moveObject[i]->type == 200)
- {
- m_moveObject[i]->icon = 257 + m_moveObject[i]->phase / 1 % 6;
- m_moveObject[i]->channel = 2;
- }
- if (m_moveObject[i]->type == 201)
- {
- m_moveObject[i]->icon = 257 + m_moveObject[i]->phase / 1 % 6;
- m_moveObject[i]->channel = 11;
- }
- if (m_moveObject[i]->type == 202)
- {
- m_moveObject[i]->icon = 257 + m_moveObject[i]->phase / 1 % 6;
- m_moveObject[i]->channel = 12;
- }
- if (m_moveObject[i]->type == 203)
- {
- m_moveObject[i]->icon = 257 + m_moveObject[i]->phase / 1 % 6;
- m_moveObject[i]->channel = 13;
- }
- if (m_moveObject[i]->type == 55)
- {
- m_moveObject[i]->icon = 252;
- m_moveObject[i]->channel = 10;
- }
- if (m_moveObject[i]->type == 56)
- {
- m_moveObject[i]->icon = table_dynamitef[m_moveObject[i]->phase / 1 % 100];
- m_moveObject[i]->channel = 10;
- if (m_moveObject[i]->phase == 50)
- {
- DynamiteStart(i, 0, 0);
- }
- if (m_moveObject[i]->phase == 53)
- {
- DynamiteStart(i, -100, 8);
- }
- if (m_moveObject[i]->phase == 55)
- {
- DynamiteStart(i, 80, 10);
- }
- if (m_moveObject[i]->phase == 56)
- {
- DynamiteStart(i, -15, -100);
- }
- if (m_moveObject[i]->phase == 59)
- {
- DynamiteStart(i, 20, 70);
- }
- if (m_moveObject[i]->phase == 62)
- {
- DynamiteStart(i, 30, -50);
- }
- if (m_moveObject[i]->phase == 64)
- {
- DynamiteStart(i, -40, 30);
- }
- if (m_moveObject[i]->phase == 67)
- {
- DynamiteStart(i, -180, 10);
- }
- if (m_moveObject[i]->phase == 69)
- {
- DynamiteStart(i, 200, -10);
- }
- if (m_moveObject[i]->phase >= 70)
- {
- m_moveObject[i]->type = 0;
- }
- }
- if (m_moveObject[i]->type == 5)
- {
- if (m_moveObject[i]->phase / 3 % 22 < 11)
- {
- m_moveObject[i]->icon = m_moveObject[i]->phase / 3 % 11;
- }
- else
- {
- m_moveObject[i]->icon = 11 - m_moveObject[i]->phase / 3 % 11;
- }
- m_moveObject[i]->channel = 10;
- }
- if (m_moveObject[i]->type == 6)
- {
- m_moveObject[i]->icon = 21 + m_moveObject[i]->phase / 4 % 8;
- m_moveObject[i]->channel = 10;
- }
- if (m_moveObject[i]->type == 7)
- {
- m_moveObject[i]->icon = 29 + m_moveObject[i]->phase / 3 % 8;
- m_moveObject[i]->channel = 10;
- }
- if (m_moveObject[i]->type == 21)
- {
- m_moveObject[i]->icon = table_cle[m_moveObject[i]->phase / 3 % 12];
- m_moveObject[i]->channel = 10;
- }
- if (m_moveObject[i]->type == 49)
- {
- m_moveObject[i]->icon = table_cle1[m_moveObject[i]->phase / 3 % 12];
- m_moveObject[i]->channel = 10;
- }
- if (m_moveObject[i]->type == 50)
- {
- m_moveObject[i]->icon = table_cle2[m_moveObject[i]->phase / 3 % 12];
- m_moveObject[i]->channel = 10;
- }
- if (m_moveObject[i]->type == 51)
- {
- m_moveObject[i]->icon = table_cle3[m_moveObject[i]->phase / 3 % 12];
- m_moveObject[i]->channel = 10;
- }
- if (m_moveObject[i]->type == 24)
- {
- m_moveObject[i]->icon = table_skate[m_moveObject[i]->phase / 1 % 34];
- m_moveObject[i]->channel = 10;
- }
- if (m_moveObject[i]->type == 25)
- {
- m_moveObject[i]->icon = table_shield[m_moveObject[i]->phase / 2 % 16];
- m_moveObject[i]->channel = 10;
- }
- if (m_moveObject[i]->type == 26)
- {
- m_moveObject[i]->icon = table_power[m_moveObject[i]->phase / 2 % 8];
- m_moveObject[i]->channel = 10;
- }
- if (m_moveObject[i]->type == 40)
- {
- m_moveObject[i]->icon = table_invert[m_moveObject[i]->phase / 2 % 20];
- m_moveObject[i]->channel = 10;
- }
- if (m_moveObject[i]->type == 31)
- {
- m_moveObject[i]->icon = table_charge[m_moveObject[i]->phase / 2 % 6];
- m_moveObject[i]->channel = 1;
- }
- if (m_moveObject[i]->type == 27)
- {
- m_moveObject[i]->icon = table_magictrack[m_moveObject[i]->phase / 1 % 24];
- m_moveObject[i]->channel = 10;
- if (m_moveObject[i]->phase >= 24)
- {
- m_moveObject[i]->type = 0;
- }
- }
- if (m_moveObject[i]->type == 57)
- {
- m_moveObject[i]->icon = table_shieldtrack[m_moveObject[i]->phase / 1 % 20];
- m_moveObject[i]->channel = 10;
- if (m_moveObject[i]->phase >= 20)
- {
- m_moveObject[i]->type = 0;
- }
- }
- if (m_moveObject[i]->type == 39)
- {
- m_moveObject[i]->icon = table_tresortrack[m_moveObject[i]->phase / 1 % 11];
- m_moveObject[i]->channel = 10;
- if (m_moveObject[i]->phase >= 11)
- {
- m_moveObject[i]->type = 0;
- }
- }
- if (m_moveObject[i]->type == 58 && m_moveObject[i]->phase >= 20)
- {
- m_moveObject[i]->type = 0;
- }
- if (m_moveObject[i]->type == 8)
- {
- if (m_moveObject[i]->phase >= table_explo1->length)
- {
- m_moveObject[i]->type = 0;
- }
- else
- {
- m_moveObject[i]->icon = table_explo1[m_moveObject[i]->phase];
- m_moveObject[i]->channel = 9;
- }
- }
- if (m_moveObject[i]->type == 9)
- {
- if (m_moveObject[i]->phase >= 20)
- {
- m_moveObject[i]->type = 0;
- }
- else
- {
- m_moveObject[i]->icon = table_explo2[m_moveObject[i]->phase % 20];
- m_moveObject[i]->channel = 9;
- }
- }
- if (m_moveObject[i]->type == 10)
- {
- if (m_moveObject[i]->phase >= 20)
- {
- m_moveObject[i]->type = 0;
- }
- else
- {
- m_moveObject[i]->icon = table_explo3[m_moveObject[i]->phase / 1 % 20];
- m_moveObject[i]->channel = 9;
- }
- }
- if (m_moveObject[i]->type == 11)
- {
- if (m_moveObject[i]->phase >= 9)
- {
- m_moveObject[i]->type = 0;
- }
- else
- {
- m_moveObject[i]->icon = table_explo4[m_moveObject[i]->phase / 1 % 9];
- m_moveObject[i]->channel = 9;
- }
- }
- if (m_moveObject[i]->type == 90)
- {
- if (m_moveObject[i]->phase >= 12)
- {
- m_moveObject[i]->type = 0;
- }
- else
- {
- m_moveObject[i]->icon = table_explo5[m_moveObject[i]->phase / 1 % 12];
- m_moveObject[i]->channel = 9;
- }
- }
- if (m_moveObject[i]->type == 91)
- {
- if (m_moveObject[i]->phase >= 6)
- {
- m_moveObject[i]->type = 0;
- }
- else
- {
- m_moveObject[i]->icon = table_explo6[m_moveObject[i]->phase / 1 % 6];
- m_moveObject[i]->channel = 9;
- }
- }
- if (m_moveObject[i]->type == 92)
- {
- if (m_moveObject[i]->phase >= 128)
- {
- m_moveObject[i]->type = 0;
- }
- else
- {
- m_moveObject[i]->icon = table_explo7[m_moveObject[i]->phase / 1 % 128];
- m_moveObject[i]->channel = 9;
- }
- }
- if (m_moveObject[i]->type == 93)
- {
- if (m_moveObject[i]->phase >= 5)
- {
- m_moveObject[i]->type = 0;
- }
- else
- {
- m_moveObject[i]->icon = table_explo8[m_moveObject[i]->phase / 1 % 5];
- m_moveObject[i]->channel = 9;
- }
- }
- if (m_moveObject[i]->type == 98)
- {
- if (m_moveObject[i]->phase >= 10)
- {
- m_moveObject[i]->type = 0;
- }
- else
- {
- m_moveObject[i]->icon = table_sploutch1[m_moveObject[i]->phase / 1 % 10];
- m_moveObject[i]->channel = 9;
- }
- }
- if (m_moveObject[i]->type == 99)
- {
- if (m_moveObject[i]->phase >= 13)
- {
- m_moveObject[i]->type = 0;
- }
- else
- {
- m_moveObject[i]->icon = table_sploutch2[m_moveObject[i]->phase / 1 % 13];
- m_moveObject[i]->channel = 9;
- }
- }
- if (m_moveObject[i]->type == 100)
- {
- if (m_moveObject[i]->phase >= 18)
- {
- m_moveObject[i]->type = 0;
- }
- else
- {
- m_moveObject[i]->icon = table_sploutch3[m_moveObject[i]->phase / 1 % 18];
- m_moveObject[i]->channel = 9;
- }
- }
- if (m_moveObject[i]->type == 53)
- {
- if (m_moveObject[i]->phase >= 90)
- {
- m_moveObject[i]->type = 0;
- }
- else
- {
- m_moveObject[i]->icon = table_tentacule[m_moveObject[i]->phase / 2 % 45];
- m_moveObject[i]->channel = 9;
- }
- }
- TinyPoint pos;
- if (m_moveObject[i]->type == 52)
- {
- if (m_moveObject[i]->phase == 0)
- {
- PlaySound(72, m_moveObject[i]->posStart);
- }
- if (m_moveObject[i]->phase == 137)
- {
- PlaySound(73, m_moveObject[i]->posStart);
- }
- if (m_moveObject[i]->phase >= 157)
- {
- m_moveObject[i]->type = 0;
- }
- else
- {
- m_moveObject[i]->icon = table_bridge[m_moveObject[i]->phase / 1 % 157];
- m_moveObject[i]->channel = 1;
- pos->X = m_moveObject[i]->posStart->X / 64;
- pos->Y = m_moveObject[i]->posStart->Y / 64;
- m_decor[pos->X, pos->Y]->icon = m_moveObject[i]->icon;
- }
- }
- if (m_moveObject[i]->type == 36)
- {
- if (m_moveObject[i]->phase >= 16)
- {
- m_moveObject[i]->type = 0;
- }
- else
- {
- m_moveObject[i]->icon = table_pollution[m_moveObject[i]->phase / 2 % 8];
- m_moveObject[i]->channel = 10;
- }
- }
- if (m_moveObject[i]->type == 41)
- {
- if (m_moveObject[i]->phase >= 16)
- {
- m_moveObject[i]->type = 0;
- }
- else
- {
- m_moveObject[i]->icon = table_invertstart[m_moveObject[i]->phase / 2 % 8];
- m_moveObject[i]->channel = 10;
- }
- }
- if (m_moveObject[i]->type == 42)
- {
- if (m_moveObject[i]->phase >= 16)
- {
- m_moveObject[i]->type = 0;
- }
- else
- {
- m_moveObject[i]->icon = table_invertstop[m_moveObject[i]->phase / 2 % 8];
- m_moveObject[i]->channel = 10;
- }
- }
- if (m_moveObject[i]->type == 14)
- {
- if (m_moveObject[i]->phase >= 14)
- {
- m_moveObject[i]->type = 0;
- }
- else
- {
- m_moveObject[i]->icon = table_plouf[m_moveObject[i]->phase / 2 % 7];
- m_moveObject[i]->channel = 1;
- }
- }
- if (m_moveObject[i]->type == 35)
- {
- if (m_moveObject[i]->phase >= 6)
- {
- m_moveObject[i]->type = 0;
- }
- else
- {
- m_moveObject[i]->icon = table_tiplouf[m_moveObject[i]->phase / 2 % 7];
- m_moveObject[i]->channel = 1;
- }
- }
- if (m_moveObject[i]->type == 15)
- {
- m_moveObject[i]->icon = table_blup[m_moveObject[i]->phase / 2 % 20];
- m_moveObject[i]->channel = 1;
- }
- if (m_moveObject[i]->type == 4)
- {
- if (m_moveObject[i]->posStart->X > m_moveObject[i]->posEnd->X)
- {
- if (m_moveObject[i]->step == 1)
- {
- m_moveObject[i]->icon = table_bulldozer_turn2l[m_moveObject[i]->time % 22];
- }
- if (m_moveObject[i]->step == 3)
- {
- m_moveObject[i]->icon = table_bulldozer_turn2r[m_moveObject[i]->time % 22];
- }
- if (m_moveObject[i]->step == 2)
- {
- m_moveObject[i]->icon = table_bulldozer_left[m_moveObject[i]->time % 8];
- }
- if (m_moveObject[i]->step == 4)
- {
- m_moveObject[i]->icon = table_bulldozer_right[m_moveObject[i]->time % 8];
- }
- }
- else
- {
- if (m_moveObject[i]->step == 1)
- {
- m_moveObject[i]->icon = table_bulldozer_turn2r[m_moveObject[i]->time % 22];
- }
- if (m_moveObject[i]->step == 3)
- {
- m_moveObject[i]->icon = table_bulldozer_turn2l[m_moveObject[i]->time % 22];
- }
- if (m_moveObject[i]->step == 2)
- {
- m_moveObject[i]->icon = table_bulldozer_right[m_moveObject[i]->time % 8];
- }
- if (m_moveObject[i]->step == 4)
- {
- m_moveObject[i]->icon = table_bulldozer_left[m_moveObject[i]->time % 8];
- }
- }
- m_moveObject[i]->channel = 10;
- }
- if (m_moveObject[i]->type == 17)
- {
- if (m_moveObject[i]->posStart.x > m_moveObject[i]->posEnd.x)
- {
- if (m_moveObject[i]->step == 1)
- {
- m_moveObject[i]->icon = table_poisson_turn2l[m_moveObject[i]->time % 48];
- }
- if (m_moveObject[i]->step == 3)
- {
- m_moveObject[i]->icon = table_poisson_turn2r[m_moveObject[i]->time % 48];
- }
- if (m_moveObject[i]->step == 2)
- {
- m_moveObject[i]->icon = table_poisson_left[m_moveObject[i]->time % 8];
- }
- if (m_moveObject[i]->step == 4)
- {
- m_moveObject[i]->icon = table_poisson_right[m_moveObject[i]->time % 8];
- }
- }
- else
- {
- if (m_moveObject[i]->step == 1)
- {
- m_moveObject[i]->icon = table_poisson_turn2r[m_moveObject[i]->time % 48];
- }
- if (m_moveObject[i]->step == 3)
- {
- m_moveObject[i]->icon = table_poisson_turn2l[m_moveObject[i]->time % 48];
- }
- if (m_moveObject[i]->step == 2)
- {
- m_moveObject[i]->icon = table_poisson_right[m_moveObject[i]->time % 8];
- }
- if (m_moveObject[i]->step == 4)
- {
- m_moveObject[i]->icon = table_poisson_left[m_moveObject[i]->time % 8];
- }
- }
- m_moveObject[i]->channel = 10;
- }
- if (m_moveObject[i]->type == 20)
- {
- if (m_moveObject[i]->posStart.x > m_moveObject[i]->posEnd.x)
- {
- if (m_moveObject[i]->step == 1)
- {
- m_moveObject[i]->icon = table_oiseau_turn2l[m_moveObject[i]->time % 10];
- }
- if (m_moveObject[i]->step == 3)
- {
- m_moveObject[i]->icon = table_oiseau_turn2r[m_moveObject[i]->time % 10];
- }
- if (m_moveObject[i]->step == 2)
- {
- m_moveObject[i]->icon = table_oiseau_left[m_moveObject[i]->time % 8];
- }
- if (m_moveObject[i]->step == 4)
- {
- m_moveObject[i]->icon = table_oiseau_right[m_moveObject[i]->time % 8];
- }
- }
- else
- {
- if (m_moveObject[i]->step == 1)
- {
- m_moveObject[i]->icon = table_oiseau_turn2r[m_moveObject[i]->time % 10];
- }
- if (m_moveObject[i]->step == 3)
- {
- m_moveObject[i]->icon = table_oiseau_turn2l[m_moveObject[i]->time % 10];
- }
- if (m_moveObject[i]->step == 2)
- {
- m_moveObject[i]->icon = table_oiseau_right[m_moveObject[i]->time % 8];
- }
- if (m_moveObject[i]->step == 4)
- {
- m_moveObject[i]->icon = table_oiseau_left[m_moveObject[i]->time % 8];
- }
- }
- m_moveObject[i]->channel = 10;
- }
- if (m_moveObject[i]->type == 44)
- {
- if (m_moveObject[i]->posStart.x > m_moveObject[i]->posEnd.x)
- {
- if (m_moveObject[i]->step == 1)
- {
- m_moveObject[i]->icon = table_guepe_turn2l[m_moveObject[i]->time % 5];
- }
- if (m_moveObject[i]->step == 3)
- {
- m_moveObject[i]->icon = table_guepe_turn2r[m_moveObject[i]->time % 5];
- }
- if (m_moveObject[i]->step == 2)
- {
- m_moveObject[i]->icon = table_guepe_left[m_moveObject[i]->time % 6];
- }
- if (m_moveObject[i]->step == 4)
- {
- m_moveObject[i]->icon = table_guepe_right[m_moveObject[i]->time % 6];
- }
- }
- else
- {
- if (m_moveObject[i]->step == 1)
- {
- m_moveObject[i]->icon = table_guepe_turn2r[m_moveObject[i]->time % 5];
- }
- if (m_moveObject[i]->step == 3)
- {
- m_moveObject[i]->icon = table_guepe_turn2l[m_moveObject[i]->time % 5];
- }
- if (m_moveObject[i]->step == 2)
- {
- m_moveObject[i]->icon = table_guepe_right[m_moveObject[i]->time % 6];
- }
- if (m_moveObject[i]->step == 4)
- {
- m_moveObject[i]->icon = table_guepe_left[m_moveObject[i]->time % 6];
- }
- }
- m_moveObject[i]->channel = 10;
- }
- if (m_moveObject[i]->type == 54)
- {
- if (m_moveObject[i]->posStart.x > m_moveObject[i]->posEnd.x)
- {
- if (m_moveObject[i]->step == 1)
- {
- m_moveObject[i]->icon = table_creature_turn2[m_moveObject[i]->time % 152];
- }
- if (m_moveObject[i]->step == 3)
- {
- m_moveObject[i]->icon = table_creature_turn2[m_moveObject[i]->time % 152];
- }
- if (m_moveObject[i]->step == 2)
- {
- m_moveObject[i]->icon = table_creature_left[m_moveObject[i]->time % 8];
- }
- if (m_moveObject[i]->step == 4)
- {
- m_moveObject[i]->icon = table_creature_right[m_moveObject[i]->time % 8];
- }
- }
- else
- {
- if (m_moveObject[i]->step == 1)
- {
- m_moveObject[i]->icon = table_creature_turn2[m_moveObject[i]->time % 152];
- }
- if (m_moveObject[i]->step == 3)
- {
- m_moveObject[i]->icon = table_creature_turn2[m_moveObject[i]->time % 152];
- }
- if (m_moveObject[i]->step == 2)
- {
- m_moveObject[i]->icon = table_creature_right[m_moveObject[i]->time % 8];
- }
- if (m_moveObject[i]->step == 4)
- {
- m_moveObject[i]->icon = table_creature_left[m_moveObject[i]->time % 8];
- }
- }
- m_moveObject[i]->channel = 10;
- }
- if (m_moveObject[i]->type == 32)
- {
- if (m_moveObject[i]->posStart.x > m_moveObject[i]->posEnd.x)
- {
- if (m_moveObject[i]->step == 1)
- {
- m_moveObject[i]->icon = table_blupih_turn2l[m_moveObject[i]->time % 26];
- }
- if (m_moveObject[i]->step == 3)
- {
- m_moveObject[i]->icon = table_blupih_turn2r[m_moveObject[i]->time % 26];
- }
- if (m_moveObject[i]->step == 2)
- {
- m_moveObject[i]->icon = table_blupih_left[m_moveObject[i]->time % 8];
- }
- if (m_moveObject[i]->step == 4)
- {
- m_moveObject[i]->icon = table_blupih_right[m_moveObject[i]->time % 8];
- }
- }
- else
- {
- if (m_moveObject[i]->step == 1)
- {
- m_moveObject[i]->icon = table_blupih_turn2r[m_moveObject[i]->time % 26];
- }
- if (m_moveObject[i]->step == 3)
- {
- m_moveObject[i]->icon = table_blupih_turn2l[m_moveObject[i]->time % 26];
- }
- if (m_moveObject[i]->step == 2)
- {
- m_moveObject[i]->icon = table_blupih_right[m_moveObject[i]->time % 8];
- }
- if (m_moveObject[i]->step == 4)
- {
- m_moveObject[i]->icon = table_blupih_left[m_moveObject[i]->time % 8];
- }
- }
- if ((m_moveObject[i]->step == 1 || m_moveObject[i]->step == 3) && m_moveObject[i]->time == 21)
- {
- pos.x = m_moveObject[i]->posCurrent.x;
- pos.y = m_moveObject[i]->posCurrent.y + 40;
- if (ObjectStart(pos, 23, 55) != -1)
- {
- PlaySound(52, pos);
- }
- }
- }
- if (m_moveObject[i]->type == 33)
- {
- if (m_moveObject[i]->posStart.x > m_moveObject[i]->posEnd.x)
- {
- if (m_moveObject[i]->step == 1)
- {
- m_moveObject[i]->icon = table_blupit_turn2l[m_moveObject[i]->time % 24];
- }
- if (m_moveObject[i]->step == 3)
- {
- m_moveObject[i]->icon = table_blupit_turn2r[m_moveObject[i]->time % 24];
- }
- if (m_moveObject[i]->step == 2)
- {
- m_moveObject[i]->icon = table_blupit_left[m_moveObject[i]->time % 8];
- }
- if (m_moveObject[i]->step == 4)
- {
- m_moveObject[i]->icon = table_blupit_right[m_moveObject[i]->time % 8];
- }
- }
- else
- {
- if (m_moveObject[i]->step == 1)
- {
- m_moveObject[i]->icon = table_blupit_turn2r[m_moveObject[i]->time % 24];
- }
- if (m_moveObject[i]->step == 3)
- {
- m_moveObject[i]->icon = table_blupit_turn2l[m_moveObject[i]->time % 24];
- }
- if (m_moveObject[i]->step == 2)
- {
- m_moveObject[i]->icon = table_blupit_right[m_moveObject[i]->time % 8];
- }
- if (m_moveObject[i]->step == 4)
- {
- m_moveObject[i]->icon = table_blupit_left[m_moveObject[i]->time % 8];
- }
- }
- if ((m_moveObject[i]->step == 1 || m_moveObject[i]->step == 3) && m_moveObject[i]->time == 3)
- {
- int speed;
- if ((m_moveObject[i]->posStart.x < m_moveObject[i]->posEnd.x && m_moveObject[i]->step == 1) || (m_moveObject[i]->posStart.x > m_moveObject[i]->posEnd.x && m_moveObject[i]->step == 3))
- {
- pos.x = m_moveObject[i]->posCurrent.x - 30;
- pos.y = m_moveObject[i]->posCurrent.x + BLUPIOFFY;
- speed = -5;
- }
- else
- {
- pos.x = m_moveObject[i]->posCurrent.x + 30;
- pos.y = m_moveObject[i]->posCurrent.y + BLUPIOFFY;
- speed = 5;
- }
- if (ObjectStart(pos, 23, speed) != -1)
- {
- PlaySound(52, pos);
- }
- }
- if ((m_moveObject[i]->step == 1 || m_moveObject[i]->step == 3) && m_moveObject[i]->time == 21)
- {
- int speed;
- if ((m_moveObject[i]->posStart.x < m_moveObject[i]->posEnd.x && m_moveObject[i]->step == 1) || (m_moveObject[i]->posStart.x > m_moveObject[i]->posEnd.x && m_moveObject[i]->step == 3))
- {
- pos.x = m_moveObject[i]->posCurrent.x + 30;
- pos.y = m_moveObject[i]->posCurrent.y + BLUPIOFFY;
- speed = 5;
- }
- else
- {
- pos.x = m_moveObject[i]->posCurrent.x - 30;
- pos.y = m_moveObject[i]->posCurrent.y + BLUPIOFFY;
- speed = -5;
- }
- if (ObjectStart(pos, 23, speed) != -1)
- {
- PlaySound(52, pos);
- }
- }
- }
- if (m_moveObject[i]->type == 34)
- {
- m_moveObject[i]->icon = table_glu[m_moveObject[i]->phase / 1 % 25];
- m_moveObject[i]->channel = 10;
- }
- if (m_moveObject[i]->type == 37)
- {
- if (m_moveObject[i]->phase >= 70)
- {
- m_moveObject[i]->type = 0;
- }
- else
- {
- m_moveObject[i]->icon = table_clear[m_moveObject[i]->phase / 1 % 70];
- m_moveObject[i]->channel = 10;
- }
- }
- if (m_moveObject[i]->type == 38)
- {
- if (m_moveObject[i]->phase >= 90)
- {
- m_moveObject[i]->type = 0;
- }
- else
- {
- m_moveObject[i]->icon = table_electro[m_moveObject[i]->phase / 1 % 90];
- if (m_moveObject[i]->phase < 30)
- {
- m_moveObject[i]->channel = 12;
- }
- else
- {
- m_moveObject[i]->channel = 10;
- }
- }
- }
- if (m_moveObject[i]->type == 13)
- {
- m_moveObject[i]->icon = 68;
- m_moveObject[i]->channel = 10;
- }
- if (m_moveObject[i]->type == 46)
- {
- m_moveObject[i]->icon = 208;
- m_moveObject[i]->channel = 10;
- }
- if (m_moveObject[i]->type == 19)
- {
- m_moveObject[i]->icon = 89;
- m_moveObject[i]->channel = 10;
- }
- if (m_moveObject[i]->type == 28)
- {
- m_moveObject[i]->icon = 167;
- m_moveObject[i]->channel = 10;
- }
- if (m_moveObject[i]->type == 23)
- {
- m_moveObject[i]->icon = 176;
- m_moveObject[i]->channel = 10;
- }
- if (m_moveObject[i]->type == 29)
- {
- m_moveObject[i]->icon = 177;
- m_moveObject[i]->channel = 10;
- }
- if (m_moveObject[i]->type == 30)
- {
- m_moveObject[i]->icon = 178;
- m_moveObject[i]->channel = 10;
- }
- MoveObject[] moveObject = m_moveObject;
- moveObject[i]->phase = moveObject[i]->phase + 1;
- if (m_moveObject[i]->phase > 32700)
- {
- m_moveObject[i]->phase = 0;
- }
-}
-
-void CDecor::DynamiteStart(int i, int dx, int dy)
-{
- POINT posStart = m_moveObject[i].posStart;
- posStart.x -= 34;
- posStart.y -= 34;
- posStart.x += dx;
- posStart.y -= dy;
- ObjectStart(posStart, 8, 0);
- if (dx == 0 && dy == 0)
- {
- PlaySound(10, posStart);
- m_decorAction = 1;
- m_decorPhase = 0;
- }
- RECT src;
- src.left = posStart.x;
- src.right = posStart.x + 128;
- src.top = posStart.y;
- src.bottom = posStart.y + 128;
- POINT tinyPoint;
- for (int j = 0; j < 2; j++)
- {
- tinyPoint.x = posStart.x / 64;
- for (int k = 0; k < 2; j++)
- {
- if (tinyPoint.x >= 0 && tinyPoint.x < 100 && tinyPoint.y >= 0 && tinyPoint.y < 100)
- {
- int icon = m_decor[tinyPoint.x, tinyPoint.y]->icon;
- if (icon == 378 || icon == 379 || icon == 404 || icon == 410)
- {
- POINT pos;
- pos.x = tinyPoint.x * 64;
- pos.y = tinyPoint.y * 64;
- ModifDecor(pos, -1);
- }
- }
- tinyPoint.x++;
- }
- tinyPoint.y++;
- }
- for (i = 0; i < MAXMOVEOBJECT; i++)
- {
- if (m_moveObject[i].type == 2 || m_moveObject[i].type == 3 || m_moveObject[i].type == 96 || m_moveObject[i].type == 97 || m_moveObject[i].type == 4 ||
- m_moveObject[i].type == 6 || m_moveObject[i].type == 12 || m_moveObject[i].type == 13 || m_moveObject[i].type == 16 || m_moveObject[i].type == 17 ||
- m_moveObject[i].type == 19 || m_moveObject[i].type == 20 || m_moveObject[i].type == 24 || m_moveObject[i].type == 25 || m_moveObject[i].type == 26 || m_moveObject[i].type == 28 ||
- m_moveObject[i].type == 30 || m_moveObject[i].type == 32 || m_moveObject[i].type == 33 || m_moveObject[i].type == 34 || m_moveObject[i].type == 40 || m_moveObject[i].type == 44 ||
- m_moveObject[i].type == 46 || m_moveObject[i].type == 52 || m_moveObject[i].type == 54 || m_moveObject[i].type == 200 || m_moveObject[i].type == 201 || m_moveObject[i].type == 202 ||
- m_moveObject[i].type == 203)
- {
- RECT src2;
- src2.left = m_moveObject[i].posCurrent.x;
- src2.right = m_moveObject[i].posCurrent.x + 60;
- src2.top = m_moveObject[i].posCurrent.y;
- src2.bottom = m_moveObject[i].posCurrent.y + 20;
- RECT tinyRect;
- if (IntersectRect(tinyRect, src2, src))
- {
- if (m_moveObject[i].type == 12)
- {
- SearchLinkCaisse(i, TRUE);
- for (int l = 0; l < m_nbLinkCaisse; l++)
- {
- int channel = m_moveObject[m_linkCaisse[l]]->channel;
- int icon2 = m_moveObject[m_linkCaisse[l]]->icon;
- POINT posCurrent = m_moveObject[m_linkCaisse[l]]->posCurrent;
- double num = (double)Random(7, 23);
- if (m_random->next(0, 100) % 2 == 0)
- {
- num = -num;
- }
- ByeByeAdd(channel, icon2, posCurrent, num, 1.0);
- m_moveObject[m_linkCaisse[l]]->type = 0;
- }
- ObjectDelete(m_moveObject[i].posCurrent, m_moveObject[i].type);
- UpdateCaisse();
- }
- else
- {
- ObjectDelete(m_moveObject[i].posCurrent, m_moveObject[i].type);
- }
- }
- }
- }
- if (m_blupiFocus && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi && m_blupiPos.x > posStart.x - 30 && m_blupiPos.x < posStart.x + 30 + 64 && m_blupiPos.y > posStart.y - 30 && m_blupiPos.y < posStart.y + 30 + 64)
- {
- BlupiDead(11, -1);
- m_blupiAir = TRUE;
- }
-
-}
-
-int CDecor::AscenseurDetect(RECT rect, POINT oldpos, POINT newpos)
-{
- if (m_blupiTimeNoAsc != 0)
- {
- return -1;
- }
- int num = newpos.y - oldpos.y;
- int num2;
- if (num < 0)
- {
- num2 = -30;
- }
- else
- {
- num2 = 30;
- }
- num = abs(num);
- for (int i = 0; i < MAXMOVEOBJECT; i++)
- {
- if (m_moveObject[i].type == 1 || m_moveObject[i].type == 47 || m_moveObject[i].type == 48)
- {
- RECT src;
- src.left = m_moveObject[i]->posCurrent.x;
- src.right = m_moveObject[i]->posCurrent.x + 64;
- src.top = m_moveObject[i]->posCurrent.y;
- src.bottom = m_moveObject[i]->posCurrent.y + 16;
- if (num < 30)
- {
- RECT tinyRect;
- if (IntersectRect(tinyRect, src, rect))
- {
- return i;
- }
- }
- else
- {
- RECT src2 = rect;
- src2.top -= num / 30 * num2;
- src2.bottom -= num / 30 * num2;
- for (int j = 0; j <= num / 30; j++)
- {
- RECT tinyRect;
- if (IntersectRect(tinyRect, src, src2))
- {
- return i;
- }
- src2.top += num2;
- src2.bottom += num;
- }
- }
-
- }
- }
- return -1;
-}
-
-void CDecor::AscenseurVertigo(int i, BOOL* pbVertigoLeft, BOOL* pbVertigoRight)
-{
- bVertigoLeft = FALSE;
- bVertigoRight = FALSE;
- if (m_blupiPos.x + 20 + 4 < m_moveObject[i]->posCurrent.x)
- {
- bVertigoLeft = TRUE;
- }
- if (m_blupiPos.x + 60 - 20 - 4 > m_moveObject[i]->posCurrent.x + 64)
- {
- bVertigoRight = TRUE;
- }
- if (AscenseurShift(i))
- {
- if (bVertigoLeft)
- {
- bVertigoLeft = FALSE;
- bVertigoRight = TRUE;
- m_blupiTimeNoAsc = 10;
- return;
- }
- if (bVertigoRight)
- {
- bVertigoRight = FALSE;
- bVertigoLeft = TRUE;
- m_blupiTimeNoAsc = 10;
- }
- }
-}
-
-BOOL CDecor::AscenseurShift(int i)
-{
- return i != -1 && m_moveObject[i]->icon >= 311 && m_moveObject[i]->icon <= 316;
-}
-
-void CDecor::AscenseurSynchro(int i)
-{
- for (i = 0; i < MAXMOVEOBJECT; i++)
- {
- m_moveObject[i]->posCurrent = m_moveObject[i]->posStart;
- m_moveObject[i]->step = 1;
- m_moveObject[i]->time = 0;
- m_moveObject[i]->phase = 0;
- }
-}
-
-void CDecor::UpdateCaisse()
-{
- m_nbRankCaisse = 0;
- for (int i = 0; i < MAXMOVEOBJECT; i++)
- {
- if (m_moveObject[i].type == TYPE_CAISSE)
- {
- m_rankCaisse[m_nbRankCaisse++] = i;
- }
- }
-}
-
-BOOL CDecor::TestPushCaisse(int i, POINT pos, BOOL bPop)
-{
- POINT move;
-
- move.x = pos.x - m_moveObject[i].posCurrent.x;
- move.y = 0;
- SearchLinkCaisse(i, bPop);
- int y = m_moveObject[i].posCurrent.y;
- for (int j = 0; j < m_nbLinkCaisse; j++)
- {
- i = m_linkCaisse[j];
- if (!TestPushOneCaisse(i, move, y))
- {
- return FALSE;
- }
- }
- for (int j = 0; j < m_nbLinkCaisse; j++)
- {
- i = m_linkCaisse[j];
- int num = i;
- m_moveObject[num].posCurrent.x = m_moveObject[num].posCurrent.x + move.x;
- m_moveObject[num].posStart.x = m_moveObject[num].posStart.x + move.x;
- int num2 = i;
- m_moveObject[num].posEnd.x = m_moveObject[num].posEnd.x + move.x;
- }
- return TRUE;
-}
-
-BOOL CDecor::TestPushOneCaisse(int i, POINT move, int b)
-{
-
-}
-
-void CDecor::SearchLinkCaisse(int rank, BOOL bPop)
-{
- m_nbLinkCaisse = 0;
- AddLinkCaisse(rank);
- POINT posCurrent = m_moveObject;
-
- BOOL flag;
- do
- {
- flag = FALSE;
- for (int i = 0; i < m_nbLinkCaisse; i++)
- {
- int num = m_linkCaisse[i];
- if (m_moveObject[num]->posCurrent.y <=
- posCurrent.y && (!bPop || (m_moveObject
- [num]->posCurrent.x >= posCurrent.x - 32 &&
- m_moveObject[num]->posCurrent.x <=
- posCurrent.x + 32)))
- {
- RECT src;
- src.left = m_moveObject[num]->posCurrent.x - 1;
- src.top = m_moveObject[num]->posCurrent.y - 1;
- src.right = src.left + 64 + 1;
- src.bottom = src.top + 64 + 1;
- for (int j = 0; j < m_nbRankCaisse; j++)
- {
- int num2 = m_rankCaisse[j];
- if (num2 != num && m_moveObject[num2]->posCurrent.y <= posCurrent.y && (!bPop || (m_moveObject[num2]->posCurrent.x >= posCurrent.x - 32 && m_moveObject[num2]->posCurrent.x <= posCurrent.x + 32)))
- {
- RECT src2;
- src2.left = m_moveObject[num2]->posCurrent.x - 1;
- src2.top = m_moveObject[num2]->posCurrent.y - 1;
- src2.right = src2.left + 64 + 1;
- src2.bottom = src2.top + 64 + 1;
- RECT tinyRect;
- if (IntersectRect(tinyRect, src2, src) && AddLinkCaisse(num2))
- {
- flag = TRUE;
- }
- }
- }
- }
- }
- } while (flag);
-}
-
-BOOL CDecor::AddLinkCaisse(int rank)
-{
- for (int i = 0; i < m_nbLinkCaisse; i++)
- {
- if (m_linkCaisse[i] == rank)
- {
- return FALSE;
- }
- }
- m_linkCaisse[m_nbLinkCaisse] = rank;
- m_nbLinkCaisse++;
- return TRUE;
-}
-
-int CDecor::CaisseInFront()
-{
- POINT tinyPoint;
- if (m_blupiDir == 1)
- {
- tinyPoint.x = m_blupiPos.x + 16 - 32;
- tinyPoint.y = m_blupiPos.y;
- }
- else
- {
- tinyPoint.x = m_blupiPos.x + 60 - 16 + 32;
- tinyPoint.y = m_blupiPos.y;
- }
- for (int i = 0; i < m_nbRankCaisse; i++)
- {
- int num = m_rankCaisse[i];
- if (tinyPoint.x > m_moveObject[num]->posCurrent.x &&
- tinyPoint.x < m_moveObject[num]->posCurrent.x + 64 &&
- tinyPoint.y > m_moveObject[num]->posCurrent.y &&
- tinyPoint.y < m_moveObject[num]->posCurrent.y + 64)
- {
- return num;
- }
- }
- return -1;
-}
-
-int CDecor::CaisseGetMove(int max)
-{
- max -= (m_nbLinkCaisse - 1) / 2;
- if (max < 1)
- {
- max = 1;
- }
- if (m_blupiPower)
- {
- max *= 2;
- }
- if (m_blupiPhase < 20)
- {
- max = max * m_blupiPhase / 20;
- if (max == 0)
- {
- max++;
- }
- }
- return max;
-}
-
-int CDecor::MockeryDetect(POINT pos)
-{
- if (m_blupiTimeMockery > 0)
- {
- return 0;
- }
- if (m_blupiAir)
- {
- POINT tinyPoint;
- tinyPoint.x = pos.x + 30;
- tinyPoint.y = pos.y + 30 + 64;
- if (tinyPoint.x >= 0 && tinyPoint.x < 6400 && tinyPoint.y >= 0 && tinyPoint.y < 6400)
- {
- int icon = m_decor[tinyPoint.x / 64, tinyPoint.y / 64]->icon;
- if (icon == 68 || icon == 317)
- {
- return 64;
- }
- }
- }
- RECT src;
- src.left = pos.x;
- src.right = pos.x + 60;
- src.top = pos.y + 11;
- src.bottom = pos.y + 60;
- if (m_blupiAir)
- {
- src.bottom += 90;
- }
- for (int i = 0; i < MAXMOVEOBJECT; i++)
- {
- if (m_moveObject[i]->type == 2 ||
- m_moveObject[i]->type == 16 ||
- m_moveObject[i]->type == 96 ||
- m_moveObject[i]->type == 97 ||
- m_moveObject[i]->type == 4 ||
- m_moveObject[i]->type == 20 ||
- m_moveObject[i]->type == 44 ||
- m_moveObject[i]->type == 54 ||
- m_moveObject[i]->type == 23 ||
- m_moveObject[i]->type == 32 ||
- m_moveObject[i]->type == 33)
- {
- RECT src2;
- src2.left = m_moveObject[i]->posCurrent.x;
- src2.right = m_moveObject[i]->posCurrent.x + 60;
- src2.top = m_moveObject[i]->posCurrent.y + 36;
- src2.bottom = m_moveObject[i]->posCurrent.y + 60;
- RECT tinyRect;
- if (IntersectRect(tinyRect, src2, src))
- {
- if (m_moveObject[i]->type == 54)
- {
- return 83;
- }
- if (m_blupiDir == 2)
- {
- if (pos.x >= src2.left)
- {
- return 64;
- }
- if (m_moveObject[i]->type == 2)
- {
- return 0;
- }
- return 63;
- }
- else
- {
- if (pos.x < src2.left)
- {
- return 64;
- }
- if (m_moveObject[i]->type == 2)
- {
- return 0;
- }
- return 63;
- }
- }
- }
- }
- return 0;
-}
-
-BOOL CDecor::BlupiElectro(POINT pos)
-{
- if (m_blupiCloud)
- {
- return FALSE;
- }
- RECT src;
- src.left = pos.x + 16;
- src.right = pos.x + 60 - 16;
- src.top = pos.y + 11;
- src.bottom = pos.y + 60 - 2;
- RECT src2;
- src2.left = m_blupiPos.x - 16 - 40;
- src2.right = m_blupiPos.x + 60 + 16 + 40;
- src2.top = m_blupiPos.y + 11 - 40;
- src2.bottom = m_blupiPos.y + 60 - 2 + 40;
- RECT tinyRect;
- return IntersectRect(tinyRect, src, src2);
-}
-
-void CDecor::MoveObjectFollow(POINT pos)
-{
- if (m_blupiHide)
- {
- return;
- }
- RECT src = BlupiRect(pos);
- src.left = pos.x + 16;
- src.right = pos.x + 60 - 16;
- for (int i = 0; i < MAXMOVEOBJECT; i++)
- {
- if (m_moveObject[i]->type == 96)
- {
- RECT src2;
- src2.left = m_moveObject[i]->posCurrent.x - 100;
- src2.right = m_moveObject[i]->posCurrent.x + 60 + 100;
- src2.top = m_moveObject[i]->posCurrent.y - 100;
- src2.bottom = m_moveObject[i]->posCurrent.y + 60 + 100;
- RECT tinyRect;
- if (IntersectRect(tinyRect, src2, src))
- {
- m_moveObject[i]->type = 97;
- PlaySound(92, m_moveObject[i]->posCurrent);
- }
- }
- }
-}
-
-int CDecor::MoveObjectDetect(POINT pos, BOOL* pbNear)
-{
- RECT src = BlupiRect(pos);
- src.left = pos.x + 16;
- src.right = pos.x + 60 - 16;
- RECT src2;
- src2.left = src.left - 20;
- src2.right = src.right + 20;
- src2.top = src.top - 40;
- src2.bottom = src.bottom + 30;
-
- for (int i = 0; i < MAXMOVEOBJECT; i++)
- {
- if (m_moveObject[i]->type != 0 &&
- m_moveObject[i]->type != 27 &&
- m_moveObject[i]->type != 57 &&
- m_moveObject[i]->type != 39 &&
- m_moveObject[i]->type != 58 &&
- m_moveObject[i]->type != 34 &&
- m_moveObject[i]->type != 37 &&
- m_moveObject[i]->type != 38 &&
- (m_blupiAction != 14 && m_blupiAction != 29) ||
- m_moveObject[i]->type != 12)
- {
- RECT src3;
-
- }
- }
-}
-
-int CDecor::MoveAscenseurDetect(POINT pos, int height)
-{
- if (m_blupiTimeNoAsc != 0)
- {
- return -1;
- }
- RECT src;
- src.left = pos.x + 12;
- src.right = pos.x + 60 - 12;
- src.top = pos.y + 60 - 2;
- src.bottom = pos.y + 60 + height - 1;
- for (int i = 0; i < MAXMOVEOBJECT; i++)
- {
- if (m_moveObject[i]->type == 1 || m_moveObject[i]->type == 47 || m_moveObject[i]->type == 48)
- {
- RECT src2;
- src2.left = m_moveObject[i]->posCurrent.x;
- src2.right = m_moveObject[i]->posCurrent.x + 64;
- src2.top = m_moveObject[i]->posCurrent.y;
- src2.bottom = m_moveObject[i]->posCurrent.y + 16;
- RECT tinyRect;
- if (IntersectRect(tinyRect, src2, src))
- {
- return i;
- }
- }
- }
- return -1;
-}
-
-int CDecor::MoveChargeDetect(POINT pos)
-{
- RECT src;
- src.left = pos.x + 16;
- src.right = pos.x + 60 - 16;
- src.top = pos.y + 11;
- src.bottom = pos.y + 60 - 2;
- for (int i = 0; i < MAXMOVEOBJECT; i++)
- {
- if (m_moveObject[i]->type == 31)
- {
- RECT src2;
- src2.left = m_moveObject[i]->posCurrent.x - 10;
- src2.right = m_moveObject[i]->posCurrent.x + 60 + 10;
- src2.top = m_moveObject[i]->posCurrent.y + 36;
- src2.bottom = m_moveObject[i]->posCurrent.y + 60;
- RECT tinyRect;
- if (IntersectRect(tinyRect, src2, src))
- {
- return i;
- }
- }
- }
- return -1;
-}
-
-int CDecor::MovePersoDetect(POINT pos)
-{
- RECT src;
- src.left = pos.x + 16;
- src.right = pos.x + 60 - 16;
- src.top = pos.y + 11;
- src.bottom = pos.y + 60 - 2;
- for (int i = 0; i < MAXMOVEOBJECT; i++)
- {
- if (m_moveObject[i]->type >= 200 && m_moveObject[i]->type <= 203)
- {
- RECT src2;
- src2.left = m_moveObject[i]->posCurrent.x - 16;
- src2.right = m_moveObject[i]->posCurrent.x + 60 + 16;
- src2.top = m_moveObject[i]->posCurrent.y + 36;
- src2.bottom = m_moveObject[i]->posCurrent.y + 60;
- RECT tinyRect;
- if (IntersectRect(tinyRect, src2, src))
- {
- return i;
- }
- }
- }
- return -1;
-}
-
-int CDecor::MoveBalleDetect(POINT pos)
-{
-
-}
-
-int CDecor::MoveObjectDelete(POINT cel)
-{
- int result = -1;
- for (int i = 0; i < MAXMOVEOBJECT; i++)
- {
- if (m_moveObject[i]->type != 0)
- {
- if (cel.x == m_moveObject[i]->posStart.x / 64 && cel.y == m_moveObject[i]->posStart.y / 64)
- {
- result = m_moveObject[i]->type;
- m_moveObject[i]->type = 0;
- }
- else if (cel.x == m_moveObject[i]->posEnd.x / 64 && cel.y == m_moveObject[i]->posEnd.y / 64)
- {
- result = m_moveObject[i]->type;
- m_moveObject[i]->type = 0;
- }
- }
- }
- return result;
-}
-
-int CDecor::MoveObjectFree()
-{
- for (int i = 0; i < MAXMOVEOBJECT; i++)
- {
- if (m_moveObject[i]->type == 0)
- {
- m_moveObject[i]->type = 0;
- return i;
- }
- }
- return -1;
-}
-
-int CDecor::SortGetType(int type)
-{
- if (type == 2 || type == 3 || type == 96 || type == 97)
- {
- return 1;
- }
- if (type == 12)
- {
- return 2;
- }
- return 3;
-}
-
-void CDecor::MoveObjectSort()
-{
- MoveObject src = default(MoveObject);
- int num = 0;
- for (int i = 0; i < MAXMOVEOBJECT; i++)
- {
- if (m_moveObject[i]->type != 0)
- {
- MoveObjectCopy(m_moveObject[num++], m_moveObject[i]);
- }
- }
- for (int i = num; i < MAXMOVEOBJECT; i++)
- {
- m_moveObject[i]->type = 0;
- }
- if (num <= 1)
- {
- return;
- }
- BOOL flag;
- do
- {
- flag = FALSE;
- for (int i = 0; i < num - 1; i++)
- {
- if (SortGetType(m_moveObject[i]->type) > SortGetType(m_moveObject[i + 1]->type))
- {
- MoveObjectCopy(src, m_moveObject[i]);
- MoveObjectCopy(m_moveObject[i], m_moveObject[i + 1]);
- MoveObjectCopy(m_moveObject[i + 1], src);
- flag = TRUE;
- }
- }
- } while (flag);
- UpdateCaisse();
- m_nbLinkCaisse = 0;
-}
-
-void CDecor::MoveObjectPriority(int i)
-{
-
-}
-
-int CDecor::MoveObjectSearch(POINT pos, int type)
-{
- for (int i = 0; i < MAXMOVEOBJECT; i++)
- {
- if (m_moveObject[i]->type != 0 && (type == -1 ||
- m_moveObject[i]->type == type))
- {
- if (m_moveObject[i]->type == 23 &&
- m_moveObject[i]->posStart.x != m_moveObject[i]->posEnd.x)
- {
- if (m_moveObject[i]->posCurrent.x >= pos.x - 100 &&
- m_moveObject[i]->posCurrent.x <= pos.x + 100 &&
- m_moveObject[i]->posCurrent.y == pos.y)
- {
- return i;
- }
- }
- else if (m_moveObject[i]->type == 23 &&
- m_moveObject[i]->posStart.y != m_moveObject[i]->posEnd.y)
- {
- if (m_moveObject[i]->posCurrent.y >= pos.y - 100 &&
- m_moveObject[i]->posCurrent.y <= pos.y + 100 &&
- m_moveObject[i]->posCurrent.x == pos.x)
- {
- return i;
- }
- }
- else if (m_moveObject[i]->posCurrent.x == pos.x &&
- m_moveObject[i]->posCurrent.y == pos.y)
- {
- return i;
- }
- }
- }
- return -1;
-}
diff --git a/decnet.cpp b/decnet.cpp
deleted file mode 100644
index 85e2145..0000000
--- a/decnet.cpp
+++ /dev/null
@@ -1,197 +0,0 @@
-// DecNet.cpp
-//
-
-#include "def.h"
-#include "decor.h"
-#include "misc.h"
-#include "network.h"
-
-void CDecor::NetStopCloud(int rank)
-{
- NetMessage msg;
-
- msg.data1 = 0;
- msg.x = 0;
- msg.y = 0;
- msg.type = MESS_STOPCLOUD;
- msg.channel = rank;
- NetMessagePush(&msg);
- return;
-}
-
-void CDecor::NetPlaySound(short channel, POINT pos)
-{
- NetMessage msg;
-
- msg.y = pos.y;
- msg.x = pos.x;
- msg.type = MESS_PLAYSOUND;
- msg.data1 = 0;
- msg.channel = channel;
- NetMessagePush(&msg);
- return;
-}
-
-void CDecor::NetStopSound(short channel)
-{
- NetMessage msg;
-
- msg.data1 = 0;
- msg.x = 0;
- msg.y = 0;
- msg.type = MESS_STOPSOUND;
- msg.channel = channel;
- NetMessagePush(&msg);
-}
-
-void CDecor::NetDataFlush()
-{
- for (int i = 0; i < MAXNETPLAYER; i++)
- {
- m_netPos[i].x = 0;
- m_netPos[i].y = 0;
- m_netIcons[i] = -1;
- m_netUnk1[i] = 0;
- m_netUnk2[i] = 0;
- m_netUnk3[i] = 0;
- m_netPlayerPacketsReceived[i] = 0;
- m_netPlayerPacketsReceived2[i] = 0;
- m_netTimeSincePacket[i] = 0;
- m_netVitesses[i].x = 0;
- m_netVitesses[i].y = 0;
- m_netUnk4[i].x = 0;
- m_netUnk4[i].y = 0;
- }
- m_netPacketsSent = 0;
- m_netPacketsSent2 = 0;
- m_netPacketsReceived = 0;
- m_netPacketsReceived2 = 0;
- m_netPacketIcon = -1;
- NetMessageIndexFlush();
-}
-
-void CDecor::NetFUN_155e0(BYTE _foo, short _bar)
-{
- char data[4]{ 4, _foo, _bar & 0xff, _bar >> 8 };
- m_pNetwork->Send(&data, 4, DPSEND_GUARANTEED);
- return;
-}
-
-void CDecor::TreatNetData()
-{
-
-}
-
-void CDecor::DoNetSmooth(int player)
-{
-
-}
-
-void CDecor::NetFUN_15d50()
-{
-
-}
-
-void CDecor::FUN_15da0(int index, short step)
-{
-
-}
-
-
-void CDecor::NetPlayerCollide(POINT pos, int* out)
-{
- tagRECT rect1;
- RECT rect2;
- RECT rect3;
- //TODO
-
-}
-
-void CDecor::NetMessageIndexFlush()
-{
- m_netMessageIndex1 = 0;
- m_netMessageIndex2 = 0;
- m_netMessageIndex3 = 0;
- return;
-}
-
-BOOL CDecor::NetMessagePush(NetMessage* message)
-{
- NetMessage* messages;
- BYTE data;
- short pos;
- int i;
-
- if (m_netMessageIndex1 == MAXNETMESSAGE) return FALSE;
-
- CopyMemory(&m_netMessages[m_netMessageIndex2], message, sizeof(NetMessage));
- m_netMessageIndex1++;
- m_netMessageIndex2++;
- if (m_netMessageIndex2 == MAXNETMESSAGE)
- {
- m_netMessageIndex2 = 0;
- }
- return TRUE;
-}
-
-BOOL CDecor::NetMessagePop(NetMessage* message)
-{
- if (m_netMessageIndex1 == 0) return FALSE;
-
- CopyMemory(message, &m_netMessages[m_netMessageIndex3], sizeof(NetMessage));
- m_netMessageIndex1--;
- m_netMessageIndex3++;
- if (m_netMessageIndex3 == MAXNETMESSAGE)
- {
- m_netMessageIndex3 = 0;
- }
- return TRUE;
-}
-
-void CDecor::NotifFlush()
-{
- for (int i = 0; i < MAXNOTIF; i++)
- {
- m_notifText[i][0] = '\0';
- }
-
- m_notifTime = 0;
-}
-
-void CDecor::NotifPop()
-{
- for (int i = MAXNOTIF; i > 0; --i)
- {
- strcpy()
- m_notifText[MAXNOTIF - 1][0] = '\0';
- m_notifTime = NOTIFDELAY; // idk
- }
-}
-
-void CDecor::NotifPush(char *str)
-{
- int i;
- for (i = 0; i < MAXNOTIF; i++)
- {
- if (m_notifText[i][0] != '\0') break;
- }
- if (i >= MAXNOTIF)
- {
- NotifPop();
- i = MAXNOTIF - 1;
- }
- strcpy(m_notifText[i], str);
- m_notifTime = NOTIFDELAY;
- m_pSound->PlayImage(SOUND_TRESOR, { LXIMAGE / 2, LYIMAGE / 2 }, -1);
-}
-
-void CDecor::NotifStep()
-{
- if (m_notifTime == 0)
- {
- NotifPop();
- }
- else {
- m_notifTime--;
- }
-}
\ No newline at end of file
diff --git a/obstacle.h b/obstacle.h
deleted file mode 100644
index 87ac4ac..0000000
--- a/obstacle.h
+++ /dev/null
@@ -1,589 +0,0 @@
-#pragma once
-#define Q_EMPTY \
- 0,0,0,0, \
- 0,0,0,0, \
- 0,0,0,0, \
- 0,0,0,0
-#define Q_FULL \
- 1,1,1,1, \
- 1,1,1,1, \
- 1,1,1,1, \
- 1,1,1,1
-#define Q_TRIANGLE_RIGHT \
- 1,1,1,1, \
- 0,1,1,1, \
- 0,0,0,1, \
- 0,0,0,0
-#define Q_TRIANGLE_LEFT \
- 1,1,1,1, \
- 1,1,1,0, \
- 1,0,0,0, \
- 0,0,0,0
-#define Q_TOP_HALF \
- 1,1,1,1, \
- 1,1,1,1, \
- 0,0,0,0, \
- 0,0,0,0
-#define Q_TOP_QUARTER \
- 1,1,1,1, \
- 0,0,0,0, \
- 0,0,0,0, \
- 0,0,0,0
-#define Q_TOP_3_QUARTERS \
- 1,1,1,1, \
- 1,1,1,1, \
- 1,1,1,1, \
- 0,0,0,0
-#define Q_PILLAR \
- 0,1,1,0, \
- 0,1,1,0, \
- 0,1,1,0, \
- 0,1,1,0
-
-extern short table_decor_quart[]
-{
- Q_FULL, // 0
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_TRIANGLE_RIGHT,
-
- Q_TRIANGLE_RIGHT, // 16
- Q_TRIANGLE_LEFT,
- Q_TRIANGLE_LEFT,
-
- 1,1,1,1,
- 1,1,1,1,
- 0,0,1,1,
- 0,0,0,0,
-
- 1,1,1,1,
- 1,1,1,1,
- 1,1,0,0,
- 1,1,0,0,
-
- 1,1,1,1,
- 1,1,1,1,
- 1,1,0,0,
- 0,0,0,0,
-
- Q_EMPTY,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_TOP_HALF,
- Q_TOP_QUARTER,
- Q_FULL,
- Q_FULL,
-
- Q_FULL, // 32
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_TOP_3_QUARTERS,
- Q_TOP_HALF,
- Q_TOP_QUARTER,
-
- Q_FULL, // 48
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
-
- Q_FULL, // 64
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_TRIANGLE_LEFT,
- Q_TRIANGLE_RIGHT,
- Q_EMPTY,
- Q_EMPTY,
- Q_FULL,
- Q_FULL,
-
- Q_FULL, // 80
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_EMPTY,
- Q_EMPTY,
-
- 1,1,1,1,
- 1,1,1,1,
- 1,1,1,1,
- 1,1,0,0,
-
- 1,1,1,1,
- 1,1,1,1,
- 1,1,0,0,
- 1,1,0,0,
-
- 1,1,1,1,
- 1,1,1,1,
- 1,1,1,1,
- 0,1,1,1,
-
- 1,1,1,1,
- 1,1,1,1,
- 0,0,1,1,
- 0,0,1,1,
-
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
-
- Q_FULL, // 96
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
-
- 1,1,1,1,
- 1,1,1,1,
- 1,1,1,0,
- 1,1,1,0,
-
- 1,1,1,1,
- 1,1,1,1,
- 0,1,1,1,
- 0,1,1,1,
-
- Q_EMPTY,
- Q_EMPTY,
-
- Q_EMPTY, // 112
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
-
- 0,0,0,1,
- 0,0,0,1,
- 0,0,0,1,
- 0,0,0,1,
-
- Q_EMPTY,
-
- Q_EMPTY, // 128
-
- 1,0,0,0,
- 1,0,0,0,
- 1,0,0,0,
- 1,0,0,0,
-
- Q_EMPTY,
- Q_EMPTY,
-
- 0,0,0,0,
- 0,0,0,0,
- 0,0,0,0,
- 1,1,1,1,
-
- Q_EMPTY,
- Q_EMPTY,
- Q_TOP_QUARTER,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
-
- Q_FULL, // 144
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_TRIANGLE_LEFT,
- Q_TRIANGLE_RIGHT,
- Q_FULL,
- Q_FULL,
- Q_EMPTY,
- Q_EMPTY,
-
- Q_EMPTY, // 160
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
-
- Q_EMPTY, // 176
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_PILLAR,
- Q_PILLAR,
- Q_EMPTY,
- Q_EMPTY,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
-
- Q_FULL, // 192
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
-
- Q_EMPTY, // 208
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
-
- Q_FULL, // 224
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
-
- Q_EMPTY, // 240
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_TOP_3_QUARTERS,
- Q_TOP_3_QUARTERS,
-
- 1,1,1,1,
- 1,1,1,1,
- 1,1,1,0,
- 0,0,0,0,
-
- Q_FULL,
- Q_FULL,
-
- Q_TOP_3_QUARTERS, // 256
- Q_FULL,
- Q_FULL,
- Q_TOP_3_QUARTERS,
- Q_TOP_3_QUARTERS,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
-
- Q_EMPTY, // 272
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_FULL,
- Q_FULL,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
-
- Q_EMPTY, // 288
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_FULL,
- Q_EMPTY,
- Q_EMPTY,
-
- Q_FULL, // 304
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_TOP_HALF,
- Q_TOP_HALF,
- Q_TOP_HALF,
- Q_TOP_HALF,
- Q_TOP_HALF,
- Q_TOP_HALF,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
-
- Q_EMPTY, // 320
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_TOP_QUARTER,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
-
- 1,1,1,1,
- 1,1,1,1,
- 0,1,1,0,
- 0,1,1,0,
-
- 1,1,1,1,
- 1,1,1,1,
- 0,1,1,0,
- 0,1,1,0,
-
- 1,1,1,1,
- 1,1,1,1,
- 0,1,1,0,
- 0,1,1,0,
-
- 1,1,1,1,
- 1,1,1,1,
- 0,1,1,0,
- 0,1,1,0,
-
- Q_PILLAR,
- Q_PILLAR,
-
- Q_PILLAR, // 336
- Q_EMPTY,
- Q_FULL,
- Q_EMPTY,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
-
- Q_FULL, // 352
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_TOP_QUARTER,
- Q_TOP_QUARTER,
- Q_TOP_QUARTER,
- Q_EMPTY,
-
- Q_EMPTY, // 368
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_FULL,
- Q_FULL,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
-
- Q_EMPTY, // 384
- Q_EMPTY,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_FULL,
- Q_EMPTY,
- Q_EMPTY,
-
- Q_EMPTY, // 400
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
-
- Q_EMPTY, // 416
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_EMPTY,
- Q_PILLAR,
- Q_PILLAR,
- Q_PILLAR,
- Q_PILLAR,
- Q_PILLAR,
- Q_PILLAR,
- Q_PILLAR,
- Q_PILLAR,
- Q_PILLAR,
- Q_PILLAR,
- Q_PILLAR,
-
- Q_PILLAR, // 432
- Q_PILLAR,
- Q_PILLAR,
- Q_PILLAR,
- Q_PILLAR,
- Q_PILLAR,
- Q_PILLAR,
- Q_PILLAR,
- Q_PILLAR
-};
\ No newline at end of file
diff --git a/RCa19860 b/resource/RCa19860
similarity index 100%
rename from RCa19860
rename to resource/RCa19860
diff --git a/RCb19860 b/resource/RCb19860
similarity index 100%
rename from RCb19860
rename to resource/RCb19860
diff --git a/RCc19860 b/resource/RCc19860
similarity index 100%
rename from RCc19860
rename to resource/RCc19860
diff --git a/RCd19860 b/resource/RCd19860
similarity index 100%
rename from RCd19860
rename to resource/RCd19860
diff --git a/arrow.cur b/resource/arrow.cur
similarity index 100%
rename from arrow.cur
rename to resource/arrow.cur
diff --git a/arrowdl.cur b/resource/arrowdl.cur
similarity index 100%
rename from arrowdl.cur
rename to resource/arrowdl.cur
diff --git a/arrowdow.cur b/resource/arrowdow.cur
similarity index 100%
rename from arrowdow.cur
rename to resource/arrowdow.cur
diff --git a/arrowdr.cur b/resource/arrowdr.cur
similarity index 100%
rename from arrowdr.cur
rename to resource/arrowdr.cur
diff --git a/arrowlef.cur b/resource/arrowlef.cur
similarity index 100%
rename from arrowlef.cur
rename to resource/arrowlef.cur
diff --git a/arrowrig.cur b/resource/arrowrig.cur
similarity index 100%
rename from arrowrig.cur
rename to resource/arrowrig.cur
diff --git a/arrowul.cur b/resource/arrowul.cur
similarity index 100%
rename from arrowul.cur
rename to resource/arrowul.cur
diff --git a/arrowup.cur b/resource/arrowup.cur
similarity index 100%
rename from arrowup.cur
rename to resource/arrowup.cur
diff --git a/arrowur.cur b/resource/arrowur.cur
similarity index 100%
rename from arrowur.cur
rename to resource/arrowur.cur
diff --git a/blupi-d.aps b/resource/blupi-d.aps
similarity index 100%
rename from blupi-d.aps
rename to resource/blupi-d.aps
diff --git a/blupi-d.rc b/resource/blupi-d.rc
similarity index 100%
rename from blupi-d.rc
rename to resource/blupi-d.rc
diff --git a/blupi-e.aps b/resource/blupi-e.aps
similarity index 100%
rename from blupi-e.aps
rename to resource/blupi-e.aps
diff --git a/blupi-e.rc b/resource/blupi-e.rc
similarity index 100%
rename from blupi-e.rc
rename to resource/blupi-e.rc
diff --git a/blupi-f.aps b/resource/blupi-f.aps
similarity index 100%
rename from blupi-f.aps
rename to resource/blupi-f.aps
diff --git a/blupi-f.rc b/resource/blupi-f.rc
similarity index 100%
rename from blupi-f.rc
rename to resource/blupi-f.rc
diff --git a/blupi.ico b/resource/blupi.ico
similarity index 100%
rename from blupi.ico
rename to resource/blupi.ico
diff --git a/blupi.rct b/resource/blupi.rct
similarity index 100%
rename from blupi.rct
rename to resource/blupi.rct
diff --git a/empty.cur b/resource/empty.cur
similarity index 100%
rename from empty.cur
rename to resource/empty.cur
diff --git a/fill.cur b/resource/fill.cur
similarity index 100%
rename from fill.cur
rename to resource/fill.cur
diff --git a/map.cur b/resource/map.cur
similarity index 100%
rename from map.cur
rename to resource/map.cur
diff --git a/resource2.h b/resource/resource2.h
similarity index 100%
rename from resource2.h
rename to resource/resource2.h
diff --git a/resrc1.h b/resource/resrc1.h
similarity index 100%
rename from resrc1.h
rename to resource/resrc1.h
diff --git a/rstemp.rct b/resource/rstemp.rct
similarity index 100%
rename from rstemp.rct
rename to resource/rstemp.rct
diff --git a/speedy.aps b/resource/speedy.aps
similarity index 100%
rename from speedy.aps
rename to resource/speedy.aps
diff --git a/speedy.rc b/resource/speedy.rc
similarity index 100%
rename from speedy.rc
rename to resource/speedy.rc
diff --git a/speedyblupi.aps b/resource/speedyblupi.aps
similarity index 100%
rename from speedyblupi.aps
rename to resource/speedyblupi.aps
diff --git a/speedyblupi.rc b/resource/speedyblupi.rc
similarity index 100%
rename from speedyblupi.rc
rename to resource/speedyblupi.rc
diff --git a/wait.cur b/resource/wait.cur
similarity index 100%
rename from wait.cur
rename to resource/wait.cur
diff --git a/speedyblupi.dsp b/speedyblupi.dsp
deleted file mode 100644
index b0f1b31..0000000
--- a/speedyblupi.dsp
+++ /dev/null
@@ -1,335 +0,0 @@
-# Microsoft Developer Studio Project File - Name="speedyblupi" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 5.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Application" 0x0101
-
-CFG=speedyblupi - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "speedyblupi.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "speedyblupi.mak" CFG="speedyblupi - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "speedyblupi - Win32 Release" (based on "Win32 (x86) Application")
-!MESSAGE "speedyblupi - Win32 Debug" (based on "Win32 (x86) Application")
-!MESSAGE
-
-# Begin Project
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "speedyblupi - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "dxsdk3/sdk/inc" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /libpath:"dxsdk3/sdk/lib"
-
-!ELSEIF "$(CFG)" == "speedyblupi - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
-# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "dxsdk3/sdk/inc" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
-
-!ENDIF
-
-# Begin Target
-
-# Name "speedyblupi - Win32 Release"
-# Name "speedyblupi - Win32 Debug"
-# Begin Group "resource"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=.\arrow.cur
-# End Source File
-# Begin Source File
-
-SOURCE=.\arrowdl.cur
-# End Source File
-# Begin Source File
-
-SOURCE=.\arrowdow.cur
-# End Source File
-# Begin Source File
-
-SOURCE=.\arrowdr.cur
-# End Source File
-# Begin Source File
-
-SOURCE=.\arrowlef.cur
-# End Source File
-# Begin Source File
-
-SOURCE=.\arrowrig.cur
-# End Source File
-# Begin Source File
-
-SOURCE=.\arrowul.cur
-# End Source File
-# Begin Source File
-
-SOURCE=.\arrowup.cur
-# End Source File
-# Begin Source File
-
-SOURCE=.\arrowur.cur
-# End Source File
-# Begin Source File
-
-SOURCE=".\blupi-d.rc"
-# End Source File
-# Begin Source File
-
-SOURCE=".\blupi-e.rc"
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=".\blupi-f.rc"
-# PROP Exclude_From_Build 1
-# End Source File
-# Begin Source File
-
-SOURCE=.\blupi.ico
-# End Source File
-# Begin Source File
-
-SOURCE=.\blupi.rct
-# End Source File
-# Begin Source File
-
-SOURCE=.\cursor1.cur
-# End Source File
-# Begin Source File
-
-SOURCE=.\empty.cur
-# End Source File
-# Begin Source File
-
-SOURCE=.\fill.cur
-# End Source File
-# Begin Source File
-
-SOURCE=.\map.cur
-# End Source File
-# Begin Source File
-
-SOURCE=.\wait.cur
-# End Source File
-# End Group
-# Begin Group "include"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=.\actions.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\button.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\ddutil.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\decor.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\dectables.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\def.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\event.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\jauge.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\menu.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\misc.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\movie.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\network.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\obstacle.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\pixmap.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\resource.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\resrc1.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\sound.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\text.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\texttables.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\wave.h
-# End Source File
-# End Group
-# Begin Source File
-
-SOURCE=.\blupi.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\button.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\ddutil.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\decblock.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\decblupi.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\decdesign.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\decio.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\decmove.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\decnet.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\decor.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\event.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\jauge.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\menu.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\misc.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\movie.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\network.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\pixmap.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\sound.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\text.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\wave.cpp
-# End Source File
-# End Target
-# End Project
diff --git a/speedyblupi.dsw b/speedyblupi.dsw
deleted file mode 100644
index 9aa939d..0000000
--- a/speedyblupi.dsw
+++ /dev/null
@@ -1,29 +0,0 @@
-Microsoft Developer Studio Workspace File, Format Version 5.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "speedyblupi"=.\speedyblupi.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
diff --git a/speedyblupi.ncb b/speedyblupi.ncb
deleted file mode 100644
index c8baf70..0000000
Binary files a/speedyblupi.ncb and /dev/null differ
diff --git a/speedyblupi.opt b/speedyblupi.opt
deleted file mode 100644
index a695f54..0000000
Binary files a/speedyblupi.opt and /dev/null differ
diff --git a/speedyblupi.plg b/speedyblupi.plg
deleted file mode 100644
index 8e13a8b..0000000
--- a/speedyblupi.plg
+++ /dev/null
@@ -1,109 +0,0 @@
---------------------Configuration: speedyblupi - Win32 Debug--------------------
-Begining build with project "C:\Users\Jimmy\Documents\GitHub\sb2-decomp\speedyblupi.dsp", at root.
-Active configuration is Win32 (x86) Application (based on Win32 (x86) Application)
-
-Project's tools are:
- "32-bit C/C++ Compiler for 80x86" with flags "/nologo /MLd /W3 /Gm /GX /Zi /Od /I "dxsdk3/sdk/inc" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /Fp"Debug/speedyblupi.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /c "
- "OLE Type Library Maker" with flags "/nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 "
- "Win32 Resource Compiler" with flags "/l 0x409 /fo"Debug/blupi-d.res" /d "_DEBUG" "
- "Browser Database Maker" with flags "/nologo /o"Debug/speedyblupi.bsc" "
- "COFF Linker for 80x86" with flags "kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /incremental:yes /pdb:"Debug/speedyblupi.pdb" /debug /machine:I386 /out:"Debug/speedyblupi.exe" /pdbtype:sept /libpath:"dxsdk3/sdk/lib" "
- "Custom Build" with flags ""
- "" with flags ""
-
-Creating command line "rc.exe /l 0x409 /fo"Debug/blupi-d.res" /d "_DEBUG" "C:\Users\Jimmy\Documents\GitHub\sb2-decomp\blupi-d.rc""
-Creating temp file "C:\Users\Jimmy\AppData\Local\Temp\RSP48F6.tmp" with contents
-Creating command line "cl.exe @C:\Users\Jimmy\AppData\Local\Temp\RSP48F6.tmp"
-Creating temp file "C:\Users\Jimmy\AppData\Local\Temp\RSP48F7.tmp" with contents
-Creating command line "link.exe @C:\Users\Jimmy\AppData\Local\Temp\RSP48F7.tmp"
-Compiling resources...
-
-
-C:\Users\Jimmy\Documents\GitHub\sb2-decomp\blupi-d.rc (31): error RC2135 : file not found: blupi.ico
-
-
-C:\Users\Jimmy\Documents\GitHub\sb2-decomp\blupi-d.rc (81): error RC2135 : file not found: map.cur
-
-
-C:\Users\Jimmy\Documents\GitHub\sb2-decomp\blupi-d.rc (82): error RC2135 : file not found: arrowup.cur
-
-
-C:\Users\Jimmy\Documents\GitHub\sb2-decomp\blupi-d.rc (83): error RC2135 : file not found: arrowdow.cur
-
-
-C:\Users\Jimmy\Documents\GitHub\sb2-decomp\blupi-d.rc (84): error RC2135 : file not found: arrowlef.cur
-
-
-C:\Users\Jimmy\Documents\GitHub\sb2-decomp\blupi-d.rc (85): error RC2135 : file not found: arrowrig.cur
-
-
-C:\Users\Jimmy\Documents\GitHub\sb2-decomp\blupi-d.rc (86): error RC2135 : file not found: arrowul.cur
-
-
-C:\Users\Jimmy\Documents\GitHub\sb2-decomp\blupi-d.rc (87): error RC2135 : file not found: arrowur.cur
-
-
-C:\Users\Jimmy\Documents\GitHub\sb2-decomp\blupi-d.rc (88): error RC2135 : file not found: arrowdr.cur
-
-
-C:\Users\Jimmy\Documents\GitHub\sb2-decomp\blupi-d.rc (89): error RC2135 : file not found: arrowdl.cur
-
-
-C:\Users\Jimmy\Documents\GitHub\sb2-decomp\blupi-d.rc (90): error RC2135 : file not found: wait.cur
-
-
-C:\Users\Jimmy\Documents\GitHub\sb2-decomp\blupi-d.rc (91): error RC2135 : file not found: empty.cur
-
-
-C:\Users\Jimmy\Documents\GitHub\sb2-decomp\blupi-d.rc (92): error RC2135 : file not found: fill.cur
-
-
-C:\Users\Jimmy\Documents\GitHub\sb2-decomp\blupi-d.rc (93): error RC2135 : file not found: arrow.cur
-C:\Users\Jimmy\Documents\GitHub\sb2-decomp\blupi-d.rc (181): error RC2104 : undefined keyword or key name: TX_TERMMIN
-
-
-
-
-
-
-Error executing rc.exe.
-
-
-
-speedyblupi.exe - 15 error(s), 0 warning(s)
diff --git a/speedyblupi.sln b/speedyblupi.sln
deleted file mode 100644
index a75a76b..0000000
--- a/speedyblupi.sln
+++ /dev/null
@@ -1,31 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 15
-VisualStudioVersion = 15.0.26730.12
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "speedyblupi", "speedyblupi.vcxproj", "{E892DD4F-D6B7-4A19-8EC3-AB2625A8A523}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|x64 = Debug|x64
- Debug|x86 = Debug|x86
- Release|x64 = Release|x64
- Release|x86 = Release|x86
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {E892DD4F-D6B7-4A19-8EC3-AB2625A8A523}.Debug|x64.ActiveCfg = Debug|x64
- {E892DD4F-D6B7-4A19-8EC3-AB2625A8A523}.Debug|x64.Build.0 = Debug|x64
- {E892DD4F-D6B7-4A19-8EC3-AB2625A8A523}.Debug|x86.ActiveCfg = Debug|Win32
- {E892DD4F-D6B7-4A19-8EC3-AB2625A8A523}.Debug|x86.Build.0 = Debug|Win32
- {E892DD4F-D6B7-4A19-8EC3-AB2625A8A523}.Release|x64.ActiveCfg = Release|x64
- {E892DD4F-D6B7-4A19-8EC3-AB2625A8A523}.Release|x64.Build.0 = Release|x64
- {E892DD4F-D6B7-4A19-8EC3-AB2625A8A523}.Release|x86.ActiveCfg = Release|Win32
- {E892DD4F-D6B7-4A19-8EC3-AB2625A8A523}.Release|x86.Build.0 = Release|Win32
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- SolutionGuid = {330B6445-ECF1-4B81-AA61-15954FA4F694}
- EndGlobalSection
-EndGlobal
diff --git a/speedyblupi.vcxproj b/speedyblupi.vcxproj
deleted file mode 100644
index 49c93ed..0000000
--- a/speedyblupi.vcxproj
+++ /dev/null
@@ -1,253 +0,0 @@
-
-
-
-
- Debug
- Win32
-
-
- Release
- Win32
-
-
- Debug
- x64
-
-
- Release
- x64
-
-
-
- {E892DD4F-D6B7-4A19-8EC3-AB2625A8A523}
- Win32Proj
- speedyblupi
- 10.0.19041.0
- speedyblupi
-
-
-
- Application
- true
- v141
- MultiByte
-
-
- Application
- false
- v141
- true
- MultiByte
-
-
- Application
- true
- v141
- MultiByte
-
-
- Application
- false
- v141
- true
- MultiByte
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- true
-
-
- true
-
-
- false
-
-
- false
-
-
-
-
-
- Level3
- Disabled
- _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)
- true
- false
- false
- dxsdk3\sdk\inc;%(AdditionalIncludeDirectories)
- PlaySound;DrawText
-
-
- Windows
- true
- winmm.lib;ddraw.lib;dsound.lib;dplay.lib;%(AdditionalDependencies)
- dxsdk3\sdk\lib
-
-
-
-
-
-
- Level3
- Disabled
- _CRT_SECURE_NO_WARNINGS;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)
- true
- false
- false
- dxsdk3\sdk\inc;%(AdditionalIncludeDirectories)
- PlaySound;DrawText
-
-
- Windows
- true
- winmm.lib;ddraw.lib;dsound.lib;%(AdditionalDependencies)
- dxsdk3\sdk\lib
-
-
-
-
- Level3
-
-
- MaxSpeed
- true
- true
- _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)
- true
- false
- dxsdk3\sdk\inc;%(AdditionalIncludeDirectories)
- PlaySound;DrawText
-
-
- Windows
- true
- true
- true
- winmm.lib;ddraw.lib;dsound.lib;%(AdditionalDependencies)
- dxsdk3\sdk\lib
-
-
-
-
- Level3
-
-
- MaxSpeed
- true
- true
- _CRT_SECURE_NO_WARNINGS;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)
- true
- false
- dxsdk3\sdk\inc;%(AdditionalIncludeDirectories)
- PlaySound;DrawText
-
-
- Windows
- true
- true
- true
- winmm.lib;ddraw.lib;dsound.lib;%(AdditionalDependencies)
- dxsdk3\sdk\lib
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- true
- true
- true
- true
-
-
- true
- true
- true
- true
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/speedyblupi.vcxproj.filters b/speedyblupi.vcxproj.filters
deleted file mode 100644
index 99e11b7..0000000
--- a/speedyblupi.vcxproj.filters
+++ /dev/null
@@ -1,203 +0,0 @@
-
-
-
-
- {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
- rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
-
-
- {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
- cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
-
-
- {7afac595-449b-49eb-b3fd-d4a7328dbbc0}
-
-
-
-
- Sources
-
-
- Sources
-
-
- Sources
-
-
- Sources
-
-
- Sources
-
-
- Sources
-
-
- Sources
-
-
- Sources
-
-
- Sources
-
-
- Sources
-
-
- Sources
-
-
- Sources
-
-
- Sources
-
-
- Sources
-
-
- Sources
-
-
- Sources
-
-
- Sources
-
-
- Sources
-
-
- Sources
-
-
-
-
- Sources
-
-
- Sources
-
-
- Sources
-
-
- Sources
-
-
- Sources
-
-
- Sources
-
-
- Sources
-
-
- Sources
-
-
- Sources
-
-
- Sources
-
-
- Sources
-
-
- Sources
-
-
- Sources
-
-
- Sources
-
-
- Sources
-
-
- Sources
-
-
- Sources
-
-
- Sources
-
-
- Sources
-
-
- Sources
-
-
-
-
- Resource Files
-
-
- Resource Files
-
-
- Resource Files
-
-
- Resource Files
-
-
- Resource Files
-
-
- Resource Files
-
-
- Resource Files
-
-
- Resource Files
-
-
- Resource Files
-
-
- Resource Files
-
-
- Resource Files
-
-
- Resource Files
-
-
- Resource Files
-
-
- Resource Files
-
-
- Data
-
-
- Resource Files
-
-
-
-
- Resource Files
-
-
- Resource Files
-
-
- Resource Files
-
-
-
-
- Resource Files
-
-
-
\ No newline at end of file
diff --git a/speedyblupi.vcxproj.user b/speedyblupi.vcxproj.user
deleted file mode 100644
index be25078..0000000
--- a/speedyblupi.vcxproj.user
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/src/blupi.cpp b/src/blupi.cpp
index 3e05896..abc57cf 100644
--- a/src/blupi.cpp
+++ b/src/blupi.cpp
@@ -3,10 +3,9 @@
#define WIN32_LEAN_AND_MEAN
-#pragma once
-
#include
#include
+#include
#include
#include
#include
@@ -27,8 +26,6 @@
#include "misc.h"
#include "network.h"
-#pragma warning (disable : 4996)
-
// Define Globals
#define NAME "Blupi"
diff --git a/src/button.cpp b/src/button.cpp
index 8ddfb18..48616b1 100644
--- a/src/button.cpp
+++ b/src/button.cpp
@@ -1,20 +1,18 @@
// Button.cpp
//
-#include
-#include
-#include
-#include
+//#include
+//#include
+//#include
+//#include
-#include
+//#include
+
+#include "button.h"
+#include "misc.h"
#include "def.h"
#include "pixmap.h"
#include "sound.h"
-#include "decor.h"
-#include "button.h"
-#include "misc.h"
-
-using namespace std;
//////////////////////////////////////////////////////////
diff --git a/src/button.h b/src/button.h
index 834266e..83f02a7 100644
--- a/src/button.h
+++ b/src/button.h
@@ -1,10 +1,9 @@
#pragma once
-// #include
-#include
+//#include
#include "decor.h"
-#include "sound.h"
#include "pixmap.h"
+#include "sound.h"
class CButton
{
diff --git a/src/ddutil.h b/src/ddutil.h
index 86c1d1d..406ba8e 100644
--- a/src/ddutil.h
+++ b/src/ddutil.h
@@ -9,8 +9,6 @@
#define DIRECTDRAW_VERSION 0x0500
-using namespace std;
-
#pragma once
#include
diff --git a/src/decblupi.cpp b/src/decblupi.cpp
index 3314f6e..450af53 100644
--- a/src/decblupi.cpp
+++ b/src/decblupi.cpp
@@ -1,10 +1,10 @@
// DecBlupi.cpp
//
-#include "DEF.H"
-#include "DECOR.H"
-#include "MISC.H"
-#include "RESOURCE.H"
+#include "misc.h"
+#include "decor.h"
+#include "misc.h"
+//#include "resource.h"
#include "dectables.h"
int CDecor::GetBlupiChannelStandard()
diff --git a/src/decio.cpp b/src/decio.cpp
index f0edfc3..43609f2 100644
--- a/src/decio.cpp
+++ b/src/decio.cpp
@@ -57,7 +57,7 @@ BOOL CDecor::Write(int gamer, int mission, BOOL bUser)
pBuffer->music = m_music;
pBuffer->region = m_region;
blupiDir = m_blupiStartDir;
- strcpy(pBuffer->libelle, m_missionTitle);
+ strcpy(pBuffer->name, m_missionTitle);
blupiPos = m_blupiStartPos;
for (i = 0; i < 4; i++)
@@ -129,7 +129,7 @@ BOOL CDecor::Read(int gamer, int mission, BOOL bUser)
m_region = pBuffer->region;
if (0 < majRev && minRev > 2)
{
- strcpy(m_missionTitle,pBuffer->libelle);
+ strcpy(m_missionTitle,pBuffer->name);
}
startDir = m_blupiStartDir;
blupiDir = pBuffer->blupiDir;
@@ -194,7 +194,7 @@ BOOL CDecor::MissionStart(int gamer, int mission, BOOL bUser)
{
char filename[MAX_PATH];
FILE* file = NULL;
- DescFile* pBuffer = NULL;
+ DescSave* pBuffer = NULL;
int nb, i, x, y;
int majRev, minRev;
@@ -204,28 +204,119 @@ BOOL CDecor::MissionStart(int gamer, int mission, BOOL bUser)
file = fopen(filename, "wb");
if (file == NULL) goto error;
- pBuffer = (DescFile*)malloc(sizeof(DescFile));
+ pBuffer = (DescSave*)malloc(sizeof(DescSave));
if (pBuffer == NULL) goto error;
- memset(pBuffer, 0, sizeof(DescFile));
-
+
+ memset(pBuffer, 0, sizeof(DescSave));
+ pBuffer->lg = sizeof(DescSave);
pBuffer->majRev = 1;
pBuffer->minRev = 4;
- memcpy(pBuffer->reserve1, m_decor, sizeof(Cellule));
- memcpy(pBuffer->reserve1, m_bigDecor, sizeof(m_bigDecor));
- memcpy(pBuffer->reserve1, m_balleTraj, sizeof(m_balleTraj));
- memcpy(pBuffer->reserve1, m_moveTraj, sizeof(m_moveTraj));
- memcpy(pBuffer->reserve1, m_moveObject, sizeof(m_moveObject));
+ pBuffer->reserve1[0] = 0;
+ memcpy(pBuffer->decor, m_decor, sizeof(pBuffer->decor));
+ memcpy(pBuffer->bigDecor, m_bigDecor, sizeof(pBuffer->bigDecor));
+ memcpy(pBuffer->balleTraj, m_balleTraj, sizeof(pBuffer->balleTraj));
+ memcpy(pBuffer->moveTraj, m_moveTraj, sizeof(pBuffer->moveTraj));
+ memcpy(pBuffer->moveObject, m_moveObject, sizeof(pBuffer->moveObject));
pBuffer->posDecor = m_posDecor;
pBuffer->dimDecor = m_dimDecor;
- pBuffer->world = m_mission;
+ pBuffer->phase = m_phase;
+ pBuffer->term = m_term;
pBuffer->music = m_music;
pBuffer->region = m_region;
- pBuffer->blupiPos[2] = m_blupiPos;
- pBuffer->blupiPos[3] = m_blupiValidPos;
- pBuffer->blupiDir[3] = m_blupiStartDir[3];
- pBuffer->libelle[99] = m_missionTitle[99];
+ pBuffer->time = m_time;
+ memcpy(pBuffer->missionTitle, m_missionTitle, sizeof(pBuffer->missionTitle));
+ pBuffer->nbRankCaisse = m_nbRankCaisse;
+ memcpy(pBuffer->rankCaisse, m_rankCaisse, sizeof(pBuffer->rankCaisse));
+ pBuffer->nbLinkCaisse = m_nbLinkCaisse;
+ memcpy(pBuffer->linkCaisse, m_linkCaisse, sizeof(pBuffer->linkCaisse));
+ pBuffer->blupiPos = m_blupiPos;
+ pBuffer->blupiValidPos = m_blupiValidPos;
+ pBuffer->blupiAction = m_blupiAction;
+ pBuffer->blupiDir = m_blupiDir;
+ pBuffer->blupiPhase = m_blupiPhase;
+ pBuffer->blupiVitesse = m_blupiVitesse;
+ pBuffer->blupiIcon = m_blupiIcon;
+ pBuffer->blupiSec = m_blupiSec;
+ pBuffer->blupiChannel = m_blupiChannel;
+ pBuffer->blupiVector = m_blupiVector;
+ pBuffer->blupiTransport = m_blupiTransport;
+ pBuffer->blupiFocus = m_blupiFocus;
+ pBuffer->blupiAir = m_blupiAir;
+ pBuffer->blupiHelico = m_blupiHelico;
+ pBuffer->blupiOver = m_blupiOver;
+ pBuffer->blupiJeep = m_blupiJeep;
+ pBuffer->blupiTank = m_blupiTank;
+ pBuffer->blupiSkate = m_blupiSkate;
+ pBuffer->blupiNage = m_blupiNage;
+ pBuffer->blupiSurf = m_blupiSurf;
+ pBuffer->blupiVent = m_blupiVent;
+ pBuffer->blupiSuspend = m_blupiSuspend;
+ pBuffer->blupiJumpAie = m_blupiJumpAie;
+ pBuffer->blupiShield = m_blupiShield;
+ pBuffer->blupiPower = m_blupiPower;
+ pBuffer->blupiCloud = m_blupiCloud;
+ pBuffer->blupiHide = m_blupiHide;
+ pBuffer->blupiInvert = m_blupiInvert;
+ pBuffer->blupiBalloon = m_blupiBalloon;
+ pBuffer->blupiEcrase = m_blupiEcrase;
+ pBuffer->blupiPosHelico = m_blupiPosHelico;
+ pBuffer->blupiPosMagic = m_blupiPosMagic;
+ pBuffer->blupiRestart = m_blupiRestart;
+ pBuffer->blupiFront = m_blupiFront;
+ pBuffer->blupiBullet = m_blupiBullet;
+ pBuffer->blupiCle = m_blupiCle;
+ pBuffer->blupiPerso = m_blupiPerso;
+ pBuffer->blupiDynamite = m_blupiDynamite;
+ pBuffer->blupiNoBarre = m_blupiNoBarre;
+ pBuffer->blupiTimeShield = m_blupiTimeShield;
+ pBuffer->blupiTimeFire = m_blupiTimeFire;
+ pBuffer->blupiTimeNoAsc = m_blupiTimeNoAsc;
+ pBuffer->blupiTimeOuf = m_blupiTimeOuf;
+ pBuffer->blupiActionOuf = m_blupiActionOuf;
+ pBuffer->blupiFifoNb = m_blupiFifoNb;
+ memcpy(pBuffer->blupiFifoPos, m_blupiFifoPos, sizeof(pBuffer->blupiFifoPos));
+ memcpy(pBuffer->blupiStartPos, m_blupiStartPos, sizeof(pBuffer->blupiStartPos));
+ pBuffer->blupiStartDir[0] = m_blupiStartDir[0];
+ pBuffer->blupiStartDir[1] = m_blupiStartDir[1];
+ pBuffer->blupiStartDir[2] = m_blupiStartDir[2];
+ pBuffer->blupiStartDir[3] = m_blupiStartDir[3];
+ pBuffer->jaugeHide[0] = m_jauges[0].GetHide();
+ pBuffer->jaugeHide[1] = m_jauges[1].GetHide();
+ pBuffer->jaugeType[0] = m_jauges[0].GetType();
+ pBuffer->jaugeType[1] = m_jauges[1].GetType();
+ pBuffer->jaugeLevel[0] = m_jauges[0].GetLevel();
+ pBuffer->jaugeLevel[1] = m_jauges[1].GetLevel();
+ pBuffer->blupiLevel = m_blupiLevel;
+ pBuffer->energyUnused = m_blupiEnergyUnused;
+ pBuffer->bHelicoMarch = m_bHelicoMarch;
+ pBuffer->bHelicoStop = m_bHelicoStop;
+ pBuffer->bJeepMarch = m_bJeepMarch;
+ pBuffer->bJeepStop = m_bJeepStop;
+ pBuffer->bFoundCle = m_bFoundCle;
+ pBuffer->bPrivate = m_bPrivate;
+ pBuffer->bCheatDoors = m_bCheatDoors;
+ pBuffer->bSuperBlupi = m_bSuperBlupi;
+ pBuffer->bDrawSecret = m_bDrawSecret;
+ pBuffer->bJoystick = m_bJoystick;
+ pBuffer->mission = m_mission;
+ memcpy(pBuffer->doors, m_doors, sizeof(pBuffer->doors));
+ pBuffer->nbVies = m_nbVies;
+ pBuffer->nbTresor = m_nbTresor;
+ pBuffer->totalTresor = m_totalTresor;
+ pBuffer->goalPhase = m_goalPhase;
+ pBuffer->d8f8 = m_D8F8;
+ pBuffer->scrollPoint = m_scrollPoint;
+ pBuffer->scrollAdd = m_scrollAdd;
+ pBuffer->voyageIcon = m_voyageIcon;
+ pBuffer->voyageChannel = m_voyageChannel;
+ pBuffer->voyagePhase = m_voyagePhase;
+ pBuffer->voyageTotal = m_voyageTotal;
+ pBuffer->voyageStart = m_voyageStart;
+ pBuffer->voyageEnd = m_voyageEnd;
+ pBuffer->decorAction = m_decorAction;
+ pBuffer->decorPhase = m_decorPhase;
- if (fwrite(pBuffer, sizeof(DescFile), 1, file) >= 1)
+ if (fwrite(pBuffer, sizeof(DescSave), 1, file) >= 1)
{
free(pBuffer);
fclose(file);
diff --git a/src/decmove.cpp b/src/decmove.cpp
index 02e2e7a..bfc3b47 100644
--- a/src/decmove.cpp
+++ b/src/decmove.cpp
@@ -7,94 +7,7 @@
#include "dectables.h"
-BOOL CDecor::TestPath(RECT rect, POINT start, POINT end)
-{
- int num = abs(end.x - start.x);
- int num2 = abs(end.y - start.y);
- POINT tinyPoint = start;
- if (num > num2)
- {
- RECT rect2;
- if (end.x > start.x)
- {
- for (int i = 0; i <= num; i++)
- {
- int j = i * (end.y - start.y) / num;
- rect2.left = rect.left + i;
- rect2.right = rect.right + i;
- rect2.top = rect.top + j;
- rect2.bottom = rect.bottom + j;
- if (DecorDetect(rect2))
- {
- end = tinyPoint;
- return FALSE;
- }
- tinyPoint.x = start.x + i;
- tinyPoint.y = start.y + j;
- }
- }
- if (end.x < start.x)
- {
- for (int i = 0; i >= -num; i--)
- {
- int j = i * (start.y - end.y) / num;
- rect2.left = rect.left + i;
- rect2.right = rect.right + i;
- rect2.top = rect.top + j;
- rect2.bottom = rect.bottom + j;
- if (DecorDetect(rect2))
- {
- end = tinyPoint;
- return FALSE;
- }
- tinyPoint.x = start.x + i;
- tinyPoint.y = start.y + j;
- }
- }
- }
- else
- {
- RECT rect2;
- if (end.y > start.y)
- {
- for (int j = 0; j <= num2; j++)
- {
- int i = j * (end.x - start.x) / num2;
- rect2.left = rect.left + i;
- rect2.right = rect.right + i;
- rect2.top = rect.top + j;
- rect2.bottom = rect.bottom + j;
- if (DecorDetect(rect2))
- {
- end = tinyPoint;
- return FALSE;
- }
- tinyPoint.x = start.x + i;
- tinyPoint.y = start.y + j;
- }
- }
- if (end.y < start.y)
- {
- for (int j = 0; j >= -num2; j--)
- {
- int i = j * (start.x - end.x) / num2;
- rect2.left = rect.left + i;
- rect2.right = rect.right + i;
- rect2.top = rect.top + j;
- rect2.bottom = rect.bottom + j;
- if (DecorDetect(rect2))
- {
- end = tinyPoint;
- return FALSE;
- }
- tinyPoint.x = start.x + i;
- tinyPoint.y = start.y + j;
- }
- }
- }
- return TRUE;
-}
void CDecor::MoveObjectPollution()
@@ -490,7 +403,7 @@ void CDecor::MoveObjectStepLine(int i)
tinyRect.top = m_moveObject[i].posCurrent.y;
tinyRect.bottom = m_moveObject[i].posCurrent.y + 16;
RECT tinyRect2;
- flag = IntersectRect(tinyRect2, tinyRect, src);
+ flag = IntersectRect(&tinyRect2, &tinyRect, &src);
tinyPoint = m_moveObject[i].posCurrent;
}
POINT posCurrent;
@@ -517,7 +430,7 @@ void CDecor::MoveObjectStepLine(int i)
tinyRect.right = posCurrent.x + 60 - 10;
tinyRect.top = posCurrent.y + 10;
tinyRect.bottom = posCurrent.y + 60 - 10;
- if (TestPath(tinyRect, m_moveObject[i].posCurrent, posCurrent))
+ if (TestPath(tinyRect, m_moveObject[i].posCurrent, &posCurrent))
{
m_moveObject[i].posCurrent = posCurrent;
m_moveObject[i].posStart = posCurrent;
@@ -1550,7 +1463,7 @@ void CDecor::DynamiteStart(int i, int dx, int dy)
src2.top = m_moveObject[i].posCurrent.y;
src2.bottom = m_moveObject[i].posCurrent.y + 20;
RECT tinyRect;
- if (IntersectRect(tinyRect, src2, src))
+ if (IntersectRect(&tinyRect, &src2, &src))
{
if (m_moveObject[i].type == 12)
{
@@ -1614,7 +1527,7 @@ int CDecor::AscenseurDetect(RECT rect, POINT oldpos, POINT newpos)
if (num < 30)
{
RECT tinyRect;
- if (IntersectRect(tinyRect, src, rect))
+ if (IntersectRect(&tinyRect, &src, &rect))
{
return i;
}
@@ -1627,7 +1540,7 @@ int CDecor::AscenseurDetect(RECT rect, POINT oldpos, POINT newpos)
for (int j = 0; j <= num / 30; j++)
{
RECT tinyRect;
- if (IntersectRect(tinyRect, src, src2))
+ if (IntersectRect(&tinyRect, &src, &src2))
{
return i;
}
@@ -1769,7 +1682,7 @@ void CDecor::SearchLinkCaisse(int rank, BOOL bPop)
src2.right = src2.left + 64 + 1;
src2.bottom = src2.top + 64 + 1;
RECT tinyRect;
- if (IntersectRect(tinyRect, src2, src) && AddLinkCaisse(num2))
+ if (IntersectRect(&tinyRect, &src2, &src) && AddLinkCaisse(num2))
{
flag = TRUE;
}
@@ -1892,7 +1805,7 @@ int CDecor::MockeryDetect(POINT pos)
src2.top = m_moveObject[i].posCurrent.y + 36;
src2.bottom = m_moveObject[i].posCurrent.y + 60;
RECT tinyRect;
- if (IntersectRect(tinyRect, src2, src))
+ if (IntersectRect(&tinyRect, &src2, &src))
{
if (m_moveObject[i].type == 54)
{
@@ -1945,7 +1858,7 @@ BOOL CDecor::BlupiElectro(POINT pos)
src2.top = m_blupiPos.y + 11 - 40;
src2.bottom = m_blupiPos.y + 60 - 2 + 40;
RECT tinyRect;
- return IntersectRect(tinyRect, src, src2);
+ return IntersectRect(&tinyRect, &src, &src2);
}
void CDecor::MoveObjectFollow(POINT pos)
@@ -1967,7 +1880,7 @@ void CDecor::MoveObjectFollow(POINT pos)
src2.top = m_moveObject[i].posCurrent.y - 100;
src2.bottom = m_moveObject[i].posCurrent.y + 60 + 100;
RECT tinyRect;
- if (IntersectRect(tinyRect, src2, src))
+ if (IntersectRect(&tinyRect, &src2, &src))
{
m_moveObject[i].type = 97;
PlaySound(92, m_moveObject[i].posCurrent);
@@ -2028,7 +1941,7 @@ int CDecor::MoveAscenseurDetect(POINT pos, int height)
src2.top = m_moveObject[i].posCurrent.y;
src2.bottom = m_moveObject[i].posCurrent.y + 16;
RECT tinyRect;
- if (IntersectRect(tinyRect, src2, src))
+ if (IntersectRect(&tinyRect, &src2, &src))
{
return i;
}
@@ -2054,7 +1967,7 @@ int CDecor::MoveChargeDetect(POINT pos)
src2.top = m_moveObject[i].posCurrent.y + 36;
src2.bottom = m_moveObject[i].posCurrent.y + 60;
RECT tinyRect;
- if (IntersectRect(tinyRect, src2, src))
+ if (IntersectRect(&tinyRect, &src2, &src))
{
return i;
}
@@ -2080,7 +1993,7 @@ int CDecor::MovePersoDetect(POINT pos)
src2.top = m_moveObject[i].posCurrent.y + 36;
src2.bottom = m_moveObject[i].posCurrent.y + 60;
RECT tinyRect;
- if (IntersectRect(tinyRect, src2, src))
+ if (IntersectRect(&tinyRect, &src2, &src))
{
return i;
}
diff --git a/src/decor.cpp b/src/decor.cpp
index 6f5a14c..24ad50b 100644
--- a/src/decor.cpp
+++ b/src/decor.cpp
@@ -1,13 +1,13 @@
// Decor.cpp
//
-#include
-#include
-#include
-#include
+//#include
+//#include
+//#include
+//#include
#include
#include "def.h"
-#include "resource.h"
+//#include "resource.h"
#include "pixmap.h"
#include "sound.h"
#include "decor.h"
@@ -16,9 +16,7 @@
#include "event.h"
#include "dectables.h"
#include "jauge.h"
-#include "network.h"
-
-
+//#include "network.h"
///////////////////////////////////////////////////////////////////////////////
diff --git a/src/decor.h b/src/decor.h
index 049d52b..e1232ce 100644
--- a/src/decor.h
+++ b/src/decor.h
@@ -2,9 +2,9 @@
#pragma once
#include "DEF.H"
-#include "JAUGE.H"
-#include "SOUND.H"
-#include "PIXMAP.H"
+#include "jauge.h"
+#include "sound.h"
+#include "pixmap.h"
#include "network.h"
/////////////////////////////////////////////////////////////////////////////
@@ -82,6 +82,124 @@ typedef struct
}
DescFile;
+typedef struct
+{
+ int lg;
+ int majRev;
+ int minRev;
+ int reserve1[50];
+ short decor[100][100];
+ short bigDecor[100][100];
+ char balleTraj[100][13];
+ char moveTraj[100][13];
+ MoveObject moveObject[200];
+ int reserve2[50];
+ POINT posDecor;
+ POINT dimDecor;
+ int phase;
+ int term;
+ int music;
+ int region;
+ int time;
+ char missionTitle[100];
+ int reserve3[50];
+ int nbRankCaisse;
+ int rankCaisse[200];
+ int nbLinkCaisse;
+ int linkCaisse[200];
+ int reserve4[50];
+ POINT blupiPos;
+ POINT blupiValidPos;
+ int blupiAction;
+ int blupiDir;
+ int blupiPhase;
+ POINT blupiVitesse;
+ int blupiIcon;
+ int blupiSec;
+ int blupiChannel;
+ POINT blupiVector;
+ int blupiTransport;
+ BOOL blupiFocus;
+ BOOL blupiAir;
+ BOOL blupiHelico;
+ BOOL blupiJeep;
+ BOOL blupiTank;
+ BOOL blupiSkate;
+ BOOL blupiNage;
+ BOOL blupiSurf;
+ BOOL blupiVent;
+ BOOL blupiSuspend;
+ BOOL blupiJumpAie;
+ BOOL blupiShield;
+ BOOL blupiPower;
+ BOOL blupiCloud;
+ BOOL blupiHide;
+ POINT blupiPosHelico;
+ POINT blupiPosMagic;
+ BOOL blupiRestart;
+ BOOL blupiFront;
+ int blupiBullet;
+ int blupiCle;
+ int blupiPerso;
+ int blupiNoBarre;
+ int blupiTimeShield;
+ int blupiTimeFire;
+ int blupiTimeOuf;
+ int blupiActionOuf;
+ int blupiFifoNb;
+ POINT blupiFifoPos[10];
+ BOOL blupiInvert;
+ BOOL blupiBalloon;
+ BOOL blupiOver;
+ BOOL blupiEcrase;
+ int blupiTimeNoAsc;
+ int blupiDynamite;
+ int reserve5[41];
+ POINT blupiStartPos[4];
+ int blupiStartDir[4];
+ int reserve6[50];
+ BOOL jaugeHide[2];
+ BOOL jaugeType[2];
+ BOOL jaugeLevel[2];
+ int blupiLevel;
+ int energyUnused;
+ int reserve7[50];
+ BOOL bHelicoMarch;
+ BOOL bHelicoStop;
+ BOOL bJeepMarch;
+ BOOL bJeepStop;
+ int reserve8[50];
+ BOOL bFoundCle;
+ BOOL bPrivate;
+ BOOL bCheatDoors;
+ BOOL bSuperBlupi;
+ BOOL bDrawSecret;
+ BOOL bJoystick;
+ int idklol;
+ int mission;
+ char doors[200];
+ int nbVies;
+ int nbTresor;
+ int totalTresor;
+ int goalPhase;
+ int reserve9[50];
+ int d8f8;
+ POINT scrollPoint;
+ POINT scrollAdd;
+ int reserve10[50];
+ int voyageIcon;
+ int voyageChannel;
+ int voyagePhase;
+ int voyageTotal;
+ POINT voyageStart;
+ POINT voyageEnd;
+ int reserve11[50];
+ int decorAction;
+ int decorPhase;
+ int reserve12[50];
+}
+DescSave;
+
class CDecor
{
public:
@@ -298,6 +416,8 @@ public:
void OpenGoldsWin();
void DoorsLost();
+ BOOL DeleteMission(int user, int mission, BOOL bUser);
+
inline BOOL IsValidCel(POINT cel);
inline void MoveObjectCopy(MoveObject src, MoveObject dest);
inline void StopVehicleSound();
diff --git a/src/def.h b/src/def.h
index 10eb3d7..1110509 100644
--- a/src/def.h
+++ b/src/def.h
@@ -3,7 +3,8 @@
#pragma once
-#include
+#include
+#include
// prevent WinAPI from overriding our functions
#undef PlaySound
diff --git a/src/event.cpp b/src/event.cpp
index 2aef1a4..70db0d0 100644
--- a/src/event.cpp
+++ b/src/event.cpp
@@ -1,41 +1,31 @@
// Event.cpp
//
-#pragma once
-
-using namespace std;
-
#include
#include
#include
-#include
+//#include
#include
#include
-#include
#include "def.h"
#include "resource.h"
-#include "pixmap.h"
-#include "sound.h"
+//#include "pixmap.h"
+//#include "sound.h"
#include "decor.h"
#include "movie.h"
-#include "button.h"
-#include "menu.h"
-#include "jauge.h"
+//#include "button.h"
+//#include "menu.h"
+//#include "jauge.h"
#include "event.h"
#include "text.h"
#include "misc.h"
#include "network.h"
-#pragma warning (disable : 4996)
-#pragma warning (disable : 4700)
-
#define DEF_TIME_HELP 10000
#define DEF_TIME_DEMO 1000
#define MAXDEMO 2000
#define MAXINDEX 20
-
-
typedef struct
{
short majRev;
@@ -2500,7 +2490,7 @@ BOOL CEvent::DrawButtons()
if (m_phase == WM_PHASE_INIT)
{
- DrawText(m_pPixmap, { 414, 446 }, (char*)"Version 2.2", FONTLITTLE);
+ DrawText(m_pPixmap, { 414, 446 }, "Version 2.2", FONTLITTLE);
}
for (int i = 0; table[m_index].buttons[i].message != 0; i++)
@@ -2782,8 +2772,8 @@ BOOL CEvent::DrawButtons()
SetEnable(WM_BUTTON6, 0);
SetEnable(WM_BUTTON14, 0);
}
- SetState(WM_BUTTON5, (m_pPixmap->GetTrueColor() == FALSE));
- SetState(WM_BUTTON6, (m_pPixmap->GetTrueColor() != FALSE));
+ SetState(WM_BUTTON5, (m_pPixmap->GetTrueColorBack() == FALSE));
+ SetState(WM_BUTTON6, (m_pPixmap->GetTrueColorBack() != FALSE));
SetState(WM_BUTTON13, (m_jauges->GetHide() == FALSE));
SetState(WM_BUTTON14, (m_jauges->GetHide() != FALSE));
for (int j = 0; j < 6; j++)
@@ -3217,12 +3207,12 @@ BOOL CEvent::TreatEventBase(UINT message, WPARAM wParam, LPARAM lParam)
{
if (m_phase == WM_PHASE_SERVICE)
{
- ChangePhase(WM_PHASE_DPLAY_DO_SERVICE);
+ ChangePhase(WM_PHASE_DP_DOSERVICE);
return TRUE;
}
if (m_phase == WM_PHASE_CREATE)
{
- ChangePhase(WM_PHASE_DPLAY_CREATE);
+ ChangePhase(WM_PHASE_DP_DOCREATE);
return TRUE;
}
if (m_phase == WM_PHASE_MULTI)
@@ -3443,8 +3433,8 @@ BOOL CEvent::TreatEventBase(UINT message, WPARAM wParam, LPARAM lParam)
m_multi -= i;
if (m_multi < 1) m_multi = 1;
- m_b6D34 = m_pDecor->Read(m_gamer, m_multi + 200, FALSE);
- if (m_b6D34) DrawMap();
+ m_bDrawMap = m_pDecor->Read(m_gamer, m_multi + 200, FALSE);
+ if (m_bDrawMap) DrawMap();
NetSendLobby();
NetAdjustLobbyButtons();
@@ -3473,8 +3463,8 @@ BOOL CEvent::TreatEventBase(UINT message, WPARAM wParam, LPARAM lParam)
m_multi += i;
if (m_multi > 12) m_multi = 12;
- m_b6D34 = m_pDecor->Read(m_gamer, m_multi + 200, FALSE);
- if (m_b6D34) DrawMap();
+ m_bDrawMap = m_pDecor->Read(m_gamer, m_multi + 200, FALSE);
+ if (m_bDrawMap) DrawMap();
NetSendLobby();
NetAdjustLobbyButtons();
@@ -3496,10 +3486,6 @@ BOOL CEvent::TreatEventBase(UINT message, WPARAM wParam, LPARAM lParam)
return ChangePhase(WM_PHASE_INFO);
}
break;
- case WM_MOVIE:
- StartMovie("movie\\essai.avi");
- ChangePhase(WM_PHASE_INIT);
- return FALSE;
case WM_DECOR1:
SetState(WM_DECOR1, 1);
SetState(WM_DECOR2, 0);
@@ -4122,7 +4108,7 @@ BOOL CEvent::ChangePhase(UINT phase)
{
m_bShowMouse = FALSE;
}
- if (phase == WM_PHASE_1544)
+ if (phase == WM_PHASE_QUITPLAYTEST)
{
m_pDecor->Read(m_gamer, 999, TRUE);
phase = WM_PHASE_BUILD;
@@ -4166,7 +4152,7 @@ BOOL CEvent::ChangePhase(UINT phase)
DemoRecStop();
}
- if (phase == WM_PHASE_DOQUIT)
+ if (phase == WM_PHASE_QUITPLAY)
{
if (!m_bPrivate)
{
@@ -4443,7 +4429,7 @@ BOOL CEvent::ChangePhase(UINT phase)
m_bNamesExist[i] = TRUE;
strcpy(m_gamerNameList[i], m_gamerName);
- m_pDecor->InitalizeDoors(door);
+ m_pDecor->InitializeDoors(door);
int num = 0;
for (j = 0; j < 200; j++)
{
@@ -5527,15 +5513,15 @@ void CEvent::ChangeButtons(int message)
m_pSound->SuspendMusic();
}
}
- if (message == WM_BUTTON5 && m_pPixmap->GetTrueColor())
+ if (message == WM_BUTTON5 && m_pPixmap->GetTrueColorBack())
{
- m_pPixmap->SetTrueColor(0);
+ m_pPixmap->SetTrueColorBack(0);
SetState(WM_BUTTON5, 1);
SetState(WM_BUTTON6, 0);
}
- if (message == WM_BUTTON6 && !m_pPixmap->GetTrueColor())
+ if (message == WM_BUTTON6 && !m_pPixmap->GetTrueColorBack())
{
- m_pPixmap->SetTrueColor(1);
+ m_pPixmap->SetTrueColorBack(1);
SetState(WM_BUTTON5, 0);
SetState(WM_BUTTON6, 1);
}
@@ -5658,4 +5644,14 @@ die:
// original code relies on undefined behavior specific to older msvc :
// if (srcFile->_flag & _IOERR)
// while (!(destFile->_flag & _IOERR))
+}
+
+void CEvent::DrawMap()
+{
+ // TODO
+}
+
+void CEvent::NetAdjustLobbyButtons()
+{
+ // TODO
}
\ No newline at end of file
diff --git a/src/event.h b/src/event.h
index 9dce7f5..011af94 100644
--- a/src/event.h
+++ b/src/event.h
@@ -1,7 +1,5 @@
// Event.h
-
-
/////////////////////////////////////////////////////////////////////////////
#pragma once
@@ -9,7 +7,7 @@
#include "movie.h"
#include "menu.h"
#include "button.h"
-
+#include "text.h"
typedef struct
{
diff --git a/src/jauge.cpp b/src/jauge.cpp
index 9b0c305..3a172cd 100644
--- a/src/jauge.cpp
+++ b/src/jauge.cpp
@@ -1,15 +1,12 @@
// Jauge.cpp
//
-using namespace std;
-#pragma once
-
#include
-#include
-#include
+//#include
+//#include
#include
// #include
-#include
+//#include
#include "def.h"
#include "pixmap.h"
#include "sound.h"
diff --git a/src/jauge.h b/src/jauge.h
index 38fe673..fb44f53 100644
--- a/src/jauge.h
+++ b/src/jauge.h
@@ -3,7 +3,7 @@
#pragma once
//////////////////////////////////////////////////////////////////////////
-// #include
+
#include "pixmap.h"
#include "sound.h"
diff --git a/src/menu.h b/src/menu.h
index fc9c7d7..76b58a3 100644
--- a/src/menu.h
+++ b/src/menu.h
@@ -2,7 +2,6 @@
#pragma once
-// #include
#include "decor.h"
#include "pixmap.h"
diff --git a/src/misc.cpp b/src/misc.cpp
index a92a01d..a7444b9 100644
--- a/src/misc.cpp
+++ b/src/misc.cpp
@@ -29,13 +29,13 @@ void InitHInstance(HINSTANCE hInstance)
void OutputDebug(const char *pMessage)
{
#ifdef _DEBUG
- OutputDebugStringA(pMessage);
+ OutputDebugString(pMessage);
#endif
}
void LoadString(UINT nID, char *pBuffer, int lgBuffer)
{
- LoadStringA(g_hInstance, nID, pBuffer, lgBuffer);
+ LoadString(g_hInstance, nID, pBuffer, lgBuffer);
}
void ChangeSprite(int sprite)
diff --git a/src/misc.h b/src/misc.h
index 42b875b..978a4c2 100644
--- a/src/misc.h
+++ b/src/misc.h
@@ -1,12 +1,13 @@
// misc.h
//
-#pragma once
-// #include
+#include
+
+#pragma once
extern void InitHInstance(HINSTANCE hInstance);
extern void OutputDebug(const char *pMessage);
-extern void LoadString(UINT nID, char *pBuffer, int lgBuffer);
+extern void LoadString(unsigned nID, char *pBuffer, int lgBuffer);
extern void ChangeSprite(int sprite);
extern POINT ConvLongToPos(LPARAM lParam);
diff --git a/src/movie.cpp b/src/movie.cpp
index bf46536..1196e8f 100644
--- a/src/movie.cpp
+++ b/src/movie.cpp
@@ -1,10 +1,6 @@
// movie.cpp
//
-using namespace std;
-
-#pragma once
-
#include
#include
#include
@@ -19,8 +15,6 @@ using namespace std;
#include "movie.h"
#include "misc.h"
-#pragma warning (disable : 4996)
-
//----------------------------------------------------------------------------
#define AVI_VIDEO "avivideo"
diff --git a/src/movie.h b/src/movie.h
index 3dbbf4f..2cdda7d 100644
--- a/src/movie.h
+++ b/src/movie.h
@@ -3,8 +3,6 @@
#pragma once
-// #include
-
class CMovie
{
public:
diff --git a/src/pixmap.cpp b/src/pixmap.cpp
index 177e4be..caadbe1 100644
--- a/src/pixmap.cpp
+++ b/src/pixmap.cpp
@@ -15,7 +15,6 @@
#define DIRECTDRAW_VERSION 0x0500
-
/////////////////////////////////////////////////////////////////////////////
@@ -431,17 +430,22 @@ BOOL CPixmap::InitSysPalette()
return TRUE;
}
-BOOL CPixmap::GetTrueColor()
+BOOL CPixmap::GetTrueColorBack()
{
return m_bTrueColorBack;
}
+BOOL CPixmap::GetTrueColorDecor()
+{
+ return m_bTrueColorDecor;
+}
+
void CPixmap::SetBenchmarkSuccess(BOOL bSuccess)
{
m_bBenchmarkSuccess = bSuccess;
}
-void CPixmap::SetTrueColor(BOOL bTrueColor)
+void CPixmap::SetTrueColorBack(BOOL bTrueColor)
{
m_bTrueColorBack = bTrueColor;
}
@@ -801,7 +805,7 @@ BOOL CPixmap::Cache(int channel, char *pFilename, POINT totalDim, POINT iconDim,
// Cache une image globale.
-BOOL CPixmap::Cache2(int channel, LPCSTR pFilename, POINT totalDim, POINT iconDim, BOOL bUsePalette)
+BOOL CPixmap::Cache(int channel, char* pFilename, POINT totalDim, POINT iconDim, BOOL bUsePalette)
{
HRESULT hErr;
@@ -902,14 +906,14 @@ BOOL CPixmap::BackgroundCache(int channel, const char* pFilename, POINT totalDim
{
strcpy(file, "image16\\");
strcat(file, pFilename);
- if (Cache2(channel, file, totalDim, iconDim, FALSE))
+ if (Cache(channel, file, totalDim, iconDim, FALSE))
{
return TRUE;
}
}
strcpy(file, "image08\\");
strcat(file, pFilename);
- return Cache2(channel, file, totalDim, iconDim, bUsePalette);
+ return Cache(channel, file, totalDim, iconDim, bUsePalette);
}
BOOL CPixmap::CacheAll(BOOL cache, HWND hWnd, BOOL bFullScreen, BOOL bTrueColor, BOOL bTrueColorDecor, int mouseType, const char* pFilename, int region)
diff --git a/src/pixmap.h b/src/pixmap.h
index 0911091..f36c438 100644
--- a/src/pixmap.h
+++ b/src/pixmap.h
@@ -63,9 +63,9 @@ public:
void MouseBackClear();
void MouseBackDraw();
void SetBenchmarkSuccess(BOOL bSuccess);
- void SetTrueColor(BOOL bTrueColor);
+ void SetTrueColorBack(BOOL bTrueColor);
void SetTrueColorDecor(BOOL bTrueColorDecor);
- BOOL GetTrueColor();
+ BOOL GetTrueColorBack();
BOOL GetTrueColorDecor();
protected:
diff --git a/src/resource.h b/src/resource.h
index fbb324d..f64b6ef 100644
--- a/src/resource.h
+++ b/src/resource.h
@@ -2,6 +2,8 @@
// Microsoft Visual C++ generated include file.
// Used by Eggbert 2.rc
//
+#pragma once
+
#define TX_ACTION_GO 1
#define TX_ACTION_STOP 2
#define TX_ACTION_MANGE 3
@@ -37,7 +39,6 @@
#define TX_ACTION_REPEAT 33
#define TX_ACTION_QARMURE 34
#define TX_ACTION_FABARMURE 35
-<<<<<<<< HEAD:src/resource.h
#define TX_IONAMEEX 100
#define TX_IOFREE 101
#define TX_OWNMISSION 102
@@ -116,8 +117,6 @@
#define TX_SAVE_CGAME 270
#define TX_GAMESAVED 288
#define TX_NOTINDEMO 289
-
-========
#define TX_IONAMEEX 100
#define TX_IOFREE 101
#define TX_OWNMISSION 102
@@ -247,7 +246,6 @@
#define TX_MISSIONFREE 272
#define TX_GAMESAVED 288
#define TX_NOTINDEMO 289
->>>>>>>> upstream/Overhaul:resource.h
#define TX_REPEAT_CULTIVE 500
#define TX_REPEAT_FLEUR 501
#define TX_REPEAT_FLEURQ 502
diff --git a/src/resource1.h b/src/resource1.h
index eaa8950..514be47 100644
--- a/src/resource1.h
+++ b/src/resource1.h
@@ -2,6 +2,7 @@
// Microsoft Visual C++ generated include file.
// Used by Eggbert2.rc
//
+#pragma once
#define IDS_STRING101 101
#define IDS_STRING102 102
#define IDC_CURSOR1 102
diff --git a/src/sound.h b/src/sound.h
index 2652be4..b057918 100644
--- a/src/sound.h
+++ b/src/sound.h
@@ -1,12 +1,10 @@
// sound.h
//
-using namespace std;
-
#pragma once
-#include
-//
+//#include
+
#include "dsound.h"
#include
diff --git a/src/text.cpp b/src/text.cpp
index 9e08aa2..0824195 100644
--- a/src/text.cpp
+++ b/src/text.cpp
@@ -1,19 +1,16 @@
// Text.cpp
-#include
-#include
-#include
+//#include
+//#include
+//#include
#include
#include "def.h"
#include "pixmap.h"
#include "text.h"
#include "texttables.h"
-#pragma warning (disable: 4996)
-
/////////////////////////////////////////////////////////////////////////////
-
// Retourne l'offset pour un caract�re donn�.
int GetOffset(char c)