From 600eb1b6d4962317cf6a06856a43a536a93799bd Mon Sep 17 00:00:00 2001 From: jummy Date: Tue, 6 Aug 2024 14:26:25 -0500 Subject: [PATCH] interim commit it's real sucks clues in here --- .gitignore | 4 +- blupi.cpp | 269 ++-- button.cpp | 2 +- ddutil.cpp | 2 +- ddutil.h | 37 +- decblupi.cpp | 1 - decor.cpp | 3424 ++++++++++++++++++++++++------------------------- decor.h | 124 +- dectables.cpp | 21 - dectables.h | 606 +++++++-- def.h | 777 ++++++++++- event.h | 15 +- jauge.cpp | 56 +- jauge.h | 2 +- network.cpp | 306 ++++- network.h | 81 +- obstacle.h | 589 +++++++++ pixmap.h | 1 - sound.h | 3 +- 19 files changed, 4215 insertions(+), 2105 deletions(-) delete mode 100644 dectables.cpp create mode 100644 obstacle.h diff --git a/.gitignore b/.gitignore index 772bac2..1a738f9 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,6 @@ ################################################################################ /.vs -planetblupi.* \ No newline at end of file +planetblupi.* +/Release +/Debug \ No newline at end of file diff --git a/blupi.cpp b/blupi.cpp index 3203604..c186f2f 100644 --- a/blupi.cpp +++ b/blupi.cpp @@ -47,10 +47,11 @@ int g_timerInterval = 50; // inverval = 50ms int g_mouseType = MOUSETYPEGRA; int g_benchmark; BOOL g_bBenchmarkSuccess; -BOOL g_bTrueColor; BOOL g_bTrueColorBack; BOOL g_bTrueColorDecor; -MMRESULT g_updateTimer; // timer général +BOOL g_bCDAudio; +int g_something; +MMRESULT g_updateTimer; // timer général BOOL g_bActive = TRUE; // is application active ? BOOL g_bTermInit = FALSE; // initialisation en cours int g_objectMax; @@ -85,6 +86,7 @@ BOOL ReadConfig (LPSTR lpCmdLine) char* pText; int nb; int i; + MEMORYSTATUS mem; file = fopen("data\\config.def", "rb"); if ( file == NULL ) return FALSE; @@ -93,7 +95,7 @@ BOOL ReadConfig (LPSTR lpCmdLine) fclose(file); -#if 0 +#if !_NOCD pText = strstr(buffer, "CD-Rom="); if ( pText == NULL ) { @@ -177,86 +179,89 @@ BOOL ReadConfig (LPSTR lpCmdLine) g_benchmark = GetNum(pText+10); if ( g_benchmark < 0 ) g_benchmark = 0; if ( g_benchmark > 100000 ) g_benchmark = 100000; - if ( g_benchmark > 3099 ) g_bBenchmarkSuccess = 1, g_bTrueColor = 1, g_bTrueColorDecor; + if (g_benchmark > 3099) + { + g_bBenchmarkSuccess = TRUE; + g_bTrueColorBack = TRUE; + g_bTrueColorDecor = TRUE; + } } pText = strstr(buffer, "TrueColor="); if ( pText != NULL ) { i = GetNum(pText + 10); - if (i == 8) g_bTrueColor = 0; - if (i == 16) g_bTrueColor = 1; - g_bTrueColorDecor = g_bTrueColor; + if (i == 8) g_bTrueColorBack = FALSE; + if (i == 16) g_bTrueColorBack = TRUE; + g_bTrueColorDecor = g_bTrueColorBack; } pText = strstr(buffer, "TrueColorBack="); if ( pText != NULL ) { i = GetNum(pText+14); - if (i == 8) g_bTrueColor = 0; - - if (i == 16) g_bTrueColor = 1; + if (i == 8) g_bTrueColorBack = FALSE; + if (i == 16) g_bTrueColorBack = TRUE; } pText = strstr(buffer, "TrueColorDecor="); if ( pText != NULL ) { i = GetNum(pText + 15); - if (i == 8) g_bTrueColorDecor = 0; + if (i == 8) g_bTrueColorDecor = FALSE; + if (i == 16) g_bTrueColorDecor = TRUE; + } - if (i == 16) g_bTrueColorDecor = 1; + pText = strstr(buffer, "CDAudio="); + if ( pText != NULL ) + { + i = GetNum(pText + 8); + g_bCDAudio = (i == TRUE); + } + + mem.dwLength = sizeof(MEMORYSTATUS); + GlobalMemoryStatus(&mem); + + if (mem.dwTotalPhys < 32000000) g_bBenchmarkSuccess = FALSE; + + if (!g_bBenchmarkSuccess) + { + g_bTrueColorBack = FALSE; + g_bTrueColorDecor = FALSE; } return TRUE; } -// Mise à jour principale. [Rewrite Variables] +// Mise à jour principale. [TODO: Rewrite Variables] void UpdateFrame(void) { - RECT clip, rcRect; - UINT phase; - POINT posMouse; - int i, term, speed; + int phase, term; - g_pPixmap->MouseBackClear(); // enlève la souris dans "back" - posMouse = g_pEvent->GetLastMousePos(); + g_pEvent->ReadInput(); phase = g_pEvent->GetPhase(); - - if ( phase == g_lastPhase && - phase == WM_PHASE_PLAY || phase == WM_PHASE_PLAYTEST || phase == WM_PHASE_BUILD ) + if (phase == WM_PHASE_PLAY || phase == WM_PHASE_PLAYTEST || phase == WM_PHASE_BUILD) { -//? rcRect.left = POSDRAWX; -//? rcRect.top = POSDRAWY; -//? rcRect.right = POSDRAWX+DIMDRAWX; -//? rcRect.bottom = POSDRAWY+DIMDRAWY; -//? g_pPixmap->DrawImage(-1, CHBACK, rcRect, 1); // dessine le fond - } - else - { - rcRect.left = 0; - rcRect.top = 0; - rcRect.right = LXIMAGE; - rcRect.bottom = LYIMAGE; - g_pPixmap->DrawImage(-1, CHBACK, rcRect, 1); // dessine le fond - } - - //[this block remains dormant, yet functional in SB] - if (phase == WM_PHASE_INTRO1 || - phase == WM_PHASE_INTRO2) - { - g_pEvent->IntroStep(); + if (!g_pDecor->GetPause()) + { + for (int i = 0; i < g_pEvent->GetSpeed() * g_speedRate; i++) + { + g_pDecor->MoveStep(); + g_pEvent->DemoStep(); + } + } } if (phase == WM_PHASE_INIT) { - g_pEvent->DemoStep(); // démarre év. démo automatique + g_pEvent->DemoStep(); } - if (phase == WM_PHASE_PLAYMOVIE || phase == WM_PHASE_WINMOVIE || WM_PHASE_WINMOVIEDESIGN || WM_PHASE_WINMOVIEMULTI) + if (phase == WM_PHASE_PLAYMOVIE || phase == WM_PHASE_WINMOVIE || phase == WM_PHASE_WINMOVIEDESIGN || phase == WM_PHASE_WINMOVIEMULTI) { - g_pEvent->MovieToStart; + g_pEvent->MovieToStart(); } if (phase == WM_PHASE_INSERT) @@ -264,64 +269,55 @@ void UpdateFrame(void) g_pEvent->TryInsert(); } - if ( phase == WM_PHASE_PLAY ) + if (phase == WM_PHASE_PLAY) { - clip.left = POSDRAWX; - clip.top = POSDRAWY+g_pDecor->GetInfoHeight(); - clip.right = POSDRAWX+DIMDRAWX; - clip.bottom = POSDRAWY+DIMDRAWY; - - if ( g_pEvent->IsShift() ) // shift en cours ? + term = g_pDecor->IsTerminated(); + if (g_pEvent->IsPrivate()) { - g_pEvent->DecorAutoShift(posMouse); - g_pDecor->Build(clip, posMouse); // construit juste le décor + if (term == -1) + { + g_pEvent->ChangePhase(WM_PHASE_HISTORY1); + return; + } + if (term != 0) + { + g_pEvent->ChangePhase(WM_PHASE_HELP); + return; + } } else { - if ( !g_pEvent->GetPause() ) + if (g_pEvent->IsMulti()) { - speed = g_pEvent->GetSpeed() * g_speedRate; - for ( i=0 ; iBlupiStep(i==0); // avance tous les blupi - g_pDecor->MoveStep(i==0); // avance tous les décors - g_pEvent->DemoStep(); // avance enregistrement/reproduction + if (term == -1) { + g_pEvent->ChangePhase(WM_PHASE_H0MOVIE); + return; + } + if (term != 0) { + g_pEvent->ChangePhase(WM_PHASE_H2MOVIE); + return; } } - - g_pEvent->DecorAutoShift(posMouse); - g_pDecor->Build(clip, posMouse); // construit le décor - g_pDecor->NextPhase(1); // refait la carte de temps en temps + else + { + if (term == -1) { + g_pEvent->GetWorldGroup(); // probably intended to be a variable assignment? wtf ghidra + g_pEvent->SetNbVies(g_pDecor->GetNbVies()); + g_pEvent->ChangePhase(WM_PHASE_LOST); + } + if (term == -2) { + g_pEvent->SetNbVies(g_pDecor->GetNbVies()); + g_pEvent->ChangePhase(WM_PHASE_PLAYMOVIE); + } + if (term > 0) { + g_pEvent->SetNbVies(g_pDecor->GetNbVies()); + g_pDecor->SetMission(term); + g_pEvent->ChangePhase(WM_PHASE_PLAY); + } + } + } } - - if ( phase == WM_PHASE_PLAY ) - { - term = g_pDecor->IsTerminated(); - if ( term == 1 ) g_pEvent->ChangePhase(WM_PHASE_LOST); // perdu - if ( term == 2 ) g_pEvent->ChangePhase(WM_PHASE_WINMOVIE); // gagné - } - - g_pPixmap->MouseBackDraw(); // remet la souris dans "back" -} - -//[excluded from SB release builds] -void Benchmark() -{ - int i; - POINT pos = { 0, 0 }; - - g_pPixmap->DrawIcon(-1, 2, 10, pos, 0); - - pos.x = 300; - pos.y = 350; - for (i = 0; i < 10000; i++) - { - g_pPixmap->DrawIcon(-1, 2, i % 4, pos, 0); - } - - g_pPixmap->DrawIcon(-1, 2, 10, pos, 0); - g_pSound->Play(0); } // Incomplete @@ -353,11 +349,24 @@ void SetDecor() g_pPixmap->DrawImage(-1, 0, rect, 1); } - g_pEvent->FUN_1d7d0(); + g_pEvent->AddPhaseText(); g_lastPhase = phase; g_pPixmap->MouseBackDraw(); } +int Benchmark() +{ + MEMORYSTATUS mem; + + for (int i = 0; i < 10; i++) + { + UpdateFrame(); + SetDecor(); + g_pPixmap->Display(); + // TODO + } +} + // Restitue le jeu après une activation en mode fullScreen. @@ -457,14 +466,17 @@ LRESULT CALLBACK WindowProc (HWND hWnd, UINT message, { case WM_TIMER: case WM_UPDATE: - if (!g_pEvent->IsMovie()) // pas de film en cours ? + if (g_pEvent != NULL && !g_pEvent->IsMovie() && !g_pEvent->IsMouseRelease()) // pas de film en cours ? { + g_pEvent->GetPhase(); // ? if (g_bActive) { UpdateFrame(); + SetDecor(); } g_pPixmap->Display(); } + if (g_something > 0) g_something--; break; case WM_SYSCOLORCHANGE: OutputDebug("Event WM_SYSCOLORCHANGE\n"); @@ -478,7 +490,7 @@ LRESULT CALLBACK WindowProc (HWND hWnd, UINT message, g_bActive = (wParam != 0); if ( g_pEvent != NULL ) { - g_pEvent->SomethingDecor(); + g_pEvent->FlushInput(); } if ( g_bActive ) { @@ -489,12 +501,8 @@ LRESULT CALLBACK WindowProc (HWND hWnd, UINT message, } if ( !g_bFullScreen && g_bTermInit ) { - totalDim.x = 64; - totalDim.y = 66; - iconDim.x = 64; - iconDim.y = 66/2; - g_pPixmap->Cache(CHLITTLE, "image16\\little.blp", totalDim, iconDim, TRUE); - g_pPixmap->SetTransparent(CHLITTLE, RGB(0,0,255)); // bleu + g_pPixmap->BackgroundCache(CHLITTLE, "little.blp", { 256, 96 }, { DIMLITTLEX , DIMLITTLEY }, TRUE); + g_pPixmap->SetTransparent(CHLITTLE, RGB(0, 0, 255)); // bleu g_pPixmap->SavePalette(); g_pPixmap->InitSysPalette(); @@ -502,7 +510,7 @@ LRESULT CALLBACK WindowProc (HWND hWnd, UINT message, SetWindowText(hWnd, "Blupi"); if ( g_pSound != NULL ) g_pSound->RestartMusic(); } - else // désactive ? + else // désactive ? { if ( g_bFullScreen ) { @@ -590,7 +598,7 @@ LRESULT CALLBACK WindowProc (HWND hWnd, UINT message, break; case WM_DESTROY: - KillTimer(g_hWnd, 1); + timeKillEvent((UINT)g_hWnd); FinishObjects(); PostQuitMessage(0); break; @@ -644,7 +652,7 @@ static BOOL DoInit(HINSTANCE hInstance, LPSTR lpCmdLine, int nCmdShow) wc.hIcon = LoadIcon(hInstance, "IDR_MAINFRAME"); wc.hCursor = LoadCursor(hInstance, "IDC_POINTER"); wc.hbrBackground = GetStockBrush(BLACK_BRUSH); - wc.lpszMenuMane = NAME; + wc.lpszMenuName = NAME; wc.lpszClassName = NAME; RegisterClass(&wc); @@ -701,7 +709,7 @@ static BOOL DoInit(HINSTANCE hInstance, LPSTR lpCmdLine, int nCmdShow) ChangeSprite(SPRITE_WAIT); // met le sablier maison - if (!bOk) // config.def pas correct ? + if (!bOK) // config.def pas correct ? { return InitFail("Game not correctly installed", FALSE); } @@ -710,31 +718,14 @@ static BOOL DoInit(HINSTANCE hInstance, LPSTR lpCmdLine, int nCmdShow) g_pPixmap = new CPixmap; if (g_pPixmap == NULL) return InitFail("New pixmap", TRUE); - totalDim.x = LXIMAGE; - totalDim.y = LYIMAGE; - if (!g_pPixmap->Create(g_hWnd, totalDim, g_bFullScreen, g_mouseType)) - return InitFail("Create pixmap", TRUE); - - OutputDebug("Image: init\n"); - totalDim.x = LXIMAGE; - totalDim.y = LYIMAGE; - iconDim.x = 0; - iconDim.y = 0; - - if (!g_pPixmap->CacheAll(g_hWnd, g_bFullScreen, g_bTrueColor, g_bTrueColorDecor, g_mouseType, "image16\\init.blp", FALSE)) - return InitFail("CacheAll", TRUE) + g_pPixmap->SetBenchmarkSuccess(g_bBenchmarkSuccess); #if _INTRO - if (!g_pPixmap->Cache(CHBACK, "image16\\init.blp", totalDim, iconDim, TRUE)) + if (!g_pPixmap->CacheAll(TRUE, g_hWnd, g_bFullScreen, g_bTrueColor, g_bTrueColorDecor, g_mouseType, "intro1.blp", FALSE)) #else - if (!g_pPixmap->Cache(CHBACK, "image16\\init.blp", totalDim, iconDim, TRUE)) + if (!g_pPixmap->CacheAll(TRUE, g_hWnd, g_bFullScreen, g_bTrueColorBack, g_bTrueColorDecor, g_mouseType, "init.blp", FALSE)) #endif - return FALSE; - - OutputDebug("SavePalette\n"); - g_pPixmap->SavePalette(); - OutputDebug("InitSysPalette\n"); - g_pPixmap->InitSysPalette(); + return FALSE; g_pSound = new CSound; if (g_pSound == NULL) return InitFail("New sound", TRUE); @@ -742,6 +733,10 @@ static BOOL DoInit(HINSTANCE hInstance, LPSTR lpCmdLine, int nCmdShow) g_pSound->Create(g_hWnd); g_pSound->CacheAll(); g_pSound->SetState(TRUE); + g_pSound->SetCDAudio(g_bCDAudio); + + g_pNetwork = new CNetwork; + if (g_pNetwork == NULL) return InitFail("New network", TRUE); g_pMovie = new CMovie; if (g_pMovie == NULL) return InitFail("New movie", FALSE); @@ -751,25 +746,32 @@ static BOOL DoInit(HINSTANCE hInstance, LPSTR lpCmdLine, int nCmdShow) g_pDecor = new CDecor; if (g_pDecor == NULL) return InitFail("New decor", FALSE); - g_pDecor->Create(g_hWnd, g_pSound, g_pPixmap); - g_pDecor->MapInitColors(); + g_pDecor->Create(g_hWnd, g_pSound, g_pPixmap, g_pNetwork); g_pEvent = new CEvent; if (g_pEvent == NULL) return InitFail("New event", FALSE); - g_pEvent->Create(g_hWnd, g_pPixmap, g_pDecor, g_pSound, g_pMovie); + g_pEvent->Create(hInstance, g_hWnd, g_pPixmap, g_pDecor, g_pSound, g_pMovie, g_pNetwork); g_pEvent->SetFullScreen(g_bFullScreen); g_pEvent->SetMouseType(g_mouseType); #if _INTRO g_pEvent->ChangePhase(WM_PHASE_INTRO1); #else - g_pEvent->ChangePhase(WM_PHASE_TESTCD); + g_pEvent->ChangePhase(WM_PHASE_INIT); #endif g_bTermInit = TRUE; return TRUE; } +void TimerStep() +{ + if (g_bActive && !g_something) + { + g_something = TRUE; + PostMessage(g_hWnd, WM_UPDATE, 0, 0); + } +} // Programme principal. @@ -783,7 +785,8 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, return FALSE; } - SetTimer(g_hWnd, 1, g_timerInterval, NULL); + Benchmark(); + timeSetEvent(g_timerInterval, g_timerInterval >> 2, (LPTIMECALLBACK)TimerStep, 0, 1); while ( TRUE ) { @@ -804,4 +807,4 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, } return msg.wParam; -} +} \ No newline at end of file diff --git a/button.cpp b/button.cpp index 516ca44..79611a8 100644 --- a/button.cpp +++ b/button.cpp @@ -50,7 +50,7 @@ BOOL CButton::Create(HWND hWnd, CPixmap *pPixmap, CSound *pSound, int region,*/ UINT message) { POINT iconDim; - int i, icon; + //int i, icon; static int ttypes[] = { diff --git a/ddutil.cpp b/ddutil.cpp index 2fcbf9e..b880ee0 100644 --- a/ddutil.cpp +++ b/ddutil.cpp @@ -19,7 +19,7 @@ // Le message : // First-chance exception in Blupi.exe (GDI32.DLL): 0xC0000005: Access Violation. -// apparaît au endroits marqués par (@) ... +// apparaît au endroits marqués par (@) ... BOOL g_bDebug = TRUE; diff --git a/ddutil.h b/ddutil.h index 8254ebf..f2e3aa3 100644 --- a/ddutil.h +++ b/ddutil.h @@ -1,22 +1,27 @@ +/*========================================================================== +* +* Copyright (C) 1995 Microsoft Corporation. All Rights Reserved. +* +* File: ddutil.cpp +* Content: Routines for loading bitmap and palettes from resources +* +***************************************************************************/ +#pragma once +#ifdef __cplusplus +extern "C" { /* Assume C declarations for C++ */ +#endif /* __cplusplus */ - - - -#ifdef _cplusplus -extern "C" { -#endif - -extern void DDSetDebug (BOOL bDebug); -extern IDirectDrawSurface * DDConnectBitmap(IDirectDraw *pdd, HBITMAP hbm); -extern IDirectDrawPalette * DDLoadPalette(IDirectDraw *pdd, LPCSTR szBitmap); -extern IDirectDrawSurface * DDLoadBitmap(IDirectDraw *pdd, LPCSTR szBitmap, int dx, int dy); -extern HRESULT DDReLoadBitmap(IDirectDrawSurface *pdds, LPCSTR szBitmap); -extern HRESULT DDCopyBitmap(IDirectDrawSurface *pdds, HBITMAP hbm, int x, int y, int dx, int dy); -extern DWORD DDColorMatch(IDirectDrawSurface *pdds, COLORREF rgb); -extern HRESULT DDSetColorKey(IDirectDrawSurface *pdds, COLORREF rgb); -extern HRESULT DDSetColorKey2(IDirectDrawSurface *pdds, COLORREF rgb1, COLORREF rgb2); + extern void DDSetDebug(BOOL bDebug); + extern IDirectDrawSurface * DDConnectBitmap(IDirectDraw *pdd, HBITMAP hbm); + extern IDirectDrawPalette * DDLoadPalette(IDirectDraw *pdd, LPCSTR szBitmap); + extern IDirectDrawSurface * DDLoadBitmap(IDirectDraw *pdd, LPCSTR szBitmap, int dx, int dy); + extern HRESULT DDReLoadBitmap(IDirectDrawSurface *pdds, LPCSTR szBitmap); + extern HRESULT DDCopyBitmap(IDirectDrawSurface *pdds, HBITMAP hbm, int x, int y, int dx, int dy); + extern DWORD DDColorMatch(IDirectDrawSurface *pdds, COLORREF rgb); + extern HRESULT DDSetColorKey(IDirectDrawSurface *pdds, COLORREF rgb); + extern HRESULT DDSetColorKey2(IDirectDrawSurface *pdds, COLORREF rgb1, COLORREF rgb2); #ifdef __cplusplus } diff --git a/decblupi.cpp b/decblupi.cpp index a74aba4..96999fb 100644 --- a/decblupi.cpp +++ b/decblupi.cpp @@ -3,7 +3,6 @@ #include "DEF.H" #include "DECOR.H" -#include "ACTION.H" #include "MISC.H" #include "RESOURCE.H" diff --git a/decor.cpp b/decor.cpp index 9efe08c..64b531d 100644 --- a/decor.cpp +++ b/decor.cpp @@ -1,4 +1,4 @@ -// CDecor.cpp +// Decor.cpp // #include @@ -20,7 +20,7 @@ //////////////////////////////////////////////////////////////////////////////// -#define MAXMOVEOBJECT 200 + #define MAXQUART 441 #define SCROLL_SPEED 8 #define SCROLL_MARGX 80 @@ -34,6 +34,11 @@ #define TEXTDELAY 10 // tooltip popup delay +BOOL IsValidCel(POINT cel) +{ + return cel.x >= 0 && cel.x < MAXCELX && cel.y >= 0 && cel.y < MAXCELY; +} + // Constructor CDecor::CDecor() @@ -47,13 +52,15 @@ CDecor::CDecor() for (i = 0; i < 200; i++) { - m_lastDecorIcon[i] = 0; + m_lastDecorIndexes[i] = 0; } + m_lastRegion = -1; + m_iconLift = 0; m_time = 0; m_bCheatDoors = FALSE; m_bSuperBlupi = FALSE; m_bDrawSecret = FALSE; - m_buildOfficialMissions = FALSE; + m_bBuildOfficialMissions = FALSE; m_bNetPacked = FALSE; m_bNetMovePredict = TRUE; m_bNetDebug = FALSE; @@ -80,11 +87,11 @@ void CDecor::Create(HWND hWnd, CSound* pSound, CPixmap* pPixmap, CNetwork* pNetw m_pNetwork = pNetwork; m_keyPress = 0; m_lastKeyPress = 0; - m_blupiSpeedX = 0; - m_bHelicopterFlying = FALSE; - m_bHelicopterStationary = FALSE; - m_bCarMoving = FALSE; - m_bCarStationary = FALSE; + m_bJoystick = FALSE; + m_bHelicoMarch = FALSE; + m_bHelicoStop = FALSE; + m_bJeepMarch = FALSE; + m_bJeepStop = FALSE; InitDecor(); m_jauges[0].Create(m_hWnd, m_pPixmap, m_pSound, { 169, 450 }, 1, FALSE); @@ -95,8 +102,6 @@ void CDecor::Create(HWND hWnd, CSound* pSound, CPixmap* pPixmap, CNetwork* pNetw NotifFlush(); } -// The only seemingly sane function. - BOOL CDecor::LoadImages() { POINT totalDim, iconDim; @@ -115,11 +120,7 @@ BOOL CDecor::LoadImages() void CDecor::InitGamer() { m_nbVies = 3; - BYTE *ptr = m_doors; - for (int i = 50; i != 0; i--) { - *(int *)ptr = 0x01010101; - ptr += 4; - } + FillMemory(m_doors, sizeof(m_doors), 1); } void CDecor::InitDecor() @@ -143,7 +144,7 @@ void CDecor::InitDecor() m_decor[5][4].icon = 39; for (int k = MAXMOVEOBJECT; k != 0; k--) { - m_moveObject[k]->type = 0; + m_moveObject[k].type = 0; } FlushBalleTraj(); FlushMoveTraj(); @@ -203,7 +204,7 @@ void CDecor::InitDecor() m_blupiTimeNoAsc = 0; m_blupiTimeMockery = 0; m_blupiVitesse = { 0, 0 }; - m_blupiValidPos = m_blupiStartPos; + m_blupiValidPos = m_blupiStartPos[0]; m_blupiEnergyUnused = 100; m_blupiFront = FALSE; m_blupiBullet = 0; @@ -213,11 +214,11 @@ void CDecor::InitDecor() m_nbTresor = 0; m_totalTresor = 1; m_goalPhase = 0; - m_scrollPoint = m_blupiStartPos; + m_scrollPoint = m_blupiStartPos[0]; m_scrollAdd.x = 0; m_scrollAdd.y = 0; m_term = 0; - m_CC20 = -1; + m_2ndPositionCalculationSlot = -1; } void CDecor::SetTime(int time) @@ -230,14 +231,9 @@ int CDecor::GetTime() return m_time; } -// Basically the same as the other fucking function - void CDecor::PlayPrepare(BOOL bTest) { - if (bTest) - { - m_nbVies = 3; - } + if (bTest) m_nbVies = 3; if (m_bMulti) { @@ -327,7 +323,7 @@ void CDecor::PlayPrepare(BOOL bTest) (m_moveObject[i].type == TYPE_BLUPIHELICO) || (m_moveObject[i].type == TYPE_BLUPITANK)) { - m_moveObject[i]->type = 0; + m_moveObject[i].type = 0; } } m_goalPhase = 0; @@ -337,10 +333,10 @@ void CDecor::PlayPrepare(BOOL bTest) m_scrollAdd = { 0, 0 }; m_blupiPosHelico.x = -1; m_nbLinkCaisse = 0; - m_bHelicopterFlying = FALSE; - m_bHelicopterStationary = FALSE; - m_bCarMoving = FALSE; - m_bCarStationary = FALSE; + m_bHelicoMarch = FALSE; + m_bHelicoStop = FALSE; + m_bJeepMarch = FALSE; + m_bJeepStop = FALSE; m_blupiFront = FALSE; m_blupiNoBarre = 0; m_blupiValidPos = m_blupiPos; @@ -357,8 +353,6 @@ void CDecor::PlayPrepare(BOOL bTest) m_bPause = FALSE; } -// Sort of makes sense. - void CDecor::BuildPrepare() { for (int i = 0; i < MAXMOVEOBJECT; i++) @@ -373,8 +367,8 @@ void CDecor::BuildPrepare() } } m_voyageIcon = -1; - m_selectedCelPos.x = -1; - m_CC20 = -1; + m_posCelHili.x = -1; + m_2ndPositionCalculationSlot = -1; m_time = 0; m_bPause = FALSE; NetDataFlush(); @@ -391,25 +385,25 @@ void CDecor::MoveStep() if (m_phase == WM_PHASE_PLAY || m_phase == WM_PHASE_PLAYTEST) { BlupiStep(); - FUN_15d50(); + NetFUN_15d50(); NotifStep(); } if (m_phase == WM_PHASE_BUILD) { if (m_keyPress & KEY_RIGHT) { m_posDecor.x += 50; - int max = (m_dimDecor.x > 0) ? (m_dimDecor.x - LXIMAGE) : 0; + int max = (m_dimDecor.x != 0) ? (MAXCELX * DIMOBJX - LXIMAGE) : 0; if (m_posDecor.x > max) { m_posDecor.x = max; } - m_selectedCelPos.x = -1; + m_posCelHili.x = -1; } if (m_keyPress & KEY_LEFT) { m_posDecor.x -= 50; if (m_posDecor.x < 0) { m_posDecor.x = 0; } - m_selectedCelPos.x = -1; + m_posCelHili.x = -1; } if (m_keyPress & KEY_DOWN) { m_posDecor.y += 50; @@ -417,14 +411,14 @@ void CDecor::MoveStep() if (m_posDecor.y > max) { m_posDecor.y = max; } - m_selectedCelPos.x = -1; + m_posCelHili.x = -1; } if (m_keyPress & KEY_UP) { m_posDecor.x -= 50; if (m_posDecor.x < 0) { m_posDecor.x = 0; } - m_selectedCelPos.x = -1; + m_posCelHili.x = -1; } } } @@ -434,7 +428,9 @@ int CDecor::GetBlupiChannelStandard() if (m_bMulti && m_blupiChannel == CHBLUPI && m_team > 0) { return m_team + CHBLUPI1 - 1; } - return m_blupiChannel; + else { + return m_blupiChannel; + } } int CDecor::GetBlupiChannelActual() @@ -450,7 +446,9 @@ int CDecor::GetIconPerso() if (m_bMulti) { return m_team + 108; } - return 108; + else { + return 108; + } } BOOL CDecor::BlitzActif(int celx, int cely) @@ -461,8 +459,7 @@ BOOL CDecor::BlitzActif(int celx, int cely) return 1 - (((m_time ^ foo) - foo & 1 ^ foo) == foo); } - POINT pos; - pos = { celx * DIMOBJX, cely * DIMOBJY }; + POINT pos = { celx * DIMOBJX, cely * DIMOBJY }; int num = m_time % 100; @@ -518,7 +515,7 @@ void CDecor::Build(RECT rect) tinyPoint.y = - posDecor.y % 64 + 2 - 64; for (int j = posDecor.y / 64 - 1; j < posDecor.y / 64 + LYIMAGE / 64 + 2; j++) { - if (i >= 0 && i < 100 && j >= 0 && j < 100) + if (i >= 0 && i < MAXCELX && j >= 0 && j < MAXCELY) { int num2 = m_bigDecor[i][j].icon; int channel = 9; @@ -552,7 +549,7 @@ void CDecor::Build(RECT rect) tinyPoint.y = - posDecor.y % 64; for (int 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) + if (i >= 0 && i < MAXCELX && j >= 0 && j < MAXCELY && m_decor[i][j].icon != -1) { int num2 = m_decor[i][j].icon; if (num2 == 384 || num2 == 385) @@ -582,7 +579,7 @@ void CDecor::Build(RECT rect) tinyPoint.y = m_blupiPos.y - posDecor.y; if (m_blupiJeep) { - tinyPoint.y += m_blupiOffsetY; + tinyPoint.y += BLUPIOFFY; } if (m_blupiShield) { @@ -638,7 +635,7 @@ void CDecor::Build(RECT rect) for (int num3 = MAXMOVEOBJECT - 1; num3 >= 0; num3--) { - if (m_moveObject[num3].type != 0 && m_moveObject[num3].posCurrent.x >= posDecor.x - 64 && m_moveObject[num3].posCurrent.y >= posDecor.y - 64 && m_moveObject[num3].posCurrent.X <= posDecor.X + m_drawBounds.Width && m_moveObject[num3].posCurrent.Y <= posDecor.Y + m_drawBounds.Height && (m_moveObject[num3].type < 8 || m_moveObject[num3].type > 11) && (m_moveObject[num3].type < 90 || m_moveObject[num3].type > 95) && (m_moveObject[num3].type < 98 || m_moveObject[num3].type > 100) && m_moveObject[num3].type != 53 && m_moveObject[num3].type != 1 && m_moveObject[num3].type != 47 && m_moveObject[num3].type != 48) + if (m_moveObject[num3].type != 0 && m_moveObject[num3].posCurrent.x >= posDecor.x - 64 && m_moveObject[num3].posCurrent.y >= posDecor.y - 64 && m_moveObject[num3].posCurrent.x <= posDecor.x + LXIMAGE && m_moveObject[num3].posCurrent.y <= posDecor.y + LYIMAGE && (m_moveObject[num3].type < 8 || m_moveObject[num3].type > 11) && (m_moveObject[num3].type < 90 || m_moveObject[num3].type > 95) && (m_moveObject[num3].type < 98 || m_moveObject[num3].type > 100) && m_moveObject[num3].type != 53 && m_moveObject[num3].type != 1 && m_moveObject[num3].type != 47 && m_moveObject[num3].type != 48) { tinyPoint.x = m_moveObject[num3].posCurrent.x - posDecor.x; tinyPoint.y = m_moveObject[num3].posCurrent.y - posDecor.y; @@ -651,22 +648,17 @@ void CDecor::Build(RECT rect) { tinyPoint.y += BLUPIOFFY; } - double opacity = 1.0; - if (m_moveObject[num3].type == 58) - { - opacity = (double)(20 - m_moveObject[num3].phase) * 0.3 / 20.0; - } - m_pPixmap->QuickIcon(m_moveObject[num3].channel, m_moveObject[num3].icon, tinyPoint, opacity, 0.0); + // get the winphone opacity stuff out of here + m_pPixmap->QuickIcon(m_moveObject[num3].channel, m_moveObject[num3].icon, tinyPoint); if (m_moveObject[num3].type == 30) { - for (int l = 0; l < table_drinkoffset.Length; l++) + for (int l = 0; l < sizeof(table_drinkoffset)/sizeof(int); l++) { - int num4 = (m_time + Tables.table_drinkoffset[l]) % 50; - int rank = Tables.table_drinkeffect[num4 % 5]; + 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; - double opacity2 = (50.0 - (double)num4) / 50.0; - m_pPixmap->QuickIcon(10, rank, pos2, opacity2, 0.0); + m_pPixmap->QuickIcon(10, rank, pos2); } } if (m_bDrawSecret && m_moveObject[num3].type == 12 && m_moveObject[num3].icon != 32 && m_moveObject[num3].icon != 33 && m_moveObject[num3].icon != 34) @@ -675,24 +667,24 @@ void CDecor::Build(RECT rect) } } } - tinyPoint.X = m_drawBounds.Left - posDecor.X % 64; - for (int i = posDecor.X / 64; i < posDecor.X / 64 + m_drawBounds.Width / 64 + 2; i++) + tinyPoint.x = - posDecor.x % 64; + for (int i = posDecor.x / 64; i < posDecor.x / 64 + LXIMAGE / 64 + 2; i++) { - tinyPoint.Y = m_drawBounds.Top - posDecor.Y % 64; - for (int j = posDecor.Y / 64; j < posDecor.Y / 64 + m_drawBounds.Height / 64 + 2; j++) + tinyPoint.y = 0 - posDecor.y % 64; + for (int 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) + if (i >= 0 && i < 100 && j >= 0 && j < 100 && m_decor[i][j].icon != -1) { - int num2 = m_decor[i, j].icon; - pos.X = tinyPoint.X; - pos.Y = tinyPoint.Y; + int num2 = m_decor[i][j].icon; + pos.x = tinyPoint.x; + pos.y = tinyPoint.y; if ((num2 >= 107 && num2 <= 109) || num2 == 157) { - pos.Y -= 7; + pos.y -= 7; } if (num2 == 211) { - num2 = Tables.table_ressort[(m_time / 2 + i * 7) % 8]; + num2 = table_ressort[(m_time / 2 + i * 7) % 8]; } if (num2 == 214 && !m_bDrawSecret) { @@ -700,12 +692,12 @@ void CDecor::Build(RECT rect) } if (num2 == 364) { - pos.Y -= 2; + pos.y -= 2; } switch (num2) { default: - m_pixmap.QuickIcon(1, num2, pos); + m_pPixmap->QuickIcon(1, num2, pos); break; case 68: case 91: @@ -750,811 +742,149 @@ void CDecor::Build(RECT rect) break; } } - tinyPoint.Y += 64; + tinyPoint.y += 64; } - tinyPoint.X += 64; + tinyPoint.x += 64; } for (int num3 = 0; num3 < MAXMOVEOBJECT; num3++) { - if ((m_moveObject[num3].type == 1 || m_moveObject[num3].type == 47 || m_moveObject[num3].type == 48) && m_moveObject[num3].posCurrent.X >= posDecor.X - 64 && m_moveObject[num3].posCurrent.Y >= posDecor.Y - 64 && m_moveObject[num3].posCurrent.X <= posDecor.X + m_drawBounds.Width && m_moveObject[num3].posCurrent.Y <= posDecor.Y + m_drawBounds.Height) + if ((m_moveObject[num3].type == 1 || m_moveObject[num3].type == 47 || m_moveObject[num3].type == 48) && m_moveObject[num3].posCurrent.x >= posDecor.x - 64 && m_moveObject[num3].posCurrent.y >= posDecor.y - 64 && m_moveObject[num3].posCurrent.x <= posDecor.x + LXIMAGE && m_moveObject[num3].posCurrent.y <= posDecor.y + LYIMAGE) { - tinyPoint.X = m_drawBounds.Left + m_moveObject[num3].posCurrent.X - posDecor.X; - tinyPoint.Y = m_drawBounds.Top + m_moveObject[num3].posCurrent.Y - posDecor.Y; - m_pixmap.QuickIcon(m_moveObject[num3].channel, m_moveObject[num3].icon, tinyPoint); + tinyPoint.x = 0 + m_moveObject[num3].posCurrent.x - posDecor.x; + tinyPoint.y = 0 + m_moveObject[num3].posCurrent.y - posDecor.y; + m_pPixmap->QuickIcon(m_moveObject[num3].channel, m_moveObject[num3].icon, tinyPoint); } } - tinyPoint.X = m_drawBounds.Left - posDecor.X % 64; - for (int i = posDecor.X / 64; i < posDecor.X / 64 + m_drawBounds.Width / 64 + 2; i++) + tinyPoint.x = 0 - posDecor.x % 64; + for (int i = posDecor.x / 64; i < posDecor.x / 64 + LXIMAGE / 64 + 2; i++) { - tinyPoint.Y = m_drawBounds.Top - posDecor.Y % 64; - for (int j = posDecor.Y / 64; j < posDecor.Y / 64 + m_drawBounds.Height / 64 + 2; j++) + tinyPoint.y = 0 - posDecor.y % 64; + for (int 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) + if (i >= 0 && i < 100 && j >= 0 && j < 100 && m_decor[i][j].icon != -1) { - int num2 = m_decor[i, j].icon; + int num2 = m_decor[i][j].icon; pos = tinyPoint; if (num2 == 68) { - num2 = Tables.table_decor_lave[(i * 13 + j * 7 + m_time / 2) % 8]; - m_pixmap.QuickIcon(1, num2, pos); + num2 = table_decor_lave[(i * 13 + j * 7 + m_time / 2) % 8]; + m_pPixmap->QuickIcon(1, num2, pos); } if (num2 == 373) { - num2 = ((!m_blupiFocus) ? Tables.table_decor_piege2[(i * 13 + j * 7 + m_time / 2) % 4] : Tables.table_decor_piege1[(i * 13 + j * 7 + m_time / 4) % 16]); - m_pixmap.QuickIcon(1, num2, pos); + num2 = ((!m_blupiFocus) ? table_decor_piege2[(i * 13 + j * 7 + m_time / 2) % 4] : table_decor_piege1[(i * 13 + j * 7 + m_time / 4) % 16]); + m_pPixmap->QuickIcon(1, num2, pos); } if (num2 == 404 || num2 == 410) { - num2 = Tables.table_decor_goutte[(i * 13 + j * 7 + m_time / 2) % 48]; - pos.Y -= 9; - m_pixmap.QuickIcon(1, num2, pos); + num2 = table_decor_goutte[(i * 13 + j * 7 + m_time / 2) % 48]; + pos.y -= 9; + m_pPixmap->QuickIcon(1, num2, pos); if (num2 >= 404 && num2 <= 407) { - m_decor[i, j].icon = 404; + m_decor[i][j].icon = 404; } else { - m_decor[i, j].icon = 410; + m_decor[i][j].icon = 410; } } if (num2 == 317) { - num2 = Tables.table_decor_ecraseur[m_time / 3 % 10]; - m_pixmap.QuickIcon(1, num2, pos); + num2 = table_decor_ecraseur[m_time / 3 % 10]; + m_pPixmap->QuickIcon(1, num2, pos); } if (num2 == 378) { - num2 = Tables.table_decor_scie[(i * 13 + j * 7 + m_time / 1) % 6]; - m_pixmap.QuickIcon(1, num2, pos); + num2 = table_decor_scie[(i * 13 + j * 7 + m_time / 1) % 6]; + m_pPixmap->QuickIcon(1, num2, pos); } if (num2 == 324) { - num2 = Tables.table_decor_temp[m_time / 4 % 20]; - m_pixmap.QuickIcon(1, num2, pos); + num2 = table_decor_temp[m_time / 4 % 20]; + m_pPixmap->QuickIcon(1, num2, pos); } if (num2 == 92) { - num2 = Tables.table_decor_eau1[(i * 13 + j * 7 + m_time / 3) % 6]; - m_pixmap.QuickIcon(1, num2, pos); + num2 = table_decor_eau1[(i * 13 + j * 7 + m_time / 3) % 6]; + m_pPixmap->QuickIcon(1, num2, pos); } if (num2 == 91) { int num5 = 3 + (i * 17 + j * 13) % 3; - num2 = Tables.table_decor_eau2[(i * 11 + j * 7 + m_time / num5) % 6]; - m_pixmap.QuickIcon(1, num2, pos); + num2 = table_decor_eau2[(i * 11 + j * 7 + m_time / num5) % 6]; + m_pPixmap->QuickIcon(1, num2, pos); } if (num2 == 305 && BlitzActif(i, j)) { - num2 = m_random.Next(305, 308); - m_pixmap.QuickIcon(1, num2, pos); + num2 = rand() % 4 + 305; + m_pPixmap->QuickIcon(1, num2, pos); } if (num2 == 110) { - num2 = Tables.table_decor_ventg[m_time / 1 % 4]; - m_pixmap.QuickIcon(1, num2, pos); + num2 = table_decor_ventg[m_time / 1 % 4]; + m_pPixmap->QuickIcon(1, num2, pos); } if (num2 == 114) { - num2 = Tables.table_decor_ventd[m_time / 1 % 4]; - m_pixmap.QuickIcon(1, num2, pos); + num2 = table_decor_ventd[m_time / 1 % 4]; + m_pPixmap->QuickIcon(1, num2, pos); } if (num2 == 118) { - num2 = Tables.table_decor_venth[m_time / 1 % 4]; - m_pixmap.QuickIcon(1, num2, pos); + num2 = table_decor_venth[m_time / 1 % 4]; + m_pPixmap->QuickIcon(1, num2, pos); } if (num2 == 122) { - num2 = Tables.table_decor_ventb[m_time / 1 % 4]; - m_pixmap.QuickIcon(1, num2, pos); + num2 = table_decor_ventb[m_time / 1 % 4]; + m_pPixmap->QuickIcon(1, num2, pos); } if (num2 == 126) { - num2 = Tables.table_decor_ventillog[m_time / 2 % 3]; - m_pixmap.QuickIcon(1, num2, pos); + num2 = table_decor_ventillog[m_time / 2 % 3]; + m_pPixmap->QuickIcon(1, num2, pos); } if (num2 == 129) { - num2 = Tables.table_decor_ventillod[m_time / 2 % 3]; - m_pixmap.QuickIcon(1, num2, pos); + num2 = table_decor_ventillod[m_time / 2 % 3]; + m_pPixmap->QuickIcon(1, num2, pos); } if (num2 == 132) { - num2 = Tables.table_decor_ventilloh[m_time / 2 % 3]; - m_pixmap.QuickIcon(1, num2, pos); + num2 = table_decor_ventilloh[m_time / 2 % 3]; + m_pPixmap->QuickIcon(1, num2, pos); } if (num2 == 135) { - num2 = Tables.table_decor_ventillob[m_time / 2 % 3]; - m_pixmap.QuickIcon(1, num2, pos); + num2 = table_decor_ventillob[m_time / 2 % 3]; + m_pPixmap->QuickIcon(1, num2, pos); } } - tinyPoint.Y += 64; + tinyPoint.y += 64; } - tinyPoint.X += 64; + tinyPoint.x += 64; } - ByeByeDraw(posDecor); for (int num3 = 0; num3 < MAXMOVEOBJECT; num3++) { - if (m_moveObject[num3].type != 0 && m_moveObject[num3].posCurrent.X >= posDecor.X - 64 && m_moveObject[num3].posCurrent.Y >= posDecor.Y - 64 && m_moveObject[num3].posCurrent.X <= posDecor.X + m_drawBounds.Width && m_moveObject[num3].posCurrent.Y <= posDecor.Y + m_drawBounds.Height && ((m_moveObject[num3].type >= 8 && m_moveObject[num3].type <= 11) || (m_moveObject[num3].type >= 90 && m_moveObject[num3].type <= 95) || (m_moveObject[num3].type >= 98 && m_moveObject[num3].type <= 100) || m_moveObject[num3].type == 53)) + if (m_moveObject[num3].type != 0 && m_moveObject[num3].posCurrent.x >= posDecor.x - 64 && m_moveObject[num3].posCurrent.y >= posDecor.y - 64 && m_moveObject[num3].posCurrent.x <= posDecor.x + LXIMAGE && m_moveObject[num3].posCurrent.y <= posDecor.y + LYIMAGE && ((m_moveObject[num3].type >= 8 && m_moveObject[num3].type <= 11) || (m_moveObject[num3].type >= 90 && m_moveObject[num3].type <= 95) || (m_moveObject[num3].type >= 98 && m_moveObject[num3].type <= 100) || m_moveObject[num3].type == 53)) { - tinyPoint.X = m_drawBounds.Left + m_moveObject[num3].posCurrent.X - posDecor.X; - tinyPoint.Y = m_drawBounds.Top + m_moveObject[num3].posCurrent.Y - posDecor.Y; - m_pixmap.QuickIcon(m_moveObject[num3].channel, m_moveObject[num3].icon, tinyPoint); + tinyPoint.x = 0 + m_moveObject[num3].posCurrent.x - posDecor.x; + tinyPoint.y = 0 + m_moveObject[num3].posCurrent.y - posDecor.y; + m_pPixmap->QuickIcon(m_moveObject[num3].channel, m_moveObject[num3].icon, tinyPoint); } } if (m_blupiFront) { - tinyPoint.X = m_drawBounds.Left + m_blupiPos.X - posDecor.X; - tinyPoint.Y = m_drawBounds.Top + m_blupiPos.Y - posDecor.Y; - m_pixmap.QuickIcon(m_blupiChannel, m_blupiIcon, tinyPoint); + tinyPoint.x = 0 + m_blupiPos.x - posDecor.x; + tinyPoint.y = 0 + m_blupiPos.y - posDecor.y; + m_pPixmap->QuickIcon(m_blupiChannel, m_blupiIcon, tinyPoint); } DrawInfo(); VoyageDraw(); m_time++; } -// i have gone completely insane - -void CDecor::Build(RECT rect) -{ - short *pShort1; - short short2; - int mobType; - POINT dest; - RECT rect_00; - POINT pos; - RECT clip; - RECT clip_00; - RECT *pRV4; - int int5; - int int6; - int int7; - int *pint8; - int uint9; - BOOL BV10; - int int11; - int int12; - int uint13; - int int14; - int uint15; - int uint16; - int int17; - int int18; - int int19; - int int20; - MoveObject *pMob; - int int22; - LONG LV23; - LONG LV24; - int int25; - int L_48; - int L_40; - int L_3c; - int *L_38; - int L_34; - RECT rect_3; - RECT rect_2; - RECT rect_1; - - rect_2 = m_pPixmap->GetClipping(); - rect_1 = rect_2; - clip.top = rect.top; - clip.left = rect.left; - clip.right = rect.right; - clip.bottom = rect.bottom; - m_pPixmap->SetClipping(clip); - pRV4 = ▭ - DecorNextAction((POINT *)pRV4); - rect_3.right = 0; - rect_3.left = 2; - rect_2.left = pRV4->left; - rect_2.top = pRV4->top; - int20 = rect_2.top * 2; - int12 = rect_2.left * 2 / 3 % LXIMAGE; - do { - int17 = 0; - rect.left = 2; - int22 = int20 / 3 % LYIMAGE; - do { - dest.y = int17; - dest.x = rect_3.right; - rect_00.top = int22; - rect_00.left = int12; - rect_00.right = LXIMAGE; - rect_00.bottom = LYIMAGE; - m_pPixmap->DrawPart(-1, 3, dest, rect_00, 1, 0); - int11 = LYIMAGE - int22; - int22 = 0; - int17 += int11; - rect.left--; - } while (rect.left != 0); - int22 = LXIMAGE - int12; - int12 = 0; - rect_3.right += int22; - rect_3.left--; - } while (rect_3.left != 0); - int22 = rect_2.left % DIMOBJX; - rect_3.right = -DIMOBJX - int22; - int12 = (int)(rect_2.left + (uint13 & 0x3f)) >> 6; - int20 = int12 - 1; - rect.left = 0; - if (int20 < int12 + 13) { - // int3 = -(_posDecor.y % 64 + 64 - 2); - uint13 = rect_2.top >> 0x1f; - int5 = -(rect_2.top % DIMOBJY + DIMOBJY - 2); - int6 = (int)(rect_2.top + (uint13 & 0x3f)) >> 6; - rect.left = (int12 + 13) - int20; - int17 = int6 + -1; - int20 = int20 * 100 + 10008; - int11 = int5; - int19 = int17; - do { - for (; int19 < int6 + 9; int19 = int19 + 1) { - if (10007 < int20 && int20 < 20008 && -1 < int19 && int19 < 100) { - int7 = 9; - int14 = (int)*(short *)((int)(m_decor + -1) + (int19 + int20) * 2 + 184); - if (int14 != -1) { - if (int14 == 203) { - int7 = 1; - int14 = table_marine[m_time / 3 % 11]; - } - int18 = int11; - if ((65 < int14) && (int14 < 69)) { - int18 = int11 + -13; - } - if ((86 < int14) && (int14 < 90)) { - int18 += -2; - } - pos.y = int18; - pos.x = rect_3.right; - m_pPixmap->QuickIcon(int7, int14, pos); - } - } - int11 = int11 + 64; - } - rect_3.right += 64; - int20 += 100; - rect.left--; - int11 = int5; - int19 = int17; - } while (rect.left != 0); - } - int22 = -int22; - int20 = int12 + 12; - if (int12 < int20) { - uint13 = rect_2.top >> 0x1f; - int5 = -(((rect_2.top ^ uint13) - uint13 & 0x3f ^ uint13) - uint13); - int6 = (int)(rect_2.top + (uint13 & 0x3f)) >> 6; - rect.left = int20 - int12; - int17 = int12 * 100 + 8; - int11 = int5; - int19 = int6; - rect_3.right = int22; - do { - for (; int19 < int6 + 9; int19++) { - if ((((7 < int17) && (int17 < 10008)) && (-1 < int19)) && - (((int19 < 100 && - (short2 = *(short *)((int)(m_decor + -1) + (int19 + int17) * 2 + 184), - short2 != -1)) && ((int14 = (int)short2, int14 == 0x180 || (int14 == 0x181)))))) { - pos.y = int11; - pos.x = rect_3.right; - m_pPixmap->QuickIcon(CHOBJECT, int14, pos); - } - int11 = int11 + 0x40; - } - rect_3.right += 0x40; - int17 += 100; - rect.left += -1; - int11 = int5; - int19 = int6; - } while (rect.left != 0); - } - if (m_phase == WM_PHASE_BUILD) { - L_38 = &m_jaugeSomething4; - rect.left = 3; - pint8 = &m_D42C; - do { - int17 = 2; - if (0 < rect.left) { - int17 = rect.left + 10; - } - int11 = 4; - if (*L_38 == 2) { - int11 = 0; - } - int5 = pint8[-1] - rect_2.left; - int19 = *pint8 - rect_2.top; - pos.y = int19; - pos.x = int5; - m_pPixmap->QuickIcon(int17, int11, pos); - if (m_buildOfficialMissions != 0) { - pos.y = int19 + -0x14; - pos.x = (int)pint8 + int5 + (-54294 - (int)this); - m_pPixmap->QuickIcon(4, rect.left + 0x78, pos); - } - rect.left += -1; - L_38 = L_38 + -1; - pint8 = pint8 + -2; - } while (-1 < rect.left); - } - if (m_bMulti && m_phase != WM_PHASE_BUILD) { - rect.left = 0; - L_40 = 0; - pint8 = &m_D488; - L_38 = &m_D45C; - do { - int17 = pint8[-4]; - if ((int17 != -1) && (((int17 < 0x114 || (0x11c < int17)) && (*pint8 != 4)))) { - int17 = L_38[-1] - rect_2.left; - int11 = *L_38 - rect_2.top; - if (*pint8 == 1) { - uint13 = m_time / 2; - uint15 = (int)uint13 >> 0x1f; - pos.y = int11 + -2; - pos.x = int17; - m_pPixmap->QuickIcon(CHELEMENT, - (&DAT_00435568)[((uint13 ^ uint15) - uint15 & 0xf ^ uint15) - uint15], - pos); - pos.y = int11; - pos.x = int17; - m_pPixmap->QuickIcon(CHELEMENT, (&DAT_004356a8)[(m_time / 2) % 5], - pos); - } - if (*pint8 == 2) { - pos.y = int11; - pos.x = int17; - m_pPixmap->QuickIcon(CHELEMENT, (&table_magicloop)[(m_time / 2) % 5], - pos); - } - if (*pint8 == 3) { - int19 = 0; - do { - pos.y = int11 + -0x22; - pos.x = int17 + -0x22; - m_pPixmap->QuickIcon(CHEXPLO, - (rect.left + int19 + m_time) % 6 + 0x30, pos); - int19 += 1; - } while (int19 < 3); - } - int19 = pint8[4]; - int5 = (int)*(short *)(m_pNetwork->m_players[0].name + L_40 + -2); - if ((int19 == 2) && (0 < int5)) { - int19 = int5 + 10; - } - pos.y = int11; - pos.x = int17; - m_pPixmap->QuickIcon(int19, pint8[-4], pos); - pos.y = int11 + -0x14; - pos.x = int17 + 10; - m_pPixmap->QuickIcon(4, int5 + 0x78, pos); - } - rect.left += 1; - pint8 = pint8 + 1; - L_40 += 0x20; - L_38 = L_38 + 2; - } while (L_40 < 0x80); - } - if ((m_phase == WM_PHASE_BUILD) || (m_blupiSec = 0, m_blupiFront != 0)) - goto LAB_00404781; - int11 = (m_blupiPos).x - rect_2.left; - int17 = (m_blupiPos).y - rect_2.top; - if (m_blupiShield == 0) { - if (m_blupiPower != 0) { - m_blupiSec = 2; - if ((m_blupiTimeShield < 26) && - (uint13 = m_time >> 0x1f, - 1 < (int)(((m_time ^ uint13) - uint13 & 3 ^ uint13) - uint13))) goto LAB_004052d0; - pos.y = int17; - pos.x = int11; - m_pPixmap->QuickIcon(CHELEMENT, (&table_magicloop)[(m_time / 2) % 5], pos - ); - int25 = m_blupiIcon; - goto LAB_00404771; - } - if (m_blupiCloud) { - m_blupiSec = 3; - if ((25 < m_blupiTimeShield) || - (uint13 = m_time >> 0x1f, - (int)(((m_time ^ uint13) - uint13 & 3 ^ uint13) - uint13) < 2)) { - int19 = 0; - do { - pos.y = int17 + -0x22; - pos.x = int11 + -0x22; - m_pPixmap->QuickIcon(CHEXPLO, (int19 + m_time) % 6 + 0x30, pos); - int19 += 1; - } while (int19 < 3); - } - LAB_00404768: - int25 = m_blupiIcon; - goto LAB_00404771; - } - if (m_blupiHide == 0) goto LAB_00404768; - m_blupiSec = 4; - if ((m_blupiTimeShield < 26) && - (uint13 = m_time >> 0x1f, - 1 < (int)(((m_time ^ uint13) - uint13 & 3 ^ uint13) - uint13))) goto LAB_004052d0; - m_pPixmap->DrawIcon(0xe, 1, 0xf5, (POINT)0x0, 0, 1); - int25 = m_blupiIcon; - BV10 = 0; - int5 = 1; - LV24 = 0; - LV23 = 0; - int19 = GetBlupiChannel_1(); - pos.y = LV24; - pos.x = LV23; - m_pPixmap->DrawIcon(0xe, int19, (int)int25, pos, int5, BV10); - m_pPixmap->DrawIcon(0xe, 1, 0xed, (POINT)0x0, 0, 1); - int25 = (Icon4)0x0; - int19 = 0xe; - } - else { - m_blupiSec = 1; - if ((m_blupiTimeShield < 0x1a) && - (uint13 = m_time >> 0x1f, - 1 < (int)(((m_time ^ uint13) - uint13 & 3 ^ uint13) - uint13))) { - LAB_004052d0: - int25 = m_blupiIcon; - } - else { - uint13 = m_time / 2; - uint15 = (int)uint13 >> 0x1f; - pos.y = int17 + -2; - pos.x = int11; - m_pPixmap->QuickIcon(CHELEMENT, - (&DAT_00435568)[((uint13 ^ uint15) - uint15 & 0xf ^ uint15) - uint15], - pos); - pos.y = int17; - pos.x = int11; - m_pPixmap->QuickIcon(CHELEMENT, (&DAT_004356a8)[(m_time / 2) % 5], pos); - int25 = m_blupiIcon; - } - LAB_00404771: - int19 = GetBlupiChannel_1(); - } - pos.y = int17; - pos.x = int11; - m_pPixmap->QuickIcon(int19, (int)int25, pos); -LAB_00404781: - pMob = m_moveObject + 199; - rect.left = MAXMOVEOBJECT; - do { - mobType = pMob->type; - if (((((((mobType != TYPE_empty) && - (int17 = (pMob->posCurrent).x, (int)(rect_2.left - 64U) <= int17)) && - (int11 = (pMob->posCurrent).y, (int)(rect_2.top - 64U) <= int11)) && - ((int17 <= (int)(rect_2.left + LXIMAGE) && (int11 <= (int)(rect_2.top + LYIMAGE))))) - && (((short)mobType < 8 || (11 < (short)mobType)))) && - (((short)mobType < 90 || (95 < (short)mobType)))) && - ((((short)mobType < 98 || (100 < (short)mobType)) && - ((((mobType != TYPE_TENTACULE && (mobType != TYPE_ASCENSEUR)) && (mobType != TYPE_ASCENSUERs)) && - (mobType != TYPE_ASCENSEURsi)))))) { - int17 -= rect_2.left; - int11 -= rect_2.top; - if (((mobType == TYPE_BULLDOZER) || (mobType == TYPE_BLUPIHELICO)) || (mobType == TYPE_BLUPITANK)) { - int17 += 2; - int11 += 6; - } - if (mobType == TYPE_CREATURE) { - int11 += 6; - } - pos.y = int11; - pos.x = int17; - m_pPixmap->QuickIcon((int)pMob->channel, (int)pMob->icon, pos); - if (((m_bDrawSecret != 0) || (m_phase != WM_PHASE_PLAY)) && - ((pMob->type == TYPE_CAISSE && - (((short2 = pMob->icon, short2 != obj_woodencase0 && (short2 != obj_woodencase1)) && - (short2 != obj_woodencase2)))))) { - pos.y = int11; - pos.x = int17; - m_pPixmap->QuickIcon(CHOBJECT, 0xd6, pos); - } - } - pMob = pMob + -1; - rect.left += -1; - } while (rect.left != 0); - if (int12 < int20) { - uint13 = rect_2.top >> 0x1f; - int5 = -(((rect_2.top ^ uint13) - uint13 & 0x3f ^ uint13) - uint13); - int6 = (int)(rect_2.top + (uint13 & 0x3f)) >> 6; - rect.left = int12 * 7; - L_34 = int20 - int12; - int17 = int12 * 100 + 8; - int11 = int5; - int19 = int6; - rect_3.right = int22; - do { - for (; int19 < int6 + 9; int19 = int19 + 1) { - if (((7 < int17) && (int17 < 10008)) && - ((-1 < int19 && - ((int19 < 100 && - (short2 = *(short *)((int)(m_decor + -1) + (int19 + int17) * 2 + 0xb8), - short2 != -1)))))) { - int14 = (int)short2; - if (((106 < int14) && (int14 < 110)) || (int7 = int11, int14 == 0x9d)) { - int7 = int11 + -7; - } - if (int14 == 211) { - uint13 = m_time / 2 + rect.left; - uint15 = (int)uint13 >> 0x1f; - int14 = table_ressort[((uint13 ^ uint15) - uint15 & 7 ^ uint15) - uint15]; - } - if (((int14 == 214) && (m_bDrawSecret == 0)) && (m_phase == WM_PHASE_PLAY)) { - int14 = -1; - } - if (int14 == 364) { - int7 += -2; - } - if ((((int14 != obj_lava) && (int14 != 0x5b)) && - ((int14 != obj_watersurface && ((int14 != obj_lightning && (int14 != obj_crusher))) - ))) && ((int14 != obj_crusher6 && - ((((((int14 != 0x175 && (int14 != 0x194)) && (int14 != 0x19a)) && - ((int14 != 0x17a && (int14 != 0x180)))) && (int14 != 0x181)) && - ((int14 < obj_wind_left || (0x89 < int14)))))))) { - pos.y = int7; - pos.x = rect_3.right; - m_pPixmap->QuickIcon(CHOBJECT, int14, pos); - } - } - int11 = int11 + 64; - } - rect_3.right += 64; - int17 += 100; - rect.left += 7; - L_34 += -1; - int11 = int5; - int19 = int6; - } while (L_34 != 0); - } - pMob = m_moveObject; - rect.left = 200; - do { - mobType = pMob->type; - if ((((mobType == TYPE_ASCENSEUR) || (mobType == TYPE_ASCENSEURs)) || (mobType == TYPE_ASCENSEURsi)) - && (((int17 = (pMob->posCurrent).x, (int)(rect_2.left - 64U) <= int17 && - (int11 = (pMob->posCurrent).y, (int)(rect_2.top - 0x40U) <= int11)) && - ((int17 <= (int)(rect_2.left + LXIMAGE) && (int11 <= (int)(rect_2.top + LYIMAGE)))) - ))) { - pos.y = int11 - rect_2.top; - pos.x = int17 - rect_2.left; - m_pPixmap->QuickIcon((int)pMob->channel, (int)pMob->icon, pos); - } - uint13 = rect_2.top; - if ((m_phase == WM_PHASE_BUILD) && - ((((mobType = pMob->type, mobType == TYPE_ASCENSEUR || (mobType == TYPE_ASCENSUERs)) || - (((mobType == TYPE_ASCENSEURsi || - (((mobType == TYPE_BOMBEMOVE || (mobType == TYPE_BULLDOZER)) || (mobType == TYPE_POISSON)))) || - (((mobType == TYPE_OISEAU || (mobType == TYPE_GUEPE)) || (mobType == TYPE_CREATURE)))))) || - ((mobType == TYPE_BLUPIHELICO || (mobType == TYPE_BLUPITANK)))))) { - int11 = (pMob->posEnd).x; - int17 = rect_2.left - 64; - if ((int17 <= int11) && - (((int19 = (pMob->posEnd).y, (int)(rect_2.top - 0x40U) <= int19 && - (int11 <= (int)(rect_2.left + LXIMAGE))) && (int19 <= (int)(rect_2.top + LYIMAGE))) - )) { - pos.y = int19 - rect_2.top; - pos.x = int11 - rect_2.left; - m_pPixmap->QuickIcon(1, 0x1f, pos); - } - int11 = (pMob->posStart).x; - if (((int17 <= int11) && (int17 = (pMob->posStart).y, (int)(uint13 - 0x40) <= int17)) - && ((int11 <= (int)(rect_2.left + LXIMAGE) && (int17 <= (int)(uint13 + LYIMAGE))))) { - pos.y = int17 - uint13; - pos.x = int11 - rect_2.left; - m_pPixmap->QuickIcon(1, 0x1e, pos); - } - } - pMob = pMob + 1; - rect.left += -1; - } while (rect.left != 0); - if (int12 < int20) { - uint15 = rect_2.top >> 0x1f; - uint13 = rect_2.top ^ uint15; - int17 = (int)(rect_2.top + (uint15 & 0x3f)) >> 6; - L_48 = int12 * 0xd; - L_3c = int12 * 100 + 8; - rect_3.right = int22; - do { - if (int17 < int17 + 9) { - rect.left = int17 * 7; - L_38 = (int *)int17; - rect_3.bottom = -((uint13 - uint15 & 0x3f ^ uint15) - uint15); - do { - if (((7 < L_3c) && (L_3c < 10008)) && ((-1 < rect.left && (rect.left < 700)))) { - pShort1 = (short *)((int)(m_decor + -1) + ((int)L_38 + L_3c) * 2 + 0xb8); - if (*pShort1 != -1) { - int22 = (int)*pShort1; - if (int22 == obj_lava) { - uint9 = m_time / 3 + L_48 + rect.left; - uint16 = (int)uint9 >> 0x1f; - int22 = (&table_decor_lave)[((uint9 ^ uint16) - uint16 & 7 ^ uint16) - uint16]; - pos.y = rect_3.bottom; - pos.x = rect_3.right; - m_pPixmap->QuickIcon(CHOBJECT, int22, pos); - } - if (int22 == 0x175) { - int22 = m_time; - if (m_blupiFocus == 0) { - uint9 = int22 / 2 + L_48 + rect.left; - uint16 = (int)uint9 >> 0x1f; - int22 = (&table_decor_piege2)[((uint9 ^ uint16) - uint16 & 3 ^ uint16) - uint16]; - } - else { - uint9 = ((int)(int22 + (int22 >> 0x1f & 3U)) >> 2) + L_48 + rect.left; - uint16 = (int)uint9 >> 0x1f; - int22 = (&table_decor_piege1) - [((uint9 ^ uint16) - uint16 & 0xf ^ uint16) - uint16]; - } - pos.y = rect_3.bottom; - pos.x = rect_3.right; - m_pPixmap->QuickIcon(1, int22, pos); - } - if ((int22 == 404) || (int11 = rect_3.bottom, int22 == 410)) { - int22 = *(int *)(&table_decor_goutte + - ((m_time / 2 + L_48 + rect.left) % 0x30) * 4); - int11 = rect_3.bottom + -9; - pos.y = int11; - pos.x = rect_3.right; - m_pPixmap->QuickIcon(1, int22, pos); - if ((int22 < 404) || (407 < int22)) { - *pShort1 = 410; - } - else { - *pShort1 = 404; - } - } - if (int22 == obj_crusher) { - int22 = table_decor_ecraseur[(m_time / 3) % 10]; - pos.y = int11; - pos.x = rect_3.right; - m_pPixmap->QuickIcon(1, int22, pos); - } - if (int22 == 0x17a) { - int22 = table_decor_scie[(m_time + L_48 + rect.left) % 6]; - pos.y = int11; - pos.x = rect_3.right; - m_pPixmap->QuickIcon(1, int22, pos); - } - if (int22 == obj_crusher6) { - int22 = m_time + (m_time >> 0x1f & 3U); - int22 = table_decor_temp[(int)(CONCAT44(int22 >> 0x1f, int22 >> 2) % 0x14)]; - pos.y = int11; - pos.x = rect_3.right; - m_pPixmap->QuickIcon(1, int22, pos); - } - if (int22 == obj_watersurface) { - uint9 = m_time / 3 + L_48 + rect.left; - uint16 = (int)uint9 >> 0x1f; - int22 = (&table_decor_eau1)[((uint9 ^ uint16) - uint16 & 3 ^ uint16) - uint16]; - pos.y = int11; - pos.x = rect_3.right; - m_pPixmap->QuickIcon(1, int22, pos); - } - if (int22 == 0x5b) { - uint9 = m_time / 3 + L_48 + rect.left; - uint16 = (int)uint9 >> 0x1f; - int22 = (&table_decor_eau2)[((uint9 ^ uint16) - uint16 & 3 ^ uint16) - uint16]; - pos.y = int11; - pos.x = rect_3.right; - m_pPixmap->QuickIcon(1, int22, pos); - } - if ((int22 == obj_lightning) && - (BV10 = BlitzActif(this, int12, (int)L_38), BV10 != 0)) { - int22 = *(int *)(&table_decor_lightning + - ((m_time + L_48 + rect.left) % 0x32) * 4); - pos.y = int11; - pos.x = rect_3.right; - m_pPixmap->QuickIcon(1, int22, pos); - } - if (int22 == obj_wind_left) { - uint9 = m_time >> 0x1f; - int22 = (&table_decor_ventg)[((m_time ^ uint9) - uint9 & 3 ^ uint9) - uint9]; - pos.y = int11; - pos.x = rect_3.right; - m_pPixmap->QuickIcon(1, int22, pos); - } - if (int22 == obj_wind_right) { - uint9 = m_time >> 0x1f; - int22 = (&table_decor_ventd)[((m_time ^ uint9) - uint9 & 3 ^ uint9) - uint9]; - pos.y = int11; - pos.x = rect_3.right; - m_pPixmap->QuickIcon(1, int22, pos); - } - if (int22 == obj_wind_up) { - uint9 = m_time >> 0x1f; - int22 = (&table_decor_venth)[((m_time ^ uint9) - uint9 & 3 ^ uint9) - uint9]; - pos.y = int11; - pos.x = rect_3.right; - m_pPixmap->QuickIcon(1, int22, pos); - } - if (int22 == obj_wind_down) { - uint9 = m_time >> 0x1f; - int22 = (&table_decor_ventb)[((m_time ^ uint9) - uint9 & 3 ^ uint9) - uint9]; - pos.y = int11; - pos.x = rect_3.right; - m_pPixmap->QuickIcon(1, int22, pos); - } - if (int22 == obj_fan_left) { - int22 = (&table_decor_ventillog)[(m_time / 2) % 3]; - pos.y = int11; - pos.x = rect_3.right; - m_pPixmap->QuickIcon(1, int22, pos); - } - if (int22 == obj_fan_right) { - int22 = (&table_decor_ventillod)[(m_time / 2) % 3]; - pos.y = int11; - pos.x = rect_3.right; - m_pPixmap->QuickIcon(1, int22, pos); - } - if (int22 == obj_fan_up) { - int22 = (&table_decor_ventilloh)[(m_time / 2) % 3]; - pos.y = int11; - pos.x = rect_3.right; - m_pPixmap->QuickIcon(1, int22, pos); - } - if (int22 == obj_fan_down) { - pos.y = int11; - pos.x = rect_3.right; - m_pPixmap->QuickIcon(1, - (&table_decor_ventillob)[(m_time / 2) % 3], pos); - } - } - } - rect_3.bottom += 64; - L_38 = (int *)((int)L_38 + 1); - rect.left += 7; - } while ((int)L_38 < int17 + 9); - } - rect_3.right += 64; - int12 += 1; - L_3c += 100; - L_48 += 13; - } while (int12 < int20); - } - uint13 = rect_2.left; - pMob = m_moveObject; - rect.left = 200; - do { - mobType = pMob->type; - if (((((mobType != TYPE_empty) && (int20 = (pMob->posCurrent).x, (int)(uint13 - 64) <= int20) - ) && (int12 = (pMob->posCurrent).y, (int)(rect_2.top - 0x40U) <= int12)) && - ((int20 <= (int)(uint13 + LXIMAGE) && (int12 <= (int)(rect_2.top + LYIMAGE))))) && - (((((7 < (short)mobType && ((short)mobType < 0xc)) || - ((0x59 < (short)mobType && ((short)mobType < 0x60)))) || - ((0x61 < (short)mobType && ((short)mobType < 0x65)))) || (mobType == TYPE_TENTACULE)))) { - pos.y = int12 - rect_2.top; - pos.x = int20 - uint13; - m_pPixmap->QuickIcon((int)pMob->channel, (int)pMob->icon, pos); - } - pMob = pMob + 1; - rect.left += -1; - } while (rect.left != 0); - if ((m_blupiFront != 0) && (m_phase != WM_PHASE_BUILD)) { - int22 = (m_blupiPos).y - rect_2.top; - int20 = (m_blupiPos).x - uint13; - int25 = m_blupiIcon; - int12 = GetBlupiChannel_1(); - pos.y = int22; - pos.x = int20; - m_pPixmap->QuickIcon(int12, (int)int25, pos); - } - DrawInfo(); - VoyageDraw(); - clip_00.top = rect_1.top; - clip_00.left = rect_1.left; - clip_00.right = rect_1.right; - clip_00.bottom = rect_1.bottom; - CPixmap::SetClipping(m_pPixmap, clip_00); - int20 = m_time + 1; - m_time = int20; - if (32767 < int20) { - m_time = 0; - } - return; -} - - - void CDecor::DrawInfo() { POINT pos; @@ -1566,7 +896,7 @@ void CDecor::DrawInfo() if (m_messages[i] != '\0') { pos.x = 10; pos.y = 10; - DrawText(m_pPixmap, pos, *m_messages[i], 0); + DrawText(m_pPixmap, pos, m_messages[i], 0); } } @@ -1574,7 +904,7 @@ void CDecor::DrawInfo() pos.x = -15; for (int i = 0; i < m_nbVies; i++) { pos.y = 417; - m_pPixmap->QuickIcon(GetStandardBlupiChannel(), 48, pos); + m_pPixmap->QuickIcon(GetBlupiChannelStandard(), 48, pos); pos.x += 16; } } @@ -1600,117 +930,115 @@ POINT CDecor::DecorNextAction() m_posDecor; } POINT posDecor = m_posDecor; - while (tables->table_decor_action[num] != 0) + while (table_decor_action[num] != 0) { - if (m_decorAction == tables->table_decor_action[num]) + if (m_decorAction == table_decor_action[num]) { + // more + } } } -void CDecor::TreatInput(UINT input) -{ - m_keyPress = input; - if (m_blupiInvert != 0) - { - if ((input & INPUT_LEFT) != 0) - { - m_keyPress = input & ~INPUT_LEFT | INPUT_RIGHT; - } - if ((input & INPUT_RIGHT) != 0) - { - m_keyPress = m_keyPress & ~INPUT_RIGHT | INPUT_LEFT; - } - } -} - -void CDecor::SetSpeedX(double speed) +void CDecor::TreatKeys(int keys) { + m_keyPress = keys; if (m_blupiInvert) { - speed = -speed; + if (keys & KEY_LEFT) + { + m_keyPress = keys & ~KEY_LEFT | KEY_RIGHT; + } + if (keys & KEY_RIGHT) + { + m_keyPress = m_keyPress & ~KEY_RIGHT | KEY_LEFT; + } } - m_blupiSpeedX = speed; } -void CDecor::SetSpeedY(double speed) +void CDecor::SetJoystickEnable(BOOL bJoystick) { - m_blupiSpeedY = speed; + m_bJoystick = bJoystick; +} + +void CDecor::SetFieldD814(BOOL param) +{ + m_bD814 = param; } int CDecor::SoundEnviron(int sound, int obstacle) { if ((obstacle >= 32 && obstacle <= 34) || (obstacle >= 41 && obstacle <= 47) || (obstacle >= 139 && obstacle <= 143)) { - if (sound == 4) + if (sound == SOUND_JUMPTOC) { return 79; } - if (sound == 3) + if (sound == SOUND_JUMPEND) { return 78; } } if ((obstacle >= 1 && obstacle <= 28) || (obstacle >= 78 && obstacle <= 90) || (obstacle >= 250 && obstacle <= 260) || (obstacle >= 311 && obstacle <= 316) || (obstacle >= 324 && obstacle <= 329)) { - if (sound == 4) + if (sound == SOUND_JUMPTOC) { return 81; } - if (sound == 3) + if (sound == SOUND_JUMPEND) { return 80; } } if ((obstacle >= 284 && obstacle <= 303) || obstacle == 338) { - if (sound == 4) + if (sound == SOUND_JUMPTOC) { return 83; } - if (sound == 3) + if (sound == SOUND_JUMPEND) { return 82; } } if (obstacle >= 341 && obstacle <= 363) { - if (sound == 4) + if (sound == SOUND_JUMPTOC) { return 85; } - if (sound == 3) + if (sound == SOUND_JUMPEND) { return 84; } } if (obstacle >= 215 && obstacle <= 234) { - if (sound == 4) + if (sound == SOUND_JUMPTOC) { return 87; } - if (sound == 3) + if (sound == SOUND_JUMPEND) { return 86; } } if (obstacle >= 246 && obstacle <= 249) { - if (sound == 4) + if (sound == SOUND_JUMPTOC) { return 89; } - if (sound == 3) + if (sound == SOUND_JUMPEND) { return 88; } } if (obstacle >= 107 && obstacle <= 109) { - if (sound == 4) + if (sound == SOUND_JUMPTOC) { return 91; } - if (sound == 3) + if (sound == SOUND_JUMPEND) { return 90; } @@ -1718,74 +1046,737 @@ int CDecor::SoundEnviron(int sound, int obstacle) return sound; } -void CDecor::PlaySound(int sound, POINT pos) +void CDecor::PlaySound(int sound, POINT pos, BOOL bLocal) { - { - if (m_blupiHide && (sound == 1 || sound == 2 || sound == 3 || sound == 4 || sound == 5 || sound == 6 || sound == 7 || sound == 20 || sound == 21 || sound == 22 || sound == 23 || sound == 24 || sound == 25 || sound == 27 || sound == 32 || sound == 34 || sound == 35 || sound == 36 || sound == 37 || sound == 38 || sound == 39 || sound == 40 || sound == 46 || sound == 47 || sound == 48 || sound == 49 || sound == 64 || sound == 65 || sound == 78 || sound == 79 || sound == 80 || sound == 81 || sound == 82 || sound == 83 || sound == 84 || sound == 85 || sound == 86 || sound == 87 || sound == 88 || sound == 89 || sound == 90 || sound == 91)) - { - return; - } - pos.x -= m_posDecor.y; - pos.y -= m_posDecor.y; - m_pSound->PlayImage(sound, pos); - } + if (!bLocal) NetPlaySound(sound, pos); + + m_pSound->PlayImage(sound, { pos.x - m_posDecor.x, pos.y - m_posDecor.y }, -1); + + switch (sound) { + case SOUND_HELICOHIGH: + m_bHelicoMarch = TRUE; + break; + case SOUND_HELICOLOW: + m_bHelicoStop = TRUE; + break; + case SOUND_JEEPHIGH: + m_bJeepMarch = TRUE; + break; + case SOUND_JEEPLOW: + m_bJeepStop = TRUE; + break; + } } -void CDecor::StopSound(CSound sound) +void CDecor::StopSound(int sound) { m_pSound->StopSound(sound); - if (sound == SOUND_16_HELICOHIGH) - { - m_bHelicopterFlying = FALSE; - } - if (sound == SOUND_18_HELICOLOW) - { - m_bHelicopterStationary = FALSE; - } - if (sound == SOUND_29_JEEPHIGH) - { - m_bCarMoving = FALSE; - } - if (sound == SOUND_31_JEEPLOW) - { - m_bCarStationary = FALSE; - } - return; + + switch (sound) { + case SOUND_HELICOHIGH: + m_bHelicoMarch = FALSE; + break; + case SOUND_HELICOLOW: + m_bHelicoStop = FALSE; + break; + case SOUND_JEEPHIGH: + m_bJeepMarch = FALSE; + break; + case SOUND_JEEPLOW: + m_bJeepStop = FALSE; + break; + } } -void CDecor::AdaptMotorVehicleSound() +void CDecor::AdaptMotorVehicleSound(POINT pos) { - POINT blupiPos = m_blupiPos; + POINT blupiPos = pos; blupiPos.x -= m_posDecor.x; blupiPos.y -= m_posDecor.y; - if (m_bHelicopterFlying != FALSE) + if (m_bHelicoMarch) { - m_pSound->PlayImage(16, blupiPos); + m_pSound->PlayImage(SOUND_HELICOHIGH, blupiPos); } - if (m_bHelicopterStationary != FALSE) + if (m_bHelicoStop) { - m_pSound->PlayImage(18, blupiPos); + m_pSound->PlayImage(SOUND_HELICOLOW, blupiPos); } - if (m_bCarMoving != FALSE) + if (m_bJeepMarch) { - m_pSound->PlayImage(29, blupiPos); + m_pSound->PlayImage(SOUND_JEEPHIGH, blupiPos); } - if (m_bCarStationary != FALSE) + if (m_bJeepStop) { - m_pSound->PlayImage(31, blupiPos); + m_pSound->PlayImage(SOUND_JEEPLOW, blupiPos); } return; } -// TODO: Add VehicleSoundsPhase +void CDecor::VehicleSoundsPhase(int phase) +{ + m_phase = phase; + + if (phase == WM_PHASE_PLAY || phase == WM_PHASE_PLAYTEST) { + int channel = -1; + if (m_bHelicoMarch) channel = SOUND_HELICOHIGH; + 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); + } + else { + if (m_bHelicoMarch) m_pSound->StopSound(SOUND_HELICOHIGH); + if (m_bHelicoStop) m_pSound->StopSound(SOUND_HELICOLOW); + if (m_bJeepMarch) m_pSound->StopSound(SOUND_JEEPHIGH); + if (m_bJeepStop) m_pSound->StopSound(SOUND_JEEPLOW); + } +} + +POINT CDecor::ScreenPosToCelPos(POINT pos) +{ + if (pos.x >= 0 && pos.x < LXIMAGE && pos.y >= 0 && pos.y < LYIMAGE) { + return { + (m_posDecor.x + m_dimCelHili.x * -32 + 32 + pos.x) / 64, + (m_posDecor.y + m_dimCelHili.y * -32 + 32 + pos.y) / 64 + }; + } + else return { -1, -1 }; +} + +void CDecor::SetCelPosFromScreenPos(POINT pos) +{ + m_posCelHili = ScreenPosToCelPos(pos); +} + +void CDecor::SetFieldCC38AndStuff(int _foo, int _bar) +{ + m_dimCelHili = { 1, 1 }; + if (_foo == 2 && _bar != 3 && _bar != 9 && _bar != 10) m_dimCelHili = { 2, 2 }; + if (_foo == 3) m_iconLift = _bar; + if (_foo == 4) m_iconLift = _bar + 20; + if (_foo == 5) m_iconLift = _bar + 40; + m_2ndPositionCalculationSlot = -1; +} + +void CDecor::DeleteCel(POINT cel) +{ + m_2ndPositionCalculationSlot = -1; + + if (!IsValidCel(cel)) return; + + m_decor[cel.x][cel.y].icon = -1; + AdaptBorder(cel); + m_bigDecor[cel.x][cel.y].icon = -1; + MoveObjectDelete(cel); +} + +void CDecor::PlaceMenuItem(short *pCel, int *pTable, int lastIndex, BYTE flags, int currentIcon, BOOL bRand) +{ + if (bRand) { + *pCel = pTable[rand() % (pTable[0] + 1)]; + } + else if (!flags & 8) { + if (flags & 1) { + lastIndex++; + if (*pCel == pTable[lastIndex] && currentIcon != 0 && pTable[0] <= lastIndex) { + lastIndex = 0; + } + *pCel = pTable[lastIndex + 1]; + } + } + else { + *pCel = pTable[lastIndex + 1]; + } +} + +void CDecor::PlaceItemFromMenu1(POINT cel, int index, BYTE flags, int currentIcon) +{ + m_2ndPositionCalculationSlot = -1; + + short *pIcon = &m_decor[cel.x][cel.y].icon; + short *pIconBig = &m_bigDecor[cel.x][cel.y].icon; + + if (!IsValidCel(cel)) return; + + switch (index) { + case 0: // Tree + PlaceMenuItem(pIconBig, table_366b0, m_lastDecorIndexes[0], flags, *pIconBig, TRUE); + break; + case 1: // Palmtree + PlaceMenuItem(pIconBig, table_366c0, m_lastDecorIndexes[1], flags, *pIconBig, TRUE); + break; + case 2: // Decorative plant + PlaceMenuItem(pIconBig, table_366d8, m_lastDecorIndexes[2], flags, *pIconBig, TRUE); + break; + case 3: // Marine plant + *pIcon = Object::Marine_1; + break; + case 4: // House + PlaceMenuItem(pIconBig, table_366e8, m_lastDecorIndexes[3], flags, *pIconBig, TRUE); + break; + case 5: // Mechanical background + PlaceMenuItem(pIconBig, table_366f8, m_lastDecorIndexes[4], flags, *pIconBig, TRUE); + break; + case 6: // Kid's stuff background + PlaceMenuItem(pIconBig, table_36710, m_lastDecorIndexes[5], flags, *pIconBig, TRUE); + break; + case 7: // Green slime 2 + PlaceMenuItem(pIconBig, table_36748, m_lastDecorIndexes[6], flags, *pIconBig, TRUE); + break; + case 8: // Element for Palace + PlaceMenuItem(pIconBig, table_36520, m_lastDecorIndexes[7], flags, *pIconBig, TRUE); + break; + case 9: // Support + PlaceMenuItem(pIcon, table_36670, m_lastDecorIndexes[8], flags, *pIcon, TRUE); + break; + case 10: // Spider's web + PlaceMenuItem(pIcon, table_366a0, m_lastDecorIndexes[9], flags, *pIcon, TRUE); + break; + } +} + +void CDecor::PlaceItemFromMenu2(POINT cel, int index, BYTE flags, int currentIcon) +{ + m_2ndPositionCalculationSlot = -1; + + short *pIcon = &m_decor[cel.x][cel.y].icon; + + if (!IsValidCel(cel)) return; + + m_iconLift = index; + + switch (index) { + case 0: // Square tech-blocks + PlaceMenuItem(pIcon, table_36418, m_lastDecorIndexes[10], flags, *pIcon, TRUE); + break; + case 1: // Special tech-blocks + PlaceMenuItem(pIcon, table_36458, m_lastDecorIndexes[11], flags, *pIcon, TRUE); + break; + case 2: // Triangular tech-blocks + PlaceMenuItem(pIcon, table_36488, m_lastDecorIndexes[12], flags, *pIcon, FALSE); + break; + case 3: // Secret tech-block + PlaceMenuItem(pIcon, table_364a0, m_lastDecorIndexes[13], flags, *pIcon, FALSE); + break; + case 4: // Mechanical square + PlaceMenuItem(pIcon, table_364b0, m_lastDecorIndexes[14], flags, *pIcon, TRUE); + break; + case 5: // Special mechanical + PlaceMenuItem(pIcon, table_364d0, m_lastDecorIndexes[15], flags, *pIcon, FALSE); + break; + case 6: // Secret mechanical + PlaceMenuItem(pIcon, table_364e8, m_lastDecorIndexes[16], flags, *pIcon, FALSE); + break; + case 7: // Pipes + *pIcon = Object::Pipes_1; + break; + } + AdaptBorder(cel); +} + +void CDecor::PlaceItemFromMenu3(POINT cel, int index, BYTE flags, int currentIcon) +{ + m_2ndPositionCalculationSlot = -1; + + short *pIcon = &m_decor[cel.x][cel.y].icon; + + if (!IsValidCel(cel)) return; + + m_iconLift = index + 20; + + switch (index) { + case 0: // Square rock + PlaceMenuItem(pIcon, table_36530, m_lastDecorIndexes[20], flags, *pIcon, FALSE); + break; + case 1: // Triangular rock + PlaceMenuItem(pIcon, table_36538, m_lastDecorIndexes[21], flags, *pIcon, FALSE); + break; + case 2: // Secret rock + PlaceMenuItem(pIcon, table_36548, m_lastDecorIndexes[22], flags, *pIcon, FALSE); + break; + case 3: // Cave + // todo + break; + case 4: // Secret cave + *pIcon = Object::CaveSecret; + break; + case 5: // Cheese + *pIcon = Random(Object::CheeseSquare_1, Object::CheeseSquare_4); + break; + case 6: // Secret cheese + *pIcon = Object::CheeseSecret; + break; + case 7: // Green slime 2 + *pIcon = Object::Slime_1; + break; + case 8: // Grass + PlaceMenuItem(pIcon, table_365d0, m_lastDecorIndexes[23], flags, *pIcon, FALSE); + break; + case 9: // Water + PlaceMenuItem(pIcon, table_36630, m_lastDecorIndexes[24], flags, *pIcon, FALSE); + break; + } + AdaptBorder(cel); +} + +void CDecor::PlaceItemFromMenu4(POINT cel, int index, BYTE flags, int currentIcon) +{ + m_2ndPositionCalculationSlot = -1; + + short *pIcon = &m_decor[cel.x][cel.y].icon; + + if (!IsValidCel(cel)) return; + + m_iconLift = index + 40; + + switch (index) { + case 0: // Palace + break; + case 1: // Element for Palace + break; + case 2: // Building facade + break; + case 3: // Roof + break; + case 4: // Bricks + break; + case 5: // Furniture + break; + case 6: // Wooden wall + break; + case 7: // Kid's stuff square + break; + case 8: // Special Kid's stuff + break; + case 9: // Invisible block + break; + } + AdaptBorder(cel); +} + +void CDecor::PlaceItemFromMenu5(POINT cel, int index, BYTE flags, int currentIcon) +{ + m_2ndPositionCalculationSlot = -1; + + int mobId; + MoveObject* pMob; + + short *pIcon = &m_decor[cel.x][cel.y].icon; + + if (!IsValidCel(cel)) return; + + switch (index) { + case 0: // Bomb + MoveObjectDelete(cel); + mobId = MoveObjectFree(); + if (mobId == -1) return; + pMob = &m_moveObject[mobId]; + pMob->type = TYPE_BOMBEDOWN; + pMob->stepAdvance = 1; + pMob->stepRecede = 1; + pMob->timeStopStart = 0; + pMob->timeStopEnd = 0; + pMob->posStart = { cel.x * 64 + 2, cel.y * 64 + 4 }; + pMob->posEnd = pMob->posStart; + pMob->posCurrent = pMob->posStart; + pMob->step = STEP_STOPSTART; + pMob->time = 0; + pMob->phase = 0; + pMob->channel = CHELEMENT; + pMob->icon = 0x0c; + break; + case 1: // Hanging bomb + MoveObjectDelete(cel); + mobId = MoveObjectFree(); + if (mobId == -1) return; + pMob = &m_moveObject[mobId]; + pMob->type = TYPE_BOMBEUP; + pMob->stepAdvance = 1; + pMob->stepRecede = 1; + pMob->timeStopStart = 0; + pMob->timeStopEnd = 0; + pMob->posStart = { cel.x * 64 + 2, cel.y * 64 }; + pMob->posEnd = pMob->posStart; + pMob->posCurrent = pMob->posStart; + pMob->step = STEP_STOPSTART; + pMob->time = 0; + pMob->phase = 0; + pMob->channel = CHELEMENT; + pMob->icon = 0x30; + break; + case 2: // Homing bomb + MoveObjectDelete(cel); + mobId = MoveObjectFree(); + if (mobId == -1) return; + pMob = &m_moveObject[mobId]; + pMob->type = TYPE_BOMBEFOLLOW1; + pMob->stepAdvance = 1; + pMob->stepRecede = 1; + pMob->timeStopStart = 0; + pMob->timeStopEnd = 0; + pMob->posStart = { cel.x * 64, cel.y * 64 }; + pMob->posEnd = pMob->posStart; + pMob->posCurrent = pMob->posStart; + pMob->step = STEP_STOPSTART; + pMob->time = 0; + pMob->phase = 0; + pMob->channel = CHELEMENT; + pMob->icon = 0x100; + break; + case 3: // Lava + PlaceMenuItem(pIcon, table_decor_lave, m_lastDecorIndexes[40], flags, *pIcon, FALSE); + break; + case 4: // Fan + PlaceMenuItem(pIcon, table_decor_ventillog, m_lastDecorIndexes[41], flags, *pIcon, FALSE); + break; + case 5: // Wind + PlaceMenuItem(pIcon, table_decor_ventg, m_lastDecorIndexes[42], flags, *pIcon, FALSE); + break; + case 6: // Slime trap (floor) + *pIcon = Object::SlimeTrapFloor_1; + break; + case 7: // Slime trap (ceiling) + *pIcon = Object::SlimeTrapCeiling_1; + break; + case 8: // Circular saw + PlaceMenuItem(pIcon, table_decor_scie, m_lastDecorIndexes[43], flags, *pIcon, FALSE); + break; + case 9: // Inverter + MoveObjectDelete(cel); + mobId = MoveObjectFree(); + if (mobId == -1) return; + pMob = &m_moveObject[mobId]; + pMob->type = TYPE_INVERT; + pMob->stepAdvance = 1; + pMob->stepRecede = 1; + pMob->timeStopStart = 0; + pMob->timeStopEnd = 0; + pMob->posStart = { cel.x * 64 + 2, cel.y * 64 + 8 }; + pMob->posEnd = pMob->posStart; + pMob->posCurrent = pMob->posStart; + pMob->step = STEP_STOPSTART; + pMob->time = 0; + pMob->phase = 0; + pMob->channel = CHELEMENT; + pMob->icon = 0xBB; + break; + case 10: // Lightning + *pIcon = Object::LightningMachine; + break; + case 11: // Crusher + *pIcon = Object::Crusher_1; + break; + } + AdaptBorder(cel); +} + +void CDecor::PlaceItemFromMenu6(POINT cel, int index, BYTE flags, int currentIcon) +{ + m_2ndPositionCalculationSlot = -1; + + short *pIcon = &m_decor[cel.x][cel.y].icon; + + if (!IsValidCel(cel) || currentIcon == 0) return; + + switch (m_iconLift) { + + } + + switch (index) { + case 0: // Slow lift + case 1: // Normal lift + case 2: // Fast lift + case 3: // Fast/Slow lift + case 4: // Lift with conveyor belt + case 5: // Bulldozer + case 6: // Fish + case 7: // Bird + case 8: // Wasp + case 9: // Slime creature + case 10: // Moving bomb + case 11: // Heliported ennemy + case 12: // Motorized ennemy + } +} + +void CDecor::PlaceItemFromMenu7(POINT cel, int index, BYTE flags, int currentIcon) +{ + m_2ndPositionCalculationSlot = -1; + + MoveObject* pMob; + int mobId; + + short *pIcon = &m_decor[cel.x][cel.y].icon; + + if (!IsValidCel(cel)) return; + + switch (index) { + case 0: // Chest + MoveObjectDelete(cel); + mobId = MoveObjectFree(); + if (mobId == -1) return; + pMob = &m_moveObject[mobId]; + pMob->type = TYPE_TRESOR; + pMob->stepAdvance = 1; + pMob->stepRecede = 1; + pMob->timeStopStart = 0; + pMob->timeStopEnd = 0; + pMob->posStart = { cel.x * 64 + 2, cel.y * 64 + 4 }; + pMob->posEnd = pMob->posStart; + pMob->posCurrent = pMob->posStart; + pMob->step = STEP_STOPSTART; + pMob->time = 0; + pMob->phase = 0; + pMob->channel = CHELEMENT; + pMob->icon = 0x00; + break; + case 1: // Egg + MoveObjectDelete(cel); + mobId = MoveObjectFree(); + if (mobId == -1) return; + pMob = &m_moveObject[mobId]; + pMob->type = TYPE_EGG; + pMob->stepAdvance = 1; + pMob->stepRecede = 1; + pMob->timeStopStart = 0; + pMob->timeStopEnd = 0; + pMob->posStart = { cel.x * 64 + 2, cel.y * 64 + 8 }; + pMob->posEnd = pMob->posStart; + pMob->posCurrent = pMob->posStart; + pMob->step = STEP_STOPSTART; + pMob->time = 0; + pMob->phase = 0; + pMob->channel = CHELEMENT; + pMob->icon = 0x15; + break; + case 2: // Lollipop + MoveObjectDelete(cel); + mobId = MoveObjectFree(); + if (mobId == -1) return; + pMob = &m_moveObject[mobId]; + pMob->type = TYPE_POWER; + pMob->stepAdvance = 1; + pMob->stepRecede = 1; + pMob->timeStopStart = 0; + pMob->timeStopEnd = 0; + pMob->posStart = { cel.x * 64 + 2, cel.y * 64 + 8 }; + pMob->posEnd = pMob->posStart; + pMob->posCurrent = pMob->posStart; + pMob->step = STEP_STOPSTART; + pMob->time = 0; + pMob->phase = 0; + pMob->channel = CHELEMENT; + pMob->icon = 0x88; + break; + case 3: // Shield + MoveObjectDelete(cel); + mobId = MoveObjectFree(); + if (mobId == -1) return; + pMob = &m_moveObject[mobId]; + pMob->type = TYPE_SHIELD; + pMob->stepAdvance = 1; + pMob->stepRecede = 1; + pMob->timeStopStart = 0; + pMob->timeStopEnd = 0; + pMob->posStart = { cel.x * 64 + 2, cel.y * 64 + 8 }; + pMob->posEnd = pMob->posStart; + pMob->posCurrent = pMob->posStart; + pMob->step = STEP_STOPSTART; + pMob->time = 0; + pMob->phase = 0; + pMob->channel = CHELEMENT; + pMob->icon = 0x90; + break; + case 4: // Invisibility potion + MoveObjectDelete(cel); + mobId = MoveObjectFree(); + if (mobId == -1) return; + pMob = &m_moveObject[mobId]; + pMob->type = TYPE_DRINK; + pMob->stepAdvance = 1; + pMob->stepRecede = 1; + pMob->timeStopStart = 0; + pMob->timeStopEnd = 0; + pMob->posStart = { cel.x * 64 + 2, cel.y * 64 + 6 }; + pMob->posEnd = pMob->posStart; + pMob->posCurrent = pMob->posStart; + pMob->step = STEP_STOPSTART; + pMob->time = 0; + pMob->phase = 0; + pMob->channel = CHELEMENT; + pMob->icon = 0xB2; + break; + case 5: // Glue supply + MoveObjectDelete(cel); + mobId = MoveObjectFree(); + if (mobId == -1) return; + pMob = &m_moveObject[mobId]; + pMob->type = TYPE_BULLET; + pMob->stepAdvance = 1; + pMob->stepRecede = 1; + pMob->timeStopStart = 0; + pMob->timeStopEnd = 0; + pMob->posStart = { cel.x * 64 + 2, cel.y * 64 + 4 }; + pMob->posEnd = pMob->posStart; + pMob->posCurrent = pMob->posStart; + pMob->step = STEP_STOPSTART; + pMob->time = 0; + pMob->phase = 0; + pMob->channel = CHELEMENT; + pMob->icon = 0xB1; + break; + case 6: // Recharging device + MoveObjectDelete(cel); + mobId = MoveObjectFree(); + if (mobId == -1) return; + pMob = &m_moveObject[mobId]; + pMob->type = TYPE_CHARGE; + pMob->stepAdvance = 1; + pMob->stepRecede = 1; + pMob->timeStopStart = 0; + pMob->timeStopEnd = 0; + pMob->posStart = { cel.x * 64 + 2, cel.y * 64 + 4 }; + pMob->posEnd = pMob->posStart; + pMob->posCurrent = pMob->posStart; + pMob->step = STEP_STOPSTART; + pMob->time = 0; + pMob->phase = 0; + pMob->channel = CHELEMENT; + pMob->icon = 0xEE; + break; + case 7: // Personal bomb + int type; + mobId = MoveObjectSearch(cel, -1); + if (mobId != -1 && currentIcon != 0) { + if (mobId >= TYPE_BOMBEPERSO4) { + m_lastDecorIndexes[60] = 0; + } + else { + m_lastDecorIndexes[60] = m_moveObject[mobId].type - TYPE_BOMBEPERSO1; + } + } + type = m_lastDecorIndexes[60] + TYPE_BOMBEPERSO1; + MoveObjectDelete(cel); + mobId = MoveObjectFree(); + if (mobId == -1) return; + pMob = &m_moveObject[mobId]; + pMob->type = type; + pMob->stepAdvance = 1; + pMob->stepRecede = 1; + pMob->timeStopStart = 0; + pMob->timeStopEnd = 0; + pMob->posStart = { cel.x * 64 + 2, cel.y * 64 + 6 }; + pMob->posEnd = pMob->posStart; + pMob->posCurrent = pMob->posStart; + pMob->step = STEP_STOPSTART; + pMob->time = 0; + pMob->phase = 0; + switch (type) { + default: + case TYPE_BOMBEPERSO1: + pMob->channel = CHBLUPI; + break; + case TYPE_BOMBEPERSO2: + pMob->channel = CHBLUPI1; + break; + case TYPE_BOMBEPERSO3: + pMob->channel = CHBLUPI2; + break; + case TYPE_BOMBEPERSO4: + pMob->channel = CHBLUPI3; + break; + } + pMob->icon = 0x101; + break; + case 8: // Dynamite + MoveObjectDelete(cel); + mobId = MoveObjectFree(); + if (mobId == -1) return; + pMob = &m_moveObject[mobId]; + pMob->type = TYPE_DYNAMITE; + pMob->stepAdvance = 1; + pMob->stepRecede = 1; + pMob->timeStopStart = 0; + pMob->timeStopEnd = 0; + pMob->posStart = { cel.x * 64 + 2, cel.y * 64 + 6 }; + pMob->posEnd = pMob->posStart; + pMob->posCurrent = pMob->posStart; + pMob->step = STEP_STOPSTART; + pMob->time = 0; + pMob->phase = 0; + pMob->channel = CHELEMENT; + pMob->icon = 0xFC; + break; + } + AdaptBorder(cel); +} + +void CDecor::PlaceItemFromMenu8(POINT cel, int index, BYTE flags, int currentIcon) +{ + m_2ndPositionCalculationSlot = -1; + + short *pIcon = &m_decor[cel.x][cel.y].icon; + + if (!IsValidCel(cel)) return; + + switch (index) { + case 0: // Key + case 1: // Door + case 2: // Closed while not all chests have been found + case 3: // Teleporter + case 4: // Bar to hang from + case 5: // Spring + case 6: // Vanishing bloc + case 7: // Fragile bridge + case 8: // Wooden case + case 9: // Secret wooden case + } +} + +void CDecor::PlaceItemFromMenu9(POINT cel, int index, BYTE flags, int currentIcon) +{ + m_2ndPositionCalculationSlot = -1; + + short *pIcon = &m_decor[cel.x][cel.y].icon; + + if (!IsValidCel(cel)) return; + + switch (index) { + case 0: // Hovercraft + case 1: // Helicopter + case 2: // Skateboard + case 3: // Jeep + case 4: // Glue tank + } +} + +void CDecor::PlaceItemFromMenu10(POINT cel, int index, BYTE flags, int currentIcon) +{ + m_2ndPositionCalculationSlot = -1; + + short *pIcon = &m_decor[cel.x][cel.y].icon; + + if (!IsValidCel(cel)) return; + + switch (index) { + case 0: // Goal + case 1: // Yellow Blupi + case 2: // Orange Blupi + case 3: // Blue Blupi + case 4: // Green Blupi + case 5: // Door + case 6: // Level start + case 7: // Key + } +} void CDecor::UpdateCaisse() { m_nbRankCaisse = 0; for (int i = 0; i < MAXMOVEOBJECT; i++) { - if (m_moveObject[i]->type == 12) + if (m_moveObject[i].type == TYPE_CAISSE) { m_rankCaisse[m_nbRankCaisse++] = i; } @@ -1796,10 +1787,10 @@ BOOL CDecor::TestPushCaisse(int i, POINT pos, BOOL bPop) { POINT move; - move.x = pos.x - m_moveObject[i]->posCurrent.x; + move.x = pos.x - m_moveObject[i].posCurrent.x; move.y = 0; SearchLinkCaisse(i, bPop); - int y = m_moveObject[i]->posCurrent.y; + int y = m_moveObject[i].posCurrent.y; for (int j = 0; j < m_nbLinkCaisse; j++) { i = m_linkCaisse[j]; @@ -1810,12 +1801,12 @@ BOOL CDecor::TestPushCaisse(int i, POINT pos, BOOL bPop) } for (int j = 0; j < m_nbLinkCaisse; j++) { - i = m_linkCaisse; + i = m_linkCaisse[j]; int num = i; - m_moveObject[num]->posCurrent.x = m_moveObject[num]->posCurrent.x + move.x; - m_moveObject[num]->posStart.x = m_moveObject[num]->posStart.x + move.x; + m_moveObject[num].posCurrent.x = m_moveObject[num].posCurrent.x + move.x; + m_moveObject[num].posStart.x = m_moveObject[num].posStart.x + move.x; int num2 = i; - m_moveObject[num]->posEnd.x = m_moveObject[num]->posEnd.x + move.x; + m_moveObject[num].posEnd.x = m_moveObject[num].posEnd.x + move.x; } return TRUE; } @@ -1829,7 +1820,7 @@ void CDecor::SearchLinkCaisse(int rank, BOOL bPop) { m_nbLinkCaisse = 0; AddLinkCaisse(rank); - POINT posCurrent = m_moveObject; + POINT posCurrent = m_moveObject[0].posCurrent; BOOL flag; do @@ -1838,10 +1829,10 @@ void CDecor::SearchLinkCaisse(int rank, BOOL bPop) for (int i = 0; i < m_nbLinkCaisse; i++) { int num = m_linkCaisse[i]; - if (m_moveObject[num]->posCurrent.y <= + if (m_moveObject[num].posCurrent.y <= posCurrent.y && (!bPop || (m_moveObject - [num]->posCurrent.x >= posCurrent.x - 32 && - m_moveObject[num]->posCurrent.x <= + [num].posCurrent.x >= posCurrent.x - 32 && + m_moveObject[num].posCurrent.x <= posCurrent.x + 32))) { @@ -1885,27 +1876,24 @@ void CDecor::SetMusic(int music) m_music = music; } -void CDecor::GetDims(POINT* ptr) +POINT CDecor::GetDim() { - ptr->x = m_dimDecor.x; - ptr->y = m_dimDecor.y; - return; + return m_dimDecor; } -void CDecor::SetDims(POINT dims) +void CDecor::SetDim(POINT dim) { - m_dimDecor.x = dims.x; - m_dimDecor.y = dims.y; + m_dimDecor = dim; } int CDecor::GetNbVies() { - return m_nbVies; + return m_nbVies; } -void CDecor::SetNbVies(int lives) +void CDecor::SetNbVies(int nbVies) { - m_nbVies = lives; + m_nbVies = nbVies; } BOOL CDecor::GetPause() @@ -1919,37 +1907,37 @@ void CDecor::SetPause(BOOL bPause) } -void CDecor::GetDoors(int doors) +void CDecor::InitializeDoors(GameData *gameData) { - for (int i = 0; i < m_doors; i++) + for (int i = 0; i < MAXMOVEOBJECT; i++) { - doors[i] = (int) + gameData[i] = m_doors[i]; } } -void CDecor::SetAllMissions(BOOL CheatDoors) +void CDecor::SetAllMissions(BOOL bAllMissions) { - m_bCheatDoors = CheatDoors; - m_bPrivate, m_mission->AdaptDoors; + m_bCheatDoors = bAllMissions; + AdaptDoors(m_bPrivate, m_mission); return; } -void CDecor::CheatAction(int cheat, MoveObject moveObject) +void CDecor::CheatAction(int cheat) { - if (cheat == cheat_cleanall) + if (cheat == 2) // cleanall { for (int i = 0; i < MAXMOVEOBJECT; i++) { - if (m_moveObject[i]->type == 2 || m_moveObject[i]->type == 3 || m_moveObject[i]->type == 96 || - m_moveObject[i]->type == 97 || m_moveObject[i]->type == 4 || m_moveObject[i]->type == 16 || - m_moveObject[i]->type == 17 || m_moveObject[i]->type == 20 || m_moveObject[i]->type == 44 || - m_moveObject[i]->type == 54 || m_moveObject[i]->type == 32 || m_moveObject[i]->type == 33) + if (m_moveObject[i].type == 2 || m_moveObject[i].type == 3 || m_moveObject[i].type == 96 || + m_moveObject[i].type == 97 || m_moveObject[i].type == 4 || m_moveObject[i].type == 16 || + m_moveObject[i].type == 17 || m_moveObject[i].type == 20 || m_moveObject[i].type == 44 || + m_moveObject[i].type == 54 || m_moveObject[i].type == 32 || m_moveObject[i].type == 33) { m_decorAction = 1; m_decorPhase = 0; - m_moveObject[i]->type = 8; - m_moveObject[i]->phase = 0; + m_moveObject[i].type = 8; + m_moveObject[i].phase = 0; MoveObject[] moveObject = m_moveObject; int num = i; @@ -1957,15 +1945,15 @@ void CDecor::CheatAction(int cheat, MoveObject moveObject) MoveObject[] moveObject2 = m_moveObject; int num2 = i; moveObject2[num2]->posCurrent.y = moveObject2[num2].posCurrent.y - 34; - m_moveObject[i]->posStart = m_moveObject[i]->posCurrent; - m_moveObject[i]->posEnd = m_moveObject[i]->posCurrent; + m_moveObject[i].posStart = m_moveObject[i].posCurrent; + m_moveObject[i].posEnd = m_moveObject[i].posCurrent; MoveObjectStepIcon(i); - PlaySound(10, m_moveObject[i]->posCurrent); + PlaySound(10, m_moveObject[i].posCurrent); } } } - if (cheat == cheat_funskate) + if (cheat == 6) // funskate { m_blupiAir = FALSE; m_blupiHelico = FALSE; @@ -1982,7 +1970,7 @@ void CDecor::CheatAction(int cheat, MoveObject moveObject) StopSound(29); StopSound(31); } - if (cheat == cheat_givecopter) + if (cheat == 7) // givecopter { m_blupiAir = FALSE; m_blupiHelico = TRUE; @@ -1995,7 +1983,7 @@ void CDecor::CheatAction(int cheat, MoveObject moveObject) m_blupiVent = FALSE; m_blupiSuspend = FALSE; } - if (cheat == cheat_jeepdrive) + if (cheat == 8) // jeepdrive { m_blupiAir = FALSE; m_blupiHelico = FALSE; @@ -2008,29 +1996,29 @@ void CDecor::CheatAction(int cheat, MoveObject moveObject) m_blupiVent = FALSE; m_blupiSuspend = FALSE; } - if (cheat == cheat_alltreasure) - { - for (int i = 0; i < MOVEOBJECT; i++) - { - if (m_moveObject[i]->type == 5) - { - m_moveObject[i]->type == 0; - m_nbTresor++; - OpenDoorsTresor(); - PlaySound(11, m_moveObject[i]->posCurrent); - } - } - } - if (cheat == cheat_endgoal) + if (cheat == 9) // alltreasure { for (int i = 0; i < MAXMOVEOBJECT; i++) { - if (m_moveObject[i]->type == 7 || m_moveObject[i]->type == 21) + if (m_moveObject[i].type == 5) { - m_blupiPos = m_moveObject[i]->posCurrent; + m_moveObject[i].type == 0; + m_nbTresor++; + OpenDoorsTresor(); + PlaySound(11, m_moveObject[i].posCurrent); + } + } + } + if (cheat == 10) // endgoal + { + for (int i = 0; i < MAXMOVEOBJECT; i++) + { + if (m_moveObject[i].type == 7 || m_moveObject[i].type == 21) + { + m_blupiPos = m_moveObject[i].posCurrent; if (m_nbTresor >= m_totalTresor) { - if (m_moveObject[i]->type == 21) + if (m_moveObject[i].type == 21) { m_bFoundCle = TRUE; } @@ -2063,13 +2051,13 @@ void CDecor::CheatAction(int cheat, MoveObject moveObject) } else { - (m_moveObject[i]->posCurrent)->PlaySound(13); + PlaySound(13, m_moveObject[i].posCurrent); } m_goalPhase = 50; } } } - if (cheat == cheat_roundshield) + if (cheat == 12) // roundshield { PlaySound(42, m_blupiPos); m_blupiShield = TRUE; @@ -2078,9 +2066,9 @@ void CDecor::CheatAction(int cheat, MoveObject moveObject) m_blupiHide = FALSE; m_blupiTimeShield = 100; m_blupiPosMagic = m_blupiPos; - m_jauges[1]->SetHide(FALSE); + m_jauges[1].SetHide(FALSE); } - if (cheat == cheat_quicklollipop) + if (cheat == 13) // quicklollipop { m_blupiAction = 49; m_blupiPhase = 0; @@ -2096,16 +2084,16 @@ void CDecor::CheatAction(int cheat, MoveObject moveObject) m_blupiFocus = FALSE; PlaySound(50, m_blupiPos); } - if (cheat == cheat_tenbombs) + if (cheat == 14) // tenbombs { m_blupiPerso = 10; PlaySound(60, m_blupiPos); } - if (cheat == cheat_birdlime) + if (cheat == 15) // birdlime { m_blupiBullet = 10; } - if (cheat == cheat_drivetank) + if (cheat == 16) // drivetank { m_blupiAir = FALSE; m_blupiHelico = FALSE; @@ -2120,7 +2108,7 @@ void CDecor::CheatAction(int cheat, MoveObject moveObject) m_blupiCloud = FALSE; m_blupiHide = FALSE; } - if (cheat == cheat_powercharge) + if (cheat == 17) // powercharge { m_blupiAction = 56; m_blupiPhase = 0; @@ -2137,7 +2125,7 @@ void CDecor::CheatAction(int cheat, MoveObject moveObject) m_blupiFocus = FALSE; PlaySound(58, m_blupiPos); } - if (cheat == cheat_hidedrink) + if (cheat == 18) // hidedrink { m_blupiAction = 55; m_blupiPhase = 0; @@ -2154,7 +2142,7 @@ void CDecor::CheatAction(int cheat, MoveObject moveObject) m_blupiFocus = FALSE; PlaySound(57, m_blupiPos); } - if (cheat == cheat_iovercraft) + if (cheat == 22) // iovercraft { m_blupiAir = FALSE; m_blupiHelico = FALSE; @@ -2167,18 +2155,18 @@ void CDecor::CheatAction(int cheat, MoveObject moveObject) m_blupiVent = FALSE; m_blupiSuspend = FALSE; } - if (cheat == cheat_dynamite) + if (cheat == 23) // udynamite { m_blupiDynamite = 1; PlaySound(60, m_blupiPos); } - if (cheat == cheat_wellkeys) + if (cheat == 24) // wellkeys { m_blupiCle |= 7; } if (m_blupiShield && m_blupiHide && m_blupiCloud && m_blupiPower) { - m_jauges[1]->SetHide(TRUE); + m_jauges[1].SetHide(TRUE); } if (m_blupiHelico && m_blupiOver) { @@ -2192,7 +2180,6 @@ void CDecor::CheatAction(int cheat, MoveObject moveObject) } } -/* void CDecor::BlupiStep() { POINT tinyPoint; @@ -2279,7 +2266,7 @@ void CDecor::BlupiStep() m_blupiAction = 5; m_blupiPhase = 0; } - m_blupiVitesseY = 1.0; + m_blupiVitesse.y = 1.0; m_blupiAir = true; flag = true; } @@ -2289,8 +2276,8 @@ void CDecor::BlupiStep() { m_blupiHelico = false; m_blupiOver = false; - tinyPoint.X = tinyPoint3.X - 34; - tinyPoint.Y = tinyPoint3.Y - 34; + tinyPoint.x = tinyPoint3.x - 34; + tinyPoint.y = tinyPoint3.y - 34; ObjectStart(tinyPoint, 9, 0); m_decorAction = 1; m_decorPhase = 0; @@ -2303,8 +2290,8 @@ void CDecor::BlupiStep() if (m_blupiJeep && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi) { m_blupiJeep = false; - tinyPoint.X = tinyPoint3.X - 34; - tinyPoint.Y = tinyPoint3.Y - 34; + tinyPoint.x = tinyPoint3.x - 34; + tinyPoint.y = tinyPoint3.y - 34; ObjectStart(tinyPoint, 9, 0); m_decorAction = 1; m_decorPhase = 0; @@ -2317,8 +2304,8 @@ void CDecor::BlupiStep() if (m_blupiTank && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi) { m_blupiTank = false; - tinyPoint.X = tinyPoint3.X - 34; - tinyPoint.Y = tinyPoint3.Y - 34; + tinyPoint.x = tinyPoint3.x - 34; + tinyPoint.y = tinyPoint3.y - 34; ObjectStart(tinyPoint, 9, 0); m_decorAction = 1; m_decorPhase = 0; @@ -2331,8 +2318,8 @@ void CDecor::BlupiStep() if (m_blupiSkate && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi) { m_blupiSkate = false; - tinyPoint.X = tinyPoint3.X - 34; - tinyPoint.Y = tinyPoint3.Y - 34; + tinyPoint.x = tinyPoint3.x - 34; + tinyPoint.y = tinyPoint3.y - 34; ObjectStart(tinyPoint, 9, 0); m_decorAction = 1; m_decorPhase = 0; @@ -2349,11 +2336,11 @@ void CDecor::BlupiStep() } if ((m_keyPress & 1) != 0 && m_blupiFocus) { - m_blupiVitesseY = (double)(m_blupiPower ? -25 : -19); + m_blupiVitesse.y = (m_blupiPower ? -25 : -19); } else { - m_blupiVitesseY = (double)(m_blupiPower ? -16 : -10); + m_blupiVitesse.y = (m_blupiPower ? -16 : -10); } m_blupiAir = true; flag = true; @@ -2373,18 +2360,18 @@ void CDecor::BlupiStep() if (m_blupiSkate) { PlaySound(1, tinyPoint3); - m_blupiVitesseY = (double)(m_blupiPower ? -17 : -13); + m_blupiVitesse.y = (m_blupiPower ? -17 : -13); } else { PlaySound(1, tinyPoint3); if (IsNormalJump(tinyPoint3)) { - m_blupiVitesseY = (double)(m_blupiPower ? -26 : -16); + m_blupiVitesse.y = (m_blupiPower ? -26 : -16); } else { - m_blupiVitesseY = (double)(m_blupiPower ? -16 : -12); + m_blupiVitesse.y = (m_blupiPower ? -16 : -12); } } m_blupiAir = true; @@ -2393,9 +2380,9 @@ void CDecor::BlupiStep() } if (m_blupiAir) { - if (flag5 && m_blupiVitesseY < 0.0) + if (flag5 && m_blupiVitesse.y < 0) { - if (m_blupiVitesseY < -14.0 && m_blupiAction != 11 && m_blupiAction != 75 && m_blupiAction != 76 && m_blupiAction != 77 && m_blupiAction != 78 && m_blupiAction != 79 && m_blupiAction != 80 && m_blupiAction != 81 && !m_blupiSkate) + if (m_blupiVitesse.y < -14.0 && m_blupiAction != 11 && m_blupiAction != 75 && m_blupiAction != 76 && m_blupiAction != 77 && m_blupiAction != 78 && m_blupiAction != 79 && m_blupiAction != 80 && m_blupiAction != 81 && !m_blupiSkate) { m_blupiJumpAie = true; PlaySound(40, tinyPoint3); @@ -2404,26 +2391,26 @@ void CDecor::BlupiStep() { PlaySound(SoundEnviron(4, detectIcon), tinyPoint3); } - m_blupiVitesseY = 1.0; + m_blupiVitesse.y = 1.0; } - tinyPoint3.Y += (int)(m_blupiVitesseY * 2.0); - if (m_blupiVitesseY < 20.0) + tinyPoint3.y += (int)(m_blupiVitesse.y * 2.0); + if (m_blupiVitesse.y < 20.0) { - m_blupiVitesseY += 2.0; + m_blupiVitesse.y += 2.0; } rect = BlupiRect(tinyPoint3); - rect.Top = tinyPoint3.Y + 60 - 30; - rect.Bottom = tinyPoint3.Y + 60 - 1; - if (m_blupiVitesseY >= 0.0 && DecorDetect(rect)) + rect.top = tinyPoint3.y + 60 - 30; + rect.bottom = tinyPoint3.y + 60 - 1; + if (m_blupiVitesse.y >= 0.0 && DecorDetect(rect)) { - tinyPoint3.Y = tinyPoint3.Y / 32 * 32 + Decor.BLUPIOFFY; + tinyPoint3.y = tinyPoint3.y / 32 * 32 + BLUPIOFFY; if (!IsRessort(tinyPoint3)) { PlaySound(SoundEnviron(3, m_detectIcon), tinyPoint3); } if (m_blupiFocus) { - if (m_blupiVitesseY > 20.0) + if (m_blupiVitesse.y > 20.0) { m_blupiAction = 61; } @@ -2441,20 +2428,20 @@ void CDecor::BlupiStep() m_blupiPhase = 0; } } - rect.Left = tinyPoint3.X + 20; - rect.Right = tinyPoint3.X + 60 - 20; - rect.Top = tinyPoint3.Y + 60 - 33; - rect.Bottom = tinyPoint3.Y + 60 - 1; + rect.left = tinyPoint3.x + 20; + rect.right = tinyPoint3.x + 60 - 20; + rect.top = tinyPoint3.y + 60 - 33; + rect.bottom = tinyPoint3.y + 60 - 1; num = AscenseurDetect(rect, m_blupiPos, tinyPoint3); - if (m_blupiVitesseY >= 0.0 && num != -1) + if (m_blupiVitesse.y >= 0.0 && num != -1) { m_blupiTransport = num; flag4 = false; PlaySound(3, tinyPoint3); - tinyPoint3.Y = m_moveObject[num].posCurrent.Y - 64 + Decor.BLUPIOFFY; + tinyPoint3.y = m_moveObject[num].posCurrent.y - 64 + BLUPIOFFY; if (m_blupiFocus) { - if (m_blupiVitesseY > 20.0) + if (m_blupiVitesse.y > 20.0) { m_blupiAction = 61; } @@ -2493,13 +2480,13 @@ void CDecor::BlupiStep() { if (m_blupiPhase == 8) { - tinyPoint.X = m_blupiPos.X; - tinyPoint.Y = m_blupiPos.Y + 40; - if (m_blupiVitesseY > 0.0) + tinyPoint.x = m_blupiPos.x; + tinyPoint.y = m_blupiPos.y + 40; + if (m_blupiVitesse.y > 0.0) { - tinyPoint.Y += (int)(m_blupiVitesseY * 4.0); + tinyPoint.y += (int)(m_blupiVitesse.y * 4.0); } - m_blupiVitesseY -= 10.0; + m_blupiVitesse.y -= 10.0; if (ObjectStart(tinyPoint, 23, 55) != -1) { PlaySound(52, m_blupiPos); @@ -2539,12 +2526,12 @@ void CDecor::BlupiStep() m_blupiPhase = 0; m_blupiFocus = true; num = MoveObjectDetect(tinyPoint3, out flag6); - if (num != -1 && !flag6 && tinyPoint3.Y - Decor.BLUPIFLOOR == m_moveObject[num].posCurrent.Y) + if (num != -1 && !flag6 && tinyPoint3.y - BLUPIFLOOR == m_moveObject[num].posCurrent.y) { - if (m_blupiDir == 2 && tinyPoint3.X < m_moveObject[num].posCurrent.X) + if (m_blupiDir == 2 && tinyPoint3.x < m_moveObject[num].posCurrent.x) { - tinyPoint.X = tinyPoint3.X - 16; - tinyPoint.Y = tinyPoint3.Y; + tinyPoint.x = tinyPoint3.x - 16; + tinyPoint.y = tinyPoint3.y; int num2 = MoveObjectDetect(tinyPoint, out flag6); if (num2 == -1) { @@ -2552,10 +2539,10 @@ void CDecor::BlupiStep() m_blupiPhase = 0; } } - if (m_blupiDir == 1 && tinyPoint3.X > m_moveObject[num].posCurrent.X) + if (m_blupiDir == 1 && tinyPoint3.x > m_moveObject[num].posCurrent.x) { - tinyPoint.X = tinyPoint3.X + 16; - tinyPoint.Y = tinyPoint3.Y; + tinyPoint.x = tinyPoint3.x + 16; + tinyPoint.y = tinyPoint3.y; int num2 = MoveObjectDetect(tinyPoint, out flag6); if (num2 == -1) { @@ -2639,7 +2626,7 @@ void CDecor::BlupiStep() { m_blupiAction = 5; m_blupiPhase = 0; - m_blupiVitesseY = -12.0; + m_blupiVitesse.y = -12.0; m_blupiAir = true; flag = true; } @@ -2694,44 +2681,44 @@ void CDecor::BlupiStep() } if (m_blupiAction == 7 && m_blupiPhase == 4) { - m_scrollAdd.Y = -150; + m_scrollAdd.y = -150; PlaySound(21, tinyPoint3); } if (m_blupiAction == 6 && m_blupiPhase == 4) { - m_scrollAdd.Y = 150; + m_scrollAdd.y = 150; PlaySound(7, tinyPoint3); } if (!m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus) { if (m_blupiSpeedY > 0.0 && m_blupiSpeedX == 0.0 && (m_keyPress & 1) == 0 && m_blupiAction != 28 && m_blupiDir == 1 && (num = CaisseInFront()) != -1) { - tinyPoint3.X = m_moveObject[num].posCurrent.X + 64 - 5; + tinyPoint3.x = m_moveObject[num].posCurrent.x + 64 - 5; m_blupiAction = 28; m_blupiPhase = 0; - m_scrollAdd.Y = 0; + m_scrollAdd.y = 0; PlaySound(39, tinyPoint3); } if (m_blupiSpeedY > 0.0 && m_blupiSpeedX > 0.0 && (m_keyPress & 1) == 0 && m_blupiAction != 29 && m_blupiDir == 1 && CaisseInFront() != -1) { m_blupiAction = 29; m_blupiPhase = 0; - m_scrollAdd.Y = 0; + m_scrollAdd.y = 0; PlaySound(39, tinyPoint3); } if (m_blupiSpeedY > 0.0 && m_blupiSpeedX == 0.0 && (m_keyPress & 1) == 0 && m_blupiAction != 28 && m_blupiDir == 2 && (num = CaisseInFront()) != -1) { - tinyPoint3.X = m_moveObject[num].posCurrent.X - 60 + 5; + tinyPoint3.x = m_moveObject[num].posCurrent.x - 60 + 5; m_blupiAction = 28; m_blupiPhase = 0; - m_scrollAdd.Y = 0; + m_scrollAdd.y = 0; PlaySound(39, tinyPoint3); } if (m_blupiSpeedY > 0.0 && m_blupiSpeedX < 0.0 && (m_keyPress & 1) == 0 && m_blupiAction != 29 && m_blupiDir == 2 && CaisseInFront() != -1) { m_blupiAction = 29; m_blupiPhase = 0; - m_scrollAdd.Y = 0; + m_scrollAdd.y = 0; PlaySound(39, tinyPoint3); } if (m_blupiAction == 29 && m_blupiActionOuf != 47) @@ -2767,7 +2754,7 @@ void CDecor::BlupiStep() int num4; if (m_blupiSpeedX < 0.0 && m_blupiFocus) { - if (m_blupiDir == 2 && m_blupiAction != 3 && m_blupiAction != 59 && m_blupiAction != 7 && m_blupiAction != 6 && m_blupiAction != 29 && ((!m_blupiJeep && !m_blupiTank && !m_blupiSkate) || Math.Abs(m_blupiVitesseX) <= 8.0)) + if (m_blupiDir == 2 && m_blupiAction != 3 && m_blupiAction != 59 && m_blupiAction != 7 && m_blupiAction != 6 && m_blupiAction != 29 && ((!m_blupiJeep && !m_blupiTank && !m_blupiSkate) || Math.Abs(m_blupiVitesse.x) <= 8.0)) { if (m_blupiAir) { @@ -2792,7 +2779,7 @@ void CDecor::BlupiStep() { if (m_blupiAction == 14) { - tinyPoint3.X -= CaisseGetMove(5); + tinyPoint3.x -= CaisseGetMove(5); } else { @@ -2801,23 +2788,23 @@ void CDecor::BlupiStep() { num3 = 3; } - num4 = Tables.table_vitesse_march[num3]; + num4 = table_vitesse_march[num3]; if (m_blupiPower) { num4 *= 3; num4 /= 2; } - tinyPoint3.X += Misc.Speed(m_blupiSpeedX, num4); + tinyPoint3.x += Misc.Speed(m_blupiSpeedX, num4); } } if (m_blupiDir == 2 && m_blupiAction == 29) { - tinyPoint3.X -= CaisseGetMove(3); + tinyPoint3.x -= CaisseGetMove(3); } } if (m_blupiSpeedX > 0.0 && m_blupiFocus) { - if (m_blupiDir == 1 && m_blupiAction != 3 && m_blupiAction != 59 && m_blupiAction != 7 && m_blupiAction != 6 && m_blupiAction != 29 && ((!m_blupiJeep && !m_blupiTank && !m_blupiSkate) || Math.Abs(m_blupiVitesseX) <= 8.0)) + if (m_blupiDir == 1 && m_blupiAction != 3 && m_blupiAction != 59 && m_blupiAction != 7 && m_blupiAction != 6 && m_blupiAction != 29 && ((!m_blupiJeep && !m_blupiTank && !m_blupiSkate) || Math.Abs(m_blupiVitesse.x) <= 8.0)) { if (m_blupiAir) { @@ -2842,7 +2829,7 @@ void CDecor::BlupiStep() { if (m_blupiAction == 14) { - tinyPoint3.X += CaisseGetMove(5); + tinyPoint3.x += CaisseGetMove(5); } else { @@ -2851,18 +2838,18 @@ void CDecor::BlupiStep() { num3 = 3; } - num4 = Tables.table_vitesse_march[num3]; + num4 = table_vitesse_march[num3]; if (m_blupiPower) { num4 *= 3; num4 /= 2; } - tinyPoint3.X += Misc.Speed(m_blupiSpeedX, num4); + tinyPoint3.x += Misc.Speed(m_blupiSpeedX, num4); } } if (m_blupiDir == 1 && m_blupiAction == 29) { - tinyPoint3.X += CaisseGetMove(3); + tinyPoint3.x += CaisseGetMove(3); } } if (m_blupiHelico) @@ -3025,7 +3012,7 @@ void CDecor::BlupiStep() m_blupiPhase = 0; PlaySound(20, tinyPoint3); } - m_scrollAdd.Y = 0; + m_scrollAdd.y = 0; if (blupiAction == 14) { StopSound(38); @@ -3039,30 +3026,30 @@ void CDecor::BlupiStep() { if (m_blupiAction == 9 && m_blupiDir == 1) { - tinyPoint3.X += 4; + tinyPoint3.x += 4; } if (m_blupiAction == 9 && m_blupiDir == 2) { - tinyPoint3.X -= 4; + tinyPoint3.x -= 4; } if (m_blupiAction == 10 && m_blupiDir == 1) { - tinyPoint3.X -= 4; + tinyPoint3.x -= 4; } if (m_blupiAction == 10 && m_blupiDir == 2) { - tinyPoint3.X += 4; + tinyPoint3.x += 4; } } if ((m_keyPress & -3) == 0 && m_blupiSpeedX == 0.0 && m_blupiSpeedY == 0.0 && (m_blupiJeep || m_blupiTank || m_blupiSkate) && m_blupiFocus) { if (m_blupiAction == 10 && m_blupiDir == 1) { - tinyPoint3.X -= 5; + tinyPoint3.x -= 5; } if (m_blupiAction == 10 && m_blupiDir == 2) { - tinyPoint3.X += 5; + tinyPoint3.x += 5; } } if ((m_keyPress & -3) == 0 && m_blupiSpeedX == 0.0 && m_blupiSpeedY == 0.0 && m_blupiNage && m_blupiFocus && m_blupiAction == 2) @@ -3101,191 +3088,191 @@ void CDecor::BlupiStep() { m_blupiAction = 1; m_blupiPhase = 0; - m_blupiVitesseY = 0.0; + m_blupiVitesse.y = 0.0; } } if (Def.EasyMove) { if (m_blupiSpeedY <= -1.0 || (m_keyPress & 1) != 0) { - if (m_blupiVitesseY > -7.0) + if (m_blupiVitesse.y > -7.0) { - m_blupiVitesseY -= 0.5; + m_blupiVitesse.y -= 0.5; } - if (m_blupiVitesseY == -0.5) + if (m_blupiVitesse.y == -0.5) { - m_blupiVitesseY = -1.0; + m_blupiVitesse.y = -1.0; } } else if (m_blupiSpeedY >= 1.0) { - if (m_blupiVitesseY < 8.0) + if (m_blupiVitesse.y < 8.0) { - m_blupiVitesseY += 0.5; + m_blupiVitesse.y += 0.5; } } else { - if (m_blupiVitesseY > 1.0) + if (m_blupiVitesse.y > 1.0) { - m_blupiVitesseY -= 1.0; + m_blupiVitesse.y -= 1.0; } - if (m_blupiVitesseY < 1.0) + if (m_blupiVitesse.y < 1.0) { - m_blupiVitesseY += 1.0; + m_blupiVitesse.y += 1.0; } } - tinyPoint3.Y += (int)m_blupiVitesseY; + tinyPoint3.y += (int)m_blupiVitesse.y; } else { if (m_blupiSpeedY <= -1.0 || (m_keyPress & 1) != 0) { - if (m_blupiVitesseY > -10.0) + if (m_blupiVitesse.y > -10.0) { - m_blupiVitesseY -= 0.5; + m_blupiVitesse.y -= 0.5; } } else if (m_blupiSpeedY >= 1.0) { - if (m_blupiVitesseY < 12.0) + if (m_blupiVitesse.y < 12.0) { - m_blupiVitesseY += 0.5; + m_blupiVitesse.y += 0.5; } } else { - if (m_blupiVitesseY > 1.0) + if (m_blupiVitesse.y > 1.0) { - m_blupiVitesseY -= 1.0; + m_blupiVitesse.y -= 1.0; } - if (m_blupiVitesseY < 1.0) + if (m_blupiVitesse.y < 1.0) { - m_blupiVitesseY += 1.0; + m_blupiVitesse.y += 1.0; } } - tinyPoint3.Y += (int)m_blupiVitesseY; + tinyPoint3.y += (int)m_blupiVitesse.y; } if (Def.EasyMove) { if (m_blupiSpeedX <= -1.0) { int num5 = (int)(m_blupiSpeedX * 12.0); - if (m_blupiVitesseX > (double)num5) + if (m_blupiVitesse.x > num5) { - m_blupiVitesseX -= 0.5; + m_blupiVitesse.x -= 0.5; } - tinyPoint.X = tinyPoint3.X + (int)m_blupiVitesseX; - tinyPoint.Y = tinyPoint3.Y; + tinyPoint.x = tinyPoint3.x + (int)m_blupiVitesse.x; + tinyPoint.y = tinyPoint3.y; if (BlupiBloque(tinyPoint, -1)) { - m_blupiVitesseX = 0.0; + m_blupiVitesse.x = 0.0; } } else if (m_blupiSpeedX >= 1.0) { int num6 = (int)(m_blupiSpeedX * 12.0); - if (m_blupiVitesseX < (double)num6) + if (m_blupiVitesse.x < num6) { - m_blupiVitesseX += 0.5; + m_blupiVitesse.x += 0.5; } - tinyPoint.X = tinyPoint3.X + (int)m_blupiVitesseX; - tinyPoint.Y = tinyPoint3.Y; + tinyPoint.x = tinyPoint3.x + (int)m_blupiVitesse.x; + tinyPoint.y = tinyPoint3.y; if (BlupiBloque(tinyPoint, 1)) { - m_blupiVitesseX = 0.0; + m_blupiVitesse.x = 0.0; } } else { - if (m_blupiVitesseX > 0.0) + if (m_blupiVitesse.x > 0.0) { - m_blupiVitesseX -= 2.0; - if (m_blupiVitesseX < 0.0) + m_blupiVitesse.x -= 2.0; + if (m_blupiVitesse.x < 0.0) { - m_blupiVitesseX = 0.0; + m_blupiVitesse.x = 0.0; } } - if (m_blupiVitesseX < 0.0) + if (m_blupiVitesse.x < 0.0) { - m_blupiVitesseX += 2.0; - if (m_blupiVitesseX > 0.0) + m_blupiVitesse.x += 2.0; + if (m_blupiVitesse.x > 0.0) { - m_blupiVitesseX = 0.0; + m_blupiVitesse.x = 0.0; } } } - tinyPoint3.X += (int)m_blupiVitesseX; + tinyPoint3.x += (int)m_blupiVitesse.x; } else { if (m_blupiSpeedX <= -1.0) { int num7 = (int)(m_blupiSpeedX * 16.0); - if (m_blupiVitesseX > (double)num7) + if (m_blupiVitesse.x > num7) { - m_blupiVitesseX -= 1.0; + m_blupiVitesse.x -= 1.0; } - tinyPoint.X = tinyPoint3.X + (int)m_blupiVitesseX; - tinyPoint.Y = tinyPoint3.Y; + tinyPoint.x = tinyPoint3.x + (int)m_blupiVitesse.x; + tinyPoint.y = tinyPoint3.y; if (BlupiBloque(tinyPoint, -1)) { - m_blupiVitesseX = 0.0; + m_blupiVitesse.x = 0.0; } } else if (m_blupiSpeedX >= 1.0) { int num8 = (int)(m_blupiSpeedX * 16.0); - if (m_blupiVitesseX < (double)num8) + if (m_blupiVitesse.x < num8) { - m_blupiVitesseX += 1.0; + m_blupiVitesse.x += 1.0; } - tinyPoint.X = tinyPoint3.X + (int)m_blupiVitesseX; - tinyPoint.Y = tinyPoint3.Y; + tinyPoint.x = tinyPoint3.x + (int)m_blupiVitesse.x; + tinyPoint.y = tinyPoint3.y; if (BlupiBloque(tinyPoint, 1)) { - m_blupiVitesseX = 0.0; + m_blupiVitesse.x = 0.0; } } else { - if (m_blupiVitesseX > 0.0) + if (m_blupiVitesse.x > 0.0) { - m_blupiVitesseX -= 2.0; - if (m_blupiVitesseX < 0.0) + m_blupiVitesse.x -= 2.0; + if (m_blupiVitesse.x < 0.0) { - m_blupiVitesseX = 0.0; + m_blupiVitesse.x = 0.0; } } - if (m_blupiVitesseX < 0.0) + if (m_blupiVitesse.x < 0.0) { - m_blupiVitesseX += 2.0; - if (m_blupiVitesseX > 0.0) + m_blupiVitesse.x += 2.0; + if (m_blupiVitesse.x > 0.0) { - m_blupiVitesseX = 0.0; + m_blupiVitesse.x = 0.0; } } } - tinyPoint3.X += (int)m_blupiVitesseX; + tinyPoint3.x += (int)m_blupiVitesse.x; } MoveObjectPollution(); if (ButtonPressed == Def.ButtonGlygh.PlayAction && !flag4 && m_blupiTransport == -1) { ButtonPressed = Def.ButtonGlygh.None; - rect.Left = m_blupiPos.X + 20; - rect.Right = m_blupiPos.X + 22; - rect.Top = m_blupiPos.Y + 60 - 2; - rect.Bottom = m_blupiPos.Y + 60; + rect.left = m_blupiPos.x + 20; + rect.right = m_blupiPos.x + 22; + rect.top = m_blupiPos.y + 60 - 2; + rect.bottom = m_blupiPos.y + 60; flag2 = !DecorDetect(rect); - rect.Left = m_blupiPos.X + 60 - 22; - rect.Right = m_blupiPos.X + 60 - 20; - rect.Top = m_blupiPos.Y + 60 - 2; - rect.Bottom = m_blupiPos.Y + 60; + rect.left = m_blupiPos.x + 60 - 22; + rect.right = m_blupiPos.x + 60 - 20; + rect.top = m_blupiPos.y + 60 - 2; + rect.bottom = m_blupiPos.y + 60; flag3 = !DecorDetect(rect); if (!flag2 && !flag3) { - tinyPoint.X = m_blupiPos.X; - tinyPoint.Y = m_blupiPos.Y - Decor.BLUPIFLOOR; + tinyPoint.x = m_blupiPos.x; + tinyPoint.y = m_blupiPos.y - BLUPIFLOOR; ObjectStart(tinyPoint, 13, 0); m_blupiHelico = false; m_blupiAction = 1; @@ -3314,99 +3301,99 @@ void CDecor::BlupiStep() m_blupiAction = 1; m_blupiPhase = 0; } - m_blupiVitesseY = 0.0; + m_blupiVitesse.y = 0.0; } } rect = BlupiRect(tinyPoint3); - rect.Top = tinyPoint3.Y + 60 - 2; - rect.Bottom = tinyPoint3.Y + 60 + Decor.OVERHEIGHT - 1; + rect.top = tinyPoint3.y + 60 - 2; + rect.bottom = tinyPoint3.y + 60 + OVERHEIGHT - 1; bool flag7 = !DecorDetect(rect); - num = MoveAscenseurDetect(m_blupiPos, Decor.OVERHEIGHT); + num = MoveAscenseurDetect(m_blupiPos, OVERHEIGHT); if (num != -1) { flag7 = false; } if ((m_blupiSpeedY < 0.0 || (m_keyPress & 1) != 0) && !flag7) { - if (m_blupiVitesseY == 0.0 && num != -1) + if (m_blupiVitesse.y == 0.0 && num != -1) { - m_blupiVitesseY = -5.0; + m_blupiVitesse.y = -5.0; } - else if (m_blupiVitesseY > -5.0) + else if (m_blupiVitesse.y > -5.0) { - m_blupiVitesseY -= 1.0; + m_blupiVitesse.y -= 1.0; } } else if (m_blupiSpeedY > 0.0) { - if (m_blupiVitesseY < 12.0) + if (m_blupiVitesse.y < 12.0) { - m_blupiVitesseY += 5.0; + m_blupiVitesse.y += 5.0; } } - else if (m_blupiVitesseY < 12.0 && m_time % 2 == 0) + else if (m_blupiVitesse.y < 12.0 && m_time % 2 == 0) { - m_blupiVitesseY += 1.0; + m_blupiVitesse.y += 1.0; } - tinyPoint3.Y += (int)m_blupiVitesseY; + tinyPoint3.y += (int)m_blupiVitesse.y; if (m_blupiSpeedX < 0.0 && flag4) { int num9 = (int)(m_blupiSpeedX * 12.0); - if (m_blupiVitesseX > (double)num9) + if (m_blupiVitesse.x > num9) { - m_blupiVitesseX -= 1.0; + m_blupiVitesse.x -= 1.0; } - tinyPoint.X = tinyPoint3.X + (int)m_blupiVitesseX; - tinyPoint.Y = tinyPoint3.Y; + tinyPoint.x = tinyPoint3.x + (int)m_blupiVitesse.x; + tinyPoint.y = tinyPoint3.y; if (BlupiBloque(tinyPoint, -1)) { - m_blupiVitesseX = 0.0; + m_blupiVitesse.x = 0.0; } } else if (m_blupiSpeedX > 0.0 && flag4) { int num10 = (int)(m_blupiSpeedX * 12.0); - if (m_blupiVitesseX < (double)num10) + if (m_blupiVitesse.x < num10) { - m_blupiVitesseX += 1.0; + m_blupiVitesse.x += 1.0; } - tinyPoint.X = tinyPoint3.X + (int)m_blupiVitesseX; - tinyPoint.Y = tinyPoint3.Y; + tinyPoint.x = tinyPoint3.x + (int)m_blupiVitesse.x; + tinyPoint.y = tinyPoint3.y; if (BlupiBloque(tinyPoint, 1)) { - m_blupiVitesseX = 0.0; + m_blupiVitesse.x = 0.0; } } else { - if (m_blupiVitesseX > 0.0) + if (m_blupiVitesse.x > 0.0) { - m_blupiVitesseX -= 1.0; + m_blupiVitesse.x -= 1.0; } - if (m_blupiVitesseX < 0.0) + if (m_blupiVitesse.x < 0.0) { - m_blupiVitesseX += 1.0; + m_blupiVitesse.x += 1.0; } } - tinyPoint3.X += (int)m_blupiVitesseX; + tinyPoint3.x += (int)m_blupiVitesse.x; MoveObjectPollution(); if (ButtonPressed == Def.ButtonGlygh.PlayAction && !flag4 && m_blupiTransport == -1) { ButtonPressed = Def.ButtonGlygh.None; - rect.Left = m_blupiPos.X + 20; - rect.Right = m_blupiPos.X + 22; - rect.Top = m_blupiPos.Y + 60 - 2; - rect.Bottom = m_blupiPos.Y + 60; + rect.left = m_blupiPos.x + 20; + rect.right = m_blupiPos.x + 22; + rect.top = m_blupiPos.y + 60 - 2; + rect.bottom = m_blupiPos.y + 60; flag2 = !DecorDetect(rect); - rect.Left = m_blupiPos.X + 60 - 22; - rect.Right = m_blupiPos.X + 60 - 20; - rect.Top = m_blupiPos.Y + 60 - 2; - rect.Bottom = m_blupiPos.Y + 60; + rect.left = m_blupiPos.x + 60 - 22; + rect.right = m_blupiPos.x + 60 - 20; + rect.top = m_blupiPos.y + 60 - 2; + rect.bottom = m_blupiPos.y + 60; flag3 = !DecorDetect(rect); if (!flag2 && !flag3) { - tinyPoint.X = m_blupiPos.X; - tinyPoint.Y = m_blupiPos.Y - Decor.BLUPIFLOOR; + tinyPoint.x = m_blupiPos.x; + tinyPoint.y = m_blupiPos.y - BLUPIFLOOR; ObjectStart(tinyPoint, 46, 0); m_blupiOver = false; m_blupiAction = 1; @@ -3423,86 +3410,86 @@ void CDecor::BlupiStep() { if (m_blupiSpeedY < 0.0 || (m_keyPress & 1) != 0) { - if (m_blupiVitesseY > -5.0 && m_time % 6 == 0) + if (m_blupiVitesse.y > -5.0 && m_time % 6 == 0) { - m_blupiVitesseY -= 1.0; + m_blupiVitesse.y -= 1.0; } } else if (m_blupiSpeedY > 0.0) { - if (m_blupiVitesseY < 0.0 && m_time % 6 == 0) + if (m_blupiVitesse.y < 0.0 && m_time % 6 == 0) { - m_blupiVitesseY += 1.0; + m_blupiVitesse.y += 1.0; } } - else if (m_blupiVitesseY > -3.0 && m_time % 6 == 0) + else if (m_blupiVitesse.y > -3.0 && m_time % 6 == 0) { - m_blupiVitesseY -= 1.0; + m_blupiVitesse.y -= 1.0; } - tinyPoint3.Y += (int)m_blupiVitesseY; + tinyPoint3.y += (int)m_blupiVitesse.y; if (m_blupiSpeedX < 0.0) { int num11 = (int)(m_blupiSpeedX * 10.0); - if (m_blupiVitesseX > (double)num11) + if (m_blupiVitesse.x > num11) { - m_blupiVitesseX -= 1.0; + m_blupiVitesse.x -= 1.0; } - tinyPoint.X = tinyPoint3.X + (int)m_blupiVitesseX; - tinyPoint.Y = tinyPoint3.Y; + tinyPoint.x = tinyPoint3.x + (int)m_blupiVitesse.x; + tinyPoint.y = tinyPoint3.y; if (BlupiBloque(tinyPoint, -1)) { - m_blupiVitesseX = 0.0; + m_blupiVitesse.x = 0.0; } } else if (m_blupiSpeedX > 0.0) { int num12 = (int)(m_blupiSpeedX * 10.0); - if (m_blupiVitesseX < (double)num12) + if (m_blupiVitesse.x < num12) { - m_blupiVitesseX += 1.0; + m_blupiVitesse.x += 1.0; } - tinyPoint.X = tinyPoint3.X + (int)m_blupiVitesseX; - tinyPoint.Y = tinyPoint3.Y; + tinyPoint.x = tinyPoint3.x + (int)m_blupiVitesse.x; + tinyPoint.y = tinyPoint3.y; if (BlupiBloque(tinyPoint, 1)) { - m_blupiVitesseX = 0.0; + m_blupiVitesse.x = 0.0; } } else { - if (m_blupiVitesseX > 0.0) + if (m_blupiVitesse.x > 0.0) { - m_blupiVitesseX -= 2.0; - if (m_blupiVitesseX < 0.0) + m_blupiVitesse.x -= 2.0; + if (m_blupiVitesse.x < 0.0) { - m_blupiVitesseX = 0.0; + m_blupiVitesse.x = 0.0; } } - if (m_blupiVitesseX < 0.0) + if (m_blupiVitesse.x < 0.0) { - m_blupiVitesseX += 2.0; - if (m_blupiVitesseX > 0.0) + m_blupiVitesse.x += 2.0; + if (m_blupiVitesse.x > 0.0) { - m_blupiVitesseX = 0.0; + m_blupiVitesse.x = 0.0; } } } - tinyPoint3.X += (int)m_blupiVitesseX; + tinyPoint3.x += (int)m_blupiVitesse.x; } if (m_blupiEcrase && m_blupiFocus) { if (flag4) { - if (m_blupiVitesseY < 2.0) + if (m_blupiVitesse.y < 2.0) { - m_blupiVitesseY += 1.0; + m_blupiVitesse.y += 1.0; } } else { - m_blupiVitesseY = 0.0; + m_blupiVitesse.y = 0.0; } - tinyPoint3.Y += (int)m_blupiVitesseY; + tinyPoint3.y += (int)m_blupiVitesse.y; if (flag4) { num3 = 7; @@ -3511,162 +3498,162 @@ void CDecor::BlupiStep() { num3 = 4; } - num3 = (int)((double)num3 * m_blupiSpeedX); + num3 = (int)(num3 * m_blupiSpeedX); if (m_blupiSpeedX < 0.0) { - if (m_blupiVitesseX > (double)num3) + if (m_blupiVitesse.x > num3) { - m_blupiVitesseX -= 1.0; + m_blupiVitesse.x -= 1.0; } - tinyPoint.X = tinyPoint3.X + (int)m_blupiVitesseX; - tinyPoint.Y = tinyPoint3.Y; + tinyPoint.x = tinyPoint3.x + (int)m_blupiVitesse.x; + tinyPoint.y = tinyPoint3.y; if (BlupiBloque(tinyPoint, -1)) { - m_blupiVitesseX = 0.0; + m_blupiVitesse.x = 0.0; } } else if (m_blupiSpeedX > 0.0) { - if (m_blupiVitesseX < (double)num3) + if (m_blupiVitesse.x < num3) { - m_blupiVitesseX += 1.0; + m_blupiVitesse.x += 1.0; } - tinyPoint.X = tinyPoint3.X + (int)m_blupiVitesseX; - tinyPoint.Y = tinyPoint3.Y; + tinyPoint.x = tinyPoint3.x + (int)m_blupiVitesse.x; + tinyPoint.y = tinyPoint3.y; if (BlupiBloque(tinyPoint, 1)) { - m_blupiVitesseX = 0.0; + m_blupiVitesse.x = 0.0; } } else { - if (m_blupiVitesseX > 0.0) + if (m_blupiVitesse.x > 0.0) { - m_blupiVitesseX -= 2.0; - if (m_blupiVitesseX < 0.0) + m_blupiVitesse.x -= 2.0; + if (m_blupiVitesse.x < 0.0) { - m_blupiVitesseX = 0.0; + m_blupiVitesse.x = 0.0; } } - if (m_blupiVitesseX < 0.0) + if (m_blupiVitesse.x < 0.0) { - m_blupiVitesseX += 2.0; - if (m_blupiVitesseX > 0.0) + m_blupiVitesse.x += 2.0; + if (m_blupiVitesse.x > 0.0) { - m_blupiVitesseX = 0.0; + m_blupiVitesse.x = 0.0; } } } - if (m_blupiVitesseX == 0.0 && !flag4) + if (m_blupiVitesse.x == 0.0 && !flag4) { m_blupiAction = 1; m_blupiPhase = 0; } - tinyPoint3.X += (int)m_blupiVitesseX; + tinyPoint3.x += (int)m_blupiVitesse.x; } if (m_blupiJeep && m_blupiFocus) { - if (m_blupiVitesseX == 0.0 && m_blupiAction == 2) + if (m_blupiVitesse.x == 0.0 && m_blupiAction == 2) { m_blupiAction = 1; m_blupiPhase = 0; } m_blupiMotorHigh = (m_blupiAction != 1); rect = BlupiRect(tinyPoint3); - rect.Right -= 40; - rect.Top = tinyPoint3.Y + 60 - 2; - rect.Bottom = tinyPoint3.Y + 60 - 1; + rect.right -= 40; + rect.top = tinyPoint3.y + 60 - 2; + rect.bottom = tinyPoint3.y + 60 - 1; bool flag8 = !DecorDetect(rect); - rect.Left += 40; - rect.Right += 40; + rect.left += 40; + rect.right += 40; bool flag9 = !DecorDetect(rect); if (flag4) { - if (m_blupiVitesseY < 50.0) + if (m_blupiVitesse.y < 50.0) { - m_blupiVitesseY += 5.0; + m_blupiVitesse.y += 5.0; } } else { - if (m_blupiVitesseY != 0.0) + if (m_blupiVitesse.y != 0.0) { PlaySound(3, m_blupiPos); } - m_blupiVitesseY = 0.0; + m_blupiVitesse.y = 0.0; } - tinyPoint3.Y += (int)m_blupiVitesseY; + tinyPoint3.y += (int)m_blupiVitesse.y; if (m_blupiTransport == -1) { - rect.Left = tinyPoint3.X + 20; - rect.Right = tinyPoint3.X + 60 - 20; - rect.Top = tinyPoint3.Y + 60 - 35; - rect.Bottom = tinyPoint3.Y + 60 - 1; + rect.left = tinyPoint3.x + 20; + rect.right = tinyPoint3.x + 60 - 20; + rect.top = tinyPoint3.y + 60 - 35; + rect.bottom = tinyPoint3.y + 60 - 1; num = AscenseurDetect(rect, m_blupiPos, tinyPoint3); - if (m_blupiVitesseY >= 0.0 && num != -1) + if (m_blupiVitesse.y >= 0.0 && num != -1) { m_blupiTransport = num; flag4 = false; PlaySound(3, tinyPoint3); - tinyPoint3.Y = m_moveObject[num].posCurrent.Y - 64 + Decor.BLUPIOFFY; + tinyPoint3.y = m_moveObject[num].posCurrent.y - 64 + BLUPIOFFY; } } if (flag8 && !flag9) { int num13 = -20; - if (m_blupiVitesseX > (double)num13) + if (m_blupiVitesse.x > num13) { - m_blupiVitesseX -= 1.0; + m_blupiVitesse.x -= 1.0; } } else if (!flag8 && flag9) { int num14 = 20; - if (m_blupiVitesseX < (double)num14) + if (m_blupiVitesse.x < num14) { - m_blupiVitesseX += 1.0; + m_blupiVitesse.x += 1.0; } } else if (m_blupiSpeedX < 0.0) { int num15 = (int)(m_blupiSpeedX * 20.0); - if (m_blupiVitesseX > (double)num15) + if (m_blupiVitesse.x > num15) { - m_blupiVitesseX -= 1.0; + m_blupiVitesse.x -= 1.0; } } else if (m_blupiSpeedX > 0.0) { int num16 = (int)(m_blupiSpeedX * 20.0); - if (m_blupiVitesseX < (double)num16) + if (m_blupiVitesse.x < num16) { - m_blupiVitesseX += 1.0; + m_blupiVitesse.x += 1.0; } } else { - if (m_blupiVitesseX > 0.0) + if (m_blupiVitesse.x > 0.0) { - m_blupiVitesseX -= 2.0; - if (m_blupiVitesseX < 0.0) + m_blupiVitesse.x -= 2.0; + if (m_blupiVitesse.x < 0.0) { - m_blupiVitesseX = 0.0; + m_blupiVitesse.x = 0.0; } } - if (m_blupiVitesseX < 0.0) + if (m_blupiVitesse.x < 0.0) { - m_blupiVitesseX += 2.0; - if (m_blupiVitesseX > 0.0) + m_blupiVitesse.x += 2.0; + if (m_blupiVitesse.x > 0.0) { - m_blupiVitesseX = 0.0; + m_blupiVitesse.x = 0.0; } } } if (m_blupiAction == 3) { - m_blupiVitesseX = 0.0; + m_blupiVitesse.x = 0.0; } - tinyPoint3.X += (int)m_blupiVitesseX; + tinyPoint3.x += (int)m_blupiVitesse.x; if (flag8 && !flag9) { m_blupiRealRotation = Misc.Approch(m_blupiRealRotation, -45, 5); @@ -3684,8 +3671,8 @@ void CDecor::BlupiStep() if (ButtonPressed == Def.ButtonGlygh.PlayAction && !flag4 && m_blupiTransport == -1) { ButtonPressed = Def.ButtonGlygh.None; - tinyPoint.X = m_blupiPos.X; - tinyPoint.Y = m_blupiPos.Y - Decor.BLUPIFLOOR; + tinyPoint.x = m_blupiPos.x; + tinyPoint.y = m_blupiPos.y - BLUPIFLOOR; ObjectStart(tinyPoint, 19, 0); m_blupiJeep = false; m_blupiAction = 1; @@ -3713,17 +3700,17 @@ void CDecor::BlupiStep() { if (m_blupiDir == 1) { - tinyPoint.X = m_blupiPos.X - 35; - tinyPoint.Y = m_blupiPos.Y; + tinyPoint.x = m_blupiPos.x - 35; + tinyPoint.y = m_blupiPos.y; num4 = -5; - m_blupiVitesseX += 12.0; + m_blupiVitesse.x += 12.0; } else { - tinyPoint.X = m_blupiPos.X + 35; - tinyPoint.Y = m_blupiPos.Y; + tinyPoint.x = m_blupiPos.x + 35; + tinyPoint.y = m_blupiPos.y; num4 = 5; - m_blupiVitesseX -= 12.0; + m_blupiVitesse.x -= 12.0; } if (ObjectStart(tinyPoint, 23, num4) != -1) { @@ -3735,7 +3722,7 @@ void CDecor::BlupiStep() } } } - if (m_blupiVitesseX == 0.0 && m_blupiAction == 2) + if (m_blupiVitesse.x == 0.0 && m_blupiAction == 2) { m_blupiAction = 1; m_blupiPhase = 0; @@ -3743,81 +3730,81 @@ void CDecor::BlupiStep() m_blupiMotorHigh = (m_blupiAction != 1); if (flag4) { - if (m_blupiVitesseY < 50.0) + if (m_blupiVitesse.y < 50.0) { - m_blupiVitesseY += 5.0; + m_blupiVitesse.y += 5.0; } } else { - if (m_blupiVitesseY != 0.0) + if (m_blupiVitesse.y != 0.0) { PlaySound(3, m_blupiPos); } - m_blupiVitesseY = 0.0; + m_blupiVitesse.y = 0.0; } - tinyPoint3.Y += (int)m_blupiVitesseY; + tinyPoint3.y += (int)m_blupiVitesse.y; if (m_blupiTransport == -1) { - rect.Left = tinyPoint3.X + 20; - rect.Right = tinyPoint3.X + 60 - 20; - rect.Top = tinyPoint3.Y + 60 - 35; - rect.Bottom = tinyPoint3.Y + 60 - 1; + rect.left = tinyPoint3.x + 20; + rect.right = tinyPoint3.x + 60 - 20; + rect.top = tinyPoint3.y + 60 - 35; + rect.bottom = tinyPoint3.y + 60 - 1; num = AscenseurDetect(rect, m_blupiPos, tinyPoint3); - if (m_blupiVitesseY >= 0.0 && num != -1) + if (m_blupiVitesse.y >= 0.0 && num != -1) { m_blupiTransport = num; flag4 = false; PlaySound(3, tinyPoint3); - tinyPoint3.Y = m_moveObject[num].posCurrent.Y - 64 + Decor.BLUPIOFFY; + tinyPoint3.y = m_moveObject[num].posCurrent.y - 64 + BLUPIOFFY; } } if (m_blupiSpeedX < 0.0) { int num17 = (int)(m_blupiSpeedX * 12.0); - if (m_blupiVitesseX > (double)num17) + if (m_blupiVitesse.x > num17) { - m_blupiVitesseX -= 1.0; + m_blupiVitesse.x -= 1.0; } } else if (m_blupiSpeedX > 0.0) { int num18 = (int)(m_blupiSpeedX * 12.0); - if (m_blupiVitesseX < (double)num18) + if (m_blupiVitesse.x < num18) { - m_blupiVitesseX += 1.0; + m_blupiVitesse.x += 1.0; } } else { - if (m_blupiVitesseX > 0.0) + if (m_blupiVitesse.x > 0.0) { - m_blupiVitesseX -= 3.0; - if (m_blupiVitesseX < 0.0) + m_blupiVitesse.x -= 3.0; + if (m_blupiVitesse.x < 0.0) { - m_blupiVitesseX = 0.0; + m_blupiVitesse.x = 0.0; } } - if (m_blupiVitesseX < 0.0) + if (m_blupiVitesse.x < 0.0) { - m_blupiVitesseX += 3.0; - if (m_blupiVitesseX > 0.0) + m_blupiVitesse.x += 3.0; + if (m_blupiVitesse.x > 0.0) { - m_blupiVitesseX = 0.0; + m_blupiVitesse.x = 0.0; } } } if (m_blupiAction == 3) { - m_blupiVitesseX = 0.0; + m_blupiVitesse.x = 0.0; } - tinyPoint3.X += (int)m_blupiVitesseX; + tinyPoint3.x += (int)m_blupiVitesse.x; MoveObjectPollution(); if (ButtonPressed == Def.ButtonGlygh.PlayAction && !flag4 && m_blupiTransport == -1) { ButtonPressed = Def.ButtonGlygh.None; - tinyPoint.X = m_blupiPos.X; - tinyPoint.Y = m_blupiPos.Y; + tinyPoint.x = m_blupiPos.x; + tinyPoint.y = m_blupiPos.y; ObjectStart(tinyPoint, 28, 0); m_blupiTank = false; m_blupiAction = 1; @@ -3830,7 +3817,7 @@ void CDecor::BlupiStep() } if (m_blupiSkate && m_blupiFocus) { - if (m_blupiVitesseX == 0.0 && m_blupiAction == 2) + if (m_blupiVitesse.x == 0.0 && m_blupiAction == 2) { m_blupiAction = 1; m_blupiPhase = 0; @@ -3838,44 +3825,44 @@ void CDecor::BlupiStep() if (m_blupiSpeedX < 0.0) { int num19 = (int)(m_blupiSpeedX * 15.0); - if (m_blupiVitesseX > (double)num19) + if (m_blupiVitesse.x > num19) { - m_blupiVitesseX -= 1.0; + m_blupiVitesse.x -= 1.0; } } else if (m_blupiSpeedX > 0.0) { int num20 = (int)(m_blupiSpeedX * 15.0); - if (m_blupiVitesseX < (double)num20) + if (m_blupiVitesse.x < num20) { - m_blupiVitesseX += 1.0; + m_blupiVitesse.x += 1.0; } } else { - if (m_blupiVitesseX > 0.0) + if (m_blupiVitesse.x > 0.0) { - m_blupiVitesseX -= 1.0; - if (m_blupiVitesseX < 0.0) + m_blupiVitesse.x -= 1.0; + if (m_blupiVitesse.x < 0.0) { - m_blupiVitesseX = 0.0; + m_blupiVitesse.x = 0.0; } } - if (m_blupiVitesseX < 0.0) + if (m_blupiVitesse.x < 0.0) { - m_blupiVitesseX += 1.0; - if (m_blupiVitesseX > 0.0) + m_blupiVitesse.x += 1.0; + if (m_blupiVitesse.x > 0.0) { - m_blupiVitesseX = 0.0; + m_blupiVitesse.x = 0.0; } } } if (m_blupiAction == 3) { - m_blupiVitesseX = 0.0; + m_blupiVitesse.x = 0.0; } - tinyPoint3.X += (int)m_blupiVitesseX; - if (ButtonPressed == Def.ButtonGlygh.PlayAction && !flag4 && !m_blupiAir && m_blupiTransport == -1 && m_blupiVitesseX < 8.0) + tinyPoint3.x += (int)m_blupiVitesse.x; + if (ButtonPressed == Def.ButtonGlygh.PlayAction && !flag4 && !m_blupiAir && m_blupiTransport == -1 && m_blupiVitesse.x < 8.0) { ButtonPressed = Def.ButtonGlygh.None; m_blupiSkate = false; @@ -3906,8 +3893,8 @@ void CDecor::BlupiStep() { if (m_blupiPhase == 12) { - tinyPoint.X = m_blupiPos.X; - tinyPoint.Y = m_blupiPos.Y - Decor.BLUPIFLOOR + 1; + tinyPoint.x = m_blupiPos.x; + tinyPoint.y = m_blupiPos.y - BLUPIFLOOR + 1; ObjectStart(tinyPoint, 24, 0); } if (m_blupiPhase == 20) @@ -3923,16 +3910,16 @@ void CDecor::BlupiStep() { if (m_blupiSpeedY < 0.0 || (m_keyPress & 1) != 0) { - if (m_blupiVitesseY > -5.0) + if (m_blupiVitesse.y > -5.0) { - m_blupiVitesseY -= 1.0; + m_blupiVitesse.y -= 1.0; } } else if (m_blupiSpeedY > 0.0) { - if (m_blupiVitesseY < 5.0) + if (m_blupiVitesse.y < 5.0) { - m_blupiVitesseY += 1.0; + m_blupiVitesse.y += 1.0; } } else @@ -3945,54 +3932,54 @@ void CDecor::BlupiStep() { num3 = 0; } - if (m_blupiVitesseY > (double)num3) + if (m_blupiVitesse.y > num3) { - m_blupiVitesseY -= 1.0; + m_blupiVitesse.y -= 1.0; } - if (m_blupiVitesseY < (double)num3) + if (m_blupiVitesse.y < num3) { - m_blupiVitesseY += 1.0; + m_blupiVitesse.y += 1.0; } } - tinyPoint3.Y += (int)m_blupiVitesseY; + tinyPoint3.y += (int)m_blupiVitesse.y; } if (m_blupiSpeedX < 0.0) { int num21 = (int)(m_blupiSpeedX * 8.0); - if (m_blupiVitesseX > (double)num21) + if (m_blupiVitesse.x > num21) { - m_blupiVitesseX -= 1.0; + m_blupiVitesse.x -= 1.0; } } else if (m_blupiSpeedX > 0.0) { int num22 = (int)(m_blupiSpeedX * 8.0); - if (m_blupiVitesseX < (double)num22) + if (m_blupiVitesse.x < num22) { - m_blupiVitesseX += 1.0; + m_blupiVitesse.x += 1.0; } } else { - if (m_blupiVitesseX > 0.0) + if (m_blupiVitesse.x > 0.0) { - m_blupiVitesseX -= 2.0; - if (m_blupiVitesseX < 0.0) + m_blupiVitesse.x -= 2.0; + if (m_blupiVitesse.x < 0.0) { - m_blupiVitesseX = 0.0; + m_blupiVitesse.x = 0.0; } } - if (m_blupiVitesseX < 0.0) + if (m_blupiVitesse.x < 0.0) { - m_blupiVitesseX += 2.0; - if (m_blupiVitesseX > 0.0) + m_blupiVitesse.x += 2.0; + if (m_blupiVitesse.x > 0.0) { - m_blupiVitesseX = 0.0; + m_blupiVitesse.x = 0.0; } } } - num = Tables.table_vitesse_nage[m_blupiPhase % 14 / 2]; - tinyPoint3.X += (int)(m_blupiVitesseX * (double)num / 7.0); + num = table_vitesse_nage[m_blupiPhase % 14 / 2]; + tinyPoint3.x += (int)(m_blupiVitesse.x * num / 7.0); if (m_time % 70 == 0 || m_time % 70 == 28) { MoveObjectBlup(tinyPoint3); @@ -4044,74 +4031,74 @@ void CDecor::BlupiStep() { if (m_blupiSpeedY < 0.0 || (m_keyPress & 1) != 0) { - if (m_blupiVitesseY > -5.0) + if (m_blupiVitesse.y > -5.0) { - m_blupiVitesseY -= 1.0; + m_blupiVitesse.y -= 1.0; } } else if (m_blupiSpeedY > 0.0) { - if (m_blupiVitesseY < 5.0) + if (m_blupiVitesse.y < 5.0) { - m_blupiVitesseY += 1.0; + m_blupiVitesse.y += 1.0; } } else { - if (m_blupiVitesseY > -2.0) + if (m_blupiVitesse.y > -2.0) { - m_blupiVitesseY -= 1.0; + m_blupiVitesse.y -= 1.0; } - if (m_blupiVitesseY < -2.0) + if (m_blupiVitesse.y < -2.0) { - m_blupiVitesseY += 1.0; + m_blupiVitesse.y += 1.0; } } - tinyPoint3.Y += (int)m_blupiVitesseY; - tinyPoint3.Y += Decor.BLUPISURF; - if (tinyPoint3.Y % 64 > 30) + tinyPoint3.y += (int)m_blupiVitesse.y; + tinyPoint3.y += BLUPISURF; + if (tinyPoint3.y % 64 > 30) { - tinyPoint3.Y += 64 - tinyPoint3.Y % 64; + tinyPoint3.y += 64 - tinyPoint3.y % 64; } - tinyPoint3.Y -= Decor.BLUPISURF; + tinyPoint3.y -= BLUPISURF; } if (m_blupiSpeedX < 0.0) { int num23 = (int)(m_blupiSpeedX * 8.0); - if (m_blupiVitesseX > (double)num23) + if (m_blupiVitesse.x > num23) { - m_blupiVitesseX -= 1.0; + m_blupiVitesse.x -= 1.0; } } else if (m_blupiSpeedX > 0.0) { int num24 = (int)(m_blupiSpeedX * 8.0); - if (m_blupiVitesseX < (double)num24) + if (m_blupiVitesse.x < num24) { - m_blupiVitesseX += 1.0; + m_blupiVitesse.x += 1.0; } } else { - if (m_blupiVitesseX > 0.0) + if (m_blupiVitesse.x > 0.0) { - m_blupiVitesseX -= 2.0; - if (m_blupiVitesseX < 0.0) + m_blupiVitesse.x -= 2.0; + if (m_blupiVitesse.x < 0.0) { - m_blupiVitesseX = 0.0; + m_blupiVitesse.x = 0.0; } } - if (m_blupiVitesseX < 0.0) + if (m_blupiVitesse.x < 0.0) { - m_blupiVitesseX += 2.0; - if (m_blupiVitesseX > 0.0) + m_blupiVitesse.x += 2.0; + if (m_blupiVitesse.x > 0.0) { - m_blupiVitesseX = 0.0; + m_blupiVitesse.x = 0.0; } } } - num = Tables.table_vitesse_surf[m_blupiPhase % 12 / 2]; - tinyPoint3.X += (int)(m_blupiVitesseX * (double)num / 10.0); + num = table_vitesse_surf[m_blupiPhase % 12 / 2]; + tinyPoint3.x += (int)(m_blupiVitesse.x * num / 10.0); } TinyPoint tinyPoint4; if (m_blupiSuspend && m_blupiFocus) @@ -4119,18 +4106,18 @@ void CDecor::BlupiStep() if (m_blupiSpeedX < 0.0 && m_blupiAction == 2) { int num25 = (int)(m_blupiSpeedX * 5.0); - tinyPoint3.X += num25; + tinyPoint3.x += num25; } if (m_blupiSpeedX > 0.0 && m_blupiAction == 2) { int num26 = (int)(m_blupiSpeedX * 5.0); - tinyPoint3.X += num26; + tinyPoint3.x += num26; } num = GetTypeBarre(tinyPoint3); if (num == 2) { - tinyPoint4.X = tinyPoint3.X; - tinyPoint4.Y = tinyPoint3.Y / 64 * 64 + Decor.BLUPIOFFY; + tinyPoint4.x = tinyPoint3.x; + tinyPoint4.y = tinyPoint3.y / 64 * 64 + BLUPIOFFY; rect = BlupiRect(tinyPoint4); if (!DecorDetect(rect, true)) { @@ -4146,8 +4133,8 @@ void CDecor::BlupiStep() m_blupiSuspend = false; m_blupiAir = true; m_blupiAction = 5; - tinyPoint3.Y = tinyPoint3.Y; - m_blupiVitesseY = 0.0; + tinyPoint3.y = tinyPoint3.y; + m_blupiVitesse.y = 0.0; m_blupiNoBarre = 5; m_blupiActionOuf = 65; m_blupiTimeOuf = 0; @@ -4168,8 +4155,8 @@ void CDecor::BlupiStep() m_blupiAir = true; m_blupiAction = 5; m_blupiPhase = 0; - tinyPoint3.Y -= 2; - m_blupiVitesseY = -11.0; + tinyPoint3.y -= 2; + m_blupiVitesse.y = -11.0; m_blupiNoBarre = 5; PlaySound(35, tinyPoint3); } @@ -4179,15 +4166,15 @@ void CDecor::BlupiStep() if (m_blupiDynamite > 0) { ButtonPressed = Def.ButtonGlygh.None; - rect.Left = tinyPoint3.X + 18; - rect.Right = tinyPoint3.X + 20; - rect.Top = tinyPoint3.Y + 60 - 2; - rect.Bottom = tinyPoint3.Y + 60; + rect.left = tinyPoint3.x + 18; + rect.right = tinyPoint3.x + 20; + rect.top = tinyPoint3.y + 60 - 2; + rect.bottom = tinyPoint3.y + 60; flag2 = !DecorDetect(rect); - rect.Left = tinyPoint3.X + 60 - 20; - rect.Right = tinyPoint3.X + 60 - 18; - rect.Top = tinyPoint3.Y + 60 - 2; - rect.Bottom = tinyPoint3.Y + 60; + rect.left = tinyPoint3.x + 60 - 20; + rect.right = tinyPoint3.x + 60 - 18; + rect.top = tinyPoint3.y + 60 - 2; + rect.bottom = tinyPoint3.y + 60; flag3 = !DecorDetect(rect); if (!flag2 && !flag3 && ObjectStart(tinyPoint3, 56, 0) != -1) { @@ -4204,15 +4191,15 @@ void CDecor::BlupiStep() num = MoveObjectDetect(tinyPoint3, out flag6); if (num == -1 || m_moveObject[num].type != 200) { - rect.Left = tinyPoint3.X + 18; - rect.Right = tinyPoint3.X + 20; - rect.Top = tinyPoint3.Y + 60 - 2; - rect.Bottom = tinyPoint3.Y + 60; + rect.left = tinyPoint3.x + 18; + rect.right = tinyPoint3.x + 20; + rect.top = tinyPoint3.y + 60 - 2; + rect.bottom = tinyPoint3.y + 60; flag2 = !DecorDetect(rect); - rect.Left = tinyPoint3.X + 60 - 20; - rect.Right = tinyPoint3.X + 60 - 18; - rect.Top = tinyPoint3.Y + 60 - 2; - rect.Bottom = tinyPoint3.Y + 60; + rect.left = tinyPoint3.x + 60 - 20; + rect.right = tinyPoint3.x + 60 - 18; + rect.top = tinyPoint3.y + 60 - 2; + rect.bottom = tinyPoint3.y + 60; flag3 = !DecorDetect(rect); num = MoveChargeDetect(tinyPoint3); if (num == -1 && !flag2 && !flag3 && ObjectStart(tinyPoint3, 200, 0) != -1) @@ -4235,31 +4222,31 @@ void CDecor::BlupiStep() rect = BlupiRect(m_blupiPos); tinyPoint4 = tinyPoint3; TestPath(rect, m_blupiPos, ref tinyPoint3); - if (flag && m_blupiPos.X == tinyPoint3.X && m_blupiPos.X != tinyPoint4.X) + if (flag && m_blupiPos.x == tinyPoint3.x && m_blupiPos.x != tinyPoint4.x) { - tinyPoint3.Y = tinyPoint4.Y; + tinyPoint3.y = tinyPoint4.y; TestPath(rect, m_blupiPos, ref tinyPoint3); } - if (m_blupiVent && m_blupiPos.Y == tinyPoint3.Y && m_blupiPos.Y != tinyPoint4.Y) + if (m_blupiVent && m_blupiPos.y == tinyPoint3.y && m_blupiPos.y != tinyPoint4.y) { - tinyPoint3.X = tinyPoint4.X; + tinyPoint3.x = tinyPoint4.x; TestPath(rect, m_blupiPos, ref tinyPoint3); } - if (m_blupiTransport != -1 && m_blupiPos.X == tinyPoint3.X && m_blupiPos.X != tinyPoint4.X) + if (m_blupiTransport != -1 && m_blupiPos.x == tinyPoint3.x && m_blupiPos.x != tinyPoint4.x) { - tinyPoint3.Y = tinyPoint4.Y; + tinyPoint3.y = tinyPoint4.y; TestPath(rect, m_blupiPos, ref tinyPoint3); } if (m_blupiHelico || m_blupiOver || m_blupiBalloon || m_blupiEcrase || m_blupiJeep || m_blupiTank || m_blupiSkate || m_blupiNage) { - if (m_blupiPos.X == tinyPoint3.X && m_blupiPos.X != tinyPoint4.X) + if (m_blupiPos.x == tinyPoint3.x && m_blupiPos.x != tinyPoint4.x) { - tinyPoint3.Y = tinyPoint4.Y; + tinyPoint3.y = tinyPoint4.y; TestPath(rect, m_blupiPos, ref tinyPoint3); } - else if (m_blupiPos.Y == tinyPoint3.Y && m_blupiPos.Y != tinyPoint4.Y) + else if (m_blupiPos.y == tinyPoint3.y && m_blupiPos.y != tinyPoint4.y) { - tinyPoint3.X = tinyPoint4.X; + tinyPoint3.x = tinyPoint4.x; TestPath(rect, m_blupiPos, ref tinyPoint3); } } @@ -4273,15 +4260,15 @@ void CDecor::BlupiStep() } else { - rect.Left = tinyPoint3.X + 24; - rect.Right = tinyPoint3.X + 26; - rect.Top = tinyPoint3.Y + 60 - 2; - rect.Bottom = tinyPoint3.Y + 60; + rect.left = tinyPoint3.x + 24; + rect.right = tinyPoint3.x + 26; + rect.top = tinyPoint3.y + 60 - 2; + rect.bottom = tinyPoint3.y + 60; flag2 = !DecorDetect(rect); - rect.Left = tinyPoint3.X + 60 - 26; - rect.Right = tinyPoint3.X + 60 - 24; - rect.Top = tinyPoint3.Y + 60 - 2; - rect.Bottom = tinyPoint3.Y + 60; + rect.left = tinyPoint3.x + 60 - 26; + rect.right = tinyPoint3.x + 60 - 24; + rect.top = tinyPoint3.y + 60 - 2; + rect.bottom = tinyPoint3.y + 60; flag3 = !DecorDetect(rect); } if (m_blupiDir == 1 && flag2 && !flag3) @@ -4330,15 +4317,15 @@ void CDecor::BlupiStep() } else { - rect.Left = tinyPoint3.X + 2; - rect.Right = tinyPoint3.X + 18; - rect.Top = tinyPoint3.Y + 60 - 2; - rect.Bottom = tinyPoint3.Y + 60; + rect.left = tinyPoint3.x + 2; + rect.right = tinyPoint3.x + 18; + rect.top = tinyPoint3.y + 60 - 2; + rect.bottom = tinyPoint3.y + 60; flag2 = !DecorDetect(rect); - rect.Left = tinyPoint3.X + 60 - 18; - rect.Right = tinyPoint3.X + 60 - 2; - rect.Top = tinyPoint3.Y + 60 - 2; - rect.Bottom = tinyPoint3.Y + 60; + rect.left = tinyPoint3.x + 60 - 18; + rect.right = tinyPoint3.x + 60 - 2; + rect.top = tinyPoint3.y + 60 - 2; + rect.bottom = tinyPoint3.y + 60; flag3 = !DecorDetect(rect); } if (flag2 && !flag3) @@ -4360,15 +4347,15 @@ void CDecor::BlupiStep() } else { - rect.Left = tinyPoint3.X + 2; - rect.Right = tinyPoint3.X + 18; - rect.Top = tinyPoint3.Y + 60 - 2; - rect.Bottom = tinyPoint3.Y + 60; + rect.left = tinyPoint3.x + 2; + rect.right = tinyPoint3.x + 18; + rect.top = tinyPoint3.y + 60 - 2; + rect.bottom = tinyPoint3.y + 60; flag2 = !DecorDetect(rect); - rect.Left = tinyPoint3.X + 60 - 18; - rect.Right = tinyPoint3.X + 60 - 2; - rect.Top = tinyPoint3.Y + 60 - 2; - rect.Bottom = tinyPoint3.Y + 60; + rect.left = tinyPoint3.x + 60 - 18; + rect.right = tinyPoint3.x + 60 - 2; + rect.top = tinyPoint3.y + 60 - 2; + rect.bottom = tinyPoint3.y + 60; flag3 = !DecorDetect(rect); } if (flag2 && !flag3) @@ -4390,15 +4377,15 @@ void CDecor::BlupiStep() } else { - rect.Left = tinyPoint3.X + 12; - rect.Right = tinyPoint3.X + 19; - rect.Top = tinyPoint3.Y + 60 - 2; - rect.Bottom = tinyPoint3.Y + 60; + rect.left = tinyPoint3.x + 12; + rect.right = tinyPoint3.x + 19; + rect.top = tinyPoint3.y + 60 - 2; + rect.bottom = tinyPoint3.y + 60; flag2 = !DecorDetect(rect); - rect.Left = tinyPoint3.X + 60 - 19; - rect.Right = tinyPoint3.X + 60 - 12; - rect.Top = tinyPoint3.Y + 60 - 2; - rect.Bottom = tinyPoint3.Y + 60; + rect.left = tinyPoint3.x + 60 - 19; + rect.right = tinyPoint3.x + 60 - 12; + rect.top = tinyPoint3.y + 60 - 2; + rect.bottom = tinyPoint3.y + 60; flag3 = !DecorDetect(rect); } if (flag2 && !flag3) @@ -4519,17 +4506,17 @@ void CDecor::BlupiStep() { m_blupiInvert = false; m_jauges[1].SetHide(true); - tinyPoint.X = m_blupiPos.X; - tinyPoint.Y = m_blupiPos.Y + 100; + tinyPoint.x = m_blupiPos.x; + tinyPoint.y = m_blupiPos.y + 100; ObjectStart(tinyPoint, 42, -60); - tinyPoint.X = m_blupiPos.X; - tinyPoint.Y = m_blupiPos.Y - 100; + tinyPoint.x = m_blupiPos.x; + tinyPoint.y = m_blupiPos.y - 100; ObjectStart(tinyPoint, 42, 60); - tinyPoint.X = m_blupiPos.X - 100; - tinyPoint.Y = m_blupiPos.Y; + tinyPoint.x = m_blupiPos.x - 100; + tinyPoint.y = m_blupiPos.y; ObjectStart(tinyPoint, 42, 10); - tinyPoint.X = m_blupiPos.X + 100; - tinyPoint.Y = m_blupiPos.Y; + tinyPoint.x = m_blupiPos.x + 100; + tinyPoint.y = m_blupiPos.y; ObjectStart(tinyPoint, 42, -10); PlaySound(67, tinyPoint3); } @@ -4545,8 +4532,8 @@ void CDecor::BlupiStep() { m_blupiBalloon = false; m_jauges[1].SetHide(true); - tinyPoint.X = m_blupiPos.X - 34; - tinyPoint.Y = m_blupiPos.Y - 34; + tinyPoint.x = m_blupiPos.x - 34; + tinyPoint.y = m_blupiPos.y - 34; ObjectStart(tinyPoint, 91, 0); PlaySound(41, m_blupiPos); } @@ -4567,8 +4554,8 @@ void CDecor::BlupiStep() ObjectStart(m_blupiPos, 41, 60); ObjectStart(m_blupiPos, 41, 10); ObjectStart(m_blupiPos, 41, -10); - tinyPoint.X = m_blupiPos.X - 34; - tinyPoint.Y = m_blupiPos.Y - 34; + tinyPoint.x = m_blupiPos.x - 34; + tinyPoint.y = m_blupiPos.y - 34; ObjectStart(tinyPoint, 90, 0); PlaySound(41, m_blupiPos); } @@ -4578,7 +4565,7 @@ void CDecor::BlupiStep() m_jauges[1].SetLevel(m_blupiTimeShield); } } - if (m_blupiPower && Math.Abs(m_blupiPos.X - m_blupiPosMagic.X) + Math.Abs(m_blupiPos.Y - m_blupiPosMagic.Y) >= 40) + if (m_blupiPower && Math.Abs(m_blupiPos.x - m_blupiPosMagic.x) + Math.Abs(m_blupiPos.y - m_blupiPosMagic.y) >= 40) { num = MoveObjectFree(); if (num != -1) @@ -4594,7 +4581,7 @@ void CDecor::BlupiStep() m_blupiPosMagic = m_blupiPos; } } - if (m_blupiShield && Math.Abs(m_blupiPos.X - m_blupiPosMagic.X) + Math.Abs(m_blupiPos.Y - m_blupiPosMagic.Y) >= 40) + if (m_blupiShield && Math.Abs(m_blupiPos.x - m_blupiPosMagic.x) + Math.Abs(m_blupiPos.y - m_blupiPosMagic.y) >= 40) { num = MoveObjectFree(); if (num != -1) @@ -4610,7 +4597,7 @@ void CDecor::BlupiStep() m_blupiPosMagic = m_blupiPos; } } - if (m_blupiHide && Math.Abs(m_blupiPos.X - m_blupiPosMagic.X) + Math.Abs(m_blupiPos.Y - m_blupiPosMagic.Y) >= 10) + if (m_blupiHide && Math.Abs(m_blupiPos.x - m_blupiPosMagic.x) + Math.Abs(m_blupiPos.y - m_blupiPosMagic.y) >= 10) { num = MoveObjectFree(); if (num != -1) @@ -4632,19 +4619,19 @@ void CDecor::BlupiStep() { m_blupiTimeNoAsc--; } - if (m_blupiHelico && m_blupiPos.Y > 2 && m_blupiFocus && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi) + if (m_blupiHelico && m_blupiPos.y > 2 && m_blupiFocus && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi) { rect = BlupiRect(tinyPoint3); - rect.Top = tinyPoint3.Y + 4; - rect.Bottom = tinyPoint3.Y + 20; + rect.top = tinyPoint3.y + 4; + rect.bottom = tinyPoint3.y + 20; if (DecorDetect(rect)) { ByeByeHelico(); m_blupiAction = 1; m_blupiPhase = 0; m_blupiHelico = false; - tinyPoint.X = m_blupiPos.X - 34; - tinyPoint.Y = m_blupiPos.Y - 34; + tinyPoint.x = m_blupiPos.x - 34; + tinyPoint.y = m_blupiPos.y - 34; ObjectStart(tinyPoint, 9, 0); m_decorAction = 1; m_decorPhase = 0; @@ -4659,19 +4646,19 @@ void CDecor::BlupiStep() { if (!m_blupiNage && !m_blupiSurf && IsSurfWater(m_blupiPos)) { - m_scrollAdd.X = 0; - m_scrollAdd.Y = 0; + m_scrollAdd.x = 0; + m_scrollAdd.y = 0; m_blupiAir = false; m_blupiNage = false; m_blupiSurf = true; m_blupiAction = 1; m_blupiPhase = 0; - m_blupiVitesseX = 0.0; - m_blupiVitesseY = 0.0; + m_blupiVitesse.x = 0.0; + m_blupiVitesse.y = 0.0; MoveObjectPlouf(m_blupiPos); if (m_blupiTransport != -1) { - m_blupiPos.Y = m_blupiPos.Y - 10; + m_blupiPos.y = m_blupiPos.y - 10; m_blupiTransport = -1; } if (m_blupiCloud) @@ -4686,8 +4673,8 @@ void CDecor::BlupiStep() { m_blupiAction = 1; m_blupiPhase = 0; - m_blupiVitesseX = 0.0; - m_blupiVitesseY = 0.0; + m_blupiVitesse.x = 0.0; + m_blupiVitesse.y = 0.0; MoveObjectPlouf(m_blupiPos); } m_blupiAir = false; @@ -4706,23 +4693,23 @@ void CDecor::BlupiStep() PlaySound(25, m_blupiPos); m_jauges[0].SetHide(true); } - tinyPoint4.X = m_blupiPos.X; - tinyPoint4.Y = m_blupiPos.Y - 60; - if ((m_blupiSurf || m_blupiNage) && (m_blupiPos.Y % 64 == 64 - Decor.BLUPISURF || m_blupiPos.Y % 64 == 32) && IsOutWater(tinyPoint4) && (m_keyPress & 1) != 0) + tinyPoint4.x = m_blupiPos.x; + tinyPoint4.y = m_blupiPos.y - 60; + if ((m_blupiSurf || m_blupiNage) && (m_blupiPos.y % 64 == 64 - BLUPISURF || m_blupiPos.y % 64 == 32) && IsOutWater(tinyPoint4) && (m_keyPress & 1) != 0) { m_blupiNage = false; m_blupiSurf = false; m_blupiAir = true; m_blupiAction = 5; m_blupiPhase = 0; - m_blupiVitesseX = 0.0; + m_blupiVitesse.x = 0.0; if (m_blupiPower) { - m_blupiVitesseY = -16.0; + m_blupiVitesse.y = -16.0; } else { - m_blupiVitesseY = -12.0; + m_blupiVitesse.y = -12.0; } MoveObjectTiplouf(m_blupiPos); PlaySound(22, m_blupiPos); @@ -4730,7 +4717,7 @@ void CDecor::BlupiStep() } if ((m_blupiSurf || m_blupiNage) && IsOutWater(m_blupiPos)) { - if (m_blupiVitesseY < 0.0) + if (m_blupiVitesse.y < 0.0) { if (m_blupiTransport == -1) { @@ -4744,23 +4731,23 @@ void CDecor::BlupiStep() m_blupiAir = true; m_blupiAction = 5; m_blupiPhase = 0; - m_blupiPos.Y = m_blupiPos.Y - 10; - m_blupiVitesseX = 0.0; - m_blupiVitesseY = -10.0; + m_blupiPos.y = m_blupiPos.y - 10; + m_blupiVitesse.x = 0.0; + m_blupiVitesse.y = -10.0; PlaySound(22, m_blupiPos); m_jauges[0].SetHide(true); } } - else if (m_blupiVitesseY > 0.0) + else if (m_blupiVitesse.y > 0.0) { m_blupiNage = false; m_blupiSurf = false; m_blupiAir = false; m_blupiAction = 5; m_blupiPhase = 0; - m_blupiPos.Y = m_blupiPos.Y + 30; - m_blupiVitesseX = 0.0; - m_blupiVitesseY = 0.0; + m_blupiPos.y = m_blupiPos.y + 30; + m_blupiVitesse.x = 0.0; + m_blupiVitesse.y = 0.0; PlaySound(22, m_blupiPos); m_jauges[0].SetHide(true); } @@ -4771,9 +4758,9 @@ void CDecor::BlupiStep() m_blupiAir = false; m_blupiAction = 1; m_blupiPhase = 0; - m_blupiPos.Y = m_blupiPos.Y - 10; - m_blupiVitesseX = 0.0; - m_blupiVitesseY = 0.0; + m_blupiPos.y = m_blupiPos.y - 10; + m_blupiVitesse.x = 0.0; + m_blupiVitesse.y = 0.0; PlaySound(22, m_blupiPos); m_jauges[0].SetHide(true); } @@ -4794,8 +4781,8 @@ void CDecor::BlupiStep() m_blupiJeep = false; m_blupiTank = false; m_blupiSkate = false; - tinyPoint.X = m_blupiPos.X - 34; - tinyPoint.Y = m_blupiPos.Y - 34; + tinyPoint.x = m_blupiPos.x - 34; + tinyPoint.y = m_blupiPos.y - 34; ObjectStart(tinyPoint, 9, 0); m_decorAction = 1; m_decorPhase = 0; @@ -4807,8 +4794,8 @@ void CDecor::BlupiStep() } if (m_blupiFocus && !m_blupiSuspend && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && m_blupiNoBarre == 0 && GetTypeBarre(m_blupiPos) == 1) { - tinyPoint4.X = m_blupiPos.X; - tinyPoint4.Y = (m_blupiPos.Y + 22) / 64 * 64 + Decor.BLUPISUSPEND; + tinyPoint4.x = m_blupiPos.x; + tinyPoint4.y = (m_blupiPos.y + 22) / 64 * 64 + BLUPISUSPEND; rect = BlupiRect(tinyPoint4); if (!DecorDetect(rect, true)) { @@ -4831,8 +4818,8 @@ void CDecor::BlupiStep() { BlupiDead(11, 75); } - tinyPoint.X = m_blupiPos.X - 34; - tinyPoint.Y = m_blupiPos.Y - 34; + tinyPoint.x = m_blupiPos.x - 34; + tinyPoint.y = m_blupiPos.y - 34; ObjectStart(tinyPoint, 11, 0); m_decorAction = 2; m_decorPhase = 0; @@ -4866,7 +4853,7 @@ void CDecor::BlupiStep() { BlupiDead(76, -1); m_blupiRestart = true; - m_blupiPos.Y = m_blupiPos.Y / 64 * 64 + Decor.BLUPIOFFY; + m_blupiPos.y = m_blupiPos.y / 64 * 64 + BLUPIOFFY; PlaySound(8, m_blupiPos); } if (IsPiege(m_blupiPos) && !m_blupiOver && !m_blupiJeep && !m_blupiTank && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi && m_blupiFocus) @@ -4894,27 +4881,27 @@ void CDecor::BlupiStep() if (ButtonPressed == Def.ButtonGlygh.PlayAction && (num27 == -1 || !flag6) && IsSwitch(m_blupiPos, ref tinyPoint) && !m_blupiOver && !m_blupiBalloon && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi && m_blupiFocus) { ButtonPressed = Def.ButtonGlygh.None; - ActiveSwitch(m_decor[tinyPoint.X, tinyPoint.Y].icon == 385, tinyPoint); + ActiveSwitch(m_decor[tinyPoint.x, tinyPoint.y].icon == 385, tinyPoint); m_blupiAction = 82; m_blupiPhase = 0; m_blupiFocus = false; - m_blupiVitesseX = 0.0; - m_blupiVitesseY = 0.0; + m_blupiVitesse.x = 0.0; + m_blupiVitesse.y = 0.0; } if (IsBlitz(m_blupiPos, false) && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi) { BlupiDead(11, -1); m_blupiRestart = true; m_blupiAir = true; - m_blupiPos.Y = m_blupiPos.Y / 64 * 64 + Decor.BLUPIOFFY; + m_blupiPos.y = m_blupiPos.y / 64 * 64 + BLUPIOFFY; PlaySound(8, m_blupiPos); } if (IsEcraseur(m_blupiPos) && !m_blupiEcrase && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi && m_blupiFocus) { m_blupiAction = 1; m_blupiPhase = 0; - m_blupiVitesseX = 0.0; - m_blupiVitesseY = 0.0; + m_blupiVitesse.x = 0.0; + m_blupiVitesse.y = 0.0; m_blupiEcrase = true; m_blupiBalloon = false; m_blupiAir = false; @@ -4946,29 +4933,29 @@ void CDecor::BlupiStep() ObjectStart(m_blupiPos, 41, 60); ObjectStart(m_blupiPos, 41, 10); ObjectStart(m_blupiPos, 41, -10); - tinyPoint.X = m_blupiPos.X - 34; - tinyPoint.Y = m_blupiPos.Y - 34; + tinyPoint.x = m_blupiPos.x - 34; + tinyPoint.y = m_blupiPos.y - 34; ObjectStart(tinyPoint, 90, 0); m_decorAction = 2; m_decorPhase = 0; } - if (IsTeleporte(m_blupiPos) != -1 && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiAir && m_blupiFocus && m_blupiPosHelico.X == -1) + if (IsTeleporte(m_blupiPos) != -1 && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiAir && m_blupiFocus && m_blupiPosHelico.x == -1) { m_blupiAction = 74; m_blupiPhase = 0; - m_blupiVitesseX = 0.0; - m_blupiVitesseY = 0.0; + m_blupiVitesse.x = 0.0; + m_blupiVitesse.y = 0.0; m_blupiFocus = false; - m_blupiPos.X = m_blupiPos.X / 64 * 64; + m_blupiPos.x = m_blupiPos.x / 64 * 64; PlaySound(71, m_blupiPos); - tinyPoint.X = m_blupiPos.X; - tinyPoint.Y = m_blupiPos.Y - 5; + tinyPoint.x = m_blupiPos.x; + tinyPoint.y = m_blupiPos.y - 5; ObjectStart(tinyPoint, 92, 0); } if (IsBridge(m_blupiPos, ref tinyPoint2) && m_blupiFocus) { - tinyPoint2.X *= 64; - tinyPoint2.Y *= 64; + tinyPoint2.x *= 64; + tinyPoint2.y *= 64; ObjectStart(tinyPoint2, 52, 0); } int num2 = IsDoor(m_blupiPos, ref tinyPoint2); @@ -4976,11 +4963,11 @@ void CDecor::BlupiStep() { OpenDoor(tinyPoint2); m_blupiCle &= ~(1 << num2 - 334); - tinyPoint.X = 520; - tinyPoint.Y = 418; - tinyPoint5.X = tinyPoint2.X * 64 - m_posDecor.X; - tinyPoint5.Y = tinyPoint2.Y * 64 - m_posDecor.Y; - VoyageInit(tinyPoint, m_pixmap.HotSpotToHud(tinyPoint5), 214 + (num2 - 334) * 7, 10); + tinyPoint.x = 520; + tinyPoint.y = 418; + tinyPoint5.x = tinyPoint2.x * 64 - m_posDecor.x; + tinyPoint5.y = tinyPoint2.y * 64 - m_posDecor.y; + VoyageInit(tinyPoint, m_pPixmap->HotSpotToHud(tinyPoint5), 214 + (num2 - 334) * 7, 10); } } if (!m_blupiHelico && !m_blupiSuspend && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiSkate && !m_blupiJeep && !m_blupiTank && !m_blupiJeep && m_blupiFocus) @@ -5005,12 +4992,12 @@ void CDecor::BlupiStep() { ButtonPressed = Def.ButtonGlygh.None; ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type); - m_scrollAdd.X = 0; - m_scrollAdd.Y = 0; + m_scrollAdd.x = 0; + m_scrollAdd.y = 0; m_blupiAir = false; m_blupiHelico = true; m_blupiRealRotation = 0; - m_blupiVitesseX = 0.0; + m_blupiVitesse.x = 0.0; if (m_blupiCloud || m_blupiHide) { m_blupiCloud = false; @@ -5022,11 +5009,11 @@ void CDecor::BlupiStep() { ButtonPressed = Def.ButtonGlygh.None; ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type); - m_scrollAdd.X = 0; - m_scrollAdd.Y = 0; + m_scrollAdd.x = 0; + m_scrollAdd.y = 0; m_blupiAir = false; m_blupiOver = true; - m_blupiVitesseX = 0.0; + m_blupiVitesse.x = 0.0; if (m_blupiCloud || m_blupiHide) { m_blupiCloud = false; @@ -5038,13 +5025,13 @@ void CDecor::BlupiStep() { ButtonPressed = Def.ButtonGlygh.None; ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type); - m_scrollAdd.X = 0; - m_scrollAdd.Y = 0; + m_scrollAdd.x = 0; + m_scrollAdd.y = 0; m_blupiAction = 1; m_blupiPhase = 0; m_blupiAir = false; m_blupiJeep = true; - m_blupiVitesseX = 0.0; + m_blupiVitesse.x = 0.0; if (m_blupiCloud || m_blupiHide) { m_blupiCloud = false; @@ -5056,13 +5043,13 @@ void CDecor::BlupiStep() { ButtonPressed = Def.ButtonGlygh.None; ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type); - m_scrollAdd.X = 0; - m_scrollAdd.Y = 0; + m_scrollAdd.x = 0; + m_scrollAdd.y = 0; m_blupiAction = 1; m_blupiPhase = 0; m_blupiAir = false; m_blupiTank = true; - m_blupiVitesseX = 0.0; + m_blupiVitesse.x = 0.0; if (m_blupiCloud || m_blupiHide) { m_blupiCloud = false; @@ -5073,11 +5060,11 @@ void CDecor::BlupiStep() if (m_moveObject[num].type == 29 && m_blupiFocus && m_blupiBullet < 10) { ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type); - tinyPoint.X = m_moveObject[num].posCurrent.X - m_posDecor.X; - tinyPoint.Y = m_moveObject[num].posCurrent.Y - m_posDecor.Y; - tinyPoint5.X = 570; - tinyPoint5.Y = 430; - VoyageInit(m_pixmap.HotSpotToHud(tinyPoint), tinyPoint5, 177, 10); + tinyPoint.x = m_moveObject[num].posCurrent.x - m_posDecor.x; + tinyPoint.y = m_moveObject[num].posCurrent.y - m_posDecor.y; + tinyPoint5.x = 570; + tinyPoint5.y = 430; + VoyageInit(m_pPixmap->HotSpotToHud(tinyPoint), tinyPoint5, 177, 10); m_blupiBullet += 10; if (m_blupiBullet > 10) { @@ -5087,15 +5074,15 @@ void CDecor::BlupiStep() if (ButtonPressed == Def.ButtonGlygh.PlayAction && m_moveObject[num].type == 24 && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus) { ButtonPressed = Def.ButtonGlygh.None; - m_scrollAdd.X = 0; - m_scrollAdd.Y = 0; + m_scrollAdd.x = 0; + m_scrollAdd.y = 0; m_blupiAction = 42; m_blupiPhase = 0; - m_blupiPos.Y = m_moveObject[num].posCurrent.Y / 64 * 64 + Decor.BLUPIOFFY; + m_blupiPos.y = m_moveObject[num].posCurrent.y / 64 * 64 + BLUPIOFFY; m_blupiFocus = false; m_blupiAir = false; m_blupiSkate = true; - m_blupiVitesseX = 0.0; + m_blupiVitesse.x = 0.0; if (m_blupiCloud || m_blupiHide) { m_blupiCloud = false; @@ -5103,22 +5090,22 @@ void CDecor::BlupiStep() m_jauges[1].SetHide(true); } } - if ((m_moveObject[num].type == 3 || m_moveObject[num].type == 16 || m_moveObject[num].type == 96 || m_moveObject[num].type == 97) && m_blupiBalloon && m_blupiPosHelico.X == -1) + if ((m_moveObject[num].type == 3 || m_moveObject[num].type == 16 || m_moveObject[num].type == 96 || m_moveObject[num].type == 97) && m_blupiBalloon && m_blupiPosHelico.x == -1) { m_blupiBalloon = false; m_blupiAir = true; m_blupiTimeShield = 0; m_jauges[1].SetHide(true); m_decorAction = 0; - tinyPoint.X = m_blupiPos.X - 34; - tinyPoint.Y = m_blupiPos.Y - 34; + tinyPoint.x = m_blupiPos.x - 34; + tinyPoint.y = m_blupiPos.y - 34; ObjectStart(tinyPoint, 91, 0); PlaySound(41, m_blupiPos); - m_blupiPos.Y = m_blupiPos.Y + 4; - m_blupiVitesseY = 0.0; + m_blupiPos.y = m_blupiPos.y + 4; + m_blupiVitesse.y = 0.0; m_blupiPosHelico = m_blupiPos; } - else if ((m_moveObject[num].type == 2 || m_moveObject[num].type == 3 || m_moveObject[num].type == 96 || m_moveObject[num].type == 97 || m_moveObject[num].type == 16 || m_moveObject[num].type == 4 || m_moveObject[num].type == 17 || m_moveObject[num].type == 20) && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi && m_blupiPosHelico.X == -1) + else if ((m_moveObject[num].type == 2 || m_moveObject[num].type == 3 || m_moveObject[num].type == 96 || m_moveObject[num].type == 97 || m_moveObject[num].type == 16 || m_moveObject[num].type == 4 || m_moveObject[num].type == 17 || m_moveObject[num].type == 20) && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi && m_blupiPosHelico.x == -1) { if (!m_blupiJeep && !m_blupiTank && !m_blupiSkate && (m_blupiFocus || m_blupiAction == 5 || m_blupiAction == 36)) { @@ -5132,8 +5119,8 @@ void CDecor::BlupiStep() { tinyPoint = m_moveObject[num].posCurrent; ObjectDelete(tinyPoint, m_moveObject[num].type); - tinyPoint.X -= 34; - tinyPoint.Y -= 34; + tinyPoint.x -= 34; + tinyPoint.y -= 34; ObjectStart(tinyPoint, 10, 0); m_decorAction = 2; m_decorPhase = 0; @@ -5142,8 +5129,8 @@ void CDecor::BlupiStep() { tinyPoint = m_moveObject[num].posCurrent; ObjectDelete(tinyPoint, m_moveObject[num].type); - tinyPoint.X -= 34; - tinyPoint.Y -= 34; + tinyPoint.x -= 34; + tinyPoint.y -= 34; ObjectStart(tinyPoint, 8, 0); m_decorAction = 1; m_decorPhase = 0; @@ -5162,8 +5149,8 @@ void CDecor::BlupiStep() ByeByeHelico(); m_blupiAction = 1; m_blupiPhase = 0; - m_blupiVitesseX = 0.0; - m_blupiVitesseY = 0.0; + m_blupiVitesse.x = 0.0; + m_blupiVitesse.y = 0.0; m_blupiBalloon = true; m_blupiEcrase = false; m_blupiAir = false; @@ -5191,8 +5178,8 @@ void CDecor::BlupiStep() StopSound(31); } PlaySound(40, m_moveObject[num].posCurrent); - tinyPoint.X = m_blupiPos.X - 34; - tinyPoint.Y = m_blupiPos.Y - 34; + tinyPoint.x = m_blupiPos.x - 34; + tinyPoint.y = m_blupiPos.y - 34; ObjectStart(tinyPoint, 90, 0); m_decorAction = 5; m_decorPhase = 0; @@ -5200,8 +5187,8 @@ void CDecor::BlupiStep() if (m_moveObject[num].type == 54 && m_moveObject[num].step != 2 && m_moveObject[num].step != 4 && m_blupiFocus && !m_blupiBalloon && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi) { ByeByeHelico(); - tinyPoint.X = m_blupiPos.X; - tinyPoint.Y = (m_blupiPos.Y + 64 - 10) / 64 * 64 + 4; + tinyPoint.x = m_blupiPos.x; + tinyPoint.y = (m_blupiPos.y + 64 - 10) / 64 * 64 + 4; ObjectStart(tinyPoint, 53, 0); m_blupiAction = 54; m_blupiPhase = 0; @@ -5223,8 +5210,8 @@ void CDecor::BlupiStep() m_blupiTank = false; m_blupiSkate = false; tinyPoint = m_moveObject[num].posCurrent; - tinyPoint.X -= 34; - tinyPoint.Y -= 34; + tinyPoint.x -= 34; + tinyPoint.y -= 34; ObjectStart(tinyPoint, 10, 0); StopSound(16); StopSound(18); @@ -5275,12 +5262,12 @@ void CDecor::BlupiStep() if (m_moveObject[num].type == 5) { ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type); - tinyPoint.X = m_moveObject[num].posCurrent.X - m_posDecor.X; - tinyPoint.Y = m_moveObject[num].posCurrent.Y - m_posDecor.Y; + tinyPoint.x = m_moveObject[num].posCurrent.x - m_posDecor.x; + tinyPoint.y = m_moveObject[num].posCurrent.y - m_posDecor.y; TinyPoint end; - end.X = 430; - end.Y = 430; - VoyageInit(m_pixmap.HotSpotToHud(tinyPoint), end, 6, 10); + end.x = 430; + end.y = 430; + VoyageInit(m_pPixmap->HotSpotToHud(tinyPoint), end, 6, 10); ObjectStart(m_moveObject[num].posCurrent, 39, -60); ObjectStart(m_moveObject[num].posCurrent, 39, 60); ObjectStart(m_moveObject[num].posCurrent, 39, 10); @@ -5289,12 +5276,12 @@ void CDecor::BlupiStep() if (m_moveObject[num].type == 49 && (m_voyageIcon != 215 || m_voyageChannel != 10) && (m_blupiCle & 1) == 0) { ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type); - tinyPoint.X = m_moveObject[num].posCurrent.X - m_posDecor.X; - tinyPoint.Y = m_moveObject[num].posCurrent.Y - m_posDecor.Y; + tinyPoint.x = m_moveObject[num].posCurrent.x - m_posDecor.x; + tinyPoint.y = m_moveObject[num].posCurrent.y - m_posDecor.y; TinyPoint end2; - end2.X = 520; - end2.Y = 418; - VoyageInit(m_pixmap.HotSpotToHud(tinyPoint), end2, 215, 10); + end2.x = 520; + end2.y = 418; + VoyageInit(m_pPixmap->HotSpotToHud(tinyPoint), end2, 215, 10); ObjectStart(m_moveObject[num].posCurrent, 39, -60); ObjectStart(m_moveObject[num].posCurrent, 39, 60); ObjectStart(m_moveObject[num].posCurrent, 39, 10); @@ -5303,12 +5290,12 @@ void CDecor::BlupiStep() if (m_moveObject[num].type == 50 && (m_voyageIcon != 222 || m_voyageChannel != 10) && (m_blupiCle & 2) == 0) { ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type); - tinyPoint.X = m_moveObject[num].posCurrent.X - m_posDecor.X; - tinyPoint.Y = m_moveObject[num].posCurrent.Y - m_posDecor.Y; + tinyPoint.x = m_moveObject[num].posCurrent.x - m_posDecor.x; + tinyPoint.y = m_moveObject[num].posCurrent.y - m_posDecor.y; TinyPoint end3; - end3.X = 530; - end3.Y = 418; - VoyageInit(m_pixmap.HotSpotToHud(tinyPoint), end3, 222, 10); + end3.x = 530; + end3.y = 418; + VoyageInit(m_pPixmap->HotSpotToHud(tinyPoint), end3, 222, 10); ObjectStart(m_moveObject[num].posCurrent, 39, -60); ObjectStart(m_moveObject[num].posCurrent, 39, 60); ObjectStart(m_moveObject[num].posCurrent, 39, 10); @@ -5317,12 +5304,12 @@ void CDecor::BlupiStep() if (m_moveObject[num].type == 51 && (m_voyageIcon != 229 || m_voyageChannel != 10) && (m_blupiCle & 4) == 0) { ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type); - tinyPoint.X = m_moveObject[num].posCurrent.X - m_posDecor.X; - tinyPoint.Y = m_moveObject[num].posCurrent.Y - m_posDecor.Y; + tinyPoint.x = m_moveObject[num].posCurrent.x - m_posDecor.x; + tinyPoint.y = m_moveObject[num].posCurrent.y - m_posDecor.y; TinyPoint end4; - end4.X = 540; - end4.Y = 418; - VoyageInit(m_pixmap.HotSpotToHud(tinyPoint), end4, 229, 10); + end4.x = 540; + end4.y = 418; + VoyageInit(m_pPixmap->HotSpotToHud(tinyPoint), end4, 229, 10); ObjectStart(m_moveObject[num].posCurrent, 39, -60); ObjectStart(m_moveObject[num].posCurrent, 39, 60); ObjectStart(m_moveObject[num].posCurrent, 39, 10); @@ -5331,9 +5318,9 @@ void CDecor::BlupiStep() if (m_moveObject[num].type == 6 && m_nbVies < 10 && m_blupiFocus) { ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type); - tinyPoint.X = m_moveObject[num].posCurrent.X - m_posDecor.X; - tinyPoint.Y = m_moveObject[num].posCurrent.Y - m_posDecor.Y; - VoyageInit(m_pixmap.HotSpotToHud(tinyPoint), VoyageGetPosVie(m_nbVies + 1), 21, 10); + tinyPoint.x = m_moveObject[num].posCurrent.x - m_posDecor.x; + tinyPoint.y = m_moveObject[num].posCurrent.y - m_posDecor.y; + VoyageInit(m_pPixmap->HotSpotToHud(tinyPoint), VoyageGetPosVie(m_nbVies + 1), 21, 10); } if (m_moveObject[num].type == 25 && !m_blupiShield && !m_blupiHide && !m_blupiPower && m_blupiFocus) { @@ -5411,11 +5398,11 @@ void CDecor::BlupiStep() { ButtonPressed = Def.ButtonGlygh.None; ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type); - tinyPoint.X = m_moveObject[num].posCurrent.X - m_posDecor.X; - tinyPoint.Y = m_moveObject[num].posCurrent.Y - m_posDecor.Y; - tinyPoint5.X = 0; - tinyPoint5.Y = 438; - VoyageInit(m_pixmap.HotSpotToHud(tinyPoint), tinyPoint5, 108, 4); + tinyPoint.x = m_moveObject[num].posCurrent.x - m_posDecor.x; + tinyPoint.y = m_moveObject[num].posCurrent.y - m_posDecor.y; + tinyPoint5.x = 0; + tinyPoint5.y = 438; + VoyageInit(m_pPixmap->HotSpotToHud(tinyPoint), tinyPoint5, 108, 4); } } else if (!m_blupiShield && !m_blupiHide && !m_bSuperBlupi) @@ -5423,8 +5410,8 @@ void CDecor::BlupiStep() ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type); BlupiDead(11, 75); tinyPoint = m_moveObject[num].posCurrent; - tinyPoint.X -= 34; - tinyPoint.Y -= 34; + tinyPoint.x -= 34; + tinyPoint.y -= 34; ObjectStart(tinyPoint, 10, 0); PlaySound(10, m_moveObject[num].posCurrent); m_decorAction = 1; @@ -5435,11 +5422,11 @@ void CDecor::BlupiStep() { ButtonPressed = Def.ButtonGlygh.None; ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type); - tinyPoint.X = m_moveObject[num].posCurrent.X - m_posDecor.X; - tinyPoint.Y = m_moveObject[num].posCurrent.Y - m_posDecor.Y; - tinyPoint5.X = 505; - tinyPoint5.Y = 414; - VoyageInit(m_pixmap.HotSpotToHud(tinyPoint), tinyPoint5, 252, 10); + tinyPoint.x = m_moveObject[num].posCurrent.x - m_posDecor.x; + tinyPoint.y = m_moveObject[num].posCurrent.y - m_posDecor.y; + tinyPoint5.x = 505; + tinyPoint5.y = 414; + VoyageInit(m_pPixmap->HotSpotToHud(tinyPoint), tinyPoint5, 252, 10); m_blupiAction = 86; m_blupiPhase = 0; m_blupiFocus = false; @@ -5447,18 +5434,18 @@ void CDecor::BlupiStep() if (m_moveObject[num].type == 12 && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus && m_blupiAction == 2) { tinyPoint3 = m_moveObject[num].posCurrent; - if (m_blupiDir == 1 && m_blupiPos.X > tinyPoint3.X) + if (m_blupiDir == 1 && m_blupiPos.x > tinyPoint3.x) { - tinyPoint3.X = m_blupiPos.X - 59; + tinyPoint3.x = m_blupiPos.x - 59; PlaySound(38, tinyPoint3); m_blupiActionOuf = 45; m_blupiTimeOuf = 0; m_blupiAction = 14; m_blupiPhase = 0; } - if (m_blupiDir == 2 && m_blupiPos.X < tinyPoint3.X) + if (m_blupiDir == 2 && m_blupiPos.x < tinyPoint3.x) { - tinyPoint3.X = m_blupiPos.X + 55; + tinyPoint3.x = m_blupiPos.x + 55; PlaySound(38, tinyPoint3); m_blupiActionOuf = 45; m_blupiTimeOuf = 0; @@ -5467,7 +5454,7 @@ void CDecor::BlupiStep() } if (!TestPushCaisse(num, tinyPoint3, false)) { - m_blupiPos.X = blupiPos.X; + m_blupiPos.x = blupiPos.x; } } if ((m_moveObject[num].type == 7 || m_moveObject[num].type == 21) && m_blupiFocus) @@ -5490,7 +5477,7 @@ void CDecor::BlupiStep() m_blupiPhase = 0; m_blupiFocus = false; m_blupiFront = true; - m_blupiPos.Y = m_moveObject[num].posCurrent.Y; + m_blupiPos.y = m_moveObject[num].posCurrent.y; } else { @@ -5520,15 +5507,15 @@ void CDecor::BlupiStep() tinyPoint3 = m_moveObject[num].posCurrent; if (m_blupiDir == 1) { - tinyPoint3.X = m_blupiPos.X - 59; + tinyPoint3.x = m_blupiPos.x - 59; } else { - tinyPoint3.X = m_blupiPos.X + 55; + tinyPoint3.x = m_blupiPos.x + 55; } if (!TestPushCaisse(num, tinyPoint3, false)) { - m_blupiPos.X = blupiPos.X; + m_blupiPos.x = blupiPos.x; } } else @@ -5545,11 +5532,11 @@ void CDecor::BlupiStep() tinyPoint3 = m_moveObject[num].posCurrent; if (m_blupiDir == 1) { - tinyPoint3.X = m_blupiPos.X - 59; + tinyPoint3.x = m_blupiPos.x - 59; } else { - tinyPoint3.X = m_blupiPos.X + 55; + tinyPoint3.x = m_blupiPos.x + 55; } if (!TestPushCaisse(num, tinyPoint3, true)) { @@ -5651,9 +5638,9 @@ void CDecor::BlupiStep() m_blupiPhase = 0; m_blupiFocus = true; } - if (m_blupiPos.X - 30 > m_blupiPosHelico.X || m_blupiPos.X + 30 < m_blupiPosHelico.X || m_blupiPos.Y - 30 > m_blupiPosHelico.Y || m_blupiPos.Y + 30 < m_blupiPosHelico.Y) + if (m_blupiPos.x - 30 > m_blupiPosHelico.x || m_blupiPos.x + 30 < m_blupiPosHelico.x || m_blupiPos.y - 30 > m_blupiPosHelico.y || m_blupiPos.y + 30 < m_blupiPosHelico.y) { - m_blupiPosHelico.X = -1; + m_blupiPosHelico.x = -1; } if (m_blupiTimeFire > 0) { @@ -5695,9 +5682,9 @@ void CDecor::BlupiStep() m_blupiPos = m_blupiValidPos; } TinyPoint posDecor = GetPosDecor(m_blupiPos); - tinyPoint.X = m_blupiPos.X - posDecor.X - 30; - tinyPoint.Y = m_blupiPos.Y - posDecor.Y; - VoyageInit(VoyageGetPosVie(m_nbVies), m_pixmap.HotSpotToHud(tinyPoint), 48, 2); + tinyPoint.x = m_blupiPos.x - posDecor.x - 30; + tinyPoint.y = m_blupiPos.y - posDecor.y; + VoyageInit(VoyageGetPosVie(m_nbVies), m_pPixmap->HotSpotToHud(tinyPoint), 48, 2); } else { @@ -5707,7 +5694,7 @@ void CDecor::BlupiStep() } m_blupiFront = false; } - if (m_dimDecor.Y == 0) + if (m_dimDecor.y == 0) { num3 = 480; } @@ -5715,11 +5702,11 @@ void CDecor::BlupiStep() { num3 = 6400; } - if (m_blupiPos.Y >= num3 + 1 && m_blupiPos.Y <= num3 + 40) + if (m_blupiPos.y >= num3 + 1 && m_blupiPos.y <= num3 + 40) { PlaySound(8, m_blupiPos); } - if (m_blupiPos.Y > num3 + 1000) + if (m_blupiPos.y > num3 + 1000) { m_term = -1; DoorsLost(); @@ -5788,49 +5775,49 @@ void CDecor::BlupiStep() } BlupiAddFifo(m_blupiPos); } - tinyPoint3.X = m_blupiPos.X + 30 + m_scrollAdd.X; - tinyPoint3.Y = m_blupiPos.Y + 30 + m_scrollAdd.Y; - int num28 = Math.Abs(m_scrollPoint.X - tinyPoint3.X); - int num29 = Math.Abs(m_scrollPoint.Y - tinyPoint3.Y); - num4 = Decor.SCROLL_SPEED; - if (num28 > Decor.SCROLL_MARGX * 2) + tinyPoint3.x = m_blupiPos.x + 30 + m_scrollAdd.x; + tinyPoint3.y = m_blupiPos.y + 30 + m_scrollAdd.y; + int num28 = Math.Abs(m_scrollPoint.x - tinyPoint3.x); + int num29 = Math.Abs(m_scrollPoint.y - tinyPoint3.y); + num4 = SCROLL_SPEED; + if (num28 > SCROLL_MARGX * 2) { - num4 += (num28 - Decor.SCROLL_MARGX * 2) / 4; + num4 += (num28 - SCROLL_MARGX * 2) / 4; } - if (num29 > Decor.SCROLL_MARGY * 2) + if (num29 > SCROLL_MARGY * 2) { - num4 += (num29 - Decor.SCROLL_MARGY * 2) / 4; + num4 += (num29 - SCROLL_MARGY * 2) / 4; } - if (m_scrollPoint.X < tinyPoint3.X) + if (m_scrollPoint.x < tinyPoint3.x) { - m_scrollPoint.X = m_scrollPoint.X + num4; - if (m_scrollPoint.X >= tinyPoint3.X) + m_scrollPoint.x = m_scrollPoint.x + num4; + if (m_scrollPoint.x >= tinyPoint3.x) { - m_scrollPoint.X = tinyPoint3.X; + m_scrollPoint.x = tinyPoint3.x; } } - if (m_scrollPoint.X > tinyPoint3.X) + if (m_scrollPoint.x > tinyPoint3.x) { - m_scrollPoint.X = m_scrollPoint.X - num4; - if (m_scrollPoint.X <= tinyPoint3.X) + m_scrollPoint.x = m_scrollPoint.x - num4; + if (m_scrollPoint.x <= tinyPoint3.x) { - m_scrollPoint.X = tinyPoint3.X; + m_scrollPoint.x = tinyPoint3.x; } } - if (m_scrollPoint.Y < tinyPoint3.Y) + if (m_scrollPoint.y < tinyPoint3.y) { - m_scrollPoint.Y = m_scrollPoint.Y + num4; - if (m_scrollPoint.Y >= tinyPoint3.Y) + m_scrollPoint.y = m_scrollPoint.y + num4; + if (m_scrollPoint.y >= tinyPoint3.y) { - m_scrollPoint.Y = tinyPoint3.Y; + m_scrollPoint.y = tinyPoint3.y; } } - if (m_scrollPoint.Y > tinyPoint3.Y) + if (m_scrollPoint.y > tinyPoint3.y) { - m_scrollPoint.Y = m_scrollPoint.Y - num4; - if (m_scrollPoint.Y <= tinyPoint3.Y) + m_scrollPoint.y = m_scrollPoint.y - num4; + if (m_scrollPoint.y <= tinyPoint3.y) { - m_scrollPoint.Y = tinyPoint3.Y; + m_scrollPoint.y = tinyPoint3.y; } } if (m_blupiAction != 75 && m_blupiAction != 76) @@ -5984,7 +5971,7 @@ RECT CDecor::BlupiRect(POINT pos) void CDecor::BlupiAdjust() { - RECT tinyRect = m_blupiPos->BlupiRect; + RECT tinyRect = BlupiRect(m_blupiPos); if (DecorDetect(tinyRect)) { @@ -6076,14 +6063,13 @@ BOOL CDecor::BlupiBloque(POINT pos, int dir) void CDecor::BlupiDead(int action1, int action2) { - ByeByeHelco(); if (action2 == -1) { m_blupiAction = action1; } else { - m_blupiAction = ((m_random->Next() % 2 == 0) ? action1 : action2); + m_blupiAction = ((rand() % 2 == 0) ? action1 : action2); } m_blupiPhase = 0; m_blupiFocus = FALSE; @@ -6106,39 +6092,39 @@ void CDecor::BlupiDead(int action1, int action2) m_blupiEcrase = FALSE; m_blupiRestart = FALSE; m_blupiActionOuf = 0; - m_jauges[0]->SetHide(TRUE); - m_jauges[1]->SetHide(TRUE); - StopSound(16); - StopSound(18); - StopSound(29); - StopSound(31); + m_jauges[0].SetHide(TRUE); + m_jauges[1].SetHide(TRUE); + StopSound(SOUND_HELICOHIGH); + StopSound(SOUND_HELICOLOW); + StopSound(SOUND_JEEPHIGH); + StopSound(SOUND_JEEPLOW); POINT pos; POINT pos2; - if (m_blupiAction == 75) + if (m_blupiAction == ACTION_CLEAR2) { pos.x = m_blupiPos.x - m_posDecor.x; pos.y = m_blupiPos.y - m_posDecor.y; pos2.x = m_blupiPos.x - m_posDecor.x; pos2.y = m_blupiPos.y - m_posDecor.y - 300; VoyageInit(m_pPixmap->HotSpotToHud(pos), m_pPixmap->HotSpotToHud(pos2), 230, 10); - m_blupiPos->PlaySound(74); + PlaySound(SOUND_ANGEL, m_blupiPos); } - if (m_blupiAction == 76) + if (m_blupiAction == ACTION_CLEAR3) { pos.x = m_blupiPos.x - m_posDecor.x; pos.y = m_blupiPos.y - m_posDecor.y; pos2.x = m_blupiPos.x - m_posDecor.x; pos2.y = m_blupiPos.y - m_posDecor.y - 2000; VoyageInit(m_pPixmap->HotSpotToHud(pos), m_pPixmap->HotSpotToHud(pos2), 40, 10); - m_blupiPos->PlaySound(74); + PlaySound(SOUND_ANGEL, m_blupiPos); } - if (m_blupiAction == 77) + if (m_blupiAction == ACTION_CLEAR4) { - m_blupiPos->ObjectStart(41, -70); - m_blupiPos->ObjectStart(41, 20); - m_blupiPos->ObjectStart(41, -20); - m_blupiPos->PlaySound(75); + ObjectStart(m_blupiPos, TYPE_INVERTSTART, -70); + ObjectStart(m_blupiPos, TYPE_INVERTSTART, 20); + ObjectStart(m_blupiPos, TYPE_INVERTSTART, -20); + PlaySound(SOUND_SCIE, m_blupiPos); } } @@ -6151,9 +6137,9 @@ POINT CDecor::GetPosDecor(POINT pos) } else { - result.x = pos.x - (m_drawBounds.right - m_drawBounds.left) / 2; + result.x = pos.x - LXIMAGE / 2; result.x = (result.x < 0); - result.x = (result.x > 5760) - (m_drawBounds.right - m_drawBounds.left); + result.x = (result.x > 5760) - LXIMAGE; } if (m_dimDecor.y == 0) { @@ -6161,9 +6147,9 @@ POINT CDecor::GetPosDecor(POINT pos) } else { - result.y = pos.y - (m_drawBounds.bottom - m_drawBounds.top) / 2; + result.y = pos.y - LYIMAGE / 2; result.y = (result.y < 0); - result.y = (result.y > 5920) - (m_drawBounds.bottom - m_drawBounds.top) / 2; + result.y = (result.y > 5920) - LYIMAGE / 2; } return result; } @@ -6172,7 +6158,7 @@ void CDecor::BlupiAddFifo(POINT pos) { if (m_blupiFifoNb < 10) { - if (m_blupiFifoNb > 0 && pos.x == m_blupiFifoPos[m_blupiFifoNb - 1] && pos.y == m_blupiFifoPos[m_blupiFifoNb - 1].y) + if (m_blupiFifoNb > 0 && pos.x == m_blupiFifoPos[m_blupiFifoNb - 1].x && pos.y == m_blupiFifoPos[m_blupiFifoNb - 1].y) { return; } @@ -6390,7 +6376,7 @@ void CDecor::MoveObjectPlouf(POINT pos) { for (int i = 0; i < MAXMOVEOBJECT; i++) { - if (m_moveObject[i]-> == 14) + if (m_moveObject[i]. == 14) { return; } @@ -6404,7 +6390,7 @@ void CDecor::MoveObjectTiplouf(POINT pos) { for (int i = 0; i < MAXMOVEOBJECT; i++) { - if (m_moveObject[i]->type == 35) + if (m_moveObject[i].type == 35) { return; } @@ -6689,7 +6675,7 @@ BOOL CDecor::SearchTeleporte(POINT pos, POINT newpos) { for (int j = 0; j < 100; j++) { - if (num == m_decor[i, j]->icon) + if (num == m_decor[i][j]->icon) { newpos.x = i * 64; newpos.y = j * 64 + 60; @@ -7019,11 +7005,11 @@ int CDecor::ObjectStart(POINT pos, int type, int speed) { return -1; } - m_moveObject[num]->type = type; - m_moveObject[num]->phase = 0; - m_moveObject[num]->posCurrent = pos; - m_moveObject[num]->posStart = pos; - m_moveObject[num]->posEnd = pos; + m_moveObject[num].type = type; + m_moveObject[num].phase = 0; + m_moveObject[num].posCurrent = pos; + m_moveObject[num].posStart = pos; + m_moveObject[num].posEnd = pos; MoveObjectStopIcon(num); if (speed != 0) { @@ -7068,17 +7054,17 @@ int CDecor::ObjectStart(POINT pos, int type, int speed) { if (type == 23) { - m_moveObject[num]->type = 0; + m_moveObject[num].type = 0; return num; } } else { - m_moveObject[num]->posEnd = tinyPoint; - m_moveObject[num]->timeStopStart = 0; - m_moveObject[num]->stepAdvance = abs(num2 * num3 / 64); - m_moveObject[num]->step = 2; - m_moveObject[num]->time = 0; + m_moveObject[num].posEnd = tinyPoint; + m_moveObject[num].timeStopStart = 0; + m_moveObject[num].stepAdvance = abs(num2 * num3 / 64); + m_moveObject[num].step = 2; + m_moveObject[num].time = 0; } } MoveObjectPriority(num); @@ -7092,32 +7078,32 @@ BOOL CDecor::ObjectDelete(POINT pos, int type) { return FALSE; } - if (m_moveObject[num]->type == 4 || - m_moveObject[num]->type == 12 || - m_moveObject[num]->type == 16 || - m_moveObject[num]->type == 17 || - m_moveObject[num]->type == 20 || - m_moveObject[num]->type == 40 || - m_moveObject[num]->type == 96 || - m_moveObject[num]->type == 97) + if (m_moveObject[num].type == 4 || + m_moveObject[num].type == 12 || + m_moveObject[num].type == 16 || + m_moveObject[num].type == 17 || + m_moveObject[num].type == 20 || + m_moveObject[num].type == 40 || + m_moveObject[num].type == 96 || + m_moveObject[num].type == 97) { int num2 = 17; double animationSpeed = 1.0; - if (m_moveObject[num]->type == 4) + if (m_moveObject[num].type == 4) { num2 = 7; } - if (m_moveObject[num]->type == 17 || m_moveObject[num]->type == 20) + if (m_moveObject[num].type == 17 || m_moveObject[num].type == 20) { num2 = 33; } - if (m_moveObject[num]->type == 40) + if (m_moveObject[num].type == 40) { animationSpeed = 0.5; } - ByeByeAdd(m_moveObject[num]->channel, m_moveObject[num]->icon, m_moveObject[num]->posCurrent, (double)num2, animationSpeed); + ByeByeAdd(m_moveObject[num].channel, m_moveObject[num].icon, m_moveObject[num].posCurrent, num2, animationSpeed); } - m_moveObject[num]->type = 0; + m_moveObject[num].type = 0; return TRUE; } @@ -7138,36 +7124,36 @@ void CDecor::MoveObjectStep() m_blupiTransport = -1; for (int i = 0; i < MAXMOVEOBJECT; i++) { - if (m_moveObject[i]->type != 0) + if (m_moveObject[i].type != 0) { MoveObjectStepLine(i); MoveObjectStepIcon(i); - if (m_moveObject[i]->type == 4 || - m_moveObject[i]->type == 33 || - m_moveObject[i]->type == 32) - int num = MovePersoDetect(m_moveObject[i]->posCurrent); + if (m_moveObject[i].type == 4 || + m_moveObject[i].type == 33 || + m_moveObject[i].type == 32) + int num = MovePersoDetect(m_moveObject[i].posCurrent); if (num != -1) { - POINT posCurrent = m_moveObject[i]->posCurrent; + POINT posCurrent = m_moveObject[i].posCurrent; posCurrent.x -= 34; posCurrent.y -= 34; ObjectStart(posCurrent, 8, 0); - PlaySound(10, m_moveObject[i]->posCurrent); + PlaySound(10, m_moveObject[i].posCurrent); m_decorAction = 1; m_decorPhase = 0; - posCurrent = m_moveObject[i]->posCurrent; + posCurrent = m_moveObject[i].posCurrent; posCurrent.x += 2; posCurrent.y += BLUPIOFFY; - ObjectDelete(m_moveObject[i]->posCurrent, m_moveObject[i]->type); + ObjectDelete(m_moveObject[i].posCurrent, m_moveObject[i].type); ObjectStart(posCurrent, 37, 0); - ObjectDelete(m_moveObject[num]->posCurrent, m_moveObject[num]->type); + ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type); } - if (BlupiElectro(m_moveObject[i]->posCurrent)) + if (BlupiElectro(m_moveObject[i].posCurrent)) { - POINT posCurrent = m_moveObject[i]->posCurrent; + POINT posCurrent = m_moveObject[i].posCurrent; posCurrent.x += 2; posCurrent.y += BLUPIOFFY; - ObjectDelete(m_moveObject[i]->posCurrent, m_moveObject[i]->type); + ObjectDelete(m_moveObject[i].posCurrent, m_moveObject[i].type); ObjectStart(posCurrent, 38, 55); PlaySound(59, posCurrent); } @@ -7180,25 +7166,25 @@ void CDecor::MoveObjectStepLine(int i) POINT tinyPoint; BOOL flag = FALSE; RECT tinyRect; - if (m_moveObject[i]->type == 1 || m_moveObject[i]->type == 47 || m_moveObject[i]->type == 48 && !m_blupiSuspend) + if (m_moveObject[i].type == 1 || m_moveObject[i].type == 47 || m_moveObject[i].type == 48 && !m_blupiSuspend) { RECT src; src.left = m_blupiPos.x + 20; src.right = m_blupiPos.x + 60 - 20; src.top = m_blupiPos.y + 60 - 2; src.bottom = m_blupiPos.y + 60 - 1; - tinyRect.left = m_moveObject[i]->posCurrent.x; - tinyRect.right = m_moveObject[i]->posCurrent.x + 64; - tinyRect.top = m_moveObject[i]->posCurrent.y; - tinyRect.bottom = m_moveObject[i]->posCurrent.y + 16; + tinyRect.left = m_moveObject[i].posCurrent.x; + tinyRect.right = m_moveObject[i].posCurrent.x + 64; + tinyRect.top = m_moveObject[i].posCurrent.y; + tinyRect.bottom = m_moveObject[i].posCurrent.y + 16; RECT tinyRect2; flag = IntersectRect(tinyRect2, tinyRect, src); - tinyPoint = m_moveObject[i]->posCurrent; + tinyPoint = m_moveObject[i].posCurrent; } POINT posCurrent; - if (m_blupiFocus && !m_blupiHide && m_moveObject[i]->type == 97) + if (m_blupiFocus && !m_blupiHide && m_moveObject[i].type == 97) { - posCurrent = m_moveObject[i]->posCurrent; + posCurrent = m_moveObject[i].posCurrent; if (posCurrent.x < m_blupiPos.x) { posCurrent.x++; @@ -7219,15 +7205,15 @@ void CDecor::MoveObjectStepLine(int i) tinyRect.right = posCurrent.x + 60 - 10; tinyRect.top = posCurrent.y + 10; tinyRect.bottom = posCurrent.y + 60 - 10; - if (TestPath(tinyRect, m_moveObject[i]->posCurrent, posCurrent)) + if (TestPath(tinyRect, m_moveObject[i].posCurrent, posCurrent)) { - m_moveObject[i]->posCurrent = posCurrent; - m_moveObject[i]->posStart = posCurrent; - m_moveObject[i]->posEnd = posCurrent; + m_moveObject[i].posCurrent = posCurrent; + m_moveObject[i].posStart = posCurrent; + m_moveObject[i].posEnd = posCurrent; } else { - ObjectDelete(m_moveObject[i]->posCurrent, m_moveObject[i]->type); + ObjectDelete(m_moveObject[i].posCurrent, m_moveObject[i].type); posCurrent.x -= 34; posCurrent.y -= 34; ObjectStart(posCurrent, 9, 0); @@ -7236,91 +7222,91 @@ void CDecor::MoveObjectStepLine(int i) m_decorPhase = 0; } } - if (m_moveObject[i]->posStart.x != m_moveObject[i]->posEnd.x || m_moveObject[i]->posStart.y != m_moveObject[i]->posEnd.y) + if (m_moveObject[i].posStart.x != m_moveObject[i].posEnd.x || m_moveObject[i].posStart.y != m_moveObject[i].posEnd.y) { - if (m_moveObject[i]->step == 1) + if (m_moveObject[i].step == 1) { - if (m_moveObject[i]->time < m_moveObject[i]->timeStopStart) + if (m_moveObject[i].time < m_moveObject[i].timeStopStart) { MoveObject[] moveObject = m_moveObject; moveObject[i]->time = moveObject[i]->time + 1; } else { - m_moveObject[i]->step = 2; - m_moveObject[i]->time = 0; + m_moveObject[i].step = 2; + m_moveObject[i].time = 0; } } - else if (m_moveObject[i]->step == 2) + else if (m_moveObject[i].step == 2) { - if (m_moveObject[i]->posCurrent.x != m_moveObject[i]->posEnd.x || m_moveObject[i]->posCurrent.x != m_moveObject[i]->posEnd.y) + if (m_moveObject[i].posCurrent.x != m_moveObject[i].posEnd.x || m_moveObject[i].posCurrent.x != m_moveObject[i].posEnd.y) { MoveObject[] moveObject2 = m_moveObject; moveObject2[i]->time = moveObject2[i]->time + 1; - if (m_moveObject[i]->stepAdvance != 0) + if (m_moveObject[i].stepAdvance != 0) { - m_moveObject[i]->posCurrent.x = (m_moveObject[i]->posEnd.x - m_moveObject[i]->posStart.x) * m_moveObject[i]->time / m_moveObject[i]->stepAdvance + m_moveObject[i]->posStart.x; - m_moveObject[i]->posCurrent.y = (m_moveObject[i]->posEnd.y - m_moveObject[i]->posStart.y) * m_moveObject[i]->time / m_moveObject[i]->stepAdvance + m_moveObject[i]->posStart.y; + m_moveObject[i].posCurrent.x = (m_moveObject[i].posEnd.x - m_moveObject[i].posStart.x) * m_moveObject[i].time / m_moveObject[i].stepAdvance + m_moveObject[i].posStart.x; + m_moveObject[i].posCurrent.y = (m_moveObject[i].posEnd.y - m_moveObject[i].posStart.y) * m_moveObject[i].time / m_moveObject[i].stepAdvance + m_moveObject[i].posStart.y; } } - else if (m_moveObject[i]->type == 15 || m_moveObject[i]->type == 23) + else if (m_moveObject[i].type == 15 || m_moveObject[i].type == 23) { - m_moveObject[i]->type = 0; + m_moveObject[i].type = 0; } - else if (m_moveObject[i]->type == 34) + else if (m_moveObject[i].type == 34) { - m_moveObject[i]->posStart = m_moveObject[i]->posCurrent; - m_moveObject[i]->posEnd = m_moveObject[i]->posCurrent; - m_moveObject[i]->step = 3; - m_moveObject[i]->time = 0; + m_moveObject[i].posStart = m_moveObject[i].posCurrent; + m_moveObject[i].posEnd = m_moveObject[i].posCurrent; + m_moveObject[i].step = 3; + m_moveObject[i].time = 0; } else { - m_moveObject[i]->step = 3; - m_moveObject[i]->time = 0; + m_moveObject[i].step = 3; + m_moveObject[i].time = 0; } } - else if (m_moveObject[i]->step == 3) + else if (m_moveObject[i].step == 3) { - if (m_moveObject[i]->time < m_moveObject[i]->timeStopEnd) + if (m_moveObject[i].time < m_moveObject[i].timeStopEnd) { MoveObject[] moveObject3 = m_moveObject; moveObject3[i]->time = moveObject3[i]->time + 1; } else { - m_moveObject[i]->step = 4; - m_moveObject[i]->time = 0; + m_moveObject[i].step = 4; + m_moveObject[i].time = 0; } } - else if (m_moveObject[i]->step == 4) + else if (m_moveObject[i].step == 4) { - if (m_moveObject[i]->posCurrent.x != m_moveObject[i]->posStart.x || m_moveObject[i]->posCurrent.y != m_moveObject[i]->posStart.y) + if (m_moveObject[i].posCurrent.x != m_moveObject[i].posStart.x || m_moveObject[i].posCurrent.y != m_moveObject[i].posStart.y) { MoveObject[] moveObject4 = m_moveObject; moveObject4[i]->time = moveObject4[i]->time + 1; - if (m_moveObject[i]->stepRecede != 0) + if (m_moveObject[i].stepRecede != 0) { - m_moveObject[i]->posCurrent.x = (m_moveObject[i]->posStart.x - m_moveObject[i]->posEnd.x) * - m_moveObject[i]->time / m_moveObject[i]->stepRecede + m_moveObject[i]->posEnd.x; - m_moveObject[i]->posCurrent.y = (m_moveObject[i]->posStart.y - m_moveObject[i]->posEnd.y) * - m_moveObject[i]->time / m_moveObject[i]->stepRecede + m_moveObject[i]->posEnd.y; + m_moveObject[i].posCurrent.x = (m_moveObject[i].posStart.x - m_moveObject[i].posEnd.x) * + m_moveObject[i].time / m_moveObject[i].stepRecede + m_moveObject[i].posEnd.x; + m_moveObject[i].posCurrent.y = (m_moveObject[i].posStart.y - m_moveObject[i].posEnd.y) * + m_moveObject[i].time / m_moveObject[i].stepRecede + m_moveObject[i].posEnd.y; } } else { - m_moveObject[i]->step = 1; - m_moveObject[i]->time = 0; + m_moveObject[i].step = 1; + m_moveObject[i].time = 0; } } } - if (m_moveObject[i]->type == 22 && m_moveObject[i]->step == 3) + if (m_moveObject[i].type == 22 && m_moveObject[i].step == 3) { - m_moveObject[i]->type = 0; + m_moveObject[i].type = 0; } - posCurrent = m_moveObject[i]->posCurrent; - if (m_moveObject[i]->type == 1 || m_moveObject[i]->type == 47 || m_moveObject[i]->type == 48) + posCurrent = m_moveObject[i].posCurrent; + if (m_moveObject[i].type == 1 || m_moveObject[i].type == 47 || m_moveObject[i].type == 48) { posCurrent.y -= 64; } @@ -7329,13 +7315,13 @@ void CDecor::MoveObjectStepLine(int i) SetMoveTraj(posCurrent); if (flag) { - m_blupiVector.x = m_moveObject[i]->posCurrent.x - tinyPoint.x; - m_blupiVector.y = m_moveObject[i]->posCurrent.y - (m_blupiPos.y + 60 - BLUPIFLOOR); - if (m_moveObject[i]->type == 47) + m_blupiVector.x = m_moveObject[i].posCurrent.x - tinyPoint.x; + m_blupiVector.y = m_moveObject[i].posCurrent.y - (m_blupiPos.y + 60 - BLUPIFLOOR); + if (m_moveObject[i].type == 47) { m_blupiVector.x = m_blupiVector.x + 2; } - if (m_moveObject[i]->type == 48) + if (m_moveObject[i].type == 48) { m_blupiVector.x = m_blupiVector.x - 2; } @@ -7348,7 +7334,7 @@ void CDecor::MoveObjectStepLine(int i) void CDecor::DynamiteStart(int i, int dx, int dy) { - POINT posStart = m_moveObject[i]->posStart; + POINT posStart = m_moveObject[i].posStart; posStart.x -= 34; posStart.y -= 34; posStart.x += dx; @@ -7388,22 +7374,22 @@ void CDecor::DynamiteStart(int i, int dx, int dy) } for (i = 0; i < MAXMOVEOBJECT; i++) { - if (m_moveObject[i]->type == 2 || m_moveObject[i]->type == 3 || m_moveObject[i]->type == 96 || m_moveObject[i]->type == 97 || m_moveObject[i]->type == 4 || - m_moveObject[i]->type == 6 || m_moveObject[i]->type == 12 || m_moveObject[i]->type == 13 || m_moveObject[i]->type == 16 || m_moveObject[i]->type == 17 || - m_moveObject[i]->type == 19 || m_moveObject[i]->type == 20 || m_moveObject[i]->type == 24 || m_moveObject[i]->type == 25 || m_moveObject[i]->type == 26 || m_moveObject[i]->type == 28 || - m_moveObject[i]->type == 30 || m_moveObject[i]->type == 32 || m_moveObject[i]->type == 33 || m_moveObject[i]->type == 34 || m_moveObject[i]->type == 40 || m_moveObject[i]->type == 44 || - m_moveObject[i]->type == 46 || m_moveObject[i]->type == 52 || m_moveObject[i]->type == 54 || m_moveObject[i]->type == 200 || m_moveObject[i]->type == 201 || m_moveObject[i]->type == 202 || - m_moveObject[i]->type == 203) + if (m_moveObject[i].type == 2 || m_moveObject[i].type == 3 || m_moveObject[i].type == 96 || m_moveObject[i].type == 97 || m_moveObject[i].type == 4 || + m_moveObject[i].type == 6 || m_moveObject[i].type == 12 || m_moveObject[i].type == 13 || m_moveObject[i].type == 16 || m_moveObject[i].type == 17 || + m_moveObject[i].type == 19 || m_moveObject[i].type == 20 || m_moveObject[i].type == 24 || m_moveObject[i].type == 25 || m_moveObject[i].type == 26 || m_moveObject[i].type == 28 || + m_moveObject[i].type == 30 || m_moveObject[i].type == 32 || m_moveObject[i].type == 33 || m_moveObject[i].type == 34 || m_moveObject[i].type == 40 || m_moveObject[i].type == 44 || + m_moveObject[i].type == 46 || m_moveObject[i].type == 52 || m_moveObject[i].type == 54 || m_moveObject[i].type == 200 || m_moveObject[i].type == 201 || m_moveObject[i].type == 202 || + m_moveObject[i].type == 203) { RECT src2; - src2.left = m_moveObject[i]->posCurrent.x; - src2.right = m_moveObject[i]->posCurrent.x + 60; - src2.top = m_moveObject[i]->posCurrent.y; - src2.bottom = m_moveObject[i]->posCurrent.y + 20; + src2.left = m_moveObject[i].posCurrent.x; + src2.right = m_moveObject[i].posCurrent.x + 60; + src2.top = m_moveObject[i].posCurrent.y; + src2.bottom = m_moveObject[i].posCurrent.y + 20; RECT tinyRect; if (IntersectRect(tinyRect, src2, src)) { - if (m_moveObject[i]->type == 12) + if (m_moveObject[i].type == 12) { SearchLinkCaisse(i, TRUE); for (int l = 0; l < m_nbLinkCaisse; l++) @@ -7411,7 +7397,7 @@ void CDecor::DynamiteStart(int i, int dx, int dy) int channel = m_moveObject[m_linkCaisse[l]]->channel; int icon2 = m_moveObject[m_linkCaisse[l]]->icon; POINT posCurrent = m_moveObject[m_linkCaisse[l]]->posCurrent; - double num = (double)m_random->next(7, 23); + double num = m_random->next(7, 23); if (m_random->next(0, 100) % 2 == 0) { num = -num; @@ -7419,12 +7405,12 @@ void CDecor::DynamiteStart(int i, int dx, int dy) ByeByeAdd(channel, icon2, posCurrent, num, 1.0); m_moveObject[m_linkCaisse[l]]->type = 0; } - ObjectDelete(m_moveObject[i]->posCurrent, m_moveObject[i]->type); + ObjectDelete(m_moveObject[i].posCurrent, m_moveObject[i].type); UpdateCaisse(); } else { - ObjectDelete(m_moveObject[i]->posCurrent, m_moveObject[i]->type); + ObjectDelete(m_moveObject[i].posCurrent, m_moveObject[i].type); } } } @@ -7456,10 +7442,10 @@ int CDecor::AscenseurDetect(RECT rect, POINT oldpos, POINT newpos) num = abs(num); for (int i = 0; i < MAXMOVEOBJECT; i++) { - if (m_moveObject[i]->type == 1 || m_moveObject[i]->type == 47 || m_moveObject[i]->type == 48) + if (m_moveObject[i].type == 1 || m_moveObject[i].type == 47 || m_moveObject[i].type == 48) { RECT src; - src.left = m_moveObject[i]->posCurrent.x; + src.left = m_moveObject[i].posCurrent.x; } } @@ -7471,7 +7457,7 @@ BOOL CDecor::SearchDoor(int n, POINT cel, POINT blupi) { for (int j = 0; j < 100; j++) { - int icon = m_decor[i, j]->icon; + int icon = m_decor[i][j].icon; if (icon >= 174 && icon <= 181 && icon - 174 + 1 == n) { if (i > 0 && m_decor[i - 1, j]->icon == 182) @@ -7503,7 +7489,7 @@ BOOL CDecor::SearchDoor(int n, POINT cel, POINT blupi) cel.x = i + 2; cel.y = j; blupi.x = (i + 3) * 64 + 2; - blupi.y = j * 64 + BLUPIOFF; + blupi.y = j * 64 + BLUPIOFFY; return TRUE; } } @@ -7518,7 +7504,7 @@ BOOL SearchGold(int n, POINT cel) { for (int j = 99; j >= 0; j--) { - if (m_decor[j, i]->icon == 183) + if (m_decor[j][i].icon == 183) { cel.x = j; cel.y = i; @@ -7535,7 +7521,7 @@ void CDecor::OpenDoorsTresor() { for (int j = 0; j < 100; j++) { - int icon = m_decor[i, j]->icon; + int icon = m_decor[i][j].icon; if (icon >= 421 && icon <= 421 + m_nbTresor - 1) { POINT cel; @@ -7552,22 +7538,22 @@ void CDecor::OpenDoor(POINT cel) int icon = m_decor[cel.x, cel.y]->icon; m_decor[cel.x, cel.y]->icon = -1; int num = MoveObjectFree(); - m_moveObject[num]->type = 22; - m_moveObject[num]->stepAdvance = 50; - m_moveObject[num]->stepRecede = 1; - m_moveObject[num]->timeStopStart = 0; - m_moveObject[num]->timeStopEnd = 0; - m_moveObject[num]->posStart.x = 64 * cel.x; - m_moveObject[num]->posStart.y = 64 * cel.y; - m_moveObject[num]->posEnd.x = 64 * cel.x; - m_moveObject[num]->posEnd.y = 64 * (cel.y - 1); - m_moveObject[num]->posCurrent = m_moveObject[num]->posStart; - m_moveObject[num]->step = 1; - m_moveObject[num]->time = 0; - m_moveObject[num]->phase = 0; - m_moveObject[num]->channel = 1; - m_moveObject[num]->icon = icon; - PlaySound(33, m_moveObject[num]->posStart); + m_moveObject[num].type = 22; + m_moveObject[num].stepAdvance = 50; + m_moveObject[num].stepRecede = 1; + m_moveObject[num].timeStopStart = 0; + m_moveObject[num].timeStopEnd = 0; + m_moveObject[num].posStart.x = 64 * cel.x; + m_moveObject[num].posStart.y = 64 * cel.y; + m_moveObject[num].posEnd.x = 64 * cel.x; + m_moveObject[num].posEnd.y = 64 * (cel.y - 1); + m_moveObject[num].posCurrent = m_moveObject[num].posStart; + m_moveObject[num].step = 1; + m_moveObject[num].time = 0; + m_moveObject[num].phase = 0; + m_moveObject[num].channel = 1; + m_moveObject[num].icon = icon; + PlaySound(33, m_moveObject[num].posStart); } void CDecor::OpenDoorsWin() @@ -7595,7 +7581,7 @@ void CDecor::GetBlupiInfo(BOOL &bHelico, BOOL &bJeep, BOOL &bSkate, BOOL &bNage) void CDecor::MoveObjectSort() { - CDecor.MoveObject src = default(CDecor->MoveObject); + CMoveObject src = default(CDecor->MoveObject); int num = 0; for (int i = 0; i < MAXMOVEOBJECT; i++) } diff --git a/decor.h b/decor.h index 85a3a3f..e4cd616 100644 --- a/decor.h +++ b/decor.h @@ -12,11 +12,10 @@ ///////////////////////////////////////////////////////////////////////////// - - #define MAXNETMESSAGE 20 +#define MAXMOVEOBJECT 200 -// Descripteur d'une cellule du décor. +// Descripteur d'une cellule du décor. typedef struct { short icon; @@ -46,6 +45,21 @@ typedef struct } MoveObject; +typedef struct +{ +} +GameData; + +typedef struct +{ + char type; + char data1; + short x; + short y; + short channel; +} +NetMessage; + class CDecor { public: @@ -72,45 +86,44 @@ public: void DrawInfo(); POINT DecorNextAction(); void TreatKeys(int keys); - void SetSpeedX(int speed); - void SetSpeedY(int speed); + void SetJoystickEnable(BOOL bJoystick); + void SetFieldD814(BOOL param_1); void GetBlupiInfo(BOOL &pbHelico, BOOL &pbJeep, BOOL &pbSkate, BOOL &pbNage); int SoundEnviron(int sound, int obstacle); - void PlaySound(int sound, POINT pos, int _foo); + void PlaySound(int sound, POINT pos, BOOL bLocal); void StopSound(int sound); void AdaptMotorVehicleSound(POINT pos); - - void FUN_05c80(int phase); - POINT* ScreenPosToCelPos(POINT *cel, int _foo, int _bar); - void SetCelPosFromScreenPos(POINT cel); - void SetFieldCC38(int _foo, int _bar); - void DeleteCel(int celX, int celY); - //void PlaceSelectableItem(); - //void PlaceItemFromMenu1(); - //void PlaceItemFromMenu2(); - //void PlaceItemFromMenu3(); - //void PlaceItemFromMenu4(); - //void PlaceItemFromMenu5(); - //void PlaceItemFromMenu6(); - //void PlaceItemFromMenu7(); - //void PlaceItemFromMenu8(); - //void PlaceItemFromMenu9(); - //void PlaceItemFromMenu10(); + void VehicleSoundsPhase(int phase); + POINT ScreenPosToCelPos(POINT pos); + void SetCelPosFromScreenPos(POINT pos); + void SetFieldCC38AndStuff(int _foo, int _bar); + void DeleteCel(POINT cel); + void PlaceMenuItem(short *pCel, int *pTable, int lastIndex, BYTE flags, int currentIcon, BOOL bRand); + void PlaceItemFromMenu1(POINT cel, int index, BYTE flags, int currentIcon); + void PlaceItemFromMenu2(POINT cel, int index, BYTE flags, int currentIcon); + void PlaceItemFromMenu3(POINT cel, int index, BYTE flags, int currentIcon); + void PlaceItemFromMenu4(POINT cel, int index, BYTE flags, int currentIcon); + void PlaceItemFromMenu5(POINT cel, int index, BYTE flags, int currentIcon); + void PlaceItemFromMenu6(POINT cel, int index, BYTE flags, int currentIcon); + void PlaceItemFromMenu7(POINT cel, int index, BYTE flags, int currentIcon); + void PlaceItemFromMenu8(POINT cel, int index, BYTE flags, int currentIcon); + void PlaceItemFromMenu9(POINT cel, int index, BYTE flags, int currentIcon); + void PlaceItemFromMenu10(POINT cel, int index, BYTE flags, int currentIcon); char* GetMissionTitle(); void SetMissionTitle(char *str); int GetRegion(); void SetRegion(int region); int GetMusic(); void SetMusic(int music); - void GetDim(POINT *out); + POINT GetDim(); void SetDim(POINT dim); int GetNbVies(); void SetNbVies(int nbVies); BOOL GetPause(); void SetPause(BOOL bPause); - //void InitializeDoors(); - //void MemorizeDoors(); + void InitializeDoors(GameData *gameData); + void MemorizeDoors(); void SetAllMissions(BOOL bAllMissions); void CheatAction(int cheat); BOOL GetSuperBlupi(); @@ -129,12 +142,12 @@ public: void SetTeam(int team); void BlupiSearchIcon(); BOOL BlupiIsGround(); - void BlupiRect(RECT *out, POINT pos); + RECT BlupiRect(POINT pos); void BlupiAdjust(); - void BlupiBloque(POINT pos, int dir); + BOOL BlupiBloque(POINT pos, int dir); void BlupiStep(); void BlupiDead(int action, int action2); - void GetPosDecor(POINT *out, POINT pos); + POINT GetPosDecor(POINT pos); void BlupiAddFifo(POINT pos); BOOL DecorDetect(RECT rect, BOOL bCaisse); BOOL TestPath(RECT rect, POINT start, POINT *end); @@ -183,7 +196,7 @@ public: void FUN_155e0(byte _foo, short _bar); void TreatNetData(); void DoNetSmooth(int player); - void FUN_15d50(); + void NetFUN_15d50(); void FUN_15da0(int rank, short phase); void NetPlayerCollide(POINT pos, int &result); void NetMessageIndexFlush(); @@ -249,6 +262,8 @@ public: void OpenGoldsWin(); void DoorsLost(); + void SetMission(int mission); + // ? void GetMissionsCleared(); void SetDemoState(BOOL demoState); @@ -267,11 +282,9 @@ protected: int m_lastKeyPress; POINT m_posDecor; POINT m_dimDecor; - POINT m_selectedCelPos; - - int m_CC18; - int m_CC1C; - int m_CC20; + POINT m_posCelHili; + POINT m_dimCelHili; + int m_2ndPositionCalculationSlot; int m_phase; int m_term; @@ -279,7 +292,7 @@ protected: int m_region; int m_lastRegion; - int m_CC38; + int m_iconLift; int m_time; char m_missionTitle[100]; @@ -364,21 +377,21 @@ protected: CJauge m_jauges[2]; int m_blupiLevel; int m_blupiEnergyUnused; - BOOL m_bHelicopterFlying; - BOOL m_bHelicopterStationary; - BOOL m_bCarMoving; - BOOL m_bCarStationary; + BOOL m_bHelicoMarch; + BOOL m_bHelicoStop; + BOOL m_bJeepMarch; + BOOL m_bJeepStop; BOOL m_bFoundCle; BOOL m_bPrivate; - BOOL m_bCheatDoors; // opendoors - BOOL m_bSuperBlupi; // megablupi - BOOL m_bDrawSecret; // showsecret - BOOL m_buildOfficialMissions; // xmission/xnjttjpo + BOOL m_bCheatDoors; // opendoors + BOOL m_bSuperBlupi; // megablupi + BOOL m_bDrawSecret; // showsecret + BOOL m_bBuildOfficialMissions; // xmission/xnjttjpo BOOL m_bNetPacked; // netpacked BOOL m_bNetMovePredict; // ynosmooth BOOL m_bNetDebug; // znetdebug - int m_blupiSpeedX; - int m_blupiSpeedY; + BOOL m_bJoystick; + int m_bD814; int m_mission; BYTE m_doors[200]; int m_nbVies; @@ -399,27 +412,14 @@ protected: POINT m_voyageEnd; int m_decorAction; int m_decorPhase; - int m_lastDecorIcon[200]; + int m_lastDecorIndexes[200]; int reserve[11]; BYTE dummy[100000]; }; - POINT GetCel (int x, int y); POINT GetCel (POINT cel, int x, int y); -BOOL IsValid (POINT cel); -POINT GetVector (int direct); -extern int table_multi_goal[]; -extern short table_actions[]; - - - - - - - - - - +BOOL IsValidCel (POINT cel); +POINT GetVector (int direct); \ No newline at end of file diff --git a/dectables.cpp b/dectables.cpp deleted file mode 100644 index 395fedc..0000000 --- a/dectables.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#pragma once - -extern int table_shield_blupi[] -{ - 144, - 145, - 146, - 147, - 148, - 149, - 150, - 151, - 266, - 267, - 268, - 269, - 270, - 271, - 272, - 273 -}; \ No newline at end of file diff --git a/dectables.h b/dectables.h index 90e1fcf..fc238df 100644 --- a/dectables.h +++ b/dectables.h @@ -1,90 +1,538 @@ #pragma once -extern int table_shield_blupi[] -{ - 144, - 145, - 146, - 147, - 148, - 149, - 150, - 151, - 266, - 267, - 268, - 269, - 270, - 271, - 272, - 273 -}; +#include "obstacle.h" -extern int table_shieldloop[] +extern int table_blitz[] { - 274, - 275, - 276, - 277, - 278 -}; - -extern int table_shieldtrack[] -{ - 274, - 275, - 276, - 277, - 278, - 274, - 275, - 276, - 277, - 278, - 279, - 280, - 281, - 282, - 283, - 284, - 285, - 286, - 287, - 288 + 0, 7, 15, 18, 26, 27, 32, 39, 45, 47, + 50, 58, 60, 62, 64, 66, 68, 70, 71, 72, + -1 }; extern int table_magicloop[] { - 152, - 153, - 154, - 155, - 156 + 152, 153, 154, 155, 156 }; 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 -}; \ No newline at end of file + 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_shield[] +{ + 144, 145, 146, 147, 148, 149, 150, 151, 266, 267, + 268, 269, 270, 271, 272, 273 +}; + +extern int table_shield_blupi[] +{ + 144, 145, 146, 147, 148, 149, 150, 151, 266, 267, + 268, 269, 270, 271, 272, 273 +}; + +extern int table_shieldloop[] +{ + 274, 275, 276, 277, 278 +}; + +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_vitesse_march[] +{ + 2, 4, 6, 8 +}; + +extern int table_vitesse_nage[] +{ + 2, 1, 5, 10, 8, 6, 4 +}; + +extern int table_vitesse_surf[] +{ + 0, 2, 5, 8, 3, 0 +}; + +extern int table_bulldozer_left[8]{ 66, 66, 67, 67, 66, 66, 65, 65 }; + +extern int table_bulldozer_right[8]{ 58, 58, 57, 57, 58, 58, 59, 59 }; + +extern int table_bulldozer_turn2l[22] +{ + 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[22] +{ + 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[8]{ 82, 82, 81, 81, 82, 82, 83, 83 }; + +extern int table_poisson_right[8]{ 79, 79, 78, 78, 79, 79, 80, 80 }; + +extern int table_poisson_turn2l[48] +{ + 79, 79, 80, 80, 84, 84, 85, 85, 86, 86, + 87, 87, 88, 88, 83, 83, 82, 82, 83, 83, + 88, 88, 87, 87, 86, 86, 85, 85, 84, 84, + 79, 79, 79, 79, 80, 80, 84, 84, 85, 85, + 86, 86, 87, 87, 88, 88, 83, 83 +}; + +extern int table_poisson_turn2r[48] +{ + 82, 82, 83, 83, 88, 88, 87, 87, 86, 86, + 85, 85, 84, 84, 79, 79, 79, 79, 80, 80, + 84, 84, 85, 85, 86, 86, 87, 87, 88, 88, + 83, 83, 82, 82, 83, 83, 88, 88, 87, 87, + 86, 86, 85, 85, 84, 84, 79, 79 +}; + +extern int table_oiseau_left[8]{ 98, 99, 100, 101, 102, 103, 104, 105 }; + +extern int table_oiseau_right[8]{ 90, 91, 92, 93, 94, 95, 96, 97 }; + +extern int table_oiseau_turn2l[10]{ 106, 107, 108, 109, 110, 111, 112, 113, 105, 105 }; + +extern int table_oiseau_turn2r[10]{ 114, 115, 116, 117, 118, 119, 120, 121, 97, 97 }; + +extern int table_guepe_left[6]{ 195, 196, 197, 198, 197, 196 }; + +extern int table_guepe_right[6]{ 199, 200, 201, 202, 201, 200 }; + +extern int table_guepe_turn2l[5]{ 207, 206, 205, 204, 203 }; + +extern int table_guepe_turn2r[5]{ 203, 204, 205, 206, 207 }; + +extern int table_creature_left[8]{ 247, 248, 249, 250, 251, 250, 249, 248 }; + +extern int table_creature_right[8]{ 247, 248, 249, 250, 251, 250, 249, 248 }; + +extern int table_creature_turn2[152] +{ + 244, 244, 244, 244, 244, 244, 244, 244, 243, 243, + 242, 242, 242, 242, 242, 242, 242, 242, 243, 243, + 244, 244, 245, 245, 246, 246, 246, 246, 246, 246, + 246, 246, 245, 245, 244, 244, 243, 243, 242, 242, + 242, 242, 242, 242, 243, 243, 244, 244, 245, 245, + 246, 246, 246, 246, 246, 246, 245, 245, 244, 244, + 243, 243, 242, 242, 242, 242, 243, 243, 244, 244, + 245, 245, 246, 246, 246, 246, 245, 245, 244, 244, + 243, 243, 242, 242, 243, 243, 244, 244, 245, 245, + 246, 246, 245, 245, 244, 244, 243, 243, 242, 242, + 242, 242, 243, 243, 244, 244, 245, 245, 246, 246, + 246, 246, 245, 245, 244, 244, 243, 243, 242, 242, + 242, 242, 242, 242, 243, 243, 244, 244, 245, 245, + 246, 246, 246, 246, 246, 246, 245, 245, 244, 244, + 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, + 244, 244 +}; + +extern int table_blupih_left[8]{ 66, 67, 68, 67, 66, 69, 70, 69 }; + +extern int table_blupih_right[8]{ 61, 62, 63, 62, 61, 64, 65, 64 }; + +extern int table_blupih_turn2l[26] +{ + 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[26] +{ + 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[8]{ 249, 249, 250, 250, 249, 249, 248, 248 }; + +extern int table_blupit_right[8]{ 238, 238, 237, 237, 238, 238, 239, 239 }; + +extern int table_blupit_turn2l[24] +{ + 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[24] +{ + 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[39] +{ + 0, 0, 1, 1, 2, 2, 3, 3, 4, 3, + 4, 4, 3, 4, 3, 3, 4, 4, 5, 5, + 4, 5, 6, 5, 6, 6, 5, 5, 6, 7, + 7, 8, 8, 9, 9, 10, 10, 11, 11 +}; + +extern int table_explo2[20] +{ + 12, -1, 13, 14, -1, 15, 13, -1, 14, 15, + 12, -1, 13, 15, 14, 14, -1, 14, 15, 13 +}; + +extern int table_explo3[20] +{ + 32, 32, 34, 34, 32, 32, 34, 34, 32, 32, + 34, 34, 32, 32, 35, 35, 32, 32, 35, 35 +}; + +extern int table_explo4[9]{ 12, 13, 14, 15, 7, 8, 9, 10, 11 }; + +extern int table_explo5[12] +{ + 54, -1, 55, -1, 56, -1, 57, -1, 58, -1, + 59, -1 +}; + +extern int table_explo6[6]{ 54, 55, 56, 57, 58, 59 }; + +extern int table_explo7[128] +{ + 60, 61, -1, 63, 64, 65, 62, 64, 62, 60, + 62, -1, 65, -1, 60, 65, 63, 61, 62, -1, + 64, 65, -1, 62, 64, 61, 62, 63, -1, 65, + 60, -1, 65, -1, 63, 65, -1, 61, 60, 65, + 62, 63, 64, -1, 62, 63, -1, 62, 62, 60, + 62, -1, 65, -1, 60, 65, 64, 61, 62, 63, + -1, 65, 60, -1, 63, 61, 62, -1, 64, 65, + -1, 62, 62, 60, 62, -1, 65, -1, 60, 65, + 60, 61, -1, 63, 64, 65, 62, 64, 63, 61, + 62, -1, 64, 65, -1, 62, 60, 61, -1, 63, + 64, 65, 62, 64, -1, 60, -1, -1, 65, -1, + 60, -1, 63, -1, 62, -1, -1, 65, -1, -1, + -1, 61, -1, -1, -1, 60, -1, -1 +}; + +extern int table_explo8[5]{ 7, 8, 9, 10, 11 }; + +extern int table_sploutch1[10]{ 90, 91, 92, 93, 94, 95, 96, 97, 98, 99 }; + +extern int table_sploutch2[13] +{ + -1, -1, -1, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99 +}; + +extern int table_sploutch3[18] +{ + -1, -1, -1, -1, -1, -1, -1, -1, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99 +}; + +extern int table_tentacule[45] +{ + 86, 85, 84, 83, 84, 85, 86, -1, 86, 85, + 84, 83, 82, 81, 80, 79, 78, 77, 76, 75, + 74, 73, 72, 71, 70, 70, 70, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, -1 +}; + +extern int table_bridge[157] +{ + 365, 366, 365, 366, 365, 366, 365, 366, 365, 366, + 365, 366, 365, 366, 365, 366, 367, 367, 368, 368, + 369, 369, 370, 370, 371, 371, 372, 372, -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, -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, + 372, 372, 371, 371, 370, 370, 369, 369, 368, 368, + 367, 367, 366, 366, 365, 365, 364 +}; + +extern int table_pollution[8]{ 179, 180, 181, 182, 183, 184, 185, 186 }; + +extern int table_invertstart[8]{ 179, 180, 181, 182, 183, 184, 185, 186 }; + +extern int table_invertstop[8]{ 186, 185, 184, 183, 182, 181, 180, 179 }; + +extern int table_invertpanel[8]{ 187, 188, 189, 190, 191, 192, 193, 194 }; + +extern int table_plouf[7]{ 99, 100, 101, 102, 101, 100, 99 }; + +extern int table_tiplouf[3]{ 244, 99, 244 }; + +extern int table_blup[20] +{ + 103, 104, 105, 106, 104, 103, 106, 105, 103, 104, + 103, 105, 106, 103, 105, 106, 103, 104, 106, 105 +}; + +extern int table_follow1[26] +{ + 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[5]{ 256, 258, 260, 262, 264 }; + +extern int table_cle[12] +{ + 122, 123, 124, 125, 126, 127, 128, 127, 126, 125, + 124, 123 +}; + +extern int table_cle1[12] +{ + 209, 210, 211, 212, 213, 214, 215, 214, 213, 212, + 211, 210 +}; + +extern int table_cle2[12] +{ + 220, 221, 222, 221, 220, 219, 218, 217, 216, 217, + 218, 219 +}; + +extern int table_cle3[12] +{ + 229, 228, 227, 226, 225, 224, 223, 224, 225, 226, + 227, 228 +}; + +extern int table_dynamitef[100] +{ + 253, 252, 254, 252, 252, 255, 252, 254, 253, 252, + 253, 254, 255, 252, 255, 253, 252, 254, 252, 255, + 253, 254, 252, 253, 255, 254, 255, 252, 253, 254, + 255, 252, 253, 254, 255, 254, 254, 253, 254, 255, + 253, 252, 255, 254, 255, 253, 252, 254, 253, 255, + 253, 254, 252, 253, 255, 254, 252, 255, 253, 254, + 255, 253, 252, 254, 255, 254, 252, 253, 254, 255, + 253, 254, 255, 254, 255, 253, 252, 254, 253, 255, + 253, 254, 255, 253, 255, 254, 255, 252, 253, 254, + 255, 253, 253, 254, 255, 254, 252, 253, 254, 255 +}; + +extern int table_skate[34] +{ + 129, 129, 129, 129, 130, 130, 130, 131, 131, 132, + 132, 133, 133, 134, 134, 134, 135, 135, 135, 135, + 134, 134, 134, 133, 133, 132, 132, 131, 131, 131, + 130, 130, 130, 130 +}; + +extern int table_glu[25] +{ + 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[70] +{ + 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 +}; + +extern int table_electro[90] +{ + 266, 267, 266, 267, 266, 267, 266, 267, 266, 267, + 266, 267, 266, 267, 266, 267, 266, 267, 266, 267, + 266, 267, 266, 267, 266, 267, 266, 267, 266, 267, + 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 +}; + +extern int table_chenille[6]{ 311, 312, 313, 314, 315, 316 }; + +extern int table_chenillei[6]{ 316, 315, 314, 313, 312, 311 }; + +extern int table_adapt_decor[144] +{ + 153, 147, 148, 146, 40, 151, 150, 144, 39, 152, + 149, 145, 38, 36, 37, 35, 153, 147, 148, 146, + 40, 151, 150, 144, 39, 152, 149, 145, 38, 36, + 37, 156, 75, 75, 155, 155, 75, 75, 155, 155, + 74, 74, 154, 154, 75, 75, 155, 155, 157, 157, + 157, 157, 109, 109, 109, 109, 108, 108, 108, 108, + 107, 107, 107, 107, 202, 202, 138, 138, 202, 202, + 138, 138, 202, 202, 138, 138, 202, 202, 138, 138, + 283, 283, 283, 283, 262, 262, 262, 262, 263, 263, + 263, 263, 261, 261, 261, 261, 361, 359, 360, 352, + 357, 353, 355, 349, 358, 354, 356, 350, 351, 347, + 348, 341, 387, 387, 386, 386, 394, 394, 392, 392, + 395, 395, 393, 393, 397, 397, 396, 396, 251, 254, + 254, 254, 251, 258, 260, 258, 251, 257, 259, 257, + 251, 250, 256, 250 +}; + +extern int table_adapt_fromage[32] +{ + -1, 265, 264, 268, 267, 273, 271, 275, 266, 272, + 270, 274, 269, 277, 276, 278, -1, 286, 285, 289, + 288, 294, 292, 296, 287, 293, 291, 295, 290, 298, + 297, 299 +}; + +extern int table_shield[] +{ + 16, + 144, 145, 146, 147, 148, 149, 150, 151, 266, 267, + 268, 269, 270, 271, 272, 273 +}; + +extern int table_shield_blupi[] +{ + 16, + 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_invert[] +{ + 20, + 187, 187, 187, 188, 189, 190, 191, 192, 193, 194, + 187, 187, 187, 194, 193, 192, 191, 190, 189, 188 +}; + +extern int table_charge[]{ 6, 238, 239, 240, 241, 242, 243 }; + +extern int table_magicloop[]{ 5, 152, 153, 154, 155, 156 }; + +extern int table_magictrack[] +{ + 24, + 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[]{ 5, 274, 275, 276, 277, 278 }; + +extern int table_shieldtrack[] +{ + 20, + 274, 275, 276, 277, 278, 274, 275, 276, 277, 278, + 279, 280, 281, 282, 283, 284, 285, 286, 287, 288 +}; + +extern int table_drinkeffect[]{ 5, 274, 275, 276, 277, 278 }; + +extern int table_drinkoffset[]{ 3, 0, 7, 22 }; + +extern int table_tresortrack[] +{ + 11, + 166, 165, 164, 163, 162, 161, 162, 163, 164, 165, + 166 +}; + +extern int table_decor_lave[]{ 8, 68, 69, 70, 71, 72, 71, 70, 69 }; + +extern int table_decor_piege1[] +{ + 16, + 374, 374, 373, 347, 373, 374, 374, 374, 373, 347, + 347, 373, 374, 374, 374, 374 +}; + +extern int table_decor_piege2[]{ 4, 374, 373, 347, 373 }; + +extern int table_decor_goutte[] +{ + 48, + 410, 409, 410, -1, -1, -1, -1, -1, -1, 410, + 409, 408, 409, 410, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 410, 409, 408, 407, 406, 405, + 404, 405, 406, 407, 408, 409, 410, -1, -1, -1, + -1, 410, 409, 410, -1, -1, -1, -1 +}; + +extern int table_decor_ecraseur[]{ 10, 317, 317, 318, 319, 320, 321, 322, 323, 323, 323 }; + +extern int table_decor_scie[]{ 6, 378, 379, 380, 381, 382, 383 }; + +extern int table_decor_temp[] +{ + 20, + 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[]{ 6, 92, 93, 94, 95, 94, 93 }; + +extern int table_decor_eau2[]{ 6, 91, 96, 97, 98, 97, 96 }; + +extern int table_decor_ventillog[]{ 3, 126, 127, 128 }; + +extern int table_decor_ventillod[]{ 3, 129, 130, 131 }; + +extern int table_decor_ventilloh[]{ 3, 132, 133, 134 }; + +extern int table_decor_ventillob[]{ 3, 135, 136, 137 }; + +extern int table_decor_ventg[]{ 4, 110, 111, 112, 113 }; + +extern int table_decor_ventd[]{ 4, 114, 115, 116, 117 }; + +extern int table_decor_venth[]{ 4, 118, 119, 120, 121 }; + +extern int table_decor_ventb[]{ 4, 122, 123, 124, 125 }; + +extern int table_marine[] +{ + 11, + 203, 204, 205, 206, 207, 208, 207, 206, 205, 204, + 203 +}; + +extern int table_ressort[]{ 8, 209, 210, 211, 212, 213, 212, 211, 210 }; + +extern int table_366b0[]{ 3, 20, 21, 22 }; + +extern int table_366c0[]{ 4, 16, 17, 18, 19 }; + +extern int table_366d8[]{ 3, 0x17, 0x18, 0x19 }; + +extern int table_366e8[]{ 2, 0x1a, 0x1b }; + +extern int table_366f8[]{ 4, 0x1c, 0x1d, 0x1e, 0x1f }; + +extern int table_36710[]{ 12, 0x2d, 0x2e, 0x2f, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c }; + +extern int table_36748[]{ 4, 0x42, 0x43, 0x44, 0x45 }; + +extern int table_36520[]{ 3, 0x57, 0x58, 0x59 }; + +extern int table_36670[]{ 11, 0x4c, 0x4d, 0xc7, 0xc6, 0xc8, 0xc9, 0xeb, 0xec, 0x177, 0x178, 0x179 }; + +extern int table_366a0[]{ 3, 0x193, 0x191, 0x192 }; diff --git a/def.h b/def.h index 7530dca..625bb34 100644 --- a/def.h +++ b/def.h @@ -9,13 +9,14 @@ #define _INTRO FALSE // TRUE si images d'introduction #define _EGAMES FALSE // TRUE version pour eGames #define _SE FALSE // TRUE eGames Special Edition +#define _NOCD TRUE #define LXIMAGE 640 // dimensions de la fenêtre de jeu #define LYIMAGE 480 -#define MAXCELX 200 // nb max de cellules d'un monde -#define MAXCELY 200 +#define MAXCELX 100 // nb max de cellules d'un monde +#define MAXCELY 100 #define DIMOBJX 64 // dimensions d'un objet #define DIMOBJY 64 @@ -63,12 +64,39 @@ #define CHBLUPI3 13 #define CHTEMP 14 +namespace Ch { + enum Ch { + Decor = 0, + Object, + Blupi, + Back, + Button, + Jauge, + Text, + Little, + Map, + Explo, + Element, + Blupi_1, + Blupi_2, + Blupi_3, + Temp + }; +}; + // Directions : #define DIR_LEFT 1 #define DIR_RIGHT 2 +namespace Dir { + enum Dir { + Left = 1, + Right + }; +}; + // Actions : @@ -161,14 +189,114 @@ #define ACTION_TAKEDYNAMITE 86 #define ACTION_PUTDYNAMITE 87 +namespace Action { + enum Action { + Stop = 1, + March, + Turn, + Jump, + Air, + Down, + Up, + Vertigo, + Recede, + Advance, + Clear_1, + Set, + Win, + Push, + StopHelico, + MarchHelico, + TurnHelico, + StopNage, + MarchNage, + TurnNage, + StopSurf, + MarchSurf, + TurnSurf, + Drown, + StopJeep, + MarchJeep, + TurnJeep, + StopPop, + Pop, + Bye, + StopSuspend, + MarchSuspend, + TurnSuspend, + JumpSuspend, + Hide, + JumpAie, + StopSkate, + MarchSkate, + TurnSkate, + JumpSkate, + AirSkate, + TakeSkate, + DeposeSkate, + Ouf_1a, + Ouf_1b, + Ouf_2, + Ouf_3, + Ouf_4, + Sucette, + StopTank, + MarchTank, + TurnTank, + FireTank, + Glu, + Drink, + Charge, + Electro, + HelicoGlu, + TurnAir, + StopMarch, + StopJump, + StopJump_H, + Mockery, + Mockery_I, + Ouf_5, + Balloon, + StopOver, + MarchOver, + TurnOver, + Recede_Q, + Advance_Q, + StopEcrase, + MarchEcrase, + Teleporte, + Clear_2, + Clear_3, + Clear_4, + Clear_5, + Clear_6, + Clear_7, + Clear_8, + Switch, + Mockery_P, + Non, + SlowDownSkate, + TakeDynamite, + PutDynamite + }; +}; -// Sécurités : +// Sécurités : #define SEC_SHIELD 1 #define SEC_POWER 2 #define SEC_CLOUD 3 #define SEC_HIDE 4 +namespace Sec { + enum Sec { + Shield = 1, + Power, + Cloud, + Hide + }; +} + // Types : @@ -244,6 +372,85 @@ #define TYPE_BOMBEPERSO3 202 #define TYPE_BOMBEPERSO4 203 +namespace Type { + enum Type { + Empty = 0, + Ascenseur, + BombeDown, + BombeUp, + Bulldozer, + Tresor, + Egg, + Goal, + Explo_1, + Explo_2, + Explo_3, + Explo_4, + Caisse, + Helico, + Plouf, + Blup, + BombeMove, + Poisson, + Tomates, + Jeep, + Oiseau, + Cle, + Door, + Balle, + Skate, + Shield, + Power, + MagicTrack, + Tank, + Bullet, + Drink, + Charge, + BlupiHelico, + BlupiTank, + Glu, + Tiplouf, + Pollution, + Clear, + Electro, + TresorTrack, + Invert, + InvertStart, + InvertStop, + Unk_43, + Guepe, + Over, + Ascenseur_S, + Ascenseur_SI, + Cle_1, + Cle_2, + Cle_3, + Bridge, + Tentacule, + Creature, + Dynamite, + Dynamite_F, + ShieldTrack, + HideTrack, + Explo_5, + Explo_6, + Explo_7, + Explo_8, + Explo_9, + Explo_10, + BombeFollow_1, + BombeFollow_2, + Sploutch_1, + Sploutch_2, + Sploutch_3, + + BombePerso_1 = 200, + BombePerso_2, + BombePerso_3, + BombePerso_4 + }; +}; + // Steps : @@ -252,6 +459,15 @@ #define STEP_STOPEND 3 #define STEP_RECEDE 4 +namespace Step { + enum Step { + StopStart = 1, + Advance, + StopEnd, + Recede + }; +} + // Sons : @@ -349,6 +565,103 @@ #define SOUND_JUMPTOCh 91 #define SOUND_FOLLOW 92 +namespace Sound { + enum Sound { + Click, + Jump_1, + Jump_2, + JumpEnd, + JumpToc, + Turn, + Vertigo, + Down, + Fall, + New, + Boum, + Tresor, + Egg, + End_KO, + End_OK, + HelicoStart, + HelicoHigh, + HelicoStop, + HelicoLow, + LastTresor, + Up, + LookUp, + Jump_0, + Plouf, + Blup, + Surf, + Drown, + Error, + JeepStart, + JeepHigh, + JeepStop, + JeepLow, + Bye, + Door, + SuspendToc, + SuspendJump, + Singe, + Patient, + Push, + Pop, + JumpAie, + Ressort, + StartShield, + StopShield, + StartPower, + StopPower, + Ouf_1, + Ouf_2, + Ouf_3, + Ouf_4, + Sucette, + Glu, + Fire_OK, + Fire_KO, + TakeGlu, + StartCloud, + StopCloud, + Drink, + Charge, + Electro, + PersoTake, + PersoPose, + StartHide, + StopHide, + Tiplouf, + Mockery, + InvertStart, + InvertStop, + OverStop, + Blitz, + Ecrase, + Teleporte, + Bridge_1, + Bridge_2, + Angel, + Scie, + SwitchOff, + SwitchOn, + JumpEnd_B, // bois + JumpToc_B, + JumpEnd_M, // metal + JumpToc_M, + JumpEnd_G, // grotte + JumpToc_G, + JumpEnd_O, // végétaux organiques + JumpToc_O, + JumpEnd_K, // kids stuff + JumpToc_K, + JumpEnd_F, // fromage + JumpToc_F, + JumpEnd_H, // herbe + JumpToc_H, + Follow + }; +}; // @@ -359,6 +672,16 @@ #define KEY_JUMP (1 << 4) #define KEY_FIRE (1 << 5) +namespace Key { + enum Key { + Left = 1 << 0, + Right = 1 << 1, + Up = 1 << 2, + Down = 1 << 3, + Jump = 1 << 4, + Fire = 1 << 5 + }; +}; // Boutons (play) : @@ -649,11 +972,455 @@ #define WM_PHASE_DOQUIT #define WM_PHASE_GAMER - - // Types de gestion de la souris. #define MOUSETYPEGRA 1 #define MOUSETYPEWIN 2 #define MOUSETYPEWINPOS 3 +namespace Object { + enum Object { + Empty = -1, + Hili, + TechSquare_1, + TechSquare_2, + TechSquare_3, + TechSquare_4, + TechSquare_5, + TechSquare_6, + TechSquare_7, + TechSquare_8, + TechSquare_9, + TechSquare_10, + TechSquare_11, + TechSquare_12, + TechSquare_13, + TechSquare_14, + TechTriRight_1, + TechTriRight_2, // 16 + TechTriLeft_1, + TechTriLeft_2, + TechSpecial_1, + TechSpecial_2, + TechSpecial_3, + TechSecret_1, + TechSpecial_4, + TechSpecial_5, + TechSpecial_6, + TechSpecial_7, + TechSpecial_8, + TechSpecial_9, + TechSpecial_10, + LiftPoint_1, + LiftPoint_2, + Caisse_1, // 32 + Caisse_2, + Caisse_3, + RockSquare_1, + RockSquare_2, + RockSquare_3, + RockSquare_4, + RockSquare_5, + RockSquare_6, + WoodWall_1, + WoodWall_2, + WoodWall_3, + WoodWall_4, + WoodWall_5, + WoodWall_6, + WoodWall_7, + Dream_1, // 48 + Dream_2, + Dream_3, + Dream_4, + Dream_5, + Dream_6, + Dream_7, + Dream_8, + Dream_9, + Dream_10, + Dream_11, + Dream_12, + Dream_13, + Dream_14, + Dream_15, + Dream_16, + Dream_17, // 64 + Dream_18, + Dream_19, + Dream_20, + Lava_1, + Lava_2, + Lava_3, + Lava_4, + Lava_5, + TechSecret_2, + RockTriLeft_1, + RockTriRight_1, + Support_1, + Support_2, + MechSquare_1, + MechSquare_2, + MechSquare_3, // 80 + MechSquare_4, + MechSquare_5, + MechSquare_6, + MechSquare_7, + MechSecret_1, + MechSecret_2, + MechSpecial_1, + MechSpecial_2, + MechSpecial_3, + MechSpecial_4, + WaterSquare_1, + WaterSurf_1, + WaterSurf_2, + WaterSurf_3, + WaterSurf_4, + WaterSquare_2, // 96 + WaterSquare_3, + WaterSquare_4, + Splash_1, + Splash_2, + Splash_3, + Splash_4, + Bubble_1, + Bubble_2, + Bubble_3, + Bubble_4, + GrassSquare_1, + GrassLeft, + GrassRight, + WindLeft_1, + WindLeft_2, // 112 + WindLeft_3, + WindLeft_4, + WindRight_1, + WindRight_2, + WindRight_3, + WindRight_4, + WindUp_1, + WindUp_2, + WindUp_3, + WindUp_4, + WindDown_1, + WindDown_2, + WindDown_3, + WindDown_4, + FanLeft_1, + FanLeft_2, // 128 + FanLeft_3, + FanRight_1, + FanRight_2, + FanRight_3, + FanUp_1, + FanUp_2, + FanUp_3, + FanDown_1, + FanDown_2, + FanDown_3, + Bar_1, + Bookshelf_1, + Bookshelf_2, + Bookshelf_3, + Bookshelf_4, + Bookshelf_5, + RockSquare_7, // 144 + RockSquare_8, + RockSquare_9, + RockSquare_10, + RockSquare_11, + RockSquare_12, + RockSquare_13, + RockSquare_14, + RockSquare_15, + RockSquare_16, + RockTriLeft_2, + RockTriRight_2, + RockSquare_17, + GrassSquare_2, + Course_1, + Course_2, + Course_3, // 160 + Course_4, + Course_5, + Course_6, + Course_7, + Course_8, + CourseDone_1, + CourseDone_2, + CourseDone_3, + CourseDone_4, + CourseDone_5, + CourseDone_6, + CourseDone_7, + CourseDone_8, + Level_1, + Level_2, + Level_3, // 176 + Level_4, + Level_5, + Level_6, + Level_7, + Level_8, + DoorLevel, + DoorCourse, + CourseBack, + RockSecret, + Facade_1, + Facade_2, + Facade_3, + Facade_4, + Facade_5, + Facade_6, + Facade_7, // 192 + Roof_1, + Roof_2, + Roof_3, + Roof_4, + Roof_5, + Support_3, + Support_4, + Support_5, + Support_6, + Bar_2, + Marine_1, + Marine_2, + Marine_3, + Marine_4, + Marine_5, + Marine_6, // 208 + Spring_1, + Spring_2, + Spring_3, + Spring_4, + Spring_5, + Invisible, + KidsSquare_1, + KidsSquare_2, + KidsSquare_3, + KidsSquare_4, + KidsSquare_5, + KidsSquare_6, + KidsSquare_7, + KidsSquare_8, + KidsSpecial_1, + KidsSpecial_2, // 224 + KidsSpecial_3, + KidsSpecial_4, + KidsSpecial_5, + KidsSpecial_6, + KidsSpecial_7, + KidsSquare_9, + KidsSquare_10, + KidsSpecial_8, + KidsSquare_11, + KidsSquare_12, + Support_7, + Support_8, + DitherMask, + Charger_1, + Charger_2, + Charger_3, // 240 + Charger_4, + Charger_5, + Charger_6, + Splash_5, + Unk_F5, + CheeseSquare_1, + CheeseSquare_2, + CheeseSquare_3, + CheeseSquare_4, + Pipes_1, + Pipes_2, + Pipes_3, + Pipes_4, + Pipes_5, + Pipes_6, + Pipes_7, // 256 + Pipes_8, + Pipes_9, + Pipes_10, + Pipes_11, + Bricks_1, + Bricks_2, + Bricks_3, + CheeseSupport_1, + CheeseSupport_2, + CheeseSupport_3, + CheeseSupport_4, + CheeseSupport_5, + CheeseSupport_6, + CheeseSupport_7, + CheeseSupport_8, + CheeseSupport_9, // 272 + CheeseSupport_10, + CheeseSupport_11, + CheeseSupport_12, + CheeseSupport_13, + CheeseSupport_14, + CheeseSupport_15, + CheeseSupport_16, + CheeseSupport_17, + CheeseSupport_18, + CheeseSupport_19, + Bricks_4, + Cave_1, + CaveSupport_1, + CaveSupport_2, + CaveSupport_3, + CaveSupport_4, // 288 + CaveSupport_5, + CaveSupport_6, + CaveSupport_7, + CaveSupport_8, + CaveSupport_9, + CaveSupport_10, + CaveSupport_11, + CaveSupport_12, + CaveSupport_13, + CaveSupport_14, + CaveSupport_15, + CaveSupport_16, + Cave_2, + CaveSupport_17, + CaveSupport_18, + LightningMachine, // 304 + Lightning_1, + Lightning_2, + Lightning_3, + Lightning_4, + Course_9, + CourseDone_9, + Conveyor_1, + Conveyor_2, + Conveyor_3, + Conveyor_4, + Conveyor_5, + Conveyor_6, + Crusher_1, + Crusher_2, + Crusher_3, + Crusher_4, // 320 + Crusher_5, + Crusher_6, + Crusher_7, + Vanish_1, + Vanish_2, + Vanish_3, + Vanish_4, + Vanish_5, + Vanish_6, + Teleporter_1, + Teleporter_2, + Teleporter_3, + Teleporter_4, + DoorRed, + DoorGreen, + DoorBlue, // 336 + CaveSecret, + Cave_3, + CheeseSecret, + CheeseSquare_5, + Slime_1, + Slime_2, + Slime_3, + Slime_4, + Slime_5, + Slime_6, + Slime_7, + Slime_8, + Slime_9, + Slime_10, + Slime_11, + Slime_12, // 352 + Slime_13, + Slime_14, + Slime_15, + Slime_16, + Slime_17, + Slime_18, + Slime_19, + Slime_20, + Slime_21, + Slime_22, + Slime_23, + FragileBridge_1, + FragileBridge_2, + FragileBridge_3, + FragileBridge_4, + FragileBridge_5, // 368 + FragileBridge_6, + FragileBridge_7, + FragileBridge_8, + FragileBridge_9, + SlimeTrapFloor_1, + SlimeTrapFloor_2, + Support_9, + Support_10, + Support_11, + Saw_1, + Saw_2, + Saw_3, + Saw_4, + Saw_5, + Saw_6, + SawSwitchOn, // 382 + SawSwitchOff, + Palace_1, + Palace_2, + Palace_3, + Palace_4, + Palace_5, + Palace_6, + Palace_7, + Palace_8, + Palace_9, + Palace_10, + Palace_11, + Palace_12, + PalaceElement_1, + PalaceElement_2, + PalaceElement_3, // 398 + SpiderWeb_1, + SpiderWeb_2, + SpiderWeb_3, + SlimeTrapCeiling_1, + SlimeTrapCeiling_2, + SlimeTrapCeiling_3, + SlimeTrapCeiling_4, + SlimeTrapCeiling_5, + SlimeTrapCeiling_6, + SlimeTrapCeiling_7, + Course_10, + Course_11, + Course_12, + Course_13, + Course_14, + CourseDone_10, // 414 + CourseDone_11, + CourseDone_12, + CourseDone_13, + CourseDone_14, + DoorTreasure_1, + DoorTreasure_2, + DoorTreasure_3, + DoorTreasure_4, + DoorTreasure_5, + DoorTreasure_6, + DoorTreasure_7, + DoorTreasure_8, + DoorTreasure_9, + DoorTreasure_10, + DoorTreasure_11, + DoorTreasure_12, // 430 + DoorTreasure_13, + DoorTreasure_14, + DoorTreasure_15, + DoorTreasure_16, + DoorTreasure_17, + DoorTreasure_18, + DoorTreasure_19, + DoorTreasure_20 + }; +} \ No newline at end of file diff --git a/event.h b/event.h index ad52922..b782c26 100644 --- a/event.h +++ b/event.h @@ -1,6 +1,6 @@ // Event.h - +#pragma once ///////////////////////////////////////////////////////////////////////////// @@ -59,6 +59,7 @@ public: void SetFullScreen(BOOL bFullScreen); void SetMouseType(int mouseType); int GetWorld(); + int GetWorldGroup(); int GetPhysicalWorld(); int GetImageWorld(); BOOL IsHelpHide(); @@ -70,6 +71,7 @@ public: void RestoreGame(); int MissionBack(); void TableSomething(); + void SetNbVies(int nbVies); int GetButtonIndex(int button); int GetState(int button); @@ -81,8 +83,9 @@ public: void SetHide(int button, BOOL bHide); int GetMenu(int button); void SetMenu(int button, int menu); - void SomethingDecor(); + void FlushInput(); void PauseStatus(UINT pause, int multiplayer); + BOOL IsMouseRelease(); BOOL DrawButtons(); BOOL TextSomething(); @@ -116,7 +119,9 @@ public: void IntroStep(); -protected: + void AddPhaseText(); + void ReadInput(); + void DrawTextCenter(int res, int x, int y, int font=0); BOOL CreateButtons(); BOOL EventButtons(UINT message, WPARAM wParam, LPARAM lParam); @@ -159,7 +164,7 @@ protected: int m_mission; int m_private; int m_maxMission; - WMessage m_phase; + DWORD m_phase; int m_index; int m_playerIndex; BOOL m_bSchool; @@ -234,7 +239,6 @@ protected: int m_demoIndex; int m_demoEnd; int m_demoNumber; - int m_tryPhase; BOOL m_bCtrlDown; POINT m_debugPos; int m_introTime; @@ -246,7 +250,6 @@ protected: char m_textInput[100]; char m_pPlayerName[100]; int m_lives; - int m_mission; int m_multi; HINSTANCE m_hInstance; char m_chatZone[100][5]; diff --git a/jauge.cpp b/jauge.cpp index 0a868d3..e754c46 100644 --- a/jauge.cpp +++ b/jauge.cpp @@ -34,12 +34,12 @@ CJauge::~CJauge() // Create a new Button. -BOOL CJauge::Create(HWND hWnd, CPixmap *pPixmap, CDecor *pDecor, +BOOL CJauge::Create(HWND hWnd, CPixmap *pPixmap, CSound *pSound, POINT pos, int type, BOOL bMinimizeRedraw) { m_hWnd = hWnd; m_pPixmap = pPixmap; - m_pDecor = pDecor; + m_pSound = pSound; m_type = type; m_bMinimizeRedraw = bMinimizeRedraw; m_bHide = TRUE; @@ -50,34 +50,44 @@ BOOL CJauge::Create(HWND hWnd, CPixmap *pPixmap, CDecor *pDecor, m_bRedraw = TRUE; } +// Dessine un bouton dans son état. + void CJauge::Draw() { - int part; - RECT rect; + int part; + RECT rect; - if (m_bMinimizeRedraw && !m_bRedraw) return; - m_bRedraw = FALSE; + if (m_bMinimizeRedraw && !m_bRedraw) return; + m_bRedraw = FALSE; - if (m_bHide) // bouton cach� ? - { - m_pPixmap->DrawPart(-1, 0, m_pos, rect); - return; - } - int num = m_level * 114 / 100; + if (m_bHide) // bouton caché ? + { + rect = { m_pos.x, m_pos.y, m_pos.x + m_dim.x, m_pos.y + m_dim.y }; + m_pPixmap->DrawPart(-1, CHBACK, m_pos, rect, 1); // dessine le fond + return; + } - m_pPixmap->DrawPart(-1, 5, m_pos, rect); - if (num > 0) - { - m_pPixmap->DrawPart(-1, 5, m_pos, rect); - } + part = (m_level*(DIMJAUGEX - 6 - 4)) / 100; + rect = { 0, 0, DIMJAUGEX, DIMJAUGEY }; + m_pPixmap->DrawPart(-1, CHJAUGE, m_pos, rect); // partie noire + + if (part > 0) + { + rect = { 0, DIMJAUGEY * m_type, 6 + part, DIMJAUGEY + (m_type + 1) }; + m_pPixmap->DrawPart(-1, CHJAUGE, m_pos, rect); // partie colorée + } } +// Redessine une jauge. + void CJauge::Redraw() { - m_bRedraw = TRUE; + m_bRedraw = TRUE; } +// Modifie le niveau. + void CJauge::SetLevel(int level) { if ( level < 0 ) level = 0; @@ -102,6 +112,7 @@ int CJauge::GetType() return m_type; } +// Modifie le type. void CJauge::SetType(int type) { @@ -128,3 +139,12 @@ void CJauge::SetHide(BOOL bHide) m_bHide = bHide; } +POINT CJauge::GetPos() +{ + return m_pos; +} + +void CJauge::SetRedraw() +{ + m_bRedraw = TRUE; +} diff --git a/jauge.h b/jauge.h index c75e1de..575e5d6 100644 --- a/jauge.h +++ b/jauge.h @@ -1,6 +1,6 @@ // Jauge.h - +#pragma once ////////////////////////////////////////////////////////////////////////// diff --git a/network.cpp b/network.cpp index 3979279..f2199a4 100644 --- a/network.cpp +++ b/network.cpp @@ -1,43 +1,277 @@ // Network.cpp // -#include "dplay.h" -#include -#include "decor.h" -#include "event.h" -#include #include #include "misc.h" #include "network.h" +// a0f94abe-11c3-d111-be62-0040f6944838 +#define APP_GUID { 0xbe4af9a0, 0xc311, 0x11d1, { 0xbe, 0x62, 0x00, 0x40, 0xf6, 0x94, 0x48, 0x38 } }; + CNetwork::CNetwork() { - m_pDP; - m_pDPID; - m_bUnk1C; - m_pContext; - m_pSessions2; - m_pUnkC; - m_pSessions; - m_pUnk18; + m_pDP = NULL; + m_dpid = 0; + m_bHost = FALSE; + m_providers.nb = 0; + * m_providers.list = NULL; + m_sessions.nb = 0; + * m_sessions.list = NULL; + m_unknown.nb = 0; + * m_unknown.list = NULL; } CNetwork::~CNetwork() { - LPDIRECTPLAY2 lpDP; + FreeProviderList(); + FreeSessionList(); + FreeUnknownList(); + if (m_pDP) m_pDP->Release(); +} + +static BOOL EnumProvidersCallback(LPGUID lpguidSP, LPSTR lpSPName, + DWORD dwMajorVersion, DWORD dwMinorVersion, NamedGUIDList * lpContext) +{ + if (lpContext->nb < MAXSESSION) + { + lpContext->list[lpContext->nb]->guid = * lpguidSP; + strcpy(lpContext->list[lpContext->nb]->name, lpSPName); + lpContext->nb++; + } + return TRUE; +} + +BOOL CNetwork::EnumProviders() +{ + FreeProviderList(); + m_providers.nb = 0; + * m_providers.list = (NamedGUID *) malloc(MAXSESSION * sizeof(NamedGUID)); + + if (!m_providers.list) return FALSE; + + if (DirectPlayEnumerate((LPDPENUMDPCALLBACKA)EnumProvidersCallback, &m_providers) != DP_OK) + { + FreeProviderList(); + return FALSE; + } + return TRUE; +} + +int CNetwork::GetNbProviders() +{ + return m_providers.nb; +} + +char * CNetwork::GetProviderName(int index) +{ + if (index >= m_providers.nb) return NULL; + return m_providers.list[index]->name; +} + +BOOL CNetwork::CreateProvider(int index) +{ + LPDIRECTPLAY lpDP; + BOOL bOK = FALSE; + + if (index >= m_providers.nb) return FALSE; + + if (DirectPlayCreate(&m_providers.list[index]->guid, &lpDP, 0) == DP_OK) + { + if (lpDP->QueryInterface(IID_IDirectPlay2A, (LPVOID *) &m_pDP) == DP_OK) + { + return TRUE; + } + } + + if (lpDP != NULL) lpDP->Release(); + return FALSE; +} + +void CNetwork::FreeProviderList() +{ + if (m_providers.list) free(m_providers.list); + + m_providers.nb = 0; + * m_providers.list = NULL; +} + +static BOOL EnumSessionsCallback(LPDPSESSIONDESC2 lpThisSD, + LPDWORD lpdwTimeOut, DWORD dwFlags, NamedGUIDList * lpContext) +{ + if (dwFlags & DPESC_TIMEDOUT) return FALSE; + + if (lpContext->nb < MAXSESSION) + { + lpContext->list[lpContext->nb]->guid = lpThisSD->guidInstance; + strcpy(lpContext->list[lpContext->nb]->name, lpThisSD->lpszSessionNameA); + lpContext->nb++; + } + return TRUE; +} + +BOOL CNetwork::EnumSessions() +{ + DPSESSIONDESC2 desc; + + FreeSessionList(); + m_sessions.nb = 0; + * m_sessions.list = (NamedGUID *) malloc(MAXSESSION * sizeof(NamedGUID)); + + if (!m_sessions.list) return FALSE; + + ZeroMemory(&desc, sizeof(desc)); + + desc.guidApplication = APP_GUID; + desc.dwSize = sizeof(desc); + + if (m_pDP->EnumSessions(&desc, 0, (LPDPENUMSESSIONSCALLBACK2)EnumSessionsCallback, &m_sessions, DPENUMSESSIONS_AVAILABLE) != DP_OK) + { + FreeSessionList(); + return FALSE; + } + + return TRUE; +} + +char * CNetwork::GetSessionName(int index) +{ + if (index >= m_sessions.nb) return NULL; + return m_sessions.list[index]->name; +} + +BOOL CNetwork::JoinSession(int index) +{ + DPNAME name; + DPSESSIONDESC2 desc; + HRESULT hr; + + if (index > m_sessions.nb) return FALSE; + + ZeroMemory(&desc, sizeof(desc)); + + desc.guidInstance = m_sessions.list[index]->guid; + + hr = m_pDP->Open(&desc, DPOPEN_OPENSESSION); + if (hr != DP_OK) + { + TraceErrorDP(hr); + return FALSE; + } + + name.dwFlags = 0; + name.dwSize = sizeof(name); + name.lpszLongNameA = NULL; + + hr = m_pDP->CreatePlayer(&m_dpid, &name, NULL, NULL, 0, 0); + if (hr != DP_OK) + { + TraceErrorDP(hr); + m_pDP->Close(); + return FALSE; + } + else + { + m_bHost = FALSE; + return TRUE; + } } void CNetwork::FreeSessionList() { - if (m_pSessions != NULL) - { - free(m_pSessions); - } - m_pUnkC = NULL; - m_pSessions = NULL; + if (m_sessions.list) free(m_sessions.list); + + m_sessions.nb = 0; + * m_sessions.list = NULL; } -void TraceErrorDP(HRESULT hErr, char *sFile, int nLine) +BOOL CNetwork::CreateSession(char * pName) +{ + DPSESSIONDESC2 desc; + HRESULT hr; + + ZeroMemory(&desc, sizeof(desc)); + + desc.guidApplication = APP_GUID; + desc.lpszSessionNameA = pName; + desc.dwSize = sizeof(desc); + desc.dwFlags = DPSESSION_KEEPALIVE | DPSESSION_MIGRATEHOST; + desc.dwMaxPlayers = MAXPLAYERS; + + hr = m_pDP->Open(&desc, DPOPEN_CREATE); + if (hr != DP_OK) + { + TraceErrorDP(hr); + m_pDP->Close(); + return FALSE; + } + else + { + m_bHost = TRUE; + return TRUE; + } +} + +BOOL CNetwork::Send(LPVOID lpData, DWORD dwDataSize, DWORD dwFlags) +{ + HRESULT hr; + + if (!m_pDP) return FALSE; + + if (hr = m_pDP->Send(m_dpid, 0, !!dwFlags, lpData, dwDataSize), hr != DP_OK) + { + TraceErrorDP(hr); + return FALSE; + } + return TRUE; +} + +BOOL CNetwork::Receive(LPVOID pDest, DWORD dwDataSize, LPDWORD lpdwPlayer) +{ + DPID from = 0, to = 0, dataSize = 500; + char dataBuffer[500]; + HRESULT hr; + + hr = m_pDP->Receive(&from, &to, DPRECEIVE_ALL, dataBuffer, &dataSize); + if (hr != DP_OK) + { + if (hr != DPERR_NOMESSAGES) TraceErrorDP(hr); + return FALSE; + } + + ZeroMemory(pDest, dwDataSize); + + *lpdwPlayer = -1; + for (int i = 0; i < MAXPLAYERS; i++) + { + if (m_players[i].bIsPresent && from == i) + { + *lpdwPlayer = i; + break; + } + } + + return TRUE; +} + +BOOL CNetwork::Close() +{ + return m_pDP->Close() == DP_OK; +} + +void CNetwork::FreeUnknownList() +{ + if (m_unknown.list) free(m_unknown.list); + + m_unknown.nb = 0; + * m_unknown.list = NULL; +} + +BOOL CNetwork::IsHost() +{ + return m_bHost; +} + +void TraceErrorDP(HRESULT hErr) { char dperr[256]; char err[1024]; @@ -54,15 +288,35 @@ void TraceErrorDP(HRESULT hErr, char *sFile, int nLine) case DPERR_CANTADDPLAYER : sprintf(dperr, "DPERR_CANTADDPLAYER"); break; case DPERR_CANTCREATEPLAYER : sprintf(dperr, "DPERR_CANTCREATEPLAYER"); break; case DPERR_CANTCREATEGROUP : sprintf(dperr, "DPERR_CANTCREATEGROUP"); break; + case DPERR_CANTCREATESESSION: sprintf(dperr, "DPERR_CANTCREATESESSION"); break; case DPERR_CAPSNOTAVAILABLEYET : sprintf(dperr, "DPERR_CAPTSNOTAVAILABLEYET"); break; case DPERR_ALREADYINITIALIZED : sprintf(dperr, "DPERR_ALREADYINITIALIZED"); break; - case DPERR_NOAGGREGATION : sprintf(dperr, "DPERR_NOAGGREGATION"); break; - case DPERR_BUFFERTOOSMALL : sprintf(dperr, "DPERR_BUFFERTOOSMALL"); break; - case DPERR_OTHERAPPHASPRIO : sprintf(dperr, "DPERR_OTHERAPPHASPRIO"); break; - case DPERR_UNINITIALIZED : sprintf(dperr, "DPERR_UNINITIALIZED"); break; + case DPERR_INVALIDFLAGS: sprintf(dperr, "DPERR_INVALIDFLAGS"); break; + case DPERR_EXCEPTION: sprintf(dperr, "DPERR_EXCEPTION"); break; + case DPERR_INVALIDPLAYER: sprintf(dperr, "DPERR_INVALIDPLAYER"); break; + case DPERR_INVALIDOBJECT: sprintf(dperr, "DPERR_INVALIDOBJECT"); break; + case DPERR_NOCONNECTION: sprintf(dperr, "DPERR_NOCONNECTION"); break; + case DPERR_NONAMESERVERFOUND: sprintf(dperr, "DPERR_NONAMESERVERFOUND"); break; + case DPERR_NOMESSAGES: sprintf(dperr, "DPERR_NOMESSAGES"); break; + case DPERR_NOSESSIONS: sprintf(dperr, "DPERR_NOSESSIONS"); break; + case DPERR_NOPLAYERS: sprintf(dperr, "DPERR_NOPLAYERS"); break; + case DPERR_TIMEOUT: sprintf(dperr, "DPERR_TIMEOUT"); break; + case DPERR_SENDTOOBIG: sprintf(dperr, "DPERR_SENDTOOBIG"); break; + case DPERR_BUSY: sprintf(dperr, "DPERR_BUSY"); break; + case DPERR_UNAVAILABLE: sprintf(dperr, "DPERR_UNAVAILABLE"); break; + case DPERR_PLAYERLOST: sprintf(dperr, "DPERR_PLAYERLOST"); break; + case DPERR_USERCANCEL: sprintf(dperr, "DPERR_USERCANCEL"); break; + case DPERR_BUFFERTOOLARGE: sprintf(dperr, "DPERR_BUFFERTOOLARGE"); break; + case DPERR_SESSIONLOST: sprintf(dperr, "DPERR_SESSIONLOST"); break; + case DPERR_APPNOTSTARTED: sprintf(dperr, "DPERR_APPNOTSTARTED"); break; + case DPERR_CANTCREATEPROCESS: sprintf(dperr, "DPERR_CANTCREATEPROCESS"); break; + case DPERR_UNKNOWNAPPLICATION: sprintf(dperr, "DPERR_UNKNOWNAPPLICATION"); break; + case DPERR_INVALIDINTERFACE: sprintf(dperr, "DPERR_INVALIDINTERFACE"); break; + case DPERR_NOTLOBBIED: sprintf(dperr, "DPERR_NOTLOBBIED"); break; + case DP_OK: sprintf(dperr, "DP_OK"); break; default : sprintf(dperr, "Unknown Error"); break; } - sprintf(err, "DirectPlay Error %s in file %s at line %d\n", dperr, sFile, nLine); + sprintf(err, "DirectPlay Error %s\n", dperr); OutputDebug(err); } \ No newline at end of file diff --git a/network.h b/network.h index 3a51c14..0d875b4 100644 --- a/network.h +++ b/network.h @@ -1,21 +1,76 @@ +// Network.h + +#pragma once + +#include "dplay.h" + +///////////////////////////////////////////////////////////////////////////// + +#define MAXSESSION 100 +#define MAXPLAYERS 4 + +typedef struct +{ + char bIsPresent; + char ready; + char unk_2; + char unk_3; + DPID dpid; + short team; + char name[22]; +} +NetPlayer; + +typedef struct +{ + GUID guid; + char name[100]; +} +NamedGUID; + +typedef struct +{ + int nb; + NamedGUID * list[MAXSESSION]; +} +NamedGUIDList; + class CNetwork { public: CNetwork(); ~CNetwork(); - BOOL Create(); - void FreeSessionList(); - void FreeSessionList2(); + BOOL EnumProviders(); + BOOL GetNbProviders(); + char * GetProviderName(int index); + BOOL CreateProvider(int index); + void FreeProviderList(); + BOOL EnumSessions(); + char * GetSessionName(int index); + BOOL JoinSession(int index); + void FreeSessionList(); + BOOL CreateSession(char * pName); + BOOL Send(LPVOID lpData, DWORD dwDataSize, DWORD dwFlags); + BOOL Receive(LPVOID pDest, DWORD dwDataSize, LPDWORD lpdwPlayer); + BOOL Close(); + void FreeUnknownList(); + BOOL IsHost(); protected: - IDirectPlay2 m_pDP; - LPVOID m_pContext; - NetSessionList m_pSessions2; - LPVOID m_pUnkC; - addr m_pUnk18; - NetSessionList m_pSessions; - BOOL m_pUnk1C; - DPID m_pDPID; - NetPlayer m_players[4]; -}; \ No newline at end of file + LPDIRECTPLAY2 m_pDP; + NamedGUIDList m_providers; + NamedGUIDList m_sessions; + NamedGUIDList m_unknown; + BOOL m_bHost; + DPID m_dpid; + NetPlayer m_players[4]; +}; + +static BOOL EnumProvidersCallback(LPGUID lpguidSP, LPSTR lpSTName, + DWORD dwMajorVersion, DWORD dwMinorVersion, NamedGUIDList * lpContext); + +static BOOL EnumSessionsCallback(LPDPSESSIONDESC2 lpThisSD, + LPDWORD lpdwTimeOut, DWORD dwFlags, NamedGUIDList * lpContext); + +void TraceErrorDP(HRESULT hErr); \ No newline at end of file diff --git a/obstacle.h b/obstacle.h new file mode 100644 index 0000000..87ac4ac --- /dev/null +++ b/obstacle.h @@ -0,0 +1,589 @@ +#pragma once +#define Q_EMPTY \ + 0,0,0,0, \ + 0,0,0,0, \ + 0,0,0,0, \ + 0,0,0,0 +#define Q_FULL \ + 1,1,1,1, \ + 1,1,1,1, \ + 1,1,1,1, \ + 1,1,1,1 +#define Q_TRIANGLE_RIGHT \ + 1,1,1,1, \ + 0,1,1,1, \ + 0,0,0,1, \ + 0,0,0,0 +#define Q_TRIANGLE_LEFT \ + 1,1,1,1, \ + 1,1,1,0, \ + 1,0,0,0, \ + 0,0,0,0 +#define Q_TOP_HALF \ + 1,1,1,1, \ + 1,1,1,1, \ + 0,0,0,0, \ + 0,0,0,0 +#define Q_TOP_QUARTER \ + 1,1,1,1, \ + 0,0,0,0, \ + 0,0,0,0, \ + 0,0,0,0 +#define Q_TOP_3_QUARTERS \ + 1,1,1,1, \ + 1,1,1,1, \ + 1,1,1,1, \ + 0,0,0,0 +#define Q_PILLAR \ + 0,1,1,0, \ + 0,1,1,0, \ + 0,1,1,0, \ + 0,1,1,0 + +extern short table_decor_quart[] +{ + Q_FULL, // 0 + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_TRIANGLE_RIGHT, + + Q_TRIANGLE_RIGHT, // 16 + Q_TRIANGLE_LEFT, + Q_TRIANGLE_LEFT, + + 1,1,1,1, + 1,1,1,1, + 0,0,1,1, + 0,0,0,0, + + 1,1,1,1, + 1,1,1,1, + 1,1,0,0, + 1,1,0,0, + + 1,1,1,1, + 1,1,1,1, + 1,1,0,0, + 0,0,0,0, + + Q_EMPTY, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_TOP_HALF, + Q_TOP_QUARTER, + Q_FULL, + Q_FULL, + + Q_FULL, // 32 + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_TOP_3_QUARTERS, + Q_TOP_HALF, + Q_TOP_QUARTER, + + Q_FULL, // 48 + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + + Q_FULL, // 64 + Q_FULL, + Q_FULL, + Q_FULL, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_TRIANGLE_LEFT, + Q_TRIANGLE_RIGHT, + Q_EMPTY, + Q_EMPTY, + Q_FULL, + Q_FULL, + + Q_FULL, // 80 + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_EMPTY, + Q_EMPTY, + + 1,1,1,1, + 1,1,1,1, + 1,1,1,1, + 1,1,0,0, + + 1,1,1,1, + 1,1,1,1, + 1,1,0,0, + 1,1,0,0, + + 1,1,1,1, + 1,1,1,1, + 1,1,1,1, + 0,1,1,1, + + 1,1,1,1, + 1,1,1,1, + 0,0,1,1, + 0,0,1,1, + + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + + Q_FULL, // 96 + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + + 1,1,1,1, + 1,1,1,1, + 1,1,1,0, + 1,1,1,0, + + 1,1,1,1, + 1,1,1,1, + 0,1,1,1, + 0,1,1,1, + + Q_EMPTY, + Q_EMPTY, + + Q_EMPTY, // 112 + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + + 0,0,0,1, + 0,0,0,1, + 0,0,0,1, + 0,0,0,1, + + Q_EMPTY, + + Q_EMPTY, // 128 + + 1,0,0,0, + 1,0,0,0, + 1,0,0,0, + 1,0,0,0, + + Q_EMPTY, + Q_EMPTY, + + 0,0,0,0, + 0,0,0,0, + 0,0,0,0, + 1,1,1,1, + + Q_EMPTY, + Q_EMPTY, + Q_TOP_QUARTER, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + + Q_FULL, // 144 + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_TRIANGLE_LEFT, + Q_TRIANGLE_RIGHT, + Q_FULL, + Q_FULL, + Q_EMPTY, + Q_EMPTY, + + Q_EMPTY, // 160 + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + + Q_EMPTY, // 176 + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_PILLAR, + Q_PILLAR, + Q_EMPTY, + Q_EMPTY, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + + Q_FULL, // 192 + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + + Q_EMPTY, // 208 + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + + Q_FULL, // 224 + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + + Q_EMPTY, // 240 + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_TOP_3_QUARTERS, + Q_TOP_3_QUARTERS, + + 1,1,1,1, + 1,1,1,1, + 1,1,1,0, + 0,0,0,0, + + Q_FULL, + Q_FULL, + + Q_TOP_3_QUARTERS, // 256 + Q_FULL, + Q_FULL, + Q_TOP_3_QUARTERS, + Q_TOP_3_QUARTERS, + Q_FULL, + Q_FULL, + Q_FULL, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + + Q_EMPTY, // 272 + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_FULL, + Q_FULL, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + + Q_EMPTY, // 288 + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_FULL, + Q_EMPTY, + Q_EMPTY, + + Q_FULL, // 304 + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_TOP_HALF, + Q_TOP_HALF, + Q_TOP_HALF, + Q_TOP_HALF, + Q_TOP_HALF, + Q_TOP_HALF, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + + Q_EMPTY, // 320 + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_TOP_QUARTER, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + + 1,1,1,1, + 1,1,1,1, + 0,1,1,0, + 0,1,1,0, + + 1,1,1,1, + 1,1,1,1, + 0,1,1,0, + 0,1,1,0, + + 1,1,1,1, + 1,1,1,1, + 0,1,1,0, + 0,1,1,0, + + 1,1,1,1, + 1,1,1,1, + 0,1,1,0, + 0,1,1,0, + + Q_PILLAR, + Q_PILLAR, + + Q_PILLAR, // 336 + Q_EMPTY, + Q_FULL, + Q_EMPTY, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + + Q_FULL, // 352 + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_TOP_QUARTER, + Q_TOP_QUARTER, + Q_TOP_QUARTER, + Q_EMPTY, + + Q_EMPTY, // 368 + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_FULL, + Q_FULL, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + + Q_EMPTY, // 384 + Q_EMPTY, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_FULL, + Q_EMPTY, + Q_EMPTY, + + Q_EMPTY, // 400 + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + + Q_EMPTY, // 416 + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_EMPTY, + Q_PILLAR, + Q_PILLAR, + Q_PILLAR, + Q_PILLAR, + Q_PILLAR, + Q_PILLAR, + Q_PILLAR, + Q_PILLAR, + Q_PILLAR, + Q_PILLAR, + Q_PILLAR, + + Q_PILLAR, // 432 + Q_PILLAR, + Q_PILLAR, + Q_PILLAR, + Q_PILLAR, + Q_PILLAR, + Q_PILLAR, + Q_PILLAR, + Q_PILLAR +}; \ No newline at end of file diff --git a/pixmap.h b/pixmap.h index 2e45bbd..d7f775b 100644 --- a/pixmap.h +++ b/pixmap.h @@ -75,7 +75,6 @@ protected: void MouseBackDebug(); RECT MouseRectSprite(); void MouseHotSpot(); - BOOL GetTrueColor(); protected: BOOL m_bFullScreen; diff --git a/sound.h b/sound.h index 2b2a1f7..c884fd6 100644 --- a/sound.h +++ b/sound.h @@ -28,13 +28,14 @@ public: int GetAudioVolume(); void SetMidiVolume(int volume); int GetMidiVolume(); + void SetCDAudio(BOOL bCDAudio); void CacheAll(); BOOL Cache(int channel, char *pFilename); void Flush(int channel); BOOL Play (int channel, int volume=0, int pan=0); - BOOL StopSound(int channel, int volume, int pan); + BOOL StopSound(int channel); BOOL PlayImage(int channel, POINT pos, int rank=-1); BOOL PlayMusic(HWND hWnd, LPSTR lpszMIDIFilename); BOOL RestartMusic();