From 7252bd99cf0588f3aab0276668f6cdd118c9c71b Mon Sep 17 00:00:00 2001 From: jummy Date: Tue, 15 Oct 2024 13:41:43 -0500 Subject: [PATCH] compat with visual studio 5 --- .gitignore | 6 + Speedy Eggbert 2 Source.vcxproj | 4 + msvc5/msvc5.dsw | 29 ++++ msvc5/sb2decomp/sb2decomp.dsp | 250 ++++++++++++++++++++++++++++ src/blupi.cpp | 7 +- src/button.cpp | 4 +- src/button.h | 20 ++- src/ddutil.h | 5 +- src/decblock.cpp | 34 ++-- src/decblupi.cpp | 17 +- src/decdesign.cpp | 40 ++--- src/decio.cpp | 2 +- src/decmove.cpp | 45 +++--- src/decnet.cpp | 8 +- src/decor.cpp | 124 +++++++------- src/decor.h | 7 +- src/dectables.h | 278 +++++++++++++++++--------------- src/def.h | 57 +++++-- src/event.cpp | 180 ++++++++------------- src/event.h | 17 +- src/jauge.h | 8 +- src/menu.h | 8 +- src/misc.cpp | 2 +- src/misc.h | 6 +- src/movie.h | 8 +- src/network.cpp | 2 +- src/network.h | 7 +- src/obstacle.h | 10 +- src/pixmap.cpp | 3 +- src/pixmap.h | 8 +- src/pixtables.h | 15 +- src/sound.h | 8 +- src/text.h | 5 +- src/texttables.h | 10 +- src/wave.h | 10 +- 35 files changed, 792 insertions(+), 452 deletions(-) create mode 100644 msvc5/msvc5.dsw create mode 100644 msvc5/sb2decomp/sb2decomp.dsp diff --git a/.gitignore b/.gitignore index 1b4c4b9..798ec53 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ # This .gitignore file was automatically created by Microsoft(R) Visual Studio. ################################################################################ +*.exe /.vs /Debug /Release @@ -12,4 +13,9 @@ /SOUND /MOVIE /DATA +/msvc5/*.ncb +/msvc5/*.opt +/msvc5/sb2decomp/*.plg +/msvc5/sb2decomp/Debug +/msvc5/sb2decomp/Release Speedy Eggbert 2 Source.vcxproj.user \ No newline at end of file diff --git a/Speedy Eggbert 2 Source.vcxproj b/Speedy Eggbert 2 Source.vcxproj index 1913746..397d1d1 100644 --- a/Speedy Eggbert 2 Source.vcxproj +++ b/Speedy Eggbert 2 Source.vcxproj @@ -92,6 +92,7 @@ true MultiplyDefinedSymbolOnly false + false @@ -115,6 +116,7 @@ /DYNAMICBASE "legacy_stdio_definitions.lib" %(AdditionalOptions) /VERBOSE Default dxsdk3/sdk/lib/*.lib;winmm.lib;kernel32.lib;user32.lib;gdi32.lib;%(AdditionalDependencies) + false @@ -137,6 +139,7 @@ dxsdk3/sdk/lib/*.lib;winmm.lib;kernel32.lib;user32.lib;gdi32.lib;%(AdditionalDependencies) false false + false @@ -160,6 +163,7 @@ /DYNAMICBASE "legacy_stdio_definitions.lib" %(AdditionalOptions) /VERBOSE Default dxsdk3/sdk/lib/*.lib;winmm.lib;kernel32.lib;user32.lib;gdi32.lib;%(AdditionalDependencies) + false diff --git a/msvc5/msvc5.dsw b/msvc5/msvc5.dsw new file mode 100644 index 0000000..d06524d --- /dev/null +++ b/msvc5/msvc5.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 5.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "sb2decomp"=".\sb2decomp\sb2decomp.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/msvc5/sb2decomp/sb2decomp.dsp b/msvc5/sb2decomp/sb2decomp.dsp new file mode 100644 index 0000000..83416b6 --- /dev/null +++ b/msvc5/sb2decomp/sb2decomp.dsp @@ -0,0 +1,250 @@ +# Microsoft Developer Studio Project File - Name="sb2decomp" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 5.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Application" 0x0101 + +CFG=sb2decomp - 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 "sb2decomp.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 "sb2decomp.mak" CFG="sb2decomp - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "sb2decomp - Win32 Release" (based on "Win32 (x86) Application") +!MESSAGE "sb2decomp - 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)" == "sb2decomp - 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 Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /W3 /Gi /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)" == "sb2decomp - 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 /Gi /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 /libpath:"..\..\dxsdk3\sdk\lib" + +!ENDIF + +# Begin Target + +# Name "sb2decomp - Win32 Release" +# Name "sb2decomp - Win32 Debug" +# Begin Source File + +SOURCE=..\..\src\blupi.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\src\button.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\src\button.h +# End Source File +# Begin Source File + +SOURCE=..\..\src\ddutil.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\src\ddutil.h +# End Source File +# Begin Source File + +SOURCE=..\..\src\decblock.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\src\decblupi.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\src\decdesign.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\src\decio.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\src\decmove.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\src\decnet.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\src\decor.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\src\decor.h +# End Source File +# Begin Source File + +SOURCE=..\..\src\dectables.h +# End Source File +# Begin Source File + +SOURCE=..\..\src\def.h +# End Source File +# Begin Source File + +SOURCE=..\..\src\event.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\src\event.h +# End Source File +# Begin Source File + +SOURCE=..\..\src\jauge.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\src\jauge.h +# End Source File +# Begin Source File + +SOURCE=..\..\src\menu.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\src\menu.h +# End Source File +# Begin Source File + +SOURCE=..\..\src\misc.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\src\misc.h +# End Source File +# Begin Source File + +SOURCE=..\..\src\movie.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\src\movie.h +# End Source File +# Begin Source File + +SOURCE=..\..\src\network.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\src\network.h +# End Source File +# Begin Source File + +SOURCE=..\..\src\obstacle.h +# End Source File +# Begin Source File + +SOURCE=..\..\src\pixmap.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\src\pixmap.h +# End Source File +# Begin Source File + +SOURCE=..\..\src\pixtables.h +# End Source File +# Begin Source File + +SOURCE=..\..\src\resource.h +# End Source File +# Begin Source File + +SOURCE=..\..\src\resource1.h +# End Source File +# Begin Source File + +SOURCE=..\..\src\sound.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\src\sound.h +# End Source File +# Begin Source File + +SOURCE=..\..\src\text.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\src\text.h +# End Source File +# Begin Source File + +SOURCE=..\..\src\texttables.h +# End Source File +# Begin Source File + +SOURCE=..\..\src\wave.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\src\wave.h +# End Source File +# End Target +# End Project diff --git a/src/blupi.cpp b/src/blupi.cpp index 83be6e8..d01c80f 100644 --- a/src/blupi.cpp +++ b/src/blupi.cpp @@ -21,10 +21,9 @@ #include "movie.h" #include "button.h" #include "menu.h" -#include "jauge.h" #include "event.h" -#include "misc.h" #include "network.h" +#include "misc.h" // Define Globals @@ -335,7 +334,7 @@ void SetDecor(void) phase = g_pEvent->GetPhase(); - rect = { 0, 0, LXIMAGE, LYIMAGE }; + rect = RECT( 0, 0, LXIMAGE, LYIMAGE ); if (phase == WM_PHASE_PLAY || phase == WM_PHASE_PLAYTEST || phase == WM_PHASE_BUILD) { @@ -483,7 +482,7 @@ LRESULT CALLBACK WindowProc(HWND hWnd, UINT message, } if (!g_bFullScreen && g_bTermInit) { - g_pPixmap->BackgroundCache(CHLITTLE, "little.blp", { 256, 96 }, { DIMLITTLEX , DIMLITTLEY }, TRUE); + g_pPixmap->BackgroundCache(CHLITTLE, "little.blp", POINT( 256, 96 ), POINT( DIMLITTLEX , DIMLITTLEY ), TRUE); g_pPixmap->SetTransparent(CHLITTLE, RGB(0, 0, 255)); // bleu g_pPixmap->SavePalette(); diff --git a/src/button.cpp b/src/button.cpp index 48616b1..0adc9d6 100644 --- a/src/button.cpp +++ b/src/button.cpp @@ -6,7 +6,9 @@ //#include //#include -//#include +#ifndef POINT +#include +#endif #include "button.h" #include "misc.h" diff --git a/src/button.h b/src/button.h index 83f02a7..82a45cc 100644 --- a/src/button.h +++ b/src/button.h @@ -1,6 +1,8 @@ -#pragma once +#ifndef BUTTON_H +#define BUTTON_H + +#include -//#include #include "decor.h" #include "pixmap.h" #include "sound.h" @@ -50,19 +52,21 @@ protected: CSound* m_pSound; int m_type; // type de bouton BOOL m_bEnable; // TRUE si bouton actif - BOOL m_bHide; // TRUE si bouton cach� - UINT m_message; // message envoy� si bouton actionn� + BOOL m_bHide; // TRUE si bouton caché + UINT m_message; // message envoyé si bouton actionné POINT m_pos; // coin sup/gauche POINT m_dim; // dimensions int m_state; int m_mouseState; - int m_iconMenu[20]; // ic�nes du sous-menu + int m_iconMenu[20]; // icônes du sous-menu int m_toolTips[20]; // info-bulles int m_nbMenu; // nb de case du sous-menu int m_nbToolTips; // nb d'info-bulles int m_selMenu; - int m_bSomething; // sous-menu s�lectionn� - BOOL m_bMouseDown; // TRUE -> bouton souris press� + int m_bSomething; // sous-menu sélectionné + BOOL m_bMouseDown; // TRUE -> bouton souris pressé BOOL m_bMinimizeRedraw; BOOL m_bRedraw; -}; \ No newline at end of file +}; + +#endif \ No newline at end of file diff --git a/src/ddutil.h b/src/ddutil.h index 406ba8e..1490d25 100644 --- a/src/ddutil.h +++ b/src/ddutil.h @@ -1,3 +1,5 @@ +#ifndef DDUTIL_H +#define DDUTIL_H /*========================================================================== * * Copyright (C) 1995 Microsoft Corporation. All Rights Reserved. @@ -9,7 +11,6 @@ #define DIRECTDRAW_VERSION 0x0500 -#pragma once #include #ifdef __cplusplus @@ -28,3 +29,5 @@ extern HRESULT DDSetColorKey2(IDirectDrawSurface* pdds, COLORREF rg #ifdef __cplusplus } #endif /* __cplusplus */ + +#endif \ No newline at end of file diff --git a/src/decblock.cpp b/src/decblock.cpp index 9238d5e..5a59c5b 100644 --- a/src/decblock.cpp +++ b/src/decblock.cpp @@ -576,6 +576,8 @@ BOOL CDecor::IsRightBorder(POINT pos, POINT offset) } } + + return FALSE; // temp. } @@ -600,19 +602,19 @@ void CDecor::AdaptMidBorder(POINT cel) if (!IsValidCel(cel)) return; int num = 15; - if (!IsRightBorder({ cel.x, cel.y + 1 }, { 0, -1 })) + if (!IsRightBorder(POINT( cel.x, cel.y + 1 ), POINT( 0, -1 ))) { num &= -2; } - if (!IsRightBorder({ cel.x, cel.y + 1 }, { 0, 1 })) + if (!IsRightBorder(POINT( cel.x, cel.y + 1 ), POINT( 0, 1 ))) { num &= -3; } - if (!IsRightBorder({ cel.x + 1, cel.y }, { -1, 0 })) + if (!IsRightBorder(POINT( cel.x + 1, cel.y ), POINT( -1, 0 ))) { num &= -5; } - if (!IsRightBorder({ cel.x - 1, cel.y }, { 1, 0 })) + if (!IsRightBorder(POINT( cel.x - 1, cel.y ), POINT( 1, 0 ))) { num &= -9; } @@ -678,19 +680,19 @@ void CDecor::AdaptMidBorder(POINT cel) if (num2 == -1 || (num2 >= 264 && num2 <= 282)) { num = 15; - if (!IsFromage(cel + POINT{ 0,1 })) + if (!IsFromage(POINT(cel.x, cel.y + 1))) { num &= -2; } - if (!IsFromage(cel - POINT{ 0,1 })) + if (!IsFromage(POINT(cel.x, cel.y - 1))) { num &= -3; } - if (!IsFromage(cel + POINT{ 1,0 })) + if (!IsFromage(POINT(cel.x + 1, cel.y))) { num &= -5; } - if (!IsFromage(cel - POINT{ 1,0 })) + if (!IsFromage(POINT(cel.x - 1, cel.y))) { num &= -9; } @@ -717,19 +719,19 @@ void CDecor::AdaptMidBorder(POINT cel) if (num2 == -1 || (num2 >= 285 && num2 <= 303 && num2 != 301)) { num = 15; - if (!IsGrotte(cel+POINT{0,1})) + if (!IsGrotte(POINT(cel.x, cel.y + 1))) { num &= -2; } - if (!IsGrotte(cel-POINT{0,1})) + if (!IsGrotte(POINT(cel.x, cel.y - 1))) { num &= -3; } - if (!IsGrotte(cel+POINT{1,0})) + if (!IsGrotte(POINT(cel.x + 1, cel.y))) { num &= -5; } - if (!IsGrotte(cel-POINT{1,0})) + if (!IsGrotte(POINT(cel.x - 1, cel.y))) { num &= -9; } @@ -753,10 +755,10 @@ void CDecor::AdaptMidBorder(POINT cel) void CDecor::AdaptBorder(POINT cel) { AdaptMidBorder(cel); - AdaptMidBorder(cel + POINT{1, 0}); - AdaptMidBorder(cel - POINT{1, 0}); - AdaptMidBorder(cel + POINT{ 0,1 }); - AdaptMidBorder(cel - POINT{ 0,1 }); + AdaptMidBorder(POINT(cel.x + 1, cel.y)); + AdaptMidBorder(POINT(cel.x - 1, cel.y)); + AdaptMidBorder(POINT(cel.x, cel.y + 1)); + AdaptMidBorder(POINT(cel.x, cel.y - 1)); int icon = m_decor[cel.x][cel.y].icon; if (icon != -1 && !IsPassIcon(icon)) { diff --git a/src/decblupi.cpp b/src/decblupi.cpp index bb83594..9ccb8e3 100644 --- a/src/decblupi.cpp +++ b/src/decblupi.cpp @@ -283,13 +283,14 @@ RECT CDecor::BlupiRect(POINT pos) // prevent blupi from getting stuck in blocks void CDecor::BlupiAdjust() { + int i; RECT tinyRect = BlupiRect(m_blupiPos); if (!DecorDetect(tinyRect)) { return; } - for (int i = 0; i < 50; i++) + for (i = 0; i < 50; i++) { RECT rect = tinyRect; rect.bottom = rect.top + 2; @@ -303,7 +304,7 @@ void CDecor::BlupiAdjust() tinyRect.bottom += 2; m_blupiPos.y = m_blupiPos.y + 2; } - for (int i = 0; i < 50; i++) + for (i = 0; i < 50; i++) { RECT rect = tinyRect; rect.right = rect.left + 2; @@ -317,7 +318,7 @@ void CDecor::BlupiAdjust() tinyRect.right += 2; m_blupiPos.x = m_blupiPos.x + 2; } - for (int i = 0; i < 50; i++) + for (i = 0; i < 50; i++) { RECT rect = tinyRect; rect.left = rect.right - 2; @@ -331,7 +332,7 @@ void CDecor::BlupiAdjust() tinyRect.right -= 2; m_blupiPos.x = m_blupiPos.x - 2; } - for (int i = 0; i < 50; i++) + for (i = 0; i < 50; i++) { RECT rect = tinyRect; rect.right = rect.left + 2; @@ -343,7 +344,7 @@ void CDecor::BlupiAdjust() tinyRect.right += 2; m_blupiPos.x = m_blupiPos.x + 2; } - for (int i = 0; i < 50; i++) + for (i = 0; i < 50; i++) { RECT rect = tinyRect; rect.left = rect.right - 2; @@ -1294,7 +1295,7 @@ void CDecor::BlupiStep() { m_blupiVitesse.x -= 2; } - if (BlupiBloque({ end.x + m_blupiVitesse.x, end.y }, -1)) + if (BlupiBloque(POINT( end.x + m_blupiVitesse.x, end.y ), -1)) { m_blupiVitesse.x = 0; } @@ -1305,7 +1306,7 @@ void CDecor::BlupiStep() { m_blupiVitesse.x += 2; } - if (BlupiBloque({ end.x + m_blupiVitesse.x, end.y }, -1)) + if (BlupiBloque(POINT( end.x + m_blupiVitesse.x, end.y ), -1)) { m_blupiVitesse.x = 0; } @@ -3678,7 +3679,7 @@ void CDecor::BlupiStep() } if (m_blupiAction == 74 && m_blupiPhase == 128) { - POINT blupiPos2 { 0,0 }; + POINT blupiPos2 = { 0,0 }; if (SearchTeleporte(m_blupiPos, blupiPos2)) { m_blupiPos = blupiPos2; diff --git a/src/decdesign.cpp b/src/decdesign.cpp index a524756..52395f1 100644 --- a/src/decdesign.cpp +++ b/src/decdesign.cpp @@ -9,12 +9,12 @@ 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 - }; + return POINT( + (m_posDecor.x + m_dimCelHili.x * -32 + 32 + pos.x) / DIMOBJX, + (m_posDecor.y + m_dimCelHili.y * -32 + 32 + pos.y) / DIMOBJY + ); } - else return { -1, -1 }; + else return POINT( -1, -1 ); } void CDecor::SetCelPosFromScreenPos(POINT pos) @@ -24,8 +24,8 @@ void CDecor::SetCelPosFromScreenPos(POINT 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 }; + m_dimCelHili = POINT( 1, 1 ); + if (_foo == 2 && _bar != 3 && _bar != 9 && _bar != 10) m_dimCelHili = POINT( 2, 2 ); if (_foo == 3) m_iconLift = _bar; if (_foo == 4) m_iconLift = _bar + 20; if (_foo == 5) m_iconLift = _bar + 40; @@ -250,7 +250,7 @@ void CDecor::PlaceItemFromMenu5(POINT cel, int index, BYTE flags, int currentIco pMob->stepRecede = 1; pMob->timeStopStart = 0; pMob->timeStopEnd = 0; - pMob->posStart = { cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 4 }; + pMob->posStart = POINT( cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 4 ); pMob->posEnd = pMob->posStart; pMob->posCurrent = pMob->posStart; pMob->step = STEP_STOPSTART; @@ -269,7 +269,7 @@ void CDecor::PlaceItemFromMenu5(POINT cel, int index, BYTE flags, int currentIco pMob->stepRecede = 1; pMob->timeStopStart = 0; pMob->timeStopEnd = 0; - pMob->posStart = { cel.x * DIMOBJX + 2, cel.y * DIMOBJY }; + pMob->posStart = POINT( cel.x * DIMOBJX + 2, cel.y * DIMOBJY ); pMob->posEnd = pMob->posStart; pMob->posCurrent = pMob->posStart; pMob->step = STEP_STOPSTART; @@ -288,7 +288,7 @@ void CDecor::PlaceItemFromMenu5(POINT cel, int index, BYTE flags, int currentIco pMob->stepRecede = 1; pMob->timeStopStart = 0; pMob->timeStopEnd = 0; - pMob->posStart = { cel.x * DIMOBJX, cel.y * DIMOBJY }; + pMob->posStart = POINT( cel.x * DIMOBJX, cel.y * DIMOBJY ); pMob->posEnd = pMob->posStart; pMob->posCurrent = pMob->posStart; pMob->step = STEP_STOPSTART; @@ -325,7 +325,7 @@ void CDecor::PlaceItemFromMenu5(POINT cel, int index, BYTE flags, int currentIco pMob->stepRecede = 1; pMob->timeStopStart = 0; pMob->timeStopEnd = 0; - pMob->posStart = { cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 8 }; + pMob->posStart = POINT( cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 8 ); pMob->posEnd = pMob->posStart; pMob->posCurrent = pMob->posStart; pMob->step = STEP_STOPSTART; @@ -396,7 +396,7 @@ void CDecor::PlaceItemFromMenu7(POINT cel, int index, BYTE flags, int currentIco pMob->stepRecede = 1; pMob->timeStopStart = 0; pMob->timeStopEnd = 0; - pMob->posStart = { cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 4 }; + pMob->posStart = POINT( cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 4 ); pMob->posEnd = pMob->posStart; pMob->posCurrent = pMob->posStart; pMob->step = STEP_STOPSTART; @@ -415,7 +415,7 @@ void CDecor::PlaceItemFromMenu7(POINT cel, int index, BYTE flags, int currentIco pMob->stepRecede = 1; pMob->timeStopStart = 0; pMob->timeStopEnd = 0; - pMob->posStart = { cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 8 }; + pMob->posStart = POINT( cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 8 ); pMob->posEnd = pMob->posStart; pMob->posCurrent = pMob->posStart; pMob->step = STEP_STOPSTART; @@ -434,7 +434,7 @@ void CDecor::PlaceItemFromMenu7(POINT cel, int index, BYTE flags, int currentIco pMob->stepRecede = 1; pMob->timeStopStart = 0; pMob->timeStopEnd = 0; - pMob->posStart = { cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 8 }; + pMob->posStart = POINT( cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 8 ); pMob->posEnd = pMob->posStart; pMob->posCurrent = pMob->posStart; pMob->step = STEP_STOPSTART; @@ -453,7 +453,7 @@ void CDecor::PlaceItemFromMenu7(POINT cel, int index, BYTE flags, int currentIco pMob->stepRecede = 1; pMob->timeStopStart = 0; pMob->timeStopEnd = 0; - pMob->posStart = { cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 8 }; + pMob->posStart = POINT( cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 8 ); pMob->posEnd = pMob->posStart; pMob->posCurrent = pMob->posStart; pMob->step = STEP_STOPSTART; @@ -472,7 +472,7 @@ void CDecor::PlaceItemFromMenu7(POINT cel, int index, BYTE flags, int currentIco pMob->stepRecede = 1; pMob->timeStopStart = 0; pMob->timeStopEnd = 0; - pMob->posStart = { cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 6 }; + pMob->posStart = POINT( cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 6 ); pMob->posEnd = pMob->posStart; pMob->posCurrent = pMob->posStart; pMob->step = STEP_STOPSTART; @@ -491,7 +491,7 @@ void CDecor::PlaceItemFromMenu7(POINT cel, int index, BYTE flags, int currentIco pMob->stepRecede = 1; pMob->timeStopStart = 0; pMob->timeStopEnd = 0; - pMob->posStart = { cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 4 }; + pMob->posStart = POINT( cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 4 ); pMob->posEnd = pMob->posStart; pMob->posCurrent = pMob->posStart; pMob->step = STEP_STOPSTART; @@ -510,7 +510,7 @@ void CDecor::PlaceItemFromMenu7(POINT cel, int index, BYTE flags, int currentIco pMob->stepRecede = 1; pMob->timeStopStart = 0; pMob->timeStopEnd = 0; - pMob->posStart = { cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 4 }; + pMob->posStart = POINT( cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 4 ); pMob->posEnd = pMob->posStart; pMob->posCurrent = pMob->posStart; pMob->step = STEP_STOPSTART; @@ -540,7 +540,7 @@ void CDecor::PlaceItemFromMenu7(POINT cel, int index, BYTE flags, int currentIco pMob->stepRecede = 1; pMob->timeStopStart = 0; pMob->timeStopEnd = 0; - pMob->posStart = { cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 6 }; + pMob->posStart = POINT( cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 6 ); pMob->posEnd = pMob->posStart; pMob->posCurrent = pMob->posStart; pMob->step = STEP_STOPSTART; @@ -573,7 +573,7 @@ void CDecor::PlaceItemFromMenu7(POINT cel, int index, BYTE flags, int currentIco pMob->stepRecede = 1; pMob->timeStopStart = 0; pMob->timeStopEnd = 0; - pMob->posStart = { cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 6 }; + pMob->posStart = POINT( cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 6 ); pMob->posEnd = pMob->posStart; pMob->posCurrent = pMob->posStart; pMob->step = STEP_STOPSTART; diff --git a/src/decio.cpp b/src/decio.cpp index c0bab0a..a2add16 100644 --- a/src/decio.cpp +++ b/src/decio.cpp @@ -30,7 +30,7 @@ BOOL CDecor::DeleteMission(int user, int mission, BOOL bUser) BOOL CDecor::Write(int gamer, int mission, BOOL bUser) { char filename[FILENAME_MAX]; - DescFile* pBuffer; + DescFile* pBuffer = NULL; FILE* file; int* blupiDir; POINT* blupiPos; diff --git a/src/decmove.cpp b/src/decmove.cpp index 76db49b..5438d06 100644 --- a/src/decmove.cpp +++ b/src/decmove.cpp @@ -9,9 +9,8 @@ void CDecor::MoveObjectPollution() { POINT blupiPos = m_blupiPos; - POINT pos; + POINT pos = { 0, 0 }; BOOL bPollution; - pos = { 0, 0 }; int num = 20; bPollution = FALSE; if (m_blupiAction == 3) @@ -388,7 +387,7 @@ BOOL CDecor::ObjectDelete(POINT pos, int type) void CDecor::MoveObjectStep() { - m_blupiVector = { 0, 0 }; + m_blupiVector = POINT( 0, 0 ); m_blupiTransport = -1; for (int i = 0; i < MAXMOVEOBJECT; i++) { @@ -436,7 +435,7 @@ void CDecor::MoveObjectStepLine(int i) MoveObject moveObject; POINT tinyPoint; BOOL flag = FALSE; - RECT tinyRect { 0, 0, 0, 0 }; + RECT tinyRect = { 0, 0, 0, 0 }; if (m_moveObject[i].type == TYPE_ASCENSEUR || m_moveObject[i].type == TYPE_ASCENSEURs || m_moveObject[i].type == TYPE_ASCENSEURsi && @@ -1540,7 +1539,7 @@ void CDecor::DynamiteStart(int i, int dx, int dy) 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 { 0, 0, 0, 0 }; + RECT tinyRect = { 0, 0, 0, 0 }; if (IntersectRect(&tinyRect, &src2, &src)) { if (m_moveObject[i].type == TYPE_CAISSE) @@ -1599,7 +1598,7 @@ int CDecor::AscenseurDetect(RECT rect, POINT oldpos, POINT newpos) src.bottom = m_moveObject[i].posCurrent.y + 16; if (num < 30) { - RECT tinyRect { 0, 0, 0, 0 }; + RECT tinyRect = { 0, 0, 0, 0 }; if (IntersectRect(&tinyRect, &src, &rect)) { return i; @@ -1612,7 +1611,7 @@ int CDecor::AscenseurDetect(RECT rect, POINT oldpos, POINT newpos) src2.bottom -= num / 30 * num2; for (int j = 0; j <= num / 30; j++) { - RECT tinyRect { 0, 0, 0, 0 }; + RECT tinyRect = { 0, 0, 0, 0 }; if (IntersectRect(&tinyRect, &src, &src2)) { return i; @@ -1689,12 +1688,13 @@ void CDecor::UpdateCaisse() BOOL CDecor::TestPushCaisse(int i, POINT pos, BOOL bPop) { POINT move; + int j; 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++) + for (j = 0; j < m_nbLinkCaisse; j++) { i = m_linkCaisse[j]; if (!TestPushOneCaisse(i, move, y)) @@ -1702,7 +1702,7 @@ BOOL CDecor::TestPushCaisse(int i, POINT pos, BOOL bPop) return FALSE; } } - for (int j = 0; j < m_nbLinkCaisse; j++) + for (j = 0; j < m_nbLinkCaisse; j++) { i = m_linkCaisse[j]; int num = i; @@ -1780,7 +1780,7 @@ void CDecor::SearchLinkCaisse(int rank, BOOL bPop) src2.top = m_moveObject[num2].posCurrent.y - 1; src2.right = src2.left + DIMOBJX + 1; src2.bottom = src2.top + DIMOBJY + 1; - RECT tinyRect { 0,0,0,0 }; + RECT tinyRect = { 0,0,0,0 }; if (IntersectRect(&tinyRect, &src2, &src) && AddLinkCaisse(num2)) { flag = TRUE; @@ -1903,7 +1903,7 @@ int CDecor::MockeryDetect(POINT pos) src2.right = m_moveObject[i].posCurrent.x + DIMBLUPIX; src2.top = m_moveObject[i].posCurrent.y + 36; src2.bottom = m_moveObject[i].posCurrent.y + DIMBLUPIY; - RECT tinyRect{ 0,0,0,0 }; + RECT tinyRect = { 0,0,0,0 }; if (IntersectRect(&tinyRect, &src2, &src)) { if (m_moveObject[i].type == TYPE_CREATURE) @@ -1955,7 +1955,7 @@ BOOL CDecor::BlupiElectro(POINT pos) src2.right = m_blupiPos.x + DIMBLUPIX + 16 + 40; src2.top = m_blupiPos.y + 11 - 40; src2.bottom = m_blupiPos.y + DIMBLUPIY - 2 + 40; - RECT tinyRect{ 0,0,0,0 }; + RECT tinyRect = { 0,0,0,0 }; return IntersectRect(&tinyRect, &src, &src2); } @@ -1975,7 +1975,7 @@ void CDecor::MoveObjectFollow(POINT pos) src2.right = m_moveObject[i].posCurrent.x + DIMBLUPIX + 100; src2.top = m_moveObject[i].posCurrent.y - 100; src2.bottom = m_moveObject[i].posCurrent.y + DIMBLUPIY + 100; - RECT tinyRect { 0, 0, 0, 0 }; + RECT tinyRect = { 0, 0, 0, 0 }; if (IntersectRect(&tinyRect, &src2, &src)) { m_moveObject[i].type = TYPE_BOMBEFOLLOW2; @@ -2053,8 +2053,7 @@ int CDecor::MoveObjectDetect(POINT pos, BOOL* pbNear) src3.top = m_moveObject[i].posCurrent.y + 10; src3.bottom = m_moveObject[i].posCurrent.y + DIMBLUPIY - 32; } - RECT rect; - rect = { 0, 0, 0, 0 }; + RECT rect = { 0, 0, 0, 0 }; if (IntersectRect(&rect, &src3, &src)) { *pbNear = TRUE; @@ -2091,7 +2090,7 @@ int CDecor::MoveAscenseurDetect(POINT pos, int height) src2.right = m_moveObject[i].posCurrent.x + DIMOBJX; src2.top = m_moveObject[i].posCurrent.y; src2.bottom = m_moveObject[i].posCurrent.y + 16; - RECT tinyRect { 0, 0, 0, 0 }; + RECT tinyRect = { 0, 0, 0, 0 }; if (IntersectRect(&tinyRect, &src2, &src)) { return i; @@ -2117,7 +2116,7 @@ int CDecor::MoveChargeDetect(POINT pos) src2.right = m_moveObject[i].posCurrent.x + DIMBLUPIX + 10; src2.top = m_moveObject[i].posCurrent.y + 36; src2.bottom = m_moveObject[i].posCurrent.y + DIMBLUPIY; - RECT tinyRect { 0, 0, 0, 0 }; + RECT tinyRect = { 0, 0, 0, 0 }; if (IntersectRect(&tinyRect, &src2, &src)) { return i; @@ -2144,7 +2143,7 @@ int CDecor::MovePersoDetect(POINT pos) src2.right = m_moveObject[i].posCurrent.x + DIMBLUPIX + 16; src2.top = m_moveObject[i].posCurrent.y + 36; src2.bottom = m_moveObject[i].posCurrent.y + DIMBLUPIY; - RECT tinyRect { 0, 0, 0, 0 }; + RECT tinyRect = { 0, 0, 0, 0 }; if (IntersectRect(&tinyRect, &src2, &src)) { return i; @@ -2178,7 +2177,7 @@ int CDecor::MoveBalleDetect(POINT pos) rcSrc1.left = m_moveObject->posCurrent.x + 16; rcSrc1.bottom = m_moveObject->posCurrent.y + 50; rcSrc1.top = m_moveObject->posCurrent.y + 16; - rcDst = { 0, 0, 0, 0 }; + rcDst = RECT( 0, 0, 0, 0 ); if (IntersectRect(&rcDst, &rcSrc1, &rcSrc2)) return i; } @@ -2240,15 +2239,17 @@ int CDecor::SortGetType(int type) void CDecor::MoveObjectSort() { MoveObject src; + int i; int num = 0; - for (int i = 0; i < MAXMOVEOBJECT; i++) + + for (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++) + for (i = num; i < MAXMOVEOBJECT; i++) { m_moveObject[i].type = 0; } @@ -2260,7 +2261,7 @@ void CDecor::MoveObjectSort() do { flag = FALSE; - for (int i = 0; i < num - 1; i++) + for (i = 0; i < num - 1; i++) { if (SortGetType(m_moveObject[i].type) > SortGetType(m_moveObject[i + 1].type)) { diff --git a/src/decnet.cpp b/src/decnet.cpp index 51b6f7e..75561dc 100644 --- a/src/decnet.cpp +++ b/src/decnet.cpp @@ -72,7 +72,11 @@ void CDecor::NetDataFlush() void CDecor::NetFUN_155e0(BYTE _foo, short _bar) { - char data[4]{ 4, _foo, _bar & 0xff, _bar >> 8 }; + char data[4]; + data[0] = 4; + data[1] = _foo; + data[2] = _bar & 0xff; + data[3] = _bar >> 8; m_pNetwork->Send(&data, 4, DPSEND_GUARANTEED); return; } @@ -194,7 +198,7 @@ void CDecor::NotifPush(char *str) } strcpy(m_notifText[i], str); m_notifTime = NOTIFDELAY; - m_pSound->PlayImage(SOUND_TRESOR, { LXIMAGE / 2, LYIMAGE / 2 }, -1); + m_pSound->PlayImage(SOUND_TRESOR, POINT( LXIMAGE / 2, LYIMAGE / 2 ), -1); } void CDecor::NotifStep() diff --git a/src/decor.cpp b/src/decor.cpp index 2fd9079..44c3645 100644 --- a/src/decor.cpp +++ b/src/decor.cpp @@ -75,9 +75,9 @@ void CDecor::Create(HWND hWnd, CSound* pSound, CPixmap* pPixmap, CNetwork* pNetw m_bJeepStop = FALSE; InitDecor(); - m_jauges[0].Create(m_hWnd, m_pPixmap, m_pSound, { 169, 450 }, 1, FALSE); + m_jauges[0].Create(m_hWnd, m_pPixmap, m_pSound, POINT( 169, 450 ), 1, FALSE); m_jauges[0].SetHide(TRUE); - m_jauges[1].Create(m_hWnd, m_pPixmap, m_pSound, { 171, 450 }, 3, FALSE); + m_jauges[1].Create(m_hWnd, m_pPixmap, m_pSound, POINT( 171, 450 ), 3, FALSE); m_jauges[1].SetHide(TRUE); NetMessageIndexFlush(); NotifFlush(); @@ -85,14 +85,13 @@ void CDecor::Create(HWND hWnd, CSound* pSound, CPixmap* pPixmap, CNetwork* pNetw BOOL CDecor::LoadImages() { - POINT totalDim, iconDim; + POINT totalDim = { LXIMAGE, LYIMAGE }; + POINT iconDim = { 0, 0 }; char filename[52]; if (m_lastRegion == m_region) return TRUE; m_lastRegion = m_region; - totalDim = { LXIMAGE, LYIMAGE }; - iconDim = { 0, 0 }; sprintf(filename, "decor%.3d.blp", m_region); return m_pPixmap->BackgroundCache(CHDECOR, filename, totalDim, iconDim, FALSE); @@ -106,8 +105,9 @@ void CDecor::InitGamer() void CDecor::InitDecor() { - m_posDecor = { 0, 0 }; - m_dimDecor = { 100, 100 }; + int i; + m_posDecor = POINT( 0, 0 ); + m_dimDecor = POINT( 100, 100 ); m_music = 1; m_region = 2; m_missionTitle[0] = '\0'; @@ -134,7 +134,7 @@ void CDecor::InitDecor() m_moveObject[0].stepRecede = 1; m_moveObject[0].timeStopStart = 0; m_moveObject[0].timeStopEnd = 0; - m_moveObject[0].posStart = { 258, 196 }; + m_moveObject[0].posStart = POINT( 258, 196 ); m_moveObject[0].posEnd = m_moveObject[0].posStart; m_moveObject[0].posCurrent = m_moveObject[0].posStart; m_moveObject[0].phase = 0; @@ -147,7 +147,7 @@ void CDecor::InitDecor() m_moveObject[1].stepAdvance = 1; m_moveObject[1].timeStopStart = 0; m_moveObject[1].timeStopEnd = 0; - m_moveObject[1].posStart = { 322, 196 }; + m_moveObject[1].posStart = POINT( 322, 196 ); m_moveObject[1].posEnd = m_moveObject[1].posStart; m_moveObject[1].posCurrent = m_moveObject[1].posStart; m_moveObject[1].phase = 0; @@ -155,13 +155,13 @@ void CDecor::InitDecor() m_moveObject[1].time = 0; m_moveObject[1].channel = CHELEMENT; m_moveObject[1].icon = 29; - for (int i = 0; i < MAXFIFOPOS; i++) + for (i = 0; i < MAXFIFOPOS; i++) { - m_blupiFifoPos[i] = { 0, 0 }; + m_blupiFifoPos[i] = POINT( 0, 0 ); } - for (int i = 0; i < MAXNETPLAYER; i++) + for (i = 0; i < MAXNETPLAYER; i++) { - m_blupiStartPos[i] = { 194, 192 + BLUPIOFFY }; + m_blupiStartPos[i] = POINT( 194, 192 + BLUPIOFFY ); m_blupiStartDir[i] = DIR_RIGHT; } m_blupiAction = ACTION_STOP; @@ -190,7 +190,7 @@ void CDecor::InitDecor() m_blupiActionOuf = 0; m_blupiTimeNoAsc = 0; m_blupiTimeMockery = 0; - m_blupiVitesse = { 0, 0 }; + m_blupiVitesse = POINT( 0, 0 ); m_blupiValidPos = m_blupiStartPos[0]; m_blupiEnergyUnused = 100; m_blupiFront = FALSE; @@ -317,7 +317,7 @@ void CDecor::PlayPrepare(BOOL bTest) MoveObjectSort(); UpdateCaisse(); m_scrollPoint = m_blupiPos; - m_scrollAdd = { 0, 0 }; + m_scrollAdd = POINT( 0, 0 ); m_blupiPosHelico.x = -1; m_nbLinkCaisse = 0; m_bHelicoMarch = FALSE; @@ -420,6 +420,7 @@ int CDecor::GetIconPerso() void CDecor::Build(RECT rect) { int num = 1; + int i, j; POINT tinyPoint; tinyPoint.x = 0; RECT lastClip; @@ -430,11 +431,11 @@ void CDecor::Build(RECT rect) POINT posDecor = DecorNextAction(); POINT pos = { posDecor.x * 2 / 3 % DIMDECORX, posDecor.y * 2 / 3 % DIMDECORY }; - for (int i = 0; i < ((DIMDECORX - DIMDECORX / LXIMAGE * LXIMAGE) ? 2 : 1) + LXIMAGE / DIMDECORX; i++) + for (i = 0; i < ((DIMDECORX - DIMDECORX / LXIMAGE * LXIMAGE) ? 2 : 1) + LXIMAGE / DIMDECORX; i++) { tinyPoint.y = 0; rect.top = pos.y; - for (int j = 0; j < ((DIMDECORY - DIMDECORY / LYIMAGE * LYIMAGE) ? 2 : 1) + LYIMAGE / DIMDECORY; j++) + for (j = 0; j < ((DIMDECORY - DIMDECORY / LYIMAGE * LYIMAGE) ? 2 : 1) + LYIMAGE / DIMDECORY; j++) { rect.left = i ? 0 : pos.x; rect.right = DIMDECORX; @@ -448,9 +449,9 @@ void CDecor::Build(RECT rect) } tinyPoint.x = -posDecor.x % DIMOBJX - DIMOBJX; - for (int i = posDecor.x / DIMOBJX - 1; i < posDecor.x / DIMOBJX + LXIMAGE / DIMOBJX + 3; i++) { + for (i = posDecor.x / DIMOBJX - 1; i < posDecor.x / DIMOBJX + LXIMAGE / DIMOBJX + 3; i++) { tinyPoint.y = -posDecor.y % DIMOBJY + 2 - DIMOBJY; - for (int j = posDecor.y / DIMOBJY - 1; j < posDecor.y / DIMOBJY + LYIMAGE / DIMOBJY + 2; j++) + for (j = posDecor.y / DIMOBJY - 1; j < posDecor.y / DIMOBJY + LYIMAGE / DIMOBJY + 2; j++) { if (i >= 0 && i < MAXCELX && j >= 0 && j < MAXCELY) { @@ -481,10 +482,10 @@ void CDecor::Build(RECT rect) } tinyPoint.x = -posDecor.x % DIMOBJX; - for (int i = posDecor.x / DIMOBJX; i < posDecor.x / DIMOBJX + LXIMAGE / DIMOBJX + 2; i++) + for (i = posDecor.x / DIMOBJX; i < posDecor.x / DIMOBJX + LXIMAGE / DIMOBJX + 2; i++) { tinyPoint.y = -posDecor.y % DIMOBJY; - for (int j = posDecor.y / DIMOBJY; j < posDecor.y / DIMOBJY + LYIMAGE / DIMOBJY + 2; j++) + for (j = posDecor.y / DIMOBJY; j < posDecor.y / DIMOBJY + LYIMAGE / DIMOBJY + 2; j++) { if (i >= 0 && i < MAXCELX && j >= 0 && j < MAXCELY && m_decor[i][j].icon != -1) { @@ -559,18 +560,18 @@ void CDecor::Build(RECT rect) m_blupiSec = SEC_HIDE; if (m_blupiTimeShield > 25 || m_time % 4 < 2) { - m_pPixmap->DrawIcon(CHTEMP, CHOBJECT, 0xF5, { 0, 0 }, 0, TRUE); + m_pPixmap->DrawIcon(CHTEMP, CHOBJECT, 0xF5, POINT( 0, 0 ), 0, TRUE); } else { m_pPixmap->DrawIcon(CHTEMP, GetBlupiChannelStandard(), m_blupiIcon, pos, 1, FALSE); - m_pPixmap->DrawIcon(CHTEMP, CHOBJECT, 0xED, { 0, 0 }, 0, TRUE); + m_pPixmap->DrawIcon(CHTEMP, CHOBJECT, 0xED, POINT( 0, 0 ), 0, TRUE); } } m_pPixmap->QuickIcon(GetBlupiChannelStandard(), m_blupiIcon, tinyPoint); } - for (int i = 0; i < MAXMOVEOBJECT; i++) + for (i = 0; i < MAXMOVEOBJECT; i++) { if (m_moveObject[i].type != 0 && m_moveObject[i].posCurrent.x >= posDecor.x - 64 && m_moveObject[i].posCurrent.y >= posDecor.y - 64 && m_moveObject[i].posCurrent.x <= posDecor.x + LXIMAGE && m_moveObject[i].posCurrent.y <= posDecor.y + LYIMAGE && (m_moveObject[i].type < 8 || m_moveObject[i].type > 11) && (m_moveObject[i].type < 90 || m_moveObject[i].type > 95) && (m_moveObject[i].type < 98 || m_moveObject[i].type > 100) && m_moveObject[i].type != 53 && m_moveObject[i].type != 1 && m_moveObject[i].type != 47 && m_moveObject[i].type != 48) { @@ -589,9 +590,9 @@ void CDecor::Build(RECT rect) m_pPixmap->QuickIcon(m_moveObject[i].channel, m_moveObject[i].icon, tinyPoint); if (m_moveObject[i].type == 30) { - for (int l = 0; l < sizeof(table_drinkoffset) / sizeof(int); l++) + for (int L = 0; L < sizeof(table_drinkoffset) / sizeof(int); L++) { - int num4 = (m_time + table_drinkoffset[l]) % 50; + int num4 = (m_time + table_drinkoffset[L]) % 50; int rank = table_drinkeffect[num4 % 5]; POINT tinyPoint2 = { tinyPoint.x + 2, tinyPoint.y - num4 * 3 }; POINT pos2 = tinyPoint2; @@ -605,10 +606,10 @@ void CDecor::Build(RECT rect) } } tinyPoint.x = -posDecor.x % 64; - for (int i = posDecor.x / 64; i < posDecor.x / 64 + LXIMAGE / 64 + 2; i++) + for (i = posDecor.x / 64; i < posDecor.x / 64 + LXIMAGE / 64 + 2; i++) { tinyPoint.y = 0 - posDecor.y % 64; - for (int j = posDecor.y / 64; j < posDecor.y / 64 + LYIMAGE / 64 + 2; j++) + for (j = posDecor.y / 64; j < posDecor.y / 64 + LYIMAGE / 64 + 2; j++) { if (i >= 0 && i < 100 && j >= 0 && j < 100 && m_decor[i][j].icon != -1) { @@ -693,10 +694,10 @@ void CDecor::Build(RECT rect) } } tinyPoint.x = 0 - posDecor.x % 64; - for (int i = posDecor.x / 64; i < posDecor.x / 64 + LXIMAGE / 64 + 2; i++) + for (i = posDecor.x / 64; i < posDecor.x / 64 + LXIMAGE / 64 + 2; i++) { tinyPoint.y = 0 - posDecor.y % 64; - for (int j = posDecor.y / 64; j < posDecor.y / 64 + LYIMAGE / 64 + 2; j++) + for (j = posDecor.y / 64; j < posDecor.y / 64 + LYIMAGE / 64 + 2; j++) { if (i >= 0 && i < 100 && j >= 0 && j < 100 && m_decor[i][j].icon != -1) { @@ -752,7 +753,7 @@ void CDecor::Build(RECT rect) num2 = table_decor_eau2[(i * 11 + j * 7 + m_time / num5) % 6]; m_pPixmap->QuickIcon(1, num2, pos); } - if (num2 == 305 && BlitzActif({ i, j })) + if (num2 == 305 && BlitzActif(POINT( i, j ))) { num2 = rand() % 4 + 305; m_pPixmap->QuickIcon(1, num2, pos); @@ -802,7 +803,7 @@ void CDecor::Build(RECT rect) } tinyPoint.x += 64; } - for (int i = 0; i < MAXMOVEOBJECT; i++) + for (i = 0; i < MAXMOVEOBJECT; i++) { if (m_moveObject[i].type != 0 && m_moveObject[i].posCurrent.x >= posDecor.x - 64 && m_moveObject[i].posCurrent.y >= posDecor.y - 64 && m_moveObject[i].posCurrent.x <= posDecor.x + LXIMAGE && m_moveObject[i].posCurrent.y <= posDecor.y + LYIMAGE && ((m_moveObject[i].type >= 8 && m_moveObject[i].type <= 11) || (m_moveObject[i].type >= 90 && m_moveObject[i].type <= 95) || (m_moveObject[i].type >= 98 && m_moveObject[i].type <= 100) || m_moveObject[i].type == 53)) { @@ -816,7 +817,7 @@ void CDecor::Build(RECT rect) char str[20]; sprintf(str, "#%d", i); DrawText(m_pPixmap, posDecor - m_moveObject[i].posCurrent, str, FONTWHITE); - DrawText(m_pPixmap, posDecor - m_moveObject[i].posCurrent + POINT{0, 10}, m_moveObject[i].type ? debugMobTypeNames[m_moveObject[i].type] : "-", FONTWHITE); + DrawText(m_pPixmap, posDecor - m_moveObject[i].posCurrent + POINT(0, 10), m_moveObject[i].type ? debugMobTypeNames[m_moveObject[i].type] : "-", FONTWHITE); } //// } @@ -835,11 +836,12 @@ void CDecor::DrawInfo() { POINT pos; char text[100]; + int i; if (m_phase == WM_PHASE_PLAY || m_phase == WM_PHASE_PLAYTEST) { - pos = { 10, 10 }; - for (int i = 0; i < MAXNOTIF; i++) { + pos = POINT( 10, 10 ); + for (i = 0; i < MAXNOTIF; i++) { if (m_notifText[i][0] != '\0') { DrawText(m_pPixmap, pos, m_notifText[i], FONTWHITE); } @@ -847,7 +849,7 @@ void CDecor::DrawInfo() } if (m_nbVies > 0) { - pos = { -15, 417 }; + pos = POINT( -15, 417 ); for (int i = 0; i < m_nbVies; i++) { m_pPixmap->QuickIcon(GetBlupiChannelActual(), 48, pos); pos.x += 16; @@ -855,7 +857,7 @@ void CDecor::DrawInfo() } if (m_blupiBullet > 0) { - pos = { 398, 442 }; + pos = POINT( 398, 442 ); for (int i = 0; i < m_blupiBullet; i++) { m_pPixmap->QuickIcon(CHELEMENT, 176, pos); pos.x += 4; @@ -863,34 +865,34 @@ void CDecor::DrawInfo() } if (m_blupiPerso > 0) { - m_pPixmap->QuickIcon(CHBUTTON, GetIconPerso(), { 465, 438 }); + m_pPixmap->QuickIcon(CHBUTTON, GetIconPerso(), POINT( 465, 438 )); sprintf(text, "= %d", m_blupiPerso); - DrawText(m_pPixmap, { 497, 452 }, text, FONTWHITE); + DrawText(m_pPixmap, POINT( 497, 452 ), text, FONTWHITE); } if (m_blupiDynamite > 0) { - m_pPixmap->QuickIcon(CHELEMENT, 252, { 505, 414 }); + m_pPixmap->QuickIcon(CHELEMENT, 252, POINT( 505, 414 )); } if (m_blupiCle | CLE_RED) { - m_pPixmap->QuickIcon(CHELEMENT, 215, { 520, 418 }); + m_pPixmap->QuickIcon(CHELEMENT, 215, POINT( 520, 418 )); } if (m_blupiCle | CLE_GREEN) { - m_pPixmap->QuickIcon(CHELEMENT, 222, { 530, 418 }); + m_pPixmap->QuickIcon(CHELEMENT, 222, POINT( 530, 418 )); } if (m_blupiCle | CLE_BLUE) { - m_pPixmap->QuickIcon(CHELEMENT, 229, { 540, 418 }); + m_pPixmap->QuickIcon(CHELEMENT, 229, POINT( 540, 418 )); } if ((m_mission != 1 && m_mission % 10 != 0) || m_bPrivate) { sprintf(text, "%d/%d", m_nbTresor, m_totalTresor); - DrawText(m_pPixmap, { 590, 452 }, text, FONTWHITE); + DrawText(m_pPixmap, POINT( 590, 452 ), text, FONTWHITE); } - for (int i = 0; i < 2; i++) + for (i = 0; i < 2; i++) { if (!(m_jauges[i].GetHide())) m_jauges[i].Draw(); } @@ -1068,7 +1070,7 @@ void CDecor::VehicleSoundsPhase(int phase) if (m_bHelicoStop) channel = SOUND_HELICOLOW; if (m_bJeepMarch) channel = SOUND_JEEPHIGH; if (m_bJeepStop) channel = SOUND_JEEPLOW; - if (channel != -1) m_pSound->PlayImage(channel, { LXIMAGE / 2, LYIMAGE / 2 }, -1); + if (channel != -1) m_pSound->PlayImage(channel, POINT( LXIMAGE / 2, LYIMAGE / 2 ), -1); } else { if (m_bHelicoMarch) m_pSound->StopSound(SOUND_HELICOHIGH); @@ -1154,11 +1156,12 @@ void CDecor::SetAllMissions(BOOL bAllMissions) void CDecor::CheatAction(int cheat) { MoveObject* mob; + int i; switch (cheat) { case 2: // cleanall - for (int i = 0; i < MAXMOVEOBJECT; i++) + for (i = 0; i < MAXMOVEOBJECT; i++) { mob = &m_moveObject[i]; switch (mob->type) @@ -1179,7 +1182,8 @@ void CDecor::CheatAction(int cheat) m_decorPhase = 0; mob->type = TYPE_EXPLO1; mob->phase = 0; - mob->posCurrent -= { 34, 34 }; + mob->posCurrent.x -= 34; + mob->posCurrent.y -= 34; mob->posStart = mob->posCurrent; mob->posEnd = mob->posCurrent; MoveObjectStepIcon(i); @@ -1230,7 +1234,7 @@ void CDecor::CheatAction(int cheat) PlaySound(SOUND_JEEPLOW, m_blupiPos, TRUE); break; case 9: // alltreasure - for (int i = 0; i < MAXMOVEOBJECT; i++) + for (i = 0; i < MAXMOVEOBJECT; i++) { if (m_moveObject[i].type == TYPE_TRESOR) { @@ -1242,7 +1246,7 @@ void CDecor::CheatAction(int cheat) } break; case 10: // endgoal - for (int i = 0; i < MAXMOVEOBJECT; i++) + for (i = 0; i < MAXMOVEOBJECT; i++) { mob = &m_moveObject[i]; if (mob->type == TYPE_GOAL || mob->type == TYPE_CLE) @@ -1482,7 +1486,7 @@ void CDecor::SetTeam(int team) POINT CDecor::VoyageGetPosVie(int nbVies) { - return { nbVies * 20 - 5, 417 }; + return POINT( nbVies * 20 - 5, 417 ); } void CDecor::VoyageInit(POINT start, POINT end, int icon, int channel) @@ -1725,26 +1729,26 @@ BOOL CDecor::SearchWorld(int world, POINT *cel, POINT *newBlupiPos) { if (x > 1 && m_decor[x - 1][y].icon == Object::DoorLevel) { - *cel = { x - 1, y }; - *newBlupiPos = { (x - 2) * DIMOBJX + 2, y * DIMOBJY + 6 }; + *cel = POINT( x - 1, y ); + *newBlupiPos = POINT( (x - 2) * DIMOBJX + 2, y * DIMOBJY + 6 ); return TRUE; } if (x > 2 && m_decor[x - 2][y].icon == Object::DoorLevel) { - *cel = { x - 2, y }; - *newBlupiPos = { (x - 3) * DIMOBJX + 2, y * DIMOBJY + 6 }; + *cel = POINT( x - 2, y ); + *newBlupiPos = POINT( (x - 3) * DIMOBJX + 2, y * DIMOBJY + 6 ); return TRUE; } if (x < MAXCELX - 1 && m_decor[x + 1][y].icon == Object::DoorLevel) { - *cel = { x + 1, y }; - *newBlupiPos = { (x + 2) * DIMOBJX + 2, y * DIMOBJY + 6 }; + *cel = POINT( x + 1, y ); + *newBlupiPos = POINT( (x + 2) * DIMOBJX + 2, y * DIMOBJY + 6 ); return TRUE; } if (x < MAXCELX - 2 && m_decor[x + 2][y].icon == Object::DoorLevel) { - *cel = { x + 2, y }; - *newBlupiPos = { (x + 3) * DIMOBJX + 2, y * DIMOBJY + 6 }; + *cel = POINT( x + 2, y ); + *newBlupiPos = POINT( (x + 3) * DIMOBJX + 2, y * DIMOBJY + 6 ); return TRUE; } } @@ -1862,7 +1866,7 @@ void CDecor::OpenDoorsTresor() int icon = m_decor[x][y].icon; if (icon >= 0x1a5 && icon <= 0x1a5 + m_nbTresor - 1) { - OpenDoor({ x, y }); + OpenDoor(POINT( x, y )); } } } diff --git a/src/decor.h b/src/decor.h index 9e6fb43..b20e6c4 100644 --- a/src/decor.h +++ b/src/decor.h @@ -1,5 +1,6 @@ // Decor.h -#pragma once +#ifndef DECOR_H +#define DECOR_H #include "DEF.H" #include "jauge.h" @@ -621,4 +622,6 @@ inline BOOL CDecor::IsBlupiStanding() !IsBlupiVehicle() && !(m_blupiAir || m_blupiBalloon || m_blupiEcrase || m_blupiNage || m_blupiSurf || m_blupiSuspend); -} \ No newline at end of file +} + +#endif diff --git a/src/dectables.h b/src/dectables.h index 3a6d3db..5b98355 100644 --- a/src/dectables.h +++ b/src/dectables.h @@ -1,51 +1,53 @@ -#pragma once +#ifndef DECTABLES_H +#define DECTABLES_H + #include "obstacle.h" -extern int table_blitz[] +extern int table_blitz[] = { 0, 7, 15, 18, 26, 27, 32, 39, 45, 47, 50, 58, 60, 62, 64, 66, 68, 70, 71, 72, -1 }; -extern int table_vitesse_march[] +extern int table_vitesse_march[] = { 2, 4, 6, 8 }; -extern int table_vitesse_nage[] +extern int table_vitesse_nage[] = { 2, 1, 5, 10, 8, 6, 4 }; -extern int table_vitesse_surf[] +extern int table_vitesse_surf[] = { 0, 2, 5, 8, 3, 0 }; -extern int table_bulldozer_left[]{ 66, 66, 67, 67, 66, 66, 65, 65 }; +extern int table_bulldozer_left[] = { 66, 66, 67, 67, 66, 66, 65, 65 }; -extern int table_bulldozer_right[]{ 58, 58, 57, 57, 58, 58, 59, 59 }; +extern int table_bulldozer_right[] = { 58, 58, 57, 57, 58, 58, 59, 59 }; -extern int table_bulldozer_turn2l[] +extern int table_bulldozer_turn2l[] = { 58, 59, 59, 59, 60, 60, 60, 61, 61, 62, 62, 63, 63, 64, 64, 64, 65, 65, 65, 66, 66, 66 }; -extern int table_bulldozer_turn2r[] +extern int table_bulldozer_turn2r[] = { 66, 65, 65, 65, 64, 64, 64, 63, 63, 62, 62, 61, 61, 60, 60, 60, 59, 59, 59, 58, 58, 58 }; -extern int table_poisson_left[]{ 82, 82, 81, 81, 82, 82, 83, 83 }; +extern int table_poisson_left[] = { 82, 82, 81, 81, 82, 82, 83, 83 }; -extern int table_poisson_right[]{ 79, 79, 78, 78, 79, 79, 80, 80 }; +extern int table_poisson_right[] = { 79, 79, 78, 78, 79, 79, 80, 80 }; -extern int table_poisson_turn2l[] +extern int table_poisson_turn2l[] = { 79, 79, 80, 80, 84, 84, 85, 85, 86, 86, 87, 87, 88, 88, 83, 83, 82, 82, 83, 83, @@ -54,7 +56,7 @@ extern int table_poisson_turn2l[] 86, 86, 87, 87, 88, 88, 83, 83 }; -extern int table_poisson_turn2r[] +extern int table_poisson_turn2r[] = { 82, 82, 83, 83, 88, 88, 87, 87, 86, 86, 85, 85, 84, 84, 79, 79, 79, 79, 80, 80, @@ -63,27 +65,27 @@ extern int table_poisson_turn2r[] 86, 86, 85, 85, 84, 84, 79, 79 }; -extern int table_oiseau_left[]{ 98, 99, 100, 101, 102, 103, 104, 105 }; +extern int table_oiseau_left[] = { 98, 99, 100, 101, 102, 103, 104, 105 }; -extern int table_oiseau_right[]{ 90, 91, 92, 93, 94, 95, 96, 97 }; +extern int table_oiseau_right[] = { 90, 91, 92, 93, 94, 95, 96, 97 }; -extern int table_oiseau_turn2l[]{ 106, 107, 108, 109, 110, 111, 112, 113, 105, 105 }; +extern int table_oiseau_turn2l[] = { 106, 107, 108, 109, 110, 111, 112, 113, 105, 105 }; -extern int table_oiseau_turn2r[]{ 114, 115, 116, 117, 118, 119, 120, 121, 97, 97 }; +extern int table_oiseau_turn2r[] = { 114, 115, 116, 117, 118, 119, 120, 121, 97, 97 }; -extern int table_guepe_left[]{ 195, 196, 197, 198, 197, 196 }; +extern int table_guepe_left[] = { 195, 196, 197, 198, 197, 196 }; -extern int table_guepe_right[]{ 199, 200, 201, 202, 201, 200 }; +extern int table_guepe_right[] = { 199, 200, 201, 202, 201, 200 }; -extern int table_guepe_turn2l[]{ 5, 207, 206, 205, 204, 203 }; +extern int table_guepe_turn2l[] = { 5, 207, 206, 205, 204, 203 }; -extern int table_guepe_turn2r[]{ 203, 204, 205, 206, 207 }; +extern int table_guepe_turn2r[] = { 203, 204, 205, 206, 207 }; -extern int table_creature_left[]{ 247, 248, 249, 250, 251, 250, 249, 248 }; +extern int table_creature_left[] = { 247, 248, 249, 250, 251, 250, 249, 248 }; -extern int table_creature_right[]{ 247, 248, 249, 250, 251, 250, 249, 248 }; +extern int table_creature_right[] = { 247, 248, 249, 250, 251, 250, 249, 248 }; -extern int table_creature_turn2[] +extern int table_creature_turn2[] = { 244, 244, 244, 244, 244, 244, 244, 244, 243, 243, 242, 242, 242, 242, 242, 242, 242, 242, 243, 243, @@ -103,43 +105,43 @@ extern int table_creature_turn2[] 244, 244 }; -extern int table_blupih_left[]{ 66, 67, 68, 67, 66, 69, 70, 69 }; +extern int table_blupih_left[] = { 66, 67, 68, 67, 66, 69, 70, 69 }; -extern int table_blupih_right[]{ 61, 62, 63, 62, 61, 64, 65, 64 }; +extern int table_blupih_right[] = { 61, 62, 63, 62, 61, 64, 65, 64 }; -extern int table_blupih_turn2l[] +extern int table_blupih_turn2l[] = { 71, 71, 72, 72, 73, 73, 74, 74, 75, 75, 68, 68, 275, 275, 271, 271, 271, 271, 272, 272, 273, 273, 273, 273, 275, 275 }; -extern int table_blupih_turn2r[] +extern int table_blupih_turn2r[] = { 75, 75, 74, 74, 73, 73, 72, 72, 71, 71, 63, 63, 274, 274, 271, 271, 271, 271, 272, 272, 273, 273, 273, 273, 274, 274 }; -extern int table_blupit_left[]{ 249, 249, 250, 250, 249, 249, 248, 248 }; +extern int table_blupit_left[] = { 249, 249, 250, 250, 249, 249, 248, 248 }; -extern int table_blupit_right[]{ 238, 238, 237, 237, 238, 238, 239, 239 }; +extern int table_blupit_right[] = { 238, 238, 237, 237, 238, 238, 239, 239 }; -extern int table_blupit_turn2l[] +extern int table_blupit_turn2l[] = { 238, 238, 251, 251, 238, 238, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 249, 249, 252, 252, 249, 249 }; -extern int table_blupit_turn2r[] +extern int table_blupit_turn2r[] = { 249, 249, 252, 252, 249, 249, 249, 248, 247, 246, 245, 244, 243, 242, 241, 240, 239, 238, 238, 238, 251, 251, 238, 238 }; -extern int table_explo1[] +extern int table_explo1[] = { 0, 0, 1, 1, 2, 2, 3, 3, 4, 3, 4, 4, 3, 4, 3, 3, 4, 4, 5, 5, @@ -147,29 +149,29 @@ extern int table_explo1[] 7, 8, 8, 9, 9, 10, 10, 11, 11 }; -extern int table_explo2[] +extern int table_explo2[] = { 12, -1, 13, 14, -1, 15, 13, -1, 14, 15, 12, -1, 13, 15, 14, 14, -1, 14, 15, 13 }; -extern int table_explo3[] +extern int table_explo3[] = { 32, 32, 34, 34, 32, 32, 34, 34, 32, 32, 34, 34, 32, 32, 35, 35, 32, 32, 35, 35 }; -extern int table_explo4[]{ 12, 13, 14, 15, 7, 8, 9, 10, 11 }; +extern int table_explo4[] = { 12, 13, 14, 15, 7, 8, 9, 10, 11 }; -extern int table_explo5[] +extern int table_explo5[] = { 54, -1, 55, -1, 56, -1, 57, -1, 58, -1, 59, -1 }; -extern int table_explo6[]{ 54, 55, 56, 57, 58, 59 }; +extern int table_explo6[] = { 54, 55, 56, 57, 58, 59 }; -extern int table_explo7[] +extern int table_explo7[] = { 60, 61, -1, 63, 64, 65, 62, 64, 62, 60, 62, -1, 65, -1, 60, 65, 63, 61, 62, -1, @@ -186,23 +188,23 @@ extern int table_explo7[] -1, 61, -1, -1, -1, 60, -1, -1 }; -extern int table_explo8[]{ 7, 8, 9, 10, 11 }; +extern int table_explo8[] = { 7, 8, 9, 10, 11 }; -extern int table_sploutch1[]{ 90, 91, 92, 93, 94, 95, 96, 97, 98, 99 }; +extern int table_sploutch1[] = { 90, 91, 92, 93, 94, 95, 96, 97, 98, 99 }; -extern int table_sploutch2[] +extern int table_sploutch2[] = { -1, -1, -1, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99 }; -extern int table_sploutch3[] +extern int table_sploutch3[] = { -1, -1, -1, -1, -1, -1, -1, -1, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99 }; -extern int table_tentacule[] +extern int table_tentacule[] = { 86, 85, 84, 83, 84, 85, 86, -1, 86, 85, 84, 83, 82, 81, 80, 79, 78, 77, 76, 75, @@ -211,7 +213,7 @@ extern int table_tentacule[] 83, 84, 85, 86, -1 }; -extern int table_bridge[] +extern int table_bridge[] = { 365, 366, 365, 366, 365, 366, 365, 366, 365, 366, 365, 366, 365, 366, 365, 366, 367, 367, 368, 368, @@ -231,55 +233,55 @@ extern int table_bridge[] 367, 367, 366, 366, 365, 365, 364 }; -extern int table_pollution[]{ 179, 180, 181, 182, 183, 184, 185, 186 }; +extern int table_pollution[] = { 179, 180, 181, 182, 183, 184, 185, 186 }; -extern int table_invertstart[]{ 179, 180, 181, 182, 183, 184, 185, 186 }; +extern int table_invertstart[] = { 179, 180, 181, 182, 183, 184, 185, 186 }; -extern int table_invertstop[]{ 186, 185, 184, 183, 182, 181, 180, 179 }; +extern int table_invertstop[] = { 186, 185, 184, 183, 182, 181, 180, 179 }; -extern int table_invertpanel[]{ 187, 188, 189, 190, 191, 192, 193, 194 }; +extern int table_invertpanel[] = { 187, 188, 189, 190, 191, 192, 193, 194 }; -extern int table_plouf[]{ 99, 100, 101, 102, 101, 100, 99 }; +extern int table_plouf[] = { 99, 100, 101, 102, 101, 100, 99 }; -extern int table_tiplouf[]{ 244, 99, 244 }; +extern int table_tiplouf[] = { 244, 99, 244 }; -extern int table_blup[] +extern int table_blup[] = { 103, 104, 105, 106, 104, 103, 106, 105, 103, 104, 103, 105, 106, 103, 105, 106, 103, 104, 106, 105 }; -extern int table_follow1[] +extern int table_follow1[] = { 256, 256, 256, 257, 257, 258, 259, 260, 261, 262, 263, 264, 264, 265, 265, 265, 264, 264, 263, 262, 261, 260, 259, 258, 257, 257 }; -extern int table_follow2[]{ 256, 258, 260, 262, 264 }; +extern int table_follow2[] = { 256, 258, 260, 262, 264 }; -extern int table_cle[] +extern int table_cle[] = { 122, 123, 124, 125, 126, 127, 128, 127, 126, 125, 124, 123 }; -extern int table_cle1[] +extern int table_cle1[] = { 209, 210, 211, 212, 213, 214, 215, 214, 213, 212, 211, 210 }; -extern int table_cle2[] +extern int table_cle2[] = { 220, 221, 222, 221, 220, 219, 218, 217, 216, 217, 218, 219 }; -extern int table_cle3[] +extern int table_cle3[] = { 229, 228, 227, 226, 225, 224, 223, 224, 225, 226, 227, 228 }; -extern int table_decor_action[] +extern int table_decor_action[] = { 1,32, -4,4, 4,-3, -4,2, 4,5, -4,-1, 4,2, -4,-4, 4,-3, -3,2, 3,2, @@ -315,7 +317,7 @@ extern int table_decor_action[] 0 }; -extern int table_dynamitef[] +extern int table_dynamitef[] = { 253, 252, 254, 252, 252, 255, 252, 254, 253, 252, 253, 254, 255, 252, 255, 253, 252, 254, 252, 255, @@ -329,7 +331,7 @@ extern int table_dynamitef[] 255, 253, 253, 254, 255, 254, 252, 253, 254, 255 }; -extern int table_skate[] +extern int table_skate[] = { 129, 129, 129, 129, 130, 130, 130, 131, 131, 132, 132, 133, 133, 134, 134, 134, 135, 135, 135, 135, @@ -337,14 +339,14 @@ extern int table_skate[] 130, 130, 130, 130 }; -extern int table_glu[] +extern int table_glu[] = { 168, 168, 169, 169, 170, 170, 171, 171, 170, 170, 169, 169, 168, 168, 169, 169, 169, 168, 168, 169, 169, 170, 170, 169, 168 }; -extern int table_clear[] +extern int table_clear[] = { 40, 40, 40, 40, 41, 41, 41, 41, 40, 40, 40, 40, 40, 40, 40, 41, 41, 41, 40, 40, @@ -355,7 +357,7 @@ extern int table_clear[] 47, 47, 46, 46, 47, 47, 46, 46, 47, 47 }; -extern int table_electro[] +extern int table_electro[] = { 266, 267, 266, 267, 266, 267, 266, 267, 266, 267, 266, 267, 266, 267, 266, 267, 266, 267, 266, 267, @@ -368,11 +370,11 @@ extern int table_electro[] 46, 46, 47, 47, 46, 46, 47, 47, 46, 46 }; -extern int table_chenille[]{ 311, 312, 313, 314, 315, 316 }; +extern int table_chenille[] = { 311, 312, 313, 314, 315, 316 }; -extern int table_chenillei[]{ 316, 315, 314, 313, 312, 311 }; +extern int table_chenillei[] = { 316, 315, 314, 313, 312, 311 }; -extern int table_adapt_decor[] +extern int table_adapt_decor[] = { 153, 147, 148, 146, 40, 151, 150, 144, 39, 152, 149, 145, 38, 36, 37, 35, 153, 147, 148, 146, @@ -391,7 +393,7 @@ extern int table_adapt_decor[] 251, 250, 256, 250 }; -extern int table_adapt_fromage[] +extern int table_adapt_fromage[] = { -1, 265, 264, 268, 267, 273, 271, 275, 266, 272, 270, 274, 269, 277, 276, 278, -1, 286, 285, 289, @@ -399,64 +401,64 @@ extern int table_adapt_fromage[] 297, 299 }; -extern int table_shield[] +extern int table_shield[] = { 144, 145, 146, 147, 148, 149, 150, 151, 266, 267, 268, 269, 270, 271, 272, 273 }; -extern int table_shield_blupi[] +extern int table_shield_blupi[] = { 144, 145, 146, 147, 148, 149, 150, 151, 266, 267, 268, 269, 270, 271, 272, 273 }; -extern int table_power[]{ 8, 136, 137, 138, 139, 140, 141, 142, 143 }; +extern int table_power[] = { 8, 136, 137, 138, 139, 140, 141, 142, 143 }; -extern int table_invert[] +extern int table_invert[] = { 187, 187, 187, 188, 189, 190, 191, 192, 193, 194, 187, 187, 187, 194, 193, 192, 191, 190, 189, 188 }; -extern int table_charge[]{ 238, 239, 240, 241, 242, 243 }; +extern int table_charge[] = { 238, 239, 240, 241, 242, 243 }; -extern int table_magicloop[]{ 152, 153, 154, 155, 156 }; +extern int table_magicloop[] = { 152, 153, 154, 155, 156 }; -extern int table_magictrack[] +extern int table_magictrack[] = { 152, 153, 154, 155, 156, 152, 153, 154, 155, 156, 157, 158, 159, 160, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166 }; -extern int table_shieldloop[]{ 274, 275, 276, 277, 278 }; +extern int table_shieldloop[] = { 274, 275, 276, 277, 278 }; -extern int table_shieldtrack[] +extern int table_shieldtrack[] = { 274, 275, 276, 277, 278, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288 }; -extern int table_drinkeffect[]{ 274, 275, 276, 277, 278 }; +extern int table_drinkeffect[] = { 274, 275, 276, 277, 278 }; -extern int table_drinkoffset[]{ 0, 7, 22 }; +extern int table_drinkoffset[] = { 0, 7, 22 }; -extern int table_tresortrack[] +extern int table_tresortrack[] = { 166, 165, 164, 163, 162, 161, 162, 163, 164, 165, 166 }; -extern int table_decor_piege1[] +extern int table_decor_piege1[] = { 374, 374, 373, 347, 373, 374, 374, 374, 373, 347, 347, 373, 374, 374, 374, 374 }; -extern int table_decor_piege2[]{ 374, 373, 347, 373 }; +extern int table_decor_piege2[] = { 374, 373, 347, 373 }; -extern int table_decor_goutte[] +extern int table_decor_goutte[] = { 410, 409, 410, -1, -1, -1, -1, -1, -1, 410, 409, 408, 409, 410, -1, -1, -1, -1, -1, -1, @@ -465,86 +467,96 @@ extern int table_decor_goutte[] -1, 410, 409, 410, -1, -1, -1, -1 }; -extern int table_decor_ecraseur[]{ 317, 317, 318, 319, 320, 321, 322, 323, 323, 323 }; +extern int table_decor_ecraseur[] = { 317, 317, 318, 319, 320, 321, 322, 323, 323, 323 }; -extern int table_decor_scie[]{ 378, 379, 380, 381, 382, 383 }; +extern int table_decor_scie[] = { 378, 379, 380, 381, 382, 383 }; -extern int table_decor_temp[] +extern int table_decor_temp[] = { 328, 328, 327, 327, 326, 326, 325, 325, 324, 324, 325, 325, 326, 326, 327, 329, 328, 328, -1, -1 }; -extern int table_decor_eau1[]{ 92, 93, 94, 95, 94, 93 }; +extern int table_decor_eau1[] = { 92, 93, 94, 95, 94, 93 }; -extern int table_decor_eau2[]{ 91, 96, 97, 98, 97, 96 }; +extern int table_decor_eau2[] = { 91, 96, 97, 98, 97, 96 }; -extern int table_decor_ventillod[]{ 129, 130, 131 }; +extern int table_decor_ventillod[] = { 129, 130, 131 }; -extern int table_decor_ventilloh[]{ 132, 133, 134 }; +extern int table_decor_ventilloh[] = { 132, 133, 134 }; -extern int table_decor_ventillob[]{ 135, 136, 137 }; +extern int table_decor_ventillob[] = { 135, 136, 137 }; -extern int table_decor_ventd[]{ 114, 115, 116, 117 }; +extern int table_decor_ventd[] = { 114, 115, 116, 117 }; -extern int table_decor_venth[]{ 118, 119, 120, 121 }; +extern int table_decor_venth[] = { 118, 119, 120, 121 }; -extern int table_decor_ventb[]{ 122, 123, 124, 125 }; +extern int table_decor_ventb[] = { 122, 123, 124, 125 }; -extern int table_marine[] +extern int table_marine[] = { 0, 2, 5, 8, 3, 0 }; -extern int table_36418[]{ 10, 2, 3, 4, 5, 6, 7, 8, 9, 1, 11, 12, 13, 14 }; -extern int table_36458[]{ 19, 20, 21, 23, 24, 25, 26, 27, 28, 29 }; -extern int table_36488[]{ 15, 16, 17, 18 }; -extern int table_364a0[]{ 73, 22 }; -extern int table_364b0[]{ 78, 79, 80, 81, 82, 83, 84 }; -extern int table_364d0[]{ 87, 88, 89, 90 }; -extern int table_364e8[]{ 85, 86 }; -extern int table_364f8[]{ 396, 388, 389, 390, 391 }; -extern int table_36510[]{ 398, 399, 400 }; -extern int table_36520[]{ 87, 88, 89 }; -extern int table_36530[]{ 0x99 }; -extern int table_36538[]{ 0x9a, 0x9b }; -extern int table_36548[]{ 0xb9 }; -extern int table_36550[]{ 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f }; -extern int table_36570[]{ 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xe6, 0xe7, 0xe9, 0xea }; -extern int table_365a8[]{ 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe8 }; -extern int table_365d0[]{ 0x9d }; -extern int table_365d8[]{ 0x8b, 0x8c, 0x8d, 0x8e, 0x8f }; -extern int table_365f0[]{ 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0xc0 }; -extern int table_36610[]{ 0xc1, 0xc2, 0xc3, 0xc4, 0xc5 }; -extern int table_decor_lave[]{ 68, 69, 70, 71, 72, 71, 70, 69 }; -extern int table_36630[]{ 0x5b, 0x5c }; -extern int table_decor_ventillog[]{ 126, 127, 128 }; -extern int table_decor_ventg[]{ 110, 111, 112, 113 }; -extern int table_36670[]{ 0x4c, 0x4d, 0xc7, 0xc6, 0xc8, 0xc9, 0xeb, 0xec, 0x177, 0x178, 0x179 }; -extern int table_366a0[]{ 0x193, 0x191, 0x192 }; -extern int table_366b0[]{ 20, 21, 22 }; -extern int table_366c0[]{ 16, 17, 18, 19 }; -extern int table_366d8[]{ 23, 24, 25 }; -extern int table_366e8[]{ 0x1a, 0x1b }; -extern int table_366f8[]{ 0x1c, 0x1d, 0x1e, 0x1f }; -extern int table_36710[]{ 0x2d, 0x2e, 0x2f, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c}; -extern int table_36748[]{ 0x42, 0x43, 0x44, 0x45 }; +extern int table_36418[] = { 10, 2, 3, 4, 5, 6, 7, 8, 9, 1, 11, 12, 13, 14 }; +extern int table_36458[] = { 19, 20, 21, 23, 24, 25, 26, 27, 28, 29 }; +extern int table_36488[] = { 15, 16, 17, 18 }; +extern int table_364a0[] = { 73, 22 }; +extern int table_364b0[] = { 78, 79, 80, 81, 82, 83, 84 }; +extern int table_364d0[] = { 87, 88, 89, 90 }; +extern int table_364e8[] = { 85, 86 }; +extern int table_364f8[] = { 396, 388, 389, 390, 391 }; +extern int table_36510[] = { 398, 399, 400 }; +extern int table_36520[] = { 87, 88, 89 }; +extern int table_36530[] = { 0x99 }; +extern int table_36538[] = { 0x9a, 0x9b }; +extern int table_36548[] = { 0xb9 }; +extern int table_36550[] = { 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f }; +extern int table_36570[] = { 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xe6, 0xe7, 0xe9, 0xea }; +extern int table_365a8[] = { 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe8 }; +extern int table_365d0[] = { 0x9d }; +extern int table_365d8[] = { 0x8b, 0x8c, 0x8d, 0x8e, 0x8f }; +extern int table_365f0[] = { 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0xc0 }; +extern int table_36610[] = { 0xc1, 0xc2, 0xc3, 0xc4, 0xc5 }; +extern int table_decor_lave[] = { 68, 69, 70, 71, 72, 71, 70, 69 }; +extern int table_36630[] = { 0x5b, 0x5c }; +extern int table_decor_ventillog[] = { 126, 127, 128 }; +extern int table_decor_ventg[] = { 110, 111, 112, 113 }; +extern int table_36670[] = { 0x4c, 0x4d, 0xc7, 0xc6, 0xc8, 0xc9, 0xeb, 0xec, 0x177, 0x178, 0x179 }; +extern int table_366a0[] = { 0x193, 0x191, 0x192 }; +extern int table_366b0[] = { 20, 21, 22 }; +extern int table_366c0[] = { 16, 17, 18, 19 }; +extern int table_366d8[] = { 23, 24, 25 }; +extern int table_366e8[] = { 0x1a, 0x1b }; +extern int table_366f8[] = { 0x1c, 0x1d, 0x1e, 0x1f }; +extern int table_36710[] = { 0x2d, 0x2e, 0x2f, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c}; +extern int table_36748[] = { 0x42, 0x43, 0x44, 0x45 }; -extern int table_blupi[]{ - 5, 0, 6, 0, 7, 0, 7, 0, 6, 0, 5, 0, 4, 0, 2, 0, 0, 0, -2, 0, -4, 0, -5, 0, -6, 0, -7, 0, -7, 0, -6, 0, -5, 0, -4, 0, -2, 0, 0, 0, 2, 0, 4, 0, 5, 0, 6, 0, 7, 0, 7, 0, 6, 0, 5, 0, 4, 0, 2, 0, 0, 0, -2, 0, -4, 0, -5, 0, -6, 0, -7, 0, -7, 0, -6, 0, -5, 0, -4, 0, -2, 0, 0, 0, 2, 0, 4, 0, 5, 0, 6, 0, 7, 0, 7, 0, 6, 0, 5, 0, 4, 0, 2, 0, 0, 0, -2, 0, -4, 0, -5, 0, -6, 0, -7, 0, -7, 0, -6, 0, -5, 0, -4, 0, -2, 0, 0, 0, 2, 0, 4, 0, 5, 0, 6, 0, 7, 0, 7, 0, 6, 0, 5, 0, 4, 0, 2, 0, 0, 0, -2, 0, -4, 0, -5, 0, -6, 0, -7, 0, -7, 0, -6, 0, -5, 0, -4, 0, -2, 0, -1, 0, 0, 0, 14, 10, 2, 3, 4, 5, 6, 7, 8, 9, 1, 11, 12, 13, 14, 0, 10, 19, 20, 21, 23, 24, 25, 26, 27, 28, 29, 0, 4, 15, 16, 17, 18, 0, 2, 73, 22, 0, 7, 78, 79, 80, 81, 82, 83, 84, 4, 87, 88, 89, 90, 0, 2, 85, 86, 0, 5, 396, 388, 389, 390, 391, 3, 398, 399, 400, 3, 87, 88, 89, 1, 153, 2, 154, 155, 0, 1, 185, 7, 41, 42, 43, 44, 45, 46, 47, 12, 215, 216, 217, 218, 219, 220, 221, 222, 230, 231, 233, 234, 0, 8, 223, 224, 225, 226, 227, 228, 229, 232, 0, 1, 157, 5, 139, 140, 141, 142, 143, 7, 186, 187, 188, 189, 190, 191, 192, 5, 193, 194, 195, 196, 197, 1, 68, 2, 91, 92, 0, 4, 126, 129, 132, 135, 0, 4, 110, 114, 118, 122, 0, 11, 76, 77, 199, 198, 200, 201, 235, 236, 375, 376, 377, 3, 403, 401, 402, 3, 20, 21, 22, 4, 16, 17, 18, 19, 0, 3, 23, 24, 25, 2, 26, 27, 0, 4, 28, 29, 30, 31, 0, 12, 45, 46, 47, 36, 37, 38, 39, 40, 41, 42, 43, 44, 0, 4, 66, 67, 68, 69, 0, 23, 158, 159, 160, 161, 162, 163, 164, 165, 309, 411, 412, 413, 414, 415, 174, 175, 176, 177, 178, 179, 180, 181, 184, 2, 182, 183, 0, 3, 334, 335, 336, 20, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 0, 2, 378, 384, 0, 15, 29, 10, 2, 3, 4, 5, 6, 7, 8, 9, 1, 11, 12, 13, 14, 6, 19, 20, 21, 23, 24, 28, 0, 4, 15, 16, 17, 18, 0, 7, 78, 79, 80, 81, 82, 83, 84, 4, 87, 88, 89, 90, 0, 3, 153, 74, 75, 7, 41, 42, 43, 44, 45, 46, 47, 8, 215, 216, 217, 218, 219, 220, 230, 231, 0, 5, 226, 227, 228, 229, 232, 4, 157, 109, 108, 107, 0, 1, 338, 4, 261, 262, 263, 283, 0, 3, 251, 252, 253, 2, 387, 397, 0, 1, 340, 1, 361, 5, 139, 140, 141, 142, 143, 7, 186, 187, 188, 189, 190, 191, 192, 3, 32, 33, 34, 10, 2, 4, 79, 84, 143, 219, 230, 246, 341, 396, 0, 4, 330, 331, 332, 333, 0, 35, 18, 0, 276, 276, 277, 277, 278, 278, 279, 279, 280, 280, 281, 281, 282, 282, 283, 283, 284, 284, 1, 330, 0, 0, 0, 0, 0, 0, 23, 23, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 23, 23, 23, 23, 23, 0, 0, 0, 0, 0, 0, 0, 0, 23, 23, 23, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 23, 23, 23, 23, 0, 0, 0, 23, 23, 23, 0, 0, 0, 0, 0, 0, 133, 133, 0, 0, 0, 133, 133, 0, 0, 0, 0, 0, 0, 0, 133, 133, 0, 0, 0, 0, 23, 23, 23, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 23, 0, 0, 0, 0, 0, 23, 23, 23, 0, 0, 0, 135, 135, 136, 136, 137, 137, 137, 137, 137, 137, 137, 137, 138, 138, 137, 137, 137, 138, 138, 137, 137, 137, 138, 138, 137, 137, 137, 138, 138, 137, 137, 137, 137, 137, 137, 136, 136, 135, 135, 135, 0, 0, 0, 0, 0, 23, 23, 23, 0, 0, 133, 133, 0, 0, 0, 23, 23, 23, 23, 0, 0, 0, 0, 0, 0, 0, 23, 23, 0, 0, 0, 0, 0, 0, 0, 0, 133, 133, 0, 0, 0, 0, 0, 23, 23, 23, 23, 0, 0, 0, 135, 135, 136, 136, 137, 137, 137, 137, 137, 137, 137, 137, 138, 138, 137, 137, 137, 138, 138, 137, 137, 137, 138, 138, 137, 137, 137, 138, 138, 137, 137, 137, 138, 138, 137, 137, 137, 138, 138, 137, 137, 137, 138, 138, 137, 137, 137, 138, 138, 137, 137, 137, 138, 138, 137, 137, 137, 138, 138, 137, 137, 137, 138, 138, 137, 137, 137, 138, 138, 137, 137, 137, 137, 137, 137, 136, 136, 135, 135, 135, 0, 0, 0, 0, 0, 23, 23, 23, 0, 0, 133, 133, 0, 0, 0, 23, 23, 23, 23, 0, 0, 0, 0, 0, 0, 0, 23, 23, 0, 0, 0, 0, 0, 0, 0, 0, 133, 133, 0, 0, 0, 0, 0, 23, 23, 23, 23, 0, 0, 0, 2, 6, 0, 5, 6, 7, 8, 9, 10, 60, 3, 0, 19, 18, 19, 3, 6, 0, 1, 1, 2, 2, 3, 3, 4, 3, 0, 17, 18, 19, 5, 5, 4, 169, 26, 170, 170, 27, 59, 6, 0, 3, 3, 2, 2, 1, 1, 61, 5, 0, 34, 35, 34, 34, 33, 62, 2, 0, 35, 34, 6, 3, 2, 33, 34, 35, 7, 1, 0, 44, 8, 8, 0, 0, 169, 26, 170, 27, 171, 28, 172, 9, 6, 0, 5, 6, 7, 8, 9, 10, 10, 6, 0, 5, 6, 7, 8, 9, 10, 13, 6, 0, 41, 41, 42, 42, 43, 43, 11, 70, 0, 40, 40, 40, 40, 41, 41, 41, 41, 40, 40, 40, 40, 40, 40, 40, 41, 41, 41, 40, 40, 40, 40, 40, 40, 40, 41, 41, 41, 40, 40, 42, 42, 42, 43, 43, 43, 44, 44, 44, 45, 45, 45, 46, 46, 47, 47, 46, 46, 47, 47, 46, 46, 47, 47, 46, 46, 47, 47, 46, 46, 47, 47, 46, 46, 47, 47, 46, 46, 47, 47, 75, 1, 0, -1, 76, 70, 0, 40, 40, 40, 40, 41, 41, 41, 41, 40, 40, 40, 40, 40, 40, 40, 41, 41, 41, 40, 40, 40, 40, 40, 40, 40, 41, 41, 41, 40, 40, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 77, 110, 0, 324, 325, 324, 325, 324, 325, 324, 325, 324, 325, 324, 325, 324, 325, 324, 325, 324, 325, 324, 325, 324, 324, 325, 325, 326, 326, 327, 327, 328, 328, 329, 329, 330, 330, 331, 331, 332, 332, 333, 333, 334, 334, 333, 333, 332, 332, 331, 331, 330, 330, 329, 329, 329, 330, 330, 330, 331, 331, 331, 332, 332, 332, 333, 333, 333, 334, 334, 334, 333, 333, 333, 332, 332, 332, 331, 331, 331, 330, 330, 330, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 78, 1, 0, -1, 79, 1, 0, -1, 80, 1, 0, -1, 81, 1, 0, -1, 14, 6, 0, 49, 50, 51, 52, 53, 54, 29, 6, 0, 126, 125, 124, 123, 122, 121, 28, 6, 0, 122, 122, 122, 125, 125, 125, 15, 1, 0, 61, 16, 8, 0, 61, 62, 63, 62, 61, 64, 65, 64, 17, 10, 0, 71, 71, 72, 72, 73, 73, 74, 74, 75, 75, 67, 1, 0, 315, 68, 12, 0, 296, 297, 298, 299, 300, 301, 302, 301, 300, 299, 298, 297, 69, 7, 0, 296, 310, 311, 312, 313, 314, 303, 18, 10, 0, 76, 76, 76, 76, 76, 76, 77, 77, 77, 77, 19, 14, 0, 76, 76, 77, 77, 78, 78, 79, 79, 80, 80, 81, 81, 39, 39, 20, 10, 0, 88, 88, 89, 89, 90, 90, 91, 91, 92, 92, 21, 12, 0, 93, 93, 94, 94, 95, 95, 96, 96, 97, 97, 98, 98, 22, 12, 0, 93, 93, 94, 94, 95, 95, 96, 96, 97, 97, 98, 98, 23, 10, 0, 105, 105, 106, 106, 107, 107, 108, 108, 109, 109, 24, 90, 0, 93, 96, 98, 94, 95, 93, 95, 98, 93, 94, 96, 96, 94, 94, 98, 98, 93, 93, 97, 97, 94, 94, 94, 96, 96, 96, 93, 93, 93, 93, 94, 94, 94, 94, 94, 97, 97, 97, 97, 97, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 79, 79, 76, 76, 76, 76, 79, 79, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 25, 8, 0, 111, 111, 110, 110, 111, 111, 112, 112, 26, 8, 0, 111, 111, 110, 110, 111, 111, 112, 112, 27, 7, 0, 112, 113, 114, 115, 116, 117, 118, 30, 12, 0, 25, 25, 29, 29, 46, 46, 47, 47, 46, 46, 29, 29, 31, 328, 0, 156, 156, 156, 156, 157, 157, 157, 157, 158, 158, 158, 158, 157, 157, 157, 157, 156, 156, 156, 156, 157, 157, 157, 157, 158, 158, 158, 158, 157, 157, 157, 157, 156, 156, 156, 156, 157, 157, 157, 157, 158, 158, 158, 158, 157, 157, 157, 157, 156, 156, 156, 156, 157, 157, 157, 157, 158, 158, 158, 158, 157, 157, 157, 157, 156, 156, 156, 156, 157, 157, 157, 157, 158, 158, 158, 158, 157, 157, 157, 157, 156, 156, 156, 156, 157, 157, 157, 157, 158, 158, 158, 158, 157, 157, 157, 157, 156, 156, 156, 156, 157, 157, 157, 157, 158, 158, 158, 158, 157, 157, 157, 157, 144, 144, 143, 143, 151, 151, 162, 162, 163, 163, 164, 164, 163, 163, 162, 162, 163, 163, 164, 164, 163, 163, 162, 162, 163, 163, 164, 164, 163, 163, 162, 162, 163, 163, 164, 164, 163, 163, 162, 162, 151, 151, 143, 143, 144, 144, 157, 157, 156, 156, 156, 156, 157, 157, 157, 157, 158, 158, 158, 158, 157, 157, 157, 157, 156, 156, 156, 156, 157, 157, 157, 157, 158, 158, 158, 158, 157, 157, 157, 157, 156, 156, 156, 156, 157, 157, 157, 157, 158, 158, 158, 158, 157, 157, 157, 157, 156, 156, 156, 156, 157, 157, 157, 157, 158, 158, 158, 158, 157, 157, 157, 157, 144, 144, 143, 143, 151, 151, 162, 162, 163, 163, 164, 164, 163, 163, 162, 162, 163, 163, 164, 164, 163, 163, 162, 162, 163, 163, 164, 164, 163, 163, 162, 162, 163, 163, 164, 164, 163, 163, 162, 162, 151, 151, 143, 143, 151, 151, 162, 162, 163, 163, 164, 164, 163, 163, 162, 162, 163, 163, 164, 164, 163, 163, 162, 162, 163, 163, 164, 164, 163, 163, 162, 162, 163, 163, 164, 164, 163, 163, 162, 162, 163, 163, 164, 164, 163, 163, 162, 162, 163, 163, 164, 164, 163, 163, 162, 162, 151, 151, 143, 143, 144, 144, 157, 157, 32, 12, 0, 144, 144, 145, 145, 146, 146, 145, 145, 144, 144, 143, 143, 33, 10, 0, 151, 151, 152, 152, 153, 153, 154, 154, 155, 155, 34, 10, 0, 157, 157, 165, 165, 165, 165, 166, 166, 166, 166, 36, 32, 0, 135, 177, 177, 178, 178, 179, 179, 180, 180, 179, 179, 178, 178, 179, 179, 180, 180, 179, 179, 178, 178, 179, 179, 180, 180, 179, 179, 178, 178, 177, 177, 135, 37, 140, 0, 182, 182, 182, 182, 208, 208, 208, 208, 208, 182, 182, 182, 182, 182, 182, 208, 208, 208, 208, 208, 194, 194, 194, 182, 182, 182, 182, 208, 208, 208, 208, 208, 182, 182, 182, 182, 182, 182, 208, 208, 208, 208, 182, 182, 182, 182, 182, 182, 182, 182, 194, 195, 196, 197, 198, 198, 197, 197, 196, 196, 197, 197, 198, 198, 197, 197, 196, 195, 194, 182, 182, 182, 208, 208, 208, 208, 208, 208, 182, 182, 182, 182, 182, 208, 208, 208, 208, 208, 182, 182, 194, 195, 196, 197, 198, 198, 197, 197, 196, 196, 197, 197, 198, 198, 197, 197, 196, 196, 197, 197, 198, 198, 197, 197, 196, 195, 194, 182, 182, 182, 182, 182, 182, 182, 208, 208, 208, 208, 208, 208, 210, 210, 211, 211, 211, 211, 211, 211, 210, 210, 38, 96, 0, 182, 183, 184, 185, 186, 187, 182, 183, 184, 185, 186, 187, 182, 183, 184, 185, 186, 187, 182, 182, 182, 182, 182, 182, 182, 183, 184, 185, 186, 187, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 183, 184, 185, 186, 187, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 183, 184, 185, 186, 187, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 39, 7, 0, 194, 195, 196, 197, 198, 199, 200, 40, 3, 0, 210, 211, 212, 41, 8, 0, 213, 213, 214, 214, 215, 215, 214, 214, 42, 20, 0, 17, 17, 18, 18, 19, 19, 1, 1, 215, 215, 214, 214, 213, 213, 212, 212, 211, 211, 210, 210, 43, 20, 0, 210, 210, 211, 211, 212, 212, 213, 213, 214, 214, 215, 215, 1, 1, 19, 19, 18, 18, 17, 17, 44, 29, 0, 1, 1, 222, 222, 222, 222, 223, 223, 224, 224, 225, 225, 225, 225, 225, 224, 223, 222, 222, 222, 223, 223, 224, 224, 225, 225, 225, 1, 1, 45, 29, 0, 1, 1, 222, 222, 222, 222, 223, 223, 224, 224, 225, 225, 225, 225, 225, 224, 223, 222, 222, 222, 223, 223, 224, 224, 225, 225, 225, 1, 1, 46, 32, 0, 1, 1, 227, 227, 228, 228, 229, 229, 228, 228, 227, 227, 226, 226, 227, 227, 228, 228, 229, 229, 228, 228, 227, 227, 226, 226, 227, 227, 228, 228, 1, 1, 47, 34, 0, 135, 135, 136, 136, 137, 137, 231, 231, 231, 231, 230, 230, 231, 231, 231, 231, 230, 230, 231, 231, 231, 231, 230, 230, 231, 231, 231, 231, 137, 137, 136, 136, 135, 135, 48, 40, 0, 0, 0, 135, 135, 136, 136, 137, 137, 232, 233, 232, 233, 232, 233, 232, 233, 232, 233, 232, 233, 232, 233, 232, 233, 232, 233, 232, 233, 232, 233, 232, 233, 137, 137, 136, 136, 135, 135, 0, 0, 65, 44, 0, 1, 1, 288, 288, 289, 289, 290, 290, 290, 289, 288, 288, 289, 289, 290, 290, 290, 289, 288, 288, 289, 289, 290, 290, 290, 289, 288, 288, 289, 289, 290, 290, 290, 289, 288, 288, 289, 289, 290, 290, 290, 289, 1, 1, 49, 36, 0, 1, 1, 234, 234, 235, 235, 236, 236, 235, 235, 234, 234, 235, 235, 236, 236, 235, 235, 234, 234, 235, 235, 236, 236, 235, 235, 234, 234, 235, 235, 236, 236, 235, 235, 1, 1, 50, 64, 0, 238, 238, 239, 239, 240, 240, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 240, 240, 241, 241, 240, 240, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 240, 240, 241, 241, 240, 240, 241, 241, 241, 241, 241, 241, 241, 241, 240, 240, 239, 239, 238, 238, 238, 238, 238, 238, 237, 237, 238, 238, 237, 237, 51, 8, 0, 238, 238, 237, 237, 238, 238, 239, 239, 52, 12, 0, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 53, 6, 0, 251, 251, 238, 238, 238, 238, 54, 25, 0, 168, 168, 169, 169, 170, 170, 171, 171, 170, 170, 169, 169, 168, 168, 169, 169, 169, 168, 168, 169, 169, 170, 170, 169, 168, 55, 4, 0, 253, 253, 254, 254, 56, 64, 0, 1, 3, 270, 268, 1, 3, 270, 268, 1, 3, 270, 268, 1, 3, 270, 268, 1, 3, 270, 268, 1, 3, 270, 268, 1, 3, 270, 268, 1, 3, 270, 268, 1, 2, 3, 4, 270, 269, 268, 0, 1, 2, 3, 4, 270, 269, 268, 0, 1, 1, 2, 2, 3, 3, 4, 4, 270, 270 +extern int table_blupi[] = { + 5, 0, 6, 0, 7, 0, 7, 0, 6, 0, 5, 0, 4, 0, 2, 0, 0, 0, -2, 0, -4, 0, -5, 0, -6, 0, -7, 0, -7, 0, -6, 0, -5, 0, -4, 0, -2, 0, 0, 0, 2, 0, 4, 0, 5, 0, 6, 0, 7, 0, 7, 0, 6, 0, 5, 0, 4, 0, 2, 0, 0, 0, -2, 0, -4, 0, -5, 0, -6, 0, -7, 0, -7, 0, -6, 0, -5, 0, -4, 0, -2, 0, 0, 0, 2, 0, 4, 0, 5, 0, 6, 0, 7, 0, 7, 0, 6, 0, 5, 0, 4, 0, 2, 0, 0, 0, -2, 0, -4, 0, -5, 0, -6, 0, -7, 0, -7, 0, -6, 0, -5, 0, -4, 0, -2, 0, 0, 0, 2, 0, 4, 0, 5, 0, 6, 0, 7, 0, 7, 0, 6, 0, 5, 0, 4, 0, 2, 0, 0, 0, -2, 0, -4, 0, -5, 0, -6, 0, -7, 0, -7, 0, -6, 0, -5, 0, -4, 0, -2, 0, -1, 0, 0, 0, 14, 10, 2, 3, 4, 5, 6, 7, 8, 9, 1, 11, 12, 13, 14, 0, 10, 19, 20, 21, 23, 24, 25, 26, 27, 28, 29, 0, 4, 15, 16, 17, 18, 0, 2, 73, 22, 0, 7, 78, 79, 80, 81, 82, 83, 84, 4, 87, 88, 89, 90, 0, 2, 85, 86, 0, 5, 396, 388, 389, 390, 391, 3, 398, 399, 400, 3, 87, 88, 89, 1, 153, 2, 154, 155, 0, 1, 185, 7, 41, 42, 43, 44, 45, 46, 47, 12, 215, 216, 217, 218, 219, 220, 221, 222, 230, 231, 233, 234, 0, 8, 223, 224, 225, 226, 227, 228, 229, 232, 0, 1, 157, 5, 139, 140, 141, 142, 143, 7, 186, 187, 188, 189, 190, 191, 192, 5, 193, 194, 195, 196, 197, 1, 68, 2, 91, 92, 0, 4, 126, 129, 132, 135, 0, 4, 110, 114, 118, 122, 0, 11, 76, 77, 199, 198, 200, 201, 235, 236, 375, 376, 377, 3, 403, 401, 402, 3, 20, 21, 22, 4, 16, 17, 18, 19, 0, 3, 23, 24, 25, 2, 26, 27, 0, 4, 28, 29, 30, 31, 0, 12, 45, 46, 47, 36, 37, 38, 39, 40, 41, 42, 43, 44, 0, 4, 66, 67, 68, 69, 0, 23, 158, 159, 160, 161, 162, 163, 164, 165, 309, 411, 412, 413, 414, 415, 174, 175, 176, 177, 178, 179, 180, 181, 184, 2, 182, 183, 0, 3, 334, 335, 336, 20, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 0, 2, 378, 384, 0, 15, 29, 10, 2, 3, 4, 5, 6, 7, 8, 9, 1, 11, 12, 13, 14, 6, 19, 20, 21, 23, 24, 28, 0, 4, 15, 16, 17, 18, 0, 7, 78, 79, 80, 81, 82, 83, 84, 4, 87, 88, 89, 90, 0, 3, 153, 74, 75, 7, 41, 42, 43, 44, 45, 46, 47, 8, 215, 216, 217, 218, 219, 220, 230, 231, 0, 5, 226, 227, 228, 229, 232, 4, 157, 109, 108, 107, 0, 1, 338, 4, 261, 262, 263, 283, 0, 3, 251, +252, 253, 2, 387, 397, 0, 1, 340, 1, 361, 5, 139, 140, 141, 142, 143, 7, 186, 187, 188, 189, 190, 191, 192, 3, 32, 33, 34, 10, 2, 4, 79, 84, 143, 219, 230, 246, 341, 396, 0, 4, 330, 331, 332, 333, 0, 35, 18, 0, 276, 276, 277, 277, 278, 278, 279, 279, 280, 280, 281, 281, 282, 282, 283, 283, 284, 284, 1, 330, 0, 0, 0, 0, 0, 0, 23, 23, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 23, 23, 23, 23, 23, 0, 0, 0, 0, 0, 0, 0, 0, 23, 23, 23, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 23, 23, 23, 23, 0, 0, 0, 23, 23, 23, 0, 0, 0, 0, 0, 0, 133, 133, 0, 0, 0, 133, 133, 0, 0, 0, 0, 0, 0, 0, 133, 133, 0, 0, 0, 0, 23, 23, 23, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 23, 0, 0, 0, 0, 0, 23, 23, 23, 0, 0, 0, 135, 135, 136, 136, 137, 137, 137, 137, 137, 137, 137, 137, 138, 138, 137, 137, 137, 138, 138, 137, 137, 137, 138, 138, 137, 137, 137, 138, 138, 137, 137, 137, 137, 137, 137, 136, 136, 135, 135, 135, 0, 0, 0, 0, 0, 23, 23, 23, 0, 0, 133, 133, 0, 0, 0, 23, 23, 23, 23, 0, 0, 0, 0, 0, 0, 0, 23, 23, 0, 0, 0, 0, 0, 0, 0, 0, 133, 133, 0, 0, 0, 0, 0, 23, 23, 23, 23, 0, 0, 0, 135, 135, 136, 136, 137, 137, 137, 137, 137, 137, 137, 137, 138, 138, 137, 137, 137, 138, 138, 137, 137, 137, 138, 138, 137, 137, 137, 138, 138, 137, 137, 137, 138, 138, 137, 137, 137, 138, 138, 137, 137, 137, 138, 138, 137, 137, 137, 138, 138, 137, 137, 137, 138, 138, 137, 137, 137, 138, 138, 137, 137, 137, 138, 138, 137, 137, 137, 138, 138, 137, 137, 137, 137, 137, 137, 136, 136, 135, 135, 135, 0, 0, 0, 0, 0, 23, 23, 23, 0, 0, 133, 133, 0, 0, 0, 23, 23, 23, 23, 0, 0, 0, 0, 0, 0, 0, 23, 23, 0, 0, 0, 0, 0, 0, 0, 0, 133, 133, 0, 0, 0, 0, 0, 23, 23, 23, 23, 0, 0, 0, 2, 6, 0, 5, 6, 7, 8, 9, 10, 60, 3, 0, 19, 18, 19, 3, 6, 0, 1, 1, 2, 2, 3, 3, 4, 3, 0, 17, 18, 19, 5, 5, 4, 169, 26, 170, 170, 27, 59, 6, 0, 3, 3, 2, 2, 1, 1, 61, 5, 0, 34, 35, 34, 34, 33, 62, 2, 0, 35, 34, 6, 3, 2, 33, 34, 35, 7, 1, 0, 44, 8, 8, 0, 0, 169, 26, 170, 27, 171, 28, 172, 9, 6, 0, 5, 6, 7, 8, 9, 10, 10, 6, 0, 5, 6, 7, 8, 9, 10, 13, 6, 0, 41, 41, 42, 42, 43, 43, 11, 70, 0, 40, 40, 40, 40, 41, 41, 41, 41, 40, +40, 40, 40, 40, 40, 40, 41, 41, 41, 40, 40, 40, 40, 40, 40, 40, 41, 41, 41, 40, 40, 42, 42, 42, 43, 43, 43, 44, 44, 44, 45, 45, 45, 46, 46, 47, 47, 46, 46, 47, 47, 46, 46, 47, 47, 46, 46, 47, 47, 46, 46, 47, 47, 46, 46, 47, 47, 46, 46, 47, 47, 75, 1, 0, -1, 76, 70, 0, 40, 40, 40, 40, 41, 41, 41, 41, 40, 40, 40, 40, 40, 40, 40, 41, 41, 41, 40, 40, 40, 40, 40, 40, 40, 41, 41, 41, 40, 40, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 77, 110, 0, 324, 325, 324, 325, 324, 325, 324, 325, 324, 325, 324, 325, 324, 325, 324, 325, 324, 325, 324, 325, 324, 324, 325, 325, 326, 326, 327, 327, 328, 328, 329, 329, 330, 330, 331, 331, 332, 332, 333, 333, 334, 334, 333, 333, 332, 332, 331, 331, 330, 330, 329, 329, 329, 330, 330, 330, 331, 331, 331, 332, 332, 332, 333, 333, 333, 334, 334, 334, 333, 333, 333, 332, 332, 332, 331, 331, 331, 330, 330, 330, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 78, 1, 0, -1, 79, 1, 0, -1, 80, 1, 0, -1, 81, 1, 0, -1, 14, 6, 0, 49, 50, 51, 52, 53, 54, 29, 6, 0, 126, 125, 124, 123, 122, 121, 28, 6, 0, 122, 122, 122, 125, 125, 125, 15, 1, 0, 61, 16, 8, 0, 61, 62, 63, 62, 61, 64, 65, 64, 17, 10, 0, 71, 71, 72, 72, 73, 73, 74, 74, 75, 75, 67, 1, 0, 315, 68, 12, 0, 296, 297, 298, 299, 300, 301, 302, 301, 300, 299, 298, 297, 69, 7, 0, 296, 310, 311, 312, 313, 314, 303, 18, 10, 0, 76, 76, 76, 76, 76, 76, 77, 77, 77, 77, 19, 14, 0, 76, 76, 77, 77, 78, 78, 79, 79, 80, 80, 81, 81, 39, 39, 20, 10, 0, 88, 88, 89, 89, 90, 90, 91, 91, 92, 92, 21, 12, 0, 93, 93, 94, 94, 95, 95, 96, 96, 97, 97, 98, 98, 22, 12, 0, 93, 93, 94, 94, 95, 95, 96, 96, 97, 97, 98, 98, 23, 10, 0, 105, 105, 106, 106, 107, 107, 108, 108, 109, 109, 24, 90, 0, 93, 96, 98, 94, 95, 93, 95, 98, 93, 94, 96, 96, 94 +, 94, 98, 98, 93, 93, 97, 97, 94, 94, 94, 96, 96, 96, 93, 93, 93, 93, 94, 94, 94, 94, 94, 97, 97, 97, 97, 97, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 79, 79, 76, 76, 76, 76, 79, 79, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 25, 8, 0, 111, 111, 110, 110, 111, 111, 112, 112, 26, 8, 0, 111, 111, 110, 110, 111, 111, 112, 112, 27, 7, 0, 112, 113, 114, 115, 116, 117, 118, 30, 12, 0, 25, 25, 29, 29, 46, 46, 47, 47, 46, 46, 29, 29, 31, 328, 0, 156, 156, 156, 156, 157, 157, 157, 157, 158, 158, 158, 158, 157, 157, 157, 157, 156, 156, 156, 156, 157, 157, 157, 157, 158, 158, 158, 158, 157, 157, 157, 157, 156, 156, 156, 156, 157, 157, 157, 157, 158, 158, 158, 158, 157, 157, 157, 157, 156, 156, 156, 156, 157, 157, 157, 157, 158, 158, 158, 158, 157, 157, 157, 157, 156, 156, 156, 156, 157, 157, 157, 157, 158, 158, 158, 158, 157, 157, 157, 157, 156, 156, 156, 156, 157, 157, 157, 157, 158, 158, 158, 158, 157, 157, 157, 157, 156, 156, 156, 156, 157, 157, 157, 157, 158, 158, 158, 158, 157, 157, 157, 157, 144, 144, 143, 143, 151, 151, 162, 162, 163, 163, 164, 164, 163, 163, 162, 162, 163, 163, 164, 164, 163, 163, 162, 162, 163, 163, 164, 164, 163, 163, 162, 162, 163, 163, 164, 164, 163, 163, 162, 162, 151, 151, 143, 143, 144, 144, 157, 157, 156, 156, 156, 156, 157, 157, 157, 157, 158, 158, 158, 158, 157, 157, 157, 157, 156, 156, 156, 156, 157, 157, 157, 157, 158, 158, 158, 158, 157, 157, 157, 157, 156, 156, 156, 156, 157, 157, 157, 157, 158, 158, 158, 158, 157, 157, 157, 157, 156, 156, 156, 156, 157, 157, 157, 157, 158, 158, 158, 158, 157, 157, 157, 157, 144, 144, 143, 143, 151, 151, 162, 162, 163, 163, 164, 164, 163, 163, 162, 162, 163, 163, 164, 164, 163, 163, 162, 162, 163, 163, 164, 164, 163, 163, 162, 162, 163, 163, 164, 164, 163, 163, 162, 162, 151, 151, 143, 143, 151, 151, 162, 162, 163, 163, 164, 164, 163, 163, 162, 162, 163, 163, 164, 164, 163, 163, 162, 162, 163, 163, 164, 164, 163, 163, 162, 162, 163, 163, 164, 164, 163, 163, 162, 162, 16 +, +3, 163, 164, 164, 163, 163, 162, 162, 163, 163, 164, 164, 163, 163, 162, 162, 151, 151, 143, 143, 144, 144, 157, 157, 32, 12, 0, 144, 144, 145, 145, 146, 146, 145, 145, 144, 144, 143, 143, 33, 10, 0, 151, 151, 152, 152, 153, 153, 154, 154, 155, 155, 34, 10, 0, 157, 157, 165, 165, 165, 165, 166, 166, 166, 166, 36, 32, 0, 135, 177, 177, 178, 178, 179, 179, 180, 180, 179, 179, 178, 178, 179, 179, 180, 180, 179, 179, 178, 178, 179, 179, 180, 180, 179, 179, 178, 178, 177, 177, 135, 37, 140, 0, 182, 182, 182, 182, 208, 208, 208, 208, 208, 182, 182, 182, 182, 182, 182, 208, 208, 208, 208, 208, 194, 194, 194, 182, 182, 182, 182, 208, 208, 208, 208, 208, 182, 182, 182, 182, 182, 182, 208, 208, 208, 208, 182, 182, 182, 182, 182, 182, 182, 182, 194, 195, 196, 197, 198, 198, 197, 197, 196, 196, 197, 197, 198, 198, 197, 197, 196, 195, 194, 182, 182, 182, 208, 208, 208, 208, 208, 208, 182, 182, 182, 182, 182, 208, 208, 208, 208, 208, 182, 182, 194, 195, 196, 197, 198, 198, 197, 197, 196, 196, 197, 197, 198, 198, 197, 197, 196, 196, 197, 197, 198, 198, 197, 197, 196, 195, 194, 182, 182, 182, 182, 182, 182, 182, 208, 208, 208, 208, 208, 208, 210, 210, 211, 211, 211, 211, 211, 211, 210, 210, 38, 96, 0, 182, 183, 184, 185, 186, 187, 182, 183, 184, 185, 186, 187, 182, 183, 184, 185, 186, 187, 182, 182, 182, 182, 182, 182, 182, 183, 184, 185, 186, 187, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 183, 184, 185, 186, 187, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 183, 184, 185, 186, 187, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 39, 7, 0, 194, 195, 196, 197, 198, 199, 200, 40, 3, 0, 210, 211, 212, 41, 8, 0, 213, 213, 214, 214, 215, 215, 214, 214, 42, 20, 0, 17, 17, 18, 18, 19, 19, 1, 1, 215, 215, 214, 214, 213, 213, 212, 212, 211, 211, 210, 210, 43, 20, 0, 210, 210, 211, 211, 212, 212, 213, 213, 214, 214, 215, 215, 1, 1, 19, 19, 18, 18, 17, 17, 44, 29, 0, 1, 1, 222, 222, 222, 222, 223, + 223, 224, 224, 225, 225, 225, 225, 225, 224, 223, 222, 222, 222, 223, 223, 224, 224, 225, 225, 225, 1, 1, 45, 29, 0, 1, 1, 222, 222, 222, 222, 223, 223, 224, 224, 225, 225, 225, 225, 225, 224, 223, 222, 222, 222, 223, 223, 224, 224, 225, 225, 225, 1, 1, 46, 32, 0, 1, 1, 227, 227, 228, 228, 229, 229, 228, 228, 227, 227, 226, 226, 227, 227, 228, 228, 229, 229, 228, 228, 227, 227, 226, 226, 227, 227, 228, 228, 1, 1, 47, 34, 0, 135, 135, 136, 136, 137, 137, 231, 231, 231, 231, 230, 230, 231, 231, 231, 231, 230, 230, 231, 231, 231, 231, 230, 230, 231, 231, 231, 231, 137, 137, 136, 136, 135, 135, 48, 40, 0, 0, 0, 135, 135, 136, 136, 137, 137, 232, 233, 232, 233, 232, 233, 232, 233, 232, 233, 232, 233, 232, 233, 232, 233, 232, 233, 232, 233, 232, 233, 232, 233, 137, 137, 136, 136, 135, 135, 0, 0, 65, 44, 0, 1, 1, 288, 288, 289, 289, 290, 290, 290, 289, 288, 288, 289, 289, 290, 290, 290, 289, 288, 288, 289, 289, 290, 290, 290, 289, 288, 288, 289, 289, 290, 290, 290, 289, 288, 288, 289, 289, 290, 290, 290, 289, 1, 1, 49, 36, 0, 1, 1, 234, 234, 235, 235, 236, 236, 235, 235, 234, 234, 235, 235, 236, 236, 235, 235, 234, 234, 235, 235, 236, 236, 235, 235, 234, 234, 235, 235, 236, 236, 235, 235, 1, 1, 50, 64, 0, 238, 238, 239, 239, 240, 240, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 240, 240, 241, 241, 240, 240, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 240, 240, 241, 241, 240, 240, 241, 241, 241, 241, 241, 241, 241, 241, 240, 240, 239, 239, 238, 238, 238, 238, 238, 238, 237, 237, 238, 238, 237, 237, 51, 8, 0, 238, 238, 237, 237, 238, 238, 239, 239, 52, 12, 0, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 53, 6, 0, 251, 251, 238, 238, 238, 238, 54, 25, 0, 168, 168, 169, 169, 170, 170, 171, 171, 170, 170, 169, 169, 168, 168, 169, 169, 169, 168, 168, 169, 169, 170, 170, 169, 168, 55, 4, 0, 253, 253, 254, 254, 56, 64, 0, 1, 3, 270, 268, 1, 3, 270, 268, 1, 3, 270, 268, 1, 3, 270, 268, 1, 3, 270, 268, 1, 3, 270, 268, 1, 3, 270, 268, 1, 3, 270, 268, 1, 2, 3, 4, 270, 269, 268, 0, 1, 2, 3, 4, 2 +, +70, 269, 268, 0, 1, 1, 2, 2, 3, 3, 4, 4, 270, 270 }; -extern int table_mirror[]{ +extern int table_mirror[] = { 4, 3, 2, 1, 0, 11, 12, 13, 14, 15, 16, 5, 6, 7, 8, 9, 10, 20, 21, 22, 17, 18, 19, 24, 23, 25, 30, 31, 32, 29, 26, 27, 28, 36, 37, 38, 33, 34, 35, 40, 39, 41, 42, 43, 45, 44, 46, 47, 48, 55, 56, 57, 58, 59, 60, 49, 50, 51, 52, 53, 54, 66, 67, 68, 69, 70, 61, 62, 63, 64, 65, 75, 74, 73, 72, 71, 82, 83, 84, 85, 86, 87, 76, 77, 78, 79, 80, 81, 92, 91, 90, 89, 88, 99, 100, 101, 102, 103, 104, 93, 94, 95, 96, 97, 98, 109, 108, 107, 106, 105, 120, 119, 118, 117, 116, 115, 114, 113, 112, 111, 110, 127, 128, 129, 130, 131, 132, 121, 122, 123, 124, 125, 126, 134, 133, 139, 140, 141, 142, 135, 136, 137, 138, 147, 148, 149, 150, 143, 144, 145, 146, 155, 154, 153, 152, 151, 159, 160, 161, 156, 157, 158, 162, 163, 164, 167, 168, 165, 166, 173, 174, 175, 176, 169, 170, 171, 172, 181, 180, 179, 178, 177, 188, 189, 190, 191, 192, 193, 182, 183, 184, 185, 186, 187, 201, 202, 203, 204, 205, 206, 207, 194, 195, 196, 197, 198, 199, 200, 209, 208, 216, 217, 218, 219, 220, 221, 210, 211, 212, 213, 214, 215, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 250, 249, 248, 247, 246, 245, 244, 243, 242, 241, 240, 239, 238, 237, 252, 251, 255, 256, 253, 254, 257, 258, 259, 260, 261, 262, 285, 286, 287, 266, 267, 270, 269, 268, 271, 272, 273, 275, 274, 276, 277, 278, 279, 280, 281, 282, 283, 284, 263, 264, 265, 288, 289, 290, 291, 292, 293, 294, 295, 303, 304, 305, 306, 307, 308, 309, 296, 297, 298, 299, 300, 301, 302, 314, 313, 312, 311, 310, 316, 315, 323, 322, 321, 320, 319, 318, 317, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334 }; -extern int table_ressort[] +extern int table_ressort[] = { 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd4, 0xd3, 0xd2 -}; \ No newline at end of file +}; + +#endif \ No newline at end of file diff --git a/src/def.h b/src/def.h index 0c7e6d6..e8998b3 100644 --- a/src/def.h +++ b/src/def.h @@ -1,7 +1,12 @@ // Def.h // -#pragma once +#ifndef DEF_H +#define DEF_H + +#ifndef WINVER +#define WINVER 0x0400 +#endif #include #include @@ -28,6 +33,7 @@ #define MAXMOVEOBJECT 200 #define MAXNOTIF 5 #define MAXFIFOPOS 10 +#define MAXCHAT 6 #define LXIMAGE 640 // dimensions de la fenêtre de jeu #define LYIMAGE 480 @@ -1292,66 +1298,87 @@ namespace Object { #define JAUGE_AIR 0 #define JAUGE_POWER 1 +// hack to mimic array literals in old c++ +#if __cplusplus < 199711 +#define RECT(A,B,C,D) MAKE_RECT(A,B,C,D) +#define POINT(X,Y) MAKE_POINT(X,Y) + +inline RECT MAKE_RECT (int left, int top, int right, int bottom) +{ + RECT r = {left, top, right, bottom}; + return r; +}; + +inline POINT MAKE_POINT (int x, int y) +{ + POINT p = {x, y}; + return p; +}; +#else +#define RECT(A,B,C,D) RECT{A,B,C,D} +#define POINT(X,Y) POINT{X,Y} +#endif + // helpers for POINT POINT operator+(POINT p, const POINT& a) { - return { a.x + p.x, a.y + p.y }; + return POINT( a.x + p.x, a.y + p.y ); } POINT operator-(POINT p, const POINT& a) { - return { a.x - p.x, a.y - p.y }; + return POINT( a.x - p.x, a.y - p.y ); } POINT operator*(POINT p, const POINT& a) { - return { a.x * p.x, a.y * p.y }; + return POINT( a.x * p.x, a.y * p.y ); } POINT operator/(POINT p, const POINT& a) { - return { p.x / a.x, p.y / a.y }; + return POINT( p.x / a.x, p.y / a.y ); } POINT operator*(POINT p, const int& a) { - return { p.x * a, p.y * a }; + return POINT( p.x * a, p.y * a ); } POINT operator/(POINT p, const int& a) { - return { p.x / a, p.y / a }; + return POINT( p.x / a, p.y / a ); } POINT operator+=(POINT p, const POINT& a) { - return { p.x += a.x, p.y += a.y }; + return POINT( p.x += a.x, p.y += a.y ); } POINT operator-=(POINT p, const POINT& a) { - return { p.x -= a.x, p.y -= a.y }; + return POINT( p.x -= a.x, p.y -= a.y ); } POINT operator*=(POINT p, const POINT& a) { - return { p.x *= a.x, p.y *= a.y }; + return POINT( p.x *= a.x, p.y *= a.y ); } POINT operator/=(POINT p, const POINT& a) { - return { p.x /= a.x, p.y /= a.y }; + return POINT( p.x /= a.x, p.y /= a.y ); } POINT operator*=(POINT p, const int& a) { - return { p.x *= a, p.y *= a }; + return POINT( p.x *= a, p.y *= a ); } POINT operator/=(POINT p, const int& a) { - return { p.x /= a, p.y /= a }; + return POINT( p.x /= a, p.y /= a ); } bool operator!=(POINT a, const POINT& b) @@ -1362,4 +1389,6 @@ bool operator!=(POINT a, const POINT& b) bool operator==(POINT a, const POINT& b) { return a.x == b.x && a.y == b.y; -} \ No newline at end of file +} + +#endif \ No newline at end of file diff --git a/src/event.cpp b/src/event.cpp index ec01a90..a74fb6c 100644 --- a/src/event.cpp +++ b/src/event.cpp @@ -2281,75 +2281,63 @@ void CEvent::NetDraw() void CEvent::ChatSend() { - int netplay; - UINT i; - char* text; - char end[4]; - POINT* pos; - DPID dpid; - LPVOID data[25]; - char textInput[100]; + int v3; // edx + char v5[4]; // [esp+Ch] [ebp-6Ch] BYREF + int dpid; // [esp+10h] [ebp-68h] + char str[100]; // [esp+14h] [ebp-64h] BYREF - text = m_textInput; - if (m_textInput[0] != '\0') + if (m_textInput[0]) { - netplay = NetSearchPlayer(m_pNetwork->m_dpid); - strcpy(textInput, "<"); - } - if (netplay != -1) - { - strcat(textInput, (const char*)m_pNetwork->m_players[netplay].name); - strcat(textInput, "> "); - strcat(textInput, text); - //ChatMessageSound((char*)textInput); - end[0] = 108; - end[1] = 11; + v3 = NetSearchPlayer(m_pNetwork->m_dpid); + strcpy(str, "<"); + if (v3 != -1) + { + strcat(str, m_pNetwork->m_players[v3].name); + } + strcat(str, "> "); + strcat(str, m_textInput); + ChatPush(str); + v5[0] = 108; + v5[1] = 11; dpid = m_pNetwork->m_dpid; - m_pNetwork->Send(&end, 108, 1); - text = 0; - pos[132].x = 0; - pos[132].y = strlen(text); - pos[133].x = 0; - m_textHiliEnd = i - 1; + m_pNetwork->Send(v5, 108, 1); + m_textInput[0] = '\0'; + m_textHiliStart = 0; + m_textHiliEnd = strlen(m_textInput); m_textCursorIndex = 0; SetEnable(WM_BUTTON20, 0); } - return; } -/* -void CEvent::ChatMessageSound(char* data) +void CEvent::ChatPush(char *str) { - int num; - char (*chatZone); - char(*chat)[5]; - POINT pos; + int i; // eax + char *pText; // edx - num = 3; - chatZone = m_chatZone[0]; - do + for (i = 0; m_chatZone[0] != '\0'; i++) { - if (chatZone = '\0') + if (i >= MAXCHAT) { - chat = m_chatZone + num * 20; - goto error; + CEvent::ChatPop(); + pText = m_text; + goto LABEL_5; } - num++; - chatZone = chatZone + 100; - } while (num < 6); - HandleChatBuffer(); - chat = (char(*) [5])m_text; - return; - -error: - strcpy((char*)chat, data); - pos.x = 320; - pos.y = 240; - m_pSound->PlayImage(11, pos, -1); + } + pText = this->m_chatZone[i]; +LABEL_5: + strcpy(pText, str); + m_pSound->PlayImage(11, POINT( LXIMAGE / 2, LYIMAGE / 2 ), -1); } -*/ -void CEvent::HandleChatBuffer() +void CEvent::ChatFlush() +{ + for (int i = 0; i < MAXCHAT; i++) + { + m_chatZone[i][0] = '\0'; + } +} + +void CEvent::ChatPop() { char (*chatZone)[5]; int num; @@ -2360,13 +2348,10 @@ void CEvent::HandleChatBuffer() chatZone = m_chatZone; do { - result = strlen((const char*)chatZone + 100) + 1; - text = (char*)chatZone; - chatZone += 100; - memcpy(text, chatZone, result); + memcpy(m_chatZone[num - 1], m_chatZone[num], strlen(m_chatZone[num])); --num; } while (num); - *((BYTE*)m_text) = 0; + m_text[0] = 0; return; } @@ -2459,26 +2444,26 @@ BOOL CEvent::DrawButtons() if (m_phase == WM_PHASE_PLAY || m_phase == WM_PHASE_PLAYTEST || m_phase == WM_PHASE_BUILD) { - DrawTextLeft(m_pPixmap, { 2, 2 }, text, FONTLITTLE); + DrawTextLeft(m_pPixmap, POINT( 2, 2 ), text, FONTLITTLE); } else { - m_pPixmap->DrawPart(-1, CHBACK, { 2, 2 }, { 2, 2, 302, 14 }, 1, FALSE); + m_pPixmap->DrawPart(-1, CHBACK, POINT( 2, 2 ), RECT( 2, 2, 302, 14 ), 1, FALSE); } } if (m_phase == WM_PHASE_INIT) { - DrawText(m_pPixmap, { 414, 446 }, "Version 2.2", FONTLITTLE); + DrawText(m_pPixmap, POINT( 414, 446 ), "Version 2.2", FONTLITTLE); } if (m_phase == WM_PHASE_GAMER) { LoadString(TX_CHOOSEGAMER, res, 100); - DrawTextLeft(m_pPixmap, { LXIMAGE / 2 - GetTextWidth(res) / 2, 26 }, res, FONTGOLD); + DrawTextLeft(m_pPixmap, POINT( LXIMAGE / 2 - GetTextWidth(res) / 2, 26 ), res, FONTGOLD); for (i = 0; i < 8; i++) { - DrawText(m_pPixmap, { 110, 69 + i * DIMBUTTONY }, m_gamerNameList[i], FONTWHITE); + DrawText(m_pPixmap, POINT( 110, 69 + i * DIMBUTTONY ), m_gamerNameList[i], FONTWHITE); } SetEnable(WM_PHASE_CLEARGAMER, m_gamerExist[m_gamer]); } @@ -2496,7 +2481,7 @@ BOOL CEvent::DrawButtons() pos.y = 190; DrawTextLeft(m_pPixmap, pos, res, 0); - PutTextInputBox({ 320, 232 }); + PutTextInputBox(POINT( 320, 232 )); } if (m_phase == WM_PHASE_NAMEDESIGN) @@ -2512,7 +2497,7 @@ BOOL CEvent::DrawButtons() pos.y = 190; DrawTextLeft(m_pPixmap, pos, res, 0); - PutTextInputBox({ 320, 232 }); + PutTextInputBox(POINT( 320, 232 )); } // now that the decomp is looking convincingly like the retail game, @@ -2529,14 +2514,14 @@ BOOL CEvent::DrawButtons() debugTextY = 0; } - DrawTextLeft(m_pPixmap, { LXIMAGE - GetTextWidth("DECOMPILATION"), debugTextY }, "DECOMPILATION", FONTGOLD); - DrawTextLeft(m_pPixmap, { LXIMAGE - GetTextWidth("WORK IN PROGRESS"), debugTextY + 11 }, "WORK IN PROGRESS", FONTGOLD); - DrawTextLeft(m_pPixmap, { LXIMAGE - GetTextWidth(__DATE__ " " __TIME__), debugTextY + 22 }, __DATE__ " " __TIME__, FONTGOLD); + DrawTextLeft(m_pPixmap, POINT( LXIMAGE - GetTextWidth("DECOMPILATION"), debugTextY ), "DECOMPILATION", FONTGOLD); + DrawTextLeft(m_pPixmap, POINT( LXIMAGE - GetTextWidth("WORK IN PROGRESS"), debugTextY + 11 ), "WORK IN PROGRESS", FONTGOLD); + DrawTextLeft(m_pPixmap, POINT( LXIMAGE - GetTextWidth(__DATE__ " " __TIME__), debugTextY + 22 ), __DATE__ " " __TIME__, FONTGOLD); } /////// - if (m_phase == WM_PHASE_PLAY && m_phase == WM_PHASE_PLAYTEST && m_phase == WM_PHASE_BUILD) - m_pPixmap->DrawPart(-1, 0, pos, rect, 1, 0); + if (m_phase != WM_PHASE_PLAY && m_phase != WM_PHASE_PLAYTEST && m_phase != WM_PHASE_BUILD) + m_pPixmap->DrawPart(-1, 0, POINT( 2, 2 ), RECT( 2, 2, 302, 14 ), 1, 0); if (m_phase == WM_PHASE_CREATE) { LoadString(TX_MULTI_CREATE, res, 50); @@ -2903,7 +2888,7 @@ BOOL CEvent::DrawButtons() DrawTextLeft(m_pPixmap, pos, res, 0); } - for (int i = 0; table[m_index].buttons[i].message != 0; i++) + for (i = 0; table[m_index].buttons[i].message != 0; i++) { m_buttons[i].Draw(); } @@ -3966,11 +3951,13 @@ BOOL CEvent::EventButtons(UINT message, WPARAM wParam, LPARAM lParam) int i, lg, oldx, res; UINT uid; + pos = GetMousePos(); m_textToolTips[0] = 0; oldx = m_posToolTips.x; m_posToolTips.x = -1; - if (m_phase != WM_PHASE_PLAY && m_phase != WM_PHASE_PLAYTEST) + if (m_phase != WM_PHASE_PLAY && m_phase != WM_PHASE_PLAYTEST && table[m_index].buttons[0].message) { + /* // ???? for (i = 0; i < 2; i++) { if (!m_jauges[i].GetHide()) @@ -3996,6 +3983,7 @@ BOOL CEvent::EventButtons(UINT message, WPARAM wParam, LPARAM lParam) m_jauges[i].Redraw(); } } + */ } else { @@ -4363,7 +4351,7 @@ BOOL CEvent::ChangePhase(UINT phase) { AddCDPath(str); } - if (!m_pPixmap->BackgroundCache(0, str, { LXIMAGE, LYIMAGE }, { 0,0 }, FALSE)) + if (!m_pPixmap->BackgroundCache(0, str, POINT( LXIMAGE, LYIMAGE ), POINT( 0,0 ), FALSE)) { OutputNetDebug("CEvent::ChangePhase [Cache error]\r\n"); WaitMouse(FALSE); @@ -5404,10 +5392,10 @@ void CEvent::ChangeButtons(int message) SetState(WM_DIMS3, 0); SetState(WM_DIMS4, 0); SetState(message, 1); - if (message == WM_DIMS1) m_pDecor->SetDim({ MAXCELX, MAXCELY }); - if (message == WM_DIMS2) m_pDecor->SetDim({ MAXCELX, 0 }); - if (message == WM_DIMS3) m_pDecor->SetDim({ 0, MAXCELY }); - if (message == WM_DIMS4) m_pDecor->SetDim({ 0, 0 }); + if (message == WM_DIMS1) m_pDecor->SetDim(POINT( MAXCELX, MAXCELY )); + if (message == WM_DIMS2) m_pDecor->SetDim(POINT( MAXCELX, 0 )); + if (message == WM_DIMS3) m_pDecor->SetDim(POINT( 0, MAXCELY )); + if (message == WM_DIMS4) m_pDecor->SetDim(POINT( 0, 0 )); } } if (m_phase == WM_PHASE_SERVICE) @@ -5533,7 +5521,7 @@ void CEvent::ChangeButtons(int message) SomethingUserMissions(file, m_filenameBuffer[m_choiceIndex]); bBuild = !m_bBuildOfficialMissions; m_pDecor->GetMissionPath(out, m_gamer, GetWorld(), bBuild); - OpenMission(file, out); + CopyMission(file, out); ChangePhase(WM_PHASE_INFO); } SetHide(WM_BUTTON10, m_choicePageOffset == 0); @@ -5641,40 +5629,6 @@ void CEvent::ChangeButtons(int message) } } -BOOL CEvent::OpenMission(char* pMission, char* pFile) -{ - FILE* file; - FILE* file2; - int nb; - char* pBuffer = NULL; - BOOL bMission = TRUE; - - pBuffer = (char*)malloc(sizeof(2560)); - if (pBuffer == NULL) goto error; - - file = fopen(pMission, "rb"); - if (file == NULL) goto error; - - file2 = fopen(pFile, "wb"); - if (file2 == NULL) goto error; - - do - { - nb = fread(pBuffer, 1, sizeof(2560), file); - if (pBuffer[nb] & 32) break; - if (nb <= 0) - bMission = FALSE; - break; - fwrite(pBuffer, 1, nb, file2); - } while (pBuffer[nb] & 32); - return bMission; - -error: - if (file == NULL) free(file); - if (file2 == NULL) free(file2); - return bMission; -} - BOOL CEvent::ClearGamer(int gamer) { char filename[260]; diff --git a/src/event.h b/src/event.h index 87ebad3..eb475cd 100644 --- a/src/event.h +++ b/src/event.h @@ -1,9 +1,9 @@ // Event.h +#ifndef EVENT_H +#define EVENT_H ///////////////////////////////////////////////////////////////////////////// -#pragma once - #include "movie.h" #include "menu.h" #include "button.h" @@ -79,7 +79,7 @@ public: void ReadInput(); void TryInsert(); //void SomethingUserMissions(LPCSTR lpFileName, LPCSTR thing); - BOOL OpenMission(char* pMission, char* pFile); + BOOL CopyMission(char* pMission, char* pFile); void RestoreGame(); int MissionBack(); void TableSomething(); @@ -182,8 +182,9 @@ protected: void NetSend(int message, USHORT data); void NetDraw(); void ChatSend(); - void HandleChatBuffer(); - void ChatMessageSound(char* data); + void ChatPush(char* str); + void ChatPop(); + void ChatFlush(); void MouseRelease(); void MouseCapture(); @@ -192,7 +193,6 @@ protected: void DrawMap(); BOOL CheckWorld1(); void NetAdjustLobbyButtons(); - BOOL CopyMission(char *srcFileName, char *dstFileName); protected: @@ -254,6 +254,7 @@ protected: int m_fileTime[10]; POINT m_posToolTips; char m_textToolTips[50]; + char m_textToolTips2[50]; int m_mouseSprite; BOOL m_bFillMouse; BOOL m_bWaitMouse; @@ -315,4 +316,6 @@ protected: }; extern -int DirectoryThing(LPCSTR filename); \ No newline at end of file +int DirectoryThing(LPCSTR filename); + +#endif \ No newline at end of file diff --git a/src/jauge.h b/src/jauge.h index fb44f53..780fe88 100644 --- a/src/jauge.h +++ b/src/jauge.h @@ -1,6 +1,6 @@ // Jauge.h - -#pragma once +#ifndef JAUGE_H +#define JAUGE_H ////////////////////////////////////////////////////////////////////////// @@ -42,4 +42,6 @@ protected: BOOL m_bRedraw; }; -///////////////////////////////////////////////////////////////////////// \ No newline at end of file +///////////////////////////////////////////////////////////////////////// + +#endif \ No newline at end of file diff --git a/src/menu.h b/src/menu.h index 76b58a3..8c21a79 100644 --- a/src/menu.h +++ b/src/menu.h @@ -1,6 +1,6 @@ // Menu.h - -#pragma once +#ifndef MENU_H +#define MENU_H #include "decor.h" #include "pixmap.h" @@ -48,4 +48,6 @@ protected: UINT m_messages[MAXBUTTON]; int m_selRank; POINT m_mousePos; -}; \ No newline at end of file +}; + +#endif \ No newline at end of file diff --git a/src/misc.cpp b/src/misc.cpp index 5f62b96..2874728 100644 --- a/src/misc.cpp +++ b/src/misc.cpp @@ -36,7 +36,7 @@ void LoadString(UINT nID, char *pBuffer, int lgBuffer) void ChangeSprite(int sprite) { - HCURSOR hCursor = nullptr; + HCURSOR hCursor = NULL; if ( g_mouseType == MOUSETYPEGRA ) return; if ( g_lastSprite == sprite ) return; diff --git a/src/misc.h b/src/misc.h index 6cbce86..075e202 100644 --- a/src/misc.h +++ b/src/misc.h @@ -1,5 +1,7 @@ // misc.h // +#ifndef MISC_H +#define MISC_H #include @@ -20,4 +22,6 @@ extern void AddCDPath(char *pFilename); extern void AddUserPath(char *pFilename); extern void TraceErrorDD(HRESULT hErr, const char *sFile, int nLine); -extern void TraceErrorDS(HRESULT hErr, const char *sFile, int nLine); \ No newline at end of file +extern void TraceErrorDS(HRESULT hErr, const char *sFile, int nLine); + +#endif \ No newline at end of file diff --git a/src/movie.h b/src/movie.h index 2cdda7d..7025e62 100644 --- a/src/movie.h +++ b/src/movie.h @@ -1,7 +1,7 @@ // movie.h // - -#pragma once +#ifndef MOVIE_H +#define MOVIE_H class CMovie { @@ -29,4 +29,6 @@ protected: HWND m_hwndMovie; BOOL m_fPlaying; BOOL m_fMovieOpen; -}; \ No newline at end of file +}; + +#endif diff --git a/src/network.cpp b/src/network.cpp index 41025b5..eff9d10 100644 --- a/src/network.cpp +++ b/src/network.cpp @@ -9,7 +9,7 @@ #include "def.h" // a0f94abe-11c3-d111-be62-0040f6944838 -#define APP_GUID { 0xbe4af9a0, 0xc311, 0x11d1, { 0xbe, 0x62, 0x00, 0x40, 0xf6, 0x94, 0x48, 0x38 } }; +static const GUID APP_GUID = { 0xbe4af9a0, 0xc311, 0x11d1, { 0xbe, 0x62, 0x00, 0x40, 0xf6, 0x94, 0x48, 0x38 } }; CNetwork::CNetwork() { diff --git a/src/network.h b/src/network.h index 925be72..ac5dfc5 100644 --- a/src/network.h +++ b/src/network.h @@ -1,6 +1,7 @@ // Network.h -#pragma once +#ifndef NETWORK_H +#define NETWORK_H #include "dplay.h" @@ -75,4 +76,6 @@ static BOOL EnumProvidersCallback(LPGUID lpguidSP, LPSTR lpSTName, static BOOL EnumSessionsCallback(LPDPSESSIONDESC2 lpThisSD, LPDWORD lpdwTimeOut, DWORD dwFlags, NamedGUIDList* lpContext); -void TraceErrorDP(HRESULT hErr); \ No newline at end of file +void TraceErrorDP(HRESULT hErr); + +#endif \ No newline at end of file diff --git a/src/obstacle.h b/src/obstacle.h index 87ac4ac..5fce98a 100644 --- a/src/obstacle.h +++ b/src/obstacle.h @@ -1,4 +1,6 @@ -#pragma once +#ifndef OBSTACLE_H +#define OBSTACLE_H + #define Q_EMPTY \ 0,0,0,0, \ 0,0,0,0, \ @@ -40,7 +42,7 @@ 0,1,1,0, \ 0,1,1,0 -extern short table_decor_quart[] +extern short table_decor_quart[] = { Q_FULL, // 0 Q_FULL, @@ -586,4 +588,6 @@ extern short table_decor_quart[] Q_PILLAR, Q_PILLAR, Q_PILLAR -}; \ No newline at end of file +}; + +#endif \ No newline at end of file diff --git a/src/pixmap.cpp b/src/pixmap.cpp index bc8f1ad..c8b93ac 100644 --- a/src/pixmap.cpp +++ b/src/pixmap.cpp @@ -632,11 +632,12 @@ BOOL CPixmap::DrawMap(int channel, RECT src, RECT dest) return FALSE; } - while (hErr == DDERR_WASSTILLDRAWING) + while (1) { hErr = m_lpDDSurface[channel]->Blt(&dest, m_lpDDSBack, &src, DDBLT_WAIT, NULL); if (hErr == DD_OK) break; if (hErr == DDERR_SURFACELOST) hErr = RestoreAll(); if (hErr != DD_OK) break;; + if (hErr == DDERR_WASSTILLDRAWING) break; } return (hErr == DD_OK); } diff --git a/src/pixmap.h b/src/pixmap.h index 68e0ef8..0576d5b 100644 --- a/src/pixmap.h +++ b/src/pixmap.h @@ -1,6 +1,6 @@ // CPixmap.h - -#pragma once +#ifndef PIXMAP_H +#define PIXMAP_H #include @@ -124,4 +124,6 @@ protected: }; -static inline BOOL IsBlupiChannel(int channel); \ No newline at end of file +static inline BOOL IsBlupiChannel(int channel); + +#endif \ No newline at end of file diff --git a/src/pixtables.h b/src/pixtables.h index 6a6157a..ca797ae 100644 --- a/src/pixtables.h +++ b/src/pixtables.h @@ -1,4 +1,5 @@ -#pragma once +#ifndef PIXTABLES_H +#define PIXTABLES_H // keep these structs for reference /* @@ -15,7 +16,7 @@ typedef struct { */ -extern short table_icon_blupi[]{ +extern short table_icon_blupi[] = { 336, 202,185, 17,9, 32,49, 194,234, 17,8, 28,50, @@ -355,7 +356,7 @@ extern short table_icon_blupi[]{ 230,25, 5,32, 49,27, }; -extern short table_icon_element[]{ +extern short table_icon_element[] = { 289, 308,153, 9,20, 51,40, 51,194, 8,19, 52,41, @@ -648,7 +649,7 @@ extern short table_icon_element[]{ 403,153, 7,14, 44,41, }; -extern short table_icon_explo[]{ +extern short table_icon_explo[] = { 100, 157,0, 48,51, 32,28, 253,132, 36,32, 58,61, @@ -752,7 +753,7 @@ extern short table_icon_explo[]{ 54,0, 9,35, 51,25, }; -extern short table_icon_object[]{ +extern short table_icon_object[] = { 441, 504,687, 0,0, 64,64, 568,687, 0,0, 64,64, @@ -1195,4 +1196,6 @@ extern short table_icon_object[]{ 958,495, 18,0, 28,64, 986,495, 18,0, 28,64, 0,559, 18,0, 28,64, -}; \ No newline at end of file +}; + +#endif \ No newline at end of file diff --git a/src/sound.h b/src/sound.h index b057918..c34bf27 100644 --- a/src/sound.h +++ b/src/sound.h @@ -1,7 +1,7 @@ // sound.h // - -#pragma once +#ifndef SOUND_H +#define SOUND_H //#include @@ -71,4 +71,6 @@ protected: int m_midiVolume; int m_lastMidiVolume; int m_nbSuspendSkip; -}; \ No newline at end of file +}; + +#endif \ No newline at end of file diff --git a/src/text.h b/src/text.h index 247a009..43a30ad 100644 --- a/src/text.h +++ b/src/text.h @@ -1,6 +1,6 @@ // Text.h - -#pragma once +#ifndef TEXT_H +#define TEXT_H #define FONTWHITE 0 #define FONTGOLD 1 @@ -59,3 +59,4 @@ void DrawBignum(CPixmap *pPixmap, POINT pos, int num); extern int GetBignumWidth(int num); +#endif \ No newline at end of file diff --git a/src/texttables.h b/src/texttables.h index b55801b..c94e91c 100644 --- a/src/texttables.h +++ b/src/texttables.h @@ -1,5 +1,7 @@ -#pragma once -extern int table_width[] +#ifndef TEXTTABLES_H +#define TEXTTABLES_H + +extern int table_width[] = { 32, 32, @@ -132,7 +134,7 @@ extern int table_width[] }; -extern char table_char[] +extern char table_char[] = { 0, 0, @@ -1671,3 +1673,5 @@ extern char table_char[] 0, 0 }; + +#endif \ No newline at end of file diff --git a/src/wave.h b/src/wave.h index 1384aa9..de0ce98 100644 --- a/src/wave.h +++ b/src/wave.h @@ -2,13 +2,13 @@ * Sound related stuff, I dunno ************************************************/ - - - - +#ifndef WAVE_H +#define WAVE_H #include void LoadWave(HINSTANCE hinst, int ResourceID, LPDIRECTSOUND lpds, - LPDIRECTSOUNDBUFFER &lpDSB); \ No newline at end of file + LPDIRECTSOUNDBUFFER &lpDSB); + +#endif \ No newline at end of file