From 58af74667f2d5e08e09c1a4dfb8caa9cdf60110c Mon Sep 17 00:00:00 2001 From: HMVocaloid Date: Wed, 18 Sep 2024 10:42:17 -0400 Subject: [PATCH] Cleanup --- IDC_ARROW.cur | Bin 326 -> 0 bytes IDC_ARROWD.cur | Bin 326 -> 0 bytes IDC_ARROWDL.cur | Bin 326 -> 0 bytes IDC_ARROWDR.cur | Bin 326 -> 0 bytes IDC_ARROWL.cur | Bin 326 -> 0 bytes IDC_ARROWR.cur | Bin 326 -> 0 bytes IDC_ARROWU.cur | Bin 326 -> 0 bytes IDC_ARROWUL.cur | Bin 326 -> 0 bytes IDC_ARROWUR.cur | Bin 326 -> 0 bytes IDC_EMPTY.cur | Bin 326 -> 0 bytes IDC_FILL.cur | Bin 326 -> 0 bytes IDC_MAP.cur | Bin 326 -> 0 bytes IDC_POINTER.cur | Bin 326 -> 0 bytes IDC_WAIT.cur | Bin 326 -> 0 bytes IDR_MAINFRAME.ico | Bin 766 -> 0 bytes action.h | 16 - actions.h | 14 - blupi.cpp | 888 ----- button.cpp | 424 -- button.h | 71 - cursor1.cur | Bin 326 -> 0 bytes ddraw.h | 3102 --------------- ddutil.cpp | 346 -- ddutil.h | 32 - decblupi.cpp | 42 - decmove.h | 4 - decor.cpp | 9408 ------------------------------------------- decor.h | 1088 ----- dectables.cpp | 21 - dectables.h | 9720 --------------------------------------------- def.h | 542 --- dplay.h | 2154 ---------- dsound.h | 2385 ----------- event.cpp | 4010 ------------------- event.h | 357 -- fifo.h | 33 - icon1.ico | Bin 45451 -> 0 bytes jauge.cpp | 149 - jauge.h | 53 - menu.cpp | 168 - menu.h | 55 - misc.cpp | 379 -- misc.h | 25 - movie.cpp | 304 -- movie.h | 36 - network.cpp | 331 -- network.h | 102 - ping.asm | 1 - pixmap.cpp | 1984 --------- pixmap.h | 128 - resource.h | 284 -- resource1.h | 87 - resource2.h | 108 - sound.cpp | 685 ---- sound.h | 103 - text.cpp | 378 -- text.h | 61 - texttables.h | 1673 -------- wave.cpp | 270 -- wave.h | 14 - 60 files changed, 42035 deletions(-) delete mode 100644 IDC_ARROW.cur delete mode 100644 IDC_ARROWD.cur delete mode 100644 IDC_ARROWDL.cur delete mode 100644 IDC_ARROWDR.cur delete mode 100644 IDC_ARROWL.cur delete mode 100644 IDC_ARROWR.cur delete mode 100644 IDC_ARROWU.cur delete mode 100644 IDC_ARROWUL.cur delete mode 100644 IDC_ARROWUR.cur delete mode 100644 IDC_EMPTY.cur delete mode 100644 IDC_FILL.cur delete mode 100644 IDC_MAP.cur delete mode 100644 IDC_POINTER.cur delete mode 100644 IDC_WAIT.cur delete mode 100644 IDR_MAINFRAME.ico delete mode 100644 action.h delete mode 100644 actions.h delete mode 100644 blupi.cpp delete mode 100644 button.cpp delete mode 100644 button.h delete mode 100644 cursor1.cur delete mode 100644 ddraw.h delete mode 100644 ddutil.cpp delete mode 100644 ddutil.h delete mode 100644 decblupi.cpp delete mode 100644 decmove.h delete mode 100644 decor.cpp delete mode 100644 decor.h delete mode 100644 dectables.cpp delete mode 100644 dectables.h delete mode 100644 def.h delete mode 100644 dplay.h delete mode 100644 dsound.h delete mode 100644 event.cpp delete mode 100644 event.h delete mode 100644 fifo.h delete mode 100644 icon1.ico delete mode 100644 jauge.cpp delete mode 100644 jauge.h delete mode 100644 menu.cpp delete mode 100644 menu.h delete mode 100644 misc.cpp delete mode 100644 misc.h delete mode 100644 movie.cpp delete mode 100644 movie.h delete mode 100644 network.cpp delete mode 100644 network.h delete mode 100644 ping.asm delete mode 100644 pixmap.cpp delete mode 100644 pixmap.h delete mode 100644 resource.h delete mode 100644 resource1.h delete mode 100644 resource2.h delete mode 100644 sound.cpp delete mode 100644 sound.h delete mode 100644 text.cpp delete mode 100644 text.h delete mode 100644 texttables.h delete mode 100644 wave.cpp delete mode 100644 wave.h diff --git a/IDC_ARROW.cur b/IDC_ARROW.cur deleted file mode 100644 index d8d49b4cf52950a0e9aadc53dc549d20418a1c30..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 326 zcmb8pI}XAy41i&qNHD_0+Ke50gJkMCdH@E-3<&4g3>D^2X{RpW=<`ca6p@3d#3)M) zDsrXk5s{&s7In${ST5JkU90Y#*Al-MO@Hn3MgS%5C3*?^VUBpHE{BGTpIq)Qj^t#|+Y?_^o3 zdGmK)Hak+Gq^6N- zx=qqe(j8FhAkka(|G6KwL)KY3K>|gV;Vu&!-qPbm7Sb82{bvV_*<$xF!U7rAIM3wf UhbwPd^2vR%Kdb!(=YTj?KYM0>`2YX_ diff --git a/IDC_ARROWL.cur b/IDC_ARROWL.cur deleted file mode 100644 index c40f7815fdbd318d2952f5e3cddb3729ee236e3d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 326 zcmZ{eu?>Vk3zM z>PaReNqma=pYO@c?&gbA(-)1?Qo9ZKITKYx-?7$A%*Q^hOYjemanKdJvr@(4l*&xZ R4yYpf!dk?9?8m*he*!a~e((SQ diff --git a/IDC_ARROWR.cur b/IDC_ARROWR.cur deleted file mode 100644 index ca8e1aa29359fd791648fd9ecc959703814673d3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 326 zcmZ|Ju@S;B5Jb^02%Nw;BgG*h9YAMNX)c8l2#G9q#VNt|X`XiO&Ylq*NK6x)IdM;L z0dArZPf0qi((d(DYh4fbCPfRI!wa&#!$)bo*AAOQQQBYW4V$%S+GM3Y!c{4ZVNlvJ P^gj0fw(0+8^;UnrA9#8- diff --git a/IDC_ARROWU.cur b/IDC_ARROWU.cur deleted file mode 100644 index 7390bf51757c1aef910e5d29d68ffad6ccb30ec2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 326 zcmb`Cu?m1N5JO*e6}mZhbo3AEpV?3ACly=^XR2d$(j3V_I7ki#93j92tPW=FMU=%R xI!!~mv==k$%`eWL;Dz2QqZP0WQ6a6gpbr0lsBfOBn3xq+)S%+;yR6v5>;x9?mcLXf zDQ7LZCFx9eg$z9;R%lr2w%Fc=dy~wcPxwmrpY*_AAE~@yf&sL8WSobXVYdn|gKmb= aZfpB;u$yEbak1A4TIisxedOF>3jYC9!FDYG diff --git a/IDC_ARROWUR.cur b/IDC_ARROWUR.cur deleted file mode 100644 index bd28c66f035bf7ed83b23f11fb756953cefa9486..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 326 zcmbu3F%H5&3lCd>ZfVO12CQiLQed z=o1{&qZlzr^3}@UzHAY(41Z46PHr2ok<&%J!R`T@0xLWTODg!wGE`*ny`Z@AADY?ko+3b!vXT)?@UN+j%kX`gK;=?w>w zn{`vOc4S4Hm~XuKIyPT9D@v>g1jSjdOLXIEODlHwGm0e?%54Y&|FWw!Z?b zkkEC&mf0s@58zBF;Yt!yF_gM25wR416{8?7OkmA;qD_A>l6iA8!2#G$2H`Hnt27*?HSg{Kt23OSi9h_W eGSZf4`qJ)qXY{Pm4_$ntrAE8Z6aec1Ht+#%!FHkm diff --git a/IDC_WAIT.cur b/IDC_WAIT.cur deleted file mode 100644 index 55f7588391be60a9eb674dfefeaa181724476505..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 326 zcmaKnu?@m75JkTeSx6WuqM;2XB^x*+umV$1kz^4>CLx&sJOWGr5(OzjK6gn$fy7z= zbUxjGJ_8X9mP;VP9BTtC0IWpPLMAeDG|D0WCX(M~@&MK|;PQm2_hr1xn~1N>l9jDl zIrhPk!SzL$ZtLJ~r;XN*KDfdM%R^;(tfKoRi}Q11PVZ7#15?==<2r!NMoEipLSAFC wfo@aufbW2`m2auUIZ<7K_>YDenNyE?Q(<^v6~Yv@@E`I{=gBr5YrRYT0sU`iM*si- diff --git a/IDR_MAINFRAME.ico b/IDR_MAINFRAME.ico deleted file mode 100644 index 37360fffbead3d959d6df9b9a3192cdbe286a321..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 766 zcmZ`%J5Iwu5Pil-8{`5iT2fM4+9Huszzw*Hr4){oA}hHdT@K?Sk+#_z~C=ZUpSWxHIE1(&}u;9 z3lTjLeAK0iV(c?jLzQH1Ef7`W-rEYkr8;v5I^CJKk@xYX<~KvW@zc6)>?EZxD(y|F zP^*WviDNWXzATMKVO<`1QRSrNRX#DXL&5ZtdAUWLxWKH{4A?4h<6Ey41NR)B;!?c! z6m^vU@;1gN@jf&2zRb%wgw6*Bb**fWK6pu9IZheJ1q#38Pr>BK4v#*9MVy<;qtl?yoOr!(B7&Z`YplnQe!1u11$*y4z?*uxm~<$QoEA zCe1-44 -#include -#include -#include -#include -#include -#include -#include -#include -#include "def.h" -#include "resource.h" -#include "ddutil.h" -#include "pixmap.h" -#include "sound.h" -#include "decor.h" -#include "movie.h" -#include "button.h" -#include "menu.h" -#include "jauge.h" -#include "event.h" -#include "misc.h" -#include "network.h" - -#pragma warning (disable : 4996) - -// Define Globals - -#define NAME "Blupi" -#define TITLE "Eggbert" -#define MMTIMER TRUE -#define THREAD FALSE - -// Variables Globals - -HWND g_hWnd; // handle � la fen�tre -CEvent* g_pEvent = NULL; -CPixmap* g_pPixmap = NULL; // pixmap principal -CSound* g_pSound = NULL; // sound principal -CMovie* g_pMovie = NULL; // movie principal -CDecor* g_pDecor = NULL; -CNetwork* g_pNetwork; -char g_CDPath[MAX_PATH]; // chemin d'acc�s au CD-Rom -BOOL g_bFullScreen = FALSE; // FALSE si mode de test -int g_speedRate = 1; -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_bActive = TRUE; // is application active ? -BOOL g_bTermInit = FALSE; // initialisation en cours -int g_bTimer; -int g_nbTimer; -HANDLE g_hScreenMutex; -HANDLE g_hRunMutex; -HANDLE g_threadNr; -HANDLE g_hThread; -LPDWORD* g_threadID; -int g_objectMax; -int g_elementMax; -int g_blupiMax; -int g_exploMax[100]; -short g_object[6]; -short g_element[6]; -short g_blupiCh[6]; -short g_explo[6]; - -UINT g_lastPhase = 999; - -int GetNum(char *p) -{ - int n = 0; - - while ( *p >= '0' && *p <= '9' ) - { - n *= 10; - n += (*p++)-'0'; - } - - return n; -} - -BOOL ReadConfig (LPSTR lpCmdLine) -{ - FILE* file = NULL; - char buffer[200]; - char* pText; - int nb; - int i; - _MEMORYSTATUS memstatus; - - file = fopen("data\\config.def", "rb"); - if ( file == NULL ) return FALSE; - nb = fread(buffer, sizeof(char), 200-1, file); - buffer[nb] = 0; - fclose(file); - - -#if 0 - pText = strstr(buffer, "CD-Rom="); - if ( pText == NULL ) - { -#if _DEMO - GetCurrentDirectory(MAX_PATH, g_CDPath); - i = strlen (g_CDPath); - if ( i > 0 && g_CDPath [i-1] != '\\' ) - { - g_CDPath[i++] = '\\'; - g_CDPath[i] = 0; - } -#else - return FALSE; -#endif - } - else - { - pText += 7; - i = 0; - while ( pText[i] != 0 && pText[i] != '\n' && pText[i] != '\r' ) - { - g_CDPath[i] = pText[i]; - i ++; - } - if ( i > 0 && g_CDPath[i-1] != '\\' ) - { - g_CDPath[i++] = '\\'; - } - g_CDPath[i] = 0; // met le terminateur - } - -#if !_DEMO & !_EGAMES - if ( strstr(lpCmdLine, "-nocd") == NULL ) - { - char drive[10]; - - drive[0] = g_CDPath[0]; - drive[1] = ':'; - drive[2] = '\\'; - drive[3] = 0; - nb = GetDriveType(drive); - if ( nb != DRIVE_CDROM ) return FALSE; - } -#endif -#endif - - pText = strstr(buffer, "SpeedRate="); - if ( pText != NULL ) - { - g_speedRate = GetNum(pText+10); - if ( g_speedRate < 1 ) g_speedRate = 1; - if ( g_speedRate > 2 ) g_speedRate = 2; - } - - pText = strstr(buffer, "Timer="); - if ( pText != NULL ) - { - g_timerInterval = GetNum(pText+6); - if ( g_timerInterval < 10 ) g_timerInterval = 10; - if ( g_timerInterval > 1000 ) g_timerInterval = 1000; - } - - pText = strstr(buffer, "FullScreen="); - if ( pText != NULL ) - { - g_bFullScreen = GetNum(pText+11); - if ( g_bFullScreen != 0 ) g_bFullScreen = 1; - } - - pText = strstr(buffer, "MouseType="); - if ( pText != NULL ) - { - g_mouseType = GetNum(pText+10); - if ( g_mouseType < 1 ) g_mouseType = 1; - if ( g_mouseType > 9 ) g_mouseType = 9; - } - - pText = strstr(buffer, "Benchmark="); - if ( pText != NULL ) - { - 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; - } - - pText = strstr(buffer, "TrueColor="); - if ( pText != NULL ) - { - i = GetNum(pText + 10); - if (i == 8) g_bTrueColor = FALSE; - if (i == 16) g_bTrueColor = TRUE; - g_bTrueColorDecor = g_bTrueColor; - } - - pText = strstr(buffer, "TrueColorBack="); - if ( pText != NULL ) - { - i = GetNum(pText+14); - if (i == 8) g_bTrueColor = FALSE; - - if (i == 16) g_bTrueColor = TRUE; - } - - pText = strstr(buffer, "TrueColorDecor="); - if ( pText != NULL ) - { - i = GetNum(pText + 15); - if (i == 8) g_bTrueColorDecor = FALSE; - - if (i == 16) g_bTrueColorDecor = TRUE; - } - - memstatus.dwLength = 32; - GlobalMemoryStatus(&memstatus); - if (memstatus.dwTotalPhys < 32000000) - { - g_bBenchmarkSuccess = FALSE; - } - if (g_bBenchmarkSuccess == FALSE) - { - g_bTrueColorBack = FALSE; - g_bTrueColorDecor = FALSE; - } - return TRUE; -} - -// Rewrite Variables - -void UpdateFrame(void) -{ - RECT clip, rcRect; - UINT phase; - BOOL type; - POINT posMouse; - int i, term, speed, targetlevel; - - g_pEvent->ReadInput(); - phase = g_pEvent->GetPhase(); - - if (phase == g_lastPhase && - phase == WM_PHASE_PLAY || phase == WM_PHASE_PLAYTEST || phase == WM_PHASE_BUILD) - { - type = g_pDecor->GetPause(); - if (type == FALSE) - { - speed = g_pEvent->GetSpeed(); - term = 0; - speed = speed * g_speedRate; - if (0 < speed) - { - do { - g_pDecor->MoveStep(); - g_pEvent->DemoStep(); - term++; - } while (term < speed); - } - } - - if (phase == WM_PHASE_INIT) - { - g_pEvent->DemoStep(); // d�marre �v. d�mo automatique - } - - if (phase == WM_PHASE_PLAYMOVIE || phase == WM_PHASE_WINMOVIE || phase == WM_PHASE_WINMOVIEDESIGN || phase == WM_PHASE_WINMOVIEMULTI) - { - g_pEvent->MovieToStart(); - } - - if (phase == WM_PHASE_INSERT) - { - g_pEvent->TryInsert(); - } - - if (phase == WM_PHASE_PLAY) - { - if (g_pEvent->IsPrivate() == FALSE) - { - if (g_pEvent->IsMulti() == FALSE) - { - if (g_pDecor->IsTerminated() == -1) - { - g_pEvent->GetWorldGroup(); - g_pEvent->SetLives(g_pDecor->GetNbVies()); - g_pEvent->ChangePhase(WM_PHASE_LOST); - } - if (g_pDecor->IsTerminated() == -2) - { - g_pEvent->SetLives(g_pDecor->GetNbVies()); - g_pEvent->ChangePhase(WM_PHASE_WINMOVIE); - } - if (0 < g_pDecor->IsTerminated()) - { - g_pEvent->SetLives(g_pDecor->GetNbVies()); - g_pEvent->SetMission(g_pDecor->IsTerminated()); - g_pEvent->ChangePhase(WM_PHASE_PLAY); - } - } - else - { - if (g_pDecor->IsTerminated() == -1) - { - g_pEvent->ChangePhase(WM_PHASE_WINm); - return; - } - if (g_pDecor->IsTerminated() != 0) - { - g_pEvent->ChangePhase(WM_PHASE_WINMOVIEm); - return; - } - } - } - else - { - if (g_pDecor->IsTerminated() == -1) - { - g_pEvent->ChangePhase(WM_PHASE_LOSTd); - return; - } - if (g_pDecor->IsTerminated() != 0) - { - g_pEvent->ChangePhase(WM_PHASE_WINMOVIEd); - return; - } - } - } - } - return; -} - - - -// Incomplete - -void SetDecor() -{ - RECT rect; - UINT phase; - POINT posMouse; - char test[12]; - - g_pPixmap->MouseBackClear(); - g_pEvent->GetLastMousePos(); - phase = g_pEvent->GetPhase(); - - if (phase == WM_PHASE_PLAY || phase == WM_PHASE_PLAYTEST || phase == WM_PHASE_BUILD) - { - rect.top = 0; - rect.left = 0; - rect.bottom = LYIMAGE; - rect.right = LXIMAGE; - g_pDecor->Build(rect); - } - else - { - rect.top = 0; - rect.left = 0; - rect.bottom = LYIMAGE; - rect.right = LXIMAGE; - g_pPixmap->DrawImage(-1, CHBACK, rect, 1); - } - g_pEvent->DrawButtons(); - g_lastPhase = phase; - g_pPixmap->MouseBackDraw(); -} - -BOOL RestoreGame() -{ - if ( g_pPixmap == NULL ) return FALSE; - - g_pEvent->RestoreGame(); - return g_pPixmap->Restore(); -} - -BOOL FlushGame() -{ - if ( g_pPixmap == NULL ) return FALSE; - - return g_pPixmap->Flush(); -} - -static void FinishObjects(void) -{ - if ( g_pMovie != NULL ) - { - g_pEvent->StopMovie(); - - delete g_pMovie; - g_pMovie = NULL; - } - - if ( g_pEvent != NULL ) - { - delete g_pEvent; - g_pEvent = NULL; - } - - if ( g_pDecor != NULL ) - { - delete g_pDecor; - g_pDecor = NULL; - } - - if (g_pSound != NULL ) - { - g_pSound->StopMusic(); - - delete g_pSound; - g_pSound = NULL; - } - - if (g_pNetwork != NULL ) - { - delete g_pNetwork; - g_pNetwork = NULL; - } - - if ( g_pPixmap != NULL ) - { - delete g_pPixmap; - g_pPixmap = NULL; - } -} - -LRESULT CALLBACK WindowProc (HWND hWnd, UINT message, - WPARAM wParam, LPARAM lParam) -{ - static HINSTANCE hInstance; - POINT mousePos, totalDim, iconDim; - - if ( message == WM_SYSKEYDOWN && wParam == VK_F10 ) - { - message = WM_KEYDOWN; - } - if ( message == WM_SYSKEYUP && wParam == VK_F10 ) - { - message = WM_KEYUP; - } - - if ( g_pEvent != NULL && - g_pEvent->TreatEvent(message, wParam, lParam) ) return 0; - - switch( message ) - { - case WM_TIMER: - case WM_SYSCOLORCHANGE: - OutputDebug("Event WM_SYSCOLORCHANGE\n"); - break; - case WM_CREATE: - hInstance = ((LPCREATESTRUCT)lParam)->hInstance; - return 0; - break; - - case WM_ACTIVATEAPP: - g_bActive = (wParam != 0); - if (g_pEvent != NULL) - { - g_pEvent->FlushInput(); - } - if ( g_bActive ) - { - if ( g_bFullScreen ) - { - RestoreGame(); - g_lastPhase = 999; - } - if ( !g_bFullScreen && g_bTermInit ) - { - totalDim.x = 256; - totalDim.y = 96; - iconDim.x = DIMLITTLEX; - iconDim.y = DIMLITTLEY; - g_pPixmap->BackgroundCache(CHLITTLE, "little.blp", totalDim, iconDim, TRUE); - g_pPixmap->SetTransparent(CHLITTLE, RGB(0,0,255)); - - g_pPixmap->SavePalette(); - g_pPixmap->InitSysPalette(); - } - SetWindowTextA(hWnd, "Blupi"); - if ( g_pSound != NULL ) g_pSound->RestartMusic(); - } - else - { - if ( g_bFullScreen ) - { - FlushGame(); - } - SetWindowTextA(hWnd, "Blupi -- stop"); - if ( g_pSound != NULL ) g_pSound->SuspendMusic(); - } - return 0; - - case WM_KEYDOWN: - switch( wParam ) - { - case VK_F5: - g_pEvent->SetSpeed(1); - break; - case VK_F6: - g_pEvent->SetSpeed(2); - break; - case VK_F7: - g_pEvent->SetSpeed(4); - break; - case VK_F8: - g_pEvent->SetSpeed(8); - break; - } - break; - - case WM_DISPLAYCHANGE: - OutputDebug("Event WM_DISPLAYCHANGE\n"); - break; - case WM_QUERYNEWPALETTE: - OutputDebug("Event WM_QUERYNEWPALETTE\n"); - break; - case WM_PALETTECHANGED: - OutputDebug("Event WM_PALLETECHANGED\n"); - break; - case MM_MCINOTIFY: - OutputDebug("Event MM_MCINOTIFY\n"); - if ( g_pEvent->IsMovie() ) - { - if ( wParam == MCI_NOTIFY_SUCCESSFUL ) - { - g_pEvent->StopMovie(); - } - } - else - { - g_pSound->SuspendMusic(); - if ( wParam == MCI_NOTIFY_SUCCESSFUL ) - { - OutputDebug("Event MCI_NOTIFY_SUCCESSFUL\n"); - g_pSound->RestartMusic(); - } - else - { - char s[50]; - sprintf(s, "wParam=%d\n", wParam); - OutputDebug(s); - } - } - break; - - case WM_LBUTTONDOWN: - GetCursorPos(&mousePos); - ScreenToClient(hWnd, &mousePos); - break; - - case WM_DESTROY: - KillTimer(g_hWnd, 1); - FinishObjects(); - PostQuitMessage(0); - break; - case WM_SETCURSOR: -// ChangeSprite(); -// SetCursor(NULL); - return TRUE; - case WM_UPDATE: - if ( !g_pEvent->IsMovie() ) - { - if ( g_bActive ) - { - UpdateFrame(); - } - g_pPixmap->Display(); - } - break; - } - - return DefWindowProc(hWnd, message, wParam, lParam); - -} - -LPTIMECALLBACK TimerStep() -{ - if ((g_bActive != FALSE) && (g_bTimer == 0)) - { - g_bTimer = 1; - PostAppMessageA(g_hWnd, 1025, 0, 0); - } - return NULL; -} - -BOOL InitFail(const char *msg, BOOL bDirectX) -{ - char buffer[100]; - - if ( bDirectX ) strcpy(buffer, "DirectX Init FAILED\n(while "); - else strcpy(buffer, "Error ("); - strcat(buffer, msg); - strcat(buffer, ")"); - MessageBoxA(g_hWnd, buffer, TITLE, MB_OK); - - FinishObjects(); - DestroyWindow(g_hWnd); - return FALSE; -} - -int Benchmark() -{ - struct _timeb tstruct; - int i, j, t1, t2, time; - RECT rect; - POINT dest; - _MEMORYSTATUS mem; - - _ftime(&tstruct); - t1 = tstruct.millitm; - - for (j = 0; j < 10; j++) - { - UpdateFrame(); - SetDecor(); - g_pPixmap->Display(); - } - - _ftime(&tstruct); - t2 = tstruct.millitm; - - if (t1 > t2) t2 += 1000; - time = t2 - t1; - - mem.dwLength = 32; - GlobalMemoryStatus(&mem); - FILE* file = NULL; - char string[100]; - sprintf(string, "CheckTime = %d Memory = %d\r\n", time, mem.dwTotalPhys); - file = fopen("data\\time.blp", "wb"); - if (file == NULL) return time; - fwrite(string, strlen(string), 1, file); - fclose(file); - - return time; -} - -static BOOL DoInit(HINSTANCE hInstance, LPSTR lpCmdLine, int nCmdShow) -{ - WNDCLASSA wc; - POINT totalDim, iconDim; - RECT rcRect; - BOOL bOK; - - bOK = ReadConfig(lpCmdLine); - - InitHInstance(hInstance); - - wc.style = CS_HREDRAW | CS_VREDRAW; - wc.lpfnWndProc = WindowProc; - wc.cbClsExtra = 0; - wc.cbWndExtra = 0; - wc.hInstance = hInstance; - wc.hIcon = LoadIconA(hInstance, "IDR_MAINFRAME"); - wc.hCursor = LoadCursorA(hInstance, "IDC_POINTER"); - wc.hbrBackground = GetStockBrush(BLACK_BRUSH); - wc.lpszMenuName = NAME; - wc.lpszClassName = NAME; - RegisterClassA(&wc); - - if (g_bFullScreen) - { - g_hWnd = CreateWindowExA - ( - WS_EX_TOPMOST, - NAME, - TITLE, - WS_POPUP, - 0, 0, - GetSystemMetrics(SM_CXSCREEN), - GetSystemMetrics(SM_CYSCREEN), - NULL, - NULL, - hInstance, - NULL - ); - } - else - { - int sx, sy; - RECT WindowRect; - - sx = GetSystemMetrics(SM_CXSCREEN); - sy = GetSystemMetrics(SM_CYSCREEN); - - SetRect(&WindowRect, (sx - LXIMAGE) / 2, (sy - LYIMAGE) / 2, - (sx + LXIMAGE) / 2, (sy + LYIMAGE) / 2); - AdjustWindowRect(&WindowRect, WS_POPUPWINDOW | WS_CAPTION, TRUE); - WindowRect.top += GetSystemMetrics(SM_CYCAPTION); - - g_hWnd = CreateWindowA - ( - NAME, - TITLE, - WS_POPUPWINDOW | WS_CAPTION | WS_VISIBLE, - (sx - LXIMAGE) / 2, (sy - LYIMAGE) / 2, - WindowRect.right - WindowRect.left, - WindowRect.bottom - WindowRect.top, - HWND_DESKTOP, - NULL, - hInstance, - NULL - ); - } - if (!g_hWnd) return FALSE; - - ShowWindow(g_hWnd, nCmdShow); - UpdateWindow(g_hWnd); - SetFocus(g_hWnd); - - ChangeSprite(SPRITE_WAIT); - - //ZeroMemory(&g_pPixmap, sizeof(7068)); - - if (!bOK) - { - return InitFail("Game not correctly installed", FALSE); - } - - - 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, g_bTrueColor, g_bTrueColorDecor)) - return InitFail("Create pixmap", TRUE); - - g_pPixmap->SetBenchmarkSuccess(g_bBenchmarkSuccess); - OutputDebug("Image: init\n"); - totalDim.x = LXIMAGE; - totalDim.y = LYIMAGE; - iconDim.x = 0; - iconDim.y = 0; - - if (!g_pPixmap->CacheAll(TRUE, g_hWnd, g_bFullScreen, g_bTrueColor, g_bTrueColorDecor, g_mouseType, "init.blp", 0)) - return InitFail("CacheAll", TRUE); - - OutputDebug("SavePalette\n"); - g_pPixmap->SavePalette(); - OutputDebug("InitSysPalette\n"); - g_pPixmap->InitSysPalette(); - g_pPixmap->SetTrueColor(TRUE); - g_pPixmap->SetTrueColorDecor(TRUE); - - //ZeroMemory(&g_pSound, sizeof(644)); - - g_pSound = new CSound; - if (g_pSound == NULL) return InitFail("New sound", TRUE); - - g_pSound->Create(g_hWnd); - g_pSound->CacheAll(); - g_pSound->SetState(TRUE); - - //ZeroMemory(&g_pMovie, sizeof(164)); - - g_pMovie = new CMovie; - if (g_pMovie == NULL) return InitFail("New movie", FALSE); - - g_pMovie->Create(); - - //ZeroMemory(&g_pDecor, sizeof(156448)); - - g_pDecor = new CDecor; - if (g_pDecor == NULL) return InitFail("New decor", FALSE); - - g_pDecor->Create(g_hWnd, g_pSound, g_pPixmap, g_pNetwork); - - //ZeroMemory(&g_pEvent, sizeof(39904)); - - g_pEvent = new CEvent; - if (g_pEvent == NULL) return InitFail("New event", FALSE); - - 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); - g_pEvent->ChangePhase(WM_PHASE_INIT); - - //ZeroMemory(&g_pNetwork, sizeof(20)); - - g_pNetwork = new CNetwork; - if (g_pNetwork == NULL) return InitFail("New network", FALSE); - g_pNetwork->CreateProvider(0); - - g_bTermInit = TRUE; - return TRUE; -} - -#if MMTIMER -void CALLBACK UpdateTimer_Proc(UINT uIDm, UINT uMsg, DWORD dwUser, DWORD dw1, DWORD dw2) -{ - if (g_bActive && g_nbTimer == 0) - { - g_nbTimer++; - PostMessageA(g_hWnd, WM_UPDATE, NULL, NULL); - } -} -#endif - -int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, - LPSTR lpCmdLine, int nCmdShow) -{ - MSG msg; - LPTIMECALLBACK timeStep; - - if ( !DoInit(hInstance, lpCmdLine, nCmdShow) ) - { - return FALSE; - } - - Benchmark(); - -#if MMTIMER - g_updateTimer = timeSetEvent(g_timerInterval, g_timerInterval / 4, UpdateTimer_Proc, NULL, TIME_PERIODIC); - - -#else - SetTimer(g_hWnd, 1, g_timerInterval, NULL); -#endif - -#if THREAD - g_hScreenMutex = CreateMutex(NULL, FALSE, NULL); - g_hRunMutex = CreateMutex(NULL, TRUE, NULL); - g_threadNr = 0; - - g_hThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadDisplay, 0, DETACHED_PROCESS, &g_threadID); - -#endif - - while ( TRUE ) - { - if ( PeekMessageA(&msg, NULL, 0,0, PM_NOREMOVE) ) - { - if ( !GetMessage(&msg, NULL, 0, 0) ) - { - return msg.wParam; - } - TranslateMessage(&msg); - DispatchMessageA(&msg); - } - else - { - if ( !g_bActive ) WaitMessage(); - } - } - - return msg.wParam; -} - -#if THREAD -// Thread d'affichage. - -static void ThreadDisplay(char* MyID) -{ - UINT phase; - - do - { - phase = g_pEvent->GetPhase(); - if (phase == WM_PHASE_PLAY) - { - // Wait for display to be available, then lock it. - WaitForSingleObject(g_hScreenMutex, INFINITE); - - SetDecor(); - g_pPixmap->Display(); - - // Clear screen lock. - ReleaseMutex(g_hScreenMutex); - } - } - // Repeat while RunMutex is still taken. - while (WaitForSingleObject(g_hRunMutex, 10L) == WAIT_TIMEOUT); -} -#endif \ No newline at end of file diff --git a/button.cpp b/button.cpp deleted file mode 100644 index 9e7bd8e..0000000 --- a/button.cpp +++ /dev/null @@ -1,424 +0,0 @@ -// Button.cpp -// - -#include -#include -#include -#include -#include -#include -#include "def.h" -#include "pixmap.h" -#include "sound.h" -#include "decor.h" -#include "button.h" -#include "misc.h" - -using namespace std; - -////////////////////////////////////////////////////////// - -// Constructor - -CButton::CButton() -{ - m_type = 0; - m_bEnable = TRUE; - m_bHide = FALSE; - m_bSomething = FALSE; - m_state = 0; - m_mouseState = 0; - m_nbMenu = 0; - m_nbToolTips = 0; - m_selMenu = 0; - m_bMouseDown = FALSE; - m_bMinimizeRedraw = FALSE; - m_bRedraw = FALSE; -} - -// Destructor - -CButton::~CButton() -{ -} - - -// Create a new Button - -BOOL CButton::Create(HWND hWnd, CPixmap *pPixmap, CSound *pSound, - POINT pos, int type, BOOL bMinimizeRedraw, UINT message) -{ - POINT iconDim; - int i, icon; - - static int ttypes[] = - { - DIMBUTTONX,DIMBUTTONY, - }; - - if ( type < 0 || type > 0 ) return FALSE; - - - iconDim.x = ttypes[type * 2 + 0]; - iconDim.y = ttypes[type * 2 + 1]; - - m_hWnd = hWnd; - m_pPixmap = pPixmap; - m_pSound = pSound; - m_type = type; - m_bMinimizeRedraw = bMinimizeRedraw; - m_bEnable = TRUE; - m_bHide = FALSE; - m_bSomething = FALSE; - m_message = message; - m_pos.x = pos.x; - m_pos.y = pos.y; - m_dim.x = iconDim.x; - m_dim.y = iconDim.y; - m_nbMenu = 0; - m_nbToolTips = 0; - m_selMenu = 0; - m_state = 0; - m_mouseState = 0; - m_bMouseDown = FALSE; - m_bRedraw = TRUE; - return TRUE; -} - -void CButton::SetIconMenu(int* icon, int iconMenu) -{ - int i = iconMenu; - int* iconMenu2; - - if (0 < iconMenu) - { - iconMenu2 = m_iconMenu; - for (i = 0; i < iconMenu; i++) - { - icon++; - m_iconMenu[i] = icon[i]; - } - } - m_nbMenu = iconMenu; -} - -void CButton::SetToolTips(int* menu, int menuTooltips) -{ - int toolTips; - int* menuTool; - int i; - - if (0 < menuTooltips) - { - menuTool = m_toolTips; - i = menuTooltips; - for (i = 0; i < menuTooltips; i++) - { - menu++; - m_toolTips[i] = menu[i]; - } - } - m_nbToolTips = menuTooltips; -} - -// Draw a button in its state - -void CButton::Draw() -{ - int i; - POINT pos; - RECT rect; - - if ( m_bMinimizeRedraw && !m_bRedraw ) return; - m_bRedraw = FALSE, m_bSomething = FALSE; - - if ( m_bHide ) // Hidden button - { - pos.y = m_pos.y; - pos.x = m_pos.x; - return; - } - - if( m_bEnable ) - { - m_pPixmap->DrawIcon(-1, CHBUTTON+m_type, m_mouseState, m_pos); - } - else - { - m_pPixmap->DrawIcon(-1, CHBUTTON+m_type, 4, m_pos); - } - - if ( m_nbMenu == 0 ) return; - - pos = m_pos; - if ( m_nbMenu > 0 ) - { - m_pPixmap->DrawIcon(-1, CHBUTTON+m_type, - m_iconMenu[m_selMenu]+6, pos); - } - - if ( m_nbMenu == 1 || !m_bEnable || !m_bMouseDown ) return; - - pos = m_pos; - pos.x += m_dim.x+2; - for ( i=0 ; iDrawIcon(-1, CHBUTTON+m_type, i==m_selMenu?1:0, pos); - m_pPixmap->DrawIcon(-1, CHBUTTON+m_type, m_iconMenu[i]+6, pos); - pos.x += m_dim.x-1; - } -} - -/* -/Needed Yet? -////////////////////////////////////////////// -void CButton::Redraw() -{ - m_bRedraw = TRUE; -} -////////////////////////////////////////////// -*/ - -int CButton::GetState() -{ - return m_state; -} - -void CButton::SetState(int state) -{ - if ( m_state != state || - m_mouseState != state ) - { - m_bRedraw = TRUE; - } - - m_state = state; - m_mouseState = state; -} - -int CButton::GetMenu() -{ - return m_selMenu; -} - -void CButton::SetMenu(int menu) -{ - if ( m_selMenu != menu ) - { - m_bRedraw = TRUE; - } - - m_selMenu = menu; -} - -void CButton::SetEnable(BOOL bEnable) -{ - if ( m_bEnable != bEnable ) - { - m_bRedraw = TRUE; - } - - m_bEnable = bEnable; -} - -void CButton::SetSomething(BOOL bSomething) -{ - if (m_bSomething != bSomething) - { - m_bRedraw = TRUE; - } - - m_bSomething = bSomething; -} - - -/* -// Needed Yet? -///////////////////////////////////////// -BOOL CButton::GetHide() -{ - return m_bHide; -} -///////////////////////////////////////// -*/ - - -void CButton::SetHide(BOOL bHide) -{ - if ( m_bHide != bHide ) - { - m_bRedraw = TRUE; - } - - m_bHide = bHide; -} - -BOOL CButton::TreatEvent(UINT message, WPARAM wParam, LPARAM lParam) -{ - POINT pos; - - if ( m_bHide || !m_bEnable ) return FALSE; - - pos = ConvLongToPos(lParam); - - switch( message ) - { - case WM_LBUTTONDOWN: - case WM_RBUTTONDOWN: - if ( MouseDown(pos) ) return TRUE; - break; - - case WM_MOUSEMOVE: - if ( MouseMove(pos) ) return TRUE; - break; - - case WM_LBUTTONUP: - case WM_RBUTTONUP: - if ( MouseUp(pos) ) return FALSE; - break; - } - - return FALSE; -} - -// All buttons must receive the BUTTONUP event! - -// Indicates whether the mouse is over this button. - -BOOL CButton::MouseOnButton(POINT pos) -{ - return Detect(pos); -} - -// Return the tooltips for a button, depending -// on mouse position. - -int CButton::GetToolTips(POINT pos) -{ - int width = m_dim.x; - int rank; - - if ( m_bHide || !m_bEnable ) return -1; - - if ( m_nbMenu > 1 && m_bMouseDown ) // Drop-down submenu? - { - width += 2+(m_dim.x-1)*m_nbMenu; - } - - if ( pos.x < m_pos.x || - pos.x > m_pos.x+width || - pos.y < m_pos.y || - pos.y > m_pos.y+m_dim.y ) return -1; - - rank = (pos.x=-(m_pos.x+2+1))/(m_dim.x-1); - if ( rank < 0 ) rank = 0; - if ( rank > m_nbToolTips ) return -1; - - if ( m_nbMenu > 1 ) - { - if ( m_bMouseDown && rank > 0 ) - { - rank --; - } - else - { - rank = m_selMenu; - } - } - - return m_toolTips[rank]; -} - -BOOL CButton::Detect(POINT pos) -{ - int width = m_dim.x; - - if ( m_bHide || !m_bEnable ) return FALSE; - - if ( m_nbMenu > 1 && m_bMouseDown ) - { - width += 2+(m_dim.x-1)*m_nbMenu; - } - - if ( pos.x < m_pos.x || - pos.x > m_pos.x+width || - pos.y < m_pos.y || - pos.y > m_pos.y+m_dim.y ) return FALSE; - - return TRUE; -} - -BOOL CButton::MouseDown(POINT pos) -{ - if ( !Detect(pos) ) return FALSE; - - m_mouseState = 1; - m_bMouseDown = TRUE; - m_bRedraw = TRUE; -// PostMessage(m_hWnd, WM_UPDATE, 0, 0); - - m_pSound->PlayImage(SOUND_1_CLICK, pos); - return TRUE; -} - -BOOL CButton::MouseMove(POINT pos) -{ - BOOL bDetect; - int iState, iMenu; - - iState = m_mouseState; - iMenu = m_selMenu; - - bDetect = Detect(pos); - - if ( m_bMouseDown ) - { - if ( bDetect ) m_mouseState = 1; - else m_mouseState = m_state; - } - else - { - if ( bDetect ) m_mouseState = m_state+2; - else m_mouseState = m_state; - } - - if ( m_nbMenu > 1 && - m_bMouseDown && - pos.x > m_pos.x+m_dim.x+2 ) - { - m_selMenu = (pos.x-(m_pos.x+m_dim.x+2))/(m_dim.x-1); - if ( m_selMenu >= m_nbMenu ) - { - m_selMenu = m_nbMenu-1; - } - } - - if ( iState != m_mouseState || - iMenu != m_selMenu ) - { - m_bRedraw = TRUE; - PostMessage(m_hWnd, WM_UPDATE, 0, 0); - } - - return m_bMouseDown; -} - -BOOL CButton::MouseUp(POINT pos) -{ - BOOL bDetect; - - bDetect = Detect(pos); - - m_mouseState = m_state; - m_bMouseDown = FALSE; - m_bRedraw = TRUE; - - if ( !bDetect ) return FALSE; - - if ( m_message != -1 ) - { - PostMessage(m_hWnd, m_message, 0, 0); - } - - return TRUE; -} \ No newline at end of file diff --git a/button.h b/button.h deleted file mode 100644 index 926e7a2..0000000 --- a/button.h +++ /dev/null @@ -1,71 +0,0 @@ -#include -#include -#include "decor.h" -#include "sound.h" -#include "pixmap.h" - -#pragma once - -using namespace std; - -class CButton -{ -public: - CButton(); - ~CButton(); - - BOOL Create(HWND hWnd, CPixmap *pPixmap, CSound *pSound, - POINT pos, int type, BOOL bMinimizeRedraw, UINT message); - void SetIconMenu(int* icon, int iconMenu); - void SetToolTips(int* menu, int menuTooltips); - void Draw(); - void Redraw(); - - int GetState(); - void SetState(int state); - - int GetMenu(); - void SetMenu(int menu); - - BOOL GetEnable(); - void SetEnable(BOOL bEnable); - - void SetSomething(BOOL bSomething); - - BOOL GetHide(); - void SetHide(BOOL bHide); - - BOOL TreatEvent(UINT message, WPARAM wParam, LPARAM lParam); - BOOL MouseOnButton(POINT pos); - int GetToolTips(POINT pos); - - -protected: - BOOL Detect(POINT pos); - BOOL MouseDown(POINT pos); - BOOL MouseMove(POINT pos); - BOOL MouseUp(POINT pos); - -protected: - HWND m_hWnd; - CPixmap* m_pPixmap; - CDecor* m_pDecor; - CSound* m_pSound; - int m_type; // type de bouton - BOOL m_bEnable; // TRUE si bouton actif - BOOL m_bHide; // TRUE si bouton cach� - UINT m_message; // message envoy� si bouton actionn� - POINT m_pos; // coin sup/gauche - POINT m_dim; // dimensions - int m_state; - int m_mouseState; - int m_iconMenu[20]; // ic�nes du sous-menu - int m_toolTips[20]; // info-bulles - int m_nbMenu; // nb de case du sous-menu - int m_nbToolTips; // nb d'info-bulles - int m_selMenu; - int m_bSomething; // sous-menu s�lectionn� - BOOL m_bMouseDown; // TRUE -> bouton souris press� - BOOL m_bMinimizeRedraw; - BOOL m_bRedraw; -}; \ No newline at end of file diff --git a/cursor1.cur b/cursor1.cur deleted file mode 100644 index 850ce01cfd00e6b13765eff43a49c3bc5cc7ae21..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 326 zcmZQzU}9ioP*7lC5MbbBFkob05My9q&;Vkf5Q75{GXfz9G=ND6!33m07zF;Sp}6+CGE|NoyoP^_Ld7-Tlc4k!QsO*VG< diff --git a/ddraw.h b/ddraw.h deleted file mode 100644 index 224181f..0000000 --- a/ddraw.h +++ /dev/null @@ -1,3102 +0,0 @@ -/*==========================================================================; - * - * Copyright (C) 1994-1996 Microsoft Corporation. All Rights Reserved. - * - * File: ddraw.h - * Content: DirectDraw include file - * - ***************************************************************************/ - -#ifndef __DDRAW_INCLUDED__ -#define __DDRAW_INCLUDED__ -#if defined( _WIN32 ) && !defined( _NO_COM ) -#define COM_NO_WINDOWS_H -#include -#else -#define IUnknown void -#define CO_E_NOTINITIALIZED 0x800401F0L -#endif - -#define _FACDD 0x876 -#define MAKE_DDHRESULT( code ) MAKE_HRESULT( 1, _FACDD, code ) - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * GUIDS used by DirectDraw objects - */ -#if defined( _WIN32 ) && !defined( _NO_COM ) -DEFINE_GUID( CLSID_DirectDraw, 0xD7B70EE0,0x4340,0x11CF,0xB0,0x63,0x00,0x20,0xAF,0xC2,0xCD,0x35 ); -DEFINE_GUID( CLSID_DirectDrawClipper, 0x593817A0,0x7DB3,0x11CF,0xA2,0xDE,0x00,0xAA,0x00,0xb9,0x33,0x56 ); -DEFINE_GUID( IID_IDirectDraw, 0x6C14DB80,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 ); -DEFINE_GUID( IID_IDirectDraw2, 0xB3A6F3E0,0x2B43,0x11CF,0xA2,0xDE,0x00,0xAA,0x00,0xB9,0x33,0x56 ); -DEFINE_GUID( IID_IDirectDrawSurface, 0x6C14DB81,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 ); -DEFINE_GUID( IID_IDirectDrawSurface2, 0x57805885,0x6eec,0x11cf,0x94,0x41,0xa8,0x23,0x03,0xc1,0x0e,0x27 ); - -DEFINE_GUID( IID_IDirectDrawPalette, 0x6C14DB84,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 ); -DEFINE_GUID( IID_IDirectDrawClipper, 0x6C14DB85,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 ); - -#endif - -/*============================================================================ - * - * DirectDraw Structures - * - * Various structures used to invoke DirectDraw. - * - *==========================================================================*/ - -struct IDirectDraw; -struct IDirectDrawSurface; -struct IDirectDrawPalette; -struct IDirectDrawClipper; - -typedef struct IDirectDraw FAR *LPDIRECTDRAW; -typedef struct IDirectDraw2 FAR *LPDIRECTDRAW2; -typedef struct IDirectDrawSurface FAR *LPDIRECTDRAWSURFACE; -typedef struct IDirectDrawSurface2 FAR *LPDIRECTDRAWSURFACE2; - -typedef struct IDirectDrawPalette FAR *LPDIRECTDRAWPALETTE; -typedef struct IDirectDrawClipper FAR *LPDIRECTDRAWCLIPPER; - -typedef struct _DDFXROP FAR *LPDDFXROP; -typedef struct _DDSURFACEDESC FAR *LPDDSURFACEDESC; - -/* - * API's - */ -#if (defined (WIN32) || defined( _WIN32 ) ) && !defined( _NO_COM ) -//#if defined( _WIN32 ) && !defined( _NO_ENUM ) - typedef BOOL (FAR PASCAL * LPDDENUMCALLBACKA)(GUID FAR *, LPSTR, LPSTR, LPVOID); - typedef BOOL (FAR PASCAL * LPDDENUMCALLBACKW)(GUID FAR *, LPWSTR, LPWSTR, LPVOID); - extern HRESULT WINAPI DirectDrawEnumerateW( LPDDENUMCALLBACKW lpCallback, LPVOID lpContext ); - extern HRESULT WINAPI DirectDrawEnumerateA( LPDDENUMCALLBACKA lpCallback, LPVOID lpContext ); - #ifdef UNICODE - typedef LPDDENUMCALLBACKW LPDDENUMCALLBACK; - #define DirectDrawEnumerate DirectDrawEnumerateW - #else - typedef LPDDENUMCALLBACKA LPDDENUMCALLBACK; - #define DirectDrawEnumerate DirectDrawEnumerateA - #endif - extern HRESULT WINAPI DirectDrawCreate( GUID FAR *lpGUID, LPDIRECTDRAW FAR *lplpDD, IUnknown FAR *pUnkOuter ); - extern HRESULT WINAPI DirectDrawCreateClipper( DWORD dwFlags, LPDIRECTDRAWCLIPPER FAR *lplpDDClipper, IUnknown FAR *pUnkOuter ); - #ifdef WINNT - //This is the user-mode entry stub to the kernel mode procedure. - extern HRESULT NtDirectDrawCreate( GUID FAR *lpGUID, HANDLE *lplpDD, IUnknown FAR *pUnkOuter ); - #endif -#endif - -#define REGSTR_KEY_DDHW_DESCRIPTION "Description" -#define REGSTR_KEY_DDHW_DRIVERNAME "DriverName" -#define REGSTR_PATH_DDHW "Hardware\\DirectDrawDrivers" - -#define DDCREATE_HARDWAREONLY 0x00000001l -#define DDCREATE_EMULATIONONLY 0x00000002l - -#ifdef WINNT -typedef long HRESULT; -#endif - -//#ifndef WINNT -typedef HRESULT (FAR PASCAL * LPDDENUMMODESCALLBACK)(LPDDSURFACEDESC, LPVOID); -typedef HRESULT (FAR PASCAL * LPDDENUMSURFACESCALLBACK)(LPDIRECTDRAWSURFACE, LPDDSURFACEDESC, LPVOID); -//#endif -/* - * DDCOLORKEY - */ -typedef struct _DDCOLORKEY -{ - DWORD dwColorSpaceLowValue; // low boundary of color space that is to - // be treated as Color Key, inclusive - DWORD dwColorSpaceHighValue; // high boundary of color space that is - // to be treated as Color Key, inclusive -} DDCOLORKEY; - -typedef DDCOLORKEY FAR* LPDDCOLORKEY; - -/* - * DDBLTFX - * Used to pass override information to the DIRECTDRAWSURFACE callback Blt. - */ -typedef struct _DDBLTFX -{ - DWORD dwSize; // size of structure - DWORD dwDDFX; // FX operations - DWORD dwROP; // Win32 raster operations - DWORD dwDDROP; // Raster operations new for DirectDraw - DWORD dwRotationAngle; // Rotation angle for blt - DWORD dwZBufferOpCode; // ZBuffer compares - DWORD dwZBufferLow; // Low limit of Z buffer - DWORD dwZBufferHigh; // High limit of Z buffer - DWORD dwZBufferBaseDest; // Destination base value - DWORD dwZDestConstBitDepth; // Bit depth used to specify Z constant for destination - union - { - DWORD dwZDestConst; // Constant to use as Z buffer for dest - LPDIRECTDRAWSURFACE lpDDSZBufferDest; // Surface to use as Z buffer for dest - }; - DWORD dwZSrcConstBitDepth; // Bit depth used to specify Z constant for source - union - { - DWORD dwZSrcConst; // Constant to use as Z buffer for src - LPDIRECTDRAWSURFACE lpDDSZBufferSrc; // Surface to use as Z buffer for src - }; - DWORD dwAlphaEdgeBlendBitDepth; // Bit depth used to specify constant for alpha edge blend - DWORD dwAlphaEdgeBlend; // Alpha for edge blending - DWORD dwReserved; - DWORD dwAlphaDestConstBitDepth; // Bit depth used to specify alpha constant for destination - union - { - DWORD dwAlphaDestConst; // Constant to use as Alpha Channel - LPDIRECTDRAWSURFACE lpDDSAlphaDest; // Surface to use as Alpha Channel - }; - DWORD dwAlphaSrcConstBitDepth; // Bit depth used to specify alpha constant for source - union - { - DWORD dwAlphaSrcConst; // Constant to use as Alpha Channel - LPDIRECTDRAWSURFACE lpDDSAlphaSrc; // Surface to use as Alpha Channel - }; - union - { - DWORD dwFillColor; // color in RGB or Palettized - DWORD dwFillDepth; // depth value for z-buffer - LPDIRECTDRAWSURFACE lpDDSPattern; // Surface to use as pattern - }; - DDCOLORKEY ddckDestColorkey; // DestColorkey override - DDCOLORKEY ddckSrcColorkey; // SrcColorkey override -} DDBLTFX; - -typedef DDBLTFX FAR* LPDDBLTFX; - - -/* - * DDSCAPS - */ -typedef struct _DDSCAPS -{ - DWORD dwCaps; // capabilities of surface wanted -} DDSCAPS; - -typedef DDSCAPS FAR* LPDDSCAPS; - -/* - * DDCAPS - */ -#define DD_ROP_SPACE (256/32) // space required to store ROP array - -typedef struct _DDCAPS -{ - DWORD dwSize; // size of the DDDRIVERCAPS structure - DWORD dwCaps; // driver specific capabilities - DWORD dwCaps2; // more driver specific capabilites - DWORD dwCKeyCaps; // color key capabilities of the surface - DWORD dwFXCaps; // driver specific stretching and effects capabilites - DWORD dwFXAlphaCaps; // alpha driver specific capabilities - DWORD dwPalCaps; // palette capabilities - DWORD dwSVCaps; // stereo vision capabilities - DWORD dwAlphaBltConstBitDepths; // DDBD_2,4,8 - DWORD dwAlphaBltPixelBitDepths; // DDBD_1,2,4,8 - DWORD dwAlphaBltSurfaceBitDepths; // DDBD_1,2,4,8 - DWORD dwAlphaOverlayConstBitDepths; // DDBD_2,4,8 - DWORD dwAlphaOverlayPixelBitDepths; // DDBD_1,2,4,8 - DWORD dwAlphaOverlaySurfaceBitDepths; // DDBD_1,2,4,8 - DWORD dwZBufferBitDepths; // DDBD_8,16,24,32 - DWORD dwVidMemTotal; // total amount of video memory - DWORD dwVidMemFree; // amount of free video memory - DWORD dwMaxVisibleOverlays; // maximum number of visible overlays - DWORD dwCurrVisibleOverlays; // current number of visible overlays - DWORD dwNumFourCCCodes; // number of four cc codes - DWORD dwAlignBoundarySrc; // source rectangle alignment - DWORD dwAlignSizeSrc; // source rectangle byte size - DWORD dwAlignBoundaryDest; // dest rectangle alignment - DWORD dwAlignSizeDest; // dest rectangle byte size - DWORD dwAlignStrideAlign; // stride alignment - DWORD dwRops[DD_ROP_SPACE]; // ROPS supported - DDSCAPS ddsCaps; // DDSCAPS structure has all the general capabilities - DWORD dwMinOverlayStretch; // minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 - DWORD dwMaxOverlayStretch; // maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 - DWORD dwMinLiveVideoStretch; // minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 - DWORD dwMaxLiveVideoStretch; // maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 - DWORD dwMinHwCodecStretch; // minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 - DWORD dwMaxHwCodecStretch; // maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 - DWORD dwReserved1; // reserved - DWORD dwReserved2; // reserved - DWORD dwReserved3; // reserved - DWORD dwSVBCaps; // driver specific capabilities for System->Vmem blts - DWORD dwSVBCKeyCaps; // driver color key capabilities for System->Vmem blts - DWORD dwSVBFXCaps; // driver FX capabilities for System->Vmem blts - DWORD dwSVBRops[DD_ROP_SPACE];// ROPS supported for System->Vmem blts - DWORD dwVSBCaps; // driver specific capabilities for Vmem->System blts - DWORD dwVSBCKeyCaps; // driver color key capabilities for Vmem->System blts - DWORD dwVSBFXCaps; // driver FX capabilities for Vmem->System blts - DWORD dwVSBRops[DD_ROP_SPACE];// ROPS supported for Vmem->System blts - DWORD dwSSBCaps; // driver specific capabilities for System->System blts - DWORD dwSSBCKeyCaps; // driver color key capabilities for System->System blts - DWORD dwSSBFXCaps; // driver FX capabilities for System->System blts - DWORD dwSSBRops[DD_ROP_SPACE];// ROPS supported for System->System blts - DWORD dwReserved4; // reserved - DWORD dwReserved5; // reserved - DWORD dwReserved6; // reserved -} DDCAPS; - -typedef DDCAPS FAR* LPDDCAPS; - - - -/* - * DDPIXELFORMAT - */ -typedef struct _DDPIXELFORMAT -{ - DWORD dwSize; // size of structure - DWORD dwFlags; // pixel format flags - DWORD dwFourCC; // (FOURCC code) - union - { - DWORD dwRGBBitCount; // how many bits per pixel - DWORD dwYUVBitCount; // how many bits per pixel - DWORD dwZBufferBitDepth; // how many bits for z buffers - DWORD dwAlphaBitDepth; // how many bits for alpha channels - }; - union - { - DWORD dwRBitMask; // mask for red bit - DWORD dwYBitMask; // mask for Y bits - }; - union - { - DWORD dwGBitMask; // mask for green bits - DWORD dwUBitMask; // mask for U bits - }; - union - { - DWORD dwBBitMask; // mask for blue bits - DWORD dwVBitMask; // mask for V bits - }; - union - { - DWORD dwRGBAlphaBitMask; // mask for alpha channel - DWORD dwYUVAlphaBitMask; // mask for alpha channel - }; -} DDPIXELFORMAT; - -typedef DDPIXELFORMAT FAR* LPDDPIXELFORMAT; - -/* - * DDOVERLAYFX - */ -typedef struct _DDOVERLAYFX -{ - DWORD dwSize; // size of structure - DWORD dwAlphaEdgeBlendBitDepth; // Bit depth used to specify constant for alpha edge blend - DWORD dwAlphaEdgeBlend; // Constant to use as alpha for edge blend - DWORD dwReserved; - DWORD dwAlphaDestConstBitDepth; // Bit depth used to specify alpha constant for destination - union - { - DWORD dwAlphaDestConst; // Constant to use as alpha channel for dest - LPDIRECTDRAWSURFACE lpDDSAlphaDest; // Surface to use as alpha channel for dest - }; - DWORD dwAlphaSrcConstBitDepth; // Bit depth used to specify alpha constant for source - union - { - DWORD dwAlphaSrcConst; // Constant to use as alpha channel for src - LPDIRECTDRAWSURFACE lpDDSAlphaSrc; // Surface to use as alpha channel for src - }; - DDCOLORKEY dckDestColorkey; // DestColorkey override - DDCOLORKEY dckSrcColorkey; // DestColorkey override - DWORD dwDDFX; // Overlay FX - DWORD dwFlags; // flags -} DDOVERLAYFX; - -typedef DDOVERLAYFX FAR *LPDDOVERLAYFX; - -/* - * DDBLTBATCH: BltBatch entry structure - */ -typedef struct _DDBLTBATCH -{ - LPRECT lprDest; - LPDIRECTDRAWSURFACE lpDDSSrc; - LPRECT lprSrc; - DWORD dwFlags; - LPDDBLTFX lpDDBltFx; -} DDBLTBATCH; - -typedef DDBLTBATCH FAR * LPDDBLTBATCH; - -/* - * callbacks - */ -typedef DWORD (FAR PASCAL *LPCLIPPERCALLBACK)(LPDIRECTDRAWCLIPPER lpDDClipper, HWND hWnd, DWORD code, LPVOID lpContext ); -#ifdef STREAMING -typedef DWORD (FAR PASCAL *LPSURFACESTREAMINGCALLBACK)(DWORD); -#endif - - -/* - * INTERACES FOLLOW: - * IDirectDraw - * IDirectDrawClipper - * IDirectDrawPalette - * IDirectDrawSurface - */ - -/* - * IDirectDraw - */ -#if defined( _WIN32 ) && !defined( _NO_COM ) -#undef INTERFACE -#define INTERFACE IDirectDraw -DECLARE_INTERFACE_( IDirectDraw, IUnknown ) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IDirectDraw methods ***/ - STDMETHOD(Compact)(THIS) PURE; - STDMETHOD(CreateClipper)(THIS_ DWORD, LPDIRECTDRAWCLIPPER FAR*, IUnknown FAR * ) PURE; - STDMETHOD(CreatePalette)(THIS_ DWORD, LPPALETTEENTRY, LPDIRECTDRAWPALETTE FAR*, IUnknown FAR * ) PURE; - STDMETHOD(CreateSurface)(THIS_ LPDDSURFACEDESC, LPDIRECTDRAWSURFACE FAR *, IUnknown FAR *) PURE; - STDMETHOD(DuplicateSurface)( THIS_ LPDIRECTDRAWSURFACE, LPDIRECTDRAWSURFACE FAR * ) PURE; - STDMETHOD(EnumDisplayModes)( THIS_ DWORD, LPDDSURFACEDESC, LPVOID, LPDDENUMMODESCALLBACK ) PURE; - STDMETHOD(EnumSurfaces)(THIS_ DWORD, LPDDSURFACEDESC, LPVOID,LPDDENUMSURFACESCALLBACK ) PURE; - STDMETHOD(FlipToGDISurface)(THIS) PURE; - STDMETHOD(GetCaps)( THIS_ LPDDCAPS, LPDDCAPS) PURE; - STDMETHOD(GetDisplayMode)( THIS_ LPDDSURFACEDESC) PURE; - STDMETHOD(GetFourCCCodes)(THIS_ LPDWORD, LPDWORD ) PURE; - STDMETHOD(GetGDISurface)(THIS_ LPDIRECTDRAWSURFACE FAR *) PURE; - STDMETHOD(GetMonitorFrequency)(THIS_ LPDWORD) PURE; - STDMETHOD(GetScanLine)(THIS_ LPDWORD) PURE; - STDMETHOD(GetVerticalBlankStatus)(THIS_ LPBOOL ) PURE; - STDMETHOD(Initialize)(THIS_ GUID FAR *) PURE; - STDMETHOD(RestoreDisplayMode)(THIS) PURE; - STDMETHOD(SetCooperativeLevel)(THIS_ HWND, DWORD) PURE; - STDMETHOD(SetDisplayMode)(THIS_ DWORD, DWORD,DWORD) PURE; - STDMETHOD(WaitForVerticalBlank)(THIS_ DWORD, HANDLE ) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectDraw_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b) -#define IDirectDraw_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectDraw_Release(p) (p)->lpVtbl->Release(p) -#define IDirectDraw_Compact(p) (p)->lpVtbl->Compact(p) -#define IDirectDraw_CreateClipper(p, a, b, c) (p)->lpVtbl->CreateClipper(p, a, b, c) -#define IDirectDraw_CreatePalette(p, a, b, c, d) (p)->lpVtbl->CreatePalette(p, a, b, c, d) -#define IDirectDraw_CreateSurface(p, a, b, c) (p)->lpVtbl->CreateSurface(p, a, b, c) -#define IDirectDraw_DuplicateSurface(p, a, b) (p)->lpVtbl->DuplicateSurface(p, a, b) -#define IDirectDraw_EnumDisplayModes(p, a, b, c, d) (p)->lpVtbl->EnumDisplayModes(p, a, b, c, d) -#define IDirectDraw_EnumSurfaces(p, a, b, c, d) (p)->lpVtbl->EnumSurfaces(p, a, b, c, d) -#define IDirectDraw_FlipToGDISurface(p) (p)->lpVtbl->FlipToGDISurface(p) -#define IDirectDraw_GetCaps(p, a, b) (p)->lpVtbl->GetCaps(p, a, b) -#define IDirectDraw_GetDisplayMode(p, a) (p)->lpVtbl->GetDisplayMode(p, a) -#define IDirectDraw_GetFourCCCodes(p, a, b) (p)->lpVtbl->GetFourCCCodes(p, a, b) -#define IDirectDraw_GetGDISurface(p, a) (p)->lpVtbl->GetGDISurface(p, a) -#define IDirectDraw_GetMonitorFrequency(p, a) (p)->lpVtbl->GetMonitorFrequency(p, a) -#define IDirectDraw_GetScanLine(p, a) (p)->lpVtbl->GetScanLine(p, a) -#define IDirectDraw_GetVerticalBlankStatus(p, a) (p)->lpVtbl->GetVerticalBlankStatus(p, a) -#define IDirectDraw_Initialize(p, a) (p)->lpVtbl->Initialize(p, a) -#define IDirectDraw_RestoreDisplayMode(p) (p)->lpVtbl->RestoreDisplayMode(p) -#define IDirectDraw_SetCooperativeLevel(p, a, b) (p)->lpVtbl->SetCooperativeLevel(p, a, b) -#define IDirectDraw_SetDisplayMode(p, a, b, c) (p)->lpVtbl->SetDisplayMode(p, a, b, c) -#define IDirectDraw_WaitForVerticalBlank(p, a, b) (p)->lpVtbl->WaitForVerticalBlank(p, a, b) -#endif - -#endif - -#if defined( _WIN32 ) && !defined( _NO_COM ) -#undef INTERFACE -#define INTERFACE IDirectDraw2 -DECLARE_INTERFACE_( IDirectDraw2, IUnknown ) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IDirectDraw methods ***/ - STDMETHOD(Compact)(THIS) PURE; - STDMETHOD(CreateClipper)(THIS_ DWORD, LPDIRECTDRAWCLIPPER FAR*, IUnknown FAR * ) PURE; - STDMETHOD(CreatePalette)(THIS_ DWORD, LPPALETTEENTRY, LPDIRECTDRAWPALETTE FAR*, IUnknown FAR * ) PURE; - STDMETHOD(CreateSurface)(THIS_ LPDDSURFACEDESC, LPDIRECTDRAWSURFACE FAR *, IUnknown FAR *) PURE; - STDMETHOD(DuplicateSurface)( THIS_ LPDIRECTDRAWSURFACE, LPDIRECTDRAWSURFACE FAR * ) PURE; - STDMETHOD(EnumDisplayModes)( THIS_ DWORD, LPDDSURFACEDESC, LPVOID, LPDDENUMMODESCALLBACK ) PURE; - STDMETHOD(EnumSurfaces)(THIS_ DWORD, LPDDSURFACEDESC, LPVOID,LPDDENUMSURFACESCALLBACK ) PURE; - STDMETHOD(FlipToGDISurface)(THIS) PURE; - STDMETHOD(GetCaps)( THIS_ LPDDCAPS, LPDDCAPS) PURE; - STDMETHOD(GetDisplayMode)( THIS_ LPDDSURFACEDESC) PURE; - STDMETHOD(GetFourCCCodes)(THIS_ LPDWORD, LPDWORD ) PURE; - STDMETHOD(GetGDISurface)(THIS_ LPDIRECTDRAWSURFACE FAR *) PURE; - STDMETHOD(GetMonitorFrequency)(THIS_ LPDWORD) PURE; - STDMETHOD(GetScanLine)(THIS_ LPDWORD) PURE; - STDMETHOD(GetVerticalBlankStatus)(THIS_ LPBOOL ) PURE; - STDMETHOD(Initialize)(THIS_ GUID FAR *) PURE; - STDMETHOD(RestoreDisplayMode)(THIS) PURE; - STDMETHOD(SetCooperativeLevel)(THIS_ HWND, DWORD) PURE; - STDMETHOD(SetDisplayMode)(THIS_ DWORD, DWORD,DWORD, DWORD, DWORD) PURE; - STDMETHOD(WaitForVerticalBlank)(THIS_ DWORD, HANDLE ) PURE; - /*** Added in the v2 interface ***/ - STDMETHOD(GetAvailableVidMem)(THIS_ LPDDSCAPS, LPDWORD, LPDWORD) PURE; -}; -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectDraw2_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b) -#define IDirectDraw2_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectDraw2_Release(p) (p)->lpVtbl->Release(p) -#define IDirectDraw2_Compact(p) (p)->lpVtbl->Compact(p) -#define IDirectDraw2_CreateClipper(p, a, b, c) (p)->lpVtbl->CreateClipper(p, a, b, c) -#define IDirectDraw2_CreatePalette(p, a, b, c, d) (p)->lpVtbl->CreatePalette(p, a, b, c, d) -#define IDirectDraw2_CreateSurface(p, a, b, c) (p)->lpVtbl->CreateSurface(p, a, b, c) -#define IDirectDraw2_DuplicateSurface(p, a, b) (p)->lpVtbl->DuplicateSurface(p, a, b) -#define IDirectDraw2_EnumDisplayModes(p, a, b, c, d) (p)->lpVtbl->EnumDisplayModes(p, a, b, c, d) -#define IDirectDraw2_EnumSurfaces(p, a, b, c, d) (p)->lpVtbl->EnumSurfaces(p, a, b, c, d) -#define IDirectDraw2_FlipToGDISurface(p) (p)->lpVtbl->FlipToGDISurface(p) -#define IDirectDraw2_GetCaps(p, a, b) (p)->lpVtbl->GetCaps(p, a, b) -#define IDirectDraw2_GetDisplayMode(p, a) (p)->lpVtbl->GetDisplayMode(p, a) -#define IDirectDraw2_GetFourCCCodes(p, a, b) (p)->lpVtbl->GetFourCCCodes(p, a, b) -#define IDirectDraw2_GetGDISurface(p, a) (p)->lpVtbl->GetGDISurface(p, a) -#define IDirectDraw2_GetMonitorFrequency(p, a) (p)->lpVtbl->GetMonitorFrequency(p, a) -#define IDirectDraw2_GetScanLine(p, a) (p)->lpVtbl->GetScanLine(p, a) -#define IDirectDraw2_GetVerticalBlankStatus(p, a) (p)->lpVtbl->GetVerticalBlankStatus(p, a) -#define IDirectDraw2_Initialize(p, a) (p)->lpVtbl->Initialize(p, a) -#define IDirectDraw2_RestoreDisplayMode(p) (p)->lpVtbl->RestoreDisplayMode(p) -#define IDirectDraw2_SetCooperativeLevel(p, a, b) (p)->lpVtbl->SetCooperativeLevel(p, a, b) -#define IDirectDraw2_SetDisplayMode(p, a, b, c, d, e) (p)->lpVtbl->SetDisplayMode(p, a, b, c, d, e) -#define IDirectDraw2_WaitForVerticalBlank(p, a, b) (p)->lpVtbl->WaitForVerticalBlank(p, a, b) -#define IDirectDraw2_GetAvailableVidMem(p, a, b, c) (p)->lpVtbl->GetAvailableVidMem(p, a, b, c) -#endif - -#endif - -/* - * IDirectDrawPalette - */ -#if defined( _WIN32 ) && !defined( _NO_COM ) -#undef INTERFACE -#define INTERFACE IDirectDrawPalette -DECLARE_INTERFACE_( IDirectDrawPalette, IUnknown ) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IDirectDrawPalette methods ***/ - STDMETHOD(GetCaps)(THIS_ LPDWORD) PURE; - STDMETHOD(GetEntries)(THIS_ DWORD,DWORD,DWORD,LPPALETTEENTRY) PURE; - STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, DWORD, LPPALETTEENTRY) PURE; - STDMETHOD(SetEntries)(THIS_ DWORD,DWORD,DWORD,LPPALETTEENTRY) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectDrawPalette_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b) -#define IDirectDrawPalette_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectDrawPalette_Release(p) (p)->lpVtbl->Release(p) -#define IDirectDrawPalette_GetCaps(p, a) (p)->lpVtbl->GetCaps(p, a) -#define IDirectDrawPalette_GetEntries(p, a, b, c, d) (p)->lpVtbl->GetEntries(p, a, b, c, d) -#define IDirectDrawPalette_Initialize(p, a, b, c) (p)->lpVtbl->Initialize(p, a, b, c) -#define IDirectDrawPalette_SetEntries(p, a, b, c, d) (p)->lpVtbl->SetEntries(p, a, b, c, d) -#endif - -#endif - -/* - * IDirectDrawClipper - */ -#if defined( _WIN32 ) && !defined( _NO_COM ) -#undef INTERFACE -#define INTERFACE IDirectDrawClipper -DECLARE_INTERFACE_( IDirectDrawClipper, IUnknown ) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IDirectDrawClipper methods ***/ - STDMETHOD(GetClipList)(THIS_ LPRECT, LPRGNDATA, LPDWORD) PURE; - STDMETHOD(GetHWnd)(THIS_ HWND FAR *) PURE; - STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, DWORD) PURE; - STDMETHOD(IsClipListChanged)(THIS_ BOOL FAR *) PURE; - STDMETHOD(SetClipList)(THIS_ LPRGNDATA,DWORD) PURE; - STDMETHOD(SetHWnd)(THIS_ DWORD, HWND ) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectDrawClipper_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b) -#define IDirectDrawClipper_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectDrawClipper_Release(p) (p)->lpVtbl->Release(p) -#define IDirectDrawClipper_GetClipList(p, a, b, c) (p)->lpVtbl->GetClipList(p, a, b, c) -#define IDirectDrawClipper_GetHWnd(p, a) (p)->lpVtbl->GetHWnd(p, a) -#define IDirectDrawClipper_Initialize(p, a, b) (p)->lpVtbl->Initialize(p, a, b) -#define IDirectDrawClipper_IsClipListChanged(p, a) (p)->lpVtbl->IsClipListChanged(p, a) -#define IDirectDrawClipper_SetClipList(p, a, b) (p)->lpVtbl->SetClipList(p, a, b) -#define IDirectDrawClipper_SetHWnd(p, a, b) (p)->lpVtbl->SetHWnd(p, a, b) -#endif - -#endif - -/* - * IDirectDrawSurface and related interfaces - */ -#if defined( _WIN32 ) && !defined( _NO_COM ) -#undef INTERFACE -#define INTERFACE IDirectDrawSurface -DECLARE_INTERFACE_( IDirectDrawSurface, IUnknown ) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IDirectDrawSurface methods ***/ - STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE) PURE; - STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT) PURE; - STDMETHOD(Blt)(THIS_ LPRECT,LPDIRECTDRAWSURFACE, LPRECT,DWORD, LPDDBLTFX) PURE; - STDMETHOD(BltBatch)(THIS_ LPDDBLTBATCH, DWORD, DWORD ) PURE; - STDMETHOD(BltFast)(THIS_ DWORD,DWORD,LPDIRECTDRAWSURFACE, LPRECT,DWORD) PURE; - STDMETHOD(DeleteAttachedSurface)(THIS_ DWORD,LPDIRECTDRAWSURFACE) PURE; - STDMETHOD(EnumAttachedSurfaces)(THIS_ LPVOID,LPDDENUMSURFACESCALLBACK) PURE; - STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD,LPVOID,LPDDENUMSURFACESCALLBACK) PURE; - STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE, DWORD) PURE; - STDMETHOD(GetAttachedSurface)(THIS_ LPDDSCAPS, LPDIRECTDRAWSURFACE FAR *) PURE; - STDMETHOD(GetBltStatus)(THIS_ DWORD) PURE; - STDMETHOD(GetCaps)(THIS_ LPDDSCAPS) PURE; - STDMETHOD(GetClipper)(THIS_ LPDIRECTDRAWCLIPPER FAR*) PURE; - STDMETHOD(GetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE; - STDMETHOD(GetDC)(THIS_ HDC FAR *) PURE; - STDMETHOD(GetFlipStatus)(THIS_ DWORD) PURE; - STDMETHOD(GetOverlayPosition)(THIS_ LPLONG, LPLONG ) PURE; - STDMETHOD(GetPalette)(THIS_ LPDIRECTDRAWPALETTE FAR*) PURE; - STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT) PURE; - STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC) PURE; - STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, LPDDSURFACEDESC) PURE; - STDMETHOD(IsLost)(THIS) PURE; - STDMETHOD(Lock)(THIS_ LPRECT,LPDDSURFACEDESC,DWORD,HANDLE) PURE; - STDMETHOD(ReleaseDC)(THIS_ HDC) PURE; - STDMETHOD(Restore)(THIS) PURE; - STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER) PURE; - STDMETHOD(SetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE; - STDMETHOD(SetOverlayPosition)(THIS_ LONG, LONG ) PURE; - STDMETHOD(SetPalette)(THIS_ LPDIRECTDRAWPALETTE) PURE; - STDMETHOD(Unlock)(THIS_ LPVOID) PURE; - STDMETHOD(UpdateOverlay)(THIS_ LPRECT, LPDIRECTDRAWSURFACE,LPRECT,DWORD, LPDDOVERLAYFX) PURE; - STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD) PURE; - STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD, LPDIRECTDRAWSURFACE) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectDrawSurface_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectDrawSurface_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectDrawSurface_Release(p) (p)->lpVtbl->Release(p) -#define IDirectDrawSurface_AddAttachedSurface(p,a) (p)->lpVtbl->AddAttachedSurface(p,a) -#define IDirectDrawSurface_AddOverlayDirtyRect(p,a) (p)->lpVtbl->AddOverlayDirtyRect(p,a) -#define IDirectDrawSurface_Blt(p,a,b,c,d,e) (p)->lpVtbl->Blt(p,a,b,c,d,e) -#define IDirectDrawSurface_BltBatch(p,a,b,c) (p)->lpVtbl->BltBatch(p,a,b,c) -#define IDirectDrawSurface_BltFast(p,a,b,c,d,e) (p)->lpVtbl->BltFast(p,a,b,c,d,e) -#define IDirectDrawSurface_DeleteAttachedSurface(p,a,b) (p)->lpVtbl->DeleteAttachedSurface(p,a,b) -#define IDirectDrawSurface_EnumAttachedSurfaces(p,a,b) (p)->lpVtbl->EnumAttachedSurfaces(p,a,b) -#define IDirectDrawSurface_EnumOverlayZOrders(p,a,b,c) (p)->lpVtbl->EnumOverlayZOrders(p,a,b,c) -#define IDirectDrawSurface_Flip(p,a,b) (p)->lpVtbl->Flip(p,a,b) -#define IDirectDrawSurface_GetAttachedSurface(p,a,b) (p)->lpVtbl->GetAttachedSurface(p,a,b) -#define IDirectDrawSurface_GetBltStatus(p,a) (p)->lpVtbl->GetBltStatus(p,a) -#define IDirectDrawSurface_GetCaps(p,b) (p)->lpVtbl->GetCaps(p,b) -#define IDirectDrawSurface_GetClipper(p,a) (p)->lpVtbl->GetClipper(p,a) -#define IDirectDrawSurface_GetColorKey(p,a,b) (p)->lpVtbl->GetColorKey(p,a,b) -#define IDirectDrawSurface_GetDC(p,a) (p)->lpVtbl->GetDC(p,a) -#define IDirectDrawSurface_GetFlipStatus(p,a) (p)->lpVtbl->GetFlipStatus(p,a) -#define IDirectDrawSurface_GetOverlayPosition(p,a,b) (p)->lpVtbl->GetOverlayPosition(p,a,b) -#define IDirectDrawSurface_GetPalette(p,a) (p)->lpVtbl->GetPalette(p,a) -#define IDirectDrawSurface_GetPixelFormat(p,a) (p)->lpVtbl->GetPixelFormat(p,a) -#define IDirectDrawSurface_GetSurfaceDesc(p,a) (p)->lpVtbl->GetSurfaceDesc(p,a) -#define IDirectDrawSurface_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b) -#define IDirectDrawSurface_IsLost(p) (p)->lpVtbl->IsLost(p) -#define IDirectDrawSurface_Lock(p,a,b,c,d) (p)->lpVtbl->Lock(p,a,b,c,d) -#define IDirectDrawSurface_ReleaseDC(p,a) (p)->lpVtbl->ReleaseDC(p,a) -#define IDirectDrawSurface_Restore(p) (p)->lpVtbl->Restore(p) -#define IDirectDrawSurface_SetClipper(p,a) (p)->lpVtbl->SetClipper(p,a) -#define IDirectDrawSurface_SetColorKey(p,a,b) (p)->lpVtbl->SetColorKey(p,a,b) -#define IDirectDrawSurface_SetOverlayPosition(p,a,b) (p)->lpVtbl->SetOverlayPosition(p,a,b) -#define IDirectDrawSurface_SetPalette(p,a) (p)->lpVtbl->SetPalette(p,a) -#define IDirectDrawSurface_Unlock(p,b) (p)->lpVtbl->Unlock(p,b) -#define IDirectDrawSurface_UpdateOverlay(p,a,b,c,d,e) (p)->lpVtbl->UpdateOverlay(p,a,b,c,d,e) -#define IDirectDrawSurface_UpdateOverlayDisplay(p,a) (p)->lpVtbl->UpdateOverlayDisplay(p,a) -#define IDirectDrawSurface_UpdateOverlayZOrder(p,a,b) (p)->lpVtbl->UpdateOverlayZOrder(p,a,b) -#endif - -/* - * IDirectDrawSurface2 and related interfaces - */ -#undef INTERFACE -#define INTERFACE IDirectDrawSurface2 -DECLARE_INTERFACE_( IDirectDrawSurface2, IUnknown ) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IDirectDrawSurface methods ***/ - STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE2) PURE; - STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT) PURE; - STDMETHOD(Blt)(THIS_ LPRECT,LPDIRECTDRAWSURFACE2, LPRECT,DWORD, LPDDBLTFX) PURE; - STDMETHOD(BltBatch)(THIS_ LPDDBLTBATCH, DWORD, DWORD ) PURE; - STDMETHOD(BltFast)(THIS_ DWORD,DWORD,LPDIRECTDRAWSURFACE2, LPRECT,DWORD) PURE; - STDMETHOD(DeleteAttachedSurface)(THIS_ DWORD,LPDIRECTDRAWSURFACE2) PURE; - STDMETHOD(EnumAttachedSurfaces)(THIS_ LPVOID,LPDDENUMSURFACESCALLBACK) PURE; - STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD,LPVOID,LPDDENUMSURFACESCALLBACK) PURE; - STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE2, DWORD) PURE; - STDMETHOD(GetAttachedSurface)(THIS_ LPDDSCAPS, LPDIRECTDRAWSURFACE2 FAR *) PURE; - STDMETHOD(GetBltStatus)(THIS_ DWORD) PURE; - STDMETHOD(GetCaps)(THIS_ LPDDSCAPS) PURE; - STDMETHOD(GetClipper)(THIS_ LPDIRECTDRAWCLIPPER FAR*) PURE; - STDMETHOD(GetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE; - STDMETHOD(GetDC)(THIS_ HDC FAR *) PURE; - STDMETHOD(GetFlipStatus)(THIS_ DWORD) PURE; - STDMETHOD(GetOverlayPosition)(THIS_ LPLONG, LPLONG ) PURE; - STDMETHOD(GetPalette)(THIS_ LPDIRECTDRAWPALETTE FAR*) PURE; - STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT) PURE; - STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC) PURE; - STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, LPDDSURFACEDESC) PURE; - STDMETHOD(IsLost)(THIS) PURE; - STDMETHOD(Lock)(THIS_ LPRECT,LPDDSURFACEDESC,DWORD,HANDLE) PURE; - STDMETHOD(ReleaseDC)(THIS_ HDC) PURE; - STDMETHOD(Restore)(THIS) PURE; - STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER) PURE; - STDMETHOD(SetColorKey)(THIS_ DWORD, LPDDCOLORKEY) PURE; - STDMETHOD(SetOverlayPosition)(THIS_ LONG, LONG ) PURE; - STDMETHOD(SetPalette)(THIS_ LPDIRECTDRAWPALETTE) PURE; - STDMETHOD(Unlock)(THIS_ LPVOID) PURE; - STDMETHOD(UpdateOverlay)(THIS_ LPRECT, LPDIRECTDRAWSURFACE2,LPRECT,DWORD, LPDDOVERLAYFX) PURE; - STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD) PURE; - STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD, LPDIRECTDRAWSURFACE2) PURE; - /*** Added in the v2 interface ***/ - STDMETHOD(GetDDInterface)(THIS_ LPVOID FAR *) PURE; - STDMETHOD(PageLock)(THIS_ DWORD) PURE; - STDMETHOD(PageUnlock)(THIS_ DWORD) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectDrawSurface2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectDrawSurface2_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectDrawSurface2_Release(p) (p)->lpVtbl->Release(p) -#define IDirectDrawSurface2_AddAttachedSurface(p,a) (p)->lpVtbl->AddAttachedSurface(p,a) -#define IDirectDrawSurface2_AddOverlayDirtyRect(p,a) (p)->lpVtbl->AddOverlayDirtyRect(p,a) -#define IDirectDrawSurface2_Blt(p,a,b,c,d,e) (p)->lpVtbl->Blt(p,a,b,c,d,e) -#define IDirectDrawSurface2_BltBatch(p,a,b,c) (p)->lpVtbl->BltBatch(p,a,b,c) -#define IDirectDrawSurface2_BltFast(p,a,b,c,d,e) (p)->lpVtbl->BltFast(p,a,b,c,d,e) -#define IDirectDrawSurface2_DeleteAttachedSurface(p,a,b) (p)->lpVtbl->DeleteAttachedSurface(p,a,b) -#define IDirectDrawSurface2_EnumAttachedSurfaces(p,a,b) (p)->lpVtbl->EnumAttachedSurfaces(p,a,b) -#define IDirectDrawSurface2_EnumOverlayZOrders(p,a,b,c) (p)->lpVtbl->EnumOverlayZOrders(p,a,b,c) -#define IDirectDrawSurface2_Flip(p,a,b) (p)->lpVtbl->Flip(p,a,b) -#define IDirectDrawSurface2_GetAttachedSurface(p,a,b) (p)->lpVtbl->GetAttachedSurface(p,a,b) -#define IDirectDrawSurface2_GetBltStatus(p,a) (p)->lpVtbl->GetBltStatus(p,a) -#define IDirectDrawSurface2_GetCaps(p,b) (p)->lpVtbl->GetCaps(p,b) -#define IDirectDrawSurface2_GetClipper(p,a) (p)->lpVtbl->GetClipper(p,a) -#define IDirectDrawSurface2_GetColorKey(p,a,b) (p)->lpVtbl->GetColorKey(p,a,b) -#define IDirectDrawSurface2_GetDC(p,a) (p)->lpVtbl->GetDC(p,a) -#define IDirectDrawSurface2_GetFlipStatus(p,a) (p)->lpVtbl->GetFlipStatus(p,a) -#define IDirectDrawSurface2_GetOverlayPosition(p,a,b) (p)->lpVtbl->GetOverlayPosition(p,a,b) -#define IDirectDrawSurface2_GetPalette(p,a) (p)->lpVtbl->GetPalette(p,a) -#define IDirectDrawSurface2_GetPixelFormat(p,a) (p)->lpVtbl->GetPixelFormat(p,a) -#define IDirectDrawSurface2_GetSurfaceDesc(p,a) (p)->lpVtbl->GetSurfaceDesc(p,a) -#define IDirectDrawSurface2_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b) -#define IDirectDrawSurface2_IsLost(p) (p)->lpVtbl->IsLost(p) -#define IDirectDrawSurface2_Lock(p,a,b,c,d) (p)->lpVtbl->Lock(p,a,b,c,d) -#define IDirectDrawSurface2_ReleaseDC(p,a) (p)->lpVtbl->ReleaseDC(p,a) -#define IDirectDrawSurface2_Restore(p) (p)->lpVtbl->Restore(p) -#define IDirectDrawSurface2_SetClipper(p,a) (p)->lpVtbl->SetClipper(p,a) -#define IDirectDrawSurface2_SetColorKey(p,a,b) (p)->lpVtbl->SetColorKey(p,a,b) -#define IDirectDrawSurface2_SetOverlayPosition(p,a,b) (p)->lpVtbl->SetOverlayPosition(p,a,b) -#define IDirectDrawSurface2_SetPalette(p,a) (p)->lpVtbl->SetPalette(p,a) -#define IDirectDrawSurface2_Unlock(p,b) (p)->lpVtbl->Unlock(p,b) -#define IDirectDrawSurface2_UpdateOverlay(p,a,b,c,d,e) (p)->lpVtbl->UpdateOverlay(p,a,b,c,d,e) -#define IDirectDrawSurface2_UpdateOverlayDisplay(p,a) (p)->lpVtbl->UpdateOverlayDisplay(p,a) -#define IDirectDrawSurface2_UpdateOverlayZOrder(p,a,b) (p)->lpVtbl->UpdateOverlayZOrder(p,a,b) -#define IDirectDrawSurface2_GetDDInterface(p,a) (p)->lpVtbl->GetDDInterface(p,a) -#define IDirectDrawSurface2_PageLock(p,a) (p)->lpVtbl->PageLock(p,a) -#define IDirectDrawSurface2_PageUnlock(p,a) (p)->lpVtbl->PageUnlock(p,a) -#endif - - -#endif - - -/* - * DDSURFACEDESC - */ -typedef struct _DDSURFACEDESC -{ - DWORD dwSize; // size of the DDSURFACEDESC structure - DWORD dwFlags; // determines what fields are valid - DWORD dwHeight; // height of surface to be created - DWORD dwWidth; // width of input surface - LONG lPitch; // distance to start of next line (return value only) - DWORD dwBackBufferCount; // number of back buffers requested - union - { - DWORD dwMipMapCount; // number of mip-map levels requested - DWORD dwZBufferBitDepth; // depth of Z buffer requested - DWORD dwRefreshRate; // refresh rate (used when display mode is described) - }; - DWORD dwAlphaBitDepth; // depth of alpha buffer requested - DWORD dwReserved; // reserved - LPVOID lpSurface; // pointer to the associated surface memory - DDCOLORKEY ddckCKDestOverlay; // color key for destination overlay use - DDCOLORKEY ddckCKDestBlt; // color key for destination blt use - DDCOLORKEY ddckCKSrcOverlay; // color key for source overlay use - DDCOLORKEY ddckCKSrcBlt; // color key for source blt use - DDPIXELFORMAT ddpfPixelFormat; // pixel format description of the surface - DDSCAPS ddsCaps; // direct draw surface capabilities -} DDSURFACEDESC; - -/* - * ddsCaps field is valid. - */ -#define DDSD_CAPS 0x00000001l // default - -/* - * dwHeight field is valid. - */ -#define DDSD_HEIGHT 0x00000002l - -/* - * dwWidth field is valid. - */ -#define DDSD_WIDTH 0x00000004l - -/* - * lPitch is valid. - */ -#define DDSD_PITCH 0x00000008l - -/* - * dwBackBufferCount is valid. - */ -#define DDSD_BACKBUFFERCOUNT 0x00000020l - -/* - * dwZBufferBitDepth is valid. - */ -#define DDSD_ZBUFFERBITDEPTH 0x00000040l - -/* - * dwAlphaBitDepth is valid. - */ -#define DDSD_ALPHABITDEPTH 0x00000080l - - - -/* - * ddpfPixelFormat is valid. - */ -#define DDSD_PIXELFORMAT 0x00001000l - -/* - * ddckCKDestOverlay is valid. - */ -#define DDSD_CKDESTOVERLAY 0x00002000l - -/* - * ddckCKDestBlt is valid. - */ -#define DDSD_CKDESTBLT 0x00004000l - -/* - * ddckCKSrcOverlay is valid. - */ -#define DDSD_CKSRCOVERLAY 0x00008000l - -/* - * ddckCKSrcBlt is valid. - */ -#define DDSD_CKSRCBLT 0x00010000l - -/* - * dwMipMapCount is valid. - */ -#define DDSD_MIPMAPCOUNT 0x00020000l - - /* - * dwRefreshRate is valid - */ -#define DDSD_REFRESHRATE 0x00040000l - - -/* - * All input fields are valid. - */ -#define DDSD_ALL 0x0007f9eel - - -/*============================================================================ - * - * Direct Draw Capability Flags - * - * These flags are used to describe the capabilities of a given Surface. - * All flags are bit flags. - * - *==========================================================================*/ - -/**************************************************************************** - * - * DIRECTDRAWSURFACE CAPABILITY FLAGS - * - ****************************************************************************/ -/* - * This bit currently has no meaning. - */ -#define DDSCAPS_3D 0x00000001l - -/* - * Indicates that this surface contains alpha information. The pixel - * format must be interrogated to determine whether this surface - * contains only alpha information or alpha information interlaced - * with pixel color data (e.g. RGBA or YUVA). - */ -#define DDSCAPS_ALPHA 0x00000002l - -/* - * Indicates that this surface is a backbuffer. It is generally - * set by CreateSurface when the DDSCAPS_FLIP capability bit is set. - * It indicates that this surface is THE back buffer of a surface - * flipping structure. DirectDraw supports N surfaces in a - * surface flipping structure. Only the surface that immediately - * precedeces the DDSCAPS_FRONTBUFFER has this capability bit set. - * The other surfaces are identified as back buffers by the presence - * of the DDSCAPS_FLIP capability, their attachment order, and the - * absence of the DDSCAPS_FRONTBUFFER and DDSCAPS_BACKBUFFER - * capabilities. The bit is sent to CreateSurface when a standalone - * back buffer is being created. This surface could be attached to - * a front buffer and/or back buffers to form a flipping surface - * structure after the CreateSurface call. See AddAttachments for - * a detailed description of the behaviors in this case. - */ -#define DDSCAPS_BACKBUFFER 0x00000004l - -/* - * Indicates a complex surface structure is being described. A - * complex surface structure results in the creation of more than - * one surface. The additional surfaces are attached to the root - * surface. The complex structure can only be destroyed by - * destroying the root. - */ -#define DDSCAPS_COMPLEX 0x00000008l - -/* - * Indicates that this surface is a part of a surface flipping structure. - * When it is passed to CreateSurface the DDSCAPS_FRONTBUFFER and - * DDSCAP_BACKBUFFER bits are not set. They are set by CreateSurface - * on the resulting creations. The dwBackBufferCount field in the - * DDSURFACEDESC structure must be set to at least 1 in order for - * the CreateSurface call to succeed. The DDSCAPS_COMPLEX capability - * must always be set with creating multiple surfaces through CreateSurface. - */ -#define DDSCAPS_FLIP 0x00000010l - -/* - * Indicates that this surface is THE front buffer of a surface flipping - * structure. It is generally set by CreateSurface when the DDSCAPS_FLIP - * capability bit is set. - * If this capability is sent to CreateSurface then a standalonw front buffer - * is created. This surface will not have the DDSCAPS_FLIP capability. - * It can be attached to other back buffers to form a flipping structure. - * See AddAttachments for a detailed description of the behaviors in this - * case. - */ -#define DDSCAPS_FRONTBUFFER 0x00000020l - -/* - * Indicates that this surface is any offscreen surface that is not an overlay, - * texture, zbuffer, front buffer, back buffer, or alpha surface. It is used - * to identify plain vanilla surfaces. - */ -#define DDSCAPS_OFFSCREENPLAIN 0x00000040l - -/* - * Indicates that this surface is an overlay. It may or may not be directly visible - * depending on whether or not it is currently being overlayed onto the primary - * surface. DDSCAPS_VISIBLE can be used to determine whether or not it is being - * overlayed at the moment. - */ -#define DDSCAPS_OVERLAY 0x00000080l - -/* - * Indicates that unique DirectDrawPalette objects can be created and - * attached to this surface. - */ -#define DDSCAPS_PALETTE 0x00000100l - -/* - * Indicates that this surface is the primary surface. The primary - * surface represents what the user is seeing at the moment. - */ -#define DDSCAPS_PRIMARYSURFACE 0x00000200l - -/* - * Indicates that this surface is the primary surface for the left eye. - * The primary surface for the left eye represents what the user is seeing - * at the moment with the users left eye. When this surface is created the - * DDSCAPS_PRIMARYSURFACE represents what the user is seeing with the users - * right eye. - */ -#define DDSCAPS_PRIMARYSURFACELEFT 0x00000400l - -/* - * Indicates that this surface memory was allocated in system memory - */ -#define DDSCAPS_SYSTEMMEMORY 0x00000800l - -/* - * Indicates that this surface can be used as a 3D texture. It does not - * indicate whether or not the surface is being used for that purpose. - */ -#define DDSCAPS_TEXTURE 0x00001000l - -/* - * Indicates that a surface may be a destination for 3D rendering. This - * bit must be set in order to query for a Direct3D Device Interface - * from this surface. - */ -#define DDSCAPS_3DDEVICE 0x00002000l - -/* - * Indicates that this surface exists in video memory. - */ -#define DDSCAPS_VIDEOMEMORY 0x00004000l - -/* - * Indicates that changes made to this surface are immediately visible. - * It is always set for the primary surface and is set for overlays while - * they are being overlayed and texture maps while they are being textured. - */ -#define DDSCAPS_VISIBLE 0x00008000l - -/* - * Indicates that only writes are permitted to the surface. Read accesses - * from the surface may or may not generate a protection fault, but the - * results of a read from this surface will not be meaningful. READ ONLY. - */ -#define DDSCAPS_WRITEONLY 0x00010000l - -/* - * Indicates that this surface is a z buffer. A z buffer does not contain - * displayable information. Instead it contains bit depth information that is - * used to determine which pixels are visible and which are obscured. - */ -#define DDSCAPS_ZBUFFER 0x00020000l - -/* - * Indicates surface will have a DC associated long term - */ -#define DDSCAPS_OWNDC 0x00040000l - -/* - * Indicates surface should be able to receive live video - */ -#define DDSCAPS_LIVEVIDEO 0x00080000l - -/* - * Indicates surface should be able to have a stream decompressed - * to it by the hardware. - */ -#define DDSCAPS_HWCODEC 0x00100000l - -/* - * Surface is a 320x200 or 320x240 ModeX surface - */ -#define DDSCAPS_MODEX 0x00200000l - -/* - * Indicates surface is one level of a mip-map. This surface will - * be attached to other DDSCAPS_MIPMAP surfaces to form the mip-map. - * This can be done explicitly, by creating a number of surfaces and - * attaching them with AddAttachedSurface or by implicitly by CreateSurface. - * If this bit is set then DDSCAPS_TEXTURE must also be set. - */ -#define DDSCAPS_MIPMAP 0x00400000l - - - -/* - * Indicates that memory for the surface is not allocated until the surface - * is loaded (via the Direct3D texture Load() function). - */ -#define DDSCAPS_ALLOCONLOAD 0x04000000l - - - - /**************************************************************************** - * - * DIRECTDRAW DRIVER CAPABILITY FLAGS - * - ****************************************************************************/ - -/* - * Display hardware has 3D acceleration. - */ -#define DDCAPS_3D 0x00000001l - -/* - * Indicates that DirectDraw will support only dest rectangles that are aligned - * on DIRECTDRAWCAPS.dwAlignBoundaryDest boundaries of the surface, respectively. - * READ ONLY. - */ -#define DDCAPS_ALIGNBOUNDARYDEST 0x00000002l - -/* - * Indicates that DirectDraw will support only source rectangles whose sizes in - * BYTEs are DIRECTDRAWCAPS.dwAlignSizeDest multiples, respectively. READ ONLY. - */ -#define DDCAPS_ALIGNSIZEDEST 0x00000004l -/* - * Indicates that DirectDraw will support only source rectangles that are aligned - * on DIRECTDRAWCAPS.dwAlignBoundarySrc boundaries of the surface, respectively. - * READ ONLY. - */ -#define DDCAPS_ALIGNBOUNDARYSRC 0x00000008l - -/* - * Indicates that DirectDraw will support only source rectangles whose sizes in - * BYTEs are DIRECTDRAWCAPS.dwAlignSizeSrc multiples, respectively. READ ONLY. - */ -#define DDCAPS_ALIGNSIZESRC 0x00000010l - -/* - * Indicates that DirectDraw will create video memory surfaces that have a stride - * alignment equal to DIRECTDRAWCAPS.dwAlignStride. READ ONLY. - */ -#define DDCAPS_ALIGNSTRIDE 0x00000020l - -/* - * Display hardware is capable of blt operations. - */ -#define DDCAPS_BLT 0x00000040l - -/* - * Display hardware is capable of asynchronous blt operations. - */ -#define DDCAPS_BLTQUEUE 0x00000080l - -/* - * Display hardware is capable of color space conversions during the blt operation. - */ -#define DDCAPS_BLTFOURCC 0x00000100l - -/* - * Display hardware is capable of stretching during blt operations. - */ -#define DDCAPS_BLTSTRETCH 0x00000200l - -/* - * Display hardware is shared with GDI. - */ -#define DDCAPS_GDI 0x00000400l - -/* - * Display hardware can overlay. - */ -#define DDCAPS_OVERLAY 0x00000800l - -/* - * Set if display hardware supports overlays but can not clip them. - */ -#define DDCAPS_OVERLAYCANTCLIP 0x00001000l - -/* - * Indicates that overlay hardware is capable of color space conversions during - * the overlay operation. - */ -#define DDCAPS_OVERLAYFOURCC 0x00002000l - -/* - * Indicates that stretching can be done by the overlay hardware. - */ -#define DDCAPS_OVERLAYSTRETCH 0x00004000l - -/* - * Indicates that unique DirectDrawPalettes can be created for DirectDrawSurfaces - * other than the primary surface. - */ -#define DDCAPS_PALETTE 0x00008000l - -/* - * Indicates that palette changes can be syncd with the veritcal refresh. - */ -#define DDCAPS_PALETTEVSYNC 0x00010000l - -/* - * Display hardware can return the current scan line. - */ -#define DDCAPS_READSCANLINE 0x00020000l - -/* - * Display hardware has stereo vision capabilities. DDSCAPS_PRIMARYSURFACELEFT - * can be created. - */ -#define DDCAPS_STEREOVIEW 0x00040000l - -/* - * Display hardware is capable of generating a vertical blank interrupt. - */ -#define DDCAPS_VBI 0x00080000l - -/* - * Supports the use of z buffers with blt operations. - */ -#define DDCAPS_ZBLTS 0x00100000l - -/* - * Supports Z Ordering of overlays. - */ -#define DDCAPS_ZOVERLAYS 0x00200000l - -/* - * Supports color key - */ -#define DDCAPS_COLORKEY 0x00400000l - -/* - * Supports alpha surfaces - */ -#define DDCAPS_ALPHA 0x00800000l - -/* - * colorkey is hardware assisted(DDCAPS_COLORKEY will also be set) - */ -#define DDCAPS_COLORKEYHWASSIST 0x01000000l - -/* - * no hardware support at all - */ -#define DDCAPS_NOHARDWARE 0x02000000l - -/* - * Display hardware is capable of color fill with bltter - */ -#define DDCAPS_BLTCOLORFILL 0x04000000l - -/* - * Display hardware is bank switched, and potentially very slow at - * random access to VRAM. - */ -#define DDCAPS_BANKSWITCHED 0x08000000l - -/* - * Display hardware is capable of depth filling Z-buffers with bltter - */ -#define DDCAPS_BLTDEPTHFILL 0x10000000l - -/* - * Display hardware is capable of clipping while bltting. - */ -#define DDCAPS_CANCLIP 0x20000000l - -/* - * Display hardware is capable of clipping while stretch bltting. - */ -#define DDCAPS_CANCLIPSTRETCHED 0x40000000l - -/* - * Display hardware is capable of bltting to or from system memory - */ -#define DDCAPS_CANBLTSYSMEM 0x80000000l - - - /**************************************************************************** - * - * MORE DIRECTDRAW DRIVER CAPABILITY FLAGS (dwCaps2) - * - ****************************************************************************/ - -/* - * Display hardware is certified - */ -#define DDCAPS2_CERTIFIED 0x00000001l - -/* - * Driver cannot interleave 2D operations (lock and blt) to surfaces with - * Direct3D rendering operations between calls to BeginScene() and EndScene() - */ -#define DDCAPS2_NO2DDURING3DSCENE 0x00000002l - -/**************************************************************************** - * - * DIRECTDRAW FX ALPHA CAPABILITY FLAGS - * - ****************************************************************************/ - -/* - * Supports alpha blending around the edge of a source color keyed surface. - * For Blt. - */ -#define DDFXALPHACAPS_BLTALPHAEDGEBLEND 0x00000001l - -/* - * Supports alpha information in the pixel format. The bit depth of alpha - * information in the pixel format can be 1,2,4, or 8. The alpha value becomes - * more opaque as the alpha value increases. (0 is transparent.) - * For Blt. - */ -#define DDFXALPHACAPS_BLTALPHAPIXELS 0x00000002l - -/* - * Supports alpha information in the pixel format. The bit depth of alpha - * information in the pixel format can be 1,2,4, or 8. The alpha value - * becomes more transparent as the alpha value increases. (0 is opaque.) - * This flag can only be set if DDCAPS_ALPHA is set. - * For Blt. - */ -#define DDFXALPHACAPS_BLTALPHAPIXELSNEG 0x00000004l - -/* - * Supports alpha only surfaces. The bit depth of an alpha only surface can be - * 1,2,4, or 8. The alpha value becomes more opaque as the alpha value increases. - * (0 is transparent.) - * For Blt. - */ -#define DDFXALPHACAPS_BLTALPHASURFACES 0x00000008l - -/* - * The depth of the alpha channel data can range can be 1,2,4, or 8. - * The NEG suffix indicates that this alpha channel becomes more transparent - * as the alpha value increases. (0 is opaque.) This flag can only be set if - * DDCAPS_ALPHA is set. - * For Blt. - */ -#define DDFXALPHACAPS_BLTALPHASURFACESNEG 0x00000010l - -/* - * Supports alpha blending around the edge of a source color keyed surface. - * For Overlays. - */ -#define DDFXALPHACAPS_OVERLAYALPHAEDGEBLEND 0x00000020l - -/* - * Supports alpha information in the pixel format. The bit depth of alpha - * information in the pixel format can be 1,2,4, or 8. The alpha value becomes - * more opaque as the alpha value increases. (0 is transparent.) - * For Overlays. - */ -#define DDFXALPHACAPS_OVERLAYALPHAPIXELS 0x00000040l - -/* - * Supports alpha information in the pixel format. The bit depth of alpha - * information in the pixel format can be 1,2,4, or 8. The alpha value - * becomes more transparent as the alpha value increases. (0 is opaque.) - * This flag can only be set if DDCAPS_ALPHA is set. - * For Overlays. - */ -#define DDFXALPHACAPS_OVERLAYALPHAPIXELSNEG 0x00000080l - -/* - * Supports alpha only surfaces. The bit depth of an alpha only surface can be - * 1,2,4, or 8. The alpha value becomes more opaque as the alpha value increases. - * (0 is transparent.) - * For Overlays. - */ -#define DDFXALPHACAPS_OVERLAYALPHASURFACES 0x00000100l - -/* - * The depth of the alpha channel data can range can be 1,2,4, or 8. - * The NEG suffix indicates that this alpha channel becomes more transparent - * as the alpha value increases. (0 is opaque.) This flag can only be set if - * DDCAPS_ALPHA is set. - * For Overlays. - */ -#define DDFXALPHACAPS_OVERLAYALPHASURFACESNEG 0x00000200l - -/**************************************************************************** - * - * DIRECTDRAW FX CAPABILITY FLAGS - * - ****************************************************************************/ - -/* - * Uses arithmetic operations to stretch and shrink surfaces during blt - * rather than pixel doubling techniques. Along the Y axis. - */ -#define DDFXCAPS_BLTARITHSTRETCHY 0x00000020l - -/* - * Uses arithmetic operations to stretch during blt - * rather than pixel doubling techniques. Along the Y axis. Only - * works for x1, x2, etc. - */ -#define DDFXCAPS_BLTARITHSTRETCHYN 0x00000010l - -/* - * Supports mirroring left to right in blt. - */ -#define DDFXCAPS_BLTMIRRORLEFTRIGHT 0x00000040l - -/* - * Supports mirroring top to bottom in blt. - */ -#define DDFXCAPS_BLTMIRRORUPDOWN 0x00000080l - -/* - * Supports arbitrary rotation for blts. - */ -#define DDFXCAPS_BLTROTATION 0x00000100l - -/* - * Supports 90 degree rotations for blts. - */ -#define DDFXCAPS_BLTROTATION90 0x00000200l - -/* - * DirectDraw supports arbitrary shrinking of a surface along the - * x axis (horizontal direction) for blts. - */ -#define DDFXCAPS_BLTSHRINKX 0x00000400l - -/* - * DirectDraw supports integer shrinking (1x,2x,) of a surface - * along the x axis (horizontal direction) for blts. - */ -#define DDFXCAPS_BLTSHRINKXN 0x00000800l - -/* - * DirectDraw supports arbitrary shrinking of a surface along the - * y axis (horizontal direction) for blts. - */ -#define DDFXCAPS_BLTSHRINKY 0x00001000l - -/* - * DirectDraw supports integer shrinking (1x,2x,) of a surface - * along the y axis (vertical direction) for blts. - */ -#define DDFXCAPS_BLTSHRINKYN 0x00002000l - -/* - * DirectDraw supports arbitrary stretching of a surface along the - * x axis (horizontal direction) for blts. - */ -#define DDFXCAPS_BLTSTRETCHX 0x00004000l - -/* - * DirectDraw supports integer stretching (1x,2x,) of a surface - * along the x axis (horizontal direction) for blts. - */ -#define DDFXCAPS_BLTSTRETCHXN 0x00008000l - -/* - * DirectDraw supports arbitrary stretching of a surface along the - * y axis (horizontal direction) for blts. - */ -#define DDFXCAPS_BLTSTRETCHY 0x00010000l - -/* - * DirectDraw supports integer stretching (1x,2x,) of a surface - * along the y axis (vertical direction) for blts. - */ -#define DDFXCAPS_BLTSTRETCHYN 0x00020000l - -/* - * Uses arithmetic operations to stretch and shrink surfaces during - * overlay rather than pixel doubling techniques. Along the Y axis - * for overlays. - */ -#define DDFXCAPS_OVERLAYARITHSTRETCHY 0x00040000l - -/* - * Uses arithmetic operations to stretch surfaces during - * overlay rather than pixel doubling techniques. Along the Y axis - * for overlays. Only works for x1, x2, etc. - */ -#define DDFXCAPS_OVERLAYARITHSTRETCHYN 0x00000008l - -/* - * DirectDraw supports arbitrary shrinking of a surface along the - * x axis (horizontal direction) for overlays. - */ -#define DDFXCAPS_OVERLAYSHRINKX 0x00080000l - -/* - * DirectDraw supports integer shrinking (1x,2x,) of a surface - * along the x axis (horizontal direction) for overlays. - */ -#define DDFXCAPS_OVERLAYSHRINKXN 0x00100000l - -/* - * DirectDraw supports arbitrary shrinking of a surface along the - * y axis (horizontal direction) for overlays. - */ -#define DDFXCAPS_OVERLAYSHRINKY 0x00200000l - -/* - * DirectDraw supports integer shrinking (1x,2x,) of a surface - * along the y axis (vertical direction) for overlays. - */ -#define DDFXCAPS_OVERLAYSHRINKYN 0x00400000l - -/* - * DirectDraw supports arbitrary stretching of a surface along the - * x axis (horizontal direction) for overlays. - */ -#define DDFXCAPS_OVERLAYSTRETCHX 0x00800000l - -/* - * DirectDraw supports integer stretching (1x,2x,) of a surface - * along the x axis (horizontal direction) for overlays. - */ -#define DDFXCAPS_OVERLAYSTRETCHXN 0x01000000l - -/* - * DirectDraw supports arbitrary stretching of a surface along the - * y axis (horizontal direction) for overlays. - */ -#define DDFXCAPS_OVERLAYSTRETCHY 0x02000000l - -/* - * DirectDraw supports integer stretching (1x,2x,) of a surface - * along the y axis (vertical direction) for overlays. - */ -#define DDFXCAPS_OVERLAYSTRETCHYN 0x04000000l - -/* - * DirectDraw supports mirroring of overlays across the vertical axis - */ -#define DDFXCAPS_OVERLAYMIRRORLEFTRIGHT 0x08000000l - -/* - * DirectDraw supports mirroring of overlays across the horizontal axis - */ -#define DDFXCAPS_OVERLAYMIRRORUPDOWN 0x10000000l - -/**************************************************************************** - * - * DIRECTDRAW STEREO VIEW CAPABILITIES - * - ****************************************************************************/ - -/* - * The stereo view is accomplished via enigma encoding. - */ -#define DDSVCAPS_ENIGMA 0x00000001l - -/* - * The stereo view is accomplished via high frequency flickering. - */ -#define DDSVCAPS_FLICKER 0x00000002l - -/* - * The stereo view is accomplished via red and blue filters applied - * to the left and right eyes. All images must adapt their colorspaces - * for this process. - */ -#define DDSVCAPS_REDBLUE 0x00000004l - -/* - * The stereo view is accomplished with split screen technology. - */ -#define DDSVCAPS_SPLIT 0x00000008l - -/**************************************************************************** - * - * DIRECTDRAWPALETTE CAPABILITIES - * - ****************************************************************************/ - -/* - * Index is 4 bits. There are sixteen color entries in the palette table. - */ -#define DDPCAPS_4BIT 0x00000001l - -/* - * Index is onto a 8 bit color index. This field is only valid with the - * DDPCAPS_1BIT, DDPCAPS_2BIT or DDPCAPS_4BIT capability and the target - * surface is in 8bpp. Each color entry is one byte long and is an index - * into destination surface's 8bpp palette. - */ -#define DDPCAPS_8BITENTRIES 0x00000002l - -/* - * Index is 8 bits. There are 256 color entries in the palette table. - */ -#define DDPCAPS_8BIT 0x00000004l - -/* - * Indicates that this DIRECTDRAWPALETTE should use the palette color array - * passed into the lpDDColorArray parameter to initialize the DIRECTDRAWPALETTE - * object. - */ -#define DDPCAPS_INITIALIZE 0x00000008l - -/* - * This palette is the one attached to the primary surface. Changing this - * table has immediate effect on the display unless DDPSETPAL_VSYNC is specified - * and supported. - */ -#define DDPCAPS_PRIMARYSURFACE 0x00000010l - -/* - * This palette is the one attached to the primary surface left. Changing - * this table has immediate effect on the display for the left eye unless - * DDPSETPAL_VSYNC is specified and supported. - */ -#define DDPCAPS_PRIMARYSURFACELEFT 0x00000020l - -/* - * This palette can have all 256 entries defined - */ -#define DDPCAPS_ALLOW256 0x00000040l - -/* - * This palette can have modifications to it synced with the monitors - * refresh rate. - */ -#define DDPCAPS_VSYNC 0x00000080l - -/* - * Index is 1 bit. There are two color entries in the palette table. - */ -#define DDPCAPS_1BIT 0x00000100l - -/* - * Index is 2 bit. There are four color entries in the palette table. - */ -#define DDPCAPS_2BIT 0x00000200l - - -/**************************************************************************** - * - * DIRECTDRAWPALETTE SETENTRY CONSTANTS - * - ****************************************************************************/ - - -/**************************************************************************** - * - * DIRECTDRAWPALETTE GETENTRY CONSTANTS - * - ****************************************************************************/ - -/* 0 is the only legal value */ - -/**************************************************************************** - * - * DIRECTDRAWSURFACE SETPALETTE CONSTANTS - * - ****************************************************************************/ - - -/**************************************************************************** - * - * DIRECTDRAW BITDEPTH CONSTANTS - * - * NOTE: These are only used to indicate supported bit depths. These - * are flags only, they are not to be used as an actual bit depth. The - * absolute numbers 1, 2, 4, 8, 16, 24 and 32 are used to indicate actual - * bit depths in a surface or for changing the display mode. - * - ****************************************************************************/ - -/* - * 1 bit per pixel. - */ -#define DDBD_1 0x00004000l - -/* - * 2 bits per pixel. - */ -#define DDBD_2 0x00002000l - -/* - * 4 bits per pixel. - */ -#define DDBD_4 0x00001000l - -/* - * 8 bits per pixel. - */ -#define DDBD_8 0x00000800l - -/* - * 16 bits per pixel. - */ -#define DDBD_16 0x00000400l - -/* - * 24 bits per pixel. - */ -#define DDBD_24 0X00000200l - -/* - * 32 bits per pixel. - */ -#define DDBD_32 0x00000100l - -/**************************************************************************** - * - * DIRECTDRAWSURFACE SET/GET COLOR KEY FLAGS - * - ****************************************************************************/ - -/* - * Set if the structure contains a color space. Not set if the structure - * contains a single color key. - */ -#define DDCKEY_COLORSPACE 0x00000001l - -/* - * Set if the structure specifies a color key or color space which is to be - * used as a destination color key for blt operations. - */ -#define DDCKEY_DESTBLT 0x00000002l - -/* - * Set if the structure specifies a color key or color space which is to be - * used as a destination color key for overlay operations. - */ -#define DDCKEY_DESTOVERLAY 0x00000004l - -/* - * Set if the structure specifies a color key or color space which is to be - * used as a source color key for blt operations. - */ -#define DDCKEY_SRCBLT 0x00000008l - -/* - * Set if the structure specifies a color key or color space which is to be - * used as a source color key for overlay operations. - */ -#define DDCKEY_SRCOVERLAY 0x00000010l - - -/**************************************************************************** - * - * DIRECTDRAW COLOR KEY CAPABILITY FLAGS - * - ****************************************************************************/ - -/* - * Supports transparent blting using a color key to identify the replaceable - * bits of the destination surface for RGB colors. - */ -#define DDCKEYCAPS_DESTBLT 0x00000001l - -/* - * Supports transparent blting using a color space to identify the replaceable - * bits of the destination surface for RGB colors. - */ -#define DDCKEYCAPS_DESTBLTCLRSPACE 0x00000002l - -/* - * Supports transparent blting using a color space to identify the replaceable - * bits of the destination surface for YUV colors. - */ -#define DDCKEYCAPS_DESTBLTCLRSPACEYUV 0x00000004l - -/* - * Supports transparent blting using a color key to identify the replaceable - * bits of the destination surface for YUV colors. - */ -#define DDCKEYCAPS_DESTBLTYUV 0x00000008l - -/* - * Supports overlaying using colorkeying of the replaceable bits of the surface - * being overlayed for RGB colors. - */ -#define DDCKEYCAPS_DESTOVERLAY 0x00000010l - -/* - * Supports a color space as the color key for the destination for RGB colors. - */ -#define DDCKEYCAPS_DESTOVERLAYCLRSPACE 0x00000020l - -/* - * Supports a color space as the color key for the destination for YUV colors. - */ -#define DDCKEYCAPS_DESTOVERLAYCLRSPACEYUV 0x00000040l - -/* - * Supports only one active destination color key value for visible overlay - * surfaces. - */ -#define DDCKEYCAPS_DESTOVERLAYONEACTIVE 0x00000080l - -/* - * Supports overlaying using colorkeying of the replaceable bits of the - * surface being overlayed for YUV colors. - */ -#define DDCKEYCAPS_DESTOVERLAYYUV 0x00000100l - -/* - * Supports transparent blting using the color key for the source with - * this surface for RGB colors. - */ -#define DDCKEYCAPS_SRCBLT 0x00000200l - -/* - * Supports transparent blting using a color space for the source with - * this surface for RGB colors. - */ -#define DDCKEYCAPS_SRCBLTCLRSPACE 0x00000400l - -/* - * Supports transparent blting using a color space for the source with - * this surface for YUV colors. - */ -#define DDCKEYCAPS_SRCBLTCLRSPACEYUV 0x00000800l - -/* - * Supports transparent blting using the color key for the source with - * this surface for YUV colors. - */ -#define DDCKEYCAPS_SRCBLTYUV 0x00001000l - -/* - * Supports overlays using the color key for the source with this - * overlay surface for RGB colors. - */ -#define DDCKEYCAPS_SRCOVERLAY 0x00002000l - -/* - * Supports overlays using a color space as the source color key for - * the overlay surface for RGB colors. - */ -#define DDCKEYCAPS_SRCOVERLAYCLRSPACE 0x00004000l - -/* - * Supports overlays using a color space as the source color key for - * the overlay surface for YUV colors. - */ -#define DDCKEYCAPS_SRCOVERLAYCLRSPACEYUV 0x00008000l - -/* - * Supports only one active source color key value for visible - * overlay surfaces. - */ -#define DDCKEYCAPS_SRCOVERLAYONEACTIVE 0x00010000l - -/* - * Supports overlays using the color key for the source with this - * overlay surface for YUV colors. - */ -#define DDCKEYCAPS_SRCOVERLAYYUV 0x00020000l - -/* - * there are no bandwidth trade-offs for using colorkey with an overlay - */ -#define DDCKEYCAPS_NOCOSTOVERLAY 0x00040000l - - -/**************************************************************************** - * - * DIRECTDRAW PIXELFORMAT FLAGS - * - ****************************************************************************/ - -/* - * The surface has alpha channel information in the pixel format. - */ -#define DDPF_ALPHAPIXELS 0x00000001l - -/* - * The pixel format contains alpha only information - */ -#define DDPF_ALPHA 0x00000002l - -/* - * The FourCC code is valid. - */ -#define DDPF_FOURCC 0x00000004l - -/* - * The surface is 4-bit color indexed. - */ -#define DDPF_PALETTEINDEXED4 0x00000008l - -/* - * The surface is indexed into a palette which stores indices - * into the destination surface's 8-bit palette. - */ -#define DDPF_PALETTEINDEXEDTO8 0x00000010l - -/* - * The surface is 8-bit color indexed. - */ -#define DDPF_PALETTEINDEXED8 0x00000020l - -/* - * The RGB data in the pixel format structure is valid. - */ -#define DDPF_RGB 0x00000040l - -/* - * The surface will accept pixel data in the format specified - * and compress it during the write. - */ -#define DDPF_COMPRESSED 0x00000080l - -/* - * The surface will accept RGB data and translate it during - * the write to YUV data. The format of the data to be written - * will be contained in the pixel format structure. The DDPF_RGB - * flag will be set. - */ -#define DDPF_RGBTOYUV 0x00000100l - -/* - * pixel format is YUV - YUV data in pixel format struct is valid - */ -#define DDPF_YUV 0x00000200l - -/* - * pixel format is a z buffer only surface - */ -#define DDPF_ZBUFFER 0x00000400l - -/* - * The surface is 1-bit color indexed. - */ -#define DDPF_PALETTEINDEXED1 0x00000800l - -/* - * The surface is 2-bit color indexed. - */ -#define DDPF_PALETTEINDEXED2 0x00001000l - -/*=========================================================================== - * - * - * DIRECTDRAW CALLBACK FLAGS - * - * - *==========================================================================*/ - -/**************************************************************************** - * - * DIRECTDRAW ENUMSURFACES FLAGS - * - ****************************************************************************/ - -/* - * Enumerate all of the surfaces that meet the search criterion. - */ -#define DDENUMSURFACES_ALL 0x00000001l - -/* - * A search hit is a surface that matches the surface description. - */ -#define DDENUMSURFACES_MATCH 0x00000002l - -/* - * A search hit is a surface that does not match the surface description. - */ -#define DDENUMSURFACES_NOMATCH 0x00000004l - -/* - * Enumerate the first surface that can be created which meets the search criterion. - */ -#define DDENUMSURFACES_CANBECREATED 0x00000008l - -/* - * Enumerate the surfaces that already exist that meet the search criterion. - */ -#define DDENUMSURFACES_DOESEXIST 0x00000010l - - -/**************************************************************************** - * - * DIRECTDRAW ENUMDISPLAYMODES FLAGS - * - ****************************************************************************/ - -/* - * Enumerate Modes with different refresh rates. EnumDisplayModes guarantees - * that a particular mode will be enumerated only once. This flag specifies whether - * the refresh rate is taken into account when determining if a mode is unique. - */ -#define DDEDM_REFRESHRATES 0x00000001l - - -/**************************************************************************** - * - * DIRECTDRAW SETCOOPERATIVELEVEL FLAGS - * - ****************************************************************************/ - -/* - * Exclusive mode owner will be responsible for the entire primary surface. - * GDI can be ignored. used with DD - */ -#define DDSCL_FULLSCREEN 0x00000001l - -/* - * allow CTRL_ALT_DEL to work while in fullscreen exclusive mode - */ -#define DDSCL_ALLOWREBOOT 0x00000002l - -/* - * prevents DDRAW from modifying the application window. - * prevents DDRAW from minimize/restore the application window on activation. - */ -#define DDSCL_NOWINDOWCHANGES 0x00000004l - -/* - * app wants to work as a regular Windows application - */ -#define DDSCL_NORMAL 0x00000008l - -/* - * app wants exclusive access - */ -#define DDSCL_EXCLUSIVE 0x00000010l - - -/* - * app can deal with non-windows display modes - */ -#define DDSCL_ALLOWMODEX 0x00000040l - - -/**************************************************************************** - * - * DIRECTDRAW BLT FLAGS - * - ****************************************************************************/ - -/* - * Use the alpha information in the pixel format or the alpha channel surface - * attached to the destination surface as the alpha channel for this blt. - */ -#define DDBLT_ALPHADEST 0x00000001l - -/* - * Use the dwConstAlphaDest field in the DDBLTFX structure as the alpha channel - * for the destination surface for this blt. - */ -#define DDBLT_ALPHADESTCONSTOVERRIDE 0x00000002l - -/* - * The NEG suffix indicates that the destination surface becomes more - * transparent as the alpha value increases. (0 is opaque) - */ -#define DDBLT_ALPHADESTNEG 0x00000004l - -/* - * Use the lpDDSAlphaDest field in the DDBLTFX structure as the alpha - * channel for the destination for this blt. - */ -#define DDBLT_ALPHADESTSURFACEOVERRIDE 0x00000008l - -/* - * Use the dwAlphaEdgeBlend field in the DDBLTFX structure as the alpha channel - * for the edges of the image that border the color key colors. - */ -#define DDBLT_ALPHAEDGEBLEND 0x00000010l - -/* - * Use the alpha information in the pixel format or the alpha channel surface - * attached to the source surface as the alpha channel for this blt. - */ -#define DDBLT_ALPHASRC 0x00000020l - -/* - * Use the dwConstAlphaSrc field in the DDBLTFX structure as the alpha channel - * for the source for this blt. - */ -#define DDBLT_ALPHASRCCONSTOVERRIDE 0x00000040l - -/* - * The NEG suffix indicates that the source surface becomes more transparent - * as the alpha value increases. (0 is opaque) - */ -#define DDBLT_ALPHASRCNEG 0x00000080l - -/* - * Use the lpDDSAlphaSrc field in the DDBLTFX structure as the alpha channel - * for the source for this blt. - */ -#define DDBLT_ALPHASRCSURFACEOVERRIDE 0x00000100l - -/* - * Do this blt asynchronously through the FIFO in the order received. If - * there is no room in the hardware FIFO fail the call. - */ -#define DDBLT_ASYNC 0x00000200l - -/* - * Uses the dwFillColor field in the DDBLTFX structure as the RGB color - * to fill the destination rectangle on the destination surface with. - */ -#define DDBLT_COLORFILL 0x00000400l - -/* - * Uses the dwDDFX field in the DDBLTFX structure to specify the effects - * to use for the blt. - */ -#define DDBLT_DDFX 0x00000800l - -/* - * Uses the dwDDROPS field in the DDBLTFX structure to specify the ROPS - * that are not part of the Win32 API. - */ -#define DDBLT_DDROPS 0x00001000l - -/* - * Use the color key associated with the destination surface. - */ -#define DDBLT_KEYDEST 0x00002000l - -/* - * Use the dckDestColorkey field in the DDBLTFX structure as the color key - * for the destination surface. - */ -#define DDBLT_KEYDESTOVERRIDE 0x00004000l - -/* - * Use the color key associated with the source surface. - */ -#define DDBLT_KEYSRC 0x00008000l - -/* - * Use the dckSrcColorkey field in the DDBLTFX structure as the color key - * for the source surface. - */ -#define DDBLT_KEYSRCOVERRIDE 0x00010000l - -/* - * Use the dwROP field in the DDBLTFX structure for the raster operation - * for this blt. These ROPs are the same as the ones defined in the Win32 API. - */ -#define DDBLT_ROP 0x00020000l - -/* - * Use the dwRotationAngle field in the DDBLTFX structure as the angle - * (specified in 1/100th of a degree) to rotate the surface. - */ -#define DDBLT_ROTATIONANGLE 0x00040000l - -/* - * Z-buffered blt using the z-buffers attached to the source and destination - * surfaces and the dwZBufferOpCode field in the DDBLTFX structure as the - * z-buffer opcode. - */ -#define DDBLT_ZBUFFER 0x00080000l - -/* - * Z-buffered blt using the dwConstDest Zfield and the dwZBufferOpCode field - * in the DDBLTFX structure as the z-buffer and z-buffer opcode respectively - * for the destination. - */ -#define DDBLT_ZBUFFERDESTCONSTOVERRIDE 0x00100000l - -/* - * Z-buffered blt using the lpDDSDestZBuffer field and the dwZBufferOpCode - * field in the DDBLTFX structure as the z-buffer and z-buffer opcode - * respectively for the destination. - */ -#define DDBLT_ZBUFFERDESTOVERRIDE 0x00200000l - -/* - * Z-buffered blt using the dwConstSrcZ field and the dwZBufferOpCode field - * in the DDBLTFX structure as the z-buffer and z-buffer opcode respectively - * for the source. - */ -#define DDBLT_ZBUFFERSRCCONSTOVERRIDE 0x00400000l - -/* - * Z-buffered blt using the lpDDSSrcZBuffer field and the dwZBufferOpCode - * field in the DDBLTFX structure as the z-buffer and z-buffer opcode - * respectively for the source. - */ -#define DDBLT_ZBUFFERSRCOVERRIDE 0x00800000l - -/* - * wait until the device is ready to handle the blt - * this will cause blt to not return DDERR_WASSTILLDRAWING - */ -#define DDBLT_WAIT 0x01000000l - -/* - * Uses the dwFillDepth field in the DDBLTFX structure as the depth value - * to fill the destination rectangle on the destination Z-buffer surface - * with. - */ -#define DDBLT_DEPTHFILL 0x02000000l - - -/**************************************************************************** - * - * BLTFAST FLAGS - * - ****************************************************************************/ - -#define DDBLTFAST_NOCOLORKEY 0x00000000 -#define DDBLTFAST_SRCCOLORKEY 0x00000001 -#define DDBLTFAST_DESTCOLORKEY 0x00000002 -#define DDBLTFAST_WAIT 0x00000010 - -/**************************************************************************** - * - * FLIP FLAGS - * - ****************************************************************************/ - -#define DDFLIP_WAIT 0x00000001l - - -/**************************************************************************** - * - * DIRECTDRAW SURFACE OVERLAY FLAGS - * - ****************************************************************************/ - -/* - * Use the alpha information in the pixel format or the alpha channel surface - * attached to the destination surface as the alpha channel for the - * destination overlay. - */ -#define DDOVER_ALPHADEST 0x00000001l - -/* - * Use the dwConstAlphaDest field in the DDOVERLAYFX structure as the - * destination alpha channel for this overlay. - */ -#define DDOVER_ALPHADESTCONSTOVERRIDE 0x00000002l - -/* - * The NEG suffix indicates that the destination surface becomes more - * transparent as the alpha value increases. - */ -#define DDOVER_ALPHADESTNEG 0x00000004l - -/* - * Use the lpDDSAlphaDest field in the DDOVERLAYFX structure as the alpha - * channel destination for this overlay. - */ -#define DDOVER_ALPHADESTSURFACEOVERRIDE 0x00000008l - -/* - * Use the dwAlphaEdgeBlend field in the DDOVERLAYFX structure as the alpha - * channel for the edges of the image that border the color key colors. - */ -#define DDOVER_ALPHAEDGEBLEND 0x00000010l - -/* - * Use the alpha information in the pixel format or the alpha channel surface - * attached to the source surface as the source alpha channel for this overlay. - */ -#define DDOVER_ALPHASRC 0x00000020l - -/* - * Use the dwConstAlphaSrc field in the DDOVERLAYFX structure as the source - * alpha channel for this overlay. - */ -#define DDOVER_ALPHASRCCONSTOVERRIDE 0x00000040l - -/* - * The NEG suffix indicates that the source surface becomes more transparent - * as the alpha value increases. - */ -#define DDOVER_ALPHASRCNEG 0x00000080l - -/* - * Use the lpDDSAlphaSrc field in the DDOVERLAYFX structure as the alpha channel - * source for this overlay. - */ -#define DDOVER_ALPHASRCSURFACEOVERRIDE 0x00000100l - -/* - * Turn this overlay off. - */ -#define DDOVER_HIDE 0x00000200l - -/* - * Use the color key associated with the destination surface. - */ -#define DDOVER_KEYDEST 0x00000400l - -/* - * Use the dckDestColorkey field in the DDOVERLAYFX structure as the color key - * for the destination surface - */ -#define DDOVER_KEYDESTOVERRIDE 0x00000800l - -/* - * Use the color key associated with the source surface. - */ -#define DDOVER_KEYSRC 0x00001000l - -/* - * Use the dckSrcColorkey field in the DDOVERLAYFX structure as the color key - * for the source surface. - */ -#define DDOVER_KEYSRCOVERRIDE 0x00002000l - -/* - * Turn this overlay on. - */ -#define DDOVER_SHOW 0x00004000l - -/* - * Add a dirty rect to an emulated overlayed surface. - */ -#define DDOVER_ADDDIRTYRECT 0x00008000l - -/* - * Redraw all dirty rects on an emulated overlayed surface. - */ -#define DDOVER_REFRESHDIRTYRECTS 0x00010000l - -/* - * Redraw the entire surface on an emulated overlayed surface. - */ -#define DDOVER_REFRESHALL 0x00020000l - - -/* - * Use the overlay FX flags to define special overlay FX - */ -#define DDOVER_DDFX 0x00080000l - - -/**************************************************************************** - * - * DIRECTDRAWSURFACE LOCK FLAGS - * - ****************************************************************************/ - -/* - * The default. Set to indicate that Lock should return a valid memory pointer - * to the top of the specified rectangle. If no rectangle is specified then a - * pointer to the top of the surface is returned. - */ -#define DDLOCK_SURFACEMEMORYPTR 0x00000000L // default - -/* - * Set to indicate that Lock should wait until it can obtain a valid memory - * pointer before returning. If this bit is set, Lock will never return - * DDERR_WASSTILLDRAWING. - */ -#define DDLOCK_WAIT 0x00000001L - -/* - * Set if an event handle is being passed to Lock. Lock will trigger the event - * when it can return the surface memory pointer requested. - */ -#define DDLOCK_EVENT 0x00000002L - -/* - * Indicates that the surface being locked will only be read from. - */ -#define DDLOCK_READONLY 0x00000010L - -/* - * Indicates that the surface being locked will only be written to - */ -#define DDLOCK_WRITEONLY 0x00000020L - - -/**************************************************************************** - * - * DIRECTDRAWSURFACE PAGELOCK FLAGS - * - ****************************************************************************/ - -/* - * No flags defined at present - */ - - -/**************************************************************************** - * - * DIRECTDRAWSURFACE PAGEUNLOCK FLAGS - * - ****************************************************************************/ - -/* - * No flags defined at present - */ - - -/**************************************************************************** - * - * DIRECTDRAWSURFACE BLT FX FLAGS - * - ****************************************************************************/ - -/* - * If stretching, use arithmetic stretching along the Y axis for this blt. - */ -#define DDBLTFX_ARITHSTRETCHY 0x00000001l - -/* - * Do this blt mirroring the surface left to right. Spin the - * surface around its y-axis. - */ -#define DDBLTFX_MIRRORLEFTRIGHT 0x00000002l - -/* - * Do this blt mirroring the surface up and down. Spin the surface - * around its x-axis. - */ -#define DDBLTFX_MIRRORUPDOWN 0x00000004l - -/* - * Schedule this blt to avoid tearing. - */ -#define DDBLTFX_NOTEARING 0x00000008l - -/* - * Do this blt rotating the surface one hundred and eighty degrees. - */ -#define DDBLTFX_ROTATE180 0x00000010l - -/* - * Do this blt rotating the surface two hundred and seventy degrees. - */ -#define DDBLTFX_ROTATE270 0x00000020l - -/* - * Do this blt rotating the surface ninety degrees. - */ -#define DDBLTFX_ROTATE90 0x00000040l - -/* - * Do this z blt using dwZBufferLow and dwZBufferHigh as range values - * specified to limit the bits copied from the source surface. - */ -#define DDBLTFX_ZBUFFERRANGE 0x00000080l - -/* - * Do this z blt adding the dwZBufferBaseDest to each of the sources z values - * before comparing it with the desting z values. - */ -#define DDBLTFX_ZBUFFERBASEDEST 0x00000100l - -/**************************************************************************** - * - * DIRECTDRAWSURFACE OVERLAY FX FLAGS - * - ****************************************************************************/ - -/* - * If stretching, use arithmetic stretching along the Y axis for this overlay. - */ -#define DDOVERFX_ARITHSTRETCHY 0x00000001l - -/* - * Mirror the overlay across the vertical axis - */ -#define DDOVERFX_MIRRORLEFTRIGHT 0x00000002l - -/* - * Mirror the overlay across the horizontal axis - */ -#define DDOVERFX_MIRRORUPDOWN 0x00000004l - -/**************************************************************************** - * - * DIRECTDRAW WAITFORVERTICALBLANK FLAGS - * - ****************************************************************************/ - -/* - * return when the vertical blank interval begins - */ -#define DDWAITVB_BLOCKBEGIN 0x00000001l - -/* - * set up an event to trigger when the vertical blank begins - */ -#define DDWAITVB_BLOCKBEGINEVENT 0x00000002l - -/* - * return when the vertical blank interval ends and display begins - */ -#define DDWAITVB_BLOCKEND 0x00000004l - -/**************************************************************************** - * - * DIRECTDRAW GETFLIPSTATUS FLAGS - * - ****************************************************************************/ - -/* - * is it OK to flip now? - */ -#define DDGFS_CANFLIP 0x00000001l - -/* - * is the last flip finished? - */ -#define DDGFS_ISFLIPDONE 0x00000002l - -/**************************************************************************** - * - * DIRECTDRAW GETBLTSTATUS FLAGS - * - ****************************************************************************/ - -/* - * is it OK to blt now? - */ -#define DDGBS_CANBLT 0x00000001l - -/* - * is the blt to the surface finished? - */ -#define DDGBS_ISBLTDONE 0x00000002l - - -/**************************************************************************** - * - * DIRECTDRAW ENUMOVERLAYZORDER FLAGS - * - ****************************************************************************/ - -/* - * Enumerate overlays back to front. - */ -#define DDENUMOVERLAYZ_BACKTOFRONT 0x00000000l - -/* - * Enumerate overlays front to back - */ -#define DDENUMOVERLAYZ_FRONTTOBACK 0x00000001l - -/**************************************************************************** - * - * DIRECTDRAW UPDATEOVERLAYZORDER FLAGS - * - ****************************************************************************/ - -/* - * Send overlay to front - */ -#define DDOVERZ_SENDTOFRONT 0x00000000l - -/* - * Send overlay to back - */ -#define DDOVERZ_SENDTOBACK 0x00000001l - -/* - * Move Overlay forward - */ -#define DDOVERZ_MOVEFORWARD 0x00000002l - -/* - * Move Overlay backward - */ -#define DDOVERZ_MOVEBACKWARD 0x00000003l - -/* - * Move Overlay in front of relative surface - */ -#define DDOVERZ_INSERTINFRONTOF 0x00000004l - -/* - * Move Overlay in back of relative surface - */ -#define DDOVERZ_INSERTINBACKOF 0x00000005l - -/*=========================================================================== - * - * - * DIRECTDRAW RETURN CODES - * - * The return values from DirectDraw Commands and Surface that return an HRESULT - * are codes from DirectDraw concerning the results of the action - * requested by DirectDraw. - * - *==========================================================================*/ - -/* - * Status is OK - * - * Issued by: DirectDraw Commands and all callbacks - */ -#define DD_OK 0 - -/**************************************************************************** - * - * DIRECTDRAW ENUMCALLBACK RETURN VALUES - * - * EnumCallback returns are used to control the flow of the DIRECTDRAW and - * DIRECTDRAWSURFACE object enumerations. They can only be returned by - * enumeration callback routines. - * - ****************************************************************************/ - -/* - * stop the enumeration - */ -#define DDENUMRET_CANCEL 0 - -/* - * continue the enumeration - */ -#define DDENUMRET_OK 1 - -/**************************************************************************** - * - * DIRECTDRAW ERRORS - * - * Errors are represented by negative values and cannot be combined. - * - ****************************************************************************/ - -/* - * This object is already initialized - */ -#define DDERR_ALREADYINITIALIZED MAKE_DDHRESULT( 5 ) - -/* - * This surface can not be attached to the requested surface. - */ -#define DDERR_CANNOTATTACHSURFACE MAKE_DDHRESULT( 10 ) - -/* - * This surface can not be detached from the requested surface. - */ -#define DDERR_CANNOTDETACHSURFACE MAKE_DDHRESULT( 20 ) - -/* - * Support is currently not available. - */ -#define DDERR_CURRENTLYNOTAVAIL MAKE_DDHRESULT( 40 ) - -/* - * An exception was encountered while performing the requested operation - */ -#define DDERR_EXCEPTION MAKE_DDHRESULT( 55 ) - -/* - * Generic failure. - */ -#define DDERR_GENERIC E_FAIL - -/* - * Height of rectangle provided is not a multiple of reqd alignment - */ -#define DDERR_HEIGHTALIGN MAKE_DDHRESULT( 90 ) - -/* - * Unable to match primary surface creation request with existing - * primary surface. - */ -#define DDERR_INCOMPATIBLEPRIMARY MAKE_DDHRESULT( 95 ) - -/* - * One or more of the caps bits passed to the callback are incorrect. - */ -#define DDERR_INVALIDCAPS MAKE_DDHRESULT( 100 ) - -/* - * DirectDraw does not support provided Cliplist. - */ -#define DDERR_INVALIDCLIPLIST MAKE_DDHRESULT( 110 ) - -/* - * DirectDraw does not support the requested mode - */ -#define DDERR_INVALIDMODE MAKE_DDHRESULT( 120 ) - -/* - * DirectDraw received a pointer that was an invalid DIRECTDRAW object. - */ -#define DDERR_INVALIDOBJECT MAKE_DDHRESULT( 130 ) - -/* - * One or more of the parameters passed to the callback function are - * incorrect. - */ -#define DDERR_INVALIDPARAMS E_INVALIDARG - -/* - * pixel format was invalid as specified - */ -#define DDERR_INVALIDPIXELFORMAT MAKE_DDHRESULT( 145 ) - -/* - * Rectangle provided was invalid. - */ -#define DDERR_INVALIDRECT MAKE_DDHRESULT( 150 ) - -/* - * Operation could not be carried out because one or more surfaces are locked - */ -#define DDERR_LOCKEDSURFACES MAKE_DDHRESULT( 160 ) - -/* - * There is no 3D present. - */ -#define DDERR_NO3D MAKE_DDHRESULT( 170 ) - -/* - * Operation could not be carried out because there is no alpha accleration - * hardware present or available. - */ -#define DDERR_NOALPHAHW MAKE_DDHRESULT( 180 ) - - -/* - * no clip list available - */ -#define DDERR_NOCLIPLIST MAKE_DDHRESULT( 205 ) - -/* - * Operation could not be carried out because there is no color conversion - * hardware present or available. - */ -#define DDERR_NOCOLORCONVHW MAKE_DDHRESULT( 210 ) - -/* - * Create function called without DirectDraw object method SetCooperativeLevel - * being called. - */ -#define DDERR_NOCOOPERATIVELEVELSET MAKE_DDHRESULT( 212 ) - -/* - * Surface doesn't currently have a color key - */ -#define DDERR_NOCOLORKEY MAKE_DDHRESULT( 215 ) - -/* - * Operation could not be carried out because there is no hardware support - * of the dest color key. - */ -#define DDERR_NOCOLORKEYHW MAKE_DDHRESULT( 220 ) - -/* - * No DirectDraw support possible with current display driver - */ -#define DDERR_NODIRECTDRAWSUPPORT MAKE_DDHRESULT( 222 ) - -/* - * Operation requires the application to have exclusive mode but the - * application does not have exclusive mode. - */ -#define DDERR_NOEXCLUSIVEMODE MAKE_DDHRESULT( 225 ) - -/* - * Flipping visible surfaces is not supported. - */ -#define DDERR_NOFLIPHW MAKE_DDHRESULT( 230 ) - -/* - * There is no GDI present. - */ -#define DDERR_NOGDI MAKE_DDHRESULT( 240 ) - -/* - * Operation could not be carried out because there is no hardware present - * or available. - */ -#define DDERR_NOMIRRORHW MAKE_DDHRESULT( 250 ) - -/* - * Requested item was not found - */ -#define DDERR_NOTFOUND MAKE_DDHRESULT( 255 ) - -/* - * Operation could not be carried out because there is no overlay hardware - * present or available. - */ -#define DDERR_NOOVERLAYHW MAKE_DDHRESULT( 260 ) - -/* - * Operation could not be carried out because there is no appropriate raster - * op hardware present or available. - */ -#define DDERR_NORASTEROPHW MAKE_DDHRESULT( 280 ) - -/* - * Operation could not be carried out because there is no rotation hardware - * present or available. - */ -#define DDERR_NOROTATIONHW MAKE_DDHRESULT( 290 ) - -/* - * Operation could not be carried out because there is no hardware support - * for stretching - */ -#define DDERR_NOSTRETCHHW MAKE_DDHRESULT( 310 ) - -/* - * DirectDrawSurface is not in 4 bit color palette and the requested operation - * requires 4 bit color palette. - */ -#define DDERR_NOT4BITCOLOR MAKE_DDHRESULT( 316 ) - -/* - * DirectDrawSurface is not in 4 bit color index palette and the requested - * operation requires 4 bit color index palette. - */ -#define DDERR_NOT4BITCOLORINDEX MAKE_DDHRESULT( 317 ) - -/* - * DirectDraw Surface is not in 8 bit color mode and the requested operation - * requires 8 bit color. - */ -#define DDERR_NOT8BITCOLOR MAKE_DDHRESULT( 320 ) - -/* - * Operation could not be carried out because there is no texture mapping - * hardware present or available. - */ -#define DDERR_NOTEXTUREHW MAKE_DDHRESULT( 330 ) - -/* - * Operation could not be carried out because there is no hardware support - * for vertical blank synchronized operations. - */ -#define DDERR_NOVSYNCHW MAKE_DDHRESULT( 335 ) - -/* - * Operation could not be carried out because there is no hardware support - * for zbuffer blting. - */ -#define DDERR_NOZBUFFERHW MAKE_DDHRESULT( 340 ) - -/* - * Overlay surfaces could not be z layered based on their BltOrder because - * the hardware does not support z layering of overlays. - */ -#define DDERR_NOZOVERLAYHW MAKE_DDHRESULT( 350 ) - -/* - * The hardware needed for the requested operation has already been - * allocated. - */ -#define DDERR_OUTOFCAPS MAKE_DDHRESULT( 360 ) - -/* - * DirectDraw does not have enough memory to perform the operation. - */ -#define DDERR_OUTOFMEMORY E_OUTOFMEMORY - -/* - * DirectDraw does not have enough memory to perform the operation. - */ -#define DDERR_OUTOFVIDEOMEMORY MAKE_DDHRESULT( 380 ) - -/* - * hardware does not support clipped overlays - */ -#define DDERR_OVERLAYCANTCLIP MAKE_DDHRESULT( 382 ) - -/* - * Can only have ony color key active at one time for overlays - */ -#define DDERR_OVERLAYCOLORKEYONLYONEACTIVE MAKE_DDHRESULT( 384 ) - -/* - * Access to this palette is being refused because the palette is already - * locked by another thread. - */ -#define DDERR_PALETTEBUSY MAKE_DDHRESULT( 387 ) - -/* - * No src color key specified for this operation. - */ -#define DDERR_COLORKEYNOTSET MAKE_DDHRESULT( 400 ) - -/* - * This surface is already attached to the surface it is being attached to. - */ -#define DDERR_SURFACEALREADYATTACHED MAKE_DDHRESULT( 410 ) - -/* - * This surface is already a dependency of the surface it is being made a - * dependency of. - */ -#define DDERR_SURFACEALREADYDEPENDENT MAKE_DDHRESULT( 420 ) - -/* - * Access to this surface is being refused because the surface is already - * locked by another thread. - */ -#define DDERR_SURFACEBUSY MAKE_DDHRESULT( 430 ) - -/* - * Access to this surface is being refused because no driver exists - * which can supply a pointer to the surface. - * This is most likely to happen when attempting to lock the primary - * surface when no DCI provider is present. - */ -#define DDERR_CANTLOCKSURFACE MAKE_DDHRESULT( 435 ) - -/* - * Access to Surface refused because Surface is obscured. - */ -#define DDERR_SURFACEISOBSCURED MAKE_DDHRESULT( 440 ) - -/* - * Access to this surface is being refused because the surface is gone. - * The DIRECTDRAWSURFACE object representing this surface should - * have Restore called on it. - */ -#define DDERR_SURFACELOST MAKE_DDHRESULT( 450 ) - -/* - * The requested surface is not attached. - */ -#define DDERR_SURFACENOTATTACHED MAKE_DDHRESULT( 460 ) - -/* - * Height requested by DirectDraw is too large. - */ -#define DDERR_TOOBIGHEIGHT MAKE_DDHRESULT( 470 ) - -/* - * Size requested by DirectDraw is too large -- The individual height and - * width are OK. - */ -#define DDERR_TOOBIGSIZE MAKE_DDHRESULT( 480 ) - -/* - * Width requested by DirectDraw is too large. - */ -#define DDERR_TOOBIGWIDTH MAKE_DDHRESULT( 490 ) - -/* - * Action not supported. - */ -#define DDERR_UNSUPPORTED E_NOTIMPL - -/* - * FOURCC format requested is unsupported by DirectDraw - */ -#define DDERR_UNSUPPORTEDFORMAT MAKE_DDHRESULT( 510 ) - -/* - * Bitmask in the pixel format requested is unsupported by DirectDraw - */ -#define DDERR_UNSUPPORTEDMASK MAKE_DDHRESULT( 520 ) - -/* - * vertical blank is in progress - */ -#define DDERR_VERTICALBLANKINPROGRESS MAKE_DDHRESULT( 537 ) - -/* - * Informs DirectDraw that the previous Blt which is transfering information - * to or from this Surface is incomplete. - */ -#define DDERR_WASSTILLDRAWING MAKE_DDHRESULT( 540 ) - -/* - * Rectangle provided was not horizontally aligned on reqd. boundary - */ -#define DDERR_XALIGN MAKE_DDHRESULT( 560 ) - -/* - * The GUID passed to DirectDrawCreate is not a valid DirectDraw driver - * identifier. - */ -#define DDERR_INVALIDDIRECTDRAWGUID MAKE_DDHRESULT( 561 ) - -/* - * A DirectDraw object representing this driver has already been created - * for this process. - */ -#define DDERR_DIRECTDRAWALREADYCREATED MAKE_DDHRESULT( 562 ) - -/* - * A hardware only DirectDraw object creation was attempted but the driver - * did not support any hardware. - */ -#define DDERR_NODIRECTDRAWHW MAKE_DDHRESULT( 563 ) - -/* - * this process already has created a primary surface - */ -#define DDERR_PRIMARYSURFACEALREADYEXISTS MAKE_DDHRESULT( 564 ) - -/* - * software emulation not available. - */ -#define DDERR_NOEMULATION MAKE_DDHRESULT( 565 ) - -/* - * region passed to Clipper::GetClipList is too small. - */ -#define DDERR_REGIONTOOSMALL MAKE_DDHRESULT( 566 ) - -/* - * an attempt was made to set a clip list for a clipper objec that - * is already monitoring an hwnd. - */ -#define DDERR_CLIPPERISUSINGHWND MAKE_DDHRESULT( 567 ) - -/* - * No clipper object attached to surface object - */ -#define DDERR_NOCLIPPERATTACHED MAKE_DDHRESULT( 568 ) - -/* - * Clipper notification requires an HWND or - * no HWND has previously been set as the CooperativeLevel HWND. - */ -#define DDERR_NOHWND MAKE_DDHRESULT( 569 ) - -/* - * HWND used by DirectDraw CooperativeLevel has been subclassed, - * this prevents DirectDraw from restoring state. - */ -#define DDERR_HWNDSUBCLASSED MAKE_DDHRESULT( 570 ) - -/* - * The CooperativeLevel HWND has already been set. - * It can not be reset while the process has surfaces or palettes created. - */ -#define DDERR_HWNDALREADYSET MAKE_DDHRESULT( 571 ) - -/* - * No palette object attached to this surface. - */ -#define DDERR_NOPALETTEATTACHED MAKE_DDHRESULT( 572 ) - -/* - * No hardware support for 16 or 256 color palettes. - */ -#define DDERR_NOPALETTEHW MAKE_DDHRESULT( 573 ) - -/* - * If a clipper object is attached to the source surface passed into a - * BltFast call. - */ -#define DDERR_BLTFASTCANTCLIP MAKE_DDHRESULT( 574 ) - -/* - * No blter. - */ -#define DDERR_NOBLTHW MAKE_DDHRESULT( 575 ) - -/* - * No DirectDraw ROP hardware. - */ -#define DDERR_NODDROPSHW MAKE_DDHRESULT( 576 ) - -/* - * returned when GetOverlayPosition is called on a hidden overlay - */ -#define DDERR_OVERLAYNOTVISIBLE MAKE_DDHRESULT( 577 ) - -/* - * returned when GetOverlayPosition is called on a overlay that UpdateOverlay - * has never been called on to establish a destionation. - */ -#define DDERR_NOOVERLAYDEST MAKE_DDHRESULT( 578 ) - -/* - * returned when the position of the overlay on the destionation is no longer - * legal for that destionation. - */ -#define DDERR_INVALIDPOSITION MAKE_DDHRESULT( 579 ) - -/* - * returned when an overlay member is called for a non-overlay surface - */ -#define DDERR_NOTAOVERLAYSURFACE MAKE_DDHRESULT( 580 ) - -/* - * An attempt was made to set the cooperative level when it was already - * set to exclusive. - */ -#define DDERR_EXCLUSIVEMODEALREADYSET MAKE_DDHRESULT( 581 ) - -/* - * An attempt has been made to flip a surface that is not flippable. - */ -#define DDERR_NOTFLIPPABLE MAKE_DDHRESULT( 582 ) - -/* - * Can't duplicate primary & 3D surfaces, or surfaces that are implicitly - * created. - */ -#define DDERR_CANTDUPLICATE MAKE_DDHRESULT( 583 ) - -/* - * Surface was not locked. An attempt to unlock a surface that was not - * locked at all, or by this process, has been attempted. - */ -#define DDERR_NOTLOCKED MAKE_DDHRESULT( 584 ) - -/* - * Windows can not create any more DCs - */ -#define DDERR_CANTCREATEDC MAKE_DDHRESULT( 585 ) - -/* - * No DC was ever created for this surface. - */ -#define DDERR_NODC MAKE_DDHRESULT( 586 ) - -/* - * This surface can not be restored because it was created in a different - * mode. - */ -#define DDERR_WRONGMODE MAKE_DDHRESULT( 587 ) - -/* - * This surface can not be restored because it is an implicitly created - * surface. - */ -#define DDERR_IMPLICITLYCREATED MAKE_DDHRESULT( 588 ) - -/* - * The surface being used is not a palette-based surface - */ -#define DDERR_NOTPALETTIZED MAKE_DDHRESULT( 589 ) - - -/* - * The display is currently in an unsupported mode - */ -#define DDERR_UNSUPPORTEDMODE MAKE_DDHRESULT( 590 ) - -/* - * Operation could not be carried out because there is no mip-map - * texture mapping hardware present or available. - */ -#define DDERR_NOMIPMAPHW MAKE_DDHRESULT( 591 ) - -/* - * The requested action could not be performed because the surface was of - * the wrong type. - */ -#define DDERR_INVALIDSURFACETYPE MAKE_DDHRESULT( 592 ) - - - -/* - * A DC has already been returned for this surface. Only one DC can be - * retrieved per surface. - */ -#define DDERR_DCALREADYCREATED MAKE_DDHRESULT( 620 ) - -/* - * The attempt to page lock a surface failed. - */ -#define DDERR_CANTPAGELOCK MAKE_DDHRESULT( 640 ) - -/* - * The attempt to page unlock a surface failed. - */ -#define DDERR_CANTPAGEUNLOCK MAKE_DDHRESULT( 660 ) - -/* - * An attempt was made to page unlock a surface with no outstanding page locks. - */ -#define DDERR_NOTPAGELOCKED MAKE_DDHRESULT( 680 ) - -/* - * An attempt was made to invoke an interface member of a DirectDraw object - * created by CoCreateInstance() before it was initialized. - */ -#define DDERR_NOTINITIALIZED CO_E_NOTINITIALIZED - -/* Alpha bit depth constants */ - - -#ifdef __cplusplus -}; -#endif - -#endif diff --git a/ddutil.cpp b/ddutil.cpp deleted file mode 100644 index b51b857..0000000 --- a/ddutil.cpp +++ /dev/null @@ -1,346 +0,0 @@ -/*========================================================================== - * - * Copyright (C) 1995-1997 Microsoft Corporation. All Rights Reserved. - * - * File: ddutil.cpp - * Content: Routines for loading bitmap and palettes from resources - * - ***************************************************************************/ -#undef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#include -#include -#include -#include -#include -#include "ddutil.h" -#include "misc.h" - -using namespace std; - -#define DIRECTDRAW_VERSION 0x0500 - -BOOL g_bDebug = TRUE; - -void DDSetDebug(BOOL bDebug) -{ - g_bDebug = bDebug; -} - - -/* - * DDLoadBitmap - * - * create a DirectDrawSurface from a bitmap resource. - * - */ -extern "C" IDirectDrawSurface * DDLoadBitmap(IDirectDraw *pdd, LPCSTR szBitmap, int dx, int dy) -{ - HBITMAP hbm; - BITMAP bm; - DDSURFACEDESC ddsd; - IDirectDrawSurface *pdds; - - // - // try to load the bitmap as a resource, if that fails, try it as a file - // - hbm = (HBITMAP)LoadImageA(GetModuleHandle(NULL), szBitmap, IMAGE_BITMAP, dx, dy, LR_CREATEDIBSECTION); - - if (hbm == NULL) - hbm = (HBITMAP)LoadImageA(NULL, szBitmap, IMAGE_BITMAP, dx, dy, LR_LOADFROMFILE|LR_CREATEDIBSECTION); - - if (hbm == NULL) - return NULL; - - // - // get size of the bitmap - // - GetObject(hbm, sizeof(bm), &bm); // get size of bitmap - - // - // create a DirectDrawSurface for this bitmap - // - ZeroMemory(&ddsd, sizeof(ddsd)); - ddsd.dwSize = sizeof(ddsd); - ddsd.dwFlags = DDSD_CAPS | DDSD_HEIGHT |DDSD_WIDTH; - ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; - ddsd.dwWidth = bm.bmWidth; - ddsd.dwHeight = bm.bmHeight; - - if (pdd->CreateSurface(&ddsd, &pdds, NULL) != DD_OK) - return NULL; - - DDCopyBitmap(pdds, hbm, 0, 0, 0, 0); - - DeleteObject(hbm); - - return pdds; -} - -/* - * DDReLoadBitmap - * - * load a bitmap from a file or resource into a directdraw surface. - * normaly used to re-load a surface after a restore. - * - */ -HRESULT DDReLoadBitmap(IDirectDrawSurface *pdds, LPCSTR szBitmap) -{ - HBITMAP hbm; - HRESULT hr; - - // - // try to load the bitmap as a resource, if that fails, try it as a file - // - hbm = (HBITMAP)LoadImageA(GetModuleHandle(NULL), szBitmap, IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION); - - if (hbm == NULL) - hbm = (HBITMAP)LoadImageA(NULL, szBitmap, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE|LR_CREATEDIBSECTION); - - if (hbm == NULL) - { - OutputDebugStringA("handle is null\n"); - return E_FAIL; - } - - hr = DDCopyBitmap(pdds, hbm, 0, 0, 0, 0); - if (hr != DD_OK) - { - OutputDebugStringA("ddcopybitmap failed\n"); - } - - - DeleteObject(hbm); - return hr; -} - -/* - * DDCopyBitmap - * - * draw a bitmap into a DirectDrawSurface - * - */ -extern "C" HRESULT DDCopyBitmap(IDirectDrawSurface *pdds, HBITMAP hbm, int x, int y, int dx, int dy) -{ - HDC hdcImage; - HDC hdc; - BITMAP bm; - DDSURFACEDESC ddsd; - HRESULT hr; - - if (hbm == NULL || pdds == NULL) - return E_FAIL; - - // - // make sure this surface is restored. - // - pdds->Restore(); - - // - // select bitmap into a memoryDC so we can use it. - // - hdcImage = CreateCompatibleDC(NULL); - if (!hdcImage) - OutputDebugStringA("createcompatible dc failed\n"); - SelectObject(hdcImage, hbm); - - // - // get size of the bitmap - // - GetObject(hbm, sizeof(bm), &bm); // get size of bitmap - dx = dx == 0 ? bm.bmWidth : dx; // use the passed size, unless zero - dy = dy == 0 ? bm.bmHeight : dy; - - // - // get size of surface. - // - ddsd.dwSize = sizeof(ddsd); - ddsd.dwFlags = DDSD_HEIGHT | DDSD_WIDTH; - pdds->GetSurfaceDesc(&ddsd); - - if ((hr = pdds->GetDC(&hdc)) == DD_OK) - { - StretchBlt(hdc, 0, 0, ddsd.dwWidth, ddsd.dwHeight, hdcImage, x, y, dx, dy, SRCCOPY); - pdds->ReleaseDC(hdc); - } - - DeleteDC(hdcImage); - - return hr; -} - -// -// DDLoadPalette -// -// Create a DirectDraw palette object from a bitmap resoure -// -// if the resource does not exist or NULL is passed create a -// default 332 palette. -// -extern "C" IDirectDrawPalette * DDLoadPalette(IDirectDraw *pdd, LPCSTR szBitmap) -{ - IDirectDrawPalette* ddpal; - int i; - int n; - int fh; - HRSRC h; - LPBITMAPINFOHEADER lpbi; - PALETTEENTRY ape[256]; - RGBQUAD * prgb; - - // - // build a 332 palette as the default. - // - for (i=0; i<256; i++) - { - ape[i].peRed = (BYTE)(((i >> 5) & 0x07) * 255 / 7); - ape[i].peGreen = (BYTE)(((i >> 2) & 0x07) * 255 / 7); - ape[i].peBlue = (BYTE)(((i >> 0) & 0x03) * 255 / 3); - ape[i].peFlags = (BYTE)0; - } - - // - // get a pointer to the bitmap resource. - // - if (szBitmap && (h = FindResourceA(NULL, szBitmap, (LPCSTR)RT_BITMAP))) - { - lpbi = (LPBITMAPINFOHEADER)LockResource(LoadResource(NULL, h)); - if (!lpbi) - OutputDebugStringA("lock resource failed\n"); - prgb = (RGBQUAD*)((BYTE*)lpbi + lpbi->biSize); - - if (lpbi == NULL || lpbi->biSize < sizeof(BITMAPINFOHEADER)) - n = 0; - else if (lpbi->biBitCount > 8) - n = 0; - else if (lpbi->biClrUsed == 0) - n = 1 << lpbi->biBitCount; - else - n = lpbi->biClrUsed; - - // - // a DIB color table has its colors stored BGR not RGB - // so flip them around. - // - for(i=0; i 8) - n = 0; - else if (bi.biClrUsed == 0) - n = 1 << bi.biBitCount; - else - n = bi.biClrUsed; - - // - // a DIB color table has its colors stored BGR not RGB - // so flip them around. - // - for(i=0; iCreatePalette(DDPCAPS_8BIT, ape, &ddpal, NULL); - - return ddpal; -} - -/* - * DDColorMatch - * - * convert a RGB color to a pysical color. - * - * we do this by leting GDI SetPixel() do the color matching - * then we lock the memory and see what it got mapped to. - */ -extern "C" DWORD DDColorMatch(IDirectDrawSurface *pdds, COLORREF rgb) -{ - COLORREF rgbT; - HDC hdc; - DWORD dw = CLR_INVALID; - DDSURFACEDESC ddsd; - HRESULT hres; - - // - // use GDI SetPixel to color match for us - // - if (rgb != CLR_INVALID && pdds->GetDC(&hdc) == DD_OK) - { - rgbT = GetPixel(hdc, 0, 0); // save current pixel value - SetPixel(hdc, 0, 0, rgb); // set our value - pdds->ReleaseDC(hdc); - } - - // - // now lock the surface so we can read back the converted color - // - ddsd.dwSize = sizeof(ddsd); - while ((hres = pdds->Lock(NULL, &ddsd, 0, NULL)) == DDERR_WASSTILLDRAWING) - ; - - if (hres == DD_OK) - { - dw = *(DWORD *)ddsd.lpSurface; // get DWORD - if(ddsd.ddpfPixelFormat.dwRGBBitCount < 32) - dw &= (1 << ddsd.ddpfPixelFormat.dwRGBBitCount)-1; // mask it to bpp - pdds->Unlock(NULL); - } - - // - // now put the color that was there back. - // - if (rgb != CLR_INVALID && pdds->GetDC(&hdc) == DD_OK) - { - SetPixel(hdc, 0, 0, rgbT); - pdds->ReleaseDC(hdc); - } - - return dw; -} - -/* - * DDSetColorKey - * - * set a color key for a surface, given a RGB. - * if you pass CLR_INVALID as the color key, the pixel - * in the upper-left corner will be used. - */ -extern "C" HRESULT DDSetColorKey(IDirectDrawSurface *pdds, COLORREF rgb) -{ - DDCOLORKEY ddck; - - ddck.dwColorSpaceLowValue = DDColorMatch(pdds, rgb); - ddck.dwColorSpaceHighValue = ddck.dwColorSpaceLowValue; - return pdds->SetColorKey(DDCKEY_SRCBLT, &ddck); -} - -extern "C" HRESULT DDSetColorKey2(IDirectDrawSurface* pdds, COLORREF rgb1, - COLORREF rgb2) -{ - DDCOLORKEY ddck; - - ddck.dwColorSpaceLowValue = DDColorMatch(pdds, rgb1); - ddck.dwColorSpaceHighValue = DDColorMatch(pdds, rgb2); - return pdds->SetColorKey(DDCKEY_SRCBLT, &ddck); -} \ No newline at end of file diff --git a/ddutil.h b/ddutil.h deleted file mode 100644 index 86c1d1d..0000000 --- a/ddutil.h +++ /dev/null @@ -1,32 +0,0 @@ -/*========================================================================== - * - * Copyright (C) 1995 Microsoft Corporation. All Rights Reserved. - * - * File: ddutil.cpp - * Content: Routines for loading bitmap and palettes from resources - * - ***************************************************************************/ - -#define DIRECTDRAW_VERSION 0x0500 - -using namespace std; - -#pragma once -#include - -#ifdef __cplusplus -extern "C" { /* Assume C declarations for C++ */ -#endif /* __cplusplus */ - -extern void DDSetDebug(BOOL bDebug); -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 -} -#endif /* __cplusplus */ diff --git a/decblupi.cpp b/decblupi.cpp deleted file mode 100644 index a74aba4..0000000 --- a/decblupi.cpp +++ /dev/null @@ -1,42 +0,0 @@ -// DecBlupi.cpp -// - -#include "DEF.H" -#include "DECOR.H" -#include "ACTION.H" -#include "MISC.H" -#include "RESOURCE.H" - -void CDecor::BlupiCheat(int cheat) -{ - int rank; - Perso *persos; - PersoType persosType; - - m_persos = persos; - - for (rank = 0; rank < MAXBLUPI; rank++) - { - if (cheat == 2) - { - if (persosType == perso_bomb || - persosType == perso_hangingbomb || - persosType == perso_homingbomb || - persosType == perso_hombingbombactive || - persosType == perso_bulldozer || - persosType == perso_movingbomb) - } - } -} - -/* -void CDecor::GetBlupiHitbox(RECT *out, POINT pos) -{ - int rect.top; - int rect.bottom; - int rect.left; - int rect.right; - - if -} -*/ \ No newline at end of file diff --git a/decmove.h b/decmove.h deleted file mode 100644 index 8c022e7..0000000 --- a/decmove.h +++ /dev/null @@ -1,4 +0,0 @@ -#pragma once - -short* GetListMoves(int rank); -short* GetListIcons(int rank); \ No newline at end of file diff --git a/decor.cpp b/decor.cpp deleted file mode 100644 index 3324ce0..0000000 --- a/decor.cpp +++ /dev/null @@ -1,9408 +0,0 @@ -// CDecor.cpp -// - -#include -#include -#include -#include -#include -#include "def.h" -#include "resource.h" -#include "pixmap.h" -#include "sound.h" -#include "decor.h" -#include "action.h" -#include "text.h" -#include "misc.h" -#include "fifo.h" -#include "DECMOVE.h" -#include "event.h" -#include "dectables.h" -#include "jauge.h" -#include "network.h" - -#pragma warning (disable: 4996) -#define DIRECTDRAW_VERSION 0x0300 - - -//////////////////////////////////////////////////////////////////////////////// - - - -#define TEXTDELAY 10 - -// Constructor -// Possibly incomplete - -CDecor::CDecor() -{ - - - m_hWnd = NULL; - m_pSound = NULL; - m_pPixmap = NULL; - memset(m_lastDecorIcon, 0, 800); - m_lastRegion = 0; - m_menuType = 0; - m_time = 0; - m_bAllMissions = FALSE; // m_bCheatDoors - m_bInvincible = FALSE; // m_bSuperBlupi - m_bShowSecret = FALSE; // m_bDrawSecret - m_bAccessBuild = FALSE; // m_buildOfficialMissions - m_bNetPacked = FALSE; - m_bNetMovePredict = TRUE; - m_bNetDebug = FALSE; - m_bMulti = FALSE; - m_team = 0; - m_netPacketsSent = 0; - m_netPacketsSent2 = 0; - m_netPacketsRecieved = 0; - m_netPacketsRecieved2 = 0; - //BlupiFlush(); - //MoveFlush(); - //InitDrapeau(); -} - -CDecor::~CDecor() -{ - -} - -void CDecor::Create(HWND hWnd, CSound* pSound, CPixmap* pPixmap, CNetwork* pNetwork) -{ - POINT pos; - pos.x = 169; - pos.y = 450; - POINT pos2; - pos2.x = 295; - pos2.y = 450; - - m_hWnd = hWnd; - m_pSound = pSound; - m_pPixmap = pPixmap; - m_pNetwork = pNetwork; - m_input = 0; - m_previousInput = 0; - m_bHelicopterFlying = FALSE; - m_bHelicopterStationary = FALSE; - m_bCarMoving = FALSE; - m_bCarStationary = FALSE; - InitDecor(); - m_jauges[0].Create(m_hWnd, m_pPixmap, m_pSound, pos, 1, FALSE); - m_jauges[0].SetHide(TRUE); - m_jauges[1].Create(m_hWnd, m_pPixmap, m_pSound, pos2, 3, FALSE); - m_jauges[1].SetHide(TRUE); - NetMessageIndexFlush(); - NotifFlush(); -} - -BOOL CDecor::LoadImages() -{ - POINT totalDim, iconDim; - char filename[52]; - - if (m_lastRegion == m_region) return TRUE; - m_lastRegion = m_region; - - totalDim.x = DIMCELX * 2 * 16; - totalDim.y = DIMCELY * 2 * 6; - iconDim.x = DIMCELX * 2; - iconDim.y = DIMCELY * 2; - sprintf(filename, "decor%.3d.blp", m_region); - if (!m_pPixmap->BackgroundCache(CHBACK, filename, totalDim, iconDim, FALSE)) return FALSE; - return TRUE; -} - -void CDecor::InitGamer() -{ - int i; - BYTE* door; - - m_nbVies = 3; - memset(m_doors, 1, 200); - return; -} - - -void CDecor::InitDecor() -{ - int i; - LONG pos, pos2; - - m_cameraPos.x = 0; - m_cameraPos.y = 0; - m_worldDims.x = 100; - m_worldDims.y = 100; - m_music = 1; - m_region = 2; - m_missionTitle[0] = '\0'; - m_decorAction = 0; - for (int i = 0; i < 100; i++) - { - for (int j = 0; j < 100; j++) - { - m_decor[i, j]->icon = -1; - m_bigDecor[i, j]->icon = 1; - } - } - m_decor[3, 4]->icon = 40; - m_decor[4, 4]->icon = 38; - m_decor[5, 4]->icon = 39; - for (int k = 0; k < MAXMOVEOBJECT; k++) - { - m_moveObject[k]->type = 0; - } - FlushBalleTraj(); - FlushMoveTraj(); - m_moveObject[0]->type = 5; - m_moveObject[0]->stepAdvance = 1; - m_moveObject[0]->stepRecede = 1; - m_moveObject[0]->timeStopStart = 0; - m_moveObject[0]->timeStopEnd = 0; - m_moveObject[0]->posStart.x = 258; - m_moveObject[0]->posStart.y = 196; - m_moveObject[0]->posEnd = m_moveObject[0]->posStart; - m_moveObject[0]->posCurrent = m_moveObject[0]->posStart; - m_moveObject[0]->phase = 0; - m_moveObject[0]->step = 1; - m_moveObject[0]->time = 0; - m_moveObject[0]->channel = 10; - m_moveObject[0]->icon = 0; - m_moveObject[1]->type = 7; - m_moveObject[1]->stepAdvance = 1; - m_moveObject[1]->timeStopStart = 0; - m_moveObject[1]->timeStopEnd = 0; - m_moveObject[1]->posStart.x = 450; - m_moveObject[1]->posStart.y = 196; - m_moveObject[1]->posEnd = m_moveObject[1]->posStart; - m_moveObject[1]->posCurrent = m_moveObject[1]->posStart; - m_moveObject[1]->phase = 0; - m_moveObject[1]->step = 1; - m_moveObject[1]->time = 0; - m_moveObject[1]->channel = 10; - m_moveObject[1]->icon = 29; - pos = m_blupiStartPos[0].x = 66; - pos2 = m_blupiStartPos[0].y = 192 + BLUPIOFFY; - m_blupiStartDir[4] = 2; - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiIcon.icon = 0; - m_blupiIcon.type = 0; - m_blupiChannel.channel = CHBLUPI; - m_blupiChannel.blupiChannel = 0; - m_blupiFocus = TRUE; - m_blupiAir = FALSE; - m_blupiHelico = FALSE; - m_blupiOver = FALSE; - m_blupiJeep = FALSE; - m_blupiTank = FALSE; - m_blupiSkate = FALSE; - m_blupiNage = FALSE; - m_blupiSurf = FALSE; - m_blupiSuspend = FALSE; - m_blupiJumpAie = FALSE; - m_blupiShield = FALSE; - m_blupiPower = FALSE; - m_blupiCloud = FALSE; - m_blupiHide = FALSE; - m_blupiInvert = FALSE; - m_blupiBalloon = FALSE; - m_blupiEcrase = FALSE; - m_blupiMotorHigh = FALSE; - m_blupiPosHelico.x = -1; - m_blupiActionOuf = 0; - m_blupiTimeNoAsc = 0; - m_blupiTimeMockery = 0; - m_blupiVitesseX = 0.0; - m_blupiVitesseY = 0.0; - m_blupiValidPos.x = pos; - m_blupiValidPos.y = pos2; - m_blupiFront = FALSE; - m_blupiBullet = 0; - m_blupiCle = 0; - m_blupiPerso = 0; - m_blupiDynamite = 0; - m_nbTresor = 0; - m_totalTresor = 1; - m_goalPhase = 0; - m_scrollPoint.x = pos; - m_scrollPoint.y = pos2; - m_scrollAdd.x = 0; - m_scrollAdd.y = 0; - m_term = 0; - m_2ndPositionCalculationSlot = -1; -} - -void CDecor::SetTime(int time) -{ - m_time = time; -} - -int CDecor::GetTime() -{ - return m_time; -} - -// Basically the same as the other fucking function - -void CDecor::PlayPrepare(BOOL bTest) -{ - /* - int rand; - - rand = Random(0, 23); - */ - - int blupiStart; - MoveObjectType moveType; - - if (bTest != FALSE) - { - m_nbVies = 3; - } - - if (*(int*)((int)m_blupiStartDir + 14) == FALSE) - { - m_blupiPos.x = *(LONG*)((int)&m_blupiFifoPos[9].y + 2); - m_blupiPos.y = *(LONG*)((int)&m_blupiStartPos[0].x + 2); - blupiStart = *(int*)((int)&m_blupiStartPos[3].y + 2); - } - else - { - *(BYTE*)(m_doors + 198) = 10; - blupiStart = *(int*)((int)&m_bMulti + 2); - m_blupiPos.x = *(LONG*)((int)&m_blupiFifoPos[blupiStart + 9].y + 2); - m_blupiPos.y = *(LONG*)((int)&m_blupiStartPos[blupiStart].x + 2); - blupiStart = *(int*)((int)m_blupiStartDir + *(int*)((int)&m_bMulti + 2) * 4 + -2); - } - m_blupiDir = blupiStart; - if (blupiStart == DIR_LEFT) - { - m_blupiIcon.icon = 4; - m_blupiIcon.type = 0; - } - else - { - m_blupiIcon.icon = 4; - m_blupiIcon.type = 0; - } - - m_blupiAction = ACTION_STOP; - m_blupiPhase = 0; - m_blupiTransport = DIR_LEFT; - m_blupiFocus = TRUE; - m_blupiAir = FALSE; - m_blupiHelico = FALSE; - m_blupiOver = FALSE; - m_blupiJeep = FALSE; - m_blupiTank = FALSE; - m_blupiSkate = FALSE; - m_blupiNage = FALSE; - m_blupiSurf = FALSE; - m_blupiSuspend = FALSE; - m_blupiJumpAie = FALSE; - m_blupiShield = FALSE; - m_blupiPower = FALSE; - m_blupiCloud = FALSE; - m_blupiHide = FALSE; - m_blupiInvert = FALSE; - m_blupiBalloon = FALSE; - m_blupiEcrase = FALSE; - m_blupiMotorHigh = FALSE; - m_blupiActionOuf = 0; - m_blupiTimeNoAsc = 0; - m_blupiTimeMockery = 0; - m_blupiValidPos = m_blupiPos; - m_blupiBullet = 0; - m_blupiCle = 0; - m_blupiPerso = 0; - m_blupiDynamite = 0; - m_nbTresor = 0; - m_totalTresor = 0; - for (int i = 0; i < MAXMOVEOBJECT; i++) - { - if (m_moveObject[i]->type == 5) - { - m_totalTresor++; - } - m_moveObject[i]->posCurrent = m_moveObject[i]->posStart; - m_moveObject[i]->step = 1; - m_moveObject[i]->phase = 0; - m_moveObject[i]->time = 0; - if (m_moveObject[i]->type == 5 || - m_moveObject[i]->type == 6 || - m_moveObject[i]->type == 25 || - m_moveObject[i]->type == 26 || - m_moveObject[i]->type == 40 || - m_moveObject[i]->type == 2 || - m_moveObject[i]->type == 3 || - m_moveObject[i]->type == 96 || - m_moveObject[i]->type == 97) - { - m_moveObject[i]->phase = Random(0, 23); - } - if (m_moveObject[i]->type == 23) - { - m_moveObject[i]->type = 0; - } - if (m_moveObject[i]->type == TYPE_BALLE) - { - m_moveObject[i]->type = TYPE_EMPTY; - } - moveType = (MoveObjectType)m_moveObject[i]->type; - if ((m_bMulti != FALSE) && (moveType == TYPE_CAISSE) || (moveType == TYPE_GOAL) || (moveType == TYPE_CLE) || (moveType == TYPE_BLUPIHELICO) || (moveType == TYPE_BLUPITANK)) - { - m_moveObject[i]->type = TYPE_EMPTY; - } - } - m_goalPhase = 0; - MoveObjectSort(); - UpdateCaisse(); - m_scrollPoint = m_blupiPos; - m_scrollAdd.x = 0; - m_scrollAdd.y = 0; - m_blupiPosHelico.x = -1; - m_blupiMotorSound = 0; - m_blupiFront = FALSE; - m_blupiNoBarre = 0; - m_blupiValidPos = m_blupiPos; - m_blupiFifoNb = 0; - m_blupiTimeFire = 0; - NotifFlush(); - NetDataFlush(); - m_voyageIcon = -1; - m_jauges[0].SetHide(TRUE); - m_jauges[1].SetHide(TRUE); - m_bFoundCle = FALSE; - m_term = 0; - m_time = 0; - m_bPause = FALSE; - MoveStep(); - m_scrollPoint.x = m_blupiPos.x + 30 + m_scrollAdd.x; - m_scrollPoint.y = m_blupiPos.y + 30 + m_scrollAdd.y; -} - -// Sort of makes sense. - -void CDecor::BuildPrepare() -{ - for (int i = 0; i < MAXMOVEOBJECT; i++) - { - m_moveObject[i]->posCurrent = m_moveObject[i]->posStart; - m_moveObject[i]->step = 1; - m_moveObject[i]->time = 0; - m_moveObject[i]->phase = 0; - if (m_moveObject[i]->type == 23) - { - m_moveObject[i]->type = 0; - } - } - m_time = 0; - m_voyageIcon = -1; - m_posCelHili.x = -1; - m_2ndPositionCalculationSlot = -1; - m_bPause = FALSE; - NetDataFlush(); - return; -} - -int CDecor::IsTerminated() -{ - return m_term; -} - -void CDecor::MoveStep() -{ - LONG* longDecor; - UINT posDecor; - int dimDecor; - - MoveObjectStep(); - - if ((m_phase == WM_PHASE_PLAY) || (m_phase == WM_PHASE_PLAYTEST)) - { - // BlupiStep(); - - NotifStep(); - } - - if (m_phase == WM_PHASE_BUILD) - { - if ((m_keyPress & 2) != 0) - { - posDecor = m_posDecor.x + 50; - dimDecor = (UINT)((m_dimDecor).x != 0) & 5760; - m_posDecor.x = dimDecor; - if ((int)posDecor < dimDecor) - { - m_posDecor.x = posDecor; - } - m_posCelHili.x = -1; - } - if ((m_keyPress & 1) != 0) - { - longDecor = &m_posDecor.y; - *longDecor = *longDecor + 50; - dimDecor = (UINT)(m_dimDecor.y != 0) & 5920; - if ((int)dimDecor < m_posDecor.y) - { - m_posDecor.y = dimDecor; - } - m_posCelHili.y = dimDecor; - } - m_posCelHili.x = -1; - } - if ((m_keyPress & 4) != 0) - { - posDecor = m_posDecor.y + -50; - m_posDecor.y = posDecor; - if (posDecor < 0) - { - m_posDecor.y = 0; - } - m_posCelHili.x = -1; - } - return; -} - -void CDecor::NotifStep() -{ - int i; - - i = *(int*)(m_notifText[3] + 98); - - if (i == 0) - { - NotifPop(); - return; - } - *(int*)(m_notifText[3] + 98) = i + -1; - return; -} - -int CDecor::GetBlupiChannelStandard() -{ - if (((m_bMulti != FALSE) && (m_blupiChannel.channel == CHBLUPI)) && (0 < m_team)) - { - return m_team + 10; - } - return (int)m_blupiChannel.channel; -} - -int CDecor::GetBlupiChannelActual() -{ - if ((m_bMulti != 0) && (0 < m_team)) - { - return m_team + CHELEMENT; - } - return CHBLUPI; -} - - - -// Fuck this function. That's all I can say. - -void CDecor::Build(RECT rect) -{ - RECT rect1; - RECT clip; - POINT posDecor, posDecorNext; - RECT rectDir; - - rect1 = m_pPixmap->GetClipping((RECT*)&posDecor); - clip = rect1; - m_pPixmap->SetClipping(rect); - posDecorNext = DecorNextAction(); - rectDir.right = 0; - rectDir.left = 2; - posDecor.x = posDecorNext.x; - posDecor.y = ((int*)posDecorNext.x)[1]; - -} - - - -BOOL CDecor::BlitzActif(int celx, int cely) -{ - POINT pos; - pos.x = celx * 64; - pos.y = cely * 64; - int time; - - if (m_phase == WM_PHASE_BUILD) - { - time = m_time >> 31; - return (((m_time ^ time) - time & 1 ^ time) == time); - } - if ((((pos.x - 80 <= m_blupiPos.x) && (m_blupiPos.x <= pos.x + 80)) && - (m_blupiPos.x = (m_blupiPos.y, pos.y + -500 <= m_blupiPos.x)) && (m_blupiPos.x <= pos.y + 500))) - { - if (((m_time & 100 < 70) && (0 < pos.y)) && (m_decor[pos.x + -1][pos.y + 99].icon == 304)) - { - PlaySoundB(SOUND_69_BLITZ, pos, 0); - } - if (table_blitz[0] != -1) - { - int* blitz = table_blitz; - while (1) - { - if (m_time % 100 == (int)blitz++) - { - break; - } - return 0; - } - } - } - return FALSE; -} - - -void CDecor::DrawInfo() -{ - POINT pos; - char(*pText)[100]; - char text[100]; - - if (m_phase == WM_PHASE_PLAY || WM_PHASE_PLAYTEST) - { - pText = m_notifText; - for (int i = 4; i != 0; i--) - { - if ((*pText)[0] != '\0') - { - pos.x = 10; - pos.y = 10; - DrawTextB(m_pPixmap, pos, m_messages[i], 0); - } - } - if (m_nbVies > 0) - { - pos.x = -15; - for (int i = 0; i < m_nbVies; i++) - { - pos.y = 417; - m_pPixmap->QuickIcon(GetBlupiChannelStandard(), 48, pos); - pos.x += 16; - } - } - if (m_blupiBullet > 0) - { - pos.x = -15; - pos.y = 398; - for (int i = 0; i < m_blupiBullet; i++) - { - m_pPixmap->QuickIcon(CHELEMENT, 176, pos); - pos.x += 4; - } - } - } -} - -POINT CDecor::DecorNextAction() -{ - int num = 0; - if (m_decorAction == 0 || m_bPause) - { - m_posDecor; - } - POINT posDecor = m_posDecor; - while (table_decor_action[num] != 0) - { - if (m_decorAction == table_decor_action[num]) - { - if (m_decorPhase < table_decor_action[num + 1]) - { - posDecor.x += 3 * table_decor_action[num + 2 + m_decorPhase * 2]; - posDecor.y += 3 * table_decor_action[num + 2 + m_decorPhase * 2 + 1]; - int num2; - if (m_dimDecor.x == 0) - { - num2 = 0; - } - else - { - num2 = 6400 - (m_drawBounds.right - m_drawBounds.left); - } - if (posDecor.x < 0) - { - posDecor.x = 0; - } - if (posDecor.x > num2) - { - posDecor.x = num2; - } - if (m_dimDecor.y == 0) - { - num2 = 0; - } - else - { - num2 = 6400 - (m_drawBounds.bottom - m_drawBounds.top); - } - if (posDecor.y < 0) - { - posDecor.y = 0; - } - if (posDecor.y > num2) - { - posDecor.y = num2; - } - m_decorPhase++; - break; - } - m_decorAction = 0; - break; - } - else - { - num += 2 + table_decor_action[num + 1] * 2; - } - } - return posDecor; -} - - -void CDecor::SetInput(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::SetJoystickEnable(BOOL bJoystick) -{ - m_bJoystick = bJoystick; - return; -} - -void CDecor::SetSpeedX(double speed) -{ - if (m_blupiInvert) - { - speed = -speed; - } - m_blupiSpeedX = speed; -} - -void CDecor::SetSpeedY(double speed) -{ - m_blupiSpeedY = speed; -} - -int CDecor::SoundEnviron(int sound, int obstacle) -{ - if ((obstacle >= 32 && obstacle <= 34) || (obstacle >= 41 && obstacle <= 47) || (obstacle >= 139 && obstacle <= 143)) - { - if (sound == 4) - { - return 79; - } - if (sound == 3) - { - 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) - { - return 81; - } - if (sound == 3) - { - return 80; - } - } - if ((obstacle >= 284 && obstacle <= 303) || obstacle == 338) - { - if (sound == 4) - { - return 83; - } - if (sound == 3) - { - return 82; - } - } - if (obstacle >= 341 && obstacle <= 363) - { - if (sound == 4) - { - return 85; - } - if (sound == 3) - { - return 84; - } - } - if (obstacle >= 215 && obstacle <= 234) - { - if (sound == 4) - { - return 87; - } - if (sound == 3) - { - return 86; - } - } - if (obstacle >= 246 && obstacle <= 249) - { - if (sound == 4) - { - return 89; - } - if (sound == 3) - { - return 88; - } - } - if (obstacle >= 107 && obstacle <= 109) - { - if (sound == 4) - { - return 91; - } - if (sound == 3) - { - return 90; - } - } - return sound; -} - -void CDecor::PlaySoundB(int sound, POINT pos, int net) -{ - { - 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); - } -} - -void CDecor::StopSound(Sound 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; - -} - -void CDecor::AdaptMotorVehicleSound() -{ - POINT blupiPos = m_blupiPos; - blupiPos.x -= m_posDecor.x; - blupiPos.y -= m_posDecor.y; - - if (m_bHelicopterFlying != FALSE) - { - m_pSound->PlayImage(16, blupiPos); - } - if (m_bHelicopterStationary != FALSE) - { - m_pSound->PlayImage(18, blupiPos); - } - if (m_bCarMoving != FALSE) - { - m_pSound->PlayImage(29, blupiPos); - } - if (m_bCarStationary != FALSE) - { - m_pSound->PlayImage(31, blupiPos); - } - return; -} - -void CDecor::ChangePhase(UINT phase) -{ - int channel; - POINT pos; - - pos.x = LXIMAGE / 2; - pos.y = LYIMAGE / 2; - - m_phase = phase; - if ((phase == WM_PHASE_PLAY) || (phase == WM_PHASE_PLAYTEST)) - { - channel = -1; - if (m_bHelicopterFlying != FALSE) channel = 16; - if (m_bHelicopterStationary != FALSE) channel = 18; - if (m_bJeepMarch != FALSE) channel = 29; - if (m_bJeepStop != FALSE) channel = 31; - if (channel != -1) - m_pSound->PlayImage(channel, pos, -1); - } - else - { - if (m_bHelicopterFlying != FALSE) m_pSound->StopSound(SOUND_16_HELICOHIGH); - if (m_bHelicopterStationary != FALSE) m_pSound->StopSound(SOUND_18_HELICOLOW); - if (m_bJeepMarch != FALSE) m_pSound->StopSound(SOUND_29_JEEPHIGH); - if (m_bJeepStop != FALSE) m_pSound->StopSound(SOUND_31_JEEPLOW); - return; - } - return; -} - -POINT CDecor::ScreenPosToCelPos(POINT* pos, POINT cel) -{ - POINT res; - UINT num; - LONG thing; - POINT pos2; - - if (cel.x < 0 || cel.x >= LXIMAGE || cel.y < 0 || cel.y >= LYIMAGE) - { - res.x = m_posDecor.x + m_dimCelHili.x * -32 + 32 + cel.x; - res.y = m_posDecor.y + m_dimCelHili.y * -32 + 32 + cel.y; - num = res.y >> 31; - pos->x = (res.x + (res.x >> 31 & 63)) >> 6; - pos->y = (res.y + (num & 63)) >> 6; - return *(POINT*)(num, pos); - } - pos->x = -1; - pos->y = -1; - pos2.x = pos->x; - pos2.y = thing; - return pos2; -} - - -void CDecor::DeleteCel(int celX, int celY) -{ - POINT cel; - POINT pos; - - m_2ndPositionCalculationSlot = -1; - - if ((((-1 < celX) && (celX < MAXCELX)) && (-1 < celY)) && (celY < MAXCELY)) - { - m_decor[celX][celY].icon = -1; - cel.y = celY; - cel.x = celX; - AdaptBorder(cel); - m_bigDecor[celX][celY].icon = -1; - pos.y = celY; - pos.x = celX; - MoveObjectDelete(pos); - } - return; -} - -void CDecor::SetGamerName(const char* playerName) -{ - char* name; - int result; - - name = m_missionTitle; - - result = strlen(playerName) + 1; - - strncpy(name, playerName, result); - - return; -} - -// TODO: Add VehicleSoundsPhase - -void CDecor::UpdateCaisse() -{ - m_nbRankCaisse = 0; - for (int i = 0; i < MAXMOVEOBJECT; i++) - { - if (m_moveObject[i]->type == 12) - { - m_rankCaisse[m_nbRankCaisse++] = i; - } - } -} - -BOOL CDecor::TestPushCaisse(int i, POINT pos, BOOL bPop) -{ - POINT move; - - move.x = pos.x - m_moveObject[i]->posCurrent.x; - move.y = 0; - SearchLinkCaisse(i, bPop); - int y = m_moveObject[i]->posCurrent.y; - for (int j = 0; j < m_nbLinkCaisse; j++) - { - i = m_linkCaisse[j]; - if (!TestPushOneCaisse(i, move, y)) - { - return FALSE; - } - } - for (int j = 0; j < m_nbLinkCaisse; j++) - { - i = m_linkCaisse[j]; - int num = i; - m_moveObject[num]->posCurrent.x = m_moveObject[num]->posCurrent.x + move.x; - m_moveObject[num]->posStart.x = m_moveObject[num]->posStart.x + move.x; - int num2 = i; - m_moveObject[num]->posEnd.x = m_moveObject[num]->posEnd.x + move.x; - } - return TRUE; -} - -BOOL CDecor::TestPushOneCaisse(int i, POINT move, int b) -{ - RECT rect; - - rect.top = m_moveObject[i]->posCurrent.y; - rect.left = m_moveObject[i]->posCurrent.x + move.x; - rect.right = m_moveObject[i]->posCurrent.x + move.x + 64; - rect.bottom = m_moveObject[i]->posCurrent.y + 64; - - if (DecorDetect(rect, FALSE) != FALSE) - { - return FALSE; - } - - if (m_moveObject[i]->posCurrent.y != b) - { - return TRUE; - } - rect.top = m_moveObject[i]->posCurrent.y; - rect.left = m_moveObject[i]->posCurrent.x + move.x; - rect.right = m_moveObject[i]->posCurrent.x + move.x + 20; - rect.bottom = m_moveObject[i]->posCurrent.y + 66; - - if (DecorDetect(rect, TRUE) == FALSE) - { - return FALSE; - } - rect.top = m_moveObject[i]->posCurrent.y + 64; - rect.left = m_moveObject[i]->posCurrent.x + move.x + 44; - rect.right = m_moveObject[i]->posCurrent.x + move.x + 64; - rect.bottom = m_moveObject[i]->posCurrent.y + 66; - - return (DecorDetect(rect, TRUE)); -} - - -void CDecor::SearchLinkCaisse(int rank, BOOL bPop) -{ - m_nbLinkCaisse = 0; - AddLinkCaisse(rank); - POINT posCurrent = m_moveObject[rank]->posCurrent; - - BOOL flag; - do - { - flag = FALSE; - for (int i = 0; i < m_nbLinkCaisse; i++) - { - int num = m_linkCaisse[i]; - if (m_moveObject[num]->posCurrent.y <= - posCurrent.y && (!bPop || (m_moveObject - [num]->posCurrent.x >= posCurrent.x - 32 && - m_moveObject[num]->posCurrent.x <= - posCurrent.x + 32))) - { - RECT src; - src.left = m_moveObject[num]->posCurrent.x - 1; - src.top = m_moveObject[num]->posCurrent.y - 1; - src.right = src.left + 64 + 1; - src.bottom = src.top + 64 + 1; - for (int j = 0; j < m_nbRankCaisse; j++) - { - int num2 = m_rankCaisse[j]; - if (num2 != num && m_moveObject[num2]->posCurrent.y <= posCurrent.y && (!bPop || (m_moveObject[num2]->posCurrent.x >= posCurrent.x - 32 && m_moveObject[num2]->posCurrent.x <= posCurrent.x + 32))) - { - RECT src2; - src2.left = m_moveObject[num2]->posCurrent.x - 1; - src2.top = m_moveObject[num2]->posCurrent.y - 1; - src2.right = src2.left + 64 + 1; - src2.bottom = src2.top + 64 + 1; - tagRECT tinyRect; - if (IntersectRect(&tinyRect, &src2, &src) && AddLinkCaisse(num2)) - { - flag = TRUE; - } - } - } - } - } - } while (flag); -} - - -BOOL CDecor::AddLinkCaisse(int rank) -{ - for (int i = 0; i < m_nbLinkCaisse; i++) - { - if (m_linkCaisse[i] == rank) - { - return FALSE; - } - } - m_linkCaisse[m_nbLinkCaisse] = rank; - m_nbLinkCaisse++; - return TRUE; -} - - -BOOL CDecor::LoadBackgroundImages() -{ - char filename[52]; - POINT totalDim, iconDim; - - if (m_region == m_lastRegion) return TRUE; - m_lastRegion == m_region; - - totalDim.x = DIMCELX * 2 * 16; - totalDim.y = DIMCELY * 2 * 6; - iconDim.x = DIMCELX * 2; - iconDim.y = DIMCELY * 2; - sprintf(filename, "image\\decor%.3d.blp", m_region); - if (!m_pPixmap->BackgroundCache(CHFLOOR, filename, totalDim, iconDim, FALSE)) - return FALSE; - - return TRUE; -} - - - -/* -int CDecor::SetBlupiChannel() -{ - if ( m_bMulti = 0 || - m_blupiChannel == CHBLUPI || - m_team > 0);{ - return m_team + 10; - } - return m_blupiChannel; -} -*/ - -int CDecor::GetBlupiChannel() -{ - int channel; - - if ((*(int*)((int)m_blupiStartDir + 14) != 0) && - (channel = *(int*)((int)&m_bMulti + 2), 0 < channel)) - { - return channel + CHELEMENT; - } - return CHBLUPI; -} - - - -int CDecor::GetIconPerso() -{ - if ( m_bMulti != 0){ - return m_team + ICON_BUTTON_PERSONALBOMBICON; - } - return ICON_BUTTON_PERSONALBOMBICON; -} - -int CDecor::GetRegion() -{ - return m_region; -} - -void CDecor::SetRegion(int region) -{ - m_region = region; -} - -int CDecor::GetMusic() -{ - return m_music; -} - -void CDecor::SetMusic(int music) -{ - m_music = music; -} - -void CDecor::GetDims(POINT* ptr) -{ - ptr->x = m_worldDims.x; - ptr->y = m_worldDims.y; - return; -} - -void CDecor::SetDims(POINT dims) -{ - m_worldDims.x = dims.x; - m_worldDims.y = dims.y; -} - -int CDecor::GetNbVies() -{ - return m_nbVies; -} - -void CDecor::SetNbVies(int lives) -{ - m_nbVies = lives; -} - -BOOL CDecor::GetPause() -{ - return m_bPause; -} - -void CDecor::SetPause(BOOL bPause) -{ - m_bPause = bPause; -} - -void CDecor::SetAllMissions(BOOL CheatDoors) -{ - m_bCheatDoors = CheatDoors; - AdaptDoors(m_bPrivate, m_mission); - return; -} - -void CDecor::AdaptDoors(BOOL bPrivate, int mission) -{ - POINT pos; - POINT pos2; - int i; - int p; - - m_bPrivate = bPrivate; - m_mission = mission; - - pos.x = 0; - pos.y = 0; - pos2.x = 0; - pos2.y = 0; - p = bPrivate; - - if (bPrivate == FALSE) - { - if (mission == 1) - { - for (p = 0; p < 20; p++) - { - if ((SearchDoor(bPrivate, pos2, pos) != FALSE) && ((*(char*)((int)m_lastDecorIcon + bPrivate + 0xFFFFFF) == '\0' || - (m_bCheatDoors != FALSE)))) - { - m_decor[pos2.x][pos2.y].icon = -1; - i = MoveObjectFree(); - m_moveObject[i]->type = TYPE_DOOR; - m_moveObject[i]->stepAdvance = 50; - m_moveObject[i]->stepRecede = 1; - m_moveObject[i]->timeStopStart = 0; - m_moveObject[i]->timeStopEnd = 0; - m_moveObject[i]->posStart.x = pos2.x << 6; - m_moveObject[i]->posStart.y = pos2.y << 6; - m_moveObject[i]->posCurrent.x = m_moveObject[i]->posStart.x; - m_moveObject[i]->posCurrent.y = m_moveObject[i]->posStart.y; - m_moveObject[i]->step = STEP_STOPSTART; - m_moveObject[i]->time = 0; - m_moveObject[i]->phase = 0; - m_moveObject[i]->channel = CHOBJECT; - m_moveObject[i]->icon = 183; - PlaySoundB(SOUND_33_DOOR, m_moveObject[i]->posStart, 0); - } - bPrivate = bPrivate + TRUE; - } - } - } -} - -void CDecor::CheatAction(int cheat, MoveObject moveObject) -{ - if (cheat == cheat_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) - { - m_decorAction = 1; - m_decorPhase = 0; - m_moveObject[i]->type = 8; - m_moveObject[i]->phase = 0; - - m_moveObject[i]->posCurrent.x = m_moveObject[i]->posCurrent.x + -34; - m_moveObject[i]->posCurrent.y = m_moveObject[i]->posCurrent.y + -34; - m_moveObject[i]->posStart.x = m_moveObject[i]->posCurrent.x; - m_moveObject[i]->posStart.y = m_moveObject[i]->posCurrent.y; - m_moveObject[i]->posEnd.x = m_moveObject[i]->posCurrent.x; - m_moveObject[i]->posEnd.y = m_moveObject[i]->posCurrent.y; - MoveObjectStepIcon(i); - PlaySoundB(10, m_moveObject[i]->posCurrent, 0); - - } - } - } - if (cheat == cheat_funskate) - { - m_blupiAir = FALSE; - m_blupiHelico = FALSE; - m_blupiOver = FALSE; - m_blupiJeep = FALSE; - m_blupiTank = FALSE; - m_blupiSkate = TRUE; - m_blupiNage = FALSE; - m_blupiSurf = FALSE; - m_blupiVent = FALSE; - m_blupiSuspend = FALSE; - m_pSound->StopSound(SOUND_16_HELICOHIGH); - StopSound(SOUND_18_HELICOLOW); - StopSound(SOUND_29_JEEPHIGH); - StopSound(SOUND_31_JEEPLOW); - } - if (cheat == cheat_givecopter) - { - m_blupiAir = FALSE; - m_blupiHelico = TRUE; - m_blupiOver = FALSE; - m_blupiJeep = FALSE; - m_blupiTank = FALSE; - m_blupiSkate = FALSE; - m_blupiNage = FALSE; - m_blupiSurf = FALSE; - m_blupiVent = FALSE; - m_blupiSuspend = FALSE; - } - if (cheat == cheat_jeepdrive) - { - m_blupiAir = FALSE; - m_blupiHelico = FALSE; - m_blupiOver = FALSE; - m_blupiJeep = TRUE; - m_blupiTank = FALSE; - m_blupiSkate = FALSE; - m_blupiNage = FALSE; - m_blupiSurf = FALSE; - m_blupiVent = FALSE; - m_blupiSuspend = FALSE; - } - if (cheat == cheat_alltreasure) - { - for (int i = 0; i < MAXMOVEOBJECT; i++) - { - if (m_moveObject[i]->type == 5) - { - m_moveObject[i]->type == 0; - m_nbTresor++; - OpenDoorsTresor(); - PlaySoundB(SOUND_11_TRESOR, m_moveObject[i]->posCurrent, 0); - } - } - } - if (cheat == cheat_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) - { - m_bFoundCle = TRUE; - } - StopSound(SOUND_16_HELICOHIGH); - StopSound(SOUND_18_HELICOLOW); - StopSound(SOUND_29_JEEPHIGH); - StopSound(SOUND_31_JEEPLOW); - PlaySoundB(SOUND_14_ENDOK, m_blupiPos, 0); - m_blupiAction = 13; - m_blupiPhase = 0; - m_blupiFocus = FALSE; - m_blupiFront = TRUE; - m_blupiAir = FALSE; - m_blupiHelico = FALSE; - m_blupiOver = FALSE; - m_blupiJeep = TRUE; - m_blupiTank = FALSE; - m_blupiSkate = FALSE; - m_blupiNage = FALSE; - m_blupiSurf = FALSE; - m_blupiVent = FALSE; - m_blupiSuspend = FALSE; - m_blupiShield = FALSE; - m_blupiPower = FALSE; - m_blupiCloud = FALSE; - m_blupiHide = FALSE; - m_blupiInvert = FALSE; - m_blupiBalloon = FALSE; - m_blupiEcrase = FALSE; - } - else - { - PlaySoundB(SOUND_13_ENDKO, m_blupiPos, 0); - } - m_goalPhase = 50; - } - } - } - if (cheat == cheat_roundshield) - { - PlaySoundB(SOUND_42_STARTSHIELD, m_blupiPos, 0); - m_blupiShield = TRUE; - m_blupiPower = FALSE; - m_blupiCloud = FALSE; - m_blupiHide = FALSE; - m_blupiTimeShield = 100; - m_blupiPosMagic = m_blupiPos; - m_jauges[1].SetHide(FALSE); - } - if (cheat == cheat_quicklollipop) - { - m_blupiAction = 49; - m_blupiPhase = 0; - m_blupiHelico = FALSE; - m_blupiOver = FALSE; - m_blupiJeep = FALSE; - m_blupiTank = FALSE; - m_blupiSkate = FALSE; - m_blupiShield = FALSE; - m_blupiPower = FALSE; - m_blupiCloud = FALSE; - m_blupiHide = FALSE; - m_blupiFocus = FALSE; - PlaySoundB(SOUND_50_SUCETTE, m_blupiPos, 0); - } - if (cheat == cheat_tenbombs) - { - m_blupiPerso = 10; - PlaySoundB(SOUND_60_PERSOTAKE, m_blupiPos, 0); - } - if (cheat == cheat_birdlime) - { - m_blupiBullet = 10; - } - if (cheat == cheat_drivetank) - { - m_blupiAir = FALSE; - m_blupiHelico = FALSE; - m_blupiOver = FALSE; - m_blupiJeep = FALSE; - m_blupiTank = TRUE; - m_blupiSkate = FALSE; - m_blupiNage = FALSE; - m_blupiSurf = FALSE; - m_blupiVent = FALSE; - m_blupiSuspend = FALSE; - m_blupiCloud = FALSE; - m_blupiHide = FALSE; - } - if (cheat == cheat_powercharge) - { - m_blupiAction = 56; - m_blupiPhase = 0; - m_blupiHelico = FALSE; - m_blupiOver = FALSE; - m_blupiJeep = FALSE; - m_blupiTank = TRUE; - m_blupiSkate = FALSE; - m_blupiShield = FALSE; - m_blupiPower = FALSE; - m_blupiCloud = FALSE; - m_blupiHide = FALSE; - m_blupiJumpAie = FALSE; - m_blupiFocus = FALSE; - PlaySoundB(SOUND_58_CHARGE, m_blupiPos, 0); - } - if (cheat == cheat_hidedrink) - { - m_blupiAction = 55; - m_blupiPhase = 0; - m_blupiHelico = FALSE; - m_blupiOver = FALSE; - m_blupiJeep = FALSE; - m_blupiTank = FALSE; - m_blupiSkate = FALSE; - m_blupiShield = FALSE; - m_blupiPower = FALSE; - m_blupiCloud = FALSE; - m_blupiHide = FALSE; - m_blupiJumpAie = FALSE; - m_blupiFocus = FALSE; - PlaySoundB(SOUND_57_DRINK, m_blupiPos, 0); - } - if (cheat == cheat_iovercraft) - { - m_blupiAir = FALSE; - m_blupiHelico = FALSE; - m_blupiOver = TRUE; - m_blupiJeep = FALSE; - m_blupiTank = FALSE; - m_blupiSkate = FALSE; - m_blupiNage = FALSE; - m_blupiSurf = FALSE; - m_blupiVent = FALSE; - m_blupiSuspend = FALSE; - } - if (cheat == cheat_udynamite) - { - m_blupiDynamite = 1; - PlaySoundB(SOUND_60_PERSOTAKE, m_blupiPos, 0); - } - if (cheat == cheat_wellkeys) - { - m_blupiCle |= 7; - } - if (m_blupiShield && m_blupiHide && m_blupiCloud && m_blupiPower) - { - m_jauges[1].SetHide(TRUE); - } - if (m_blupiHelico && m_blupiOver) - { - m_pSound->StopSound(SOUND_16_HELICOHIGH); - StopSound(SOUND_18_HELICOLOW); - } - if (m_blupiJeep && m_blupiTank) - { - StopSound(SOUND_29_JEEPHIGH); - StopSound(SOUND_31_JEEPLOW); - } -} - -void CDecor::BlupiSearchIcon() -{ - int num = 0; - int num2 = 2; - int num3 = m_blupiAction; - if (m_blupiVent && m_blupiHelico && m_blupiOver) - { - if (num3 == 1) - { - num3 = 8; - } - if (num3 == 2) - { - num3 = 14; - } - } - if (m_blupiHelico) - { - if (num3 == 1) - { - num3 = 15; - } - if (num3 == 2) - { - num3 = 16; - } - if (num3 == 3) - { - num3 = 17; - } - if (num3 == 10) - { - num3 = 15; - } - if (num3 == 9) - { - num3 = 15; - } - m_blupiRealRotation = (int)(m_blupiVitesseX * 2.0); - } - if (m_blupiOver) - { - if (num3 == 1) - { - num3 = 67; - } - if (num3 == 2) - { - num3 = 68; - } - if (num3 == 3) - { - num3 = 69; - } - if (num3 == 10) - { - num3 = 67; - } - if (num3 == 9) - { - num3 = 67; - } - } - if (m_blupiJeep) - { - if (num3 == 1) - { - num3 = 25; - } - if (num3 == 2) - { - num3 = 26; - } - if (num3 == 10) - { - num3 == 26; - } - if (num3 == 3) - { - num3 = 27; - } - } - if (m_blupiTank) - { - if (num3 == 1) - { - num3 = 50; - } - if (num3 == 2) - { - num3 = 51; - } - if (num3 == 10) - { - num3 = 51; - } - if (num3 == 3) - { - num3 = 52; - } - } - -} - -/* -void CDecor::BlupiStep() -{ - POINT tinyPoint; - POINT tinyPoint2; - BlupiAdjust(); - m_blupiLastPos = m_blupiPos; - POINT tinyPoint3 = m_blupiPos; - BOOL flag = m_blupiAir; - int blupiAction = m_blupiAction; - BOOL flag2 = FALSE; - BOOL flag3 = FALSE; - tinyPoint3.x += m_blupiVector.x; - tinyPoint3.y += m_blupiVector.y; - if (m_blupiFocus && (tinyPoint3.y + 30) / 64 >= 99) - { - BlupiDead(75, -1); - m_blupiRestart = TRUE; - m_blupiAir = TRUE; - m_blupiPos.y = m_blupiPos.y / 64 * 64 + BLUPIOFFY; - PlaySoundB(8, m_blupiPos, 0); - return; - } - RECT rect; - if (m_blupiVector.x != 0 || m_blupiVector.y != 0) - { - rect = BlupiRect(m_blupiPos); - rect.top = m_blupiPos.y + 11; - rect.bottom = m_blupiPos.y + 60 - 2; - TestPath(rect, m_blupiPos, tinyPoint3); - } - m_blupiVent = FALSE; - int num; - if (m_blupiTransport == -1 && !m_blupiJeep && !m_blupiTank && !m_blupiSkate - && m_blupiFocus) - { - num = m_decor[(tinyPoint3.x + 30) / 64, (tinyPoint3.y + 30) / 64]->icon; - if (num == 110) - { - tinyPoint3.x -= 9; - } - if (num == 114) - { - tinyPoint3.x += 9; - } - if (num == 118) - { - tinyPoint3.y -= 20; - } - if (num == 122) - { - tinyPoint3.y += 20; - } - if (num >= 110 && num <= 125) - { - m_blupiVent = TRUE; - rect.left = m_blupiPos.x + 12; - rect.right = m_blupiPos.x + 60 - 12; - rect.top = m_blupiPos.y + 11; - rect.bottom = m_blupiPos.y + 60 - 2; - TestPath(rect, m_blupiPos, tinyPoint3); - } - } - BOOL flag4; - if (m_blupiTransport == -1) - { - rect = BlupiRect(tinyPoint3); - rect.top = tinyPoint3.y + 60 - 2; - rect.bottom = tinyPoint3.y + 60 - 1; - flag = !DecorDetect(rect); - } - else - { - flag4 = FALSE; - } - rect = BlupiRect(tinyPoint3); - rect.top = tinyPoint3.y + 10; - rect.bottom = tinyPoint3.y + 20; - BOOL flag5 = DecorDetect(rect); - int detectIcon = m_detectIcon; - if (!m_blupiAir && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && flag4 && m_blupiFocus) - { - if (m_blupiFocus) - { - m_blupiAction = 5; - m_blupiPhase = 0; - } - m_blupiVitesseY = 1.0; - m_blupiAir = true; - flag = true; - } - if (!m_blupiNage && !m_blupiSurf && !m_blupiSuspend && !m_blupiAir && IsRessort(tinyPoint3)) - { - if ((m_blupiHelico || m_blupiOver) && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi) - { - m_blupiHelico = false; - m_blupiOver = false; - tinyPoint.x = tinyPoint3.x - 34; - tinyPoint.y = tinyPoint3.y - 34; - ObjectStart(tinyPoint, 9, 0); - m_decorAction = 1; - m_decorPhase = 0; - StopSound(SOUND_16_HELICOHIGH); - StopSound(SOUND_18_HELICOLOW); - StopSound(SOUND_29_JEEPHIGH); - StopSound(SOUND_31_JEEPLOW); - PlaySoundB(10, m_blupiPos,0); - } - if (m_blupiJeep && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi) - { - m_blupiJeep = false; - tinyPoint.x = tinyPoint3.x - 34; - tinyPoint.y = tinyPoint3.y - 34; - ObjectStart(tinyPoint, 9, 0); - m_decorAction = 1; - m_decorPhase = 0; - StopSound(SOUND_16_HELICOHIGH); - StopSound(SOUND_18_HELICOLOW); - StopSound(SOUND_29_JEEPHIGH); - StopSound(SOUND_31_JEEPLOW); - PlaySoundB(10, m_blupiPos, 0); - } - if (m_blupiTank && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi) - { - m_blupiTank = false; - tinyPoint.x = tinyPoint3.x - 34; - tinyPoint.y = tinyPoint3.y - 34; - ObjectStart(tinyPoint, 9, 0); - m_decorAction = 1; - m_decorPhase = 0; - StopSound(SOUND_16_HELICOHIGH); - StopSound(SOUND_18_HELICOLOW); - StopSound(SOUND_29_JEEPHIGH); - StopSound(SOUND_31_JEEPLOW); - PlaySoundB(10, m_blupiPos, 0); - } - if (m_blupiSkate && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi) - { - m_blupiSkate = false; - tinyPoint.x = tinyPoint3.x - 34; - tinyPoint.y = tinyPoint3.y - 34; - ObjectStart(tinyPoint, 9, 0); - m_decorAction = 1; - m_decorPhase = 0; - StopSound(SOUND_16_HELICOHIGH); - StopSound(SOUND_18_HELICOLOW); - StopSound(SOUND_29_JEEPHIGH); - StopSound(SOUND_31_JEEPLOW); - PlaySoundB(10, m_blupiPos, 0); - } - if (m_blupiFocus && 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_blupiAction = 5; - m_blupiPhase = 0; - } - if ((m_keyPress & 1) != 0 && m_blupiFocus) - { - m_blupiVitesseY = (double)(m_blupiPower ? -25 : -19); - } - else - { - m_blupiVitesseY = (double)(m_blupiPower ? -16 : -10); - } - m_blupiAir = true; - flag = true; - PlaySoundB(41, tinyPoint3, 0); - } - if ((m_keyPress & 1) != 0 && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus) - { - if (m_blupiAction != 4 && m_blupiAction != 3 && !m_blupiAir) - { - m_blupiAction = 4; - m_blupiPhase = 0; - } - if (m_blupiAction == 4 && m_blupiPhase == 3) - { - m_blupiAction = 5; - m_blupiPhase = 0; - if (m_blupiSkate) - { - PlaySoundB(1, tinyPoint3, 0); - m_blupiVitesseY = (double)(m_blupiPower ? -17 : -13); - } - else - { - PlaySoundB(1, tinyPoint3, 0); - if (IsNormalJump(tinyPoint3)) - { - m_blupiVitesseY = (double)(m_blupiPower ? -26 : -16); - } - else - { - m_blupiVitesseY = (double)(m_blupiPower ? -16 : -12); - } - } - m_blupiAir = true; - flag = true; - } - } - if (m_blupiAir) - { - if (flag5 && m_blupiVitesseY < 0.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) - { - m_blupiJumpAie = true; - PlaySoundB(40, tinyPoint3, 0); - } - else - { - PlaySoundB(SoundEnviron(4, detectIcon), tinyPoint3, 0); - } - m_blupiVitesseY = 1.0; - } - tinyPoint3.y += (int)(m_blupiVitesseY * 2.0); - if (m_blupiVitesseY < 20.0) - { - m_blupiVitesseY += 2.0; - } - rect = BlupiRect(tinyPoint3); - rect.top = tinyPoint3.y + 60 - 30; - rect.bottom = tinyPoint3.y + 60 - 1; - if (m_blupiVitesseY >= 0.0 && DecorDetect(rect)) - { - tinyPoint3.y = tinyPoint3.y / 32 * 32 + BLUPIOFFY; - if (!IsRessort(tinyPoint3)) - { - PlaySoundB(SoundEnviron(3, m_detectIcon), tinyPoint3, 0); - } - if (m_blupiFocus) - { - if (m_blupiVitesseY > 20.0) - { - m_blupiAction = 61; - } - else - { - m_blupiAction = 61; - } - m_blupiPhase = 0; - } - m_blupiAir = false; - if (m_blupiJumpAie) - { - m_blupiJumpAie = false; - m_blupiAction = 36; - 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; - num = AscenseurDetect(rect, m_blupiPos, tinyPoint3); - if (m_blupiVitesseY >= 0.0 && num != -1) - { - m_blupiTransport = num; - flag4 = false; - PlaySoundB(3, tinyPoint3, 0); - tinyPoint3.y = m_moveObject[num]->posCurrent.y - 64 + BLUPIOFFY; - if (m_blupiFocus) - { - if (m_blupiVitesseY > 20.0) - { - m_blupiAction = 61; - } - else - { - m_blupiAction = 61; - } - m_blupiPhase = 0; - } - m_blupiAir = false; - if (m_blupiJumpAie) - { - m_blupiJumpAie = false; - m_blupiAction = 36; - m_blupiPhase = 0; - } - } - } - if (m_blupiAction == 36 && m_blupiPhase == 30) - { - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiFocus = true; - } - if (m_blupiAction == 56 && m_blupiPhase == 64) - { - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiFocus = true; - m_blupiCloud = true; - m_blupiTimeShield = 100; - m_jauges[1].SetHide(false); - PlaySoundB(55, tinyPoint3, 0); - } - if (m_blupiAction == 58) - { - if (m_blupiPhase == 8) - { - tinyPoint.x = m_blupiPos.x; - tinyPoint.y = m_blupiPos.y + 40; - if (m_blupiVitesseY > 0.0) - { - tinyPoint.y += (int)(m_blupiVitesseY * 4.0); - } - m_blupiVitesseY -= 10.0; - if (ObjectStart(tinyPoint, 23, 55) != -1) - { - PlaySoundB(52, m_blupiPos, 0); - m_blupiTimeFire = 10; - m_blupiBullet--; - } - } - if (m_blupiPhase == 14) - { - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiFocus = true; - } - } - if ((m_blupiAction == 44 || m_blupiAction == 45) && m_blupiPhase == 29) - { - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiFocus = true; - } - if (m_blupiAction == 46 && m_blupiPhase == 32) - { - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiFocus = true; - } - if (m_blupiAction == 47 && m_blupiPhase == 34) - { - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiFocus = true; - } - bool flag6; - if (m_blupiAction == 48 && m_blupiPhase == 40) - { - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiFocus = true; - num = MoveObjectDetect(tinyPoint3, flag6); - if (num != -1 && !flag6 && tinyPoint3.y - BLUPIFLOOR == m_moveObject[num]->posCurrent.y) - { - if (m_blupiDir == 2 && tinyPoint3.x < m_moveObject[num]->posCurrent.x) - { - tinyPoint.x = tinyPoint3.x - 16; - tinyPoint.y = tinyPoint3.y; - int num2 = MoveObjectDetect(tinyPoint, flag6); - if (num2 == -1) - { - m_blupiAction = 9; - m_blupiPhase = 0; - } - } - if (m_blupiDir == 1 && tinyPoint3.x > m_moveObject[num]->posCurrent.x) - { - tinyPoint.x = tinyPoint3.x + 16; - tinyPoint.y = tinyPoint3.y; - int num2 = MoveObjectDetect(tinyPoint, flag6); - if (num2 == -1) - { - m_blupiAction = 9; - m_blupiPhase = 0; - } - } - } - } - if (m_blupiAction == 65) - { - if (m_blupiPhase == 4) - { - PlaySoundB(47, m_blupiPos, 0); - } - if (m_blupiPhase == 44) - { - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiFocus = true; - } - } - if (m_blupiAction == 63) - { - if (m_blupiPhase == 1) - { - PlaySoundB(65, m_blupiPos, 0); - m_blupiTimeMockery = 300; - } - if (m_blupiPhase == 92) - { - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiFocus = true; - } - } - if (m_blupiAction == 64) - { - if (m_blupiPhase == 6) - { - PlaySoundB(65, m_blupiPos, 0); - m_blupiTimeMockery = 300; - } - if (m_blupiPhase == 104) - { - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiFocus = true; - } - } - if (m_blupiAction == 83) - { - if (m_blupiPhase == 4) - { - PlaySoundB(47, m_blupiPos, 0); - } - if (m_blupiPhase == 60) - { - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiFocus = true; - } - } - if (m_blupiAction == 84 && m_blupiPhase == 18) - { - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiFocus = true; - } - if (m_blupiAction == 60 && m_blupiPhase == 3) - { - m_blupiAction = 1; - m_blupiPhase = 0; - } - if (m_blupiAction == 61 && m_blupiPhase == 5) - { - m_blupiAction = 1; - m_blupiPhase = 0; - } - if (m_blupiAction == 62 && m_blupiPhase == 2) - { - m_blupiAction = 5; - m_blupiPhase = 0; - m_blupiVitesseY = -12.0; - m_blupiAir = true; - flag = true; - } - if (m_blupiAction == 49 && m_blupiPhase == 32) - { - ObjectStart(m_sucettePos, m_sucetteType, 0); - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiFocus = true; - m_blupiPower = true; - m_blupiTimeShield = 100; - m_blupiPosMagic = m_blupiPos; - m_jauges[1].SetHide(false); - PlaySoundB(44, tinyPoint3, 0); - } - if (m_blupiAction == 55 && m_blupiPhase == 36) - { - ObjectStart(m_sucettePos, m_sucetteType, 0); - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiFocus = true; - m_blupiHide = true; - m_blupiTimeShield = 100; - m_blupiPosMagic = m_blupiPos; - m_jauges[1].SetHide(false); - PlaySoundB(62, tinyPoint3, 0); - } - if (m_blupiSpeedY < 0.0 && m_blupiLastSpeedY == 0.0 && m_blupiAction != 3 && m_blupiAction != 4 && m_blupiAction != 5 && m_blupiAction != 8 && m_blupiAction != 10 && m_blupiAction != 9 && !m_blupiAir && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus) - { - m_blupiAction = 7; - m_blupiPhase = 0; - } - if (m_blupiSpeedY == 0.0 && m_blupiLastSpeedY < 0.0 && m_blupiAction != 3 && m_blupiAction != 4 && m_blupiAction != 5 && m_blupiAction != 8 && m_blupiAction != 10 && m_blupiAction != 9 && !m_blupiAir && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus) - { - m_blupiAction = 1; - m_blupiPhase = 0; - } - if (m_blupiSpeedY > 0.0 && m_blupiLastSpeedY == 0.0 && m_blupiAction != 3 && m_blupiAction != 4 && m_blupiAction != 5 && m_blupiAction != 6 && m_blupiAction != 28 && m_blupiAction != 8 && m_blupiAction != 10 && m_blupiAction != 9 && !m_blupiAir && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus) - { - m_blupiAction = 6; - m_blupiPhase = 0; - } - if (m_blupiSpeedY > 0.0 && m_blupiSpeedX == 0.0 && (m_keyPress & 1) == 0 && m_blupiAction != 3 && m_blupiAction != 4 && m_blupiAction != 5 && m_blupiAction != 6 && m_blupiAction != 28 && m_blupiAction != 8 && m_blupiAction != 10 && m_blupiAction != 9 && !m_blupiAir && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus) - { - m_blupiAction = 6; - m_blupiPhase = 0; - } - if (m_blupiSpeedY == 0.0 && m_blupiLastSpeedY > 0.0 && m_blupiAction != 3 && m_blupiAction != 4 && m_blupiAction != 5 && m_blupiAction != 8 && m_blupiAction != 10 && m_blupiAction != 9 && !m_blupiAir && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus) - { - m_blupiAction = 1; - m_blupiPhase = 0; - } - if (m_blupiAction == 7 && m_blupiPhase == 4) - { - m_scrollAdd.y = -150; - PlaySoundB(21, tinyPoint3, 0); - } - if (m_blupiAction == 6 && m_blupiPhase == 4) - { - m_scrollAdd.y = 150; - PlaySoundB(7, tinyPoint3, 0); - } - 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; - m_blupiAction = 28; - m_blupiPhase = 0; - m_scrollAdd.y = 0; - PlaySoundB(39, tinyPoint3, 0); - } - 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; - PlaySoundB(39, tinyPoint3, 0); - } - 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; - m_blupiAction = 28; - m_blupiPhase = 0; - m_scrollAdd.y = 0; - PlaySoundB(39, tinyPoint3, 0); - } - 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; - PlaySoundB(39, tinyPoint3, 0); - } - if (m_blupiAction == 29 && m_blupiActionOuf != 47) - { - m_blupiActionOuf = 47; - m_blupiTimeOuf = 0; - } - } - if (m_blupiAction != 28 && m_blupiAction != 29 && m_blupiFocus) - { - if (m_blupiSpeedX < 0.0 && m_blupiLastSpeedX == 0.0 && !m_blupiAir && m_blupiSpeedY != 0.0) - { - m_blupiAction = 1; - m_blupiPhase = 0; - } - if (m_blupiSpeedX == 0.0 && m_blupiLastSpeedX < 0.0 && m_blupiSpeedY != 0.0) - { - m_blupiAction = 1; - m_blupiPhase = 0; - } - if (m_blupiSpeedX > 0.0 && m_blupiLastSpeedX == 0.0 && !m_blupiAir && m_blupiSpeedY != 0.0) - { - m_blupiAction = 1; - m_blupiPhase = 0; - } - if (m_blupiSpeedX == 0.0 && m_blupiLastSpeedX > 0.0 && m_blupiSpeedY != 0.0) - { - m_blupiAction = 1; - m_blupiPhase = 0; - } - } - int num3; - 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) || abs(m_blupiVitesseX) <= 8.0)) - { - if (m_blupiAir) - { - PlaySound(5, tinyPoint3); - m_blupiAction = 59; - m_blupiPhase = 0; - m_blupiDir = 1; - } - else - { - PlaySound(5, tinyPoint3); - m_blupiAction = 3; - m_blupiPhase = 0; - } - } - if (m_blupiDir == 1 && m_blupiAction != 2 && m_blupiAction != 14 && m_blupiAction != 4 && m_blupiAction != 7 && m_blupiAction != 6 && m_blupiAction != 29 && !m_blupiAir) - { - m_blupiAction = 2; - m_blupiPhase = 0; - } - if (m_blupiDir == 1 && m_blupiAction != 3 && m_blupiAction != 4 && m_blupiAction != 7 && m_blupiAction != 6 && m_blupiAction != 29 && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend) - { - if (m_blupiAction == 14) - { - tinyPoint3.x -= CaisseGetMove(5); - } - else - { - num3 = m_blupiPhase; - if (num3 > 3 || m_blupiAir) - { - num3 = 3; - } - num4 = table_vitesse_march[num3]; - if (m_blupiPower) - { - num4 *= 3; - num4 /= 2; - } - tinyPoint3.x += Speed(m_blupiSpeedX, num4); - } - } - if (m_blupiDir == 2 && m_blupiAction == 29) - { - 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) || abs(m_blupiVitesseX) <= 8.0)) - { - if (m_blupiAir) - { - PlaySound(5, tinyPoint3); - m_blupiAction = 59; - m_blupiPhase = 0; - m_blupiDir = 2; - } - else - { - PlaySound(5, tinyPoint3); - m_blupiAction = 3; - m_blupiPhase = 0; - } - } - if (m_blupiDir == 2 && m_blupiAction != 2 && m_blupiAction != 14 && m_blupiAction != 4 && m_blupiAction != 7 && m_blupiAction != 6 && m_blupiAction != 29 && !m_blupiAir) - { - m_blupiAction = 2; - m_blupiPhase = 0; - } - if (m_blupiDir == 2 && m_blupiAction != 3 && m_blupiAction != 4 && m_blupiAction != 7 && m_blupiAction != 6 && m_blupiAction != 29 && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend) - { - if (m_blupiAction == 14) - { - tinyPoint3.x += CaisseGetMove(5); - } - else - { - num3 = m_blupiPhase; - if (num3 > 3 || m_blupiAir) - { - num3 = 3; - } - num4 = table_vitesse_march[num3]; - if (m_blupiPower) - { - num4 *= 3; - num4 /= 2; - } - tinyPoint3.x += Speed(m_blupiSpeedX, num4); - } - } - if (m_blupiDir == 1 && m_blupiAction == 29) - { - tinyPoint3.x += CaisseGetMove(3); - } - } - if (m_blupiHelico) - { - if (m_blupiAction == 3 && m_blupiPhase == 10) - { - m_blupiAction = 2; - if (m_blupiDir == 1) - { - m_blupiDir = 2; - } - else - { - m_blupiDir = 1; - } - } - } - else if (m_blupiOver) - { - if (m_blupiAction == 3 && m_blupiPhase == 7) - { - m_blupiAction = 2; - if (m_blupiDir == 1) - { - m_blupiDir = 2; - } - else - { - m_blupiDir = 1; - } - } - } - else if (m_blupiJeep) - { - if (m_blupiAction == 3 && m_blupiPhase == 7) - { - m_blupiAction = 1; - m_blupiPhase = 0; - if (m_blupiDir == 1) - { - m_blupiDir = 2; - } - else - { - m_blupiDir = 1; - } - } - } - else if (m_blupiTank) - { - if (m_blupiAction == 3 && m_blupiPhase == 12) - { - m_blupiAction = 1; - m_blupiPhase = 0; - if (m_blupiDir == 1) - { - m_blupiDir = 2; - } - else - { - m_blupiDir = 1; - } - } - } - else if (m_blupiSkate) - { - if (m_blupiAction == 3 && m_blupiPhase == 14) - { - m_blupiAction = 1; - m_blupiPhase = 0; - if (m_blupiDir == 1) - { - m_blupiDir = 2; - } - else - { - m_blupiDir = 1; - } - } - } - else if (m_blupiNage || m_blupiSurf) - { - if (m_blupiAction == 3 && m_blupiPhase == 10) - { - m_blupiAction = 2; - if (m_blupiDir == 1) - { - m_blupiDir = 2; - } - else - { - m_blupiDir = 1; - } - } - } - else if (m_blupiSuspend) - { - if (m_blupiAction == 3 && m_blupiPhase == 10) - { - m_blupiAction = 1; - m_blupiPhase = 0; - if (m_blupiDir == 1) - { - m_blupiDir = 2; - } - else - { - m_blupiDir = 1; - } - } - } - else - { - if (m_blupiAction == 3 && m_blupiPhase == 6) - { - m_blupiAction = 1; - m_blupiPhase = 0; - if (m_blupiDir == 1) - { - m_blupiDir = 2; - } - else - { - m_blupiDir = 1; - } - } - if (m_blupiAction == 59 && m_blupiPhase == 6) - { - m_blupiAction = 5; - m_blupiPhase = 0; - } - } - if (!m_blupiSuspend && m_blupiAction == 4 && m_blupiPhase == 3) - { - m_blupiAction = 1; - m_blupiPhase = 0; - } - if (m_blupiSpeedX == 0.0 && m_blupiSpeedY == 0.0 && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && m_blupiFocus) - { - if (m_blupiAction == 14 || m_blupiAction == 7) - { - m_blupiAction = 1; - m_blupiPhase = 0; - } - if (m_blupiAction == 2) - { - if (m_blupiSuspend || m_blupiPhase < 10) - { - m_blupiAction = 1; - } - else - { - m_blupiAction = 60; - } - m_blupiPhase = 0; - } - if (m_blupiAction == 6) - { - m_blupiAction = 1; - m_blupiPhase = 0; - PlaySound(20, tinyPoint3); - } - m_scrollAdd.y = 0; - if (blupiAction == 14) - { - StopSound(38); - } - if (blupiAction == 29 || blupiAction == 28) - { - StopSound(39); - } - } - if (!m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && m_blupiFocus) - { - if (m_blupiAction == 9 && m_blupiDir == 1) - { - tinyPoint3.x += 4; - } - if (m_blupiAction == 9 && m_blupiDir == 2) - { - tinyPoint3.x -= 4; - } - if (m_blupiAction == 10 && m_blupiDir == 1) - { - tinyPoint3.x -= 4; - } - if (m_blupiAction == 10 && m_blupiDir == 2) - { - 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; - } - if (m_blupiAction == 10 && m_blupiDir == 2) - { - tinyPoint3.x += 5; - } - } - if ((m_keyPress & -3) == 0 && m_blupiSpeedX == 0.0 && m_blupiSpeedY == 0.0 && m_blupiNage && m_blupiFocus && m_blupiAction == 2) - { - m_blupiAction = 1; - m_blupiPhase = 0; - } - if ((m_keyPress & -3) == 0 && m_blupiSpeedX == 0.0 && m_blupiSpeedY == 0.0 && m_blupiSurf && m_blupiFocus && m_blupiAction == 2) - { - m_blupiAction = 1; - m_blupiPhase = 0; - } - if (m_blupiHelico && (m_blupiFocus || m_blupiAction == 58)) - { - if ((m_keyPress & 2) != 0 && m_blupiTimeFire == 0 && m_blupiAction != 3 && m_blupiAction != 58 && flag4) - { - if (m_blupiBullet == 0) - { - PlaySound(53, m_blupiPos); - } - else - { - m_blupiAction = 58; - m_blupiPhase = 0; - m_blupiFocus = false; - } - } - m_blupiMotorHigh = flag4; - if (m_blupiAction != 3 && m_blupiAction != 58) - { - if (flag4) - { - m_blupiAction = 2; - } - else - { - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiVitesseY = 0.0; - } - } - if (EasyMove) - { - if (m_blupiSpeedY <= -1.0 || (m_keyPress & 1) != 0) - { - if (m_blupiVitesseY > -7.0) - { - m_blupiVitesseY -= 0.5; - } - if (m_blupiVitesseY == -0.5) - { - m_blupiVitesseY = -1.0; - } - } - else if (m_blupiSpeedY >= 1.0) - { - if (m_blupiVitesseY < 8.0) - { - m_blupiVitesseY += 0.5; - } - } - else - { - if (m_blupiVitesseY > 1.0) - { - m_blupiVitesseY -= 1.0; - } - if (m_blupiVitesseY < 1.0) - { - m_blupiVitesseY += 1.0; - } - } - tinyPoint3.y += (int)m_blupiVitesseY; - } - else - { - if (m_blupiSpeedY <= -1.0 || (m_keyPress & 1) != 0) - { - if (m_blupiVitesseY > -10.0) - { - m_blupiVitesseY -= 0.5; - } - } - else if (m_blupiSpeedY >= 1.0) - { - if (m_blupiVitesseY < 12.0) - { - m_blupiVitesseY += 0.5; - } - } - else - { - if (m_blupiVitesseY > 1.0) - { - m_blupiVitesseY -= 1.0; - } - if (m_blupiVitesseY < 1.0) - { - m_blupiVitesseY += 1.0; - } - } - tinyPoint3.y += (int)m_blupiVitesseY; - } - if (EasyMove) - { - if (m_blupiSpeedX <= -1.0) - { - int num5 = (int)(m_blupiSpeedX * 12.0); - if (m_blupiVitesseX > (double)num5) - { - m_blupiVitesseX -= 0.5; - } - tinyPoint.x = tinyPoint3.x + (int)m_blupiVitesseX; - tinyPoint.y = tinyPoint3.y; - if (BlupiBloque(tinyPoint, -1)) - { - m_blupiVitesseX = 0.0; - } - } - else if (m_blupiSpeedX >= 1.0) - { - int num6 = (int)(m_blupiSpeedX * 12.0); - if (m_blupiVitesseX < (double)num6) - { - m_blupiVitesseX += 0.5; - } - tinyPoint.x = tinyPoint3.x + (int)m_blupiVitesseX; - tinyPoint.y = tinyPoint3.y; - if (BlupiBloque(tinyPoint, 1)) - { - m_blupiVitesseX = 0.0; - } - } - else - { - if (m_blupiVitesseX > 0.0) - { - m_blupiVitesseX -= 2.0; - if (m_blupiVitesseX < 0.0) - { - m_blupiVitesseX = 0.0; - } - } - if (m_blupiVitesseX < 0.0) - { - m_blupiVitesseX += 2.0; - if (m_blupiVitesseX > 0.0) - { - m_blupiVitesseX = 0.0; - } - } - } - tinyPoint3.x += (int)m_blupiVitesseX; - } - else - { - if (m_blupiSpeedX <= -1.0) - { - int num7 = (int)(m_blupiSpeedX * 16.0); - if (m_blupiVitesseX > (double)num7) - { - m_blupiVitesseX -= 1.0; - } - tinyPoint.x = tinyPoint3.x + (int)m_blupiVitesseX; - tinyPoint.y = tinyPoint3.y; - if (BlupiBloque(tinyPoint, -1)) - { - m_blupiVitesseX = 0.0; - } - } - else if (m_blupiSpeedX >= 1.0) - { - int num8 = (int)(m_blupiSpeedX * 16.0); - if (m_blupiVitesseX < (double)num8) - { - m_blupiVitesseX += 1.0; - } - tinyPoint.x = tinyPoint3.x + (int)m_blupiVitesseX; - tinyPoint.y = tinyPoint3.y; - if (BlupiBloque(tinyPoint, 1)) - { - m_blupiVitesseX = 0.0; - } - } - else - { - if (m_blupiVitesseX > 0.0) - { - m_blupiVitesseX -= 2.0; - if (m_blupiVitesseX < 0.0) - { - m_blupiVitesseX = 0.0; - } - } - if (m_blupiVitesseX < 0.0) - { - m_blupiVitesseX += 2.0; - if (m_blupiVitesseX > 0.0) - { - m_blupiVitesseX = 0.0; - } - } - } - tinyPoint3.x += (int)m_blupiVitesseX; - } - MoveObjectPollution(); - if (ButtonPressed == ButtonGlygh.PlayAction && !flag4 && m_blupiTransport == -1) - { - ButtonPressed = 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; - 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; - flag3 = !DecorDetect(rect); - if (!flag2 && !flag3) - { - tinyPoint.x = m_blupiPos.x; - tinyPoint.y = m_blupiPos.y - BLUPIFLOOR; - ObjectStart(tinyPoint, 13, 0); - m_blupiHelico = false; - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiPosHelico = m_blupiPos; - m_blupiFocus = true; - StopSound(16); - StopSound(18); - PlaySound(17, m_blupiPos); - } - } - } - if (m_blupiOver && (m_blupiFocus || m_blupiAction == 58)) - { - m_blupiMotorHigh = flag4; - if (m_blupiAction != 3) - { - if (flag4) - { - m_blupiAction = 2; - } - else - { - if (m_blupiAction != 1) - { - m_blupiAction = 1; - m_blupiPhase = 0; - } - m_blupiVitesseY = 0.0; - } - } - rect = BlupiRect(tinyPoint3); - rect.top = tinyPoint3.y + 60 - 2; - rect.bottom = tinyPoint3.y + 60 + OVERHEIGHT - 1; - bool flag7 = !DecorDetect(rect); - 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) - { - m_blupiVitesseY = -5.0; - } - else if (m_blupiVitesseY > -5.0) - { - m_blupiVitesseY -= 1.0; - } - } - else if (m_blupiSpeedY > 0.0) - { - if (m_blupiVitesseY < 12.0) - { - m_blupiVitesseY += 5.0; - } - } - else if (m_blupiVitesseY < 12.0 && m_time % 2 == 0) - { - m_blupiVitesseY += 1.0; - } - tinyPoint3.y += (int)m_blupiVitesseY; - if (m_blupiSpeedX < 0.0 && flag4) - { - int num9 = (int)(m_blupiSpeedX * 12.0); - if (m_blupiVitesseX > (double)num9) - { - m_blupiVitesseX -= 1.0; - } - tinyPoint.x = tinyPoint3.x + (int)m_blupiVitesseX; - tinyPoint.y = tinyPoint3.y; - if (BlupiBloque(tinyPoint, -1)) - { - m_blupiVitesseX = 0.0; - } - } - else if (m_blupiSpeedX > 0.0 && flag4) - { - int num10 = (int)(m_blupiSpeedX * 12.0); - if (m_blupiVitesseX < (double)num10) - { - m_blupiVitesseX += 1.0; - } - tinyPoint.x = tinyPoint3.x + (int)m_blupiVitesseX; - tinyPoint.y = tinyPoint3.y; - if (BlupiBloque(tinyPoint, 1)) - { - m_blupiVitesseX = 0.0; - } - } - else - { - if (m_blupiVitesseX > 0.0) - { - m_blupiVitesseX -= 1.0; - } - if (m_blupiVitesseX < 0.0) - { - m_blupiVitesseX += 1.0; - } - } - tinyPoint3.x += (int)m_blupiVitesseX; - MoveObjectPollution(); - if (ButtonPressed == 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; - 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; - flag3 = !DecorDetect(rect); - if (!flag2 && !flag3) - { - tinyPoint.x = m_blupiPos.x; - tinyPoint.y = m_blupiPos.y - BLUPIFLOOR; - ObjectStart(tinyPoint, 46, 0); - m_blupiOver = false; - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiPosHelico = m_blupiPos; - m_blupiFocus = true; - StopSound(16); - StopSound(18); - PlaySound(17, m_blupiPos); - } - } - } - if (m_blupiBalloon && m_blupiFocus) - { - if (m_blupiSpeedY < 0.0 || (m_keyPress & 1) != 0) - { - if (m_blupiVitesseY > -5.0 && m_time % 6 == 0) - { - m_blupiVitesseY -= 1.0; - } - } - else if (m_blupiSpeedY > 0.0) - { - if (m_blupiVitesseY < 0.0 && m_time % 6 == 0) - { - m_blupiVitesseY += 1.0; - } - } - else if (m_blupiVitesseY > -3.0 && m_time % 6 == 0) - { - m_blupiVitesseY -= 1.0; - } - tinyPoint3.y += (int)m_blupiVitesseY; - if (m_blupiSpeedX < 0.0) - { - int num11 = (int)(m_blupiSpeedX * 10.0); - if (m_blupiVitesseX > (double)num11) - { - m_blupiVitesseX -= 1.0; - } - tinyPoint.x = tinyPoint3.x + (int)m_blupiVitesseX; - tinyPoint.y = tinyPoint3.y; - if (BlupiBloque(tinyPoint, -1)) - { - m_blupiVitesseX = 0.0; - } - } - else if (m_blupiSpeedX > 0.0) - { - int num12 = (int)(m_blupiSpeedX * 10.0); - if (m_blupiVitesseX < (double)num12) - { - m_blupiVitesseX += 1.0; - } - tinyPoint.x = tinyPoint3.x + (int)m_blupiVitesseX; - tinyPoint.y = tinyPoint3.y; - if (BlupiBloque(tinyPoint, 1)) - { - m_blupiVitesseX = 0.0; - } - } - else - { - if (m_blupiVitesseX > 0.0) - { - m_blupiVitesseX -= 2.0; - if (m_blupiVitesseX < 0.0) - { - m_blupiVitesseX = 0.0; - } - } - if (m_blupiVitesseX < 0.0) - { - m_blupiVitesseX += 2.0; - if (m_blupiVitesseX > 0.0) - { - m_blupiVitesseX = 0.0; - } - } - } - tinyPoint3.x += (int)m_blupiVitesseX; - } - if (m_blupiEcrase && m_blupiFocus) - { - if (flag4) - { - if (m_blupiVitesseY < 2.0) - { - m_blupiVitesseY += 1.0; - } - } - else - { - m_blupiVitesseY = 0.0; - } - tinyPoint3.y += (int)m_blupiVitesseY; - if (flag4) - { - num3 = 7; - } - else - { - num3 = 4; - } - num3 = (int)((double)num3 * m_blupiSpeedX); - if (m_blupiSpeedX < 0.0) - { - if (m_blupiVitesseX > (double)num3) - { - m_blupiVitesseX -= 1.0; - } - tinyPoint.x = tinyPoint3.x + (int)m_blupiVitesseX; - tinyPoint.y = tinyPoint3.y; - if (BlupiBloque(tinyPoint, -1)) - { - m_blupiVitesseX = 0.0; - } - } - else if (m_blupiSpeedX > 0.0) - { - if (m_blupiVitesseX < (double)num3) - { - m_blupiVitesseX += 1.0; - } - tinyPoint.x = tinyPoint3.x + (int)m_blupiVitesseX; - tinyPoint.y = tinyPoint3.y; - if (BlupiBloque(tinyPoint, 1)) - { - m_blupiVitesseX = 0.0; - } - } - else - { - if (m_blupiVitesseX > 0.0) - { - m_blupiVitesseX -= 2.0; - if (m_blupiVitesseX < 0.0) - { - m_blupiVitesseX = 0.0; - } - } - if (m_blupiVitesseX < 0.0) - { - m_blupiVitesseX += 2.0; - if (m_blupiVitesseX > 0.0) - { - m_blupiVitesseX = 0.0; - } - } - } - if (m_blupiVitesseX == 0.0 && !flag4) - { - m_blupiAction = 1; - m_blupiPhase = 0; - } - tinyPoint3.x += (int)m_blupiVitesseX; - } - if (m_blupiJeep && m_blupiFocus) - { - if (m_blupiVitesseX == 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; - bool flag8 = !DecorDetect(rect); - rect.left += 40; - rect.right += 40; - bool flag9 = !DecorDetect(rect); - if (flag4) - { - if (m_blupiVitesseY < 50.0) - { - m_blupiVitesseY += 5.0; - } - } - else - { - if (m_blupiVitesseY != 0.0) - { - PlaySound(3, m_blupiPos); - } - m_blupiVitesseY = 0.0; - } - tinyPoint3.y += (int)m_blupiVitesseY; - 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; - num = AscenseurDetect(rect, m_blupiPos, tinyPoint3); - if (m_blupiVitesseY >= 0.0 && num != -1) - { - m_blupiTransport = num; - flag4 = false; - PlaySound(3, tinyPoint3); - tinyPoint3.y = m_moveObject[num]->posCurrent.y - 64 + BLUPIOFFY; - } - } - if (flag8 && !flag9) - { - int num13 = -20; - if (m_blupiVitesseX > (double)num13) - { - m_blupiVitesseX -= 1.0; - } - } - else if (!flag8 && flag9) - { - int num14 = 20; - if (m_blupiVitesseX < (double)num14) - { - m_blupiVitesseX += 1.0; - } - } - else if (m_blupiSpeedX < 0.0) - { - int num15 = (int)(m_blupiSpeedX * 20.0); - if (m_blupiVitesseX > (double)num15) - { - m_blupiVitesseX -= 1.0; - } - } - else if (m_blupiSpeedX > 0.0) - { - int num16 = (int)(m_blupiSpeedX * 20.0); - if (m_blupiVitesseX < (double)num16) - { - m_blupiVitesseX += 1.0; - } - } - else - { - if (m_blupiVitesseX > 0.0) - { - m_blupiVitesseX -= 2.0; - if (m_blupiVitesseX < 0.0) - { - m_blupiVitesseX = 0.0; - } - } - if (m_blupiVitesseX < 0.0) - { - m_blupiVitesseX += 2.0; - if (m_blupiVitesseX > 0.0) - { - m_blupiVitesseX = 0.0; - } - } - } - if (m_blupiAction == 3) - { - m_blupiVitesseX = 0.0; - } - tinyPoint3.x += (int)m_blupiVitesseX; - if (flag8 && !flag9) - { - m_blupiRealRotation = Approch(m_blupiRealRotation, -45, 5); - } - else if (!flag8 && flag9) - { - m_blupiRealRotation = Approch(m_blupiRealRotation, 45, 5); - } - else if (!flag4) - { - m_blupiRealRotation = 0; - } - m_blupiOffsetY = abs(m_blupiRealRotation / 2); - MoveObjectPollution(); - if (ButtonPressed == ButtonGlygh.PlayAction && !flag4 && m_blupiTransport == -1) - { - ButtonPressed = ButtonGlygh.None; - tinyPoint.x = m_blupiPos.x; - tinyPoint.y = m_blupiPos.y - BLUPIFLOOR; - ObjectStart(tinyPoint, 19, 0); - m_blupiJeep = false; - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiPosHelico = m_blupiPos; - StopSound(29); - StopSound(31); - PlaySound(30, m_blupiPos); - } - } - if (m_blupiTank && m_blupiFocus) - { - if (m_blupiAction == 53 && m_blupiPhase == 6) - { - m_blupiAction = 1; - m_blupiPhase = 0; - } - if ((m_keyPress & 2) != 0 && m_blupiTimeFire == 0 && m_blupiAction != 3) - { - if (m_blupiBullet == 0) - { - PlaySound(53, m_blupiPos); - } - else - { - if (m_blupiDir == 1) - { - tinyPoint.x = m_blupiPos.x - 35; - tinyPoint.y = m_blupiPos.y; - num4 = -5; - m_blupiVitesseX += 12.0; - } - else - { - tinyPoint.x = m_blupiPos.x + 35; - tinyPoint.y = m_blupiPos.y; - num4 = 5; - m_blupiVitesseX -= 12.0; - } - if (ObjectStart(tinyPoint, 23, num4) != -1) - { - m_blupiAction = 53; - m_blupiPhase = 0; - PlaySound(52, m_blupiPos); - m_blupiTimeFire = 10; - m_blupiBullet--; - } - } - } - if (m_blupiVitesseX == 0.0 && m_blupiAction == 2) - { - m_blupiAction = 1; - m_blupiPhase = 0; - } - m_blupiMotorHigh = (m_blupiAction != 1); - if (flag4) - { - if (m_blupiVitesseY < 50.0) - { - m_blupiVitesseY += 5.0; - } - } - else - { - if (m_blupiVitesseY != 0.0) - { - PlaySound(3, m_blupiPos); - } - m_blupiVitesseY = 0.0; - } - tinyPoint3.y += (int)m_blupiVitesseY; - 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; - num = AscenseurDetect(rect, m_blupiPos, tinyPoint3); - if (m_blupiVitesseY >= 0.0 && num != -1) - { - m_blupiTransport = num; - flag4 = false; - PlaySound(3, tinyPoint3); - 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) - { - m_blupiVitesseX -= 1.0; - } - } - else if (m_blupiSpeedX > 0.0) - { - int num18 = (int)(m_blupiSpeedX * 12.0); - if (m_blupiVitesseX < (double)num18) - { - m_blupiVitesseX += 1.0; - } - } - else - { - if (m_blupiVitesseX > 0.0) - { - m_blupiVitesseX -= 3.0; - if (m_blupiVitesseX < 0.0) - { - m_blupiVitesseX = 0.0; - } - } - if (m_blupiVitesseX < 0.0) - { - m_blupiVitesseX += 3.0; - if (m_blupiVitesseX > 0.0) - { - m_blupiVitesseX = 0.0; - } - } - } - if (m_blupiAction == 3) - { - m_blupiVitesseX = 0.0; - } - tinyPoint3.x += (int)m_blupiVitesseX; - MoveObjectPollution(); - if (ButtonPressed == ButtonGlygh.PlayAction && !flag4 && m_blupiTransport == -1) - { - ButtonPressed = ButtonGlygh.None; - tinyPoint.x = m_blupiPos.x; - tinyPoint.y = m_blupiPos.y; - ObjectStart(tinyPoint, 28, 0); - m_blupiTank = false; - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiPosHelico = m_blupiPos; - StopSound(29); - StopSound(31); - PlaySound(30, m_blupiPos); - } - } - if (m_blupiSkate && m_blupiFocus) - { - if (m_blupiVitesseX == 0.0 && m_blupiAction == 2) - { - m_blupiAction = 1; - m_blupiPhase = 0; - } - if (m_blupiSpeedX < 0.0) - { - int num19 = (int)(m_blupiSpeedX * 15.0); - if (m_blupiVitesseX > (double)num19) - { - m_blupiVitesseX -= 1.0; - } - } - else if (m_blupiSpeedX > 0.0) - { - int num20 = (int)(m_blupiSpeedX * 15.0); - if (m_blupiVitesseX < (double)num20) - { - m_blupiVitesseX += 1.0; - } - } - else - { - if (m_blupiVitesseX > 0.0) - { - m_blupiVitesseX -= 1.0; - if (m_blupiVitesseX < 0.0) - { - m_blupiVitesseX = 0.0; - } - } - if (m_blupiVitesseX < 0.0) - { - m_blupiVitesseX += 1.0; - if (m_blupiVitesseX > 0.0) - { - m_blupiVitesseX = 0.0; - } - } - } - if (m_blupiAction == 3) - { - m_blupiVitesseX = 0.0; - } - tinyPoint3.x += (int)m_blupiVitesseX; - if (ButtonPressed == ButtonGlygh.PlayAction && !flag4 && !m_blupiAir && m_blupiTransport == -1 && m_blupiVitesseX < 8.0) - { - ButtonPressed = Def.ButtonGlygh.None; - m_blupiSkate = false; - m_blupiAction = 43; - m_blupiPhase = 0; - m_blupiFocus = false; - m_blupiPosHelico = m_blupiPos; - } - } - if (m_blupiAction == 42) - { - if (m_blupiPhase == 8) - { - num = MoveObjectDetect(m_blupiPos, flag6); - if (num != -1) - { - ObjectDelete(m_moveObject[num]->posCurrent, m_moveObject[num]->type); - } - } - if (m_blupiPhase == 20) - { - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiFocus = true; - } - } - if (m_blupiAction == 43) - { - if (m_blupiPhase == 12) - { - tinyPoint.x = m_blupiPos.x; - tinyPoint.y = m_blupiPos.y - BLUPIFLOOR + 1; - ObjectStart(tinyPoint, 24, 0); - } - if (m_blupiPhase == 20) - { - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiFocus = true; - } - } - if (m_blupiNage && m_blupiFocus) - { - if (m_blupiTransport == -1) - { - if (m_blupiSpeedY < 0.0 || (m_keyPress & 1) != 0) - { - if (m_blupiVitesseY > -5.0) - { - m_blupiVitesseY -= 1.0; - } - } - else if (m_blupiSpeedY > 0.0) - { - if (m_blupiVitesseY < 5.0) - { - m_blupiVitesseY += 1.0; - } - } - else - { - if (m_blupiAction == 1) - { - num3 = -1; - } - else - { - num3 = 0; - } - if (m_blupiVitesseY > (double)num3) - { - m_blupiVitesseY -= 1.0; - } - if (m_blupiVitesseY < (double)num3) - { - m_blupiVitesseY += 1.0; - } - } - tinyPoint3.y += (int)m_blupiVitesseY; - } - if (m_blupiSpeedX < 0.0) - { - int num21 = (int)(m_blupiSpeedX * 8.0); - if (m_blupiVitesseX > (double)num21) - { - m_blupiVitesseX -= 1.0; - } - } - else if (m_blupiSpeedX > 0.0) - { - int num22 = (int)(m_blupiSpeedX * 8.0); - if (m_blupiVitesseX < (double)num22) - { - m_blupiVitesseX += 1.0; - } - } - else - { - if (m_blupiVitesseX > 0.0) - { - m_blupiVitesseX -= 2.0; - if (m_blupiVitesseX < 0.0) - { - m_blupiVitesseX = 0.0; - } - } - if (m_blupiVitesseX < 0.0) - { - m_blupiVitesseX += 2.0; - if (m_blupiVitesseX > 0.0) - { - m_blupiVitesseX = 0.0; - } - } - } - num = table_vitesse_nage[m_blupiPhase % 14 / 2]; - tinyPoint3.x += (int)(m_blupiVitesseX * (double)num / 7.0); - if (m_time % 70 == 0 || m_time % 70 == 28) - { - MoveObjectBlup(tinyPoint3); - } - if (m_time % 5 == 0) - { - if (!m_blupiShield && !m_blupiHide && !m_bSuperBlupi) - { - m_blupiLevel--; - } - if (m_blupiLevel == 25) - { - m_jauges[0].SetMode(1); - } - m_jauges[0].SetLevel(m_blupiLevel); - if (m_blupiLevel == 0) - { - m_blupiAction = 24; - m_blupiPhase = 0; - m_blupiFocus = false; - m_blupiHelico = false; - m_blupiOver = false; - m_blupiJeep = false; - m_blupiTank = false; - m_blupiSkate = false; - m_blupiNage = false; - m_blupiSurf = false; - m_blupiSuspend = false; - m_blupiJumpAie = false; - m_blupiShield = false; - m_blupiPower = false; - m_blupiCloud = false; - m_blupiHide = false; - m_blupiInvert = false; - m_blupiBalloon = false; - m_blupiEcrase = false; - m_blupiAir = false; - m_blupiRestart = true; - m_blupiActionOuf = 0; - m_jauges[0].SetHide(true); - m_jauges[1].SetHide(true); - PlaySound(26, tinyPoint3); - } - } - } - if (m_blupiSurf && m_blupiFocus) - { - if (m_blupiTransport == -1) - { - if (m_blupiSpeedY < 0.0 || (m_keyPress & 1) != 0) - { - if (m_blupiVitesseY > -5.0) - { - m_blupiVitesseY -= 1.0; - } - } - else if (m_blupiSpeedY > 0.0) - { - if (m_blupiVitesseY < 5.0) - { - m_blupiVitesseY += 1.0; - } - } - else - { - if (m_blupiVitesseY > -2.0) - { - m_blupiVitesseY -= 1.0; - } - if (m_blupiVitesseY < -2.0) - { - m_blupiVitesseY += 1.0; - } - } - tinyPoint3.y += (int)m_blupiVitesseY; - tinyPoint3.y += BLUPISURF; - if (tinyPoint3.y % 64 > 30) - { - tinyPoint3.y += 64 - tinyPoint3.y % 64; - } - tinyPoint3.y -= BLUPISURF; - } - if (m_blupiSpeedX < 0.0) - { - int num23 = (int)(m_blupiSpeedX * 8.0); - if (m_blupiVitesseX > (double)num23) - { - m_blupiVitesseX -= 1.0; - } - } - else if (m_blupiSpeedX > 0.0) - { - int num24 = (int)(m_blupiSpeedX * 8.0); - if (m_blupiVitesseX < (double)num24) - { - m_blupiVitesseX += 1.0; - } - } - else - { - if (m_blupiVitesseX > 0.0) - { - m_blupiVitesseX -= 2.0; - if (m_blupiVitesseX < 0.0) - { - m_blupiVitesseX = 0.0; - } - } - if (m_blupiVitesseX < 0.0) - { - m_blupiVitesseX += 2.0; - if (m_blupiVitesseX > 0.0) - { - m_blupiVitesseX = 0.0; - } - } - } - num = table_vitesse_surf[m_blupiPhase % 12 / 2]; - tinyPoint3.x += (int)(m_blupiVitesseX * (double)num / 10.0); - } - POINT tinyPoint4; - if (m_blupiSuspend && m_blupiFocus) - { - if (m_blupiSpeedX < 0.0 && m_blupiAction == 2) - { - int num25 = (int)(m_blupiSpeedX * 5.0); - tinyPoint3.x += num25; - } - if (m_blupiSpeedX > 0.0 && m_blupiAction == 2) - { - int num26 = (int)(m_blupiSpeedX * 5.0); - tinyPoint3.x += num26; - } - num = GetTypeBarre(tinyPoint3); - if (num == 2) - { - tinyPoint4.x = tinyPoint3.x; - tinyPoint4.y = tinyPoint3.y / 64 * 64 + BLUPIOFFY; - rect = BlupiRect(tinyPoint4); - if (!DecorDetect(rect, true)) - { - m_blupiSuspend = false; - m_blupiAction = 1; - m_blupiPhase = 0; - tinyPoint3 = tinyPoint4; - m_blupiPos = tinyPoint3; - } - } - if ((m_blupiSpeedY > 0.0 && m_blupiPhase > 5) || num == 0) - { - m_blupiSuspend = false; - m_blupiAir = true; - m_blupiAction = 5; - tinyPoint3.y = tinyPoint3.y; - m_blupiVitesseY = 0.0; - m_blupiNoBarre = 5; - m_blupiActionOuf = 65; - m_blupiTimeOuf = 0; - } - if (((m_keyPress & 1) != 0 || m_blupiSpeedY < 0.0) && m_blupiAction != 4 && m_blupiAction != 3) - { - m_blupiAction = 4; - m_blupiPhase = 0; - } - if ((m_keyPress & 1) == 0 && m_blupiSpeedY == 0.0 && m_blupiAction == 4) - { - m_blupiAction = 1; - m_blupiPhase = 0; - } - if (m_blupiAction == 4 && m_blupiPhase == 10) - { - m_blupiSuspend = false; - m_blupiAir = true; - m_blupiAction = 5; - m_blupiPhase = 0; - tinyPoint3.y -= 2; - m_blupiVitesseY = -11.0; - m_blupiNoBarre = 5; - PlaySound(35, tinyPoint3); - } - } - if (ButtonPressed == ButtonGlygh.PlayAction && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiTank && !m_blupiJeep && !m_blupiSkate && !flag4 && m_blupiTransport == -1 && m_blupiFocus) - { - 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; - 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; - flag3 = !DecorDetect(rect); - if (!flag2 && !flag3 && ObjectStart(tinyPoint3, 56, 0) != -1) - { - m_blupiAction = 87; - m_blupiPhase = 0; - m_blupiFocus = false; - PlaySound(61, tinyPoint3); - m_blupiDynamite--; - } - } - else if (m_blupiPerso > 0) - { - ButtonPressed = ButtonGlygh.None; - num = MoveObjectDetect(tinyPoint3, 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; - 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; - flag3 = !DecorDetect(rect); - num = MoveChargeDetect(tinyPoint3); - if (num == -1 && !flag2 && !flag3 && ObjectStart(tinyPoint3, 200, 0) != -1) - { - m_blupiAction = 46; - m_blupiPhase = 0; - m_blupiFocus = false; - PlaySound(61, tinyPoint3); - m_blupiPerso--; - } - } - if (m_blupiFocus) - { - m_blupiAction = 47; - m_blupiPhase = 0; - PlaySound(27, tinyPoint3); - } - } - } - rect = BlupiRect(m_blupiPos); - tinyPoint4 = tinyPoint3; - TestPath(rect, m_blupiPos, tinyPoint3); - if (flag && m_blupiPos.x == tinyPoint3.x && m_blupiPos.x != tinyPoint4.x) - { - tinyPoint3.y = tinyPoint4.y; - TestPath(rect, m_blupiPos, tinyPoint3); - } - if (m_blupiVent && m_blupiPos.y == tinyPoint3.y && m_blupiPos.y != tinyPoint4.y) - { - tinyPoint3.x = tinyPoint4.x; - TestPath(rect, m_blupiPos, tinyPoint3); - } - if (m_blupiTransport != -1 && m_blupiPos.x == tinyPoint3.x && m_blupiPos.x != tinyPoint4.x) - { - tinyPoint3.y = tinyPoint4.y; - TestPath(rect, m_blupiPos, 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) - { - tinyPoint3.y = tinyPoint4.y; - TestPath(rect, m_blupiPos, tinyPoint3); - } - else if (m_blupiPos.y == tinyPoint3.y && m_blupiPos.y != tinyPoint4.y) - { - tinyPoint3.x = tinyPoint4.x; - TestPath(rect, m_blupiPos, tinyPoint3); - } - } - POINT blupiPos = m_blupiPos; - m_blupiPos = tinyPoint3; - if ((m_blupiAction == 1 || m_blupiAction == 60 || m_blupiAction == 7 || m_blupiAction == 6) && !m_blupiAir && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus) - { - if (m_blupiTransport != -1) - { - AscenseurVertigo(m_blupiTransport, flag2, flag3); - } - else - { - 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; - flag3 = !DecorDetect(rect); - } - if (m_blupiDir == 1 && flag2 && !flag3) - { - if (m_blupiHelico || m_blupiOver || AscenseurShift(m_blupiTransport)) - { - m_blupiAction = 9; - m_blupiPhase = 0; - } - else - { - PlaySound(6, tinyPoint3); - m_blupiAction = 8; - m_blupiPhase = 0; - } - } - if (m_blupiDir == 2 && !flag2 && flag3) - { - if (m_blupiHelico || m_blupiOver || AscenseurShift(m_blupiTransport)) - { - m_blupiAction = 9; - m_blupiPhase = 0; - } - else - { - PlaySound(6, tinyPoint3); - m_blupiAction = 8; - m_blupiPhase = 0; - } - } - if (m_blupiAction != 8 && m_blupiAction != 10 && m_blupiAction != 9 && (flag2 || flag3)) - { - if (!m_blupiHelico && !m_blupiOver) - { - PlaySound(6, tinyPoint3); - } - m_blupiAction = 10; - m_blupiPhase = 0; - } - } - if (m_blupiAction == 1 && m_blupiJeep && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus) - { - if (m_blupiTransport != -1) - { - AscenseurVertigo(m_blupiTransport, flag2, flag3); - } - else - { - 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; - flag3 = !DecorDetect(rect); - } - if (flag2 && !flag3) - { - m_blupiAction = 10; - m_blupiPhase = 0; - } - if (flag3 && !flag2) - { - m_blupiAction = 10; - m_blupiPhase = 0; - } - } - if (m_blupiAction == 1 && m_blupiTank && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus) - { - if (m_blupiTransport != -1) - { - AscenseurVertigo(m_blupiTransport, flag2, flag3); - } - else - { - 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; - flag3 = !DecorDetect(rect); - } - if (flag2 && !flag3) - { - m_blupiAction = 10; - m_blupiPhase = 0; - } - if (flag3 && !flag2) - { - m_blupiAction = 10; - m_blupiPhase = 0; - } - } - if (m_blupiAction == 1 && m_blupiSkate && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus) - { - if (m_blupiTransport != -1) - { - AscenseurVertigo(m_blupiTransport, flag2, flag3); - } - else - { - 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; - flag3 = !DecorDetect(rect); - } - if (flag2 && !flag3) - { - m_blupiAction = 10; - m_blupiPhase = 0; - } - if (flag3 && !flag2) - { - m_blupiAction = 10; - m_blupiPhase = 0; - } - } - if (m_blupiFocus) - { - if (m_blupiAction == 8 && m_blupiPhase == 16) - { - m_blupiAction = 9; - m_blupiPhase = 0; - } - if (m_blupiAction == 9 && m_blupiPhase == 3) - { - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiActionOuf = 0; - } - num3 = 5; - if (m_blupiJeep) - { - num3 = 10; - } - if (m_blupiTank) - { - num3 = 10; - } - if (m_blupiSkate) - { - num3 = 10; - } - if (m_blupiAction == 10 && m_blupiPhase == num3) - { - m_blupiAction = 1; - m_blupiPhase = 0; - } - } - BlupiSearchIcon(); - if (m_blupiShield) - { - if (m_blupiTimeShield == 10) - { - PlaySound(43, m_blupiPos); - } - if (m_blupiTimeShield == 0) - { - m_blupiShield = false; - m_jauges[1].SetHide(true); - } - else if (m_time % 5 == 0) - { - m_blupiTimeShield--; - m_jauges[1].SetLevel(m_blupiTimeShield); - } - } - if (m_blupiPower) - { - if (m_blupiTimeShield == 20) - { - PlaySound(45, m_blupiPos); - } - if (m_blupiTimeShield == 0) - { - m_blupiPower = false; - m_jauges[1].SetHide(true); - } - else if (m_time % 3 == 0) - { - m_blupiTimeShield--; - m_jauges[1].SetLevel(m_blupiTimeShield); - } - } - if (m_blupiCloud) - { - if (m_blupiTimeShield == 25) - { - PlaySound(56, m_blupiPos); - } - if (m_blupiTimeShield == 0) - { - m_blupiCloud = false; - m_jauges[1].SetHide(true); - } - else if (m_time % 4 == 0) - { - m_blupiTimeShield--; - m_jauges[1].SetLevel(m_blupiTimeShield); - } - } - if (m_blupiHide) - { - if (m_blupiTimeShield == 20) - { - PlaySound(63, m_blupiPos); - } - if (m_blupiTimeShield == 0) - { - m_blupiHide = false; - m_jauges[1].SetHide(true); - } - else if (m_time % 4 == 0) - { - m_blupiTimeShield--; - m_jauges[1].SetLevel(m_blupiTimeShield); - } - } - if (m_blupiInvert) - { - if (m_blupiTimeShield == 0) - { - m_blupiInvert = false; - m_jauges[1].SetHide(true); - 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; - ObjectStart(tinyPoint, 42, 60); - 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; - ObjectStart(tinyPoint, 42, -10); - PlaySound(67, tinyPoint3); - } - else if (m_time % 3 == 0) - { - m_blupiTimeShield--; - m_jauges[1].SetLevel(m_blupiTimeShield); - } - } - if (m_blupiBalloon) - { - if (m_blupiTimeShield == 0) - { - m_blupiBalloon = false; - m_jauges[1].SetHide(true); - tinyPoint.x = m_blupiPos.x - 34; - tinyPoint.y = m_blupiPos.y - 34; - ObjectStart(tinyPoint, 91, 0); - PlaySound(41, m_blupiPos); - } - else if (m_time % 2 == 0) - { - m_blupiTimeShield--; - m_jauges[1].SetLevel(m_blupiTimeShield); - } - } - if (m_blupiEcrase) - { - if (m_blupiTimeShield == 0) - { - m_blupiEcrase = false; - m_blupiAir = true; - m_jauges[1].SetHide(true); - ObjectStart(m_blupiPos, 41, -60); - 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; - ObjectStart(tinyPoint, 90, 0); - PlaySound(41, m_blupiPos); - } - else if (m_time % 2 == 0) - { - m_blupiTimeShield--; - m_jauges[1].SetLevel(m_blupiTimeShield); - } - } - if (m_blupiPower && abs(m_blupiPos.x - m_blupiPosMagic.x) + abs(m_blupiPos.y - m_blupiPosMagic.y) >= 40) - { - num = MoveObjectFree(); - if (num != -1) - { - m_moveObject[num]->type = 27; - m_moveObject[num]->phase = 0; - m_moveObject[num]->posCurrent = m_blupiPos; - m_moveObject[num]->posStart = m_moveObject[num]->posCurrent; - m_moveObject[num]->posEnd = m_moveObject[num]->posCurrent; - m_moveObject[num]->step = 1; - m_moveObject[num]->time = 0; - MoveObjectStepIcon(num); - m_blupiPosMagic = m_blupiPos; - } - } - if (m_blupiShield && abs(m_blupiPos.x - m_blupiPosMagic.x) + abs(m_blupiPos.y - m_blupiPosMagic.y) >= 40) - { - num = MoveObjectFree(); - if (num != -1) - { - m_moveObject[num]->type = 57; - m_moveObject[num]->phase = 0; - m_moveObject[num]->posCurrent = m_blupiPos; - m_moveObject[num]->posStart = m_moveObject[num]->posCurrent; - m_moveObject[num]->posEnd = m_moveObject[num]->posCurrent; - m_moveObject[num]->step = 1; - m_moveObject[num]->time = 0; - MoveObjectStepIcon(num); - m_blupiPosMagic = m_blupiPos; - } - } - if (m_blupiHide && abs(m_blupiPos.x - m_blupiPosMagic.x) + abs(m_blupiPos.y - m_blupiPosMagic.y) >= 10) - { - num = MoveObjectFree(); - if (num != -1) - { - m_moveObject[num]->type = 58; - m_moveObject[num]->icon = m_blupiIcon; - m_moveObject[num]->channel = 2; - m_moveObject[num]->phase = 0; - m_moveObject[num]->posCurrent = m_blupiPos; - m_moveObject[num]->posStart = m_moveObject[num]->posCurrent; - m_moveObject[num]->posEnd = m_moveObject[num]->posCurrent; - m_moveObject[num]->step = 1; - m_moveObject[num]->time = 0; - MoveObjectStepIcon(num); - m_blupiPosMagic = m_blupiPos; - } - } - if (m_blupiTimeNoAsc > 0) - { - m_blupiTimeNoAsc--; - } - 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; - 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; - ObjectStart(tinyPoint, 9, 0); - m_decorAction = 1; - m_decorPhase = 0; - StopSound(16); - StopSound(18); - StopSound(29); - StopSound(31); - PlaySound(10, m_blupiPos); - } - } - if (!m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && m_blupiFocus) - { - if (!m_blupiNage && !m_blupiSurf && IsSurfWater(m_blupiPos)) - { - 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; - MoveObjectPlouf(m_blupiPos); - if (m_blupiTransport != -1) - { - m_blupiPos.y = m_blupiPos.y - 10; - m_blupiTransport = -1; - } - if (m_blupiCloud) - { - m_blupiCloud = false; - m_jauges[1].SetHide(true); - } - } - if (!m_blupiNage && !IsSurfWater(m_blupiPos) && IsDeepWater(m_blupiPos)) - { - if (!m_blupiSurf) - { - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiVitesseX = 0.0; - m_blupiVitesseY = 0.0; - MoveObjectPlouf(m_blupiPos); - } - m_blupiAir = false; - m_blupiSurf = false; - m_blupiNage = true; - m_blupiLevel = 100; - m_jauges[0].SetLevel(m_blupiLevel); - m_jauges[0].SetMode(2); - m_jauges[0].SetHide(false); - } - if (m_blupiNage && IsSurfWater(m_blupiPos)) - { - m_blupiAir = false; - m_blupiNage = false; - m_blupiSurf = true; - 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 - 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; - if (m_blupiPower) - { - m_blupiVitesseY = -16.0; - } - else - { - m_blupiVitesseY = -12.0; - } - MoveObjectTiplouf(m_blupiPos); - PlaySound(22, m_blupiPos); - m_jauges[0].SetHide(true); - } - if ((m_blupiSurf || m_blupiNage) && IsOutWater(m_blupiPos)) - { - if (m_blupiVitesseY < 0.0) - { - if (m_blupiTransport == -1) - { - m_blupiPos = blupiPos; - } - else - { - m_blupiTransport = -1; - m_blupiNage = false; - m_blupiSurf = false; - m_blupiAir = true; - m_blupiAction = 5; - m_blupiPhase = 0; - m_blupiPos.y = m_blupiPos.y - 10; - m_blupiVitesseX = 0.0; - m_blupiVitesseY = -10.0; - PlaySound(22, m_blupiPos); - m_jauges[0].SetHide(true); - } - } - else if (m_blupiVitesseY > 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; - PlaySound(22, m_blupiPos); - m_jauges[0].SetHide(true); - } - else - { - m_blupiNage = false; - m_blupiSurf = false; - m_blupiAir = false; - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiPos.y = m_blupiPos.y - 10; - m_blupiVitesseX = 0.0; - m_blupiVitesseY = 0.0; - PlaySound(22, m_blupiPos); - m_jauges[0].SetHide(true); - } - } - if ((m_blupiSurf || m_blupiNage) && m_blupiActionOuf != 44) - { - m_blupiActionOuf = 44; - m_blupiTimeOuf = 0; - } - } - if ((m_blupiHelico || m_blupiOver || m_blupiJeep || m_blupiTank || m_blupiSkate) && m_blupiFocus && (IsSurfWater(m_blupiPos) || IsDeepWater(m_blupiPos))) - { - ByeByeHelico(); - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiHelico = false; - m_blupiOver = false; - m_blupiJeep = false; - m_blupiTank = false; - m_blupiSkate = false; - tinyPoint.x = m_blupiPos.x - 34; - tinyPoint.y = m_blupiPos.y - 34; - ObjectStart(tinyPoint, 9, 0); - m_decorAction = 1; - m_decorPhase = 0; - StopSound(16); - StopSound(18); - StopSound(29); - StopSound(31); - PlaySound(10, m_blupiPos); - } - 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 + BLUPISUSPEND; - rect = BlupiRect(tinyPoint4); - if (!DecorDetect(rect, true)) - { - m_blupiPos = tinyPoint4; - m_blupiSuspend = true; - m_blupiAir = false; - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiActionOuf = 0; - PlaySound(34, m_blupiPos); - } - } - if (m_blupiNoBarre > 0) - { - m_blupiNoBarre--; - } - if (IsVentillo(m_blupiPos)) - { - if (m_blupiFocus && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi) - { - BlupiDead(11, 75); - } - tinyPoint.x = m_blupiPos.x - 34; - tinyPoint.y = m_blupiPos.y - 34; - ObjectStart(tinyPoint, 11, 0); - m_decorAction = 2; - m_decorPhase = 0; - StopSound(16); - StopSound(18); - StopSound(29); - StopSound(31); - PlaySound(10, m_blupiPos); - } - if (m_blupiAction != 30 && m_blupiFocus) - { - num = IsWorld(m_blupiPos); - if (num != -1) - { - StopSound(16); - StopSound(18); - StopSound(29); - StopSound(31); - PlaySound(32, m_blupiPos); - m_blupiAction = 30; - m_blupiPhase = 0; - m_blupiFocus = false; - m_blupiFront = true; - } - } - int num27 = MoveObjectDetect(m_blupiPos, flag6); - POINT tinyPoint5; - if (m_blupiAction != 11 && m_blupiAction != 75 && m_blupiAction != 76 && m_blupiAction != 77 && m_blupiAction != 78 && m_blupiAction != 79 && m_blupiAction != 80 && m_blupiAction != 81) - { - if (IsLave(m_blupiPos) && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi) - { - BlupiDead(76, -1); - m_blupiRestart = true; - 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) - { - BlupiDead(54, -1); - m_blupiRestart = true; - m_blupiAir = true; - ObjectStart(m_blupiPos, 53, 0); - PlaySound(51, m_blupiPos); - } - if (IsGoutte(m_blupiPos, false) && !m_blupiOver && !m_blupiJeep && !m_blupiTank && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi && m_blupiFocus) - { - BlupiDead(54, -1); - m_blupiRestart = true; - m_blupiAir = true; - PlaySound(51, m_blupiPos); - } - if (IsScie(m_blupiPos) && !m_blupiOver && !m_blupiJeep && !m_blupiTank && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi && m_blupiFocus) - { - BlupiDead(77, -1); - m_blupiFront = true; - m_blupiRestart = true; - m_blupiAir = true; - } - if (ButtonPressed == ButtonGlygh.PlayAction && (num27 == -1 || !flag6) && IsSwitch(m_blupiPos, tinyPoint) && !m_blupiOver && !m_blupiBalloon && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi && m_blupiFocus) - { - ButtonPressed = ButtonGlygh.None; - 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; - } - 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 + 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_blupiEcrase = true; - m_blupiBalloon = false; - m_blupiAir = false; - m_blupiHelico = false; - m_blupiOver = false; - m_blupiJeep = false; - m_blupiTank = false; - m_blupiSkate = false; - m_blupiNage = false; - m_blupiSurf = false; - m_blupiSuspend = false; - m_blupiJumpAie = false; - m_blupiShield = false; - m_blupiPower = false; - m_blupiCloud = false; - m_blupiHide = false; - m_blupiTimeShield = 100; - m_blupiPosMagic = m_blupiPos; - m_jauges[1].SetHide(false); - if (!m_blupiJeep && !m_blupiTank) - { - StopSound(16); - StopSound(18); - StopSound(29); - StopSound(31); - } - PlaySound(70, m_blupiPos); - ObjectStart(m_blupiPos, 41, -60); - 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; - 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) - { - m_blupiAction = 74; - m_blupiPhase = 0; - m_blupiVitesseX = 0.0; - m_blupiVitesseY = 0.0; - m_blupiFocus = false; - m_blupiPos.x = m_blupiPos.x / 64 * 64; - PlaySound(71, m_blupiPos); - tinyPoint.x = m_blupiPos.x; - tinyPoint.y = m_blupiPos.y - 5; - ObjectStart(tinyPoint, 92, 0); - } - if (IsBridge(m_blupiPos, tinyPoint2) && m_blupiFocus) - { - tinyPoint2.x *= 64; - tinyPoint2.y *= 64; - ObjectStart(tinyPoint2, 52, 0); - } - int num2 = IsDoor(m_blupiPos, tinyPoint2); - if (num2 != -1 && (m_blupiCle & 1 << num2 - 334) != 0) - { - 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_pPixmap->MouseHotSpot(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) - { - num = MockeryDetect(m_blupiPos); - if (num != 0) - { - m_blupiActionOuf = num; - m_blupiTimeOuf = 0; - } - } - MoveObjectFollow(m_blupiPos); - num = num27; - if (num != -1 && !flag6 && m_moveObject[num]->type == 2 && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && !m_blupiShield && !m_bSuperBlupi && m_blupiFocus) - { - m_blupiActionOuf = 48; - m_blupiTimeOuf = 0; - } - if (num != -1 && flag6) - { - if (m_moveObject[num]->type == 13 && (ButtonPressed == ButtonGlygh.PlayAction || IsFloatingObject(num)) && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus) - { - ButtonPressed = ButtonGlygh.None; - ObjectDelete(m_moveObject[num]->posCurrent, m_moveObject[num]->type); - m_scrollAdd.x = 0; - m_scrollAdd.y = 0; - m_blupiAir = false; - m_blupiHelico = true; - m_blupiRealRotation = 0; - m_blupiVitesseX = 0.0; - if (m_blupiCloud || m_blupiHide) - { - m_blupiCloud = false; - m_blupiHide = false; - m_jauges[1].SetHide(true); - } - } - if (ButtonPressed == ButtonGlygh.PlayAction && m_moveObject[num]->type == 46 && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus) - { - ButtonPressed = ButtonGlygh.None; - ObjectDelete(m_moveObject[num]->posCurrent, m_moveObject[num]->type); - m_scrollAdd.x = 0; - m_scrollAdd.y = 0; - m_blupiAir = false; - m_blupiOver = true; - m_blupiVitesseX = 0.0; - if (m_blupiCloud || m_blupiHide) - { - m_blupiCloud = false; - m_blupiHide = false; - m_jauges[1].SetHide(true); - } - } - if (ButtonPressed == ButtonGlygh.PlayAction && m_moveObject[num]->type == 19 && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus) - { - ButtonPressed = ButtonGlygh.None; - ObjectDelete(m_moveObject[num]->posCurrent, m_moveObject[num]->type); - m_scrollAdd.x = 0; - m_scrollAdd.y = 0; - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiAir = false; - m_blupiJeep = true; - m_blupiVitesseX = 0.0; - if (m_blupiCloud || m_blupiHide) - { - m_blupiCloud = false; - m_blupiHide = false; - m_jauges[1].SetHide(true); - } - } - if (ButtonPressed == ButtonGlygh.PlayAction && m_moveObject[num]->type == 28 && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus) - { - ButtonPressed = ButtonGlygh.None; - ObjectDelete(m_moveObject[num]->posCurrent, m_moveObject[num]->type); - m_scrollAdd.x = 0; - m_scrollAdd.y = 0; - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiAir = false; - m_blupiTank = true; - m_blupiVitesseX = 0.0; - if (m_blupiCloud || m_blupiHide) - { - m_blupiCloud = false; - m_blupiHide = false; - m_jauges[1].SetHide(true); - } - } - 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_pPixmap->MouseHotSpot(tinyPoint), tinyPoint5, 177, 10); - m_blupiBullet += 10; - if (m_blupiBullet > 10) - { - m_blupiBullet = 10; - } - } - 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_blupiAction = 42; - m_blupiPhase = 0; - m_blupiPos.Y = m_moveObject[num].posCurrent.Y / 64 * 64 + Decor.BLUPIOFFY; - m_blupiFocus = false; - m_blupiAir = false; - m_blupiSkate = true; - m_blupiVitesseX = 0.0; - if (m_blupiCloud || m_blupiHide) - { - m_blupiCloud = false; - m_blupiHide = false; - 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) - { - 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; - ObjectStart(tinyPoint, 91, 0); - PlaySound(41, m_blupiPos); - m_blupiPos.Y = m_blupiPos.Y + 4; - m_blupiVitesseY = 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) - { - if (!m_blupiJeep && !m_blupiTank && !m_blupiSkate && (m_blupiFocus || m_blupiAction == 5 || m_blupiAction == 36)) - { - if (m_blupiHelico || m_blupiOver || m_blupiBalloon || m_blupiEcrase) - { - m_blupiAir = true; - } - BlupiDead(11, 75); - } - if (m_moveObject[num].type == 17 || m_moveObject[num].type == 20) - { - tinyPoint = m_moveObject[num].posCurrent; - ObjectDelete(tinyPoint, m_moveObject[num].type); - tinyPoint.X -= 34; - tinyPoint.Y -= 34; - ObjectStart(tinyPoint, 10, 0); - m_decorAction = 2; - m_decorPhase = 0; - } - else - { - tinyPoint = m_moveObject[num].posCurrent; - ObjectDelete(tinyPoint, m_moveObject[num].type); - tinyPoint.X -= 34; - tinyPoint.Y -= 34; - ObjectStart(tinyPoint, 8, 0); - m_decorAction = 1; - m_decorPhase = 0; - } - if (!m_blupiJeep && !m_blupiTank) - { - StopSound(16); - StopSound(18); - StopSound(29); - StopSound(31); - } - PlaySound(10, m_moveObject[num].posCurrent); - } - if (m_moveObject[num].type == 44 && m_blupiFocus && !m_blupiBalloon && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi) - { - ByeByeHelico(); - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiVitesseX = 0.0; - m_blupiVitesseY = 0.0; - m_blupiBalloon = true; - m_blupiEcrase = false; - m_blupiAir = false; - m_blupiHelico = false; - m_blupiOver = false; - m_blupiJeep = false; - m_blupiTank = false; - m_blupiSkate = false; - m_blupiNage = false; - m_blupiSurf = false; - m_blupiSuspend = false; - m_blupiJumpAie = false; - m_blupiShield = false; - m_blupiPower = false; - m_blupiCloud = false; - m_blupiHide = false; - m_blupiTimeShield = 100; - m_blupiPosMagic = m_blupiPos; - m_jauges[1].SetHide(false); - if (!m_blupiJeep && !m_blupiTank) - { - StopSound(16); - StopSound(18); - StopSound(29); - StopSound(31); - } - PlaySound(40, m_moveObject[num].posCurrent); - tinyPoint.X = m_blupiPos.X - 34; - tinyPoint.Y = m_blupiPos.Y - 34; - ObjectStart(tinyPoint, 90, 0); - m_decorAction = 5; - m_decorPhase = 0; - } - if (m_moveObject[num].type == 54 && m_moveObject[num].step != 2 && m_moveObject[num].step != 4 && m_blupiFocus && !m_blupiBalloon && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi) - { - ByeByeHelico(); - 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; - m_blupiSuspend = false; - m_blupiJumpAie = false; - m_blupiFocus = false; - m_blupiRestart = true; - if (flag4) - { - m_blupiAir = true; - } - if (m_blupiHelico || m_blupiOver || m_blupiBalloon || m_blupiEcrase || m_blupiJeep || m_blupiTank || m_blupiSkate) - { - m_blupiHelico = false; - m_blupiOver = false; - m_blupiBalloon = false; - m_blupiEcrase = false; - m_blupiJeep = false; - m_blupiTank = false; - m_blupiSkate = false; - tinyPoint = m_moveObject[num].posCurrent; - tinyPoint.X -= 34; - tinyPoint.Y -= 34; - ObjectStart(tinyPoint, 10, 0); - StopSound(16); - StopSound(18); - StopSound(29); - StopSound(31); - PlaySound(10, m_moveObject[num].posCurrent); - m_decorAction = 1; - m_decorPhase = 0; - } - else - { - PlaySound(51, m_moveObject[num].posCurrent); - } - m_blupiCloud = false; - m_blupiHide = false; - m_jauges[1].SetHide(true); - } - if (m_moveObject[num].type == 23 && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi && m_blupiAction != 13 && m_blupiAction != 30 && 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_blupiAction != 54 && m_blupiAction != 57 && m_blupiAction != 35) - { - ByeByeHelico(); - tinyPoint = m_moveObject[num].posCurrent; - ObjectDelete(tinyPoint, m_moveObject[num].type); - m_blupiAction = 54; - m_blupiPhase = 0; - m_blupiSuspend = false; - m_blupiJumpAie = false; - m_blupiFocus = false; - m_blupiRestart = true; - if (flag4) - { - m_blupiAir = true; - } - if (m_blupiHelico || m_blupiOver || m_blupiBalloon || m_blupiEcrase || m_blupiJeep || m_blupiTank || m_blupiSkate) - { - m_blupiHelico = false; - m_blupiOver = false; - m_blupiBalloon = false; - m_blupiEcrase = false; - m_blupiJeep = false; - m_blupiTank = false; - m_blupiSkate = false; - } - StartSploutchGlu(m_moveObject[num].posCurrent); - m_blupiCloud = false; - m_blupiHide = false; - m_jauges[1].SetHide(true); - } - 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 end; - end.X = 430; - end.Y = 430; - VoyageInit(m_pixmap.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); - ObjectStart(m_moveObject[num].posCurrent, 39, -10); - } - 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 end2; - end2.X = 520; - end2.Y = 418; - VoyageInit(m_pixmap.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); - ObjectStart(m_moveObject[num].posCurrent, 39, -10); - } - 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 end3; - end3.X = 530; - end3.Y = 418; - VoyageInit(m_pixmap.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); - ObjectStart(m_moveObject[num].posCurrent, 39, -10); - } - 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 end4; - end4.X = 540; - end4.Y = 418; - VoyageInit(m_pixmap.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); - ObjectStart(m_moveObject[num].posCurrent, 39, -10); - } - 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); - } - if (m_moveObject[num].type == 25 && !m_blupiShield && !m_blupiHide && !m_blupiPower && m_blupiFocus) - { - PlaySound(42, m_moveObject[num].posCurrent); - m_blupiShield = true; - m_blupiPower = false; - m_blupiCloud = false; - m_blupiHide = false; - m_blupiTimeShield = 100; - m_blupiPosMagic = m_blupiPos; - m_jauges[1].SetHide(false); - } - if (ButtonPressed == Def.ButtonGlygh.PlayAction && m_moveObject[num].type == 26 && !m_blupiShield && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && m_blupiFocus) - { - ButtonPressed = Def.ButtonGlygh.None; - m_sucettePos = m_moveObject[num].posCurrent; - m_sucetteType = m_moveObject[num].type; - ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type); - m_blupiAction = 49; - m_blupiPhase = 0; - m_blupiCloud = false; - m_blupiHide = false; - m_blupiFocus = false; - PlaySound(50, tinyPoint3); - } - if (m_moveObject[num].type == 40 && !m_blupiHide && m_blupiFocus) - { - ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type); - m_blupiInvert = true; - m_blupiTimeShield = 100; - m_blupiPosMagic = m_blupiPos; - m_jauges[1].SetHide(false); - PlaySound(66, tinyPoint3); - ObjectStart(m_blupiPos, 41, -60); - ObjectStart(m_blupiPos, 41, 60); - ObjectStart(m_blupiPos, 41, 10); - ObjectStart(m_blupiPos, 41, -10); - } - if (ButtonPressed == Def.ButtonGlygh.PlayAction && m_moveObject[num].type == 30 && !m_blupiShield && !m_blupiCloud && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && m_blupiFocus) - { - ButtonPressed = Def.ButtonGlygh.None; - m_sucettePos = m_moveObject[num].posCurrent; - m_sucetteType = m_moveObject[num].type; - ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type); - m_blupiAction = 55; - m_blupiPhase = 0; - m_blupiShield = false; - m_blupiPower = false; - m_blupiJumpAie = false; - m_blupiFocus = false; - PlaySound(57, tinyPoint3); - } - if (m_moveObject[num].type == 31 && !m_blupiShield && !m_blupiHide && !m_blupiPower && !m_blupiCloud && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && m_blupiFocus) - { - m_blupiAction = 56; - m_blupiPhase = 0; - m_blupiShield = false; - m_blupiPower = false; - m_blupiJumpAie = false; - m_blupiFocus = false; - m_blupiCloud = true; - m_blupiTimeShield = 100; - PlaySound(58, tinyPoint3); - if (m_blupiHide) - { - m_blupiHide = false; - m_jauges[1].SetHide(true); - } - } - if (m_moveObject[num].type >= 200 && m_moveObject[num].type <= 203 && m_blupiFocus) - { - if (m_moveObject[num].type == 200) - { - if (m_blupiPerso < 5 && ButtonPressed == Def.ButtonGlygh.PlayAction) - { - 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); - } - } - else if (!m_blupiShield && !m_blupiHide && !m_bSuperBlupi) - { - ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type); - BlupiDead(11, 75); - tinyPoint = m_moveObject[num].posCurrent; - tinyPoint.X -= 34; - tinyPoint.Y -= 34; - ObjectStart(tinyPoint, 10, 0); - PlaySound(10, m_moveObject[num].posCurrent); - m_decorAction = 1; - m_decorPhase = 0; - } - } - if (m_moveObject[num].type == 55 && m_blupiFocus && m_blupiDynamite == 0 && (m_voyageIcon != 252 || m_voyageChannel != 10) && ButtonPressed == Def.ButtonGlygh.PlayAction) - { - 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); - m_blupiAction = 86; - m_blupiPhase = 0; - m_blupiFocus = false; - } - if (m_moveObject[num].type == 12 && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus && m_blupiAction == 2) - { - tinyPoint3 = m_moveObject[num].posCurrent; - if (m_blupiDir == 1 && m_blupiPos.X > tinyPoint3.X) - { - 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) - { - tinyPoint3.X = m_blupiPos.X + 55; - PlaySound(38, tinyPoint3); - m_blupiActionOuf = 45; - m_blupiTimeOuf = 0; - m_blupiAction = 14; - m_blupiPhase = 0; - } - if (!TestPushCaisse(num, tinyPoint3, false)) - { - m_blupiPos.X = blupiPos.X; - } - } - if ((m_moveObject[num].type == 7 || m_moveObject[num].type == 21) && m_blupiFocus) - { - if (m_goalPhase == 0) - { - if (m_nbTresor >= m_totalTresor) - { - if (m_moveObject[num].type == 21) - { - m_bFoundCle = true; - } - ByeByeHelico(); - StopSound(16); - StopSound(18); - StopSound(29); - StopSound(31); - PlaySound(14, m_moveObject[num].posCurrent); - m_blupiAction = 13; - m_blupiPhase = 0; - m_blupiFocus = false; - m_blupiFront = true; - m_blupiPos.Y = m_moveObject[num].posCurrent.Y; - } - else - { - PlaySound(13, m_moveObject[num].posCurrent); - } - m_goalPhase = 50; - } - else - { - m_goalPhase--; - } - } - else - { - m_goalPhase = 0; - } - } - else - { - m_goalPhase = 0; - } - if (m_blupiAction == 14 && m_blupiFocus) - { - num = CaisseInFront(); - if (num != -1) - { - tinyPoint3 = m_moveObject[num].posCurrent; - if (m_blupiDir == 1) - { - tinyPoint3.X = m_blupiPos.X - 59; - } - else - { - tinyPoint3.X = m_blupiPos.X + 55; - } - if (!TestPushCaisse(num, tinyPoint3, false)) - { - m_blupiPos.X = blupiPos.X; - } - } - else - { - m_blupiAction = 1; - m_blupiPhase = 0; - } - } - if (m_blupiAction == 29 && m_blupiFocus) - { - num = CaisseInFront(); - if (num != -1) - { - tinyPoint3 = m_moveObject[num].posCurrent; - if (m_blupiDir == 1) - { - tinyPoint3.X = m_blupiPos.X - 59; - } - else - { - tinyPoint3.X = m_blupiPos.X + 55; - } - if (!TestPushCaisse(num, tinyPoint3, true)) - { - m_blupiAction = 1; - m_blupiPhase = 0; - } - } - else - { - m_blupiAction = 1; - m_blupiPhase = 0; - } - } - if (!m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && m_blupiFocus) - { - if (m_blupiActionOuf == 44 && m_blupiAction == 1) - { - if (m_blupiTimeOuf > 50) - { - m_blupiAction = m_blupiActionOuf; - m_blupiPhase = 0; - PlaySound(46, m_blupiPos); - } - m_blupiActionOuf = 0; - } - if (m_blupiActionOuf == 45 && m_blupiAction == 1) - { - if (m_blupiTimeOuf > 50) - { - m_blupiAction = m_blupiActionOuf; - m_blupiPhase = 0; - } - m_blupiActionOuf = 0; - } - if (m_blupiAction == 45 && m_blupiPhase == 4) - { - PlaySound(46, m_blupiPos); - } - if (m_blupiActionOuf == 65 && m_blupiAction == 1) - { - if (m_blupiTimeOuf > 10 && m_blupiTimeOuf < 50) - { - m_blupiAction = m_blupiActionOuf; - m_blupiPhase = 0; - } - m_blupiActionOuf = 0; - } - if (m_blupiActionOuf == 47 && m_blupiAction == 1) - { - if (m_blupiTimeOuf > 60) - { - m_blupiAction = m_blupiActionOuf; - m_blupiPhase = 0; - PlaySound(48, m_blupiPos); - } - m_blupiActionOuf = 0; - } - if (m_blupiActionOuf == 48 && m_blupiAction == 1) - { - if (m_blupiTimeOuf < 10) - { - m_blupiAction = m_blupiActionOuf; - m_blupiPhase = 0; - PlaySound(49, m_blupiPos); - } - m_blupiActionOuf = 0; - } - if ((m_blupiActionOuf == 63 || m_blupiActionOuf == 64 || m_blupiActionOuf == 83) && m_blupiAction == 1) - { - if (m_blupiTimeOuf < 20) - { - m_blupiAction = m_blupiActionOuf; - m_blupiPhase = 0; - } - m_blupiActionOuf = 0; - } - } - if (m_blupiAction == 2 && m_blupiActionOuf != 63 && m_blupiActionOuf != 64 && m_blupiActionOuf != 83 && !m_blupiSurf && !m_blupiNage) - { - m_blupiActionOuf = 0; - } - if (m_blupiActionOuf != 0) - { - m_blupiTimeOuf++; - } - if (m_blupiTimeMockery > 0) - { - m_blupiTimeMockery--; - } - if (m_blupiAction == 86 && m_blupiPhase == 18) - { - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiFocus = true; - } - if (m_blupiAction == 87 && m_blupiPhase == 26) - { - m_blupiAction = 1; - 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) - { - m_blupiPosHelico.X = -1; - } - if (m_blupiTimeFire > 0) - { - m_blupiTimeFire--; - } - if (m_blupiAction == 74 && m_blupiPhase == 128) - { - TinyPoint blupiPos2 = default(TinyPoint); - if (SearchTeleporte(m_blupiPos, ref blupiPos2)) - { - m_blupiPos = blupiPos2; - ObjectStart(m_blupiPos, 27, 20); - ObjectStart(m_blupiPos, 27, -20); - } - m_blupiFocus = true; - m_blupiPosHelico = m_blupiPos; - } - if (m_blupiAction == 82 && m_blupiPhase == 10) - { - m_blupiAction = 1; - m_blupiPhase = 0; - m_blupiFocus = true; - } - if (ButtonPressed == Def.ButtonGlygh.PlayAction && m_blupiAction == 1) - { - m_blupiAction = 84; - m_blupiPhase = 0; - PlaySound(27, m_blupiPos); - } - if ((m_blupiAction == 11 && m_blupiPhase == 70) || (m_blupiAction == 75 && m_blupiPhase == 100) || (m_blupiAction == 76 && m_blupiPhase == 70) || (m_blupiAction == 77 && m_blupiPhase == 110) || (m_blupiAction == 78 && m_blupiPhase == 90) || (m_blupiAction == 79 && m_blupiPhase == 90) || (m_blupiAction == 80 && m_blupiPhase == 90) || (m_blupiAction == 81 && m_blupiPhase == 90) || (m_blupiAction == 24 && m_blupiPhase == 90) || (m_blupiAction == 54 && m_blupiPhase == 100) || (m_blupiAction == 57 && m_blupiPhase == 90)) - { - if (m_nbVies > 0) - { - m_blupiAction = 35; - m_blupiIcon = -1; - m_blupiPhase = 0; - if (m_blupiRestart) - { - 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); - } - else - { - m_nbVies = -1; - m_term = -1; - DoorsLost(); - } - m_blupiFront = false; - } - if (m_dimDecor.Y == 0) - { - num3 = 480; - } - else - { - num3 = 6400; - } - if (m_blupiPos.Y >= num3 + 1 && m_blupiPos.Y <= num3 + 40) - { - PlaySound(8, m_blupiPos); - } - if (m_blupiPos.Y > num3 + 1000) - { - m_term = -1; - DoorsLost(); - } - if (m_blupiAction == 13 && m_blupiPhase == 40) - { - if (m_bPrivate) - { - m_term = 1; - } - else if (m_mission == 1) - { - m_term = 199; - } - else if (m_mission == 199) - { - m_term = -2; - } - else if (m_bFoundCle) - { - OpenGoldsWin(); - m_term = 1; - } - else - { - OpenDoorsWin(); - m_term = m_mission / 10 * 10; - } - } - if (m_blupiAction == 30 && m_blupiPhase == 30) - { - num = IsWorld(m_blupiPos); - if (num != -1) - { - if (m_mission == 1) - { - m_term = num * 10; - } - else if (num == 199) - { - m_term = 1; - } - else - { - m_term = m_mission / 10 * 10 + num; - } - } - } - if (blupiAction == 63 && m_blupiAction != 63) - { - StopSound(65); - } - if (blupiAction == 64 && m_blupiAction != 64) - { - StopSound(65); - } - if (blupiAction == 83 && m_blupiAction != 83) - { - StopSound(47); - } - if (m_blupiFocus && !m_blupiAir && (!m_blupiHelico || BlupiIsGround()) && (!m_blupiOver || BlupiIsGround()) && !m_blupiBalloon && !m_blupiEcrase && !m_blupiShield && !m_blupiHide && !flag2 && !flag3 && m_blupiTransport == -1 && !IsLave(m_blupiPos) && !IsPiege(m_blupiPos) && !IsGoutte(m_blupiPos, true) && !IsScie(m_blupiPos) && !IsBridge(m_blupiPos, ref tinyPoint) && IsTeleporte(m_blupiPos) == -1 && !IsBlitz(m_blupiPos, true) && !IsTemp(m_blupiPos) && !IsBalleTraj(m_blupiPos) && !IsMoveTraj(m_blupiPos)) - { - if (m_blupiFifoNb > 0) - { - m_blupiValidPos = m_blupiFifoPos[0]; - } - 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) - { - num4 += (num28 - Decor.SCROLL_MARGX * 2) / 4; - } - if (num29 > Decor.SCROLL_MARGY * 2) - { - num4 += (num29 - Decor.SCROLL_MARGY * 2) / 4; - } - if (m_scrollPoint.X < tinyPoint3.X) - { - m_scrollPoint.X = m_scrollPoint.X + num4; - if (m_scrollPoint.X >= tinyPoint3.X) - { - 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 = tinyPoint3.X; - } - } - if (m_scrollPoint.Y < tinyPoint3.Y) - { - m_scrollPoint.Y = m_scrollPoint.Y + num4; - if (m_scrollPoint.Y >= tinyPoint3.Y) - { - 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 = tinyPoint3.Y; - } - } - if (m_blupiAction != 75 && m_blupiAction != 76) - { - m_posDecor = GetPosDecor(m_scrollPoint); - } - if (m_time % 4 == 0) - { - PosSound(m_blupiPos); - } - VoyageStep(); - m_blupiLastSpeedX = m_blupiSpeedX; - m_blupiLastSpeedY = m_blupiSpeedY; - m_lastKeyPress = m_keyPress; -} -*/ - -BOOL CDecor::GetInvincible() -{ - return m_bSuperBlupi; -} - -void CDecor::SetInvincible(BOOL invincible) -{ - m_bSuperBlupi = invincible; -} - -BOOL CDecor::GetShowSecret() -{ - return m_bShowSecret; -} - -void CDecor::SetShowSecret(BOOL secret) -{ - m_bShowSecret = secret; -} - -void CDecor::SetAccessBuild(BOOL build) -{ - m_bAccessBuild = build; -} - -BOOL CDecor::GetNetPacked() -{ - return m_bNetPacked; -} - -void CDecor::SetNetPacked(BOOL net) -{ - m_bNetPacked = net; -} - -BOOL CDecor::GetNetMovePredict() -{ - return m_bNetMovePredict; -} - -void CDecor::SetNetMovePredict(BOOL netmove) -{ - m_bNetMovePredict = netmove; -} - -BOOL CDecor::GetNetDebug() -{ - return m_bNetDebug; -} - -void CDecor::SetMulti(int multi) -{ - m_bMulti = multi; -} - -void CDecor::SetTeam(int team) -{ - m_team = team; -} - -void CDecor::SetNetDebug(BOOL bNetDebug) -{ - m_bNetDebug = bNetDebug; - - if (bNetDebug != FALSE) - { - remove("debug.txt"); - } - return; -} - -void CDecor::MemorizeDoors(BYTE* doors) -{ - int i; - - for (i = 0; i < 200; i++) - { - m_doors[i] = *(BYTE*)(i + doors); - } - return; -} - -BOOL CDecor::BlupiIsGround() -{ - if (m_blupiTransport == -1) - { - RECT rect = BlupiRect(m_blupiPos); - rect.top = m_blupiPos.y + 60 - 2; - rect.bottom = m_blupiPos.y + 60 - 1; - return DecorDetect(rect); - } -} - -RECT CDecor::BlupiRect(POINT pos) -{ - RECT result; - if (m_blupiNage || m_blupiSurf) - { - result.left = pos.x + 12; - result.right = pos.x + 60 - 12; - if (m_blupiAction == 1) - { - result.top = pos.y + 5; - result.bottom = pos.y + 60 - 10; - } - else - { - result.top = pos.y + 15; - result.bottom = pos.y + 60 - 10; - } - } - else if (m_blupiJeep) - { - result.left = pos.x + 2; - result.right = pos.x + 60 - 2; - result.top = pos.y + 10; - result.bottom = pos.y + 60 - 2; - } - else if (m_blupiTank) - { - result.left = pos.x + 2; - result.right = pos.x + 60 - 2; - result.top = pos.y + 10; - result.bottom = pos.y + 60 - 2; - } - else if (m_blupiOver) - { - result.left = pos.x + 2; - result.right = pos.x + 60 - 2; - result.top = pos.y + 2; - result.bottom = pos.y + 60 - 2; - } - else if (m_blupiBalloon) - { - result.left = pos.x + 10; - result.right = pos.x + 60 - 10; - result.top = pos.y + 5; - result.bottom = pos.y + 60 - 2; - } - else if (m_blupiEcrase) - { - result.left = pos.x + 5; - result.right = pos.x + 60 - 5; - result.top = pos.y + 39; - result.bottom = pos.y + 60 - 2; - } - else - { - result.left = pos.x + 12; - result.right = pos.x + 60 - 12; - result.top = pos.y + 11; - result.bottom = pos.y + 60 - 2; - } - return result; -} - -void CDecor::BlupiAdjust() -{ - RECT tinyRect = BlupiRect(m_blupiPos); - - if (DecorDetect(tinyRect)) - { - return; - } - for (int i = 0; i < 50; i++) - { - RECT rect = tinyRect; - rect.bottom = rect.top + 2; - rect.left = m_blupiPos.x + 12; - rect.right = m_blupiPos.x + 60 - 12; - if (DecorDetect(rect)) - { - break; - } - tinyRect.top += 2; - tinyRect.bottom += 2; - m_blupiPos.y = m_blupiPos.y + 2; - } - for (int i = 0; i < 50; i++) - { - RECT rect = tinyRect; - rect.right = rect.left + 2; - rect.top = m_blupiPos.y + 11; - rect.bottom = m_blupiPos.y + 60 - 2; - if (DecorDetect(rect)) - { - break; - } - tinyRect.left += 2; - tinyRect.right += 2; - m_blupiPos.x = m_blupiPos.x + 2; - } - for (int i = 0; i < 50; i++) - { - RECT rect = tinyRect; - rect.left = rect.right - 2; - rect.top = m_blupiPos.y + 11; - rect.bottom = m_blupiPos.y + 60 - 2; - if (DecorDetect(rect)) - { - break; - } - tinyRect.left -= 2; - tinyRect.right -= 2; - m_blupiPos.x = m_blupiPos.x - 2; - } - for (int i = 0; i < 50; i++) - { - RECT rect = tinyRect; - rect.right = rect.left + 2; - if (DecorDetect(rect)) - { - break; - } - tinyRect.left += 2; - tinyRect.right += 2; - m_blupiPos.x = m_blupiPos.x + 2; - } - for (int i = 0; i < 50; i++) - { - RECT rect = tinyRect; - rect.left = rect.right - 2; - if (DecorDetect(rect)) - { - return; - } - tinyRect.left -= 2; - tinyRect.right -= 2; - m_blupiPos.x = m_blupiPos.x - 2; - } -} - -BOOL CDecor::BlupiBloque(POINT pos, int dir) -{ - RECT rect = BlupiRect(pos); - rect.top = rect.bottom - 20; - rect.bottom -= 2; - if (dir > 0) - { - rect.left = rect.right - 2; - } - if (dir < 0) - { - rect.right = rect.left + 2; - } - return DecorDetect(rect); -} - -void CDecor::BlupiDead(int action1, int action2) -{ - if (action2 == -1) - { - m_blupiAction = action1; - } - else - { - m_blupiAction = ((rand() % 2 == 0) ? action1 : action2); - } - m_blupiPhase = 0; - m_blupiFocus = FALSE; - m_blupiHelico = FALSE; - m_blupiOver = FALSE; - m_blupiJeep = FALSE; - m_blupiTank = FALSE; - m_blupiSkate = FALSE; - m_blupiNage = FALSE; - m_blupiSurf = FALSE; - m_blupiVent = FALSE; - m_blupiSuspend = FALSE; - m_blupiJumpAie = FALSE; - m_blupiShield = FALSE; - m_blupiPower = FALSE; - m_blupiCloud = FALSE; - m_blupiHide = FALSE; - m_blupiInvert = FALSE; - m_blupiBalloon = FALSE; - m_blupiEcrase = FALSE; - m_blupiRestart = FALSE; - m_blupiActionOuf = 0; - m_jauges[0].SetHide(TRUE); - m_jauges[1].SetHide(TRUE); - StopSound(SOUND_16_HELICOHIGH); - StopSound(SOUND_18_HELICOLOW); - StopSound(SOUND_29_JEEPHIGH); - StopSound(SOUND_31_JEEPLOW); - - POINT pos; - POINT pos2; - if (m_blupiAction == 75) - { - 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(pos, pos2, 230, 10); - PlaySoundB(SOUND_74_ANGEL, m_blupiPos, 0); - } - if (m_blupiAction == 76) - { - 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(pos, pos2, 40, 10); - PlaySoundB(SOUND_74_ANGEL, m_blupiPos, 0); - } - if (m_blupiAction == 77) - { - ObjectStart(m_blupiPos, 41, -70); - ObjectStart(m_blupiPos, 41, 20); - ObjectStart(m_blupiPos, 41, -20); - PlaySoundB(SOUND_75_SCIE, m_blupiPos, 0); - } -} - -POINT CDecor::GetPosDecor(POINT pos) -{ - POINT result; - if (m_dimDecor.x == 0) - { - result.x = 0; - } - else - { - result.x = pos.x - (m_drawBounds.right - m_drawBounds.left) / 2; - result.x = (result.x < 0); - result.x = (result.x > 5760) - (m_drawBounds.right - m_drawBounds.left); - } - if (m_dimDecor.y == 0) - { - result.y = 0; - } - else - { - result.y = pos.y - (m_drawBounds.bottom - m_drawBounds.top) / 2; - result.y = (result.y < 0); - result.y = (result.y > 5920) - (m_drawBounds.bottom - m_drawBounds.top) / 2; - } - return result; -} - -void CDecor::BlupiAddFifo(POINT pos) -{ - if (m_blupiFifoNb < 10) - { - if (m_blupiFifoNb > 0 && pos.x == m_blupiFifoPos[m_blupiFifoNb - 1].x && pos.y == m_blupiFifoPos[m_blupiFifoNb - 1].y) - { - return; - } - m_blupiFifoPos[m_blupiFifoNb] = pos; - m_blupiFifoNb++; - return; - } - else - { - if (pos.x == m_blupiFifoPos[9].x && pos.y == m_blupiFifoPos[9].y) - { - return; - } - for (int i = 0; i < 9; i++) - { - m_blupiFifoPos[i] = m_blupiFifoPos[i + 1]; - } - m_blupiFifoPos[9] = pos; - return; - } -} - -BOOL CDecor::DecorDetect(RECT rect) -{ - return DecorDetect(rect, TRUE); -} - -BOOL CDecor::DecorDetect(RECT rect, BOOL bCaisse) -{ - m_detectIcon = -1; - if (rect.left < 0 || rect.top < 0) - { - return TRUE; - } - int num; - if (m_dimDecor.x == 0) - { - num = 640; - } - else - { - num = 6400; - } - if (rect.right > num) - { - return TRUE; - } - if (m_blupiHelico || - m_blupiOver || - m_blupiBalloon || - m_blupiEcrase || - m_blupiNage || - m_blupiSurf) - { - if (m_dimDecor.y == 0) - { - num = 480; - } - else - { - num = 6400; - } - if (rect.bottom > num) - { - return TRUE; - } - } - int num2 = rect.left / 16; - int num3 = (rect.right + 16 - 1) / 16; - int num4 = rect.top / 16; - int num5 = (rect.bottom + 16 - 1) / 16; - RECT src; - for (int i = num4; i <= num5; i++) - { - for (int j = num2; j <= num3; j++) - { - int num6 = j / 4; - int num7 = i / 4; - if (num6 >= 0 && num6 < 100 && num7 >= 0 && num7 < 100) - { - int icon = m_decor[num6, num7]->icon; - if (icon >= 0 && icon < MAXQUART && (!m_blupiHelico || icon != 214) && (m_blupiOver || icon != 214) && (icon != 324 || m_time / 4 % 20 < 18)) - { - num6 = j % 4; - num7 = i % 4; - if (table_decor_quart[icon * 16 + num7 * 4 + num6] != 0) - { - src.left = j * 16; - src.right = src.left + 16; - src.top = i * 16; - src.bottom = src.top + 16; - RECT tinyRect; - tinyRect.left = 0; - tinyRect.right = 0; - tinyRect.top = 0; - tinyRect.bottom = 0; - - if (IntersectRect(&tinyRect, &src, &rect)) - { - m_detectIcon = icon; - return TRUE; - } - - } - - } - } - } - } - if (!bCaisse) - { - return FALSE; - } - for (int k = 0; k < m_nbRankCaisse; k++) - { - int num8 = m_rankCaisse[k]; - src.left = m_moveObject[num8]->posCurrent.x; - src.right = m_moveObject[num8]->posCurrent.x + 64; - src.top = m_moveObject[num8]->posCurrent.y; - src.bottom = m_moveObject[num8]->posCurrent.y + 64; - RECT tinyRect; - tinyRect.left = 0; - tinyRect.right = 0; - tinyRect.top = 0; - tinyRect.bottom = 0; - if (IntersectRect(&tinyRect, &src, &rect)) - { - m_detectIcon = m_moveObject[num8]->icon; - return TRUE; - } - - } - return FALSE; -} - -BOOL CDecor::TestPath(RECT rect, POINT start, POINT end) -{ - int num = abs(end.x - start.x); - int num2 = abs(end.y - start.y); - - POINT tinyPoint = start; - if (num > num2) - { - RECT rect2; - if (end.x > start.x) - { - for (int i = 0; i <= num; i++) - { - int j = i * (end.y - start.y) / num; - rect2.left = rect.left + i; - rect2.right = rect.right + i; - rect2.top = rect.top + j; - rect2.bottom = rect.bottom + j; - if (DecorDetect(rect2)) - { - end = tinyPoint; - return FALSE; - } - tinyPoint.x = start.x + i; - tinyPoint.y = start.y + j; - } - } - if (end.x < start.x) - { - for (int i = 0; i >= -num; i--) - { - int j = i * (start.y - end.y) / num; - rect2.left = rect.left + i; - rect2.right = rect.right + i; - rect2.top = rect.top + j; - rect2.bottom = rect.bottom + j; - if (DecorDetect(rect2)) - { - end = tinyPoint; - return FALSE; - } - tinyPoint.x = start.x + i; - tinyPoint.y = start.y + j; - } - } - } - else - { - RECT rect2; - if (end.y > start.y) - { - for (int j = 0; j <= num2; j++) - { - int i = j * (end.x - start.x) / num2; - rect2.left = rect.left + i; - rect2.right = rect.right + i; - rect2.top = rect.top + j; - rect2.bottom = rect.bottom + j; - if (DecorDetect(rect2)) - { - end = tinyPoint; - return FALSE; - } - tinyPoint.x = start.x + i; - tinyPoint.y = start.y + j; - } - } - if (end.y < start.y) - { - for (int j = 0; j >= -num2; j--) - { - int i = j * (start.x - end.x) / num2; - rect2.left = rect.left + i; - rect2.right = rect.right + i; - rect2.top = rect.top + j; - rect2.bottom = rect.bottom + j; - if (DecorDetect(rect2)) - { - end = tinyPoint; - return FALSE; - } - tinyPoint.x = start.x + i; - tinyPoint.y = start.y + j; - } - } - } - return TRUE; -} - -void CDecor::MoveObjectPlouf(POINT pos) -{ - for (int i = 0; i < MAXMOVEOBJECT; i++) - { - if (m_moveObject[i]->type == 14) - { - return; - } - } - pos.y -= 45; - PlaySoundB(SOUND_23_PLOUF, pos, 0); - ObjectStart(pos, 14, 0); -} - -void CDecor::MoveObjectTiplouf(POINT pos) -{ - for (int i = 0; i < MAXMOVEOBJECT; i++) - { - if (m_moveObject[i]->type == 35) - { - return; - } - } - if (m_blupiDir == 2) - { - pos.x += 5; - } - else - { - pos.x -= 5; - } - pos.y -= 45; - PlaySoundB(SOUND_64_TIPLOUF, pos, 0); - ObjectStart(pos, 35, 0); -} - -void CDecor::MoveObjectBlup(POINT pos) -{ - PlaySoundB(SOUND_24_BLUP, pos, 0); - pos.y -= 20; - int num = 0; - POINT tinyPoint = pos; - while (tinyPoint.y > 0) - { - int icon = m_decor[(tinyPoint.x + 16) / 64, tinyPoint.y / 64]->icon; - if (icon != 91 && icon != 92) - { - break; - } - num++; - tinyPoint.y -= 64; - } - num--; - if (num <= 0) - { - return; - } - int num2 = MoveObjectFree(); - if (num2 == -1) - { - return; - } - m_moveObject[num2]->type = 15; - m_moveObject[num2]->phase = 0; - m_moveObject[num2]->posCurrent.x = pos.x; - m_moveObject[num2]->posCurrent.y = pos.y; - m_moveObject[num2]->posStart = m_moveObject[num2]->posCurrent; - m_moveObject[num2]->posEnd.x = pos.x; - m_moveObject[num2]->posEnd.y = pos.y - num * 64; - m_moveObject[num2]->timeStopStart = 0; - m_moveObject[num2]->stepAdvance = num * 10; - m_moveObject[num2]->step = 2; - m_moveObject[num2]->time = 0; - MoveObjectStepIcon(num2); -} - - -void CDecor::ActiveSwitch(BOOL bState, POINT cel) -{ - POINT pos; - pos.x = cel.x * 64; - pos.y = cel.y * 64; - ModifDecor(pos, 385 - (UINT)(bState != FALSE), TRUE); - PlaySoundB((bState != FALSE) + SOUND_76_SWITCHOFF, pos, 0); - cel.x -= 20; - for (int i = 0; i < 41; i++) - { - if (cel.x >= 0 && cel.x < 100 && m_decor[cel.x, cel.y]->icon == (bState ? 379 : 378)) - { - pos.x = cel.x * 64; - pos.y = cel.y * 64; - ModifDecor(pos, 379 - (UINT)(bState != FALSE), TRUE); - } - cel.x++; - } -} - -int CDecor::IsWorld(POINT pos) -{ - pos.x += 30; - pos.y += 30; - if (pos.x < 0 || pos.x >= 6400 || pos.y < 0 || pos.y >= 6400) - { - return -1; - } - int icon = m_decor[pos.x / 64, pos.y / 64]->icon; - if (icon >= 158 && icon <= 165) - { - return icon - 158 + 1; - } - if (icon >= 166 && icon <= 173) - { - return icon - 166 + 1; - } - if (icon == 309 || icon == 310) - { - return 9; - } - if (icon >= 411 && icon <= 415) - { - return icon - 411 + 10; - } - if (icon >= 416 && icon <= 420) - { - return icon - 416 + 10; - } - if (icon >= 174 && icon <= 181) - { - return icon - 174 + 1; - } - if (icon == 184) - { - return 199; - } - return -1; -} - -int CDecor::GetTypeBarre(POINT pos) -{ - POINT pos2 = pos; - pos.x += 30; - pos.y += 22; - if (pos.y % 64 > 44) - { - return 0; - } - if (pos.x < 0 || pos.x >= 6400 || pos.y < 0 || pos.y >= 6400) - { - return 0; - } - int icon = m_decor[pos.x / 64, pos.y / 64]->icon; - if (icon != 138 && icon != 202) - { - return 0; - } - if (pos.y >= 6336) - { - return 1; - } - icon = m_decor[pos.x / 64, pos.y / 64 + 1]->icon; - if (IsPassIcon(icon)) - { - return 2; - } - RECT rect = BlupiRect(pos2); - rect.top = pos2.y + 60 - 2; - rect.bottom = pos2.y + 60 - 1; - if (DecorDetect(rect, TRUE)) - { - return 2; - } - return 1; -} - -BOOL CDecor::IsLave(POINT pos) -{ - pos.x += 30; - return pos.x >= 0 && pos.x < 6400 && pos.y >= 0 && pos.y < 6400 && m_decor[pos.x / 64, pos.y / 64]->icon == 68; -} - -BOOL CDecor::IsPiege(POINT pos) -{ - pos.x += 30; - pos.y += 60; - return pos.x % 64 >= 15 && pos.x % 64 <= 49 && pos.x >= 0 && pos.x < 6400 && pos.y >= 0 && pos.y < 6400 && m_decor[pos.x / 64, pos.y / 64]->icon == 373; -} - -BOOL CDecor::IsGoutte(POINT pos, BOOL bAlways) -{ - pos.x += 30; - if (pos.x % 64 < 15 || pos.x % 64 > 49) - { - return FALSE; - } - if (pos.x < 0 || pos.x >= 6400 || pos.y < 0 || pos.y >= 6400) - { - return FALSE; - } - int icon = m_decor[pos.x / 64, pos.y / 64]->icon; - if (bAlways) - { - return icon == 404 || icon == 410; - } - return icon == 404; -} - -BOOL CDecor::IsScie(POINT pos) -{ - pos.x += 30; - return pos.x % 64 >= 4 && pos.x % 64 <= 60 && pos.x >= 0 && pos.x < 6400 && pos.y >= 0 && pos.y < 6400 && m_decor[pos.x / 64, pos.y / 64]->icon == 378; -} - -BOOL CDecor::IsSwitch(POINT pos, POINT celSwitch) -{ - pos.x += 30; - if (pos.x % 64 < 4 || pos.x % 64 > 60) - { - return FALSE; - } - if (pos.x < 0 || pos.x >= 6400 || pos.y < 0 || pos.y >= 6400) - { - return FALSE; - } - celSwitch.x = pos.x / 64; - celSwitch.y = pos.y / 64; - return m_decor[pos.x / 64, pos.y / 64]->icon == 384 || m_decor[pos.x / 64, pos.y / 64]->icon == 385; -} - -BOOL CDecor::IsEcraseur(POINT pos) -{ - if (m_time / 3 % 10 > 2) - { - return FALSE; - } - pos.x += 30; - return pos.x >= 0 && pos.x < 6400 && pos.y >= 0 && pos.y < 6400 && m_decor[pos.x / 64, pos.y / 64]->icon == 317; -} - -BOOL CDecor::IsBlitz(POINT pos, BOOL bAlways) -{ - pos.x += 30; - if (pos.x < 0 || pos.x >= 6400 || pos.y < 0 || pos.y >= 6400) - { - return FALSE; - } - POINT tinyPoint; - tinyPoint.x = pos.x / 64; - tinyPoint.y = pos.y / 64; - return m_decor[tinyPoint.x, tinyPoint.y]->icon == 305 && (bAlways || BlitzActif(tinyPoint.x, tinyPoint.y)); -} - -BOOL CDecor::IsRessort(POINT pos) -{ - pos.x += 30; - pos.y += 60; - return pos.x >= 0 && pos.x < 6400 && pos.y >= 0 && pos.y < 6400 && m_decor[pos.x / 64, pos.y / 64]->icon == 211; -} - -BOOL CDecor::IsTemp(POINT pos) -{ - pos.x += 30; - pos.y += 60; - return pos.x >= 0 && pos.x < 6400 && pos.y >= 0 && pos.y < 6400 && m_decor[pos.x / 64, pos.y / 64]->icon == 324; -} - -BOOL CDecor::IsBridge(POINT pos, POINT celBridge) -{ - pos.x += 30; - pos.y += 60; - if (pos.x >= 0 && pos.x < 6400 && pos.y >= 0 && pos.y < 6400 && m_decor[pos.x / 64, pos.y / 64]->icon == 364) - { - celBridge.x = pos.x / 64; - celBridge.y = pos.y / 64; - return TRUE; - } - pos.y -= 60; - if (pos.x >= 0 && pos.x < 6400 && pos.y >= 0 && pos.y < 6400 && m_decor[pos.x / 64, pos.y / 64]->icon == 364) - { - celBridge.x = pos.x / 64; - celBridge.y = pos.y / 64; - return TRUE; - } - return FALSE; - -} - -int CDecor::IsDoor(POINT pos, POINT celPorte) -{ - int num; - if (m_blupiDir == 1) - { - num = -60; - } - else - { - num = 60; - } - pos.x += 30; - for (int i = 0; i < 2; i++) - { - if (pos.x >= 0 && pos.x < 6400 && pos.y >= 0 && pos.y < 6400 && m_decor[pos.x / 64, pos.y / 64]->icon >= 334 && m_decor[pos.x / 64, pos.y / 64]->icon <= 336) - { - celPorte.x = pos.x / 64; - celPorte.y = pos.y / 64; - return m_decor[pos.x / 64, pos.y / 64]->icon; - } - pos.x += num; - } - return -1; -} - -int CDecor::IsTeleporte(POINT pos) -{ - if (pos.x % 64 > 6) - { - return -1; - } - pos.x += 30; - pos.y -= 60; - if (pos.x < 0 || pos.x >= 6400 || pos.y < 0 || pos.y >= 6400) - { - return -1; - } - if (m_decor[pos.x / 64, pos.y / 64]->icon >= 330 && m_decor[pos.x / 64, pos.y / 64]->icon <= 333) - { - return m_decor[pos.x / 64, pos.y / 64]->icon; - } - return -1; -} - -BOOL CDecor::SearchTeleporte(POINT pos, POINT newpos) -{ - int num = IsTeleporte(pos); - if (num == -1) - { - return FALSE; - } - for (int i = 0; i < 100; i++) - { - for (int j = 0; j < 100; j++) - { - if (num == m_decor[i, j]->icon) - { - newpos.x = i * 64; - newpos.y = j * 64 + 60; - if (newpos.x < pos.x - 40 || newpos.x > pos.x + 40 || newpos.y < pos.y - 40 || newpos.y > pos.y + 40) - { - return TRUE; - } - } - } - } - return FALSE; -} - -BOOL CDecor::SomethingMissionPath(int user, int mission, BOOL bUser) -{ - char str[260]; - - GetMissionPath(str, user, mission, bUser); - remove(str); - return TRUE; -} - -BOOL CDecor::IsNormalJump(POINT pos) -{ - pos.x += 32; - pos.y -= 32; - if (m_blupiDir == 1) - { - pos.x -= 15; - } - else - { - pos.x += 15; - } - for (int i = 0; i < 2; i++) - { - int num = pos.x / 64; - int num2 = pos.y / 64; - if (num2 < 0) - { - return FALSE; - } - int icon = m_decor[num, num2]->icon; - if (!IsPassIcon(icon)) - { - return FALSE; - } - pos.y -= 64; - } - return TRUE; -} - -BOOL CDecor::IsSurfWater(POINT pos) -{ - if (pos.y % 64 < 64 - BLUPISURF) - { - return FALSE; - } - int icon = m_decor[(pos.x + 30) / 64, pos.y / 64]->icon; - int icon2 = m_decor[(pos.x + 30) / 64, (pos.y + BLUPISURF) / 64]->icon; - return icon != 92 && icon2 == 92; -} - -BOOL CDecor::IsDeepWater(POINT pos) -{ - int num = (pos.x + 30) / 64; - int num2 = pos.y / 64; - if (num < 0 || num >= 100 || num2 < 0 || num2 >= 100) - { - return FALSE; - } - int icon = m_decor[num, num2]->icon; - return icon == 91 || icon == 92; -} - -BOOL CDecor::IsOutWater(POINT pos) -{ - int icon = m_decor[(pos.x + 30) / 64, (pos.y + 30) / 64]->icon; - return icon != 91 && icon != 92 && IsPassIcon(icon); -} - -BOOL CDecor::IsPassIcon(int icon) -{ - if (icon == 324 && m_time / 4 % 20 >= 18) - { - return TRUE; - } - if (icon >= 0 && icon < MAXQUART) - { - for (int i = 0; i < 16; i++) - { - if (table_decor_quart[icon * 16 + i] != 0) - { - return FALSE; - } - } - } - return TRUE; -} - -BOOL CDecor::IsBlocIcon(int icon) -{ - if (icon < 0 || icon >= MAXQUART) - { - return FALSE; - } - if (icon == 324 && m_time / 4 % 20 < 18) - { - return FALSE; - } - for (int i = 0; i < 16; i++) - { - if (table_decor_quart[icon * 16 + i] == 0) - { - return FALSE; - } - } - return FALSE; -} - -void CDecor::FlushBalleTraj() -{ - for (int i = 0; i < 1300; i++) - { - m_balleTraj[i] = 0; - } -} - -void CDecor::SetBalleTraj(POINT pos) -{ - if (pos.x < 0 || pos.x >= 100 || pos.y < 0 || pos.y >= 100) - { - return; - } - int num = pos.y * 13; - num += pos.x / 8; - int num2 = pos.x & 7; - m_balleTraj[num] |= 1 << num2; -} - -BOOL CDecor::IsBalleTraj(POINT pos) -{ - pos.x = (pos.x + 32) / 64; - pos.y = (pos.y + 32) / 64; - if (pos.x < 0 || pos.x >= 100 || pos.y < 0 || pos.y >= 100) - { - return FALSE; - } - int num = pos.y * 13; - num += pos.x / 8; - int num2 = pos.x & 7; - return (m_balleTraj[num] & 1 << num2) != 0; -} - -void CDecor::FlushMoveTraj() -{ - for (int i = 0; i < 1300; i++) - { - m_moveTraj[i] = 0; - } -} - -void CDecor::SetMoveTraj(POINT pos) -{ - - if (pos.x < 0 || pos.x >= 100 || pos.y < 0 || pos.y >= 100) - { - return; - } - int num = pos.y * 13; - num += pos.x / 8; - int num2 = pos.x & 7; - m_moveTraj[num] |= 1 << num2; -} - -BOOL CDecor::IsMoveTraj(POINT pos) -{ - pos.x = (pos.x + 32) / 64; - pos.y = (pos.y + 32) / 64; - if (pos.x < 0 || pos.x >= 100 || pos.y < 0 || pos.y >= 100) - { - return FALSE; - } - int num = pos.y * 13; - num += pos.x / 8; - int num2 = pos.x & 7; - return (m_moveTraj[num] & 1 << num2) != 0; -} - -int CDecor::SearchDistRight(POINT pos, POINT dir, int type) -{ - int num = 0; - if (type == 36 || type == 39 || type == 41 || type == 42 || type == 93) - { - return 500; - } - pos.x = (pos.x + 32) / 64; - pos.y = (pos.y + 32) / 64; - while (pos.x >= 0 && pos.x < 100 && pos.y >= 0 && pos.y < 100 && !IsBlocIcon(m_decor[pos.x, pos.y]->icon)) - { - if (type == 23) - { - SetBalleTraj(pos); - } - num += 64; - pos.x += dir.x; - pos.y += dir.y; - } - if ((type == 34 || type == 38) && num >= 64) - { - num -= 64; - } - if (type == 23 && num >= 10) - { - num -= 10; - } - return num; -} - -BOOL CDecor::IsVentillo(POINT pos) -{ - int num = 0; - BOOL flag = FALSE; - POINT tinyPoint; - pos.x += 30; - pos.y += 30; - if (pos.x < 0 || pos.x >= 6400 || pos.y < 0 || pos.y >= 6400) - { - return FALSE; - } - int icon = m_decor[pos.x / 64, pos.y / 64]->icon; - if (icon < 126 || icon > 137) - { - return FALSE; - } - if (icon == 126) - { - if (pos.x % 64 <= 16) - { - flag = TRUE; - } - tinyPoint.x = -64; - tinyPoint.y = 0; - num = 110; - } - if (icon == 129) - { - if (pos.x % 64 >= 48) - { - flag = TRUE; - } - tinyPoint.x = 64; - tinyPoint.y = 0; - num = 114; - } - if (icon == 132) - { - if (pos.y % 64 <= 32) - { - flag = TRUE;; - } - tinyPoint.x = 0; - tinyPoint.y = -64; - num = 118; - } - if (icon == 135) - { - if (pos.y % 64 >= 48) - { - flag = TRUE; - } - tinyPoint.x = 0; - tinyPoint.y = 64; - num = 122; - } - if (!flag) - { - return FALSE; - } - ModifDecor(pos, -1, TRUE); - do - { - pos.x += tinyPoint.x; - pos.y += tinyPoint.y; - if (num != m_decor[pos.x / 64, pos.y / 64]->icon) - { - break; - } - ModifDecor(pos, -1, TRUE); - } - while (pos.x >= 0 && pos.x < 6400 && pos.y >= 0 && pos.y < 6400); - return TRUE; -} - -// Birdlime - -void CDecor::StartSploutchGlu(POINT pos) -{ - POINT pos2; - pos2.x = pos.x; - pos2.y = pos.y; - ObjectStart(pos2, 98, 0); - pos2.x = pos.x + 15; - pos2.y = pos.y + 20; - ObjectStart(pos2, 99, 0); - pos2.x = pos.x - 20; - pos2.y = pos.y + 18; - ObjectStart(pos2, 99, 0); - pos2.x = pos.x + 23; - pos2.y = pos.y - 18; - ObjectStart(pos2, 99, 0); - pos2.x = pos.x - 15; - pos2.y = pos.y - 18; - ObjectStart(pos2, 99, 0); - pos2.x = pos.x + 32; - pos2.y = pos.y + 10; - ObjectStart(pos2, 100, 0); - pos2.x = pos.x - 28; - pos2.y = pos.y + 15; - ObjectStart(pos2, 100, 0); - StopSound(SOUND_16_HELICOHIGH); - StopSound(SOUND_18_HELICOLOW); - StopSound(SOUND_29_JEEPHIGH); - StopSound(SOUND_31_JEEPLOW); - PlaySoundB(SOUND_51_GLU, pos, 0); -} - -int CDecor::ObjectStart(POINT pos, int type, int speed) -{ - int num = MoveObjectFree(); - if (num == -1) - { - return -1; - } - m_moveObject[num]->type = type; - m_moveObject[num]->phase = 0; - m_moveObject[num]->posCurrent = pos; - m_moveObject[num]->posStart = pos; - m_moveObject[num]->posEnd = pos; - MoveObjectStepIcon(num); - if (speed != 0) - { - POINT tinyPoint = pos; - int num2 = speed; - int num3 = 0; - if (num2 > 50) - { - num2 -= 50; - POINT dir; - dir.x = 0; - dir.y = 1; - num3 = SearchDistRight(tinyPoint, dir, type); - tinyPoint.y += num3; - } - else if (num < -50) - { - num2 += 50; - POINT dir; - dir.x = 0; - dir.y = -1; - num3 = SearchDistRight(tinyPoint, dir, type); - tinyPoint.y -= num3; - } - else if (num2 > 0) - { - POINT dir; - dir.x = 1; - dir.y = 0; - num3 = SearchDistRight(tinyPoint, dir, type); - tinyPoint.x += num3; - } - else if (num2 < 0) - { - POINT dir; - dir.x = -1; - dir.y = 0; - num3 = SearchDistRight(tinyPoint, dir, type); - tinyPoint.x -= num3; - } - if (num3 == 0) - { - if (type == 23) - { - m_moveObject[num]->type = 0; - return num; - } - } - else - { - m_moveObject[num]->posEnd = tinyPoint; - m_moveObject[num]->timeStopStart = 0; - m_moveObject[num]->stepAdvance = abs(num2 * num3 / 64); - m_moveObject[num]->step = 2; - m_moveObject[num]->time = 0; - } - } - MoveObjectPriority(num); - return num; -} - -BOOL CDecor::ObjectDelete(POINT pos, int type, int something) -{ - POINT pos1; - int move; - int type2; - - pos1 = pos; - move = MoveObjectSearch(pos, type); - - if (move == -1) - { - return FALSE; - } - m_moveObject[move]->type = TYPE_EMPTY; - - if (something != 0) - { - LOWORD(pos.x = 21); - HIWORD(pos.x = 0); - LOWORD(pos.y = pos.y); - HIWORD(pos.y = type); - NetMessagePush((NetMessage*)&pos); - } - return TRUE; -} - -void CDecor::ModifDecor(POINT pos, int icon, BOOL bMulti) -{ - int num, num2; - POINT pos2; - - pos2 = pos; - num = pos.x; - num2 = pos.y; - - pos.y = (short)icon; - - m_decor[(int)(num + (num >> 31 & 63)) >> 6][(int)(num2 + (num2 >> 31 & 63)) >> 6].icon = pos.y; - - if (bMulti != FALSE) - { - LOWORD(pos.x = 30); - HIWORD(pos.x = num); - LOWORD(pos.y = num2); - HIWORD(pos.y = pos2.y); - NetMessagePush((NetMessage*)&pos); - } - return; -} - -void CDecor::NetMessageIndexFlush() -{ - m_netMessageIndex1 = 0; - m_netMessageIndex2 = 0; - m_netMessageIndex3 = 0; - return; -} - -void CDecor::NotifFlush() -{ - int players; - char(*notifBuffer)[100]; - - notifBuffer = m_notifText; - - m_notifTime = 0; -} - -void CDecor::NotifPop() -{ - char(*notifText)[100]; - int i; - int num; - const void* num2; - void* num3; - int string; - - notifText = m_notifText; - i = 3; - for (i = 0; i < 3; i++) - { - string = strlen((const char*)(i + 100)) + 1; - num = (int)notifText + 100 + string++; - num2 = (const void*)(num + 1 - string); - num3 = (void*)notifText; - string += 100; - memcpy(num3, num2, string - 1); - --i; - } - if (i == 0) - { - m_notifText[3][0] = '\0'; - m_notifTime = 200; - } - return; -} - -void CDecor::NotifPush(char* str) -{ - int i; - char* num; - char(*text)[100]; - POINT pos; - - i = 0; - text = m_notifText; - - while (*text) - { - i++; - text += 100; - if (i >= 4) - { - NotifPop(); - num = (char*)m_notifText + i; - goto LABEL_5; - } - } - num = (char*)m_notifText + 3; - -LABEL_5: - strcpy(num, str); - m_notifTime = 200; - pos.x = 320; - pos.y = 240; - m_pSound->PlayImage(11, pos, -1); - return; -} - -BOOL CDecor::NetMessagePush(NetMessage* message) -{ - NetMessage* messages; - BYTE data; - short pos; - int i; - - if (m_netMessageIndex1 == NETEVENTMAX) - { - return FALSE; - } - - i = m_netMessageIndex2; - data = message->data1; - pos = message->x; - messages = m_netMessages + i; - messages->messageType = message->messageType; - messages->data1 = data; - pos = message->channel; - - m_netMessages[i].y = message->y; - m_netMessages[i].channel = pos; - i = m_netMessageIndex2 + 1; - m_netMessageIndex1++; - m_netMessageIndex2 = i; - - if (i == NETEVENTMAX) - { - m_netEventIndex2 = 0; - } - return TRUE; -} - -void CDecor::NetSendData(BYTE bufferSize, UCHAR send) -{ - int data; - - data = ((UINT)bufferSize, 4); - data = (send, (int)data); - m_pNetwork->Send(&data, 4, DPSEND_GUARANTEED); - return; -} - -void CDecor::NetPlayerCollide(POINT pos, int* out) -{ - tagRECT rect1; - RECT rect2; - RECT rect3; - - -} - -void CDecor::NetDataFlush() -{ - int i; - LONG* net; - int* playerPackets; - - playerPackets = m_netPlayerPacketsRecieved; - net = (LONG*)m_netVitesses[0].y; - - for (i = 0; i < 4; i++) - { - m_netPacketIcon.icon = 65535; - m_netPacketIcon.type = 65535; - playerPackets = 0; - playerPackets[4] = 0; - m_netVitesses->x = 0; - ((POINT*)(net + -1))->x = 0; - playerPackets++; - net++; - i++; - } - m_netPacketsSent = 0; - m_netPacketsSent2 = 0; - m_netPacketsRecieved = 0; - m_netPacketsRecieved2 = 0; - m_netPacketIcon.icon = 65535; - m_netPacketIcon.type = 65535; - NetMessageIndexFlush(); -} - -void CDecor::NetPlaySound(short channel, POINT pos) -{ - NetMessage event; - - event.y = (short)pos.y; - event.x = (short)pos.x; - event.messageType = PK_PLAYSOUND; - event.data1 = 0; - event.channel = channel; - NetMessagePush(&event); - return; -} - -void CDecor::NetStopCloud(int rank) -{ - NetMessage cloud; - - cloud.data1 = 0; - cloud.x = 0; - cloud.y = 0; - cloud.messageType = 60; - cloud.channel = (short)rank; - NetMessagePush(&cloud); - return; -} - -void CDecor::MoveObjectStep() -{ - m_blupiVector.x = 0; - m_blupiVector.y = 0; - m_blupiTransport = -1; - for (int i = 0; i < MAXMOVEOBJECT; i++) - { - if (m_moveObject[i]->type != 0) - { - MoveObjectStepLine(i); - MoveObjectStepIcon(i); - if (m_moveObject[i]->type == 4 || - m_moveObject[i]->type == 33 || - m_moveObject[i]->type == 32) - { - int num = MovePersoDetect(m_moveObject[i]->posCurrent); - if (num != -1) - { - POINT posCurrent = m_moveObject[i]->posCurrent; - posCurrent.x -= 34; - posCurrent.y -= 34; - ObjectStart(posCurrent, 8, 0); - PlaySoundB(SOUND_10_BOUM, m_moveObject[i]->posCurrent, 0); - m_decorAction = 1; - m_decorPhase = 0; - posCurrent = m_moveObject[i]->posCurrent; - posCurrent.x += 2; - posCurrent.y += BLUPIOFFY; - ObjectDelete(m_moveObject[i]->posCurrent, m_moveObject[i]->type, 1); - ObjectStart(posCurrent, 37, 0); - ObjectDelete(m_moveObject[num]->posCurrent, m_moveObject[num]->type, 1); - } - if (BlupiElectro(m_moveObject[i]->posCurrent)) - { - POINT posCurrent = m_moveObject[i]->posCurrent; - posCurrent.x += 2; - posCurrent.y += BLUPIOFFY; - ObjectDelete(m_moveObject[i]->posCurrent, m_moveObject[i]->type, 1); - ObjectStart(posCurrent, 38, 55); - PlaySoundB(SOUND_59_ELECTRO, posCurrent, 0); - } - } - - } - } -} - - -void CDecor::MoveObjectStepLine(int i) -{ - MoveObject moveObject; - POINT tinyPoint; - BOOL flag = FALSE; - RECT tinyRect; - if (m_moveObject[i]->type == 1 || m_moveObject[i]->type == 47 || m_moveObject[i]->type == 48 && !m_blupiSuspend) - { - RECT src; - src.left = m_blupiPos.x + 20; - src.right = m_blupiPos.x + 60 - 20; - src.top = m_blupiPos.y + 60 - 2; - src.bottom = m_blupiPos.y + 60 - 1; - tinyRect.left = m_moveObject[i]->posCurrent.x; - tinyRect.right = m_moveObject[i]->posCurrent.x + 64; - tinyRect.top = m_moveObject[i]->posCurrent.y; - tinyRect.bottom = m_moveObject[i]->posCurrent.y + 16; - RECT tinyRect2; - flag = IntersectRect(&tinyRect2, &tinyRect, &src); - tinyPoint = m_moveObject[i]->posCurrent; - } - POINT posCurrent; - if (m_blupiFocus && !m_blupiHide && m_moveObject[i]->type == 97) - { - posCurrent = m_moveObject[i]->posCurrent; - if (posCurrent.x < m_blupiPos.x) - { - posCurrent.x++; - } - if (posCurrent.x > m_blupiPos.x) - { - posCurrent.x--; - } - if (posCurrent.y < m_blupiPos.y) - { - posCurrent.y++; - } - if (posCurrent.y > m_blupiPos.y) - { - posCurrent.y--; - } - tinyRect.left = posCurrent.x + 10; - tinyRect.right = posCurrent.x + 60 - 10; - tinyRect.top = posCurrent.y + 10; - tinyRect.bottom = posCurrent.y + 60 - 10; - if (TestPath(tinyRect, m_moveObject[i]->posCurrent, posCurrent)) - { - m_moveObject[i]->posCurrent = posCurrent; - m_moveObject[i]->posStart = posCurrent; - m_moveObject[i]->posEnd = posCurrent; - } - else - { - ObjectDelete(m_moveObject[i]->posCurrent, m_moveObject[i]->type, 1); - posCurrent.x -= 34; - posCurrent.y -= 34; - ObjectStart(posCurrent, 9, 0); - PlaySoundB(SOUND_10_BOUM, posCurrent, 0); - m_decorAction = 1; - m_decorPhase = 0; - } - } - if (m_moveObject[i]->posStart.x != m_moveObject[i]->posEnd.x || m_moveObject[i]->posStart.y != m_moveObject[i]->posEnd.y) - { - if (m_moveObject[i]->step == 1) - { - if (m_moveObject[i]->time < m_moveObject[i]->timeStopStart) - { - - m_moveObject[i]->time = m_moveObject[i]->time + 1; - } - else - { - m_moveObject[i]->step = 2; - m_moveObject[i]->time = 0; - } - } - else if (m_moveObject[i]->step == 2) - { - if (m_moveObject[i]->posCurrent.x != m_moveObject[i]->posEnd.x || m_moveObject[i]->posCurrent.x != m_moveObject[i]->posEnd.y) - { - - m_moveObject[i]->time = m_moveObject[i]->time + 1; - if (m_moveObject[i]->stepAdvance != 0) - { - m_moveObject[i]->posCurrent.x = (m_moveObject[i]->posEnd.x - m_moveObject[i]->posStart.x) * m_moveObject[i]->time / m_moveObject[i]->stepAdvance + m_moveObject[i]->posStart.x; - m_moveObject[i]->posCurrent.y = (m_moveObject[i]->posEnd.y - m_moveObject[i]->posStart.y) * m_moveObject[i]->time / m_moveObject[i]->stepAdvance + m_moveObject[i]->posStart.y; - } - - } - else if (m_moveObject[i]->type == 15 || m_moveObject[i]->type == 23) - { - m_moveObject[i]->type = 0; - } - else if (m_moveObject[i]->type == 34) - { - m_moveObject[i]->posStart = m_moveObject[i]->posCurrent; - m_moveObject[i]->posEnd = m_moveObject[i]->posCurrent; - m_moveObject[i]->step = 3; - m_moveObject[i]->time = 0; - } - else - { - m_moveObject[i]->step = 3; - m_moveObject[i]->time = 0; - } - } - else if (m_moveObject[i]->step == 3) - { - if (m_moveObject[i]->time < m_moveObject[i]->timeStopEnd) - { - - m_moveObject[i]->time = m_moveObject[i]->time + 1; - } - else - { - m_moveObject[i]->step = 4; - m_moveObject[i]->time = 0; - } - } - else if (m_moveObject[i]->step == 4) - { - if (m_moveObject[i]->posCurrent.x != m_moveObject[i]->posStart.x || m_moveObject[i]->posCurrent.y != m_moveObject[i]->posStart.y) - { - m_moveObject[i]->time = m_moveObject[i]->time + 1; - if (m_moveObject[i]->stepRecede != 0) - { - m_moveObject[i]->posCurrent.x = (m_moveObject[i]->posStart.x - m_moveObject[i]->posEnd.x) * - m_moveObject[i]->time / m_moveObject[i]->stepRecede + m_moveObject[i]->posEnd.x; - m_moveObject[i]->posCurrent.y = (m_moveObject[i]->posStart.y - m_moveObject[i]->posEnd.y) * - m_moveObject[i]->time / m_moveObject[i]->stepRecede + m_moveObject[i]->posEnd.y; - } - } - else - { - m_moveObject[i]->step = 1; - m_moveObject[i]->time = 0; - } - } - } - if (m_moveObject[i]->type == 22 && m_moveObject[i]->step == 3) - { - m_moveObject[i]->type = 0; - } - posCurrent = m_moveObject[i]->posCurrent; - if (m_moveObject[i]->type == 1 || m_moveObject[i]->type == 47 || m_moveObject[i]->type == 48) - { - posCurrent.y -= 64; - } - posCurrent.x = (posCurrent.x + 32) / 64; - posCurrent.y = (posCurrent.y + 32) / 64; - SetMoveTraj(posCurrent); - if (flag) - { - m_blupiVector.x = m_moveObject[i]->posCurrent.x - tinyPoint.x; - m_blupiVector.y = m_moveObject[i]->posCurrent.y - (m_blupiPos.y + 60 - BLUPIFLOOR); - if (m_moveObject[i]->type == 47) - { - m_blupiVector.x = m_blupiVector.x + 2; - } - if (m_moveObject[i]->type == 48) - { - m_blupiVector.x = m_blupiVector.x - 2; - } - if (m_blupiTimeNoAsc == 0) - { - m_blupiTransport = i; - } - } -} - - - -void CDecor::MoveObjectStepIcon(int i) -{ - if (m_moveObject[i]->type == 47) - { - m_moveObject[i]->icon = table_chenille[m_moveObject[i]->phase / 1 % 6]; - } - if (m_moveObject[i]->type == 48) - { - m_moveObject[i]->icon = table_chenillei[m_moveObject[i]->phase / 1 % 6]; - } - if (m_moveObject[i]->type == 2) - { - m_moveObject[i]->icon = 12 + m_moveObject[i]->phase / 2 % 9; - m_moveObject[i]->channel = 10; - } - if (m_moveObject[i]->type == 3) - { - m_moveObject[i]->icon = 48 + m_moveObject[i]->phase / 2 % 9; - m_moveObject[i]->channel = 10; - } - if (m_moveObject[i]->type == 16) - { - m_moveObject[i]->icon = 69 + m_moveObject[i]->phase / 1 % 9; - m_moveObject[i]->channel = 10; - } - if (m_moveObject[i]->type == 96) - { - m_moveObject[i]->icon = table_follow1[m_moveObject[i]->phase / 1 % 26]; - m_moveObject[i]->channel = 10; - } - if (m_moveObject[i]->type == 97) - { - m_moveObject[i]->icon = table_follow2[m_moveObject[i]->phase / 1 % 5]; - m_moveObject[i]->channel = 10; - } - if (m_moveObject[i]->type == 200) - { - m_moveObject[i]->icon = 257 + m_moveObject[i]->phase / 1 % 6; - m_moveObject[i]->channel = 2; - } - if (m_moveObject[i]->type == 201) - { - m_moveObject[i]->icon = 257 + m_moveObject[i]->phase / 1 % 6; - m_moveObject[i]->channel = 11; - } - if (m_moveObject[i]->type == 202) - { - m_moveObject[i]->icon = 257 + m_moveObject[i]->phase / 1 % 6; - m_moveObject[i]->channel = 12; - } - if (m_moveObject[i]->type == 203) - { - m_moveObject[i]->icon = 257 + m_moveObject[i]->phase / 1 % 6; - m_moveObject[i]->channel = 13; - } - if (m_moveObject[i]->type == 55) - { - m_moveObject[i]->icon = 252; - m_moveObject[i]->channel = 10; - } - if (m_moveObject[i]->type == 56) - { - m_moveObject[i]->icon = table_dynamitef[m_moveObject[i]->phase / 1 % 100]; - m_moveObject[i]->channel = 10; - if (m_moveObject[i]->phase == 50) - { - DynamiteStart(i, 0, 0); - } - if (m_moveObject[i]->phase == 53) - { - DynamiteStart(i, -100, 8); - } - if (m_moveObject[i]->phase == 55) - { - DynamiteStart(i, 80, 10); - } - if (m_moveObject[i]->phase == 56) - { - DynamiteStart(i, -15, -100); - } - if (m_moveObject[i]->phase == 59) - { - DynamiteStart(i, 20, 70); - } - if (m_moveObject[i]->phase == 62) - { - DynamiteStart(i, 30, -50); - } - if (m_moveObject[i]->phase == 64) - { - DynamiteStart(i, -40, 30); - } - if (m_moveObject[i]->phase == 67) - { - DynamiteStart(i, -180, 10); - } - if (m_moveObject[i]->phase == 69) - { - DynamiteStart(i, 200, -10); - } - if (m_moveObject[i]->phase >= 70) - { - m_moveObject[i]->type = 0; - } - } - if (m_moveObject[i]->type == 5) - { - if (m_moveObject[i]->phase / 3 % 22 < 11) - { - m_moveObject[i]->icon = m_moveObject[i]->phase / 3 % 11; - } - else - { - m_moveObject[i]->icon = 11 - m_moveObject[i]->phase / 3 % 11; - } - m_moveObject[i]->channel = 10; - } - if (m_moveObject[i]->type == 6) - { - m_moveObject[i]->icon = 21 + m_moveObject[i]->phase / 4 % 8; - m_moveObject[i]->channel = 10; - } - if (m_moveObject[i]->type == 7) - { - m_moveObject[i]->icon = 29 + m_moveObject[i]->phase / 3 % 8; - m_moveObject[i]->channel = 10; - } - if (m_moveObject[i]->type == 21) - { - m_moveObject[i]->icon = table_cle[m_moveObject[i]->phase / 3 % 12]; - m_moveObject[i]->channel = 10; - } - if (m_moveObject[i]->type == 49) - { - m_moveObject[i]->icon = table_cle1[m_moveObject[i]->phase / 3 % 12]; - m_moveObject[i]->channel = 10; - } - if (m_moveObject[i]->type == 50) - { - m_moveObject[i]->icon = table_cle2[m_moveObject[i]->phase / 3 % 12]; - m_moveObject[i]->channel = 10; - } - if (m_moveObject[i]->type == 51) - { - m_moveObject[i]->icon = table_cle3[m_moveObject[i]->phase / 3 % 12]; - m_moveObject[i]->channel = 10; - } - if (m_moveObject[i]->type == 24) - { - m_moveObject[i]->icon = table_skate[m_moveObject[i]->phase / 1 % 34]; - m_moveObject[i]->channel = 10; - } - if (m_moveObject[i]->type == 25) - { - m_moveObject[i]->icon = table_shield[m_moveObject[i]->phase / 2 % 16]; - m_moveObject[i]->channel = 10; - } - if (m_moveObject[i]->type == 26) - { - m_moveObject[i]->icon = table_power[m_moveObject[i]->phase / 2 % 8]; - m_moveObject[i]->channel = 10; - } - if (m_moveObject[i]->type == 40) - { - m_moveObject[i]->icon = table_invert[m_moveObject[i]->phase / 2 % 20]; - m_moveObject[i]->channel = 10; - } - if (m_moveObject[i]->type == 31) - { - m_moveObject[i]->icon = table_charge[m_moveObject[i]->phase / 2 % 6]; - m_moveObject[i]->channel = 1; - } - if (m_moveObject[i]->type == 27) - { - m_moveObject[i]->icon = table_magictrack[m_moveObject[i]->phase / 1 % 24]; - m_moveObject[i]->channel = 10; - if (m_moveObject[i]->phase >= 24) - { - m_moveObject[i]->type = 0; - } - } - if (m_moveObject[i]->type == 57) - { - m_moveObject[i]->icon = table_shieldtrack[m_moveObject[i]->phase / 1 % 20]; - m_moveObject[i]->channel = 10; - if (m_moveObject[i]->phase >= 20) - { - m_moveObject[i]->type = 0; - } - } - if (m_moveObject[i]->type == 39) - { - m_moveObject[i]->icon = table_tresortrack[m_moveObject[i]->phase / 1 % 11]; - m_moveObject[i]->channel = 10; - if (m_moveObject[i]->phase >= 11) - { - m_moveObject[i]->type = 0; - } - } - if (m_moveObject[i]->type == 58 && m_moveObject[i]->phase >= 20) - { - m_moveObject[i]->type = 0; - } - if (m_moveObject[i]->type == 8) - { - if (m_moveObject[i]->phase >= (int)table_explo1) - { - m_moveObject[i]->type = 0; - } - else - { - m_moveObject[i]->icon = table_explo1[m_moveObject[i]->phase]; - m_moveObject[i]->channel = 9; - } - } - if (m_moveObject[i]->type == 9) - { - if (m_moveObject[i]->phase >= 20) - { - m_moveObject[i]->type = 0; - } - else - { - m_moveObject[i]->icon = table_explo2[m_moveObject[i]->phase % 20]; - m_moveObject[i]->channel = 9; - } - } - if (m_moveObject[i]->type == 10) - { - if (m_moveObject[i]->phase >= 20) - { - m_moveObject[i]->type = 0; - } - else - { - m_moveObject[i]->icon = table_explo3[m_moveObject[i]->phase / 1 % 20]; - m_moveObject[i]->channel = 9; - } - } - if (m_moveObject[i]->type == 11) - { - if (m_moveObject[i]->phase >= 9) - { - m_moveObject[i]->type = 0; - } - else - { - m_moveObject[i]->icon = table_explo4[m_moveObject[i]->phase / 1 % 9]; - m_moveObject[i]->channel = 9; - } - } - if (m_moveObject[i]->type == 90) - { - if (m_moveObject[i]->phase >= 12) - { - m_moveObject[i]->type = 0; - } - else - { - m_moveObject[i]->icon = table_explo5[m_moveObject[i]->phase / 1 % 12]; - m_moveObject[i]->channel = 9; - } - } - if (m_moveObject[i]->type == 91) - { - if (m_moveObject[i]->phase >= 6) - { - m_moveObject[i]->type = 0; - } - else - { - m_moveObject[i]->icon = table_explo6[m_moveObject[i]->phase / 1 % 6]; - m_moveObject[i]->channel = 9; - } - } - if (m_moveObject[i]->type == 92) - { - if (m_moveObject[i]->phase >= 128) - { - m_moveObject[i]->type = 0; - } - else - { - m_moveObject[i]->icon = table_explo7[m_moveObject[i]->phase / 1 % 128]; - m_moveObject[i]->channel = 9; - } - } - if (m_moveObject[i]->type == 93) - { - if (m_moveObject[i]->phase >= 5) - { - m_moveObject[i]->type = 0; - } - else - { - m_moveObject[i]->icon = table_explo8[m_moveObject[i]->phase / 1 % 5]; - m_moveObject[i]->channel = 9; - } - } - if (m_moveObject[i]->type == 98) - { - if (m_moveObject[i]->phase >= 10) - { - m_moveObject[i]->type = 0; - } - else - { - m_moveObject[i]->icon = table_sploutch1[m_moveObject[i]->phase / 1 % 10]; - m_moveObject[i]->channel = 9; - } - } - if (m_moveObject[i]->type == 99) - { - if (m_moveObject[i]->phase >= 13) - { - m_moveObject[i]->type = 0; - } - else - { - m_moveObject[i]->icon = table_sploutch2[m_moveObject[i]->phase / 1 % 13]; - m_moveObject[i]->channel = 9; - } - } - if (m_moveObject[i]->type == 100) - { - if (m_moveObject[i]->phase >= 18) - { - m_moveObject[i]->type = 0; - } - else - { - m_moveObject[i]->icon = table_sploutch3[m_moveObject[i]->phase / 1 % 18]; - m_moveObject[i]->channel = 9; - } - } - if (m_moveObject[i]->type == 53) - { - if (m_moveObject[i]->phase >= 90) - { - m_moveObject[i]->type = 0; - } - else - { - m_moveObject[i]->icon = table_tentacule[m_moveObject[i]->phase / 2 % 45]; - m_moveObject[i]->channel = 9; - } - } - POINT pos; - if (m_moveObject[i]->type == 52) - { - if (m_moveObject[i]->phase == 0) - { - PlaySoundB(72, m_moveObject[i]->posStart, 0); - } - if (m_moveObject[i]->phase == 137) - { - PlaySoundB(73, m_moveObject[i]->posStart, 0); - } - if (m_moveObject[i]->phase >= 157) - { - m_moveObject[i]->type = 0; - } - else - { - m_moveObject[i]->icon = table_bridge[m_moveObject[i]->phase / 1 % 157]; - m_moveObject[i]->channel = 1; - pos.x = m_moveObject[i]->posStart.x / 64; - pos.y = m_moveObject[i]->posStart.y / 64; - m_decor[pos.x, pos.y]->icon = m_moveObject[i]->icon; - } - } - if (m_moveObject[i]->type == 36) - { - if (m_moveObject[i]->phase >= 16) - { - m_moveObject[i]->type = 0; - } - else - { - m_moveObject[i]->icon = table_pollution[m_moveObject[i]->phase / 2 % 8]; - m_moveObject[i]->channel = 10; - } - } - if (m_moveObject[i]->type == 41) - { - if (m_moveObject[i]->phase >= 16) - { - m_moveObject[i]->type = 0; - } - else - { - m_moveObject[i]->icon = table_invertstart[m_moveObject[i]->phase / 2 % 8]; - m_moveObject[i]->channel = 10; - } - } - if (m_moveObject[i]->type == 42) - { - if (m_moveObject[i]->phase >= 16) - { - m_moveObject[i]->type = 0; - } - else - { - m_moveObject[i]->icon = table_invertstop[m_moveObject[i]->phase / 2 % 8]; - m_moveObject[i]->channel = 10; - } - } - if (m_moveObject[i]->type == 14) - { - if (m_moveObject[i]->phase >= 14) - { - m_moveObject[i]->type = 0; - } - else - { - m_moveObject[i]->icon = table_plouf[m_moveObject[i]->phase / 2 % 7]; - m_moveObject[i]->channel = 1; - } - } - if (m_moveObject[i]->type == 35) - { - if (m_moveObject[i]->phase >= 6) - { - m_moveObject[i]->type = 0; - } - else - { - m_moveObject[i]->icon = table_tiplouf[m_moveObject[i]->phase / 2 % 7]; - m_moveObject[i]->channel = 1; - } - } - if (m_moveObject[i]->type == 15) - { - m_moveObject[i]->icon = table_blup[m_moveObject[i]->phase / 2 % 20]; - m_moveObject[i]->channel = 1; - } - if (m_moveObject[i]->type == 4) - { - if (m_moveObject[i]->posStart.x > m_moveObject[i]->posEnd.x) - { - if (m_moveObject[i]->step == 1) - { - m_moveObject[i]->icon = table_bulldozer_turn2l[m_moveObject[i]->time % 22]; - } - if (m_moveObject[i]->step == 3) - { - m_moveObject[i]->icon = table_bulldozer_turn2r[m_moveObject[i]->time % 22]; - } - if (m_moveObject[i]->step == 2) - { - m_moveObject[i]->icon = table_bulldozer_left[m_moveObject[i]->time % 8]; - } - if (m_moveObject[i]->step == 4) - { - m_moveObject[i]->icon = table_bulldozer_right[m_moveObject[i]->time % 8]; - } - } - else - { - if (m_moveObject[i]->step == 1) - { - m_moveObject[i]->icon = table_bulldozer_turn2r[m_moveObject[i]->time % 22]; - } - if (m_moveObject[i]->step == 3) - { - m_moveObject[i]->icon = table_bulldozer_turn2l[m_moveObject[i]->time % 22]; - } - if (m_moveObject[i]->step == 2) - { - m_moveObject[i]->icon = table_bulldozer_right[m_moveObject[i]->time % 8]; - } - if (m_moveObject[i]->step == 4) - { - m_moveObject[i]->icon = table_bulldozer_left[m_moveObject[i]->time % 8]; - } - } - m_moveObject[i]->channel = 10; - } - if (m_moveObject[i]->type == 17) - { - if (m_moveObject[i]->posStart.x > m_moveObject[i]->posEnd.x) - { - if (m_moveObject[i]->step == 1) - { - m_moveObject[i]->icon = table_poisson_turn2l[m_moveObject[i]->time % 48]; - } - if (m_moveObject[i]->step == 3) - { - m_moveObject[i]->icon = table_poisson_turn2r[m_moveObject[i]->time % 48]; - } - if (m_moveObject[i]->step == 2) - { - m_moveObject[i]->icon = table_poisson_left[m_moveObject[i]->time % 8]; - } - if (m_moveObject[i]->step == 4) - { - m_moveObject[i]->icon = table_poisson_right[m_moveObject[i]->time % 8]; - } - } - else - { - if (m_moveObject[i]->step == 1) - { - m_moveObject[i]->icon = table_poisson_turn2r[m_moveObject[i]->time % 48]; - } - if (m_moveObject[i]->step == 3) - { - m_moveObject[i]->icon = table_poisson_turn2l[m_moveObject[i]->time % 48]; - } - if (m_moveObject[i]->step == 2) - { - m_moveObject[i]->icon = table_poisson_right[m_moveObject[i]->time % 8]; - } - if (m_moveObject[i]->step == 4) - { - m_moveObject[i]->icon = table_poisson_left[m_moveObject[i]->time % 8]; - } - } - m_moveObject[i]->channel = 10; - } - if (m_moveObject[i]->type == 20) - { - if (m_moveObject[i]->posStart.x > m_moveObject[i]->posEnd.x) - { - if (m_moveObject[i]->step == 1) - { - m_moveObject[i]->icon = table_oiseau_turn2l[m_moveObject[i]->time % 10]; - } - if (m_moveObject[i]->step == 3) - { - m_moveObject[i]->icon = table_oiseau_turn2r[m_moveObject[i]->time % 10]; - } - if (m_moveObject[i]->step == 2) - { - m_moveObject[i]->icon = table_oiseau_left[m_moveObject[i]->time % 8]; - } - if (m_moveObject[i]->step == 4) - { - m_moveObject[i]->icon = table_oiseau_right[m_moveObject[i]->time % 8]; - } - } - else - { - if (m_moveObject[i]->step == 1) - { - m_moveObject[i]->icon = table_oiseau_turn2r[m_moveObject[i]->time % 10]; - } - if (m_moveObject[i]->step == 3) - { - m_moveObject[i]->icon = table_oiseau_turn2l[m_moveObject[i]->time % 10]; - } - if (m_moveObject[i]->step == 2) - { - m_moveObject[i]->icon = table_oiseau_right[m_moveObject[i]->time % 8]; - } - if (m_moveObject[i]->step == 4) - { - m_moveObject[i]->icon = table_oiseau_left[m_moveObject[i]->time % 8]; - } - } - m_moveObject[i]->channel = 10; - } - if (m_moveObject[i]->type == 44) - { - if (m_moveObject[i]->posStart.x > m_moveObject[i]->posEnd.x) - { - if (m_moveObject[i]->step == 1) - { - m_moveObject[i]->icon = table_guepe_turn2l[m_moveObject[i]->time % 5]; - } - if (m_moveObject[i]->step == 3) - { - m_moveObject[i]->icon = table_guepe_turn2r[m_moveObject[i]->time % 5]; - } - if (m_moveObject[i]->step == 2) - { - m_moveObject[i]->icon = table_guepe_left[m_moveObject[i]->time % 6]; - } - if (m_moveObject[i]->step == 4) - { - m_moveObject[i]->icon = table_guepe_right[m_moveObject[i]->time % 6]; - } - } - else - { - if (m_moveObject[i]->step == 1) - { - m_moveObject[i]->icon = table_guepe_turn2r[m_moveObject[i]->time % 5]; - } - if (m_moveObject[i]->step == 3) - { - m_moveObject[i]->icon = table_guepe_turn2l[m_moveObject[i]->time % 5]; - } - if (m_moveObject[i]->step == 2) - { - m_moveObject[i]->icon = table_guepe_right[m_moveObject[i]->time % 6]; - } - if (m_moveObject[i]->step == 4) - { - m_moveObject[i]->icon = table_guepe_left[m_moveObject[i]->time % 6]; - } - } - m_moveObject[i]->channel = 10; - } - if (m_moveObject[i]->type == 54) - { - if (m_moveObject[i]->posStart.x > m_moveObject[i]->posEnd.x) - { - if (m_moveObject[i]->step == 1) - { - m_moveObject[i]->icon = table_creature_turn2[m_moveObject[i]->time % 152]; - } - if (m_moveObject[i]->step == 3) - { - m_moveObject[i]->icon = table_creature_turn2[m_moveObject[i]->time % 152]; - } - if (m_moveObject[i]->step == 2) - { - m_moveObject[i]->icon = table_creature_left[m_moveObject[i]->time % 8]; - } - if (m_moveObject[i]->step == 4) - { - m_moveObject[i]->icon = table_creature_right[m_moveObject[i]->time % 8]; - } - } - else - { - if (m_moveObject[i]->step == 1) - { - m_moveObject[i]->icon = table_creature_turn2[m_moveObject[i]->time % 152]; - } - if (m_moveObject[i]->step == 3) - { - m_moveObject[i]->icon = table_creature_turn2[m_moveObject[i]->time % 152]; - } - if (m_moveObject[i]->step == 2) - { - m_moveObject[i]->icon = table_creature_right[m_moveObject[i]->time % 8]; - } - if (m_moveObject[i]->step == 4) - { - m_moveObject[i]->icon = table_creature_left[m_moveObject[i]->time % 8]; - } - } - m_moveObject[i]->channel = 10; - } - if (m_moveObject[i]->type == 32) - { - if (m_moveObject[i]->posStart.x > m_moveObject[i]->posEnd.x) - { - if (m_moveObject[i]->step == 1) - { - m_moveObject[i]->icon = table_blupih_turn2l[m_moveObject[i]->time % 26]; - } - if (m_moveObject[i]->step == 3) - { - m_moveObject[i]->icon = table_blupih_turn2r[m_moveObject[i]->time % 26]; - } - if (m_moveObject[i]->step == 2) - { - m_moveObject[i]->icon = table_blupih_left[m_moveObject[i]->time % 8]; - } - if (m_moveObject[i]->step == 4) - { - m_moveObject[i]->icon = table_blupih_right[m_moveObject[i]->time % 8]; - } - } - else - { - if (m_moveObject[i]->step == 1) - { - m_moveObject[i]->icon = table_blupih_turn2r[m_moveObject[i]->time % 26]; - } - if (m_moveObject[i]->step == 3) - { - m_moveObject[i]->icon = table_blupih_turn2l[m_moveObject[i]->time % 26]; - } - if (m_moveObject[i]->step == 2) - { - m_moveObject[i]->icon = table_blupih_right[m_moveObject[i]->time % 8]; - } - if (m_moveObject[i]->step == 4) - { - m_moveObject[i]->icon = table_blupih_left[m_moveObject[i]->time % 8]; - } - } - if ((m_moveObject[i]->step == 1 || m_moveObject[i]->step == 3) && m_moveObject[i]->time == 21) - { - pos.x = m_moveObject[i]->posCurrent.x; - pos.y = m_moveObject[i]->posCurrent.y + 40; - if (ObjectStart(pos, 23, 55) != -1) - { - PlaySoundB(52, pos, 0); - } - } - } - if (m_moveObject[i]->type == 33) - { - if (m_moveObject[i]->posStart.x > m_moveObject[i]->posEnd.x) - { - if (m_moveObject[i]->step == 1) - { - m_moveObject[i]->icon = table_blupit_turn2l[m_moveObject[i]->time % 24]; - } - if (m_moveObject[i]->step == 3) - { - m_moveObject[i]->icon = table_blupit_turn2r[m_moveObject[i]->time % 24]; - } - if (m_moveObject[i]->step == 2) - { - m_moveObject[i]->icon = table_blupit_left[m_moveObject[i]->time % 8]; - } - if (m_moveObject[i]->step == 4) - { - m_moveObject[i]->icon = table_blupit_right[m_moveObject[i]->time % 8]; - } - } - else - { - if (m_moveObject[i]->step == 1) - { - m_moveObject[i]->icon = table_blupit_turn2r[m_moveObject[i]->time % 24]; - } - if (m_moveObject[i]->step == 3) - { - m_moveObject[i]->icon = table_blupit_turn2l[m_moveObject[i]->time % 24]; - } - if (m_moveObject[i]->step == 2) - { - m_moveObject[i]->icon = table_blupit_right[m_moveObject[i]->time % 8]; - } - if (m_moveObject[i]->step == 4) - { - m_moveObject[i]->icon = table_blupit_left[m_moveObject[i]->time % 8]; - } - } - if ((m_moveObject[i]->step == 1 || m_moveObject[i]->step == 3) && m_moveObject[i]->time == 3) - { - int speed; - if ((m_moveObject[i]->posStart.x < m_moveObject[i]->posEnd.x && m_moveObject[i]->step == 1) || (m_moveObject[i]->posStart.x > m_moveObject[i]->posEnd.x && m_moveObject[i]->step == 3)) - { - pos.x = m_moveObject[i]->posCurrent.x - 30; - pos.y = m_moveObject[i]->posCurrent.x + BLUPIOFFY; - speed = -5; - } - else - { - pos.x = m_moveObject[i]->posCurrent.x + 30; - pos.y = m_moveObject[i]->posCurrent.y + BLUPIOFFY; - speed = 5; - } - if (ObjectStart(pos, 23, speed) != -1) - { - PlaySoundB(52, pos, 0); - } - } - if ((m_moveObject[i]->step == 1 || m_moveObject[i]->step == 3) && m_moveObject[i]->time == 21) - { - int speed; - if ((m_moveObject[i]->posStart.x < m_moveObject[i]->posEnd.x && m_moveObject[i]->step == 1) || (m_moveObject[i]->posStart.x > m_moveObject[i]->posEnd.x && m_moveObject[i]->step == 3)) - { - pos.x = m_moveObject[i]->posCurrent.x + 30; - pos.y = m_moveObject[i]->posCurrent.y + BLUPIOFFY; - speed = 5; - } - else - { - pos.x = m_moveObject[i]->posCurrent.x - 30; - pos.y = m_moveObject[i]->posCurrent.y + BLUPIOFFY; - speed = -5; - } - if (ObjectStart(pos, 23, speed) != -1) - { - PlaySoundB(52, pos, 0); - } - } - } - if (m_moveObject[i]->type == 34) - { - m_moveObject[i]->icon = table_glu[m_moveObject[i]->phase / 1 % 25]; - m_moveObject[i]->channel = 10; - } - if (m_moveObject[i]->type == 37) - { - if (m_moveObject[i]->phase >= 70) - { - m_moveObject[i]->type = 0; - } - else - { - m_moveObject[i]->icon = table_clear[m_moveObject[i]->phase / 1 % 70]; - m_moveObject[i]->channel = 10; - } - } - if (m_moveObject[i]->type == 38) - { - if (m_moveObject[i]->phase >= 90) - { - m_moveObject[i]->type = 0; - } - else - { - m_moveObject[i]->icon = table_electro[m_moveObject[i]->phase / 1 % 90]; - if (m_moveObject[i]->phase < 30) - { - m_moveObject[i]->channel = 12; - } - else - { - m_moveObject[i]->channel = 10; - } - } - } - if (m_moveObject[i]->type == 13) - { - m_moveObject[i]->icon = 68; - m_moveObject[i]->channel = 10; - } - if (m_moveObject[i]->type == 46) - { - m_moveObject[i]->icon = 208; - m_moveObject[i]->channel = 10; - } - if (m_moveObject[i]->type == 19) - { - m_moveObject[i]->icon = 89; - m_moveObject[i]->channel = 10; - } - if (m_moveObject[i]->type == 28) - { - m_moveObject[i]->icon = 167; - m_moveObject[i]->channel = 10; - } - if (m_moveObject[i]->type == 23) - { - m_moveObject[i]->icon = 176; - m_moveObject[i]->channel = 10; - } - if (m_moveObject[i]->type == 29) - { - m_moveObject[i]->icon = 177; - m_moveObject[i]->channel = 10; - } - if (m_moveObject[i]->type == 30) - { - m_moveObject[i]->icon = 178; - m_moveObject[i]->channel = 10; - } - m_moveObject[i]->phase = m_moveObject[i]->phase + 1; - if (m_moveObject[i]->phase > 32700) - { - m_moveObject[i]->phase = 0; - } -} - - -void CDecor::DynamiteStart(int i, int dx, int dy) -{ - POINT posStart = m_moveObject[i]->posStart; - posStart.x -= 34; - posStart.y -= 34; - posStart.x += dx; - posStart.y -= dy; - ObjectStart(posStart, 8, 0); - if (dx == 0 && dy == 0) - { - PlaySoundB(SOUND_10_BOUM, posStart, 0); - m_decorAction = 1; - m_decorPhase = 0; - } - RECT src; - src.left = posStart.x; - src.right = posStart.x + 128; - src.top = posStart.y; - src.bottom = posStart.y + 128; - POINT tinyPoint; - for (int j = 0; j < 2; j++) - { - tinyPoint.x = posStart.x / 64; - for (int k = 0; k < 2; j++) - { - if (tinyPoint.x >= 0 && tinyPoint.x < 100 && tinyPoint.y >= 0 && tinyPoint.y < 100) - { - int icon = m_decor[tinyPoint.x, tinyPoint.y]->icon; - if (icon == 378 || icon == 379 || icon == 404 || icon == 410) - { - POINT pos; - pos.x = tinyPoint.x * 64; - pos.y = tinyPoint.y * 64; - ModifDecor(pos, -1, TRUE); - } - } - tinyPoint.x++; - } - tinyPoint.y++; - } - for (i = 0; i < MAXMOVEOBJECT; i++) - { - if (m_moveObject[i]->type == 2 || m_moveObject[i]->type == 3 || m_moveObject[i]->type == 96 || m_moveObject[i]->type == 97 || m_moveObject[i]->type == 4 || - m_moveObject[i]->type == 6 || m_moveObject[i]->type == 12 || m_moveObject[i]->type == 13 || m_moveObject[i]->type == 16 || m_moveObject[i]->type == 17 || - m_moveObject[i]->type == 19 || m_moveObject[i]->type == 20 || m_moveObject[i]->type == 24 || m_moveObject[i]->type == 25 || m_moveObject[i]->type == 26 || m_moveObject[i]->type == 28 || - m_moveObject[i]->type == 30 || m_moveObject[i]->type == 32 || m_moveObject[i]->type == 33 || m_moveObject[i]->type == 34 || m_moveObject[i]->type == 40 || m_moveObject[i]->type == 44 || - m_moveObject[i]->type == 46 || m_moveObject[i]->type == 52 || m_moveObject[i]->type == 54 || m_moveObject[i]->type == 200 || m_moveObject[i]->type == 201 || m_moveObject[i]->type == 202 || - m_moveObject[i]->type == 203) - { - RECT src2; - src2.left = m_moveObject[i]->posCurrent.x; - src2.right = m_moveObject[i]->posCurrent.x + 60; - src2.top = m_moveObject[i]->posCurrent.y; - src2.bottom = m_moveObject[i]->posCurrent.y + 20; - RECT tinyRect; - - if (IntersectRect(&tinyRect, &src2, &src)) - { - if (m_moveObject[i]->type == 12) - { - SearchLinkCaisse(i, TRUE); - for (int l = 0; l < m_nbLinkCaisse; l++) - { - int channel = m_moveObject[m_linkCaisse[l]]->channel; - int icon2 = m_moveObject[m_linkCaisse[l]]->icon; - POINT posCurrent = m_moveObject[m_linkCaisse[l]]->posCurrent; - double num = (double)Random(7, 23); - if (rand() % 2 == 0) - { - num = -num; - } - m_moveObject[m_linkCaisse[l]]->type = 0; - } - ObjectDelete(m_moveObject[i]->posCurrent, m_moveObject[i]->type, 0); - UpdateCaisse(); - } - else - { - ObjectDelete(m_moveObject[i]->posCurrent, m_moveObject[i]->type, 0); - } - } - - } - } - if (m_blupiFocus && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi && m_blupiPos.x > posStart.x - 30 && m_blupiPos.x < posStart.x + 30 + 64 && m_blupiPos.y > posStart.y - 30 && m_blupiPos.y < posStart.y + 30 + 64) - { - BlupiDead(11, -1); - m_blupiAir = TRUE; - } - -} - - -/* -int CDecor::AscenseurDetect(RECT rect, POINT oldpos, POINT newpos) -{ - if (m_blupiTimeNoAsc != 0) - { - return -1; - } - int num = newpos.y - oldpos.y; - int num2; - if (num < 0) - { - num2 = -30; - } - else - { - num2 = 30; - } - num = abs(num); - for (int i = 0; i < MAXMOVEOBJECT; i++) - { - if (m_moveObject[i]->type == 1 || m_moveObject[i]->type == 47 || m_moveObject[i]->type == 48) - { - RECT src; - src.left = m_moveObject[i]->posCurrent.x; - src.right = m_moveObject[i]->posCurrent.x + 64; - src.top = m_moveObject[i]->posCurrent.y; - src.bottom = m_moveObject[i]->posCurrent.y + 16; - if (num < 30) - { - tagRECT tinyRect; - if (IntersectRect(tinyRect, src, rect)) - { - return i; - } - } - else - { - RECT src2 = rect; - src2.top -= num / 30 * num2; - src2.bottom -= num / 30 * num2; - for (int j = 0; j <= num / 30; j++) - { - tagRECT tinyRect; - if (IntersectRect(tinyRect, src, src2)) - { - return i; - } - src2.top += num2; - src2.bottom += num; - } - } - - } - } - return -1; -} - -void CDecor::AscenseurVertigo(int i, BOOL bVertigoLeft, BOOL bVertigoRight) -{ - bVertigoLeft = FALSE; - bVertigoRight = FALSE; - if (m_blupiPos.x + 20 + 4 < m_moveObject[i]->posCurrent.x) - { - bVertigoLeft = TRUE; - } - if (m_blupiPos.x + 60 - 20 - 4 > m_moveObject[i]->posCurrent.x + 64) - { - bVertigoRight = TRUE; - } - if (AscenseurShift(i)) - { - if (bVertigoLeft) - { - bVertigoLeft = FALSE; - bVertigoRight = TRUE; - m_blupiTimeNoAsc = 10; - return; - } - if (bVertigoRight) - { - bVertigoRight = FALSE; - bVertigoLeft = TRUE; - m_blupiTimeNoAsc = 10; - } - } -} -*/ - -BOOL CDecor::AscenseurShift(int i) -{ - return i != -1 && m_moveObject[i]->icon >= 311 && m_moveObject[i]->icon <= 316; -} - -void CDecor::AscenseurSynchro(int i) -{ - for (i = 0; i < MAXMOVEOBJECT; i++) - { - m_moveObject[i]->posCurrent = m_moveObject[i]->posStart; - m_moveObject[i]->step = 1; - m_moveObject[i]->time = 0; - m_moveObject[i]->phase = 0; - } -} - -int CDecor::CaisseInFront() -{ - POINT tinyPoint; - if (m_blupiDir == 1) - { - tinyPoint.x = m_blupiPos.x + 16 - 32; - tinyPoint.y = m_blupiPos.y; - } - else - { - tinyPoint.x = m_blupiPos.x + 60 - 16 + 32; - tinyPoint.y = m_blupiPos.y; - } - for (int i = 0; i < m_nbRankCaisse; i++) - { - int num = m_rankCaisse[i]; - if (tinyPoint.x > m_moveObject[num]->posCurrent.x && - tinyPoint.x < m_moveObject[num]->posCurrent.x + 64 && - tinyPoint.y > m_moveObject[num]->posCurrent.y && - tinyPoint.y < m_moveObject[num]->posCurrent.y + 64) - { - return num; - } - } - return -1; -} - -int CDecor::CaisseGetMove(int max) -{ - max -= (m_nbLinkCaisse - 1) / 2; - if (max < 1) - { - max = 1; - } - if (m_blupiPower) - { - max *= 2; - } - if (m_blupiPhase < 20) - { - max = max * m_blupiPhase / 20; - if (max == 0) - { - max++; - } - } - return max; -} - - -int CDecor::MockeryDetect(POINT pos) -{ - if (m_blupiTimeMockery > 0) - { - return 0; - } - if (m_blupiAir) - { - POINT tinyPoint; - tinyPoint.x = pos.x + 30; - tinyPoint.y = pos.y + 30 + 64; - if (tinyPoint.x >= 0 && tinyPoint.x < 6400 && tinyPoint.y >= 0 && tinyPoint.y < 6400) - { - int icon = m_decor[tinyPoint.x / 64, tinyPoint.y / 64]->icon; - if (icon == 68 || icon == 317) - { - return 64; - } - } - } - RECT src; - src.left = pos.x; - src.right = pos.x + 60; - src.top = pos.y + 11; - src.bottom = pos.y + 60; - if (m_blupiAir) - { - src.bottom += 90; - } - for (int i = 0; i < MAXMOVEOBJECT; i++) - { - if (m_moveObject[i]->type == 2 || - m_moveObject[i]->type == 16 || - m_moveObject[i]->type == 96 || - m_moveObject[i]->type == 97 || - m_moveObject[i]->type == 4 || - m_moveObject[i]->type == 20 || - m_moveObject[i]->type == 44 || - m_moveObject[i]->type == 54 || - m_moveObject[i]->type == 23 || - m_moveObject[i]->type == 32 || - m_moveObject[i]->type == 33) - { - RECT src2; - src2.left = m_moveObject[i]->posCurrent.x; - src2.right = m_moveObject[i]->posCurrent.x + 60; - src2.top = m_moveObject[i]->posCurrent.y + 36; - src2.bottom = m_moveObject[i]->posCurrent.y + 60; - RECT tinyRect; - /* - if (IntersectRect(tinyRect, src2, src)) - { - if (m_moveObject[i]->type == 54) - { - return 83; - } - if (m_blupiDir == 2) - { - if (pos.x >= src2.left) - { - return 64; - } - if (m_moveObject[i]->type == 2) - { - return 0; - } - return 63; - } - else - { - if (pos.x < src2.left) - { - return 64; - } - if (m_moveObject[i]->type == 2) - { - return 0; - } - return 63; - } - } - */ - } - } - return 0; -} - -BOOL CDecor::BlupiElectro(POINT pos) -{ - if (m_blupiCloud) - { - return FALSE; - } - RECT src; - src.left = pos.x + 16; - src.right = pos.x + 60 - 16; - src.top = pos.y + 11; - src.bottom = pos.y + 60 - 2; - RECT src2; - src2.left = m_blupiPos.x - 16 - 40; - src2.right = m_blupiPos.x + 60 + 16 + 40; - src2.top = m_blupiPos.y + 11 - 40; - src2.bottom = m_blupiPos.y + 60 - 2 + 40; - RECT tinyRect; - return FALSE; //IntersectRect(tinyRect, src, src2); -} - -void CDecor::MoveObjectFollow(POINT pos) -{ - if (m_blupiHide) - { - return; - } - RECT src = BlupiRect(pos); - src.left = pos.x + 16; - src.right = pos.x + 60 - 16; - for (int i = 0; i < MAXMOVEOBJECT; i++) - { - if (m_moveObject[i]->type == 96) - { - RECT src2; - src2.left = m_moveObject[i]->posCurrent.x - 100; - src2.right = m_moveObject[i]->posCurrent.x + 60 + 100; - src2.top = m_moveObject[i]->posCurrent.y - 100; - src2.bottom = m_moveObject[i]->posCurrent.y + 60 + 100; - RECT tinyRect; - /* - if (IntersectRect(tinyRect, src2, src)) - { - m_moveObject[i]->type = 97; - PlaySoundB(SOUND_92_FOLLOW, m_moveObject[i]->posCurrent, 0); - } - */ - } - } -} - -int CDecor::MoveObjectDetect(POINT pos, BOOL bNear) -{ - RECT src = BlupiRect(pos); - src.left = pos.x + 16; - src.right = pos.x + 60 - 16; - RECT src2; - src2.left = src.left - 20; - src2.right = src.right + 20; - src2.top = src.top - 40; - src2.bottom = src.bottom + 30; - - for (int i = 0; i < MAXMOVEOBJECT; i++) - { - if (m_moveObject[i]->type != 0 && - m_moveObject[i]->type != 27 && - m_moveObject[i]->type != 57 && - m_moveObject[i]->type != 39 && - m_moveObject[i]->type != 58 && - m_moveObject[i]->type != 34 && - m_moveObject[i]->type != 37 && - m_moveObject[i]->type != 38 && - (m_blupiAction != 14 && m_blupiAction != 29) || - m_moveObject[i]->type != 12) - { - RECT src3; - - } - } - if (199 < pos.x) - { - return -1; - } -} - -int CDecor::MoveAscenseurDetect(POINT pos, int height) -{ - if (m_blupiTimeNoAsc != 0) - { - return -1; - } - RECT src; - src.left = pos.x + 12; - src.right = pos.x + 60 - 12; - src.top = pos.y + 60 - 2; - src.bottom = pos.y + 60 + height - 1; - for (int i = 0; i < MAXMOVEOBJECT; i++) - { - if (m_moveObject[i]->type == 1 || m_moveObject[i]->type == 47 || m_moveObject[i]->type == 48) - { - RECT src2; - src2.left = m_moveObject[i]->posCurrent.x; - src2.right = m_moveObject[i]->posCurrent.x + 64; - src2.top = m_moveObject[i]->posCurrent.y; - src2.bottom = m_moveObject[i]->posCurrent.y + 16; - RECT tinyRect; - /* - if (IntersectRect(tinyRect, src2, src)) - { - return i; - } - */ - } - } - return -1; -} - -int CDecor::MoveChargeDetect(POINT pos) -{ - RECT src; - src.left = pos.x + 16; - src.right = pos.x + 60 - 16; - src.top = pos.y + 11; - src.bottom = pos.y + 60 - 2; - for (int i = 0; i < MAXMOVEOBJECT; i++) - { - if (m_moveObject[i]->type == 31) - { - RECT src2; - src2.left = m_moveObject[i]->posCurrent.x - 10; - src2.right = m_moveObject[i]->posCurrent.x + 60 + 10; - src2.top = m_moveObject[i]->posCurrent.y + 36; - src2.bottom = m_moveObject[i]->posCurrent.y + 60; - RECT tinyRect; - /* - if (IntersectRect(tinyRect, src2, src)) - { - return i; - } - */ - } - } - return -1; -} - -int CDecor::MovePersoDetect(POINT pos) -{ - RECT src; - src.left = pos.x + 16; - src.right = pos.x + 60 - 16; - src.top = pos.y + 11; - src.bottom = pos.y + 60 - 2; - for (int i = 0; i < MAXMOVEOBJECT; i++) - { - if (m_moveObject[i]->type >= 200 && m_moveObject[i]->type <= 203) - { - RECT src2; - src2.left = m_moveObject[i]->posCurrent.x - 16; - src2.right = m_moveObject[i]->posCurrent.x + 60 + 16; - src2.top = m_moveObject[i]->posCurrent.y + 36; - src2.bottom = m_moveObject[i]->posCurrent.y + 60; - RECT tinyRect; - /* - if (IntersectRect(tinyRect, src2, src)) - { - return i; - } - */ - } - } - return -1; -} - -int CDecor::MoveObjectDelete(POINT cel) -{ - int result = -1; - for (int i = 0; i < MAXMOVEOBJECT; i++) - { - if (m_moveObject[i]->type != 0) - { - if (cel.x == m_moveObject[i]->posStart.x / 64 && cel.y == m_moveObject[i]->posStart.y / 64) - { - result = m_moveObject[i]->type; - m_moveObject[i]->type = 0; - } - else if (cel.x == m_moveObject[i]->posEnd.x / 64 && cel.y == m_moveObject[i]->posEnd.y / 64) - { - result = m_moveObject[i]->type; - m_moveObject[i]->type = 0; - } - } - } - return result; -} - -int CDecor::MoveObjectFree() -{ - for (int i = 0; i < MAXMOVEOBJECT; i++) - { - if (m_moveObject[i]->type == 0) - { - m_moveObject[i]->type = 0; - return i; - } - } - return -1; -} - -int CDecor::SortGetType(int type) -{ - if (type == 2 || type == 3 || type == 96 || type == 97) - { - return 1; - } - if (type == 12) - { - return 2; - } - return 3; -} - - -void CDecor::MoveObjectSort() -{ - int num = 0; - int i; - MoveObject* object; - MoveObject* moveObject; - - *(MoveObject*)moveObject = m_moveObject[100][100]; - - for (i = 0; i < MAXMOVEOBJECT; i++) - { - if (m_moveObject[i]->type != 0) - { - num++; - object = (MoveObject*)m_moveObject; - moveObject += 48; - memcpy(object, m_moveObject, 48); - } - moveObject += 24; - i--; - } - for (i = num; i < MAXMOVEOBJECT; i++) - { - m_moveObject[i]->type = 0; - } - if (num <= 1) - { - return; - } - BOOL flag; - do - { - flag = FALSE; - for (int i = 0; i < num - 1; i++) - { - if (SortGetType(m_moveObject[i]->type) > SortGetType(m_moveObject[i + 1]->type)) - { - flag = TRUE; - } - } - } while (flag); - UpdateCaisse(); - m_nbLinkCaisse = 0; -} - - -void CDecor::MoveObjectPriority(int i) -{ - if ((i != 0) && (m_moveObject + i, m_moveObject[i]->type == TYPE_BALLE)) - { - - } -} - - -int CDecor::MoveObjectSearch(POINT pos) -{ - return MoveObjectSearch(pos, -1); -} - -int CDecor::MoveObjectSearch(POINT pos, int type) -{ - for (int i = 0; i < MAXMOVEOBJECT; i++) - { - if (m_moveObject[i]->type != 0 && (type == -1 || - m_moveObject[i]->type == type)) - { - if (m_moveObject[i]->type == 23 && - m_moveObject[i]->posStart.x != m_moveObject[i]->posEnd.x) - { - if (m_moveObject[i]->posCurrent.x >= pos.x - 100 && - m_moveObject[i]->posCurrent.x <= pos.x + 100 && - m_moveObject[i]->posCurrent.y == pos.y) - { - return i; - } - } - else if (m_moveObject[i]->type == 23 && - m_moveObject[i]->posStart.y != m_moveObject[i]->posEnd.y) - { - if (m_moveObject[i]->posCurrent.y >= pos.y - 100 && - m_moveObject[i]->posCurrent.y <= pos.y + 100 && - m_moveObject[i]->posCurrent.x == pos.x) - { - return i; - } - } - else if (m_moveObject[i]->posCurrent.x == pos.x && - m_moveObject[i]->posCurrent.y == pos.y) - { - return i; - } - } - } - return -1; -} - -void CDecor::VoyageInit(POINT start, POINT end, int icon, int channel) -{ - if (m_voyageIcon != -1) - { - m_voyagePhase = m_voyageTotal; - VoyageStep(); - } - m_voyageStart = start; - m_voyageEnd = end; - m_voyageIcon = icon; - m_voyageChannel = channel; - int num = abs(end.x - start.x); - int num2 = abs(end.y - start.y); - m_voyagePhase = 0; - m_voyageTotal = (num + num2) / 10; - if (m_voyageIcon == 48 && m_voyageChannel == 2) - { - m_voyageTotal = 40; - m_nbVies--; - m_pSound->PlayImage(9, end, -1); - } - if (m_voyageIcon == 21 && m_voyageChannel == 10) - { - m_pSound->PlayImage(12, start, -1); - } - if (m_voyageIcon == 6 && m_voyageChannel == 10) - { - if (m_nbTresor == m_totalTresor - 1) - { - m_pSound->PlayImage(19, start, -1); - } - else - { - m_pSound->PlayImage(11, start, -1); - } - } - if (m_voyageIcon == 215 && m_voyageChannel == 10) - { - m_pSound->PlayImage(11, start, -1); - } - if (m_voyageIcon == 222 && m_voyageChannel == 10) - { - m_pSound->PlayImage(11, start, -1); - } - if (m_voyageIcon == 229 && m_voyageChannel == 10) - { - m_pSound->PlayImage(11, start, -1); - } - if (m_voyageIcon == 108 && m_voyageChannel == 4) - { - m_pSound->PlayImage(60, start, -1); - } - if (m_voyageIcon == 252 && m_voyageChannel == 10) - { - m_pSound->PlayImage(60, start, -1); - } - if (m_voyageIcon == 177 && m_voyageChannel == 10) - { - m_pSound->PlayImage(54, start, -1); - } - if (m_voyageIcon == 230 && m_voyageChannel == 10) - { - m_voyageTotal = 100; - } - if (m_voyageIcon == 40 && m_voyageChannel == 10) - { - m_voyageTotal = 50; - } -} - -void CDecor::VoyageStep() -{ - UINT time; - - if (m_voyageIcon != -1) - { - if (m_voyagePhase < m_voyageTotal) - { - time = m_time >> 31; - if ((((((m_time ^ time) - time & 1 ^ time) == time) && (229 < m_voyageIcon)) && (m_voyageIcon < 242)) && ((m_voyageChannel == CHELEMENT && (m_voyageIcon = m_voyageChannel + 1, 241 < m_voyageIcon + 1)))) - { - m_voyageIcon = icon_element_blupiangel; - m_voyagePhase = m_voyagePhase + 1; - return; - } - } - else - { - if (m_voyageIcon == icon_blupi_life) - { - m_voyageIcon = GetBlupiChannelActual(); - if (m_voyageIcon == m_voyageIcon) - { - m_blupiAction = ACTION_STOP; - m_blupiPhase = 0; - m_blupiFocus = TRUE; - m_energyUnused = 100; - } - } - if ((m_voyageIcon == icon_element_egg) && (m_voyageChannel == CHELEMENT)) - { - m_nbVies = m_nbVies + 1; - m_pSound->PlayImage(3, m_voyageEnd, -1); - } - if ((m_voyageIcon == icon_element_chest) && (m_voyageChannel == CHELEMENT)) - { - m_nbTresor = m_nbTresor + 1; - OpenDoorsTresor(); - m_pSound->PlayImage(3, m_voyageEnd, -1); - } - if ((m_voyageIcon == icon_element_keyred) && (m_voyageChannel == CHELEMENT)) - { - m_blupiCle = m_blupiCle | 1; - m_pSound->PlayImage(3, m_voyageEnd, -1); - } - if ((m_voyageIcon == icon_element_keygreen) && (m_voyageChannel == CHELEMENT)) - { - m_blupiCle = m_blupiCle | 2; - m_pSound->PlayImage(3, m_voyageEnd, -1); - } - if ((m_voyageIcon == icon_element_keyblue) && (m_voyageChannel == CHELEMENT)) - { - m_blupiCle = m_blupiCle | 4; - m_pSound->PlayImage(3, m_voyageEnd, -1); - } - if ((m_voyageIcon == GetIconPerso()) && (m_voyageChannel == CHBUTTON)) - { - m_blupiPerso = m_blupiPerso + 1; - m_pSound->PlayImage(3, m_voyageEnd, -1); - } - if ((m_voyageIcon == icon_element_dynamite) && (m_voyageChannel == CHELEMENT)) - { - m_blupiDynamite = m_blupiDynamite + 1; - m_pSound->PlayImage(3, m_voyageEnd, -1); - } - if ((m_voyageIcon == icon_element_gluepile) && (m_voyageChannel == CHELEMENT)) - { - m_pSound->PlayImage(3, m_voyageEnd, -1); - } - m_voyageIcon = -1; - } - m_voyagePhase = m_voyagePhase + 1; - } - return; -} - -// Add VoyageDraw - -BOOL CDecor::IsFloatingObject(int i) -{ - POINT posCurrent = m_moveObject[i]->posCurrent; - int num = (posCurrent.x + 32) / 64; - int num2 = posCurrent.y / 64 + 1; - int icon = m_decor[num, num2]->icon; - return IsPassIcon(icon); -} - -BOOL CDecor::IsRightBorder(int x, int y, int dx, int dy) -{ - return TRUE; -} - -BOOL CDecor::IsFromage(int x, int y) -{ - if (x < 0 || x >= 100 || y < 0 || y >= 100) - { - return FALSE; - } - int icon = m_decor[x, y]->icon; - return (icon >= 246 && icon <= 249) || icon == 339; -} - -BOOL CDecor::IsGrotte(int x, int y) -{ - if (x < 0 || x >= 100 || y < 0 || y >= 100) - { - return FALSE; - } - int icon = m_decor[x, y]->icon; - return icon = 284 || icon == 301 || icon == 337; -} - -void CDecor::AdaptMidBorder(int x, int y) -{ - if (x < 0 || x >= 100 || y < 0 || y >= 100) - { - return; - } - int num = 15; - if (!IsRightBorder(x, y + 1, 0, -1)) - { - num &= -2; - } - if (!IsRightBorder(x, y + 1, 0, 1)) - { - num &= -3; - } - if (!IsRightBorder(x + 1, y, -1, 0)) - { - num &= -5; - } - if (!IsRightBorder(x - 1, y, 1, 0)) - { - num &= -9; - } - int num2 = m_decor[x, y]->icon; - if (num2 == 156) - { - num2 = 35; - } - if (num2 == 252 || num2 == 253) - { - num2 = 251; - } - if (num2 == 255) - { - num2 = 254; - } - if (num2 == 362) - { - num2 = 347; - } - if (num2 == 363) - { - num2 = 348; - } - if (num2 >= 341 && num2 <= 346) - { - num2 = 341; - } - for (int i = 0; i < 144; i++) - { - if (num2 == table_adapt_decor[i]) - { - num2 = table_adapt_decor[i / 16 * 16 + num]; - if (num2 == 35 && rand() % 2 == 0) - { - num2 = 156; - } - if (num2 == 251) - { - num2 = Random(251, 253); - } - if (num2 == 254 && rand() % 2 == 0) - { - num2 = 255; - } - if (num2 == 347 && rand() % 2 == 0) - { - num2 = 362; - } - if (num2 == 348 && rand() % 2 == 0) - { - num2 = 363; - } - if (num2 == 341) - { - num2 = Random(341, 346); - } - m_decor[x, y]->icon = num2; - return; - } - } - num2 = m_decor[x, y]->icon; - if (num2 == -1 || (num2 >= 264 && num2 <= 282)) - { - num = 15; - if (!IsFromage(x, y + 1)) - { - num &= -2; - } - if (!IsFromage(x, y - 1)) - { - num &= -3; - } - if (!IsFromage(x + 1, y)) - { - num &= -5; - } - if (!IsFromage(x - 1, y)) - { - num &= -9; - } - num2 = table_adapt_fromage[num]; - if (num2 == 268 && rand() % 2 == 0) - { - num2 = 279; - } - if (num2 == 269 && rand() % 2 == 0) - { - num2 = 280; - } - if (num2 == 264 && rand() % 2 == 0) - { - num2 = 281; - } - if (num2 == 265 && rand() % 2 == 0) - { - num2 = 282; - } - m_decor[x, y]->icon = num2; - } - num2 = m_decor[x, y]->icon; - if (num2 == -1 || (num2 >= 285 && num2 <= 303 && num2 != 301)) - { - num = 15; - if (!IsGrotte(x, y + 1)) - { - num &= -2; - } - if (!IsGrotte(x, y - 1)) - { - num &= -3; - } - if (!IsGrotte(x + 1, y)) - { - num &= -5; - } - if (!IsGrotte(x - 1, y)) - { - num &= -9; - } - num2 = table_adapt_fromage[num + 16]; - if (num2 == 289 && rand() % 2 == 0) - { - num2 == 300; - } - if (num2 == 285 && rand() % 2 == 0) - { - num2 = 302; - } - if (num2 == 286 && rand() % 2 == 0) - { - num2 = 303; - } - m_decor[x, y]->icon = num2; - } -} - -void CDecor::AdaptBorder(POINT cel) -{ - AdaptMidBorder(cel.x, cel.y); - AdaptMidBorder(cel.x + 1, cel.y); - AdaptMidBorder(cel.x - 1, cel.y); - AdaptMidBorder(cel.x, cel.y + 1); - AdaptMidBorder(cel.x, cel.y - 1); - int icon = m_decor[cel.x, cel.y]->icon; - if (icon != -1 && !IsPassIcon(icon)) - { - MoveObjectDelete(cel); - } - icon = m_decor[cel.x, cel.y]->icon; - if (icon == 304) - { - for (int i = 0; i < 4; i++) - { - cel.y++; - if (cel.y >= 100) - { - break; - } - icon = m_decor[cel.x, cel.y]->icon; - if (icon != -1) - { - break; - } - m_decor[cel.x, cel.y]->icon = 305; - } - } - if (icon == -1) - { - for (int i = 0; i < 4; i++) - { - cel.y++; - if (cel.y >= 100) - { - return; - } - icon = m_decor[cel.x, cel.y]->icon; - if (icon != 305) - { - return; - } - m_decor[cel.x, cel.y]->icon = -1; - } - } -} - -BOOL CDecor::SearchDoor(int n, POINT cel, POINT blupi) -{ - for (int i = 0; i < 100; i++) - { - for (int j = 0; j < 100; j++) - { - 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) - { - cel.x = i - 1; - cel.y = j; - blupi.x = (i - 2) * 64 + 2; - blupi.y = j * 64 + BLUPIOFFY; - return TRUE; - } - if (i > 1 && m_decor[i - 2, j]->icon == 182) - { - cel.x = i - 2; - cel.y = j; - blupi.x = (i - 3) * 64 + 2; - blupi.y = j * 64 + BLUPIOFFY; - return TRUE; - } - if (i < 99 && m_decor[i + 1, j]->icon == 182) - { - cel.x = i + 1; - cel.y = j; - blupi.x = (i + 2) * 64 + 2; - blupi.y = j * 64 + BLUPIOFFY; - return TRUE; - } - if (i < 98 && m_decor[i + 2, j]->icon == 182) - { - cel.x = i + 2; - cel.y = j; - blupi.x = (i + 3) * 64 + 2; - blupi.y = j * 64 + BLUPIOFFY; - return TRUE; - } - } - } - } - return FALSE; -} - -BOOL CDecor::SearchGold(int n, POINT cel) -{ - for (int i = 99; i >= 0; i--) - { - for (int j = 99; j >= 0; j--) - { - if (m_decor[j, i]->icon == 183) - { - cel.x = j; - cel.y = i; - return TRUE; - } - } - } - return FALSE; -} - -void CDecor::FindAndSetMenus(int menuIndex, int menuType) -{ - m_dimCelHili.x = 1; - m_dimCelHili.y = 1; - if ((((menuIndex == 2) && (menuType != 3)) && (menuType != 9)) && (menuType != 10)) - { - m_dimCelHili.x = 2; - m_dimCelHili.y = 2; - } - if (menuIndex == 3) - { - m_menuType = menuType; - } - if (menuIndex == 4) - { - m_menuType = menuType + 40; - } - m_2ndPositionCalculationSlot = -1; - return; -} - -void CDecor::OpenDoorsTresor() -{ - for (int i = 0; i < 100; i++) - { - for (int j = 0; j < 100; j++) - { - int icon = m_decor[i, j]->icon; - if (icon >= 421 && icon <= 421 + m_nbTresor - 1) - { - POINT cel; - cel.x = i; - cel.y = j; - OpenDoor(cel); - } - } - } -} - -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; - PlaySoundB(SOUND_33_DOOR, m_moveObject[num]->posStart, 0); -} - -void CDecor::OpenDoorsWin() -{ - m_doors[m_mission + 1] = 1; -} - -void CDecor::OpenGoldsWin() -{ - m_doors[180 + m_mission / 10] = 1; -} - -void CDecor::DoorsLost() -{ - m_nbVies = 3; -} - -void CDecor::OutputNetDebug(char* text) -{ - char textbuffer[100]; - - if (m_bNetDebug != FALSE) - { - sprintf(textbuffer, "/ snd=%d(%d)_rcv=%d(%d)", m_netPacketsSent, m_netPacketsSent2, m_netPacketsRecieved, m_netPacketsRecieved2); - strcat(text, textbuffer); - } - return; -} - -void CDecor::InitalizeDoors(BYTE* doors) -{ - int i; - - for (i = 0; i < 200; i++) - { - *(BYTE*)(i + doors) = m_doors[i]; - } - return; -} - -void CDecor::GetBlupiInfo(BOOL bHelico, BOOL bJeep, BOOL bSkate, BOOL bNage) -{ - bHelico = m_blupiHelico; - bJeep = (m_blupiJeep) | (m_blupiTank); - bSkate = m_blupiSkate; - bNage = (m_blupiNage) | (m_blupiSurf); -} - -char* CDecor::GetMissionTitle() -{ - return m_missionTitle; -} - -void CDecor::GetMissionsCleared() -{ - -} - -void CDecor::SetDemoState(BOOL demoState) -{ - m_demoState = demoState; -} - -void CDecor::GetMissionPath(char* str, int user, int mission, BOOL bUser) -{ - if (bUser != 0) - { - sprintf(str, "data\%.3d-%.3d.blp", user, mission); - AddUserPath(str); - return; - } - sprintf(str, "data\world%.3d.blp", mission); - AddUserPath(str); - return; -} - - -BOOL CDecor::CurrentRead(int gamer, int mission, BOOL bUser) -{ - char filename[MAX_PATH]; - FILE* file = NULL; - DescFile* pBuffer = NULL; - int nb, i, num; - int* num2; - POINT* num3; - - InitDecor(); - GetMissionPath(filename, gamer, mission, bUser); - file = fopen(filename, "rb"); - - if (!file) - { - pBuffer = (DescFile*)malloc(868); - if (pBuffer != NULL) if (file != NULL) fclose(file); - if (fread(pBuffer, 868, 1, file) >= 1) - { - m_posDecor.x = pBuffer->posDecor.x; - m_posDecor.y = pBuffer->posDecor.y; - m_dimDecor.x = pBuffer->dimDecor.x; - m_dimDecor.y = pBuffer->dimDecor.y; - m_music = pBuffer->music; - m_region = pBuffer->region; - - if ((0 < pBuffer->majRev) && (pBuffer->minRev > 2)) - { - strcpy(m_missionTitle, pBuffer->libelle); - } - int* pos1 = pBuffer->blupiDir; - int* dir = m_blupiStartDir; - POINT* start = m_blupiStartPos; - for (i = 0; i < 4; i++) - { - m_blupiStartPos->x = pBuffer->blupiPos->x; - m_blupiStartPos->y = pBuffer->blupiPos->y; - dir = pos1; - start++; - pos1++; - dir++; - } - } - } - return FALSE; -} - - -/* -BOOL CDecor::MissionStart(int gamer, int rank, BOOL bUser) -{ - char filename[MAX_PATH]; - FILE* file = NULL; - DescFile* pBuffer = NULL; - int majRev, minRev; - int nb, i, x, y; - - -} -*/ - -BOOL CDecor::Read(int gamer, int rank, BOOL* pbMission, BOOL* pbPrivate) -{ - int* ptr; - int i; - int num; - FILE* stream; - char pBuffer[260]; - - ptr = NULL; - sprintf(pBuffer, "data\\s%.3d-%.3d.blp", gamer, rank); - stream = fopen(pBuffer, "rb"); - - if (stream != NULL) - { - ptr = (int*)malloc(57008); - if (ptr == NULL) if (stream != NULL) fclose(stream); - } - if (fread(ptr, 57008, 1, stream) < 1 || *ptr != 57008) - { - memcpy(m_decor, ptr + 53, 20000); - memcpy(m_bigDecor, ptr + 5053, 20000); - } - if (ptr[2] < 3) - { - FlushBalleTraj(); - } - else - { - memcpy(m_balleTraj, ptr + 10053, 1300); - } - if (ptr[2] < 4) - { - FlushMoveTraj(); - } - else - { - memcpy(m_moveTraj, ptr + 10378, 1300); - memcpy(m_moveObject, ptr + 10703, 9600); - } - m_posDecor.x = ptr[13153]; - m_posDecor.y = ptr[13154]; - m_dimDecor.x = ptr[13155]; - m_dimDecor.y = ptr[13156]; - m_phase = ptr[13157]; - m_term = ptr[13158]; - m_music = ptr[13159]; - m_region = ptr[13160]; - m_time = ptr[13161]; - memcpy(m_missionTitle, ptr + 13162, 100); - m_nbRankCaisse = ptr[13237]; - memcpy((int*)m_nbRankCaisse, ptr + 13238, 804); - memcpy((int*)m_nbLinkCaisse, ptr + 13438, 800); - m_blupiPos.x = ptr[13689]; - m_blupiPos.y = ptr[13690]; - m_blupiValidPos.x = ptr[13691]; - m_blupiValidPos.y = ptr[13692]; - m_blupiAction = ptr[13693]; - m_blupiDir = ptr[13694]; - m_blupiPhase = ptr[13695]; - m_blupiIcon = *(Icon4*)(ptr + 13698); - m_blupiSec = ptr[13699]; - m_blupiChannel.blupiChannel = *(short*)(ptr + 13700); - m_blupiVector.x = ptr[13701]; - m_blupiVector.y = ptr[13702]; - m_blupiTransport = ptr[13703]; - m_blupiFocus = ptr[13704]; - m_blupiAir = ptr[13705]; - m_blupiHelico = ptr[13706]; - m_blupiOver = ptr[13756]; - m_blupiJeep = ptr[13707]; - m_blupiTank = ptr[13708]; - m_blupiSkate = ptr[13709]; - m_blupiNage = ptr[13710]; - m_blupiSurf = ptr[13711]; - m_blupiVent = ptr[13712]; - m_blupiSuspend = ptr[13713]; - m_blupiJumpAie = ptr[13714]; - m_blupiShield = ptr[13715]; - m_blupiPower = ptr[13716]; - m_blupiCloud = ptr[13717]; - m_blupiHide = ptr[13718]; - m_blupiInvert = ptr[13754]; - m_blupiBalloon = ptr[13755]; - m_blupiEcrase = ptr[13757]; - m_blupiPosHelico.x = ptr[13719]; - m_blupiPosHelico.y = ptr[13720]; - m_blupiPosMagic.x = ptr[13721]; - m_blupiPosMagic.y = ptr[13722]; - m_blupiRestart = ptr[13723]; - m_blupiFront = ptr[13724]; - m_blupiBullet = ptr[13725]; - m_blupiCle = ptr[13726]; - m_blupiPerso = ptr[13727]; - m_blupiDynamite = ptr[13759]; - m_blupiNoBarre = ptr[13728]; - m_blupiTimeShield = ptr[13729]; - m_blupiTimeFire = ptr[13730]; - m_blupiTimeNoAsc = ptr[13758]; - m_blupiTimeOuf = ptr[13731]; - m_blupiActionOuf = ptr[13732]; - m_blupiFifoNb = ptr[13733]; - memcpy(m_blupiFifoPos, ptr + 13734, 80); - memcpy(m_blupiStartPos, ptr + 13801, 32); - m_blupiStartDir[0] = ptr[13809]; - m_blupiStartDir[1] = ptr[13810]; - m_blupiStartDir[2] = ptr[13811]; - m_blupiStartDir[3] = ptr[13812]; - - i = 2; - num = (int)ptr + 13865; - while (i != 0) - { - int jauges = (int)m_jauges; - num++; - jauges++; - i--; - } - m_blupiLevel = ptr[13869]; - m_energyUnused = ptr[13870]; - m_bHelicopterFlying = ptr[13921]; - m_bHelicopterStationary = ptr[13922]; - m_bJeepMarch = ptr[13923]; - m_bJeepStop = ptr[13924]; - m_bFoundCle = ptr[13975]; - m_bPrivate = ptr[13976]; - m_bCheatDoors = ptr[13977]; - m_bSuperBlupi = ptr[13978]; - m_bShowSecret = ptr[13979]; - m_bJoystick = ptr[13980]; - m_mission = ptr[13982]; - memcpy(m_doors, ptr + 13983, 216); - m_lives = ptr[14033]; - m_nbTresor = ptr[14034]; - m_totalTresor = ptr[14034]; - m_goalPhase = ptr[14036]; - m_scrollPoint.x = ptr[14088]; - m_scrollPoint.y = ptr[14089]; - m_scrollAdd.x = ptr[14090]; - m_scrollAdd.y = ptr[14091]; - m_voyageIcon = ptr[14142]; - m_voyageChannel = ptr[14143]; - m_voyagePhase = ptr[14144]; - m_voyageTotal = ptr[14145]; - m_voyageStart.x = ptr[14146]; - m_voyageStart.y = ptr[14147]; - m_voyageEnd.x = ptr[14148]; - m_voyageEnd.y = ptr[14149]; - m_decorAction = ptr[14200]; - m_decorPhase = ptr[14201]; - *pbPrivate = m_bPrivate; - *pbMission = m_mission; - free(ptr); - fclose(stream); - return FALSE; -} - -/* -BOOL CDecor::Write(int gamer, int mission, char* pFilename) -{ - int* ptr; - int i = 0; - int num = 0; - int string1, string2, string3; - FILE* stream; - char format[100]; - char buffer[260]; - - ptr = 0; - sprintf(buffer, "data\\s%.3d-%.3d.blp", gamer, mission); - AddUserPath(buffer); - stream = fopen(buffer, "rb"); - - if (stream != 0) - { - ptr = (int*)malloc(57008); - if (ptr == NULL) if (stream != NULL) fclose(stream); - } - if (fread(ptr, 57008, 1, stream) && (*ptr == 57008)) - { - while (i < 200) - { - i++; - if ((i + 55932 + ptr) == '\0') - { - num++; - } - } - if (ptr[13976] == 0) - { - i = ptr[13982]; - if (i == 99) - { - LoadString(TX_GAMEWRITE, format, 100); - sprintf(pFilename, format, num, ptr[14033], ptr[14034], ptr[14035]); - } - else - { - if (i < 99) - { - LoadString(i / 10 + TX_GAMEFINAL, format, 100); - i = ptr[14035]; - string1 = ptr[14034]; - string2 = ptr[14033]; - string3 = ptr[13982] % 10; - } - else - { - LoadString(TX_GAMEMISS, format, 100); - i = ptr[14035]; - string1 = ptr[14034]; - string2 = ptr[14033]; - string3 = ptr[13982]; - } - sprintf(pFilename, format, string3, num, string2, string1, i); - } - } - else - { - LoadString(TX_GAMEDES, format, 100); - sprintf(pFilename, format, ptr[13982], ptr[14034], ptr[14035]); - } - free(ptr); - fclose(stream); - return TRUE; - } - return FALSE; -} -*/ \ No newline at end of file diff --git a/decor.h b/decor.h deleted file mode 100644 index 03aa013..0000000 --- a/decor.h +++ /dev/null @@ -1,1088 +0,0 @@ -// Decor.h - -#pragma once - -using namespace std; - -#include -#include -#include -#include "def.h" -#include "network.h" -#include "jauge.h" - - -///////////////////////////////////////////////////////////////////////////// - - -#define MAXENERGY 4000 -#define MAXFIRE 400 - -#define ICON_HILI_STAT 112 -#define ICON_HILI_SEL 113 -#define ICON_HILI_ANY 114 -#define ICON_HILI_OP 115 -#define ICON_HILI_GO 117 -#define ICON_HILI_BUILD 118 -#define ICON_HILI_ERR 119 -#define ICON_BUTTON_PERSONALBOMBICON 108 -#define MAXMOVEOBJECT 200 - //#define MAXQUART 441 -#define BLUPIFLOOR 2 -#define BLUPIOFFY 4 + BLUPIFLOOR -#define BLUPISURF 12 -#define BLUPISUSPEND 12 -#define OVERHEIGHT 80 -#define MAXQUART 441 - -// Descripteur d'une cellule du d�cor. -typedef struct -{ - short floorChannel; - short floorIcon; - short objectChannel; - short objectIcon; - short fog; // brouillard - short rankMove; // rang dans m_move - short workBlupi; // rang du blupi travaillant ici - short fire; - short icon; -} -Cellule; -// Cette structure doit �tre la plus petite possible, car -// il en existe un tableau de 100x100 = 10'000 cellules ! - -// Descripteur d'un blupi anim�. -#define MAXBLUPI 100 -#define MAXUSED 50 -#define MAXLIST 10 - -typedef struct -{ - BOOL bExist; // TRUE -> utilis� - BOOL bHili; // TRUE -> s�lectionn� - - short perso; - short goalAction; // action (long terme) - short goalPhase; // phase (long terme) - POINT goalCel; // cellule vis�e (long terme) - POINT passCel; // cellule tranversante - - short energy; // �nergie restante - - POINT cel; // cellule actuelle - POINT destCel; // cellule destination - short action; // action en cours - short aDirect; // direction actuelle - short sDirect; // direction souhait�e - - POINT pos; // position relative � partir de la cellule - short posZ; // d�placement z - short channel; - short lastIcon; - short icon; - short phase; // phase dans l'action - short step; // pas global - short interrupt; // 0=prioritaire, 1=normal, 2=misc - short clipLeft; - - int nbUsed; // nb de points d�j� visit�s - char nextRankUsed; - POINT posUsed[MAXUSED]; - char rankUsed[MAXUSED]; - - short takeChannel; // objet transport� - short takeIcon; - - POINT fix; // point fixe (cultive, pont) - - short jaugePhase; - short jaugeMax; - short stop; // 1 -> devra stopper - short bArrow; // TRUE -> fl�che en dessus de blupi - short bRepeat; // TRUE -> r�p�te l'action - short nLoop; // nb de boucles pour GOAL_OTHERLOOP - short cLoop; // boucle en cours - short vIcon; // ic�ne variable - POINT goalHili; // but vis� - short bMalade; // TRUE -> blupi malade - short bCache; // TRUE -> cach� (pas dessin�) - short vehicule; // v�hicule utilis� par blupi, voir (**) - char busyCount; - char busyDelay; - char clicCount; - char clicDelay; - char reserve2[2]; - short listButton[MAXLIST]; - POINT listCel[MAXLIST]; - short listParam[MAXLIST]; - short repeatLevelHope; - short repeatLevel; - short reserve3[88]; -} -Blupi; - -// (*) Personnages : -// 0 -> blupi -// 1 -> araign�e -// 2 -> virus -// 3 -> tracks -// 4 -> robot -// 5 -> bombe -// 6 -> d�tonnateur de mine (invisible) -// 7 -> �lectro -// 8 -> disciple (robot2) - -// (**) V�hicule : -// 0 -> � pied -// 1 -> en bateau -// 2 -> en jeep -// 3 -> armure - -typedef struct -{ - int type; - int stepAdvance; - int stepRecede; - int timeStopStart; - int timeStopEnd; - POINT posStart; - POINT posEnd; - POINT posCurrent; - int step; - int time; - int phase; - int channel; - int icon; -} -MoveObject; - -typedef struct -{ - short icon; - short type; -} -Icon4; - -typedef struct -{ - short channel; - short blupiChannel; - short itemChannel; -} -IconChannel; - -typedef enum -{ - icon_element_chest = 6, - icon_element_egg = 21, - icon_element_blupiburn = 40, - icon_blupi_life = 48, - icon_button_personalbombyellow = 108, - icon_element_glueball = 176, - icon_element_gluepile = 177, - icon_element_keyred = 215, - icon_element_keygreen = 222, - icon_element_keyblue = 229, - icon_element_blupiangel = 230, - icon_element_dynamite = 252 -} -IconItem; - -typedef enum -{ - STEP_STOPSTART = 1, - STEP_ADVANCE = 2, - STEP_STOPEND = 3, - STEP_RECEDE = 4 -} -MoveObjectStep; - -typedef enum -{ - TYPE_EMPTY, - TYPE_ASCENSEUR, - TYPE_BOMBEDOWN, - TYPE_BOMBEUP, - TYPE_CAISSE, - TYPE_GOAL, - TYPE_CLE, - TYPE_BLUPIHELICO, - TYPE_BLUPITANK, - TYPE_BALLE, - TYPE_DOOR -} -MoveObjectType; - -typedef enum -{ - WM_NOMUSIC = 1044 -} -WMessage; - -typedef enum -{ - DIR_LEFT, - DIR_RIGHT -} -Direction; - - -typedef struct -{ - short move_frames_forward; - short move_frames_backward; - short delay_frames_start; - short delay_frames_end; - POINT pos_start; - POINT pos_end; - POINT pos; - short move_phase; - short move_timer; - short life_time; - short channel; - short icon; -} -PersoType; - -typedef struct -{ - short move_frames_forward; - short move_frames_backward; - short delay_frames_start; - short delay_frames_end; - POINT pos_start; - POINT pos_end; - POINT pos; - short move_phase; - short move_timer; - short life_time; - short channel; - short icon; -} -Perso; - - - -// Descripteur d'un d�cor anim�. -#define MAXMOVE 100 -#define MOVEICONNB 1000 - -typedef struct -{ - BOOL bExist; // TRUE -> utilis� - - POINT cel; // cellule du d�cor - short rankBlupi; // blupi travaillant ici - - BOOL bFloor; // TRUE -> floor, FALSE -> object - short channel; - short icon; - short maskChannel; - short maskIcon; - short phase; // phase pour pMoves ou pIcon - short rankMoves; // *nb,dx,dy,... - short rankIcons; // *nb,i,i,... - - short total; // nb total d'�tapes - short delai; // d�lai entre deux pas - short stepY; // pas vertical *100 - - short cTotal; - short cDelai; -} -Move; - -typedef struct -{ - short majRev; - short minRev; - BOOL bDemo; - short reserve1[98]; - POINT posDecor; - POINT dimDecor; - short world; - short music; - short region; - short reserve2[50]; - POINT blupiPos[100]; - int blupiDir[100]; - char libelle[100]; - short reserve3[196]; -} -DescFile; - -#define MAXLASTDRAPEAU 50 - -class CDecor -{ -public: - CDecor(); - ~CDecor(); - - // Arrange.cpp - void ArrangeFloor(POINT cel); - void ArrangeMur(POINT cel, int &icon, int index); - void ArrangeBuild(POINT cel, int &channel, int &icon); - void ArrangeObject(POINT cel); - - BOOL ArrangeFillTestFloor(POINT cel1, POINT cel2); - BOOL ArrangeFillTest(POINT pos); - void ArrangeFillPut(POINT pos, int channel, int icon); - void ArrangeFillSearch(POINT pos); - void ArrangeFill(POINT pos, int channel, int icon, BOOL bFloor); - - void ArrangeBlupi(); - - // Obstacle.cpp - void SearchFloor(int rank, int icon, POINT cel, int *pBits); - void SearchObject(int rank, int icon, POINT cel, int *pBits); - void AjustFloor(int rank, int icon, POINT cel, int *pBits); - void AjustObject(int rank, int icon, POINT cel, int *pBits); - BOOL IsFreeDirect(POINT cel, int direct, int rank); - BOOL IsFreeCelObstacle(POINT cel); - BOOL IsFreeCelFloor(POINT cel, int rank); - BOOL IsFreeCelGo(POINT cel, int rank); - BOOL IsFreeCelHili(POINT cel, int rank); - BOOL IsFreeCel(POINT cel, int rank); - BOOL IsFreeCelDepose(POINT cel, int rank); - BOOL IsFreeCelEmbarque(POINT cel, int rank, int &action, POINT &limit); - BOOL IsFreeCelDebarque(POINT cel, int rank, int &action, POINT &limit); - BOOL IsFreeJump(POINT cel, int direct, int rank, int &action); - BOOL IsFreeGlisse(POINT cel, int direct, int rank, int &action); - int DirectSearch(POINT cel, POINT goal); - void FlushUsed(int rank); - void AddUsedPos(int rank, POINT pos); - BOOL IsUsedPos(int rank, POINT pos); - BOOL SearchBestBase(int rank, int &action, POINT &newCel, int &direct); - BOOL SearchBestPass(int rank, int &action); - BOOL IsWorkableObject(POINT cel, int rank); - BOOL SearchOtherObject(int rank, POINT initCel, int action, - int distMax, int channel, - int firstIcon1, int lastIcon1, - int firstIcon2, int lastIcon2, - POINT &foundCel, int &foundIcon); - BOOL SearchOtherDrapeau(int rank, POINT initCel, int distMax, - POINT &foundCel, int &foundIcon); - BOOL SearchOtherBateau(int rank, POINT initCel, int distMax, - POINT &foundCel, int &foundIcon); - BOOL IsSpiderObject(int icon); - BOOL SearchSpiderObject(int rank, POINT initCel, int distMax, - POINT &foundCel, int &foundIcon); - BOOL IsTracksObject(int icon); - BOOL SearchTracksObject(int rank, POINT initCel, int distMax, - POINT &foundCel, int &foundIcon); - BOOL IsRobotObject(int icon); - BOOL SearchRobotObject(int rank, POINT initCel, int distMax, - POINT &foundCel, int &foundIcon, - int &foundAction); - BOOL IsBombeObject(int icon); - BOOL SearchBombeObject(int rank, POINT initCel, int distMax, - POINT &foundCel, int &foundIcon); - BOOL SearchElectroObject(int rank, POINT initCel, int distMax, - POINT &foundCel, int &foundIcon); - BOOL IsUsineBuild(int rank, POINT cel); - BOOL IsUsineFree(int rank, POINT cel); - BOOL IsFireCel(POINT cel); - BOOL IsVirusCel(POINT cel); - int IsBuildPont(POINT &cel, int &iconBuild); - BOOL IsBuildBateau(POINT cel, int &direct); - void InitDrapeau(); - void AddDrapeau(POINT cel); - void SubDrapeau(POINT cel); - BOOL TestDrapeau(POINT cel); - - // DecBlupi.cpp - void BlupiFlush(); - int BlupiCreate(POINT cel, int action, int direct, - int perso, int energy); - BOOL BlupiDelete(POINT cel, int perso=-1); - void BlupiDelete(int rank); - void BlupiKill(int exRank, POINT cel, int type); - BOOL BlupiIfExist(int rank); - void BlupiCheat(int cheat); - void BlupiActualise(int rank); - void BlupiAdaptIcon(int rank); - void BlupiPushFog(int rank); - void BlupiSound(int rank, int sound, POINT pos, BOOL bStop=FALSE); - void BlupiInitAction(int rank, int action, int direct=-1); - void BlupiChangeAction(int rank, int action, int direct=-1); - void ListFlush(int rank); - int ListGetParam(int rank, int button, POINT cel); - BOOL ListPut(int rank, int button, POINT cel, POINT cMem); - void ListRemove(int rank); - int ListSearch(int rank, int button, POINT cel, int &textForButton); - BOOL RepeatAdjust(int rank, int button, POINT &cel, POINT &cMem, - int param, int list); - void GoalStart(int rank, int action, POINT cel); - BOOL GoalNextPhase(int rank); - void SetTotalTime(int total); - int GetTotalTime(); - void GoalInitJauge(int rank); - void GoalInitPassCel(int rank); - void GoalAdjustCel(int rank, int &x, int &y); - BOOL GoalNextOp(int rank, short *pTable); - void GoalUnwork(int rank); - void GoalStop(int rank, BOOL bError=FALSE, BOOL bSound=TRUE); - BOOL BlupiIsGoalUsed(POINT cel); - void BlupiStartStopRayon(int rank, POINT startCel, POINT endCel); - BOOL BlupiRotate(int rank); - BOOL BlupiNextAction(int rank); - void BlupiNextGoal(int rank); - void BlupiStep(BOOL bFirst); - void BlupiGetRect(int rank, RECT &rect); - int GetTargetBlupi(POINT pos); - void BlupiDeselect(); - void BlupiDeselect(int rank); - void BlupiSetArrow(int rank, BOOL bArrow); - void InitOutlineRect(); - void BlupiHiliDown(POINT pos, BOOL bAdd=FALSE); - void BlupiHiliMove(POINT pos, BOOL bAdd=FALSE); - void BlupiHiliUp(POINT pos, BOOL bAdd=FALSE); - void BlupiDrawHili(); - int GetDefButton(POINT cel); - BOOL BlupiGoal(int rank, int button, POINT cel, POINT cMem); - void BlupiGoal(POINT cel, int button); - void BlupiDestCel(int rank); - BOOL IsTracksHere(POINT cel, BOOL bSkipInMove); - BOOL IsBlupiHereEx(POINT cel1, POINT cel2, int exRank, BOOL bSkipInMove); - BOOL IsBlupiHereEx(POINT cel, int exRank, BOOL bSkipInMove); - BOOL IsBlupiHere(POINT cel, BOOL bSkipInMove); - BOOL IsBlupiHere(POINT cel, int direct, BOOL bSkipInMove); - void GetLevelJauge(int *pLevels, int *pTypes); - BOOL IsWorkBlupi(int rank); - void BlupiGetButtons(POINT pos, int &nb, int *pButtons, int *pErrors, int &perso); - void TerminatedInit(); - int IsTerminated(); - Term* GetTerminated(); - - // DecMove.cpp - void MoveFlush(); - int MoveMaxFire(); - void MoveFixInit(); - BOOL MoveCreate(POINT cel, int rankBlupi, BOOL bFloor, - int channel, int icon, - int maskChannel, int maskIcon, - int total, int delai, int stepY, - BOOL bMisc=FALSE, BOOL bNotIfExist=FALSE); - BOOL MoveAddMoves(POINT cel, int rankMoves); - BOOL MoveAddIcons(POINT cel, int rankIcons, BOOL bContinue=FALSE); - BOOL MoveStartFire(POINT cel); - void MoveProxiFire(POINT cel); - void MoveFire(int rank); - void MoveStep(); - void MoveFinish(POINT cel); - void MoveFinish(int rankBlupi); - BOOL MoveIsUsed(POINT cel); - BOOL MoveGetObject(POINT cel, int &channel, int &icon); - BOOL MovePutObject(POINT cel, int channel, int icon); - - // DecIO.cpp - BOOL Write(int gamer, int mission, char* rank); - BOOL Read(int gamer, int rank, BOOL* pbMission, BOOL* pbPrivate); - BOOL FileExist(int rank, BOOL bUser, int &world, int &time, int &total); - void Flush(); - - // DecMap.cpp - void MapInitColors(); - POINT ConvCelToMap(POINT cel); - POINT ConvMapToCel(POINT pos); - BOOL MapMove(POINT pos); - void MapPutCel(POINT pos); - BOOL GenerateMap(); - - // DecStat.cpp - void StatisticInit(); - void StatisticUpdate(); - int StatisticGetBlupi(); - int StatisticGetFire(); - void StatisticDraw(); - void GenerateStatictic(); - BOOL StatisticDown(POINT pos, int fwKeys); - BOOL StatisticMove(POINT pos, int fwKeys); - BOOL StatisticUp(POINT pos, int fwKeys); - int StatisticDetect(POINT pos); - - // Chemin.cpp - void CheminMemPos(int exRank); - BOOL CheminTestPos(POINT pos, int &rank); - int CheminARebours(int rank); - void CheminFillTerrain(int rank); - BOOL CheminTestDirection(int rank, int pos, int dir, - int &next, int &li, - int &cout, int &action); - BOOL CheminCherche(int rank, int &action); - BOOL IsCheminFree(int rank, POINT dest, int button); - - // Decor.cpp - void SetShiftOffset(POINT offset); - POINT ConvCelToPos(POINT cel); - POINT ConvPosToCel(POINT pos, BOOL bMap=FALSE); - POINT ConvPosToCel2(POINT pos); - - void Create(HWND hWnd, CSound *pSound, CPixmap *pPixmap, CNetwork *pNetwork); - - BOOL LoadImages(); - void InitGamer(); - BOOL AddLinkCaisse(int rank); - void InitDecor(); - void InitAfterBuild(); - void PlayPrepare(BOOL bTest); - void BuildPrepare(); - void Build(RECT rect); - BOOL BlitzActif(int celx, int cely); - void DrawInfo(); - void UpdateCaisse(); - POINT DecorNextAction(); - void SetInput(UINT input); - void SetSpeedX(double speed); - void SetSpeedY(double speed); - int SoundEnviron(int sound, int obstacle); - void StopSound(Sound sound); - void AdaptMotorVehicleSound(); - BOOL TestPushCaisse(int i, POINT pos, BOOL bPop); - void SearchLinkCaisse(int rank, BOOL bPop); - void ResetHili(); - BOOL LoadBackgroundImages(); - BOOL TestPushOneCaisse(int i, POINT move, int b); - void ClearFog(); - void ClearFire(); - void SetBuild(BOOL bBuild); - void EnableFog(BOOL bEnable); - BOOL GetInvincible(); - void SetInvincible(BOOL bInvincible); - BOOL GetSuper(); - void SetSuper(BOOL bSuper); - void FlipOutline(); - BOOL PutFloor(POINT cel, int channel, int icon); - BOOL PutObject(POINT cel, int channel, int icon); - BOOL GetFloor(POINT cel, int &channel, int &icon); - BOOL GetObject(POINT cel, int &channel, int &icon); - BOOL SetFire(POINT cel, BOOL bFire); - - void SetCoin(POINT coin, BOOL bCenter=FALSE); - POINT GetCoin(); - POINT GetHome(); - void MemoPos(int rank, BOOL bRecord); - - void SetTime(int time); - int GetTime(); - - void SetMusic(int music); - int GetMusic(); - - void SetSkill(int skill); - int GetSkill(); - - void SetRegion(int region); - int GetRegion(); - - void SetInfoMode(BOOL bInfo); - BOOL GetInfoMode(); - void SetInfoHeight(int height); - int GetInfoHeight(); - - int GetTargetLevel(); - void GetBlupiInfo(BOOL bHelico, BOOL bJeep, BOOL bSkate, BOOL bNage); - void AdaptDoors(BOOL bPrivate, int mission); - - char* GetButtonExist(); - - void BuildPutBlupi(); - void BuildMoveFloor(int x, int y, POINT pos, int rank); - void BuildMoveObject(int x, int y, POINT pos, int rank); - void BuildGround(RECT clip); - void Build(RECT clip, POINT posMouse); - void NextPhase(int mode); - - int CountFloor(int channel, int icon); - int CelOkForAction(POINT cel, int action, int rank, - int icons[4][4], - POINT &celOutline1, - POINT &celOutline2); - int CelOkForAction(POINT cel, int action, int rank); - int GetHiliRankBlupi(int nb); - void CelHili(POINT pos, int action); - void CelHiliButton(POINT cel, int button); - void CelHiliRepeat(int list); - int GetResHili(POINT posMouse); - void HideTooltips(BOOL bHide); - - void UndoOpen(); - void UndoClose(); - void UndoCopy(); - void UndoBack(); - BOOL IsUndo(); - BOOL GetNetPacked(); - BOOL GetNetMovePredict(); - UINT GetPhase(); - char* GetMissionTitle(); - void GetDims(POINT* ptr); - void SetDims(POINT dims); - int GetNbVies(); - void SetNbVies(int lives); - BOOL GetPause(); - void SetPause(BOOL bPause); - void GetDoors(int doors); - void InitalizeDoors(BYTE* doors); - void SetAllMissions(BOOL CheatDoors); - void CheatAction(int cheat, MoveObject moveObject); - void SetAccessBuild(BOOL build); - void SetNetPacked(BOOL net); - void SetNetMovePredict(BOOL netmove); - BOOL GetNetDebug(); - void SetCelPosFromScreenPos(POINT cel); - void SetMulti(int multi); - void SetTeam(int team); - void MoveObjectSort(); - BOOL BlupiIsGround(); - RECT BlupiRect(POINT pos); - void BlupiAdjust(); - BOOL BlupiBloque(POINT pos, int dir); - void BlupiDead(int action1, int action2); - POINT GetPosDecor(POINT pos); - void BlupiAddFifo(POINT pos); - void MoveObjectPlouf(POINT pos); - void MoveObjectTiplouf(POINT pos); - int GetBlupiChannelStandard(); - void MoveObjectBlup(POINT pos); - int IsWorld(POINT pos); - void ActiveSwitch(BOOL bState, POINT cel); - int GetTypeBarre(POINT pos); - BOOL IsLave(POINT pos); - BOOL IsPiege(POINT pos); - BOOL IsGoutte(POINT pos, BOOL bAlways); - BOOL IsScie(POINT pos); - BOOL IsSwitch(POINT pos, POINT celSwitch); - BOOL IsEcraseur(POINT pos); - BOOL IsBlitz(POINT pos, BOOL bAlways); - BOOL IsRessort(POINT pos); - BOOL IsTemp(POINT pos); - BOOL IsBridge(POINT pos, POINT celBridge); - int IsDoor(POINT pos, POINT celPorte); - int IsTeleporte(POINT pos); - BOOL SearchTeleporte(POINT pos, POINT newpos); - BOOL IsNormalJump(POINT pos); - BOOL IsSurfWater(POINT pos); - BOOL IsDeepWater(POINT pos); - BOOL IsOutWater(POINT pos); - BOOL IsPassIcon(int icon); - BOOL IsBlocIcon(int icon); - void FlushBalleTraj(); - void SetBalleTraj(POINT pos); - BOOL IsBalleTraj(POINT pos); - void FlushMoveTraj(); - void SetMoveTraj(POINT pos); - BOOL IsMoveTraj(POINT pos); - int SearchDistRight(POINT pos, POINT dir, int type); - BOOL IsVentillo(POINT pos); - void StartSploutchGlu(POINT pos); - int ObjectStart(POINT pos, int type, int speed); - BOOL ObjectDelete(POINT pos, int type, int something); - void ModifDecor(POINT pos, int icon, BOOL bMulti); - void MoveObjectStep(); - void MoveObjectStepLine(int i); - void MoveObjectStepIcon(int i); - void MoveObjectFollow(POINT pos); - int MoveObjectDetect(POINT pos, BOOL bNear); - int MoveAscenseurDetect(POINT pos, int height); - int MoveChargeDetect(POINT pos); - int MovePersoDetect(POINT pos); - int MoveObjectDelete(POINT cel); - int MoveObjectFree(); - int SortGetType(int type); - int MoveObjectSearch(POINT pos); - int MoveObjectSearch(POINT pos, int type); - void VoyageInit(POINT start, POINT end, int icon, int channel); - void VoyageStep(); - BOOL IsFloatingObject(int i); - BOOL IsRightBorder(int x, int y, int dx, int dy); - BOOL IsFromage(int x, int y); - BOOL IsGrotte(int x, int y); - void AdaptMidBorder(int x, int y); - void PosSound(POINT pos); - void AdaptBorder(POINT cel); - void GetMissionPath(char* str, int user, int mission, BOOL bUser); - void DynamiteStart(int i, int dx, int dy); - int AscenseurDetect(RECT rect, POINT oldpos, POINT newpos); - void BlupiSearchIcon(); - void AscenseurVertigo(int i, BOOL bVertigoLeft, BOOL bVertigoRight); - BOOL AscenseurShift(int i); - void AscenseurSynchro(int i); - int CaisseInFront(); - int CaisseGetMove(int max); - int MockeryDetect(POINT pos); - BOOL BlupiElectro(POINT pos); - void BlupiStep(); - POINT ScreenPosToCelPos(POINT* pos, POINT cel); - BOOL DecorDetect(RECT rect); - BOOL DecorDetect(RECT rect, BOOL bCaisse); - BOOL SearchDoor(int n, POINT cel, POINT blupi); - BOOL SearchGold(int n, POINT cel); - BOOL TestPath(RECT rect, POINT start, POINT end); - void PlaySoundB(int sound, POINT pos, int net); - void OpenDoorsTresor(); - void OpenDoor(POINT cel); - void OpenDoorsWin(); - void OpenGoldsWin(); - void DoorsLost(); - void GetMissionsCleared(); - void SetDemoState(BOOL demoState); - BOOL CurrentWrite(int gamer, int mission, BOOL bUser); - BOOL CurrentRead(int gamer, int mission, BOOL bUser); - void SetJoystickEnable(BOOL bJoystick); - BOOL GetShowSecret(); - BOOL MissionStart(int gamer, int rank, BOOL bUser); - - void MemorizeDoors(BYTE* doors); - void NotifPush(char* str); - void DeleteCel(int celX, int celY); - void SetGamerName(const char* playerName); - BOOL SomethingMissionPath(int user, int mission, BOOL bUser); - void MoveObjectPriority(int i); - void FindAndSetMenus(int menuIndex, int menuType); - void ChangePhase(UINT phase); - - - // Network Related Functions - void NetMessageIndexFlush(); - void NotifFlush(); - void NetDataFlush(); - void NetPlaySound(short channel, POINT pos); - void NetStopCloud(int rank); - BOOL NetMessagePush(NetMessage* message); - BOOL DrawMap(BOOL bPlay, int player); - void NetSendData(BYTE bufferSize, UCHAR send); - void NetPlayerCollide(POINT pos, int* out); - void TreatNetData(); - void OutputNetDebug(char* text); - void NotifStep(); - void NotifPop(); - void SetNetDebug(BOOL bNetDebug); - - -protected: - BOOL GetSeeBits(POINT cel, char *pBits, int index); - int GetSeeIcon(char *pBits, int index); - -protected: - HWND m_hWnd; - CSound* m_pSound; - CPixmap* m_pPixmap; - CNetwork* m_pNetwork; - NetMessage m_netMessages[20]; - MoveObject m_moveObject[100][100]; - int m_input; - int m_bJoystick; - int m_previousInput; - int m_blupiTimeShield; - POINT m_blupiPosMagic; - POINT m_blupiLastPos; - int m_balleTraj[1300]; - POINT m_blupiVector; - int m_blupiSec; - BOOL m_bSuperBlupi; - int m_blupiRealRotation; - int m_blupiTransport; - int m_detectIcon = -1; - POINT m_cameraPos; - int m_moveTraj[1300]; - POINT m_dimDecor; - POINT m_dimCelHili; - BOOL m_blupiRestart; - POINT m_worldDims; - POINT m_selectedCelPos; - int m_phase; - int m_voyagePhase; - POINT m_sucettePos; - int m_sucetteType; - double m_blupiLastSpeedY; - int m_blupiTimeOuf; - double m_blupiLastSpeedX; - POINT m_posCelHili; - int m_2ndPositionCalculationSlot; - int m_voyageTotal; - POINT m_voyageStart; - POINT m_voyageEnd; - int m_voyageChannel; - int m_targetMission; - char m_missionTitle[100]; - int m_nbCases; - int m_linkCaisse[MAXMOVEOBJECT]; - POINT m_blupiFifoPos[10]; - int m_caseIndexes[200]; - int m_nbSomethings; - int m_blupiOffsetY; - int m_somethingIndexes; - POINT m_pos; - POINT m_safePos; - POINT m_posDecor; - RECT m_drawBounds; - BYTE m_doors[200]; - int m_action; - int m_direction; - int m_actionFrameCount; - POINT m_velocity; - Icon4 m_blupiIcon; - POINT m_blupiStartPos[4]; - int m_blupiStartDir[4]; - int m_blupiAction; - BOOL m_bCheatDoors; - int m_blupiPhase; - /* - undefined - undefined - undefined - undefined - */ - Cellule m_decor[MAXCELX / 2][MAXCELY / 2]; - Cellule m_bigDecor[100][100]; - int m_decorAction; - int m_blupiLevel; - IconChannel m_blupiChannel; - int m_keyPress; - POINT m_activeConveyorVelocity; - int m_decorPhase; - int m_nbRankCaisse; - int m_rankCaisse[MAXMOVEOBJECT]; - int m_nbLinkCaisse; - int m_activeLiftIndex; - double m_blupiSpeedX; - double m_blupiSpeedY; - BOOL m_blupiFocus; - BOOL m_blupiAir; - BOOL m_blupiHelico; - BOOL m_blupiOver; - BOOL m_blupiJeep; - BOOL m_bJeepMarch; - BOOL m_bJeepStop; - BOOL m_blupiTank; - BOOL m_blupiSkate; - BOOL m_blupiNage; - BOOL m_blupiSurf; - BOOL m_bInWind; - BOOL m_blupiVent; - BOOL m_blupiSuspend; - BOOL m_blupiJumpAie; - BOOL m_blupiShield; - BOOL m_blupiPower; - BOOL m_blupiCloud; - BOOL m_blupiHide; - BOOL m_blupiInvert; - BOOL m_blupiBalloon; - BOOL m_blupiEcrase; - BOOL m_blupiMotorHigh; - int m_blupiMotorSound; - POINT m_blupiPosHelico; - int m_blupiActionOuf; - int m_blupiTimeNoAsc; - int m_blupiTimeMockery; - double m_blupiVitesseX; - double m_blupiVitesseY; - POINT m_blupiValidPos; - BOOL m_blupiFront; - int m_blupiNoBarre; - int m_blupiFifoNb; - CJauge m_jauges[2]; - BOOL m_bFoundCle; - BOOL m_bPause; - int m_blupiTimeFire; - int m_voyageIcon; - int m_blupiBullet; - int m_blupiCle; - int m_blupiPerso; - int m_blupiDynamite; - int m_nbTresor; - int m_totalTresor; - int m_goalPhase; - POINT m_scrollPoint; - POINT m_scrollAdd; - int m_nbVies; - BOOL m_bUseSafePosition; - BOOL m_bIsTerminating; - POINT m_blupiPos; - int m_blupiDir; - int m_lastDecorIcon[200]; - int m_glue; - int m_keys; - int m_personalBombs; - int m_dynamite; - int m_powerEnergy; - int m_queuedActionFrames; - int m_nbSafePositions; - POINT m_safePositions[13]; - int m_bMulti; - int m_team; - int m_netPacketsSent; - int m_netPacketsSent2; - int m_netPacketsRecieved; - int m_netPacketsRecieved2; - POINT m_netPositions[4]; - Icon4 m_netIcons[4]; - int m_netPlayerPacketsRecieved[4]; - int m_netPlayerPacketsRecieved2[4]; - int m_bNetTimeSincePacket[4]; - POINT m_netVitesses[4]; - POINT m_netPacketPosition; - Icon4 m_netPacketIcon; - NamedGUID m_netEvents[20]; - int m_netEventIndex1; - int m_netEventIndex2; - int m_netEventIndex3; - int m_netMessageIndex1; - int m_netMessageIndex2; - int m_netMessageIndex3; - int m_menuType; - char m_messages[4][100]; - int m_air; - int m_energyUnused; - BOOL m_bHelicopterFlying; - BOOL m_bHelicopterStationary; - BOOL m_bCarMoving; - BOOL m_bCarStationary; - BOOL m_bWorldComplete; - BOOL m_bPrivate; - BOOL m_bAllMissions; // opendoors - BOOL m_bInvincible; // megablupi - BOOL m_bShowSecret; // showsecret - BOOL m_bAccessBuild; // xmission/xnjttjpo - BOOL m_bNetPacked; // netpacked - BOOL m_bNetMovePredict; // ynosmooth - BOOL m_bNetDebug; // znetdebug - BOOL m_demoState; - int m_mission; - BYTE m_missionsCleared[180]; - BYTE m_worldsCleared[20]; - int m_lives; - int m_chestsCollected; - int m_chestsTotal; - POINT m_cameraTargetPos; - POINT m_cameraTargetOffset; - int m_flyupIcon; - int m_flyupChannel; - int m_flyupFrameCount; - int m_flyupFrameTotal; - POINT m_flyupStartPos; - POINT m_flyupEndPos; - BOOL m_bScreenShake; - int m_screenShakeIndex; - char m_notifText[4][100]; - int m_notifTime; - int m_menuSelections[112]; - BYTE m_overloadProtection[100000]; - Cellule* m_pUndoDecor; - short m_rankBlupi[MAXCELX][MAXCELY]; - Blupi m_blupi[MAXBLUPI]; - Move m_move[MAXMOVE]; - POINT m_celCoin; // cellule sup/gauche - POINT m_celHome; // pour touche Home - POINT m_celHili; - POINT m_celOutline1; - POINT m_celOutline2; - POINT m_shiftOffset; - int m_iconHili[4][4]; - int m_rankHili; // rang du blupi vis� - BOOL m_bHiliRect; - POINT m_p1Hili; // coins rectangle de s�lection - POINT m_p2Hili; - int m_shiftHili; - int m_nbBlupiHili; // nb de blupi s�lectionn�s - int m_rankBlupiHili; // rang blupi s�lectionn� - BOOL m_bFog; // TRUE -> brouillard (jeu) - BOOL m_bBuild; // TRUE -> construction - BOOL m_bSuper; // TRUE -> cheat code - short m_colors[100]; - int m_time; // temps relatif global - int m_timeConst; // temps relatif global constant - int m_timeFlipOutline; // temps quand basculer mode outline - int m_totalTime; // temps total pass� sur une partie - POINT m_celArrow; // cellule avec fl�che - BOOL m_bOutline; - BOOL m_bGroundRedraw; - char m_buttonExist[MAXBUTTON]; - int m_statNb; // nb de statistiques - int m_statFirst; // premi�re statistique visible - int m_bStatUp; // fl�che up statistique - int m_bStatDown; // fl�che down statistique - int m_statHili; // statistique survol�e - BOOL m_bStatRecalc; // TRUE -> recalcule les statistiques - BOOL m_bStatRedraw; // TRUE -> redessine les statistiques - int m_nbStatHach; // nb de hachures - int m_nbStatHachBlupi; // hachures occup�es par blupi - int m_nbStatHachPlanche;// hachures occup�es par planches - int m_nbStatHachTomate; // hachures occup�es par tomates - int m_nbStatHachMetal; // hachures occup�es par m�tal - int m_nbStatHachRobot; // hachures occup�es par robot - int m_nbStatHome; // nb de maisons - int m_nbStatHomeBlupi; // maisons occup�es par blupi - int m_nbStatRobots; // nb d'ennemis - int m_term; // conditions pour gagner - int m_winCount; // compteur avant gagn� - int m_winLastHachBlupi; // dernier nombre atteint - int m_winLastHachPlanche;// dernier nombre atteint - int m_winLastHachTomate;// dernier nombre atteint - int m_winLastHachMetal; // dernier nombre atteint - int m_winLastHachRobot; // dernier nombre atteint - int m_winLastHome; // dernier nombre atteint - int m_winLastHomeBlupi; // dernier nombre atteint - int m_winLastRobots; // dernier nombre atteint - int m_music; // num�ro musique - int m_region; // num�ro r�gion (*) - int m_lastRegion; // num�ro derni�re r�gion - int m_blupiHere; - POINT m_lastDrapeau[MAXLASTDRAPEAU]; - BOOL m_bHideTooltips; // TRUE -> menu pr�sent - char m_text[50]; - POINT m_textLastPos; - int m_textCount; - int m_skill; - BOOL m_bInfo; - int m_infoHeight; - POINT m_memoPos[4]; - - BYTE m_cheminWork[MAXCELX*MAXCELY]; - int m_cheminNbPos; - POINT m_cheminPos[MAXBLUPI*2]; - int m_cheminRank[MAXBLUPI*2]; - - BOOL m_bFillFloor; - int m_fillSearchChannel; - int m_fillSearchIcon; - int m_fillPutChannel; - int m_fillPutIcon; - char* m_pFillMap; - - int SetBlupiChannel(); - int GetBlupiChannel(); - int GetBlupiChannelActual(); - int GetIconPerso(); - int GetTargetLevel(int mission); - void SetShowSecret(BOOL secret); - void GetBlupiHitbox(RECT *out, POINT pos); -}; - -// (*) R�gions : -// 0 -> normal -// 1 -> palmier -// 2 -> hiver -// 3 -> sapin - -///////////////////////////////////////////////////////////////////////////// - -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[]; - - - - - - - - - - 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 deleted file mode 100644 index 7cd75c7..0000000 --- a/dectables.h +++ /dev/null @@ -1,9720 +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 -}; - -extern int table_shieldloop[] -{ - 274, - 275, - 276, - 277, - 278 -}; - -extern int table_blitz[] -{ - 0, - 7, - 15, - 18, - 25, - 27, - 32, - 39, - 45, - 47, - 50, - 58, - 60, - 62, - 64, - 66, - 68, - 70, - 71, - 72 -}; - -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_magicloop[] -{ - 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 -}; -extern int table_chenille[] -{ - 311, - 312, - 313, - 314, - 315, - 316 -}; - -extern int table_chenillei[] -{ - 316, - 315, - 314, - 313, - 312, - 311 -}; - -extern int table_follow1[] -{ - 256, - 256, - 256, - 257, - 257, - 258, - 259, - 260, - 261, - 262, - 263, - 264, - 264, - 265, - 265, - 265, - 264, - 264, - 263, - 262, - 261, - 260, - 259, - 258, - 257, - 257 -}; - -extern int table_follow2[] -{ - 256, - 258, - 260, - 262, - 264 -}; - -extern int table_dynamitef[] -{ - 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_cle[] -{ - 122, - 123, - 124, - 125, - 126, - 127, - 128, - 127, - 126, - 125, - 124, - 123 -}; - -extern int table_cle1[] -{ - 209, - 210, - 211, - 212, - 213, - 214, - 215, - 214, - 213, - 212, - 211, - 210 -}; - -extern int table_cle2[] -{ - 220, - 221, - 222, - 221, - 220, - 219, - 218, - 217, - 216, - 217, - 218, - 219 -}; - -extern int table_cle3[] -{ - 229, - 228, - 227, - 226, - 225, - 224, - 223, - 224, - 225, - 226, - 227, - 228 -}; - -extern int table_skate[] -{ - 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_shield[] -{ - 144, - 145, - 146, - 147, - 148, - 149, - 150, - 151, - 266, - 267, - 268, - 269, - 270, - 271, - 272, - 273 -}; - -extern int table_power[] -{ - 136, - 137, - 138, - 139, - 140, - 141, - 142, - 143 -}; - -extern int table_invert[] -{ - 187, - 187, - 187, - 188, - 189, - 190, - 191, - 192, - 193, - 194, - 187, - 187, - 187, - 194, - 193, - 192, - 191, - 190, - 189, - 188 -}; - -extern int table_charge[] -{ - 238, - 239, - 240, - 241, - 242, - 243 -}; - -extern int table_tresortrack[] -{ - 166, - 165, - 164, - 163, - 162, - 161, - 162, - 163, - 164, - 165, - 166 -}; - -extern int table_explo1[] -{ - 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[] -{ - 12, - -1, - 13, - 14, - -1, - 15, - 13, - -1, - 14, - 15, - 12, - -1, - 13, - 15, - 14, - 14, - -1, - 14, - 15, - 13 -}; - -extern int table_explo3[] -{ - 32, - 32, - 34, - 34, - 32, - 32, - 34, - 34, - 32, - 32, - 34, - 34, - 32, - 32, - 35, - 35, - 32, - 32, - 35, - 35 -}; - -extern int table_explo4[] -{ - 12, - 13, - 14, - 15, - 7, - 8, - 9, - 10, - 11 -}; - -extern int table_explo5[] -{ - 54, - -1, - 55, - -1, - 56, - -1, - 57, - -1, - 58, - -1, - 59, - -1 -}; - -extern int table_explo6[] -{ - 54, - 55, - 56, - 57, - 58, - 59 -}; - -extern int table_explo7[] -{ - 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[] -{ - 7, - 8, - 9, - 10, - 11 -}; - -extern int table_sploutch1[] -{ - 90, - 91, - 92, - 93, - 94, - 95, - 96, - 97, - 98, - 99 -}; - -extern int table_decor_action[] -{ - 1, - 32, - -4, - 4, - 4, - -3, - -4, - 2, - 4, - 5, - -4, - -1, - 4, - 2, - -4, - -4, - 4, - -3, - -3, - 2, - 3, - 2, - -3, - -5, - 3, - 4, - -3, - 5, - 3, - -2, - -3, - 5, - 3, - 4, - -2, - -2, - 2, - 4, - -2, - -2, - 2, - -2, - -2, - -4, - 2, - 2, - -2, - -2, - 2, - -3, - -1, - -3, - 1, - -2, - -1, - -1, - 1, - 2, - -1, - -2, - 1, - -1, - -1, - 1, - 1, - 2, - 2, - 32, - -4, - 0, - 4, - 0, - -4, - 0, - 4, - 0, - -4, - 0, - 4, - 0, - -4, - 0, - 4, - 0, - -3, - 0, - 3, - 0, - -3, - 0, - 3, - 0, - -3, - 0, - 3, - 0, - -3, - 0, - 3, - 0, - -2, - 0, - 2, - 0, - -2, - 0, - 2, - 0, - -2, - 0, - 2, - 0, - -2, - 0, - 2, - 0, - -1, - 0, - 1, - 0, - -1, - 0, - 1, - 0, - -1, - 0, - 1, - 0, - -1, - 0, - 1, - 0, - 5, - 192, - 0, - -32, - 0, - 32, - 0, - -16, - 0, - 6, - 0, - -8, - 0, - 8, - 0, - -4, - 0, - 4, - 0, - -2, - 0, - 2, - -7, - 0, - -6, - 0, - -5, - 0, - -4, - 0, - -2, - 0, - 0, - 0, - 2, - 0, - 4, - 0, - 5, - 0, - 6, - 0, - 7, - 0, - 7, - 0, - 6, - 0, - 5, - 0, - 4, - 0, - 2, - 0, - 0, - 0, - -2, - 0, - -4, - 0, - -5, - 0, - -6, - 0, - -7, - 0, - -7, - 0, - -6, - 0, - -5, - 0, - -4, - 0, - -2, - 0, - 0, - 0, - 2, - 0, - 4, - 0, - 5, - 0, - 6, - 0, - 7, - 0, - 7, - 0, - 6, - 0, - 5, - 0, - 4, - 0, - 2, - 0, - 0, - 0, - -2, - 0, - -4, - 0, - -5, - 0, - -6, - 0, - -7, - 0, - -7, - 0, - -6, - 0, - -5, - 0, - -4, - 0, - -2, - 0, - 0, - 0, - 2, - 0, - 4, - 0, - 5, - 0, - 6, - 0, - 7, - 0, - 7, - 0, - 6, - 0, - 5, - 0, - 4, - 0, - 2, - 0, - 0, - 0, - -2, - 0, - -4, - 0, - -5, - 0, - -6, - 0, - -7, - 0, - -7, - 0, - -6, - 0, - -5, - 0, - -4, - 0, - -2, - 0, - 0, - 0, - 2, - 0, - 4, - 0, - 5, - 0, - 6, - 0, - 7, - 0, - 7, - 0, - 6, - 0, - 5, - 0, - 4, - 0, - 2, - 0, - 0, - 0, - -2, - 0, - -4, - 0, - -5, - 0, - -6, - 0, - -7, - 0, - -7, - 0, - -6, - 0, - -5, - 0, - -4, - 0, - -2, - 0, - 0, - 0, - 2, - 0, - 4, - 0, - 5, - 0, - 6, - 0, - 7, - 0, - 7, - 0, - 6, - 0, - 5, - 0, - 4, - 0, - 2, - 0, - 0, - 0, - -2, - 0, - -4, - 0, - -5, - 0, - -6, - 0, - -7, - 0, - -7, - 0, - -6, - 0, - -5, - 0, - -4, - 0, - -2, - 0, - 0, - 0, - 2, - 0, - 4, - 0, - 5, - 0, - 6, - 0, - 7, - 0, - 7, - 0, - 6, - 0, - 5, - 0, - 4, - 0, - 2, - 0, - 0, - 0, - -2, - 0, - -4, - 0, - -5, - 0, - -6, - 0, - -7, - 0, - -7, - 0, - -6, - 0, - -5, - 0, - -4, - 0, - -2, - 0, - 0, - 0, - 2, - 0, - 4, - 0, - 5, - 0, - 6, - 0, - 7, - 0, - 7, - 0, - 6, - 0, - 5, - 0, - 4, - 0, - 2, - 0, - 0, - 0, - -2, - 0, - -4, - 0, - -5, - 0, - -6, - 0, - -7, - 0, - -7, - 0, - -6, - 0, - -5, - 0, - -4, - 0, - -2, - 0, - 0, - 0, - 2, - 0, - 4, - 0, - 5, - 0, - 6, - 0, - 7, - 0, - 7, - 0, - 6, - 0, - 5, - 0, - 4, - 0, - 2, - 0, - 0, - 0, - -2, - 0, - -4, - 0, - -5, - 0, - -6, - 0, - -7, - 0, - -7, - 0, - -6, - 0, - -5, - 0, - -4, - 0, - -2, - 0, - -1, - 0, - 0 -}; - -extern int table_marine[] -{ - 203, - 204, - 205, - 206, - 207, - 208, - 207, - 206, - 205, - 204, - 203 -}; - -extern int table_adapt_decor[] -{ - 153, - 147, - 148, - 146, - 40, - 151, - 150, - 144, - 39, - 152, - 149, - 145, - 38, - 36, - 37, - 35, - 153, - 147, - 148, - 146, - 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[] -{ - -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_vitesse_march[] -{ - 2, - 4, - 6, - 8 -}; - -extern int table_decor_quart[] - { - 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, - 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, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 1, - 1, - 1, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 1, - 1, - 1, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 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, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 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, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 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, - 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, - 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, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 1, - 1, - 1, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 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, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 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, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 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, - 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, - 0, - 1, - 1, - 1, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 1, - 1, - 1, - 0, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 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, - 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, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 1, - 1, - 1, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - 0, - 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, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 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, - 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, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 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, - 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, - 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, - 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, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 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, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 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, - 0, - 0, - 0, - 0, - 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, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 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, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 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, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 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, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 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, - 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, - 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, - 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, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 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, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 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, - 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, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0 - }; - -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_sploutch2[] -{ - -1, - -1, - -1, - 90, - 91, - 92, - 93, - 94, - 95, - 96, - 97, - 98, - 99 -}; - -extern int table_sploutch3[] -{ - -1, - -1, - -1, - -1, - -1, - -1, - -1, - -1, - 90, - 91, - 92, - 93, - 94, - 95, - 96, - 97, - 98, - 99 -}; - -extern int table_tentacule[] -{ - 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[] -{ - 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[] -{ - 179, - 180, - 181, - 182, - 183, - 184, - 185, - 186 -}; - -extern int table_invertstart[] -{ - 179, - 180, - 181, - 182, - 183, - 184, - 185, - 186 -}; - -extern int table_invertstop[] -{ - 186, - 185, - 184, - 183, - 182, - 181, - 180, - 179 -}; - -extern int table_plouf[] -{ - 99, - 100, - 101, - 102, - 101, - 100, - 99 -}; - -extern int table_tiplouf[] -{ - 244, - 99, - 244 -}; - -extern int table_blup[] -{ - 103, - 104, - 105, - 106, - 104, - 103, - 106, - 105, - 103, - 104, - 103, - 105, - 106, - 103, - 105, - 106, - 103, - 104, - 106, - 105 -}; - -extern int table_bulldozer_left[] -{ - 66, - 66, - 67, - 67, - 66, - 66, - 65, - 65 -}; - -extern int table_bulldozer_right[] -{ - 58, - 58, - 57, - 57, - 58, - 58, - 59, - 59 -}; - -extern int table_bulldozer_turn2l[] -{ - 58, - 59, - 59, - 59, - 60, - 60, - 60, - 61, - 61, - 62, - 62, - 63, - 63, - 64, - 64, - 64, - 65, - 65, - 65, - 66, - 66, - 66 -}; - -extern int table_bulldozer_turn2r[] -{ - 66, - 65, - 65, - 65, - 64, - 64, - 64, - 63, - 63, - 62, - 62, - 61, - 61, - 60, - 60, - 60, - 59, - 59, - 59, - 58, - 58, - 58 -}; - -extern int table_poisson_left[] -{ - 82, - 82, - 81, - 81, - 82, - 82, - 83, - 83 -}; - -extern int table_poisson_right[] -{ - 79, - 79, - 78, - 78, - 79, - 79, - 80, - 80 -}; - - - -extern int table_poisson_turn2l[] -{ - 79, - 79, - 80, - 80, - 84, - 84, - 85, - 85, - 86, - 86, - 87, - 87, - 88, - 88, - 83, - 83, - 82, - 82, - 83, - 83, - 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[] -{ - 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[] -{ - 98, - 99, - 100, - 101, - 102, - 103, - 104, - 105 -}; - -extern int table_oiseau_right[] -{ - 90, - 91, - 92, - 93, - 94, - 95, - 96, - 97 -}; - -extern int table_oiseau_turn2l[] -{ - 106, - 107, - 108, - 109, - 110, - 111, - 112, - 113, - 105, - 105 -}; - -extern int table_oiseau_turn2r[] -{ - 114, - 115, - 116, - 117, - 118, - 119, - 120, - 121, - 97, - 97 -}; - -extern int table_guepe_left[] -{ - 195, - 196, - 197, - 198, - 197, - 196 -}; - -extern int table_guepe_right[] -{ - 199, - 200, - 201, - 202, - 201, - 200 -}; - -extern int table_guepe_turn2l[] -{ - 207, - 206, - 205, - 204, - 203 -}; - -extern int table_guepe_turn2r[] -{ - 203, - 204, - 205, - 206, - 207 -}; - -extern int table_creature_left[] -{ - 247, - 248, - 249, - 250, - 251, - 250, - 249, - 248 -}; - -extern int table_creature_right[] -{ - 247, - 248, - 249, - 250, - 251, - 250, - 249, - 248 -}; - -extern int table_creature_turn2[] -{ - 244, - 244, - 244, - 244, - 244, - 244, - 244, - 244, - 243, - 243, - 242, - 242, - 242, - 242, - 242, - 242, - 242, - 242, - 243, - 243, - 244, - 244, - 245, - 245, - 246, - 246, - 246, - 246, - 246, - 246, - 246, - 246, - 245, - 245, - 244, - 244, - 243, - 243, - 242, - 242, - 242, - 242, - 242, - 242, - 243, - 243, - 244, - 244, - 245, - 245, - 246, - 246, - 246, - 246, - 246, - 246, - 245, - 245, - 244, - 244, - 243, - 243, - 242, - 242, - 242, - 242, - 243, - 243, - 244, - 244, - 245, - 245, - 246, - 246, - 246, - 246, - 245, - 245, - 244, - 244, - 243, - 243, - 242, - 242, - 243, - 243, - 244, - 244, - 245, - 245, - 246, - 246, - 245, - 245, - 244, - 244, - 243, - 243, - 242, - 242, - 242, - 242, - 243, - 243, - 244, - 244, - 245, - 245, - 246, - 246, - 246, - 246, - 245, - 245, - 244, - 244, - 243, - 243, - 242, - 242, - 242, - 242, - 242, - 242, - 243, - 243, - 244, - 244, - 245, - 245, - 246, - 246, - 246, - 246, - 246, - 246, - 245, - 245, - 244, - 244, - 244, - 244, - 244, - 244, - 244, - 244, - 244, - 244, - 244, - 244, - 244, - 244 -}; - -extern int table_blupih_left[] -{ - 66, - 67, - 68, - 67, - 66, - 69, - 70, - 69 -}; - -extern int table_blupih_right[] -{ - 61, - 62, - 63, - 62, - 61, - 64, - 65, - 64 -}; - -extern int table_blupih_turn2l[] -{ - 71, - 71, - 72, - 72, - 73, - 73, - 74, - 74, - 75, - 75, - 68, - 68, - 275, - 275, - 271, - 271, - 271, - 271, - 272, - 272, - 273, - 273, - 273, - 273, - 275, - 275 -}; - -extern int table_blupih_turn2r[] -{ - 75, - 75, - 74, - 74, - 73, - 73, - 72, - 72, - 71, - 71, - 63, - 63, - 274, - 274, - 271, - 271, - 271, - 271, - 272, - 272, - 273, - 273, - 273, - 273, - 274, - 274 -}; - -extern int table_blupit_left[] -{ - 249, - 249, - 250, - 250, - 249, - 249, - 248, - 248 -}; - -extern int table_blupit_right[] -{ - 238, - 238, - 237, - 237, - 238, - 238, - 239, - 239 -}; - -extern int table_blupit_turn2l[] -{ - 238, - 238, - 251, - 251, - 238, - 238, - 238, - 239, - 240, - 241, - 242, - 243, - 244, - 245, - 246, - 247, - 248, - 249, - 249, - 249, - 252, - 252, - 249, - 249 -}; - -extern int table_blupit_turn2r[] -{ - 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_glu[] -{ - 168, - 168, - 169, - 169, - 170, - 170, - 171, - 171, - 170, - 170, - 169, - 169, - 168, - 168, - 169, - 169, - 169, - 168, - 168, - 169, - 169, - 170, - 170, - 169, - 168 -}; - -extern int table_clear[] -{ - - 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[] -{ - 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 -}; \ No newline at end of file diff --git a/def.h b/def.h deleted file mode 100644 index e15c404..0000000 --- a/def.h +++ /dev/null @@ -1,542 +0,0 @@ -// Def.h -// - -#pragma once - -#include - -#define _DEMO FALSE // TRUE=demo, FALSE=complet -#define _INTRO FALSE // TRUE si images d'introduction -#define _EGAMES FALSE // TRUE version pour eGames -#define _SE FALSE // TRUE eGames Special Edition - - -#define LXIMAGE 640 // dimensions de la fen�tre de jeu -#define LYIMAGE 480 - -#define POSDRAWX 144 // surface de dessin -#define POSDRAWY 15 -#define DIMDRAWX 480 -#define DIMDRAWY 450 - -#define POSMAPX 8 // surface pour la carte -#define POSMAPY 15 -#define DIMMAPX 128 -#define DIMMAPY 128 - -#define MAXCELX 200 // nb max de cellules d'un monde -#define MAXCELY 200 - -#define DIMCELX 60 // dimensions d'une cellule (d�cor) -#define DIMCELY 30 - -#define DIMOBJX 120 // dimensions d'un objet -#define DIMOBJY 120 - -#define DIMBLUPIX 60 // dimensions de blupi -#define DIMBLUPIY 60 -#define SHIFTBLUPIY 5 // petit d�calage vers le haut - -#define DIMEXPLOX 128 -#define DIMEXPLOY 128 - -#define DIMBUTTONX 40 // dimensions d'un button -#define DIMBUTTONY 40 - -#define DIMJAUGEX 124 // dimensions de la jauge -#define DIMJAUGEY 22 - -#define POSSTATX 12 // statistiques -#define POSSTATY 220 -#define DIMSTATX 60 -#define DIMSTATY 30 - -#define DIMTEXTX 16 // dimensions max d'un caract�re -#define DIMTEXTY 16 - -#define DIMLITTLEX 16 // dimensions max d'un petit caract�re -#define DIMLITTLEY 12 - -#define CHBACK 0 -#define CHFLOOR 1 -#define CHOBJECT 1 -#define CHBLUPI 2 -#define CHDECOR 3 -#define CHBUTTON 4 -#define CHJAUGE 5 -#define CHTEXT 6 -#define CHMAP 8 -#define CHEXPLO 9 -#define CHELEMENT 10 -#define CHBLUPI1 11 -#define CHBLUPI2 12 -#define CHBLUPI3 13 -#define CHPAD 14 -#define CHSPEEDYBLUPI 15 -#define CHBLUPIYOUPIE 16 -#define CHGEAR 17 -#define CHLITTLE 18 -#define CHBIGNUM 19 - -#define CHTEMP 14 - -#define MAXMOVEOBJECT 200 - -#define MESS_LOBBY 4 -#define NETEVENTMAX 20 - -#define PK_PLAYSOUND 40 - - -// Directions : - -#define DIRECT_E (0*16) // est -#define DIRECT_SE (1*16) // sud-est -#define DIRECT_S (2*16) // sud -#define DIRECT_SO (3*16) // sud-ouest -#define DIRECT_O (4*16) // ouest -#define DIRECT_NO (5*16) // nord-ouest -#define DIRECT_N (6*16) // nord -#define DIRECT_NE (7*16) // nord-est - -// NO -// O | N -// \ | / -// \ | / -// \|/ -// SO -------o------- NE -// /|\ -// / | \ -// / | \ -// S | E -// (y) SE (x) - - -// Actions : - -#define ACTION_STOP 1 // arr�t -#define ACTION_MARCH 2 -#define ACTION_TURN 3 -#define ACTION_JUMP 4 -#define ACTION_AIR 5 -#define ACTION_DOWN 6 - -// Sons : - -/* -#define SOUND_CLICK 0 -#define SOUND_JUMP1 1 -#define SOUND_JUMP2 2 -#define SOUND_JUMPEND 3 -#define SOUND_JUMPTOC 4 -#define SOUND_TURN 5 -#define SOUND_VERTIGO 6 -#define SOUND_DOWN 7 -#define SOUND_FALL 8 -#define SOUND_NEW 9 -#define SOUND_BOUM 10 -#define SOUND_TRESOR 11 -#define SOUND_EGG 12 -#define SOUND_ENDKO 13 -#define SOUND_ENDOK 14 -#define SOUND_HELICOSTART 15 -#define SOUND_HELICOHIGH 16 -#define SOUND_HELICOSTOP 17 -#define SOUND_HELICOLOW 18 -#define SOUND_LASTTRESOR 19 -#define SOUND_UP 20 -#define SOUND_LOOKUP 21 -#define SOUND_JUMP0 22 -#define SOUND_PLOUF 23 -#define SOUND_BLUP 24 -#define SOUND_SURF 25 -#define SOUND_DROWN 26 -#define SOUND_ERROR 27 -#define SOUND_JEEPSTART 28 -#define SOUND_JEEPHIGH 29 -#define SOUND_JEEPSTOP 30 -#define SOUND_JEEPLOW 31 -#define SOUND_BYE 32 -#define SOUND_DOOR 33 -#define SOUND_SUSPENDTOC 34 -#define SOUND_SUSPENDJUMP 35 -#define SOUND_SINGE 36 -#define SOUND_PATIENT 37 -*/ - -#define SOUND_MOVIE 99 - -// Boutons (play) : - -#define MAXBUTTON 40 - -#define BUTTON_GO 0 -#define BUTTON_STOP 1 -#define BUTTON_MANGE 2 -#define BUTTON_CARRY 3 -#define BUTTON_DEPOSE 4 -#define BUTTON_ABAT 5 -#define BUTTON_ROC 6 -#define BUTTON_CULTIVE 7 -#define BUTTON_BUILD1 8 -#define BUTTON_BUILD2 9 -#define BUTTON_BUILD3 10 -#define BUTTON_BUILD4 11 -#define BUTTON_BUILD5 12 -#define BUTTON_BUILD6 13 -#define BUTTON_MUR 14 -#define BUTTON_PALIS 15 -#define BUTTON_ABATn 16 -#define BUTTON_ROCn 17 -#define BUTTON_PONT 18 -#define BUTTON_TOUR 19 -#define BUTTON_BOIT 20 -#define BUTTON_LABO 21 -#define BUTTON_FLEUR 22 -#define BUTTON_FLEURn 23 -#define BUTTON_DYNAMITE 24 -#define BUTTON_BATEAU 25 -#define BUTTON_DJEEP 26 -#define BUTTON_DRAPEAU 27 -#define BUTTON_EXTRAIT 28 -#define BUTTON_FABJEEP 29 -#define BUTTON_FABMINE 30 -#define BUTTON_FABDISC 31 -#define BUTTON_REPEAT 32 -#define BUTTON_DARMURE 33 -#define BUTTON_FABARMURE 34 - - -// Erreurs : - -#define ERROR_MISC 1 -#define ERROR_GROUND 2 -#define ERROR_FREE 3 -#define ERROR_PONTOP 4 -#define ERROR_PONTTERM 5 -#define ERROR_TOURISOL 6 -#define ERROR_TOUREAU 7 -#define ERROR_TELE2 8 - - -// Lutins pour la souris - -#define SPRITE_ARROW 1 -#define SPRITE_POINTER 2 -#define SPRITE_MAP 3 -#define SPRITE_ARROWU 4 -#define SPRITE_ARROWD 5 -#define SPRITE_ARROWL 6 -#define SPRITE_ARROWR 7 -#define SPRITE_ARROWUL 8 -#define SPRITE_ARROWUR 9 -#define SPRITE_ARROWDL 10 -#define SPRITE_ARROWDR 11 -#define SPRITE_WAIT 12 -#define SPRITE_EMPTY 13 -#define SPRITE_FILL 14 - - - -#define MAXMOVEOBJECT = 200; -#define INPUT_LEFT 1 -#define INPUT_RIGHT 2 - - -// User define message - -#define WM_UPDATE (WM_USER+1) - -#define WM_DECOR1 (WM_USER+20) -#define WM_DECOR2 (WM_USER+21) -#define WM_DECOR3 (WM_USER+22) -#define WM_DECOR4 (WM_USER+23) -#define WM_DECOR5 (WM_USER+24) -#define WM_DECOR6 1049 -#define WM_DECOR7 1050 -#define WM_DECOR8 1051 -#define WM_DECOR9 1052 -#define WM_DECOR10 1053 -#define WM_DECOR11 1054 - -#define WM_ACTION_ABAT1 (WM_USER+31) -#define WM_ACTION_ABAT2 (WM_USER+32) -#define WM_ACTION_ABAT3 (WM_USER+33) -#define WM_ACTION_ABAT4 (WM_USER+34) -#define WM_ACTION_ABAT5 (WM_USER+35) -#define WM_ACTION_ABAT6 (WM_USER+36) -#define WM_ACTION_BUILD1 (WM_USER+37) -#define WM_ACTION_BUILD2 (WM_USER+38) -#define WM_ACTION_BUILD3 (WM_USER+39) -#define WM_ACTION_BUILD4 (WM_USER+40) -#define WM_ACTION_BUILD5 (WM_USER+41) -#define WM_ACTION_BUILD6 (WM_USER+42) -#define WM_ACTION_STOP (WM_USER+43) -#define WM_ACTION_CARRY (WM_USER+44) -#define WM_ACTION_DEPOSE (WM_USER+45) -#define WM_ACTION_ROC1 (WM_USER+46) -#define WM_ACTION_ROC2 (WM_USER+47) -#define WM_ACTION_ROC3 (WM_USER+48) -#define WM_ACTION_ROC4 (WM_USER+49) -#define WM_ACTION_ROC5 (WM_USER+50) -#define WM_ACTION_ROC6 (WM_USER+51) -#define WM_ACTION_ROC7 (WM_USER+52) -#define WM_ACTION_MUR (WM_USER+53) -#define WM_ACTION_CULTIVE (WM_USER+54) -#define WM_ACTION_CULTIVE2 (WM_USER+55) -#define WM_ACTION_MANGE (WM_USER+56) -#define WM_ACTION_MAKE (WM_USER+57) -#define WM_ACTION_BUILD (WM_USER+58) -#define WM_ACTION_PALIS (WM_USER+59) -#define WM_ACTION_NEWBLUPI (WM_USER+60) -#define WM_ACTION_PONTE (WM_USER+61) -#define WM_ACTION_PONTS (WM_USER+62) -#define WM_ACTION_PONTO (WM_USER+63) -#define WM_ACTION_PONTN (WM_USER+64) -#define WM_ACTION_PONTEL (WM_USER+65) -#define WM_ACTION_PONTSL (WM_USER+66) -#define WM_ACTION_PONTOL (WM_USER+67) -#define WM_ACTION_PONTNL (WM_USER+68) -#define WM_ACTION_TOUR (WM_USER+69) -#define WM_ACTION_CARRY2 (WM_USER+70) -#define WM_ACTION_DEPOSE2 (WM_USER+71) -#define WM_ACTION_MANGE2 (WM_USER+72) -#define WM_ACTION_BOIT (WM_USER+73) -#define WM_ACTION_BOIT2 (WM_USER+74) -#define WM_ACTION_LABO (WM_USER+75) -#define WM_ACTION_FLEUR1 (WM_USER+76) -#define WM_ACTION_FLEUR2 (WM_USER+77) -#define WM_ACTION_DYNAMITE (WM_USER+78) -#define WM_ACTION_DYNAMITE2 (WM_USER+79) -#define WM_ACTION_T_DYNAMITE (WM_USER+80) -#define WM_ACTION_FLEUR3 (WM_USER+81) -#define WM_ACTION_R_BUILD1 (WM_USER+82) -#define WM_ACTION_R_BUILD2 (WM_USER+83) -#define WM_ACTION_R_BUILD3 (WM_USER+84) -#define WM_ACTION_R_BUILD4 (WM_USER+85) -#define WM_ACTION_R_MAKE1 (WM_USER+86) -#define WM_ACTION_R_MAKE2 (WM_USER+87) -#define WM_ACTION_R_MAKE3 (WM_USER+88) -#define WM_ACTION_R_MAKE4 (WM_USER+89) -#define WM_ACTION_R_BUILD5 (WM_USER+90) -#define WM_ACTION_R_MAKE5 (WM_USER+91) -#define WM_ACTION_BATEAUE (WM_USER+92) -#define WM_ACTION_BATEAUS (WM_USER+93) -#define WM_ACTION_BATEAUO (WM_USER+94) -#define WM_ACTION_BATEAUN (WM_USER+95) -#define WM_ACTION_BATEAUDE (WM_USER+96) -#define WM_ACTION_BATEAUDS (WM_USER+97) -#define WM_ACTION_BATEAUDO (WM_USER+98) -#define WM_ACTION_BATEAUDN (WM_USER+99) -#define WM_ACTION_BATEAUAE (WM_USER+100) -#define WM_ACTION_BATEAUAS (WM_USER+101) -#define WM_ACTION_BATEAUAO (WM_USER+102) -#define WM_ACTION_BATEAUAN (WM_USER+103) -#define WM_ACTION_MJEEP (WM_USER+104) -#define WM_ACTION_DJEEP (WM_USER+105) -#define WM_ACTION_DRAPEAU (WM_USER+106) -#define WM_ACTION_DRAPEAU2 (WM_USER+107) -#define WM_ACTION_DRAPEAU3 (WM_USER+108) -#define WM_ACTION_EXTRAIT (WM_USER+109) -#define WM_ACTION_FABJEEP (WM_USER+110) -#define WM_ACTION_FABMINE (WM_USER+111) -#define WM_ACTION_MINE (WM_USER+112) -#define WM_ACTION_MINE2 (WM_USER+113) -#define WM_ACTION_R_BUILD6 (WM_USER+114) -#define WM_ACTION_R_MAKE6 (WM_USER+115) -#define WM_ACTION_E_RAYON (WM_USER+116) -#define WM_ACTION_ELECTRO (WM_USER+117) -#define WM_ACTION_ELECTROm (WM_USER+118) -#define WM_ACTION_GRILLE (WM_USER+119) -#define WM_ACTION_MAISON (WM_USER+120) -#define WM_ACTION_FABDISC (WM_USER+121) -#define WM_ACTION_A_MORT (WM_USER+122) -#define WM_ACTION_REPEAT (WM_USER+123) -#define WM_ACTION_TELEPORTE00 (WM_USER+124) -#define WM_ACTION_TELEPORTE10 (WM_USER+125) -#define WM_ACTION_TELEPORTE01 (WM_USER+126) -#define WM_ACTION_TELEPORTE11 (WM_USER+127) -#define WM_ACTION_FABARMURE (WM_USER+128) -#define WM_ACTION_MARMURE (WM_USER+129) -#define WM_ACTION_DARMURE (WM_USER+130) - -#define WM_BUTTON0 (WM_USER+200) -#define WM_BUTTON1 (WM_USER+201) -#define WM_BUTTON2 (WM_USER+202) -#define WM_BUTTON3 (WM_USER+203) -#define WM_BUTTON4 (WM_USER+204) -#define WM_BUTTON5 (WM_USER+205) -#define WM_BUTTON6 (WM_USER+206) -#define WM_BUTTON7 (WM_USER+207) -#define WM_BUTTON8 (WM_USER+208) -#define WM_BUTTON9 (WM_USER+209) -#define WM_BUTTON10 (WM_USER+210) -#define WM_BUTTON11 (WM_USER+211) -#define WM_BUTTON12 (WM_USER+212) -#define WM_BUTTON13 (WM_USER+213) -#define WM_BUTTON14 (WM_USER+214) -#define WM_BUTTON15 (WM_USER+215) -#define WM_BUTTON16 (WM_USER+216) -#define WM_BUTTON17 (WM_USER+217) -#define WM_BUTTON18 (WM_USER+218) -#define WM_BUTTON19 (WM_USER+219) -#define WM_BUTTON20 (WM_USER+220) -#define WM_BUTTON21 (WM_USER+221) -#define WM_BUTTON22 (WM_USER+222) -#define WM_BUTTON23 (WM_USER+223) -#define WM_BUTTON24 (WM_USER+224) -#define WM_BUTTON25 (WM_USER+225) -#define WM_BUTTON26 (WM_USER+226) -#define WM_BUTTON27 (WM_USER+227) -#define WM_BUTTON28 (WM_USER+228) -#define WM_BUTTON29 (WM_USER+229) -#define WM_BUTTON30 (WM_USER+230) -#define WM_BUTTON31 (WM_USER+231) -#define WM_BUTTON32 (WM_USER+232) -#define WM_BUTTON33 (WM_USER+233) -#define WM_BUTTON34 (WM_USER+234) -#define WM_BUTTON35 (WM_USER+235) -#define WM_BUTTON36 (WM_USER+236) -#define WM_BUTTON37 (WM_USER+237) -#define WM_BUTTON38 (WM_USER+238) -#define WM_BUTTON39 (WM_USER+239) - -#define WM_READ0 (WM_USER+300) -#define WM_READ1 (WM_USER+301) -#define WM_READ2 (WM_USER+302) -#define WM_READ3 (WM_USER+303) -#define WM_READ4 (WM_USER+304) -#define WM_READ5 (WM_USER+305) -#define WM_READ6 (WM_USER+306) -#define WM_READ7 (WM_USER+307) -#define WM_READ8 (WM_USER+308) -#define WM_READ9 (WM_USER+309) - -#define WM_WRITE0 (WM_USER+310) -#define WM_WRITE1 (WM_USER+311) -#define WM_WRITE2 (WM_USER+312) -#define WM_WRITE3 (WM_USER+313) -#define WM_WRITE4 (WM_USER+314) -#define WM_WRITE5 (WM_USER+315) -#define WM_WRITE6 (WM_USER+316) -#define WM_WRITE7 (WM_USER+317) -#define WM_WRITE8 (WM_USER+318) -#define WM_WRITE9 (WM_USER+319) - -#define WM_PHASE_INIT (WM_USER+500) -#define WM_PHASE_PLAY (WM_USER+501) -#define WM_PHASE_BUILD (WM_USER+502) -#define WM_PHASE_READ (WM_USER+503) -#define WM_PHASE_WRITE (WM_USER+504) -#define WM_PHASE_INFO (WM_USER+505) -#define WM_PHASE_BUTTON (WM_USER+506) -#define WM_PHASE_TERM (WM_USER+507) -#define WM_PHASE_WIN (WM_USER+508) -#define WM_PHASE_LOST (WM_USER+509) - - -#define WM_PHASE_MUSIC (WM_USER+512) -#define WM_PHASE_PLAYMOVIE (WM_USER+513) -#define WM_PHASE_WINMOVIE (WM_USER+514) -#define WM_PHASE_SCHOOL (WM_USER+515) -#define WM_PHASE_MISSION (WM_USER+516) -#define WM_PHASE_LASTWIN (WM_USER+517) -#define WM_PHASE_WRITEp (WM_USER+518) -#define WM_PHASE_SETUPp (WM_USER+519) -#define WM_PHASE_REGION (WM_USER+520) -#define WM_PHASE_INSERT (WM_USER+521) -#define WM_PHASE_HISTORY0 (WM_USER+522) -#define WM_PHASE_HISTORY1 (WM_USER+523) -#define WM_PHASE_HELP 1583 -#define WM_PHASE_H0MOVIE (WM_USER+525) -#define WM_PHASE_H1MOVIE (WM_USER+526) -#define WM_PHASE_H2MOVIE (WM_USER+527) -#define WM_PHASE_TESTCD (WM_USER+528) -#define WM_PHASE_MANUEL (WM_USER+529) -#define WM_PHASE_PRIVATE (WM_USER+530) -#define WM_PHASE_UNDO (WM_USER+531) -#define WM_PHASE_BYE (WM_USER+532) -#define WM_PHASE_SKILL1 (WM_USER+533) -#define WM_PHASE_SKILL2 (WM_USER+534) -#define WM_PHASE_DEMO 1557 -#define WM_PHASE_INTRO1 (WM_USER+536) -#define WM_PHASE_INTRO2 (WM_USER+537) -#define WM_PHASE_PLAYTEST (WM_USER+538) -#define WM_PHASE_WINMOVIEDESIGN (WM_USER+539) -#define WM_PHASE_WINMOVIEMULTI (WM_USER+540) - -#define WM_PREV (WM_USER+600) -#define WM_NEXT (WM_USER+601) -#define WM_MOVIE (WM_USER+602) -#define WM_PHASE_CREATE 1579 -#define WM_PHASE_608 1544 - -#define WM_PHASE_NAMEg 1527 -#define WM_PHASE_CLEARg 1528 -#define WM_PHASE_SETUP 1534 -#define WM_PHASE_DOPLAY 1539 -#define WM_PHASE_WINd 1546 -#define WM_PHASE_LOSTd 1547 -#define WM_PHASE_WINMOVIEd 1548 -#define WM_PHASE_WINm 1549 -#define WM_PHASE_LOSTm 1550 -#define WM_PHASE_WINMOVIEm 1551 -#define WM_PHASE_PRIVATE 1554 -#define WM_PHASE_NAMEd 1558 -#define WM_PHASE_WRITEd 1559 -#define WM_PHASE_READd 1560 -#define WM_PHASE_CONFIRM 1562 -#define WM_PHASE_YES 1563 -#define WM_PHASE_61C 1564 -#define WM_PHASE_61F 1567 -#define WM_PHASE_SERVICE 1568 -#define WM_PHASE_DPLAY_DO_SERVICE 1569 -#define WM_PHASE_DPLAY_CANCEL_SERVICE 1570 -#define WM_PHASE_SESSION 1571 -#define WM_PHASE_JOINGAME 1572 -#define WM_PHASE_DPLAY_CREATE_LOBBY 1573 -#define WM_PHASE_DPLAY_REFRESH 1574 -#define WM_PHASE_DPLAY_CANCEL_SESSION 1575 -#define WM_PHASE_MULTI 1576 -#define WM_PHASE_DPLAY_START_GAME_2 1577 -#define WM_PHASE_DPLAY_CANCEL_MULTI 1578 -#define WM_PHASE_DPLAY_CREATE 1580 -#define WM_PHASE_DPLAY_CANCEL_CREATE 1581 -#define WM_PHASE_STOP 1582 -#define WM_PHASE_634 1588 -#define WM_PHASE_GWRITE 1584 -#define WM_PHASE_GREADp 1585 -#define WM_PHASE_GREAD 1586 -#define WM_PHASE_DOQUIT 1587 -#define WM_PHASE_GAMER 1545 -#define WM_PHASE_CLEARg 1528 -#define WM_PHASE_CLEARd 1561 - - - -// Types de gestion de la souris. - -#define MOUSETYPEGRA 1 -#define MOUSETYPEWIN 2 -#define MOUSETYPEWINPOS 3 - - - -// Conditions pour gagner. - -typedef struct -{ - short bHachBlupi; // blupi sur dalle hachur�e - short bHachPlanche; // planches sur dalle hachur�e - short bStopFire; // feu �teint - short nbMinBlupi; // nb de blupi n�cessaires - short nbMaxBlupi; // nb de blupi n�cessaires - short bHomeBlupi; // blupi � la maison - short bKillRobots; // plus d'ennemis - short bHachTomate; // tomates sur dalle hachur�e - short bHachMetal; // m�tal sur dalle hachur�e - short bHachRobot; // robot sur dalle hachur�e - short reserve[14]; -} -Term; - diff --git a/dplay.h b/dplay.h deleted file mode 100644 index d91c0a5..0000000 --- a/dplay.h +++ /dev/null @@ -1,2154 +0,0 @@ -/*==========================================================================; - * - * Copyright (C) 1994-1997 Microsoft Corporation. All Rights Reserved. - * - * File: dplay.h - * Content: DirectPlay include file - * - ***************************************************************************/ - -#ifndef __DPLAY_INCLUDED__ -#define __DPLAY_INCLUDED__ - -#include // for DECLARE_INTERFACE and HRESULT - -/* avoid warnings in MSVC at Level4 */ -#if _MSC_VER >= 1200 -#pragma warning(push) -#endif -#pragma warning(disable:4201) - - -/* - * Some types - */ - -#ifndef _WIN64 -#define DWORD_PTR DWORD -#endif - -typedef LPVOID (*LPRGLPVOID)[]; -typedef LPRGLPVOID PRGPVOID, LPRGPVOID, PRGLPVOID, PAPVOID, LPAPVOID, PALPVOID, LPALPVOID; - -#define VOL volatile -typedef VOID *VOL LPVOIDV; - - -#define _FACDP 0x877 -#define MAKE_DPHRESULT( code ) MAKE_HRESULT( 1, _FACDP, code ) - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * GUIDS used by DirectPlay objects - */ -DEFINE_GUID(IID_IDirectPlay2, 0x2b74f7c0, 0x9154, 0x11cf, 0xa9, 0xcd, 0x0, 0xaa, 0x0, 0x68, 0x86, 0xe3); -DEFINE_GUID(IID_IDirectPlay2A,0x9d460580, 0xa822, 0x11cf, 0x96, 0xc, 0x0, 0x80, 0xc7, 0x53, 0x4e, 0x82); - -DEFINE_GUID(IID_IDirectPlay3, 0x133efe40, 0x32dc, 0x11d0, 0x9c, 0xfb, 0x0, 0xa0, 0xc9, 0xa, 0x43, 0xcb); -DEFINE_GUID(IID_IDirectPlay3A,0x133efe41, 0x32dc, 0x11d0, 0x9c, 0xfb, 0x0, 0xa0, 0xc9, 0xa, 0x43, 0xcb); - -DEFINE_GUID(IID_IDirectPlay4, 0xab1c530, 0x4745, 0x11d1, 0xa7, 0xa1, 0x0, 0x0, 0xf8, 0x3, 0xab, 0xfc); -DEFINE_GUID(IID_IDirectPlay4A,0xab1c531, 0x4745, 0x11d1, 0xa7, 0xa1, 0x0, 0x0, 0xf8, 0x3, 0xab, 0xfc); - -// {D1EB6D20-8923-11d0-9D97-00A0C90A43CB} -DEFINE_GUID(CLSID_DirectPlay,0xd1eb6d20, 0x8923, 0x11d0, 0x9d, 0x97, 0x0, 0xa0, 0xc9, 0xa, 0x43, 0xcb); - -/* - * GUIDS used by Service Providers shipped with DirectPlay - * Use these to identify Service Provider returned by EnumConnections - */ - -// GUID for IPX service provider -// {685BC400-9D2C-11cf-A9CD-00AA006886E3} -DEFINE_GUID(DPSPGUID_IPX, -0x685bc400, 0x9d2c, 0x11cf, 0xa9, 0xcd, 0x0, 0xaa, 0x0, 0x68, 0x86, 0xe3); - -// GUID for TCP/IP service provider -// 36E95EE0-8577-11cf-960C-0080C7534E82 -DEFINE_GUID(DPSPGUID_TCPIP, -0x36E95EE0, 0x8577, 0x11cf, 0x96, 0xc, 0x0, 0x80, 0xc7, 0x53, 0x4e, 0x82); - -// GUID for Serial service provider -// {0F1D6860-88D9-11cf-9C4E-00A0C905425E} -DEFINE_GUID(DPSPGUID_SERIAL, -0xf1d6860, 0x88d9, 0x11cf, 0x9c, 0x4e, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e); - -// GUID for Modem service provider -// {44EAA760-CB68-11cf-9C4E-00A0C905425E} -DEFINE_GUID(DPSPGUID_MODEM, -0x44eaa760, 0xcb68, 0x11cf, 0x9c, 0x4e, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e); - -/**************************************************************************** - * - * DirectPlay Structures - * - * Various structures used to invoke DirectPlay. - * - ****************************************************************************/ - -#ifndef IDIRECTPLAY2_OR_GREATER -typedef struct IDirectPlay FAR *LPDIRECTPLAY; -#else -typedef struct IUnknown FAR *LPDIRECTPLAY; -#endif - -typedef struct IDirectPlay2 FAR *LPDIRECTPLAY2; -typedef struct IDirectPlay2 FAR *LPDIRECTPLAY2A; -typedef struct IDirectPlay2 IDirectPlay2A; - -typedef struct IDirectPlay3 FAR *LPDIRECTPLAY3; -typedef struct IDirectPlay3 FAR *LPDIRECTPLAY3A; -typedef struct IDirectPlay3 IDirectPlay3A; - -typedef struct IDirectPlay4 FAR *LPDIRECTPLAY4; -typedef struct IDirectPlay4 FAR *LPDIRECTPLAY4A; -typedef struct IDirectPlay4 IDirectPlay4A; - -/* - * DPID - * DirectPlay player and group ID - */ -typedef DWORD DPID, FAR *LPDPID; - -/* - * DPID that system messages come from - */ -#define DPID_SYSMSG 0 - -/* - * DPID representing all players in the session - */ -#define DPID_ALLPLAYERS 0 - -/* - * DPID representing the server player - */ -#define DPID_SERVERPLAYER 1 - - -/* - * DPID representing the maxiumum ID in the range of DPID's reserved for - * use by DirectPlay. - */ -#define DPID_RESERVEDRANGE 100 - -/* - * The player ID is unknown (used with e.g. DPSESSION_NOMESSAGEID) - */ -#define DPID_UNKNOWN 0xFFFFFFFF - -/* - * DPCAPS - * Used to obtain the capabilities of a DirectPlay object - */ -typedef struct -{ - DWORD dwSize; // Size of structure, in bytes - DWORD dwFlags; // DPCAPS_xxx flags - DWORD dwMaxBufferSize; // Maximum message size, in bytes, for this service provider - DWORD dwMaxQueueSize; // Obsolete. - DWORD dwMaxPlayers; // Maximum players/groups (local + remote) - DWORD dwHundredBaud; // Bandwidth in 100 bits per second units; - // i.e. 24 is 2400, 96 is 9600, etc. - DWORD dwLatency; // Estimated latency; 0 = unknown - DWORD dwMaxLocalPlayers; // Maximum # of locally created players allowed - DWORD dwHeaderLength; // Maximum header length, in bytes, on messages - // added by the service provider - DWORD dwTimeout; // Service provider's suggested timeout value - // This is how long DirectPlay will wait for - // responses to system messages -} DPCAPS, FAR *LPDPCAPS; - -/* - * This DirectPlay object is the session host. If the host exits the - * session, another application will become the host and receive a - * DPSYS_HOST system message. - */ -#define DPCAPS_ISHOST 0x00000002 - -/* - * The service provider bound to this DirectPlay object can optimize - * group messaging. - */ -#define DPCAPS_GROUPOPTIMIZED 0x00000008 - -/* - * The service provider bound to this DirectPlay object can optimize - * keep alives (see DPSESSION_KEEPALIVE) - */ -#define DPCAPS_KEEPALIVEOPTIMIZED 0x00000010 - -/* - * The service provider bound to this DirectPlay object can optimize - * guaranteed message delivery. - */ -#define DPCAPS_GUARANTEEDOPTIMIZED 0x00000020 - -/* - * This DirectPlay object supports guaranteed message delivery. - */ -#define DPCAPS_GUARANTEEDSUPPORTED 0x00000040 - -/* - * This DirectPlay object supports digital signing of messages. - */ -#define DPCAPS_SIGNINGSUPPORTED 0x00000080 - -/* - * This DirectPlay object supports encryption of messages. - */ -#define DPCAPS_ENCRYPTIONSUPPORTED 0x00000100 - -/* - * This DirectPlay player was created on this machine - */ -#define DPPLAYERCAPS_LOCAL 0x00000800 - -/* - * Current Open settings supports all forms of Cancel - */ -#define DPCAPS_ASYNCCANCELSUPPORTED 0x00001000 - -/* - * Current Open settings supports CancelAll, but not Cancel - */ -#define DPCAPS_ASYNCCANCELALLSUPPORTED 0x00002000 - -/* - * Current Open settings supports Send Timeouts for sends - */ -#define DPCAPS_SENDTIMEOUTSUPPORTED 0x00004000 - -/* - * Current Open settings supports send priority - */ -#define DPCAPS_SENDPRIORITYSUPPORTED 0x00008000 - -/* - * Current Open settings supports DPSEND_ASYNC flag - */ -#define DPCAPS_ASYNCSUPPORTED 0x00010000 - - -/* - * DPSESSIONDESC2 - * Used to describe the properties of a DirectPlay - * session instance - */ -typedef struct -{ - DWORD dwSize; // Size of structure - DWORD dwFlags; // DPSESSION_xxx flags - GUID guidInstance; // ID for the session instance - GUID guidApplication; // GUID of the DirectPlay application. - // GUID_NULL for all applications. - DWORD dwMaxPlayers; // Maximum # players allowed in session - DWORD dwCurrentPlayers; // Current # players in session (read only) - union - { // Name of the session - LPWSTR lpszSessionName; // Unicode - LPSTR lpszSessionNameA; // ANSI - }; - union - { // Password of the session (optional) - LPWSTR lpszPassword; // Unicode - LPSTR lpszPasswordA; // ANSI - }; - DWORD_PTR dwReserved1; // Reserved for future MS use. - DWORD_PTR dwReserved2; - DWORD_PTR dwUser1; // For use by the application - DWORD_PTR dwUser2; - DWORD_PTR dwUser3; - DWORD_PTR dwUser4; -} DPSESSIONDESC2, FAR *LPDPSESSIONDESC2; - -typedef DPSESSIONDESC2 * VOL LPDPSESSIONDESC2_V; - -/* - * LPCDPSESSIONDESC2 - * A constant pointer to DPSESSIONDESC2 - */ -typedef const DPSESSIONDESC2 FAR *LPCDPSESSIONDESC2; - -/* - * Applications cannot create new players in this session. - */ -#define DPSESSION_NEWPLAYERSDISABLED 0x00000001 - -/* - * If the DirectPlay object that created the session, the host, - * quits, then the host will attempt to migrate to another - * DirectPlay object so that new players can continue to be created - * and new applications can join the session. - */ -#define DPSESSION_MIGRATEHOST 0x00000004 - -/* - * This flag tells DirectPlay not to set the idPlayerTo and idPlayerFrom - * fields in player messages. This cuts two DWORD's off the message - * overhead. - */ -#define DPSESSION_NOMESSAGEID 0x00000008 - - -/* - * This flag tells DirectPlay to not allow any new applications to - * join the session. Applications already in the session can still - * create new players. - */ -#define DPSESSION_JOINDISABLED 0x00000020 - -/* - * This flag tells DirectPlay to detect when remote players - * exit abnormally (e.g. their computer or modem gets unplugged) - */ -#define DPSESSION_KEEPALIVE 0x00000040 - -/* - * This flag tells DirectPlay not to send a message to all players - * when a players remote data changes - */ -#define DPSESSION_NODATAMESSAGES 0x00000080 - -/* - * This flag indicates that the session belongs to a secure server - * and needs user authentication - */ -#define DPSESSION_SECURESERVER 0x00000100 - -/* - * This flag indicates that the session is private and requirs a password - * for EnumSessions as well as Open. - */ -#define DPSESSION_PRIVATE 0x00000200 - -/* - * This flag indicates that the session requires a password for joining. - */ -#define DPSESSION_PASSWORDREQUIRED 0x00000400 - -/* - * This flag tells DirectPlay to route all messages through the server - */ -#define DPSESSION_MULTICASTSERVER 0x00000800 - -/* - * This flag tells DirectPlay to only download information about the - * DPPLAYER_SERVERPLAYER. - */ -#define DPSESSION_CLIENTSERVER 0x00001000 - -/* - * This flag tells DirectPlay to use the protocol built into dplay - * for reliability and statistics all the time. When this bit is - * set, only other sessions with this bit set can join or be joined. - */ -#define DPSESSION_DIRECTPLAYPROTOCOL 0x00002000 - -/* - * This flag tells DirectPlay that preserving order of received - * packets is not important, when using reliable delivery. This - * will allow messages to be indicated out of order if preceding - * messages have not yet arrived. Otherwise DPLAY will wait for - * earlier messages before delivering later reliable messages. - */ -#define DPSESSION_NOPRESERVEORDER 0x00004000 - - -/* - * This flag tells DirectPlay to optimize communication for latency - */ -#define DPSESSION_OPTIMIZELATENCY 0x00008000 - -/* - * This flag allows lobby launched games that aren't voice enabled - * to get voice capabilities. - */ -#define DPSESSION_ALLOWVOICERETRO 0x00010000 - -/* - * This flag supresses transmission of session desc changes. - * DPSESSION_NODATAMESSAGES was supposed to do that, but SetSessionDesc - * was ignoring the flag and some apps depended on the broken behavior, this - * flag allows applications to get the right behaviour without breaking apps depending - * on old broken behavior. - */ -#define DPSESSION_NOSESSIONDESCMESSAGES 0x00020000 - -/* - * DPNAME - * Used to hold the name of a DirectPlay entity - * like a player or a group - */ -typedef struct -{ - DWORD dwSize; // Size of structure - DWORD dwFlags; // Not used. Must be zero. - union - { // The short or friendly name - LPWSTR lpszShortName; // Unicode - LPSTR lpszShortNameA; // ANSI - }; - union - { // The long or formal name - LPWSTR lpszLongName; // Unicode - LPSTR lpszLongNameA; // ANSI - }; - -} DPNAME, FAR *LPDPNAME; - -/* - * LPCDPNAME - * A constant pointer to DPNAME - */ -typedef const DPNAME FAR *LPCDPNAME; - -/* - * DPCREDENTIALS - * Used to hold the user name and password of a DirectPlay user - */ -typedef struct -{ - DWORD dwSize; // Size of structure - DWORD dwFlags; // Not used. Must be zero. - union - { // User name of the account - LPWSTR lpszUsername; // Unicode - LPSTR lpszUsernameA; // ANSI - }; - union - { // Password of the account - LPWSTR lpszPassword; // Unicode - LPSTR lpszPasswordA; // ANSI - }; - union - { // Domain name of the account - LPWSTR lpszDomain; // Unicode - LPSTR lpszDomainA; // ANSI - }; -} DPCREDENTIALS, FAR *LPDPCREDENTIALS; - -typedef const DPCREDENTIALS FAR *LPCDPCREDENTIALS; - -/* - * DPSECURITYDESC - * Used to describe the security properties of a DirectPlay - * session instance - */ -typedef struct -{ - DWORD dwSize; // Size of structure - DWORD dwFlags; // Not used. Must be zero. - union - { // SSPI provider name - LPWSTR lpszSSPIProvider; // Unicode - LPSTR lpszSSPIProviderA; // ANSI - }; - union - { // CAPI provider name - LPWSTR lpszCAPIProvider; // Unicode - LPSTR lpszCAPIProviderA; // ANSI - }; - DWORD dwCAPIProviderType; // Crypto Service Provider type - DWORD dwEncryptionAlgorithm; // Encryption Algorithm type -} DPSECURITYDESC, FAR *LPDPSECURITYDESC; - -typedef const DPSECURITYDESC FAR *LPCDPSECURITYDESC; - -/* - * DPACCOUNTDESC - * Used to describe a user membership account - */ -typedef struct -{ - DWORD dwSize; // Size of structure - DWORD dwFlags; // Not used. Must be zero. - union - { // Account identifier - LPWSTR lpszAccountID; // Unicode - LPSTR lpszAccountIDA; // ANSI - }; -} DPACCOUNTDESC, FAR *LPDPACCOUNTDESC; - -typedef const DPACCOUNTDESC FAR *LPCDPACCOUNTDESC; - -/* - * LPCGUID - * A constant pointer to a guid - */ -typedef const GUID FAR *LPCGUID; - -/* - * DPLCONNECTION - * Used to hold all in the informaion needed to connect - * an application to a session or create a session - */ -typedef struct -{ - DWORD dwSize; // Size of this structure - DWORD dwFlags; // Flags specific to this structure - LPDPSESSIONDESC2 lpSessionDesc; // Pointer to session desc to use on connect - LPDPNAME lpPlayerName; // Pointer to Player name structure - GUID guidSP; // GUID of the DPlay SP to use - LPVOID lpAddress; // Address for service provider - DWORD dwAddressSize; // Size of address data -} DPLCONNECTION, FAR *LPDPLCONNECTION; - -/* - * LPCDPLCONNECTION - * A constant pointer to DPLCONNECTION - */ -typedef const DPLCONNECTION FAR *LPCDPLCONNECTION; - -/* - * DPCHAT - * Used to hold the a DirectPlay chat message - */ -typedef struct -{ - DWORD dwSize; - DWORD dwFlags; - union - { // Message string - LPWSTR lpszMessage; // Unicode - LPSTR lpszMessageA; // ANSI - }; -} DPCHAT, FAR * LPDPCHAT; - -/* - * SGBUFFER - * Scatter Gather Buffer used for SendEx - */ -typedef struct -{ - UINT len; // length of buffer data - PUCHAR pData; // pointer to buffer data -} SGBUFFER, *PSGBUFFER, FAR *LPSGBUFFER; - - -/**************************************************************************** - * - * Prototypes for DirectPlay callback functions - * - ****************************************************************************/ - -/* - * Callback for IDirectPlay2::EnumSessions - */ -typedef BOOL (FAR PASCAL * LPDPENUMSESSIONSCALLBACK2)( - LPCDPSESSIONDESC2 lpThisSD, - LPDWORD lpdwTimeOut, - DWORD dwFlags, - LPVOID lpContext ); - -/* - * This flag is set on the EnumSessions callback dwFlags parameter when - * the time out has occurred. There will be no session data for this - * callback. If *lpdwTimeOut is set to a non-zero value and the - * EnumSessionsCallback function returns TRUE then EnumSessions will - * continue waiting until the next timeout occurs. Timeouts are in - * milliseconds. - */ -#define DPESC_TIMEDOUT 0x00000001 - - -/* - * Callback for IDirectPlay2::EnumPlayers - * IDirectPlay2::EnumGroups - * IDirectPlay2::EnumGroupPlayers - */ -typedef BOOL (FAR PASCAL *LPDPENUMPLAYERSCALLBACK2)( - DPID dpId, - DWORD dwPlayerType, - LPCDPNAME lpName, - DWORD dwFlags, - LPVOID lpContext ); - - -/* - * Unicode callback for DirectPlayEnumerate - * This callback prototype will be used if compiling - * for Unicode strings - */ -typedef BOOL (FAR PASCAL * LPDPENUMDPCALLBACK)( - LPGUID lpguidSP, - LPWSTR lpSPName, - DWORD dwMajorVersion, - DWORD dwMinorVersion, - LPVOID lpContext); - -/* - * ANSI callback for DirectPlayEnumerate - * This callback prototype will be used if compiling - * for ANSI strings - */ -typedef BOOL (FAR PASCAL * LPDPENUMDPCALLBACKA)( - LPGUID lpguidSP, - LPSTR lpSPName, - DWORD dwMajorVersion, - DWORD dwMinorVersion, - LPVOID lpContext); - -/* - * Callback for IDirectPlay3(A)::EnumConnections - */ -typedef BOOL (FAR PASCAL * LPDPENUMCONNECTIONSCALLBACK)( - LPCGUID lpguidSP, - LPVOID lpConnection, - DWORD dwConnectionSize, - LPCDPNAME lpName, - DWORD dwFlags, - LPVOID lpContext); - - -/* - * API's - */ - -#ifdef UNICODE -#define DirectPlayEnumerate DirectPlayEnumerateW -#else -#define DirectPlayEnumerate DirectPlayEnumerateA -#endif // UNICODE - -extern HRESULT WINAPI DirectPlayEnumerateA( LPDPENUMDPCALLBACKA, LPVOID ); -extern HRESULT WINAPI DirectPlayEnumerateW( LPDPENUMDPCALLBACK, LPVOID ); -extern HRESULT WINAPI DirectPlayCreate( LPGUID lpGUID, LPDIRECTPLAY *lplpDP, IUnknown *pUnk); - -/**************************************************************************** - * - * IDirectPlay2 (and IDirectPlay2A) Interface - * - ****************************************************************************/ - -#undef INTERFACE -#define INTERFACE IDirectPlay2 -DECLARE_INTERFACE_( IDirectPlay2, IUnknown ) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IDirectPlay2 methods ***/ - STDMETHOD(AddPlayerToGroup) (THIS_ DPID, DPID) PURE; - STDMETHOD(Close) (THIS) PURE; - STDMETHOD(CreateGroup) (THIS_ LPDPID,LPDPNAME,LPVOID,DWORD,DWORD) PURE; - STDMETHOD(CreatePlayer) (THIS_ LPDPID,LPDPNAME,HANDLE,LPVOID,DWORD,DWORD) PURE; - STDMETHOD(DeletePlayerFromGroup)(THIS_ DPID,DPID) PURE; - STDMETHOD(DestroyGroup) (THIS_ DPID) PURE; - STDMETHOD(DestroyPlayer) (THIS_ DPID) PURE; - STDMETHOD(EnumGroupPlayers) (THIS_ DPID,LPGUID,LPDPENUMPLAYERSCALLBACK2,LPVOID,DWORD) PURE; - STDMETHOD(EnumGroups) (THIS_ LPGUID,LPDPENUMPLAYERSCALLBACK2,LPVOID,DWORD) PURE; - STDMETHOD(EnumPlayers) (THIS_ LPGUID,LPDPENUMPLAYERSCALLBACK2,LPVOID,DWORD) PURE; - STDMETHOD(EnumSessions) (THIS_ LPDPSESSIONDESC2,DWORD,LPDPENUMSESSIONSCALLBACK2,LPVOID,DWORD) PURE; - STDMETHOD(GetCaps) (THIS_ LPDPCAPS,DWORD) PURE; - STDMETHOD(GetGroupData) (THIS_ DPID,LPVOID,LPDWORD,DWORD) PURE; - STDMETHOD(GetGroupName) (THIS_ DPID,LPVOID,LPDWORD) PURE; - STDMETHOD(GetMessageCount) (THIS_ DPID, LPDWORD) PURE; - STDMETHOD(GetPlayerAddress) (THIS_ DPID,LPVOID,LPDWORD) PURE; - STDMETHOD(GetPlayerCaps) (THIS_ DPID,LPDPCAPS,DWORD) PURE; - STDMETHOD(GetPlayerData) (THIS_ DPID,LPVOID,LPDWORD,DWORD) PURE; - STDMETHOD(GetPlayerName) (THIS_ DPID,LPVOID,LPDWORD) PURE; - STDMETHOD(GetSessionDesc) (THIS_ LPVOID,LPDWORD) PURE; - STDMETHOD(Initialize) (THIS_ LPGUID) PURE; - STDMETHOD(Open) (THIS_ LPDPSESSIONDESC2,DWORD) PURE; - STDMETHOD(Receive) (THIS_ LPDPID,LPDPID,DWORD,LPVOID,LPDWORD) PURE; - STDMETHOD(Send) (THIS_ DPID, DPID, DWORD, LPVOID, DWORD) PURE; - STDMETHOD(SetGroupData) (THIS_ DPID,LPVOID,DWORD,DWORD) PURE; - STDMETHOD(SetGroupName) (THIS_ DPID,LPDPNAME,DWORD) PURE; - STDMETHOD(SetPlayerData) (THIS_ DPID,LPVOID,DWORD,DWORD) PURE; - STDMETHOD(SetPlayerName) (THIS_ DPID,LPDPNAME,DWORD) PURE; - STDMETHOD(SetSessionDesc) (THIS_ LPDPSESSIONDESC2,DWORD) PURE; -}; - -/**************************************************************************** - * - * IDirectPlay2 interface macros - * - ****************************************************************************/ - -#if !defined(__cplusplus) || defined(CINTERFACE) - -#define IDirectPlay2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectPlay2_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectPlay2_Release(p) (p)->lpVtbl->Release(p) -#define IDirectPlay2_AddPlayerToGroup(p,a,b) (p)->lpVtbl->AddPlayerToGroup(p,a,b) -#define IDirectPlay2_Close(p) (p)->lpVtbl->Close(p) -#define IDirectPlay2_CreateGroup(p,a,b,c,d,e) (p)->lpVtbl->CreateGroup(p,a,b,c,d,e) -#define IDirectPlay2_CreatePlayer(p,a,b,c,d,e,f) (p)->lpVtbl->CreatePlayer(p,a,b,c,d,e,f) -#define IDirectPlay2_DeletePlayerFromGroup(p,a,b) (p)->lpVtbl->DeletePlayerFromGroup(p,a,b) -#define IDirectPlay2_DestroyGroup(p,a) (p)->lpVtbl->DestroyGroup(p,a) -#define IDirectPlay2_DestroyPlayer(p,a) (p)->lpVtbl->DestroyPlayer(p,a) -#define IDirectPlay2_EnumGroupPlayers(p,a,b,c,d,e) (p)->lpVtbl->EnumGroupPlayers(p,a,b,c,d,e) -#define IDirectPlay2_EnumGroups(p,a,b,c,d) (p)->lpVtbl->EnumGroups(p,a,b,c,d) -#define IDirectPlay2_EnumPlayers(p,a,b,c,d) (p)->lpVtbl->EnumPlayers(p,a,b,c,d) -#define IDirectPlay2_EnumSessions(p,a,b,c,d,e) (p)->lpVtbl->EnumSessions(p,a,b,c,d,e) -#define IDirectPlay2_GetCaps(p,a,b) (p)->lpVtbl->GetCaps(p,a,b) -#define IDirectPlay2_GetMessageCount(p,a,b) (p)->lpVtbl->GetMessageCount(p,a,b) -#define IDirectPlay2_GetGroupData(p,a,b,c,d) (p)->lpVtbl->GetGroupData(p,a,b,c,d) -#define IDirectPlay2_GetGroupName(p,a,b,c) (p)->lpVtbl->GetGroupName(p,a,b,c) -#define IDirectPlay2_GetPlayerAddress(p,a,b,c) (p)->lpVtbl->GetPlayerAddress(p,a,b,c) -#define IDirectPlay2_GetPlayerCaps(p,a,b,c) (p)->lpVtbl->GetPlayerCaps(p,a,b,c) -#define IDirectPlay2_GetPlayerData(p,a,b,c,d) (p)->lpVtbl->GetPlayerData(p,a,b,c,d) -#define IDirectPlay2_GetPlayerName(p,a,b,c) (p)->lpVtbl->GetPlayerName(p,a,b,c) -#define IDirectPlay2_GetSessionDesc(p,a,b) (p)->lpVtbl->GetSessionDesc(p,a,b) -#define IDirectPlay2_Initialize(p,a) (p)->lpVtbl->Initialize(p,a) -#define IDirectPlay2_Open(p,a,b) (p)->lpVtbl->Open(p,a,b) -#define IDirectPlay2_Receive(p,a,b,c,d,e) (p)->lpVtbl->Receive(p,a,b,c,d,e) -#define IDirectPlay2_Send(p,a,b,c,d,e) (p)->lpVtbl->Send(p,a,b,c,d,e) -#define IDirectPlay2_SetGroupData(p,a,b,c,d) (p)->lpVtbl->SetGroupData(p,a,b,c,d) -#define IDirectPlay2_SetGroupName(p,a,b,c) (p)->lpVtbl->SetGroupName(p,a,b,c) -#define IDirectPlay2_SetPlayerData(p,a,b,c,d) (p)->lpVtbl->SetPlayerData(p,a,b,c,d) -#define IDirectPlay2_SetPlayerName(p,a,b,c) (p)->lpVtbl->SetPlayerName(p,a,b,c) -#define IDirectPlay2_SetSessionDesc(p,a,b) (p)->lpVtbl->SetSessionDesc(p,a,b) - -#else /* C++ */ - -#define IDirectPlay2_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirectPlay2_AddRef(p) (p)->AddRef() -#define IDirectPlay2_Release(p) (p)->Release() -#define IDirectPlay2_AddPlayerToGroup(p,a,b) (p)->AddPlayerToGroup(a,b) -#define IDirectPlay2_Close(p) (p)->Close() -#define IDirectPlay2_CreateGroup(p,a,b,c,d,e) (p)->CreateGroup(a,b,c,d,e) -#define IDirectPlay2_CreatePlayer(p,a,b,c,d,e,f) (p)->CreatePlayer(a,b,c,d,e,f) -#define IDirectPlay2_DeletePlayerFromGroup(p,a,b) (p)->DeletePlayerFromGroup(a,b) -#define IDirectPlay2_DestroyGroup(p,a) (p)->DestroyGroup(a) -#define IDirectPlay2_DestroyPlayer(p,a) (p)->DestroyPlayer(a) -#define IDirectPlay2_EnumGroupPlayers(p,a,b,c,d,e) (p)->EnumGroupPlayers(a,b,c,d,e) -#define IDirectPlay2_EnumGroups(p,a,b,c,d) (p)->EnumGroups(a,b,c,d) -#define IDirectPlay2_EnumPlayers(p,a,b,c,d) (p)->EnumPlayers(a,b,c,d) -#define IDirectPlay2_EnumSessions(p,a,b,c,d,e) (p)->EnumSessions(a,b,c,d,e) -#define IDirectPlay2_GetCaps(p,a,b) (p)->GetCaps(a,b) -#define IDirectPlay2_GetMessageCount(p,a,b) (p)->GetMessageCount(a,b) -#define IDirectPlay2_GetGroupData(p,a,b,c,d) (p)->GetGroupData(a,b,c,d) -#define IDirectPlay2_GetGroupName(p,a,b,c) (p)->GetGroupName(a,b,c) -#define IDirectPlay2_GetPlayerAddress(p,a,b,c) (p)->GetPlayerAddress(a,b,c) -#define IDirectPlay2_GetPlayerCaps(p,a,b,c) (p)->GetPlayerCaps(a,b,c) -#define IDirectPlay2_GetPlayerData(p,a,b,c,d) (p)->GetPlayerData(a,b,c,d) -#define IDirectPlay2_GetPlayerName(p,a,b,c) (p)->GetPlayerName(a,b,c) -#define IDirectPlay2_GetSessionDesc(p,a,b) (p)->GetSessionDesc(a,b) -#define IDirectPlay2_Initialize(p,a) (p)->Initialize(a) -#define IDirectPlay2_Open(p,a,b) (p)->Open(a,b) -#define IDirectPlay2_Receive(p,a,b,c,d,e) (p)->Receive(a,b,c,d,e) -#define IDirectPlay2_Send(p,a,b,c,d,e) (p)->Send(a,b,c,d,e) -#define IDirectPlay2_SetGroupData(p,a,b,c,d) (p)->SetGroupData(a,b,c,d) -#define IDirectPlay2_SetGroupName(p,a,b,c) (p)->SetGroupName(a,b,c) -#define IDirectPlay2_SetPlayerData(p,a,b,c,d) (p)->SetPlayerData(a,b,c,d) -#define IDirectPlay2_SetPlayerName(p,a,b,c) (p)->SetPlayerName(a,b,c) -#define IDirectPlay2_SetSessionDesc(p,a,b) (p)->SetSessionDesc(a,b) - -#endif - -/**************************************************************************** - * - * IDirectPlay3 (and IDirectPlay3A) Interface - * - ****************************************************************************/ - -#undef INTERFACE -#define INTERFACE IDirectPlay3 -DECLARE_INTERFACE_( IDirectPlay3, IDirectPlay2 ) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IDirectPlay2 methods ***/ - STDMETHOD(AddPlayerToGroup) (THIS_ DPID, DPID) PURE; - STDMETHOD(Close) (THIS) PURE; - STDMETHOD(CreateGroup) (THIS_ LPDPID,LPDPNAME,LPVOID,DWORD,DWORD) PURE; - STDMETHOD(CreatePlayer) (THIS_ LPDPID,LPDPNAME,HANDLE,LPVOID,DWORD,DWORD) PURE; - STDMETHOD(DeletePlayerFromGroup)(THIS_ DPID,DPID) PURE; - STDMETHOD(DestroyGroup) (THIS_ DPID) PURE; - STDMETHOD(DestroyPlayer) (THIS_ DPID) PURE; - STDMETHOD(EnumGroupPlayers) (THIS_ DPID,LPGUID,LPDPENUMPLAYERSCALLBACK2,LPVOID,DWORD) PURE; - STDMETHOD(EnumGroups) (THIS_ LPGUID,LPDPENUMPLAYERSCALLBACK2,LPVOID,DWORD) PURE; - STDMETHOD(EnumPlayers) (THIS_ LPGUID,LPDPENUMPLAYERSCALLBACK2,LPVOID,DWORD) PURE; - STDMETHOD(EnumSessions) (THIS_ LPDPSESSIONDESC2,DWORD,LPDPENUMSESSIONSCALLBACK2,LPVOID,DWORD) PURE; - STDMETHOD(GetCaps) (THIS_ LPDPCAPS,DWORD) PURE; - STDMETHOD(GetGroupData) (THIS_ DPID,LPVOID,LPDWORD,DWORD) PURE; - STDMETHOD(GetGroupName) (THIS_ DPID,LPVOID,LPDWORD) PURE; - STDMETHOD(GetMessageCount) (THIS_ DPID, LPDWORD) PURE; - STDMETHOD(GetPlayerAddress) (THIS_ DPID,LPVOID,LPDWORD) PURE; - STDMETHOD(GetPlayerCaps) (THIS_ DPID,LPDPCAPS,DWORD) PURE; - STDMETHOD(GetPlayerData) (THIS_ DPID,LPVOID,LPDWORD,DWORD) PURE; - STDMETHOD(GetPlayerName) (THIS_ DPID,LPVOID,LPDWORD) PURE; - STDMETHOD(GetSessionDesc) (THIS_ LPVOID,LPDWORD) PURE; - STDMETHOD(Initialize) (THIS_ LPGUID) PURE; - STDMETHOD(Open) (THIS_ LPDPSESSIONDESC2,DWORD) PURE; - STDMETHOD(Receive) (THIS_ LPDPID,LPDPID,DWORD,LPVOID,LPDWORD) PURE; - STDMETHOD(Send) (THIS_ DPID, DPID, DWORD, LPVOID, DWORD) PURE; - STDMETHOD(SetGroupData) (THIS_ DPID,LPVOID,DWORD,DWORD) PURE; - STDMETHOD(SetGroupName) (THIS_ DPID,LPDPNAME,DWORD) PURE; - STDMETHOD(SetPlayerData) (THIS_ DPID,LPVOID,DWORD,DWORD) PURE; - STDMETHOD(SetPlayerName) (THIS_ DPID,LPDPNAME,DWORD) PURE; - STDMETHOD(SetSessionDesc) (THIS_ LPDPSESSIONDESC2,DWORD) PURE; - /*** IDirectPlay3 methods ***/ - STDMETHOD(AddGroupToGroup) (THIS_ DPID, DPID) PURE; - STDMETHOD(CreateGroupInGroup) (THIS_ DPID,LPDPID,LPDPNAME,LPVOID,DWORD,DWORD) PURE; - STDMETHOD(DeleteGroupFromGroup) (THIS_ DPID,DPID) PURE; - STDMETHOD(EnumConnections) (THIS_ LPCGUID,LPDPENUMCONNECTIONSCALLBACK,LPVOID,DWORD) PURE; - STDMETHOD(EnumGroupsInGroup) (THIS_ DPID,LPGUID,LPDPENUMPLAYERSCALLBACK2,LPVOID,DWORD) PURE; - STDMETHOD(GetGroupConnectionSettings)(THIS_ DWORD, DPID, LPVOID, LPDWORD) PURE; - STDMETHOD(InitializeConnection) (THIS_ LPVOID,DWORD) PURE; - STDMETHOD(SecureOpen) (THIS_ LPCDPSESSIONDESC2,DWORD,LPCDPSECURITYDESC,LPCDPCREDENTIALS) PURE; - STDMETHOD(SendChatMessage) (THIS_ DPID,DPID,DWORD,LPDPCHAT) PURE; - STDMETHOD(SetGroupConnectionSettings)(THIS_ DWORD,DPID,LPDPLCONNECTION) PURE; - STDMETHOD(StartSession) (THIS_ DWORD,DPID) PURE; - STDMETHOD(GetGroupFlags) (THIS_ DPID,LPDWORD) PURE; - STDMETHOD(GetGroupParent) (THIS_ DPID,LPDPID) PURE; - STDMETHOD(GetPlayerAccount) (THIS_ DPID, DWORD, LPVOID, LPDWORD) PURE; - STDMETHOD(GetPlayerFlags) (THIS_ DPID,LPDWORD) PURE; -}; - -/**************************************************************************** - * - * IDirectPlay3 interface macros - * - ****************************************************************************/ - -#if !defined(__cplusplus) || defined(CINTERFACE) - -#define IDirectPlay3_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectPlay3_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectPlay3_Release(p) (p)->lpVtbl->Release(p) -#define IDirectPlay3_AddPlayerToGroup(p,a,b) (p)->lpVtbl->AddPlayerToGroup(p,a,b) -#define IDirectPlay3_Close(p) (p)->lpVtbl->Close(p) -#define IDirectPlay3_CreateGroup(p,a,b,c,d,e) (p)->lpVtbl->CreateGroup(p,a,b,c,d,e) -#define IDirectPlay3_CreatePlayer(p,a,b,c,d,e,f) (p)->lpVtbl->CreatePlayer(p,a,b,c,d,e,f) -#define IDirectPlay3_DeletePlayerFromGroup(p,a,b) (p)->lpVtbl->DeletePlayerFromGroup(p,a,b) -#define IDirectPlay3_DestroyGroup(p,a) (p)->lpVtbl->DestroyGroup(p,a) -#define IDirectPlay3_DestroyPlayer(p,a) (p)->lpVtbl->DestroyPlayer(p,a) -#define IDirectPlay3_EnumGroupPlayers(p,a,b,c,d,e) (p)->lpVtbl->EnumGroupPlayers(p,a,b,c,d,e) -#define IDirectPlay3_EnumGroups(p,a,b,c,d) (p)->lpVtbl->EnumGroups(p,a,b,c,d) -#define IDirectPlay3_EnumPlayers(p,a,b,c,d) (p)->lpVtbl->EnumPlayers(p,a,b,c,d) -#define IDirectPlay3_EnumSessions(p,a,b,c,d,e) (p)->lpVtbl->EnumSessions(p,a,b,c,d,e) -#define IDirectPlay3_GetCaps(p,a,b) (p)->lpVtbl->GetCaps(p,a,b) -#define IDirectPlay3_GetMessageCount(p,a,b) (p)->lpVtbl->GetMessageCount(p,a,b) -#define IDirectPlay3_GetGroupData(p,a,b,c,d) (p)->lpVtbl->GetGroupData(p,a,b,c,d) -#define IDirectPlay3_GetGroupName(p,a,b,c) (p)->lpVtbl->GetGroupName(p,a,b,c) -#define IDirectPlay3_GetPlayerAddress(p,a,b,c) (p)->lpVtbl->GetPlayerAddress(p,a,b,c) -#define IDirectPlay3_GetPlayerCaps(p,a,b,c) (p)->lpVtbl->GetPlayerCaps(p,a,b,c) -#define IDirectPlay3_GetPlayerData(p,a,b,c,d) (p)->lpVtbl->GetPlayerData(p,a,b,c,d) -#define IDirectPlay3_GetPlayerName(p,a,b,c) (p)->lpVtbl->GetPlayerName(p,a,b,c) -#define IDirectPlay3_GetSessionDesc(p,a,b) (p)->lpVtbl->GetSessionDesc(p,a,b) -#define IDirectPlay3_Initialize(p,a) (p)->lpVtbl->Initialize(p,a) -#define IDirectPlay3_Open(p,a,b) (p)->lpVtbl->Open(p,a,b) -#define IDirectPlay3_Receive(p,a,b,c,d,e) (p)->lpVtbl->Receive(p,a,b,c,d,e) -#define IDirectPlay3_Send(p,a,b,c,d,e) (p)->lpVtbl->Send(p,a,b,c,d,e) -#define IDirectPlay3_SetGroupData(p,a,b,c,d) (p)->lpVtbl->SetGroupData(p,a,b,c,d) -#define IDirectPlay3_SetGroupName(p,a,b,c) (p)->lpVtbl->SetGroupName(p,a,b,c) -#define IDirectPlay3_SetPlayerData(p,a,b,c,d) (p)->lpVtbl->SetPlayerData(p,a,b,c,d) -#define IDirectPlay3_SetPlayerName(p,a,b,c) (p)->lpVtbl->SetPlayerName(p,a,b,c) -#define IDirectPlay3_SetSessionDesc(p,a,b) (p)->lpVtbl->SetSessionDesc(p,a,b) -#define IDirectPlay3_AddGroupToGroup(p,a,b) (p)->lpVtbl->AddGroupToGroup(p,a,b) -#define IDirectPlay3_CreateGroupInGroup(p,a,b,c,d,e,f) (p)->lpVtbl->CreateGroupInGroup(p,a,b,c,d,e,f) -#define IDirectPlay3_DeleteGroupFromGroup(p,a,b) (p)->lpVtbl->DeleteGroupFromGroup(p,a,b) -#define IDirectPlay3_EnumConnections(p,a,b,c,d) (p)->lpVtbl->EnumConnections(p,a,b,c,d) -#define IDirectPlay3_EnumGroupsInGroup(p,a,b,c,d,e) (p)->lpVtbl->EnumGroupsInGroup(p,a,b,c,d,e) -#define IDirectPlay3_GetGroupConnectionSettings(p,a,b,c,d) (p)->lpVtbl->GetGroupConnectionSettings(p,a,b,c,d) -#define IDirectPlay3_InitializeConnection(p,a,b) (p)->lpVtbl->InitializeConnection(p,a,b) -#define IDirectPlay3_SecureOpen(p,a,b,c,d) (p)->lpVtbl->SecureOpen(p,a,b,c,d) -#define IDirectPlay3_SendChatMessage(p,a,b,c,d) (p)->lpVtbl->SendChatMessage(p,a,b,c,d) -#define IDirectPlay3_SetGroupConnectionSettings(p,a,b,c) (p)->lpVtbl->SetGroupConnectionSettings(p,a,b,c) -#define IDirectPlay3_StartSession(p,a,b) (p)->lpVtbl->StartSession(p,a,b) -#define IDirectPlay3_GetGroupFlags(p,a,b) (p)->lpVtbl->GetGroupFlags(p,a,b) -#define IDirectPlay3_GetGroupParent(p,a,b) (p)->lpVtbl->GetGroupParent(p,a,b) -#define IDirectPlay3_GetPlayerAccount(p,a,b,c,d) (p)->lpVtbl->GetPlayerAccount(p,a,b,c,d) -#define IDirectPlay3_GetPlayerFlags(p,a,b) (p)->lpVtbl->GetPlayerFlags(p,a,b) - -#else /* C++ */ - -#define IDirectPlay3_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirectPlay3_AddRef(p) (p)->AddRef() -#define IDirectPlay3_Release(p) (p)->Release() -#define IDirectPlay3_AddPlayerToGroup(p,a,b) (p)->AddPlayerToGroup(a,b) -#define IDirectPlay3_Close(p) (p)->Close() -#define IDirectPlay3_CreateGroup(p,a,b,c,d,e) (p)->CreateGroup(a,b,c,d,e) -#define IDirectPlay3_CreatePlayer(p,a,b,c,d,e,f) (p)->CreatePlayer(a,b,c,d,e,f) -#define IDirectPlay3_DeletePlayerFromGroup(p,a,b) (p)->DeletePlayerFromGroup(a,b) -#define IDirectPlay3_DestroyGroup(p,a) (p)->DestroyGroup(a) -#define IDirectPlay3_DestroyPlayer(p,a) (p)->DestroyPlayer(a) -#define IDirectPlay3_EnumGroupPlayers(p,a,b,c,d,e) (p)->EnumGroupPlayers(a,b,c,d,e) -#define IDirectPlay3_EnumGroups(p,a,b,c,d) (p)->EnumGroups(a,b,c,d) -#define IDirectPlay3_EnumPlayers(p,a,b,c,d) (p)->EnumPlayers(a,b,c,d) -#define IDirectPlay3_EnumSessions(p,a,b,c,d,e) (p)->EnumSessions(a,b,c,d,e) -#define IDirectPlay3_GetCaps(p,a,b) (p)->GetCaps(a,b) -#define IDirectPlay3_GetMessageCount(p,a,b) (p)->GetMessageCount(a,b) -#define IDirectPlay3_GetGroupData(p,a,b,c,d) (p)->GetGroupData(a,b,c,d) -#define IDirectPlay3_GetGroupName(p,a,b,c) (p)->GetGroupName(a,b,c) -#define IDirectPlay3_GetPlayerAddress(p,a,b,c) (p)->GetPlayerAddress(a,b,c) -#define IDirectPlay3_GetPlayerCaps(p,a,b,c) (p)->GetPlayerCaps(a,b,c) -#define IDirectPlay3_GetPlayerData(p,a,b,c,d) (p)->GetPlayerData(a,b,c,d) -#define IDirectPlay3_GetPlayerName(p,a,b,c) (p)->GetPlayerName(a,b,c) -#define IDirectPlay3_GetSessionDesc(p,a,b) (p)->GetSessionDesc(a,b) -#define IDirectPlay3_Initialize(p,a) (p)->Initialize(a) -#define IDirectPlay3_Open(p,a,b) (p)->Open(a,b) -#define IDirectPlay3_Receive(p,a,b,c,d,e) (p)->Receive(a,b,c,d,e) -#define IDirectPlay3_Send(p,a,b,c,d,e) (p)->Send(a,b,c,d,e) -#define IDirectPlay3_SetGroupData(p,a,b,c,d) (p)->SetGroupData(a,b,c,d) -#define IDirectPlay3_SetGroupName(p,a,b,c) (p)->SetGroupName(a,b,c) -#define IDirectPlay3_SetPlayerData(p,a,b,c,d) (p)->SetPlayerData(a,b,c,d) -#define IDirectPlay3_SetPlayerName(p,a,b,c) (p)->SetPlayerName(a,b,c) -#define IDirectPlay3_SetSessionDesc(p,a,b) (p)->SetSessionDesc(a,b) -#define IDirectPlay3_AddGroupToGroup(p,a,b) (p)->AddGroupToGroup(a,b) -#define IDirectPlay3_CreateGroupInGroup(p,a,b,c,d,e,f) (p)->CreateGroupInGroup(a,b,c,d,e,f) -#define IDirectPlay3_DeleteGroupFromGroup(p,a,b) (p)->DeleteGroupFromGroup(a,b) -#define IDirectPlay3_EnumConnections(p,a,b,c,d) (p)->EnumConnections(a,b,c,d) -#define IDirectPlay3_EnumGroupsInGroup(p,a,b,c,d,e) (p)->EnumGroupsInGroup(a,b,c,d,e) -#define IDirectPlay3_GetGroupConnectionSettings(p,a,b,c,d) (p)->GetGroupConnectionSettings(a,b,c,d) -#define IDirectPlay3_InitializeConnection(p,a,b) (p)->InitializeConnection(a,b) -#define IDirectPlay3_SecureOpen(p,a,b,c,d) (p)->SecureOpen(a,b,c,d) -#define IDirectPlay3_SendChatMessage(p,a,b,c,d) (p)->SendChatMessage(a,b,c,d) -#define IDirectPlay3_SetGroupConnectionSettings(p,a,b,c) (p)->SetGroupConnectionSettings(a,b,c) -#define IDirectPlay3_StartSession(p,a,b) (p)->StartSession(a,b) -#define IDirectPlay3_GetGroupFlags(p,a,b) (p)->GetGroupFlags(a,b) -#define IDirectPlay3_GetGroupParent(p,a,b) (p)->GetGroupParent(a,b) -#define IDirectPlay3_GetPlayerAccount(p,a,b,c,d) (p)->GetPlayerAccount(a,b,c,d) -#define IDirectPlay3_GetPlayerFlags(p,a,b) (p)->GetPlayerFlags(a,b) - -#endif - -/**************************************************************************** - * - * IDirectPlay4 (and IDirectPlay4A) Interface - * - ****************************************************************************/ - -#undef INTERFACE -#define INTERFACE IDirectPlay4 -DECLARE_INTERFACE_( IDirectPlay4, IDirectPlay3 ) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IDirectPlay2 methods ***/ - STDMETHOD(AddPlayerToGroup) (THIS_ DPID, DPID) PURE; - STDMETHOD(Close) (THIS) PURE; - STDMETHOD(CreateGroup) (THIS_ LPDPID,LPDPNAME,LPVOID,DWORD,DWORD) PURE; - STDMETHOD(CreatePlayer) (THIS_ LPDPID,LPDPNAME,HANDLE,LPVOID,DWORD,DWORD) PURE; - STDMETHOD(DeletePlayerFromGroup)(THIS_ DPID,DPID) PURE; - STDMETHOD(DestroyGroup) (THIS_ DPID) PURE; - STDMETHOD(DestroyPlayer) (THIS_ DPID) PURE; - STDMETHOD(EnumGroupPlayers) (THIS_ DPID,LPGUID,LPDPENUMPLAYERSCALLBACK2,LPVOID,DWORD) PURE; - STDMETHOD(EnumGroups) (THIS_ LPGUID,LPDPENUMPLAYERSCALLBACK2,LPVOID,DWORD) PURE; - STDMETHOD(EnumPlayers) (THIS_ LPGUID,LPDPENUMPLAYERSCALLBACK2,LPVOID,DWORD) PURE; - STDMETHOD(EnumSessions) (THIS_ LPDPSESSIONDESC2,DWORD,LPDPENUMSESSIONSCALLBACK2,LPVOID,DWORD) PURE; - STDMETHOD(GetCaps) (THIS_ LPDPCAPS,DWORD) PURE; - STDMETHOD(GetGroupData) (THIS_ DPID,LPVOID,LPDWORD,DWORD) PURE; - STDMETHOD(GetGroupName) (THIS_ DPID,LPVOID,LPDWORD) PURE; - STDMETHOD(GetMessageCount) (THIS_ DPID, LPDWORD) PURE; - STDMETHOD(GetPlayerAddress) (THIS_ DPID,LPVOID,LPDWORD) PURE; - STDMETHOD(GetPlayerCaps) (THIS_ DPID,LPDPCAPS,DWORD) PURE; - STDMETHOD(GetPlayerData) (THIS_ DPID,LPVOID,LPDWORD,DWORD) PURE; - STDMETHOD(GetPlayerName) (THIS_ DPID,LPVOID,LPDWORD) PURE; - STDMETHOD(GetSessionDesc) (THIS_ LPVOID,LPDWORD) PURE; - STDMETHOD(Initialize) (THIS_ LPGUID) PURE; - STDMETHOD(Open) (THIS_ LPDPSESSIONDESC2,DWORD) PURE; - STDMETHOD(Receive) (THIS_ LPDPID,LPDPID,DWORD,LPVOID,LPDWORD) PURE; - STDMETHOD(Send) (THIS_ DPID, DPID, DWORD, LPVOID, DWORD) PURE; - STDMETHOD(SetGroupData) (THIS_ DPID,LPVOID,DWORD,DWORD) PURE; - STDMETHOD(SetGroupName) (THIS_ DPID,LPDPNAME,DWORD) PURE; - STDMETHOD(SetPlayerData) (THIS_ DPID,LPVOID,DWORD,DWORD) PURE; - STDMETHOD(SetPlayerName) (THIS_ DPID,LPDPNAME,DWORD) PURE; - STDMETHOD(SetSessionDesc) (THIS_ LPDPSESSIONDESC2,DWORD) PURE; - /*** IDirectPlay3 methods ***/ - STDMETHOD(AddGroupToGroup) (THIS_ DPID, DPID) PURE; - STDMETHOD(CreateGroupInGroup) (THIS_ DPID,LPDPID,LPDPNAME,LPVOID,DWORD,DWORD) PURE; - STDMETHOD(DeleteGroupFromGroup) (THIS_ DPID,DPID) PURE; - STDMETHOD(EnumConnections) (THIS_ LPCGUID,LPDPENUMCONNECTIONSCALLBACK,LPVOID,DWORD) PURE; - STDMETHOD(EnumGroupsInGroup) (THIS_ DPID,LPGUID,LPDPENUMPLAYERSCALLBACK2,LPVOID,DWORD) PURE; - STDMETHOD(GetGroupConnectionSettings)(THIS_ DWORD, DPID, LPVOID, LPDWORD) PURE; - STDMETHOD(InitializeConnection) (THIS_ LPVOID,DWORD) PURE; - STDMETHOD(SecureOpen) (THIS_ LPCDPSESSIONDESC2,DWORD,LPCDPSECURITYDESC,LPCDPCREDENTIALS) PURE; - STDMETHOD(SendChatMessage) (THIS_ DPID,DPID,DWORD,LPDPCHAT) PURE; - STDMETHOD(SetGroupConnectionSettings)(THIS_ DWORD,DPID,LPDPLCONNECTION) PURE; - STDMETHOD(StartSession) (THIS_ DWORD,DPID) PURE; - STDMETHOD(GetGroupFlags) (THIS_ DPID,LPDWORD) PURE; - STDMETHOD(GetGroupParent) (THIS_ DPID,LPDPID) PURE; - STDMETHOD(GetPlayerAccount) (THIS_ DPID, DWORD, LPVOID, LPDWORD) PURE; - STDMETHOD(GetPlayerFlags) (THIS_ DPID,LPDWORD) PURE; - /*** IDirectPlay4 methods ***/ - STDMETHOD(GetGroupOwner) (THIS_ DPID, LPDPID) PURE; - STDMETHOD(SetGroupOwner) (THIS_ DPID, DPID) PURE; - STDMETHOD(SendEx) (THIS_ DPID, DPID, DWORD, LPVOID, DWORD, DWORD, DWORD, LPVOID, DWORD_PTR *) PURE; - STDMETHOD(GetMessageQueue) (THIS_ DPID, DPID, DWORD, LPDWORD, LPDWORD) PURE; - STDMETHOD(CancelMessage) (THIS_ DWORD, DWORD) PURE; - STDMETHOD(CancelPriority) (THIS_ DWORD, DWORD, DWORD) PURE; -}; - -/**************************************************************************** - * - * IDirectPlayX interface macros (for IDirectPlay4 and beyond) - * - ****************************************************************************/ - -#if !defined(__cplusplus) || defined(CINTERFACE) - -#define IDirectPlayX_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectPlayX_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectPlayX_Release(p) (p)->lpVtbl->Release(p) -#define IDirectPlayX_AddPlayerToGroup(p,a,b) (p)->lpVtbl->AddPlayerToGroup(p,a,b) -#define IDirectPlayX_CancelMessage(p,a,b) (p)->lpVtbl->CancelMessage(p,a,b) -#define IDirectPlayX_CancelPriority(p,a,b,c) (p)->lpVtbl->CancelPriority(p,a,b,c) -#define IDirectPlayX_Close(p) (p)->lpVtbl->Close(p) -#define IDirectPlayX_CreateGroup(p,a,b,c,d,e) (p)->lpVtbl->CreateGroup(p,a,b,c,d,e) -#define IDirectPlayX_CreatePlayer(p,a,b,c,d,e,f) (p)->lpVtbl->CreatePlayer(p,a,b,c,d,e,f) -#define IDirectPlayX_DeletePlayerFromGroup(p,a,b) (p)->lpVtbl->DeletePlayerFromGroup(p,a,b) -#define IDirectPlayX_DestroyGroup(p,a) (p)->lpVtbl->DestroyGroup(p,a) -#define IDirectPlayX_DestroyPlayer(p,a) (p)->lpVtbl->DestroyPlayer(p,a) -#define IDirectPlayX_EnumGroupPlayers(p,a,b,c,d,e) (p)->lpVtbl->EnumGroupPlayers(p,a,b,c,d,e) -#define IDirectPlayX_EnumGroups(p,a,b,c,d) (p)->lpVtbl->EnumGroups(p,a,b,c,d) -#define IDirectPlayX_EnumPlayers(p,a,b,c,d) (p)->lpVtbl->EnumPlayers(p,a,b,c,d) -#define IDirectPlayX_EnumSessions(p,a,b,c,d,e) (p)->lpVtbl->EnumSessions(p,a,b,c,d,e) -#define IDirectPlayX_GetCaps(p,a,b) (p)->lpVtbl->GetCaps(p,a,b) -#define IDirectPlayX_GetMessageCount(p,a,b) (p)->lpVtbl->GetMessageCount(p,a,b) -#define IDirectPlayX_GetMessageQueue(p,a,b,c,d,e) (p)->lpVtbl->GetMessageQueue(p,a,b,c,d,e) -#define IDirectPlayX_GetGroupData(p,a,b,c,d) (p)->lpVtbl->GetGroupData(p,a,b,c,d) -#define IDirectPlayX_GetGroupName(p,a,b,c) (p)->lpVtbl->GetGroupName(p,a,b,c) -#define IDirectPlayX_GetPlayerAddress(p,a,b,c) (p)->lpVtbl->GetPlayerAddress(p,a,b,c) -#define IDirectPlayX_GetPlayerCaps(p,a,b,c) (p)->lpVtbl->GetPlayerCaps(p,a,b,c) -#define IDirectPlayX_GetPlayerData(p,a,b,c,d) (p)->lpVtbl->GetPlayerData(p,a,b,c,d) -#define IDirectPlayX_GetPlayerName(p,a,b,c) (p)->lpVtbl->GetPlayerName(p,a,b,c) -#define IDirectPlayX_GetSessionDesc(p,a,b) (p)->lpVtbl->GetSessionDesc(p,a,b) -#define IDirectPlayX_Initialize(p,a) (p)->lpVtbl->Initialize(p,a) -#define IDirectPlayX_Open(p,a,b) (p)->lpVtbl->Open(p,a,b) -#define IDirectPlayX_Receive(p,a,b,c,d,e) (p)->lpVtbl->Receive(p,a,b,c,d,e) -#define IDirectPlayX_Send(p,a,b,c,d,e) (p)->lpVtbl->Send(p,a,b,c,d,e) -#define IDirectPlayX_SendEx(p,a,b,c,d,e,f,g,h,i) (p)->lpVtbl->SendEx(p,a,b,c,d,e,f,g,h,i) -#define IDirectPlayX_SetGroupData(p,a,b,c,d) (p)->lpVtbl->SetGroupData(p,a,b,c,d) -#define IDirectPlayX_SetGroupName(p,a,b,c) (p)->lpVtbl->SetGroupName(p,a,b,c) -#define IDirectPlayX_SetPlayerData(p,a,b,c,d) (p)->lpVtbl->SetPlayerData(p,a,b,c,d) -#define IDirectPlayX_SetPlayerName(p,a,b,c) (p)->lpVtbl->SetPlayerName(p,a,b,c) -#define IDirectPlayX_SetSessionDesc(p,a,b) (p)->lpVtbl->SetSessionDesc(p,a,b) -#define IDirectPlayX_AddGroupToGroup(p,a,b) (p)->lpVtbl->AddGroupToGroup(p,a,b) -#define IDirectPlayX_CreateGroupInGroup(p,a,b,c,d,e,f) (p)->lpVtbl->CreateGroupInGroup(p,a,b,c,d,e,f) -#define IDirectPlayX_DeleteGroupFromGroup(p,a,b) (p)->lpVtbl->DeleteGroupFromGroup(p,a,b) -#define IDirectPlayX_EnumConnections(p,a,b,c,d) (p)->lpVtbl->EnumConnections(p,a,b,c,d) -#define IDirectPlayX_EnumGroupsInGroup(p,a,b,c,d,e) (p)->lpVtbl->EnumGroupsInGroup(p,a,b,c,d,e) -#define IDirectPlayX_GetGroupConnectionSettings(p,a,b,c,d) (p)->lpVtbl->GetGroupConnectionSettings(p,a,b,c,d) -#define IDirectPlayX_InitializeConnection(p,a,b) (p)->lpVtbl->InitializeConnection(p,a,b) -#define IDirectPlayX_SecureOpen(p,a,b,c,d) (p)->lpVtbl->SecureOpen(p,a,b,c,d) -#define IDirectPlayX_SendChatMessage(p,a,b,c,d) (p)->lpVtbl->SendChatMessage(p,a,b,c,d) -#define IDirectPlayX_SetGroupConnectionSettings(p,a,b,c) (p)->lpVtbl->SetGroupConnectionSettings(p,a,b,c) -#define IDirectPlayX_StartSession(p,a,b) (p)->lpVtbl->StartSession(p,a,b) -#define IDirectPlayX_GetGroupFlags(p,a,b) (p)->lpVtbl->GetGroupFlags(p,a,b) -#define IDirectPlayX_GetGroupParent(p,a,b) (p)->lpVtbl->GetGroupParent(p,a,b) -#define IDirectPlayX_GetPlayerAccount(p,a,b,c,d) (p)->lpVtbl->GetPlayerAccount(p,a,b,c,d) -#define IDirectPlayX_GetPlayerFlags(p,a,b) (p)->lpVtbl->GetPlayerFlags(p,a,b) -#define IDirectPlayX_GetGroupOwner(p,a,b) (p)->lpVtbl->GetGroupOwner(p,a,b) -#define IDirectPlayX_SetGroupOwner(p,a,b) (p)->lpVtbl->SetGroupOwner(p,a,b) - -#else /* C++ */ - -#define IDirectPlayX_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirectPlayX_AddRef(p) (p)->AddRef() -#define IDirectPlayX_Release(p) (p)->Release() -#define IDirectPlayX_AddPlayerToGroup(p,a,b) (p)->AddPlayerToGroup(a,b) -#define IDirectPlayX_CancelMessage(p,a,b) (p)->CancelMessage(a,b) -#define IDirectPlayX_CancelPriority(p,a,b,c) (p)->CancelPriority(a,b,c) -#define IDirectPlayX_Close(p) (p)->Close() -#define IDirectPlayX_CreateGroup(p,a,b,c,d,e) (p)->CreateGroup(a,b,c,d,e) -#define IDirectPlayX_CreatePlayer(p,a,b,c,d,e,f) (p)->CreatePlayer(a,b,c,d,e,f) -#define IDirectPlayX_DeletePlayerFromGroup(p,a,b) (p)->DeletePlayerFromGroup(a,b) -#define IDirectPlayX_DestroyGroup(p,a) (p)->DestroyGroup(a) -#define IDirectPlayX_DestroyPlayer(p,a) (p)->DestroyPlayer(a) -#define IDirectPlayX_EnumGroupPlayers(p,a,b,c,d,e) (p)->EnumGroupPlayers(a,b,c,d,e) -#define IDirectPlayX_EnumGroups(p,a,b,c,d) (p)->EnumGroups(a,b,c,d) -#define IDirectPlayX_EnumPlayers(p,a,b,c,d) (p)->EnumPlayers(a,b,c,d) -#define IDirectPlayX_EnumSessions(p,a,b,c,d,e) (p)->EnumSessions(a,b,c,d,e) -#define IDirectPlayX_GetCaps(p,a,b) (p)->GetCaps(a,b) -#define IDirectPlayX_GetMessageCount(p,a,b) (p)->GetMessageCount(a,b) -#define IDirectPlayX_GetMessageQueue(p,a,b,c,d,e) (p)->GetMessageQueue(a,b,c,d,e) -#define IDirectPlayX_GetGroupData(p,a,b,c,d) (p)->GetGroupData(a,b,c,d) -#define IDirectPlayX_GetGroupName(p,a,b,c) (p)->GetGroupName(a,b,c) -#define IDirectPlayX_GetPlayerAddress(p,a,b,c) (p)->GetPlayerAddress(a,b,c) -#define IDirectPlayX_GetPlayerCaps(p,a,b,c) (p)->GetPlayerCaps(a,b,c) -#define IDirectPlayX_GetPlayerData(p,a,b,c,d) (p)->GetPlayerData(a,b,c,d) -#define IDirectPlayX_GetPlayerName(p,a,b,c) (p)->GetPlayerName(a,b,c) -#define IDirectPlayX_GetSessionDesc(p,a,b) (p)->GetSessionDesc(a,b) -#define IDirectPlayX_Initialize(p,a) (p)->Initialize(a) -#define IDirectPlayX_Open(p,a,b) (p)->Open(a,b) -#define IDirectPlayX_Receive(p,a,b,c,d,e) (p)->Receive(a,b,c,d,e) -#define IDirectPlayX_Send(p,a,b,c,d,e) (p)->Send(a,b,c,d,e) -#define IDirectPlayX_SendEx(p,a,b,c,d,e,f,g,h,i) (p)->SendEx(a,b,c,d,e,f,g,h,i) -#define IDirectPlayX_SetGroupData(p,a,b,c,d) (p)->SetGroupData(a,b,c,d) -#define IDirectPlayX_SetGroupName(p,a,b,c) (p)->SetGroupName(a,b,c) -#define IDirectPlayX_SetPlayerData(p,a,b,c,d) (p)->SetPlayerData(a,b,c,d) -#define IDirectPlayX_SetPlayerName(p,a,b,c) (p)->SetPlayerName(a,b,c) -#define IDirectPlayX_SetSessionDesc(p,a,b) (p)->SetSessionDesc(a,b) -#define IDirectPlayX_AddGroupToGroup(p,a,b) (p)->AddGroupToGroup(a,b) -#define IDirectPlayX_CreateGroupInGroup(p,a,b,c,d,e,f) (p)->CreateGroupInGroup(a,b,c,d,e,f) -#define IDirectPlayX_DeleteGroupFromGroup(p,a,b) (p)->DeleteGroupFromGroup(a,b) -#define IDirectPlayX_EnumConnections(p,a,b,c,d) (p)->EnumConnections(a,b,c,d) -#define IDirectPlayX_EnumGroupsInGroup(p,a,b,c,d,e) (p)->EnumGroupsInGroup(a,b,c,d,e) -#define IDirectPlayX_GetGroupConnectionSettings(p,a,b,c,d) (p)->GetGroupConnectionSettings(a,b,c,d) -#define IDirectPlayX_InitializeConnection(p,a,b) (p)->InitializeConnection(a,b) -#define IDirectPlayX_SecureOpen(p,a,b,c,d) (p)->SecureOpen(a,b,c,d) -#define IDirectPlayX_SendChatMessage(p,a,b,c,d) (p)->SendChatMessage(a,b,c,d) -#define IDirectPlayX_SetGroupConnectionSettings(p,a,b,c) (p)->SetGroupConnectionSettings(a,b,c) -#define IDirectPlayX_StartSession(p,a,b) (p)->StartSession(a,b) -#define IDirectPlayX_GetGroupFlags(p,a,b) (p)->GetGroupFlags(a,b) -#define IDirectPlayX_GetGroupParent(p,a,b) (p)->GetGroupParent(a,b) -#define IDirectPlayX_GetPlayerAccount(p,a,b,c,d) (p)->GetPlayerAccount(a,b,c,d) -#define IDirectPlayX_GetPlayerFlags(p,a,b) (p)->GetPlayerFlags(a,b) -#define IDirectPlayX_GetGroupOwner(p,a,b) (p)->GetGroupOwner(a,b) -#define IDirectPlayX_SetGroupOwner(p,a,b) (p)->SetGroupOwner(a,b) - -#endif - -/**************************************************************************** - * - * EnumConnections API flags - * - ****************************************************************************/ - -/* - * Enumerate Service Providers - */ -#define DPCONNECTION_DIRECTPLAY 0x00000001 - -/* - * Enumerate Lobby Providers - */ -#define DPCONNECTION_DIRECTPLAYLOBBY 0x00000002 - - -/**************************************************************************** - * - * EnumPlayers API flags - * - ****************************************************************************/ - -/* - * Enumerate all players in the current session - */ -#define DPENUMPLAYERS_ALL 0x00000000 -#define DPENUMGROUPS_ALL DPENUMPLAYERS_ALL - - -/* - * Enumerate only local (created by this application) players - * or groups - */ -#define DPENUMPLAYERS_LOCAL 0x00000008 -#define DPENUMGROUPS_LOCAL DPENUMPLAYERS_LOCAL - -/* - * Enumerate only remote (non-local) players - * or groups - */ -#define DPENUMPLAYERS_REMOTE 0x00000010 -#define DPENUMGROUPS_REMOTE DPENUMPLAYERS_REMOTE - -/* - * Enumerate groups along with the players - */ -#define DPENUMPLAYERS_GROUP 0x00000020 - -/* - * Enumerate players or groups in another session - * (must supply lpguidInstance) - */ -#define DPENUMPLAYERS_SESSION 0x00000080 -#define DPENUMGROUPS_SESSION DPENUMPLAYERS_SESSION - -/* - * Enumerate server players - */ -#define DPENUMPLAYERS_SERVERPLAYER 0x00000100 - -/* - * Enumerate spectator players - */ -#define DPENUMPLAYERS_SPECTATOR 0x00000200 - -/* - * Enumerate shortcut groups - */ -#define DPENUMGROUPS_SHORTCUT 0x00000400 - -/* - * Enumerate staging area groups - */ -#define DPENUMGROUPS_STAGINGAREA 0x00000800 - -/* - * Enumerate hidden groups - */ -#define DPENUMGROUPS_HIDDEN 0x00001000 - -/* - * Enumerate the group's owner - */ -#define DPENUMPLAYERS_OWNER 0x00002000 - - -/**************************************************************************** - * - * CreatePlayer API flags - * - ****************************************************************************/ - -/* - * This flag indicates that this player should be designated - * the server player. The app should specify this at CreatePlayer. - */ -#define DPPLAYER_SERVERPLAYER DPENUMPLAYERS_SERVERPLAYER - -/* - * This flag indicates that this player should be designated - * a spectator. The app should specify this at CreatePlayer. - */ -#define DPPLAYER_SPECTATOR DPENUMPLAYERS_SPECTATOR - -/* - * This flag indicates that this player was created locally. - * (returned from GetPlayerFlags) - */ -#define DPPLAYER_LOCAL DPENUMPLAYERS_LOCAL - -/* - * This flag indicates that this player is the group's owner - * (Only returned in EnumGroupPlayers) - */ -#define DPPLAYER_OWNER DPENUMPLAYERS_OWNER - -/**************************************************************************** - * - * CreateGroup API flags - * - ****************************************************************************/ - - -/* - * This flag indicates that the StartSession can be called on the group. - * The app should specify this at CreateGroup, or CreateGroupInGroup. - */ -#define DPGROUP_STAGINGAREA DPENUMGROUPS_STAGINGAREA - -/* - * This flag indicates that this group was created locally. - * (returned from GetGroupFlags) - */ -#define DPGROUP_LOCAL DPENUMGROUPS_LOCAL - -/* - * This flag indicates that this group was created hidden. - */ -#define DPGROUP_HIDDEN DPENUMGROUPS_HIDDEN - - -/**************************************************************************** - * - * EnumSessions API flags - * - ****************************************************************************/ - -/* - * Enumerate sessions which can be joined - */ -#define DPENUMSESSIONS_AVAILABLE 0x00000001 - -/* - * Enumerate all sessions even if they can't be joined. - */ -#define DPENUMSESSIONS_ALL 0x00000002 - - -/* - * Start an asynchronous enum sessions - */ - #define DPENUMSESSIONS_ASYNC 0x00000010 - -/* - * Stop an asynchronous enum sessions - */ - #define DPENUMSESSIONS_STOPASYNC 0x00000020 - -/* - * Enumerate sessions even if they require a password - */ - #define DPENUMSESSIONS_PASSWORDREQUIRED 0x00000040 - -/* - * Return status about progress of enumeration instead of - * showing any status dialogs. - */ - #define DPENUMSESSIONS_RETURNSTATUS 0x00000080 - -/**************************************************************************** - * - * GetCaps and GetPlayerCaps API flags - * - ****************************************************************************/ - -/* - * The latency returned should be for guaranteed message sending. - * Default is non-guaranteed messaging. - */ -#define DPGETCAPS_GUARANTEED 0x00000001 - - -/**************************************************************************** - * - * GetGroupData, GetPlayerData API flags - * Remote and local Group/Player data is maintained separately. - * Default is DPGET_REMOTE. - * - ****************************************************************************/ - -/* - * Get the remote data (set by any DirectPlay object in - * the session using DPSET_REMOTE) - */ -#define DPGET_REMOTE 0x00000000 - -/* - * Get the local data (set by this DirectPlay object - * using DPSET_LOCAL) - */ -#define DPGET_LOCAL 0x00000001 - - -/**************************************************************************** - * - * Open API flags - * - ****************************************************************************/ - -/* - * Join the session that is described by the DPSESSIONDESC2 structure - */ -#define DPOPEN_JOIN 0x00000001 - -/* - * Create a new session as described by the DPSESSIONDESC2 structure - */ -#define DPOPEN_CREATE 0x00000002 - -/* - * Return status about progress of open instead of showing - * any status dialogs. - */ - #define DPOPEN_RETURNSTATUS DPENUMSESSIONS_RETURNSTATUS - - -/**************************************************************************** - * - * DPLCONNECTION flags - * - ****************************************************************************/ - -/* - * This application should create a new session as - * described by the DPSESIONDESC structure - */ -#define DPLCONNECTION_CREATESESSION DPOPEN_CREATE - -/* - * This application should join the session described by - * the DPSESIONDESC structure with the lpAddress data - */ -#define DPLCONNECTION_JOINSESSION DPOPEN_JOIN - -/**************************************************************************** - * - * Receive API flags - * Default is DPRECEIVE_ALL - * - ****************************************************************************/ - -/* - * Get the first message in the queue - */ -#define DPRECEIVE_ALL 0x00000001 - -/* - * Get the first message in the queue directed to a specific player - */ -#define DPRECEIVE_TOPLAYER 0x00000002 - -/* - * Get the first message in the queue from a specific player - */ -#define DPRECEIVE_FROMPLAYER 0x00000004 - -/* - * Get the message but don't remove it from the queue - */ -#define DPRECEIVE_PEEK 0x00000008 - - -/**************************************************************************** - * - * Send API flags - * - ****************************************************************************/ - -/* - * Send the message using a guaranteed send method. - * Default is non-guaranteed. - */ -#define DPSEND_GUARANTEED 0x00000001 - - -/* - * This flag is obsolete. It is ignored by DirectPlay - */ -#define DPSEND_HIGHPRIORITY 0x00000002 - -/* - * This flag is obsolete. It is ignored by DirectPlay - */ -#define DPSEND_OPENSTREAM 0x00000008 - -/* - * This flag is obsolete. It is ignored by DirectPlay - */ -#define DPSEND_CLOSESTREAM 0x00000010 - -/* - * Send the message digitally signed to ensure authenticity. - */ -#define DPSEND_SIGNED 0x00000020 - -/* - * Send the message with encryption to ensure privacy. - */ -#define DPSEND_ENCRYPTED 0x00000040 - -/* - * The message is a lobby system message - */ -#define DPSEND_LOBBYSYSTEMMESSAGE 0x00000080 - - -/* - * Send message asynchronously, must check caps - * before using this flag. It is always provided - * if the protocol flag is set. - */ -#define DPSEND_ASYNC 0x00000200 - -/* - * When an message is completed, don't tell me. - * by default the application is notified with a system message. - */ -#define DPSEND_NOSENDCOMPLETEMSG 0x00000400 - - -/* - * Maximum priority for sends available to applications - */ -#define DPSEND_MAX_PRI 0x0000FFFF -#define DPSEND_MAX_PRIORITY DPSEND_MAX_PRI - - -/**************************************************************************** - * - * SetGroupData, SetGroupName, SetPlayerData, SetPlayerName, - * SetSessionDesc API flags. - * Default is DPSET_REMOTE. - * - ****************************************************************************/ - -/* - * Propagate the data to all players in the session - */ -#define DPSET_REMOTE 0x00000000 - -/* - * Do not propagate the data to other players - */ -#define DPSET_LOCAL 0x00000001 - -/* - * Used with DPSET_REMOTE, use guaranteed message send to - * propagate the data - */ -#define DPSET_GUARANTEED 0x00000002 - -/**************************************************************************** - * - * GetMessageQueue API flags. - * Default is DPMESSAGEQUEUE_SEND - * - ****************************************************************************/ - -/* - * Get Send Queue - requires Service Provider Support - */ -#define DPMESSAGEQUEUE_SEND 0x00000001 - -/* - * Get Receive Queue - */ -#define DPMESSAGEQUEUE_RECEIVE 0x00000002 - - -/**************************************************************************** - * - * Connect API flags - * - ****************************************************************************/ - - -/* - * Start an asynchronous connect which returns status codes - */ -#define DPCONNECT_RETURNSTATUS (DPENUMSESSIONS_RETURNSTATUS) - - -/**************************************************************************** - * - * DirectPlay system messages and message data structures - * - * All system message come 'From' player DPID_SYSMSG. To determine what type - * of message it is, cast the lpData from Receive to DPMSG_GENERIC and check - * the dwType member against one of the following DPSYS_xxx constants. Once - * a match is found, cast the lpData to the corresponding of the DPMSG_xxx - * structures to access the data of the message. - * - ****************************************************************************/ - -/* - * A new player or group has been created in the session - * Use DPMSG_CREATEPLAYERORGROUP. Check dwPlayerType to see if it - * is a player or a group. - */ -#define DPSYS_CREATEPLAYERORGROUP 0x0003 - -/* - * A player has been deleted from the session - * Use DPMSG_DESTROYPLAYERORGROUP - */ -#define DPSYS_DESTROYPLAYERORGROUP 0x0005 - -/* - * A player has been added to a group - * Use DPMSG_ADDPLAYERTOGROUP - */ -#define DPSYS_ADDPLAYERTOGROUP 0x0007 - -/* - * A player has been removed from a group - * Use DPMSG_DELETEPLAYERFROMGROUP - */ -#define DPSYS_DELETEPLAYERFROMGROUP 0x0021 - -/* - * This DirectPlay object lost its connection with all the - * other players in the session. - * Use DPMSG_SESSIONLOST. - */ -#define DPSYS_SESSIONLOST 0x0031 - -/* - * The current host has left the session. - * This DirectPlay object is now the host. - * Use DPMSG_HOST. - */ -#define DPSYS_HOST 0x0101 - -/* - * The remote data associated with a player or - * group has changed. Check dwPlayerType to see - * if it is a player or a group - * Use DPMSG_SETPLAYERORGROUPDATA - */ -#define DPSYS_SETPLAYERORGROUPDATA 0x0102 - -/* - * The name of a player or group has changed. - * Check dwPlayerType to see if it is a player - * or a group. - * Use DPMSG_SETPLAYERORGROUPNAME - */ -#define DPSYS_SETPLAYERORGROUPNAME 0x0103 - -/* - * The session description has changed. - * Use DPMSG_SETSESSIONDESC - */ -#define DPSYS_SETSESSIONDESC 0x0104 - -/* - * A group has been added to a group - * Use DPMSG_ADDGROUPTOGROUP - */ -#define DPSYS_ADDGROUPTOGROUP 0x0105 - -/* - * A group has been removed from a group - * Use DPMSG_DELETEGROUPFROMGROUP - */ -#define DPSYS_DELETEGROUPFROMGROUP 0x0106 - -/* - * A secure player-player message has arrived. - * Use DPMSG_SECUREMESSAGE - */ -#define DPSYS_SECUREMESSAGE 0x0107 - -/* - * Start a new session. - * Use DPMSG_STARTSESSION - */ -#define DPSYS_STARTSESSION 0x0108 - -/* - * A chat message has arrived - * Use DPMSG_CHAT - */ -#define DPSYS_CHAT 0x0109 - -/* - * The owner of a group has changed - * Use DPMSG_SETGROUPOWNER - */ -#define DPSYS_SETGROUPOWNER 0x010A - -/* - * An async send has finished, failed or been cancelled - * Use DPMSG_SENDCOMPLETE - */ -#define DPSYS_SENDCOMPLETE 0x010d - - -/* - * Used in the dwPlayerType field to indicate if it applies to a group - * or a player - */ -#define DPPLAYERTYPE_GROUP 0x00000000 -#define DPPLAYERTYPE_PLAYER 0x00000001 - - -/* - * DPMSG_GENERIC - * Generic message structure used to identify the message type. - */ -typedef struct -{ - DWORD dwType; // Message type -} DPMSG_GENERIC, FAR *LPDPMSG_GENERIC; - -/* - * DPMSG_CREATEPLAYERORGROUP - * System message generated when a new player or group - * created in the session with information about it. - */ -typedef struct -{ - DWORD dwType; // Message type - DWORD dwPlayerType; // Is it a player or group - DPID dpId; // ID of the player or group - DWORD dwCurrentPlayers; // current # players & groups in session - LPVOID lpData; // pointer to remote data - DWORD dwDataSize; // size of remote data - DPNAME dpnName; // structure with name info - // the following fields are only available when using - // the IDirectPlay3 interface or greater - DPID dpIdParent; // id of parent group - DWORD dwFlags; // player or group flags -} DPMSG_CREATEPLAYERORGROUP, FAR *LPDPMSG_CREATEPLAYERORGROUP; - -/* - * DPMSG_DESTROYPLAYERORGROUP - * System message generated when a player or group is being - * destroyed in the session with information about it. - */ -typedef struct -{ - DWORD dwType; // Message type - DWORD dwPlayerType; // Is it a player or group - DPID dpId; // player ID being deleted - LPVOID lpLocalData; // copy of players local data - DWORD dwLocalDataSize; // sizeof local data - LPVOID lpRemoteData; // copy of players remote data - DWORD dwRemoteDataSize; // sizeof remote data - // the following fields are only available when using - // the IDirectPlay3 interface or greater - DPNAME dpnName; // structure with name info - DPID dpIdParent; // id of parent group - DWORD dwFlags; // player or group flags -} DPMSG_DESTROYPLAYERORGROUP, FAR *LPDPMSG_DESTROYPLAYERORGROUP; - -/* - * DPMSG_ADDPLAYERTOGROUP - * System message generated when a player is being added - * to a group. - */ -typedef struct -{ - DWORD dwType; // Message type - DPID dpIdGroup; // group ID being added to - DPID dpIdPlayer; // player ID being added -} DPMSG_ADDPLAYERTOGROUP, FAR *LPDPMSG_ADDPLAYERTOGROUP; - -/* - * DPMSG_DELETEPLAYERFROMGROUP - * System message generated when a player is being - * removed from a group - */ -typedef DPMSG_ADDPLAYERTOGROUP DPMSG_DELETEPLAYERFROMGROUP; -typedef DPMSG_DELETEPLAYERFROMGROUP FAR *LPDPMSG_DELETEPLAYERFROMGROUP; - -/* - * DPMSG_ADDGROUPTOGROUP - * System message generated when a group is being added - * to a group. - */ -typedef struct -{ - DWORD dwType; // Message type - DPID dpIdParentGroup; // group ID being added to - DPID dpIdGroup; // group ID being added -} DPMSG_ADDGROUPTOGROUP, FAR *LPDPMSG_ADDGROUPTOGROUP; - -/* - * DPMSG_DELETEGROUPFROMGROUP - * System message generated when a GROUP is being - * removed from a group - */ -typedef DPMSG_ADDGROUPTOGROUP DPMSG_DELETEGROUPFROMGROUP; -typedef DPMSG_DELETEGROUPFROMGROUP FAR *LPDPMSG_DELETEGROUPFROMGROUP; - -/* - * DPMSG_SETPLAYERORGROUPDATA - * System message generated when remote data for a player or - * group has changed. - */ -typedef struct -{ - DWORD dwType; // Message type - DWORD dwPlayerType; // Is it a player or group - DPID dpId; // ID of player or group - LPVOID lpData; // pointer to remote data - DWORD dwDataSize; // size of remote data -} DPMSG_SETPLAYERORGROUPDATA, FAR *LPDPMSG_SETPLAYERORGROUPDATA; - -/* - * DPMSG_SETPLAYERORGROUPNAME - * System message generated when the name of a player or - * group has changed. - */ -typedef struct -{ - DWORD dwType; // Message type - DWORD dwPlayerType; // Is it a player or group - DPID dpId; // ID of player or group - DPNAME dpnName; // structure with new name info -} DPMSG_SETPLAYERORGROUPNAME, FAR *LPDPMSG_SETPLAYERORGROUPNAME; - -/* - * DPMSG_SETSESSIONDESC - * System message generated when session desc has changed - */ -typedef struct -{ - DWORD dwType; // Message type - DPSESSIONDESC2 dpDesc; // Session desc -} DPMSG_SETSESSIONDESC, FAR *LPDPMSG_SETSESSIONDESC; - -/* - * DPMSG_HOST - * System message generated when the host has migrated to this - * DirectPlay object. - * - */ -typedef DPMSG_GENERIC DPMSG_HOST; -typedef DPMSG_HOST FAR *LPDPMSG_HOST; - -/* - * DPMSG_SESSIONLOST - * System message generated when the connection to the session is lost. - * - */ -typedef DPMSG_GENERIC DPMSG_SESSIONLOST; -typedef DPMSG_SESSIONLOST FAR *LPDPMSG_SESSIONLOST; - -/* - * DPMSG_SECUREMESSAGE - * System message generated when a player requests a secure send - */ -typedef struct -{ - DWORD dwType; // Message Type - DWORD dwFlags; // Signed/Encrypted - DPID dpIdFrom; // ID of Sending Player - LPVOID lpData; // Player message - DWORD dwDataSize; // Size of player message -} DPMSG_SECUREMESSAGE, FAR *LPDPMSG_SECUREMESSAGE; - -/* - * DPMSG_STARTSESSION - * System message containing all information required to - * start a new session - */ -typedef struct -{ - DWORD dwType; // Message type - LPDPLCONNECTION lpConn; // DPLCONNECTION structure -} DPMSG_STARTSESSION, FAR *LPDPMSG_STARTSESSION; - -/* - * DPMSG_CHAT - * System message containing a chat message - */ -typedef struct -{ - DWORD dwType; // Message type - DWORD dwFlags; // Message flags - DPID idFromPlayer; // ID of the Sending Player - DPID idToPlayer; // ID of the To Player - DPID idToGroup; // ID of the To Group - LPDPCHAT lpChat; // Pointer to a structure containing the chat message -} DPMSG_CHAT, FAR *LPDPMSG_CHAT; - -/* - * DPMSG_SETGROUPOWNER - * System message generated when the owner of a group has changed - */ -typedef struct -{ - DWORD dwType; // Message type - DPID idGroup; // ID of the group - DPID idNewOwner; // ID of the player that is the new owner - DPID idOldOwner; // ID of the player that used to be the owner -} DPMSG_SETGROUPOWNER, FAR *LPDPMSG_SETGROUPOWNER; - -/* - * DPMSG_SENDCOMPLETE - * System message generated when finished with an Async Send message - * - * NOTE SENDPARMS has an overlay for DPMSG_SENDCOMPLETE, don't - * change this message w/o changing SENDPARMS. - */ -typedef struct -{ - DWORD dwType; - DPID idFrom; - DPID idTo; - DWORD dwFlags; - DWORD dwPriority; - DWORD dwTimeout; - LPVOID lpvContext; - DWORD dwMsgID; - HRESULT hr; - DWORD dwSendTime; -} DPMSG_SENDCOMPLETE, *LPDPMSG_SENDCOMPLETE; - -/**************************************************************************** - * - * DIRECTPLAY ERRORS - * - * Errors are represented by negative values and cannot be combined. - * - ****************************************************************************/ -#define DP_OK S_OK -#define DPERR_ALREADYINITIALIZED MAKE_DPHRESULT( 5 ) -#define DPERR_ACCESSDENIED MAKE_DPHRESULT( 10 ) -#define DPERR_ACTIVEPLAYERS MAKE_DPHRESULT( 20 ) -#define DPERR_BUFFERTOOSMALL MAKE_DPHRESULT( 30 ) -#define DPERR_CANTADDPLAYER MAKE_DPHRESULT( 40 ) -#define DPERR_CANTCREATEGROUP MAKE_DPHRESULT( 50 ) -#define DPERR_CANTCREATEPLAYER MAKE_DPHRESULT( 60 ) -#define DPERR_CANTCREATESESSION MAKE_DPHRESULT( 70 ) -#define DPERR_CAPSNOTAVAILABLEYET MAKE_DPHRESULT( 80 ) -#define DPERR_EXCEPTION MAKE_DPHRESULT( 90 ) -#define DPERR_GENERIC E_FAIL -#define DPERR_INVALIDFLAGS MAKE_DPHRESULT( 120 ) -#define DPERR_INVALIDOBJECT MAKE_DPHRESULT( 130 ) -#define DPERR_INVALIDPARAM E_INVALIDARG -#define DPERR_INVALIDPARAMS DPERR_INVALIDPARAM -#define DPERR_INVALIDPLAYER MAKE_DPHRESULT( 150 ) -#define DPERR_INVALIDGROUP MAKE_DPHRESULT( 155 ) -#define DPERR_NOCAPS MAKE_DPHRESULT( 160 ) -#define DPERR_NOCONNECTION MAKE_DPHRESULT( 170 ) -#define DPERR_NOMEMORY E_OUTOFMEMORY -#define DPERR_OUTOFMEMORY DPERR_NOMEMORY -#define DPERR_NOMESSAGES MAKE_DPHRESULT( 190 ) -#define DPERR_NONAMESERVERFOUND MAKE_DPHRESULT( 200 ) -#define DPERR_NOPLAYERS MAKE_DPHRESULT( 210 ) -#define DPERR_NOSESSIONS MAKE_DPHRESULT( 220 ) -#define DPERR_PENDING E_PENDING -#define DPERR_SENDTOOBIG MAKE_DPHRESULT( 230 ) -#define DPERR_TIMEOUT MAKE_DPHRESULT( 240 ) -#define DPERR_UNAVAILABLE MAKE_DPHRESULT( 250 ) -#define DPERR_UNSUPPORTED E_NOTIMPL -#define DPERR_BUSY MAKE_DPHRESULT( 270 ) -#define DPERR_USERCANCEL MAKE_DPHRESULT( 280 ) -#define DPERR_NOINTERFACE E_NOINTERFACE -#define DPERR_CANNOTCREATESERVER MAKE_DPHRESULT( 290 ) -#define DPERR_PLAYERLOST MAKE_DPHRESULT( 300 ) -#define DPERR_SESSIONLOST MAKE_DPHRESULT( 310 ) -#define DPERR_UNINITIALIZED MAKE_DPHRESULT( 320 ) -#define DPERR_NONEWPLAYERS MAKE_DPHRESULT( 330 ) -#define DPERR_INVALIDPASSWORD MAKE_DPHRESULT( 340 ) -#define DPERR_CONNECTING MAKE_DPHRESULT( 350 ) -#define DPERR_CONNECTIONLOST MAKE_DPHRESULT( 360 ) -#define DPERR_UNKNOWNMESSAGE MAKE_DPHRESULT( 370 ) -#define DPERR_CANCELFAILED MAKE_DPHRESULT( 380 ) -#define DPERR_INVALIDPRIORITY MAKE_DPHRESULT( 390 ) -#define DPERR_NOTHANDLED MAKE_DPHRESULT( 400 ) -#define DPERR_CANCELLED MAKE_DPHRESULT( 410 ) -#define DPERR_ABORTED MAKE_DPHRESULT( 420 ) - - -#define DPERR_BUFFERTOOLARGE MAKE_DPHRESULT( 1000 ) -#define DPERR_CANTCREATEPROCESS MAKE_DPHRESULT( 1010 ) -#define DPERR_APPNOTSTARTED MAKE_DPHRESULT( 1020 ) -#define DPERR_INVALIDINTERFACE MAKE_DPHRESULT( 1030 ) -#define DPERR_NOSERVICEPROVIDER MAKE_DPHRESULT( 1040 ) -#define DPERR_UNKNOWNAPPLICATION MAKE_DPHRESULT( 1050 ) -#define DPERR_NOTLOBBIED MAKE_DPHRESULT( 1070 ) -#define DPERR_SERVICEPROVIDERLOADED MAKE_DPHRESULT( 1080 ) -#define DPERR_ALREADYREGISTERED MAKE_DPHRESULT( 1090 ) -#define DPERR_NOTREGISTERED MAKE_DPHRESULT( 1100 ) - -// -// Security related errors -// -#define DPERR_AUTHENTICATIONFAILED MAKE_DPHRESULT( 2000 ) -#define DPERR_CANTLOADSSPI MAKE_DPHRESULT( 2010 ) -#define DPERR_ENCRYPTIONFAILED MAKE_DPHRESULT( 2020 ) -#define DPERR_SIGNFAILED MAKE_DPHRESULT( 2030 ) -#define DPERR_CANTLOADSECURITYPACKAGE MAKE_DPHRESULT( 2040 ) -#define DPERR_ENCRYPTIONNOTSUPPORTED MAKE_DPHRESULT( 2050 ) -#define DPERR_CANTLOADCAPI MAKE_DPHRESULT( 2060 ) -#define DPERR_NOTLOGGEDIN MAKE_DPHRESULT( 2070 ) -#define DPERR_LOGONDENIED MAKE_DPHRESULT( 2080 ) - - -/**************************************************************************** - * - * dplay 1.0 obsolete structures + interfaces - * Included for compatibility only. New apps should - * use IDirectPlay2 - * - ****************************************************************************/ - -// define this to ignore obsolete interfaces and constants -#ifndef IDIRECTPLAY2_OR_GREATER - -#define DPOPEN_OPENSESSION DPOPEN_JOIN -#define DPOPEN_CREATESESSION DPOPEN_CREATE - -#define DPENUMSESSIONS_PREVIOUS 0x00000004 - -#define DPENUMPLAYERS_PREVIOUS 0x00000004 - -#define DPSEND_GUARANTEE DPSEND_GUARANTEED -#define DPSEND_TRYONCE 0x00000004 - -#define DPCAPS_NAMESERVICE 0x00000001 -#define DPCAPS_NAMESERVER DPCAPS_ISHOST -#define DPCAPS_GUARANTEED 0x00000004 - -#define DPLONGNAMELEN 52 -#define DPSHORTNAMELEN 20 -#define DPSESSIONNAMELEN 32 -#define DPPASSWORDLEN 16 -#define DPUSERRESERVED 16 - -#define DPSYS_ADDPLAYER 0x0003 -#define DPSYS_DELETEPLAYER 0x0005 - -#define DPSYS_DELETEGROUP 0x0020 -#define DPSYS_DELETEPLAYERFROMGRP 0x0021 -#define DPSYS_CONNECT 0x484b - -typedef struct -{ - DWORD dwType; - DWORD dwPlayerType; - DPID dpId; - char szLongName[DPLONGNAMELEN]; - char szShortName[DPSHORTNAMELEN]; - DWORD dwCurrentPlayers; -} DPMSG_ADDPLAYER; - -typedef DPMSG_ADDPLAYER DPMSG_ADDGROUP; - -typedef struct -{ - DWORD dwType; - DPID dpIdGroup; - DPID dpIdPlayer; -} DPMSG_GROUPADD; - -typedef DPMSG_GROUPADD DPMSG_GROUPDELETE; -typedef struct -{ - DWORD dwType; - DPID dpId; -} DPMSG_DELETEPLAYER; - -typedef BOOL (PASCAL *LPDPENUMPLAYERSCALLBACK)( - DPID dpId, - LPSTR lpFriendlyName, - LPSTR lpFormalName, - DWORD dwFlags, - LPVOID lpContext ); - -typedef struct -{ - DWORD dwSize; - GUID guidSession; - DWORD_PTR dwSession; - DWORD dwMaxPlayers; - DWORD dwCurrentPlayers; - DWORD dwFlags; - char szSessionName[DPSESSIONNAMELEN]; - char szUserField[DPUSERRESERVED]; - DWORD_PTR dwReserved1; - char szPassword[DPPASSWORDLEN]; - DWORD_PTR dwReserved2; - DWORD_PTR dwUser1; - DWORD_PTR dwUser2; - DWORD_PTR dwUser3; - DWORD_PTR dwUser4; -} DPSESSIONDESC,*LPDPSESSIONDESC; - -typedef BOOL (PASCAL * LPDPENUMSESSIONSCALLBACK)( - LPDPSESSIONDESC lpDPSessionDesc, - LPVOID lpContext, - LPDWORD lpdwTimeOut, - DWORD dwFlags); - -/* - * IDirectPlay - */ -#undef INTERFACE -#define INTERFACE IDirectPlay -DECLARE_INTERFACE_( IDirectPlay, IUnknown ) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - /*** IDirectPlay methods ***/ - STDMETHOD(AddPlayerToGroup) (THIS_ DPID, DPID) PURE; - STDMETHOD(Close) (THIS) PURE; - STDMETHOD(CreatePlayer) (THIS_ LPDPID,LPSTR,LPSTR,LPHANDLE) PURE; - STDMETHOD(CreateGroup) (THIS_ LPDPID,LPSTR,LPSTR) PURE; - STDMETHOD(DeletePlayerFromGroup)(THIS_ DPID,DPID) PURE; - STDMETHOD(DestroyPlayer) (THIS_ DPID) PURE; - STDMETHOD(DestroyGroup) (THIS_ DPID) PURE; - STDMETHOD(EnableNewPlayers) (THIS_ BOOL) PURE; - STDMETHOD(EnumGroupPlayers) (THIS_ DPID, LPDPENUMPLAYERSCALLBACK,LPVOID,DWORD) PURE; - STDMETHOD(EnumGroups) (THIS_ DWORD_PTR, LPDPENUMPLAYERSCALLBACK,LPVOID,DWORD) PURE; - STDMETHOD(EnumPlayers) (THIS_ DWORD_PTR, LPDPENUMPLAYERSCALLBACK,LPVOID,DWORD) PURE; - STDMETHOD(EnumSessions) (THIS_ LPDPSESSIONDESC,DWORD,LPDPENUMSESSIONSCALLBACK,LPVOID,DWORD) PURE; - STDMETHOD(GetCaps) (THIS_ LPDPCAPS) PURE; - STDMETHOD(GetMessageCount) (THIS_ DPID, LPDWORD) PURE; - STDMETHOD(GetPlayerCaps) (THIS_ DPID, LPDPCAPS) PURE; - STDMETHOD(GetPlayerName) (THIS_ DPID,LPSTR,LPDWORD,LPSTR,LPDWORD) PURE; - STDMETHOD(Initialize) (THIS_ LPGUID) PURE; - STDMETHOD(Open) (THIS_ LPDPSESSIONDESC) PURE; - STDMETHOD(Receive) (THIS_ LPDPID,LPDPID,DWORD,LPVOID,LPDWORD) PURE; - STDMETHOD(SaveSession) (THIS_ LPSTR) PURE; - STDMETHOD(Send) (THIS_ DPID, DPID, DWORD, LPVOID, DWORD) PURE; - STDMETHOD(SetPlayerName) (THIS_ DPID,LPSTR,LPSTR) PURE; -}; - -/**************************************************************************** - * - * IDirectPlay interface macros - * - ****************************************************************************/ - -#if !defined(__cplusplus) || defined(CINTERFACE) - -#define IDirectPlay_AddPlayerToGroup(p,a,b) (p)->lpVtbl->AddPlayerToGroup(p,a,b) -#define IDirectPlay_Close(p) (p)->lpVtbl->Close(p) -#define IDirectPlay_CreateGroup(p,a,b,c) (p)->lpVtbl->CreateGroup(p,a,b,c) -#define IDirectPlay_CreatePlayer(p,a,b,c,d) (p)->lpVtbl->CreatePlayer(p,a,b,c,d) -#define IDirectPlay_DeletePlayerFromGroup(p,a,b) (p)->lpVtbl->DeletePlayerFromGroup(p,a,b) -#define IDirectPlay_DestroyGroup(p,a) (p)->lpVtbl->DestroyGroup(p,a) -#define IDirectPlay_DestroyPlayer(p,a) (p)->lpVtbl->DestroyPlayer(p,a) -#define IDirectPlay_EnableNewPlayers(p,a) (p)->lpVtbl->EnableNewPlayers(p,a) -#define IDirectPlay_EnumGroupPlayers(p,a,b,c,d) (p)->lpVtbl->EnumGroupPlayers(p,a,b,c,d) -#define IDirectPlay_EnumGroups(p,a,b,c,d) (p)->lpVtbl->EnumGroups(p,a,b,c,d) -#define IDirectPlay_EnumPlayers(p,a,b,c,d) (p)->lpVtbl->EnumPlayers(p,a,b,c,d) -#define IDirectPlay_EnumSessions(p,a,b,c,d,e) (p)->lpVtbl->EnumSessions(p,a,b,c,d,e) -#define IDirectPlay_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a) -#define IDirectPlay_GetMessageCount(p,a,b) (p)->lpVtbl->GetMessageCount(p,a,b) -#define IDirectPlay_GetPlayerCaps(p,a,b) (p)->lpVtbl->GetPlayerCaps(p,a,b) -#define IDirectPlay_GetPlayerName(p,a,b,c,d,e) (p)->lpVtbl->GetPlayerName(p,a,b,c,d,e) -#define IDirectPlay_Initialize(p,a) (p)->lpVtbl->Initialize(p,a) -#define IDirectPlay_Open(p,a) (p)->lpVtbl->Open(p,a) -#define IDirectPlay_Receive(p,a,b,c,d,e) (p)->lpVtbl->Receive(p,a,b,c,d,e) -#define IDirectPlay_SaveSession(p,a) (p)->lpVtbl->SaveSession(p,a) -#define IDirectPlay_Send(p,a,b,c,d,e) (p)->lpVtbl->Send(p,a,b,c,d,e) -#define IDirectPlay_SetPlayerName(p,a,b,c) (p)->lpVtbl->SetPlayerName(p,a,b,c) - -#else /* C++ */ - -#define IDirectPlay_AddPlayerToGroup(p,a,b) (p)->AddPlayerToGroup(a,b) -#define IDirectPlay_Close(p) (p)->Close() -#define IDirectPlay_CreateGroup(p,a,b,c) (p)->CreateGroup(a,b,c) -#define IDirectPlay_CreatePlayer(p,a,b,c,d) (p)->CreatePlayer(a,b,c,d) -#define IDirectPlay_DeletePlayerFromGroup(p,a,b) (p)->DeletePlayerFromGroup(a,b) -#define IDirectPlay_DestroyGroup(p,a) (p)->DestroyGroup(a) -#define IDirectPlay_DestroyPlayer(p,a) (p)->DestroyPlayer(a) -#define IDirectPlay_EnableNewPlayers(p,a) (p)->EnableNewPlayers(a) -#define IDirectPlay_EnumGroupPlayers(p,a,b,c,d) (p)->EnumGroupPlayers(a,b,c,d) -#define IDirectPlay_EnumGroups(p,a,b,c,d) (p)->EnumGroups(a,b,c,d) -#define IDirectPlay_EnumPlayers(p,a,b,c,d) (p)->EnumPlayers(a,b,c,d) -#define IDirectPlay_EnumSessions(p,a,b,c,d,e) (p)->EnumSessions(a,b,c,d,e) -#define IDirectPlay_GetCaps(p,a) (p)->GetCaps(a) -#define IDirectPlay_GetMessageCount(p,a,b) (p)->GetMessageCount(a,b) -#define IDirectPlay_GetPlayerCaps(p,a,b) (p)->GetPlayerCaps(a,b) -#define IDirectPlay_GetPlayerName(p,a,b,c,d,e) (p)->GetPlayerName(a,b,c,d,e) -#define IDirectPlay_Initialize(p,a) (p)->Initialize(a) -#define IDirectPlay_Open(p,a) (p)->Open(a) -#define IDirectPlay_Receive(p,a,b,c,d,e) (p)->Receive(a,b,c,d,e) -#define IDirectPlay_SaveSession(p,a) (p)->SaveSession(a) -#define IDirectPlay_Send(p,a,b,c,d,e) (p)->Send(a,b,c,d,e) -#define IDirectPlay_SetPlayerName(p,a,b,c) (p)->SetPlayerName(a,b,c) - -#endif - -DEFINE_GUID(IID_IDirectPlay, 0x5454e9a0, 0xdb65, 0x11ce, 0x92, 0x1c, 0x00, 0xaa, 0x00, 0x6c, 0x49, 0x72); - -#endif // IDIRECTPLAY2_OR_GREATER - -/**************************************************************************** - * - * IDirectPlay macros (included regardless of IDIRECTPLAY2_OR_GREATER flag) - * - ****************************************************************************/ - -#if !defined(__cplusplus) || defined(CINTERFACE) - -#define IDirectPlay_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectPlay_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectPlay_Release(p) (p)->lpVtbl->Release(p) - -#else - -#define IDirectPlay_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirectPlay_AddRef(p) (p)->AddRef() -#define IDirectPlay_Release(p) (p)->Release() - -#endif // IDirectPlay interface macros - -#ifdef __cplusplus -}; -#endif - -/* restore warning settings */ -#if _MSC_VER >= 1200 -#pragma warning(pop) -#else -#pragma warning(default:4201) -#endif - -#endif - diff --git a/dsound.h b/dsound.h deleted file mode 100644 index ca43f5f..0000000 --- a/dsound.h +++ /dev/null @@ -1,2385 +0,0 @@ -/*==========================================================================; - * - * Copyright (c) Microsoft Corporation. All rights reserved. - * - * File: dsound.h - * Content: DirectSound include file - * - **************************************************************************/ - -#define COM_NO_WINDOWS_H -#include -#include -#include - -#ifndef DIRECTSOUND_VERSION - -#if (NTDDI_VERSION < NTDDI_WINXP) /* Windows 2000 */ -#define DIRECTSOUND_VERSION 0x0700 /* Version 7.0 */ -#elif (NTDDI_VERSION < NTDDI_WINXPSP2 || NTDDI_VERSION == NTDDI_WS03) /* Windows XP and SP1, or Windows Server 2003 */ -#define DIRECTSOUND_VERSION 0x0800 /* Version 8.0 */ -#else /* Windows XP SP2 and higher, Windows Server 2003 SP1 and higher, Longhorn, or higher */ -#define DIRECTSOUND_VERSION 0x0900 /* Version 9.0 */ -#endif - -#endif // DIRECTSOUND_VERSION - -#ifdef __cplusplus -extern "C" { -#endif // __cplusplus - -#ifndef __DSOUND_INCLUDED__ -#define __DSOUND_INCLUDED__ - -/* Type definitions shared with Direct3D */ - -#ifndef DX_SHARED_DEFINES - -typedef float D3DVALUE, *LPD3DVALUE; - -#ifndef D3DCOLOR_DEFINED -typedef DWORD D3DCOLOR; -#define D3DCOLOR_DEFINED -#endif - -#ifndef LPD3DCOLOR_DEFINED -typedef DWORD *LPD3DCOLOR; -#define LPD3DCOLOR_DEFINED -#endif - -#ifndef D3DVECTOR_DEFINED -typedef struct _D3DVECTOR { - float x; - float y; - float z; -} D3DVECTOR; -#define D3DVECTOR_DEFINED -#endif - -#ifndef LPD3DVECTOR_DEFINED -typedef D3DVECTOR *LPD3DVECTOR; -#define LPD3DVECTOR_DEFINED -#endif - -#define DX_SHARED_DEFINES -#endif // DX_SHARED_DEFINES - -#define _FACDS 0x878 /* DirectSound's facility code */ -#define MAKE_DSHRESULT(code) MAKE_HRESULT(1, _FACDS, code) - -// DirectSound Component GUID {47D4D946-62E8-11CF-93BC-444553540000} -DEFINE_GUID(CLSID_DirectSound, 0x47d4d946, 0x62e8, 0x11cf, 0x93, 0xbc, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0); - -// DirectSound 8.0 Component GUID {3901CC3F-84B5-4FA4-BA35-AA8172B8A09B} -DEFINE_GUID(CLSID_DirectSound8, 0x3901cc3f, 0x84b5, 0x4fa4, 0xba, 0x35, 0xaa, 0x81, 0x72, 0xb8, 0xa0, 0x9b); - -// DirectSound Capture Component GUID {B0210780-89CD-11D0-AF08-00A0C925CD16} -DEFINE_GUID(CLSID_DirectSoundCapture, 0xb0210780, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16); - -// DirectSound 8.0 Capture Component GUID {E4BCAC13-7F99-4908-9A8E-74E3BF24B6E1} -DEFINE_GUID(CLSID_DirectSoundCapture8, 0xe4bcac13, 0x7f99, 0x4908, 0x9a, 0x8e, 0x74, 0xe3, 0xbf, 0x24, 0xb6, 0xe1); - -// DirectSound Full Duplex Component GUID {FEA4300C-7959-4147-B26A-2377B9E7A91D} -DEFINE_GUID(CLSID_DirectSoundFullDuplex, 0xfea4300c, 0x7959, 0x4147, 0xb2, 0x6a, 0x23, 0x77, 0xb9, 0xe7, 0xa9, 0x1d); - - -// DirectSound default playback device GUID {DEF00000-9C6D-47ED-AAF1-4DDA8F2B5C03} -DEFINE_GUID(DSDEVID_DefaultPlayback, 0xdef00000, 0x9c6d, 0x47ed, 0xaa, 0xf1, 0x4d, 0xda, 0x8f, 0x2b, 0x5c, 0x03); - -// DirectSound default capture device GUID {DEF00001-9C6D-47ED-AAF1-4DDA8F2B5C03} -DEFINE_GUID(DSDEVID_DefaultCapture, 0xdef00001, 0x9c6d, 0x47ed, 0xaa, 0xf1, 0x4d, 0xda, 0x8f, 0x2b, 0x5c, 0x03); - -// DirectSound default device for voice playback {DEF00002-9C6D-47ED-AAF1-4DDA8F2B5C03} -DEFINE_GUID(DSDEVID_DefaultVoicePlayback, 0xdef00002, 0x9c6d, 0x47ed, 0xaa, 0xf1, 0x4d, 0xda, 0x8f, 0x2b, 0x5c, 0x03); - -// DirectSound default device for voice capture {DEF00003-9C6D-47ED-AAF1-4DDA8F2B5C03} -DEFINE_GUID(DSDEVID_DefaultVoiceCapture, 0xdef00003, 0x9c6d, 0x47ed, 0xaa, 0xf1, 0x4d, 0xda, 0x8f, 0x2b, 0x5c, 0x03); - - -// -// Forward declarations for interfaces. -// 'struct' not 'class' per the way DECLARE_INTERFACE_ is defined -// - -#ifdef __cplusplus -struct IDirectSound; -struct IDirectSoundBuffer; -struct IDirectSound3DListener; -struct IDirectSound3DBuffer; -struct IDirectSoundCapture; -struct IDirectSoundCaptureBuffer; -struct IDirectSoundNotify; -#endif // __cplusplus - -// -// DirectSound 8.0 interfaces. -// - -#if DIRECTSOUND_VERSION >= 0x0800 - -#ifdef __cplusplus -struct IDirectSound8; -struct IDirectSoundBuffer8; -struct IDirectSoundCaptureBuffer8; -struct IDirectSoundFXGargle; -struct IDirectSoundFXChorus; -struct IDirectSoundFXFlanger; -struct IDirectSoundFXEcho; -struct IDirectSoundFXDistortion; -struct IDirectSoundFXCompressor; -struct IDirectSoundFXParamEq; -struct IDirectSoundFXWavesReverb; -struct IDirectSoundFXI3DL2Reverb; -struct IDirectSoundCaptureFXAec; -struct IDirectSoundCaptureFXNoiseSuppress; -struct IDirectSoundFullDuplex; -#endif // __cplusplus - -// IDirectSound8, IDirectSoundBuffer8 and IDirectSoundCaptureBuffer8 are the -// only DirectSound 7.0 interfaces with changed functionality in version 8.0. -// The other level 8 interfaces as equivalent to their level 7 counterparts: - -#define IDirectSoundCapture8 IDirectSoundCapture -#define IDirectSound3DListener8 IDirectSound3DListener -#define IDirectSound3DBuffer8 IDirectSound3DBuffer -#define IDirectSoundNotify8 IDirectSoundNotify -#define IDirectSoundFXGargle8 IDirectSoundFXGargle -#define IDirectSoundFXChorus8 IDirectSoundFXChorus -#define IDirectSoundFXFlanger8 IDirectSoundFXFlanger -#define IDirectSoundFXEcho8 IDirectSoundFXEcho -#define IDirectSoundFXDistortion8 IDirectSoundFXDistortion -#define IDirectSoundFXCompressor8 IDirectSoundFXCompressor -#define IDirectSoundFXParamEq8 IDirectSoundFXParamEq -#define IDirectSoundFXWavesReverb8 IDirectSoundFXWavesReverb -#define IDirectSoundFXI3DL2Reverb8 IDirectSoundFXI3DL2Reverb -#define IDirectSoundCaptureFXAec8 IDirectSoundCaptureFXAec -#define IDirectSoundCaptureFXNoiseSuppress8 IDirectSoundCaptureFXNoiseSuppress -#define IDirectSoundFullDuplex8 IDirectSoundFullDuplex - -#endif // DIRECTSOUND_VERSION >= 0x0800 - -typedef struct IDirectSound *LPDIRECTSOUND; -typedef struct IDirectSoundBuffer *LPDIRECTSOUNDBUFFER; -typedef struct IDirectSound3DListener *LPDIRECTSOUND3DLISTENER; -typedef struct IDirectSound3DBuffer *LPDIRECTSOUND3DBUFFER; -typedef struct IDirectSoundCapture *LPDIRECTSOUNDCAPTURE; -typedef struct IDirectSoundCaptureBuffer *LPDIRECTSOUNDCAPTUREBUFFER; -typedef struct IDirectSoundNotify *LPDIRECTSOUNDNOTIFY; - -#if DIRECTSOUND_VERSION >= 0x0800 - -typedef struct IDirectSoundFXGargle *LPDIRECTSOUNDFXGARGLE; -typedef struct IDirectSoundFXChorus *LPDIRECTSOUNDFXCHORUS; -typedef struct IDirectSoundFXFlanger *LPDIRECTSOUNDFXFLANGER; -typedef struct IDirectSoundFXEcho *LPDIRECTSOUNDFXECHO; -typedef struct IDirectSoundFXDistortion *LPDIRECTSOUNDFXDISTORTION; -typedef struct IDirectSoundFXCompressor *LPDIRECTSOUNDFXCOMPRESSOR; -typedef struct IDirectSoundFXParamEq *LPDIRECTSOUNDFXPARAMEQ; -typedef struct IDirectSoundFXWavesReverb *LPDIRECTSOUNDFXWAVESREVERB; -typedef struct IDirectSoundFXI3DL2Reverb *LPDIRECTSOUNDFXI3DL2REVERB; -typedef struct IDirectSoundCaptureFXAec *LPDIRECTSOUNDCAPTUREFXAEC; -typedef struct IDirectSoundCaptureFXNoiseSuppress *LPDIRECTSOUNDCAPTUREFXNOISESUPPRESS; -typedef struct IDirectSoundFullDuplex *LPDIRECTSOUNDFULLDUPLEX; - -typedef struct IDirectSound8 *LPDIRECTSOUND8; -typedef struct IDirectSoundBuffer8 *LPDIRECTSOUNDBUFFER8; -typedef struct IDirectSound3DListener8 *LPDIRECTSOUND3DLISTENER8; -typedef struct IDirectSound3DBuffer8 *LPDIRECTSOUND3DBUFFER8; -typedef struct IDirectSoundCapture8 *LPDIRECTSOUNDCAPTURE8; -typedef struct IDirectSoundCaptureBuffer8 *LPDIRECTSOUNDCAPTUREBUFFER8; -typedef struct IDirectSoundNotify8 *LPDIRECTSOUNDNOTIFY8; -typedef struct IDirectSoundFXGargle8 *LPDIRECTSOUNDFXGARGLE8; -typedef struct IDirectSoundFXChorus8 *LPDIRECTSOUNDFXCHORUS8; -typedef struct IDirectSoundFXFlanger8 *LPDIRECTSOUNDFXFLANGER8; -typedef struct IDirectSoundFXEcho8 *LPDIRECTSOUNDFXECHO8; -typedef struct IDirectSoundFXDistortion8 *LPDIRECTSOUNDFXDISTORTION8; -typedef struct IDirectSoundFXCompressor8 *LPDIRECTSOUNDFXCOMPRESSOR8; -typedef struct IDirectSoundFXParamEq8 *LPDIRECTSOUNDFXPARAMEQ8; -typedef struct IDirectSoundFXWavesReverb8 *LPDIRECTSOUNDFXWAVESREVERB8; -typedef struct IDirectSoundFXI3DL2Reverb8 *LPDIRECTSOUNDFXI3DL2REVERB8; -typedef struct IDirectSoundCaptureFXAec8 *LPDIRECTSOUNDCAPTUREFXAEC8; -typedef struct IDirectSoundCaptureFXNoiseSuppress8 *LPDIRECTSOUNDCAPTUREFXNOISESUPPRESS8; -typedef struct IDirectSoundFullDuplex8 *LPDIRECTSOUNDFULLDUPLEX8; - -#endif // DIRECTSOUND_VERSION >= 0x0800 - -// -// IID definitions for the unchanged DirectSound 8.0 interfaces -// - -#if DIRECTSOUND_VERSION >= 0x0800 - -#define IID_IDirectSoundCapture8 IID_IDirectSoundCapture -#define IID_IDirectSound3DListener8 IID_IDirectSound3DListener -#define IID_IDirectSound3DBuffer8 IID_IDirectSound3DBuffer -#define IID_IDirectSoundNotify8 IID_IDirectSoundNotify -#define IID_IDirectSoundFXGargle8 IID_IDirectSoundFXGargle -#define IID_IDirectSoundFXChorus8 IID_IDirectSoundFXChorus -#define IID_IDirectSoundFXFlanger8 IID_IDirectSoundFXFlanger -#define IID_IDirectSoundFXEcho8 IID_IDirectSoundFXEcho -#define IID_IDirectSoundFXDistortion8 IID_IDirectSoundFXDistortion -#define IID_IDirectSoundFXCompressor8 IID_IDirectSoundFXCompressor -#define IID_IDirectSoundFXParamEq8 IID_IDirectSoundFXParamEq -#define IID_IDirectSoundFXWavesReverb8 IID_IDirectSoundFXWavesReverb -#define IID_IDirectSoundFXI3DL2Reverb8 IID_IDirectSoundFXI3DL2Reverb -#define IID_IDirectSoundCaptureFXAec8 IID_IDirectSoundCaptureFXAec -#define IID_IDirectSoundCaptureFXNoiseSuppress8 IID_IDirectSoundCaptureFXNoiseSuppress -#define IID_IDirectSoundFullDuplex8 IID_IDirectSoundFullDuplex - -#endif // DIRECTSOUND_VERSION >= 0x0800 - -// -// Compatibility typedefs -// - -#ifndef _LPCWAVEFORMATEX_DEFINED -#define _LPCWAVEFORMATEX_DEFINED -typedef const WAVEFORMATEX *LPCWAVEFORMATEX; -#endif // _LPCWAVEFORMATEX_DEFINED - -#ifndef __LPCGUID_DEFINED__ -#define __LPCGUID_DEFINED__ -typedef const GUID *LPCGUID; -#endif // __LPCGUID_DEFINED__ - -typedef LPDIRECTSOUND *LPLPDIRECTSOUND; -typedef LPDIRECTSOUNDBUFFER *LPLPDIRECTSOUNDBUFFER; -typedef LPDIRECTSOUND3DLISTENER *LPLPDIRECTSOUND3DLISTENER; -typedef LPDIRECTSOUND3DBUFFER *LPLPDIRECTSOUND3DBUFFER; -typedef LPDIRECTSOUNDCAPTURE *LPLPDIRECTSOUNDCAPTURE; -typedef LPDIRECTSOUNDCAPTUREBUFFER *LPLPDIRECTSOUNDCAPTUREBUFFER; -typedef LPDIRECTSOUNDNOTIFY *LPLPDIRECTSOUNDNOTIFY; - -#if DIRECTSOUND_VERSION >= 0x0800 -typedef LPDIRECTSOUND8 *LPLPDIRECTSOUND8; -typedef LPDIRECTSOUNDBUFFER8 *LPLPDIRECTSOUNDBUFFER8; -typedef LPDIRECTSOUNDCAPTURE8 *LPLPDIRECTSOUNDCAPTURE8; -typedef LPDIRECTSOUNDCAPTUREBUFFER8 *LPLPDIRECTSOUNDCAPTUREBUFFER8; -#endif // DIRECTSOUND_VERSION >= 0x0800 - -// -// Structures -// - -typedef struct _DSCAPS -{ - DWORD dwSize; - DWORD dwFlags; - DWORD dwMinSecondarySampleRate; - DWORD dwMaxSecondarySampleRate; - DWORD dwPrimaryBuffers; - DWORD dwMaxHwMixingAllBuffers; - DWORD dwMaxHwMixingStaticBuffers; - DWORD dwMaxHwMixingStreamingBuffers; - DWORD dwFreeHwMixingAllBuffers; - DWORD dwFreeHwMixingStaticBuffers; - DWORD dwFreeHwMixingStreamingBuffers; - DWORD dwMaxHw3DAllBuffers; - DWORD dwMaxHw3DStaticBuffers; - DWORD dwMaxHw3DStreamingBuffers; - DWORD dwFreeHw3DAllBuffers; - DWORD dwFreeHw3DStaticBuffers; - DWORD dwFreeHw3DStreamingBuffers; - DWORD dwTotalHwMemBytes; - DWORD dwFreeHwMemBytes; - DWORD dwMaxContigFreeHwMemBytes; - DWORD dwUnlockTransferRateHwBuffers; - DWORD dwPlayCpuOverheadSwBuffers; - DWORD dwReserved1; - DWORD dwReserved2; -} DSCAPS, *LPDSCAPS; - -typedef const DSCAPS *LPCDSCAPS; - -typedef struct _DSBCAPS -{ - DWORD dwSize; - DWORD dwFlags; - DWORD dwBufferBytes; - DWORD dwUnlockTransferRate; - DWORD dwPlayCpuOverhead; -} DSBCAPS, *LPDSBCAPS; - -typedef const DSBCAPS *LPCDSBCAPS; - -#if DIRECTSOUND_VERSION >= 0x0800 - - typedef struct _DSEFFECTDESC - { - DWORD dwSize; - DWORD dwFlags; - GUID guidDSFXClass; - DWORD_PTR dwReserved1; - DWORD_PTR dwReserved2; - } DSEFFECTDESC, *LPDSEFFECTDESC; - typedef const DSEFFECTDESC *LPCDSEFFECTDESC; - - #define DSFX_LOCHARDWARE 0x00000001 - #define DSFX_LOCSOFTWARE 0x00000002 - - enum - { - DSFXR_PRESENT, // 0 - DSFXR_LOCHARDWARE, // 1 - DSFXR_LOCSOFTWARE, // 2 - DSFXR_UNALLOCATED, // 3 - DSFXR_FAILED, // 4 - DSFXR_UNKNOWN, // 5 - DSFXR_SENDLOOP // 6 - }; - - typedef struct _DSCEFFECTDESC - { - DWORD dwSize; - DWORD dwFlags; - GUID guidDSCFXClass; - GUID guidDSCFXInstance; - DWORD dwReserved1; - DWORD dwReserved2; - } DSCEFFECTDESC, *LPDSCEFFECTDESC; - typedef const DSCEFFECTDESC *LPCDSCEFFECTDESC; - - #define DSCFX_LOCHARDWARE 0x00000001 - #define DSCFX_LOCSOFTWARE 0x00000002 - - #define DSCFXR_LOCHARDWARE 0x00000010 - #define DSCFXR_LOCSOFTWARE 0x00000020 - -#endif // DIRECTSOUND_VERSION >= 0x0800 - -typedef struct _DSBUFFERDESC -{ - DWORD dwSize; - DWORD dwFlags; - DWORD dwBufferBytes; - DWORD dwReserved; - LPWAVEFORMATEX lpwfxFormat; -#if DIRECTSOUND_VERSION >= 0x0700 - GUID guid3DAlgorithm; -#endif -} DSBUFFERDESC, *LPDSBUFFERDESC; - -typedef const DSBUFFERDESC *LPCDSBUFFERDESC; - -// Older version of this structure: - -typedef struct _DSBUFFERDESC1 -{ - DWORD dwSize; - DWORD dwFlags; - DWORD dwBufferBytes; - DWORD dwReserved; - LPWAVEFORMATEX lpwfxFormat; -} DSBUFFERDESC1, *LPDSBUFFERDESC1; - -typedef const DSBUFFERDESC1 *LPCDSBUFFERDESC1; - -typedef struct _DS3DBUFFER -{ - DWORD dwSize; - D3DVECTOR vPosition; - D3DVECTOR vVelocity; - DWORD dwInsideConeAngle; - DWORD dwOutsideConeAngle; - D3DVECTOR vConeOrientation; - LONG lConeOutsideVolume; - D3DVALUE flMinDistance; - D3DVALUE flMaxDistance; - DWORD dwMode; -} DS3DBUFFER, *LPDS3DBUFFER; - -typedef const DS3DBUFFER *LPCDS3DBUFFER; - -typedef struct _DS3DLISTENER -{ - DWORD dwSize; - D3DVECTOR vPosition; - D3DVECTOR vVelocity; - D3DVECTOR vOrientFront; - D3DVECTOR vOrientTop; - D3DVALUE flDistanceFactor; - D3DVALUE flRolloffFactor; - D3DVALUE flDopplerFactor; -} DS3DLISTENER, *LPDS3DLISTENER; - -typedef const DS3DLISTENER *LPCDS3DLISTENER; - -typedef struct _DSCCAPS -{ - DWORD dwSize; - DWORD dwFlags; - DWORD dwFormats; - DWORD dwChannels; -} DSCCAPS, *LPDSCCAPS; - -typedef const DSCCAPS *LPCDSCCAPS; - -typedef struct _DSCBUFFERDESC1 -{ - DWORD dwSize; - DWORD dwFlags; - DWORD dwBufferBytes; - DWORD dwReserved; - LPWAVEFORMATEX lpwfxFormat; -} DSCBUFFERDESC1, *LPDSCBUFFERDESC1; - -typedef struct _DSCBUFFERDESC -{ - DWORD dwSize; - DWORD dwFlags; - DWORD dwBufferBytes; - DWORD dwReserved; - LPWAVEFORMATEX lpwfxFormat; -#if DIRECTSOUND_VERSION >= 0x0800 - DWORD dwFXCount; - LPDSCEFFECTDESC lpDSCFXDesc; -#endif -} DSCBUFFERDESC, *LPDSCBUFFERDESC; - -typedef const DSCBUFFERDESC *LPCDSCBUFFERDESC; - -typedef struct _DSCBCAPS -{ - DWORD dwSize; - DWORD dwFlags; - DWORD dwBufferBytes; - DWORD dwReserved; -} DSCBCAPS, *LPDSCBCAPS; - -typedef const DSCBCAPS *LPCDSCBCAPS; - -typedef struct _DSBPOSITIONNOTIFY -{ - DWORD dwOffset; - HANDLE hEventNotify; -} DSBPOSITIONNOTIFY, *LPDSBPOSITIONNOTIFY; - -typedef const DSBPOSITIONNOTIFY *LPCDSBPOSITIONNOTIFY; - -// -// DirectSound API -// - -typedef BOOL (CALLBACK *LPDSENUMCALLBACKA)(LPGUID, LPCSTR, LPCSTR, LPVOID); -typedef BOOL (CALLBACK *LPDSENUMCALLBACKW)(LPGUID, LPCWSTR, LPCWSTR, LPVOID); - -extern HRESULT WINAPI DirectSoundCreate(__in_opt LPCGUID pcGuidDevice, __deref_out LPDIRECTSOUND *ppDS, __null LPUNKNOWN pUnkOuter); -extern HRESULT WINAPI DirectSoundEnumerateA(__in LPDSENUMCALLBACKA pDSEnumCallback, __in_opt LPVOID pContext); -extern HRESULT WINAPI DirectSoundEnumerateW(__in LPDSENUMCALLBACKW pDSEnumCallback, __in_opt LPVOID pContext); - -extern HRESULT WINAPI DirectSoundCaptureCreate(__in_opt LPCGUID pcGuidDevice, __deref_out LPDIRECTSOUNDCAPTURE *ppDSC, __null LPUNKNOWN pUnkOuter); -extern HRESULT WINAPI DirectSoundCaptureEnumerateA(__in LPDSENUMCALLBACKA pDSEnumCallback, __in_opt LPVOID pContext); -extern HRESULT WINAPI DirectSoundCaptureEnumerateW(__in LPDSENUMCALLBACKW pDSEnumCallback, __in_opt LPVOID pContext); - -#if DIRECTSOUND_VERSION >= 0x0800 -extern HRESULT WINAPI DirectSoundCreate8(__in_opt LPCGUID pcGuidDevice, __deref_out LPDIRECTSOUND8 *ppDS8, __null LPUNKNOWN pUnkOuter); -extern HRESULT WINAPI DirectSoundCaptureCreate8(__in_opt LPCGUID pcGuidDevice, __deref_out LPDIRECTSOUNDCAPTURE8 *ppDSC8, __null LPUNKNOWN pUnkOuter); -extern HRESULT WINAPI DirectSoundFullDuplexCreate -( - __in_opt LPCGUID pcGuidCaptureDevice, - __in_opt LPCGUID pcGuidRenderDevice, - __in LPCDSCBUFFERDESC pcDSCBufferDesc, - __in LPCDSBUFFERDESC pcDSBufferDesc, - HWND hWnd, - DWORD dwLevel, - __deref_out LPDIRECTSOUNDFULLDUPLEX* ppDSFD, - __deref_out LPDIRECTSOUNDCAPTUREBUFFER8 *ppDSCBuffer8, - __deref_out LPDIRECTSOUNDBUFFER8 *ppDSBuffer8, - __null LPUNKNOWN pUnkOuter -); -#define DirectSoundFullDuplexCreate8 DirectSoundFullDuplexCreate - -extern HRESULT WINAPI GetDeviceID(__in_opt LPCGUID pGuidSrc, __out LPGUID pGuidDest); -#endif // DIRECTSOUND_VERSION >= 0x0800 - -#ifdef UNICODE -#define LPDSENUMCALLBACK LPDSENUMCALLBACKW -#define DirectSoundEnumerate DirectSoundEnumerateW -#define DirectSoundCaptureEnumerate DirectSoundCaptureEnumerateW -#else // UNICODE -#define LPDSENUMCALLBACK LPDSENUMCALLBACKA -#define DirectSoundEnumerate DirectSoundEnumerateA -#define DirectSoundCaptureEnumerate DirectSoundCaptureEnumerateA -#endif // UNICODE - -// -// IUnknown -// - -#if !defined(__cplusplus) || defined(CINTERFACE) -#ifndef IUnknown_QueryInterface -#define IUnknown_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#endif // IUnknown_QueryInterface -#ifndef IUnknown_AddRef -#define IUnknown_AddRef(p) (p)->lpVtbl->AddRef(p) -#endif // IUnknown_AddRef -#ifndef IUnknown_Release -#define IUnknown_Release(p) (p)->lpVtbl->Release(p) -#endif // IUnknown_Release -#else // !defined(__cplusplus) || defined(CINTERFACE) -#ifndef IUnknown_QueryInterface -#define IUnknown_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#endif // IUnknown_QueryInterface -#ifndef IUnknown_AddRef -#define IUnknown_AddRef(p) (p)->AddRef() -#endif // IUnknown_AddRef -#ifndef IUnknown_Release -#define IUnknown_Release(p) (p)->Release() -#endif // IUnknown_Release -#endif // !defined(__cplusplus) || defined(CINTERFACE) - -#ifndef __IReferenceClock_INTERFACE_DEFINED__ -#define __IReferenceClock_INTERFACE_DEFINED__ - -typedef LONGLONG REFERENCE_TIME; -typedef REFERENCE_TIME *LPREFERENCE_TIME; - -DEFINE_GUID(IID_IReferenceClock, 0x56a86897, 0x0ad4, 0x11ce, 0xb0, 0x3a, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70); - -#undef INTERFACE -#define INTERFACE IReferenceClock - -DECLARE_INTERFACE_(IReferenceClock, IUnknown) -{ - // IUnknown methods - STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - // IReferenceClock methods - STDMETHOD(GetTime) (THIS_ __out REFERENCE_TIME *pTime) PURE; - STDMETHOD(AdviseTime) (THIS_ REFERENCE_TIME rtBaseTime, REFERENCE_TIME rtStreamTime, - HANDLE hEvent, __out LPDWORD pdwAdviseCookie) PURE; - STDMETHOD(AdvisePeriodic) (THIS_ REFERENCE_TIME rtStartTime, REFERENCE_TIME rtPeriodTime, - HANDLE hSemaphore, __out LPDWORD pdwAdviseCookie) PURE; - STDMETHOD(Unadvise) (THIS_ DWORD dwAdviseCookie) PURE; -}; - -#endif // __IReferenceClock_INTERFACE_DEFINED__ - -#ifndef IReferenceClock_QueryInterface - -#define IReferenceClock_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) -#define IReferenceClock_AddRef(p) IUnknown_AddRef(p) -#define IReferenceClock_Release(p) IUnknown_Release(p) - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IReferenceClock_GetTime(p,a) (p)->lpVtbl->GetTime(p,a) -#define IReferenceClock_AdviseTime(p,a,b,c,d) (p)->lpVtbl->AdviseTime(p,a,b,c,d) -#define IReferenceClock_AdvisePeriodic(p,a,b,c,d) (p)->lpVtbl->AdvisePeriodic(p,a,b,c,d) -#define IReferenceClock_Unadvise(p,a) (p)->lpVtbl->Unadvise(p,a) -#else // !defined(__cplusplus) || defined(CINTERFACE) -#define IReferenceClock_GetTime(p,a) (p)->GetTime(a) -#define IReferenceClock_AdviseTime(p,a,b,c,d) (p)->AdviseTime(a,b,c,d) -#define IReferenceClock_AdvisePeriodic(p,a,b,c,d) (p)->AdvisePeriodic(a,b,c,d) -#define IReferenceClock_Unadvise(p,a) (p)->Unadvise(a) -#endif // !defined(__cplusplus) || defined(CINTERFACE) - -#endif // IReferenceClock_QueryInterface - -// -// IDirectSound -// - -DEFINE_GUID(IID_IDirectSound, 0x279AFA83, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60); - -#undef INTERFACE -#define INTERFACE IDirectSound - -DECLARE_INTERFACE_(IDirectSound, IUnknown) -{ - // IUnknown methods - STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - // IDirectSound methods - STDMETHOD(CreateSoundBuffer) (THIS_ __in LPCDSBUFFERDESC pcDSBufferDesc, __deref_out LPDIRECTSOUNDBUFFER *ppDSBuffer, __null LPUNKNOWN pUnkOuter) PURE; - STDMETHOD(GetCaps) (THIS_ __out LPDSCAPS pDSCaps) PURE; - STDMETHOD(DuplicateSoundBuffer) (THIS_ __in LPDIRECTSOUNDBUFFER pDSBufferOriginal, __deref_out LPDIRECTSOUNDBUFFER *ppDSBufferDuplicate) PURE; - STDMETHOD(SetCooperativeLevel) (THIS_ HWND hwnd, DWORD dwLevel) PURE; - STDMETHOD(Compact) (THIS) PURE; - STDMETHOD(GetSpeakerConfig) (THIS_ __out LPDWORD pdwSpeakerConfig) PURE; - STDMETHOD(SetSpeakerConfig) (THIS_ DWORD dwSpeakerConfig) PURE; - STDMETHOD(Initialize) (THIS_ __in_opt LPCGUID pcGuidDevice) PURE; -}; - -#define IDirectSound_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) -#define IDirectSound_AddRef(p) IUnknown_AddRef(p) -#define IDirectSound_Release(p) IUnknown_Release(p) - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectSound_CreateSoundBuffer(p,a,b,c) (p)->lpVtbl->CreateSoundBuffer(p,a,b,c) -#define IDirectSound_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a) -#define IDirectSound_DuplicateSoundBuffer(p,a,b) (p)->lpVtbl->DuplicateSoundBuffer(p,a,b) -#define IDirectSound_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b) -#define IDirectSound_Compact(p) (p)->lpVtbl->Compact(p) -#define IDirectSound_GetSpeakerConfig(p,a) (p)->lpVtbl->GetSpeakerConfig(p,a) -#define IDirectSound_SetSpeakerConfig(p,b) (p)->lpVtbl->SetSpeakerConfig(p,b) -#define IDirectSound_Initialize(p,a) (p)->lpVtbl->Initialize(p,a) -#else // !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectSound_CreateSoundBuffer(p,a,b,c) (p)->CreateSoundBuffer(a,b,c) -#define IDirectSound_GetCaps(p,a) (p)->GetCaps(a) -#define IDirectSound_DuplicateSoundBuffer(p,a,b) (p)->DuplicateSoundBuffer(a,b) -#define IDirectSound_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b) -#define IDirectSound_Compact(p) (p)->Compact() -#define IDirectSound_GetSpeakerConfig(p,a) (p)->GetSpeakerConfig(a) -#define IDirectSound_SetSpeakerConfig(p,b) (p)->SetSpeakerConfig(b) -#define IDirectSound_Initialize(p,a) (p)->Initialize(a) -#endif // !defined(__cplusplus) || defined(CINTERFACE) - -#if DIRECTSOUND_VERSION >= 0x0800 - -// -// IDirectSound8 -// - -DEFINE_GUID(IID_IDirectSound8, 0xC50A7E93, 0xF395, 0x4834, 0x9E, 0xF6, 0x7F, 0xA9, 0x9D, 0xE5, 0x09, 0x66); - -#undef INTERFACE -#define INTERFACE IDirectSound8 - -DECLARE_INTERFACE_(IDirectSound8, IDirectSound) -{ - // IUnknown methods - STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - // IDirectSound methods - STDMETHOD(CreateSoundBuffer) (THIS_ __in LPCDSBUFFERDESC pcDSBufferDesc, __out LPDIRECTSOUNDBUFFER *ppDSBuffer, __null LPUNKNOWN pUnkOuter) PURE; - STDMETHOD(GetCaps) (THIS_ __out LPDSCAPS pDSCaps) PURE; - STDMETHOD(DuplicateSoundBuffer) (THIS_ __in LPDIRECTSOUNDBUFFER pDSBufferOriginal, __out LPDIRECTSOUNDBUFFER *ppDSBufferDuplicate) PURE; - STDMETHOD(SetCooperativeLevel) (THIS_ HWND hwnd, DWORD dwLevel) PURE; - STDMETHOD(Compact) (THIS) PURE; - STDMETHOD(GetSpeakerConfig) (THIS_ __out LPDWORD pdwSpeakerConfig) PURE; - STDMETHOD(SetSpeakerConfig) (THIS_ DWORD dwSpeakerConfig) PURE; - STDMETHOD(Initialize) (THIS_ __in_opt LPCGUID pcGuidDevice) PURE; - - // IDirectSound8 methods - STDMETHOD(VerifyCertification) (THIS_ __in __out LPDWORD pdwCertified) PURE; -}; - -#define IDirectSound8_QueryInterface(p,a,b) IDirectSound_QueryInterface(p,a,b) -#define IDirectSound8_AddRef(p) IDirectSound_AddRef(p) -#define IDirectSound8_Release(p) IDirectSound_Release(p) -#define IDirectSound8_CreateSoundBuffer(p,a,b,c) IDirectSound_CreateSoundBuffer(p,a,b,c) -#define IDirectSound8_GetCaps(p,a) IDirectSound_GetCaps(p,a) -#define IDirectSound8_DuplicateSoundBuffer(p,a,b) IDirectSound_DuplicateSoundBuffer(p,a,b) -#define IDirectSound8_SetCooperativeLevel(p,a,b) IDirectSound_SetCooperativeLevel(p,a,b) -#define IDirectSound8_Compact(p) IDirectSound_Compact(p) -#define IDirectSound8_GetSpeakerConfig(p,a) IDirectSound_GetSpeakerConfig(p,a) -#define IDirectSound8_SetSpeakerConfig(p,a) IDirectSound_SetSpeakerConfig(p,a) -#define IDirectSound8_Initialize(p,a) IDirectSound_Initialize(p,a) - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectSound8_VerifyCertification(p,a) (p)->lpVtbl->VerifyCertification(p,a) -#else // !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectSound8_VerifyCertification(p,a) (p)->VerifyCertification(a) -#endif // !defined(__cplusplus) || defined(CINTERFACE) - -#endif // DIRECTSOUND_VERSION >= 0x0800 - -// -// IDirectSoundBuffer -// - -DEFINE_GUID(IID_IDirectSoundBuffer, 0x279AFA85, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60); - -#undef INTERFACE -#define INTERFACE IDirectSoundBuffer - -DECLARE_INTERFACE_(IDirectSoundBuffer, IUnknown) -{ - // IUnknown methods - STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - // IDirectSoundBuffer methods - STDMETHOD(GetCaps) (THIS_ __out LPDSBCAPS pDSBufferCaps) PURE; - STDMETHOD(GetCurrentPosition) (THIS_ __out_opt LPDWORD pdwCurrentPlayCursor, __out_opt LPDWORD pdwCurrentWriteCursor) PURE; - STDMETHOD(GetFormat) (THIS_ __out_bcount_opt(dwSizeAllocated) LPWAVEFORMATEX pwfxFormat, DWORD dwSizeAllocated, __out_opt LPDWORD pdwSizeWritten) PURE; - STDMETHOD(GetVolume) (THIS_ __out LPLONG plVolume) PURE; - STDMETHOD(GetPan) (THIS_ __out LPLONG plPan) PURE; - STDMETHOD(GetFrequency) (THIS_ __out LPDWORD pdwFrequency) PURE; - STDMETHOD(GetStatus) (THIS_ __out LPDWORD pdwStatus) PURE; - STDMETHOD(Initialize) (THIS_ __in LPDIRECTSOUND pDirectSound, __in LPCDSBUFFERDESC pcDSBufferDesc) PURE; - STDMETHOD(Lock) (THIS_ DWORD dwOffset, DWORD dwBytes, - __deref_out_bcount(*pdwAudioBytes1) LPVOID *ppvAudioPtr1, __out LPDWORD pdwAudioBytes1, - __deref_opt_out_bcount(*pdwAudioBytes2) LPVOID *ppvAudioPtr2, __out_opt LPDWORD pdwAudioBytes2, DWORD dwFlags) PURE; - STDMETHOD(Play) (THIS_ DWORD dwReserved1, DWORD dwPriority, DWORD dwFlags) PURE; - STDMETHOD(SetCurrentPosition) (THIS_ DWORD dwNewPosition) PURE; - STDMETHOD(SetFormat) (THIS_ __in LPCWAVEFORMATEX pcfxFormat) PURE; - STDMETHOD(SetVolume) (THIS_ LONG lVolume) PURE; - STDMETHOD(SetPan) (THIS_ LONG lPan) PURE; - STDMETHOD(SetFrequency) (THIS_ DWORD dwFrequency) PURE; - STDMETHOD(Stop) (THIS) PURE; - STDMETHOD(Unlock) (THIS_ __in_bcount(dwAudioBytes1) LPVOID pvAudioPtr1, DWORD dwAudioBytes1, - __in_bcount_opt(dwAudioBytes2) LPVOID pvAudioPtr2, DWORD dwAudioBytes2) PURE; - STDMETHOD(Restore) (THIS) PURE; -}; - -#define IDirectSoundBuffer_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) -#define IDirectSoundBuffer_AddRef(p) IUnknown_AddRef(p) -#define IDirectSoundBuffer_Release(p) IUnknown_Release(p) - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectSoundBuffer_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a) -#define IDirectSoundBuffer_GetCurrentPosition(p,a,b) (p)->lpVtbl->GetCurrentPosition(p,a,b) -#define IDirectSoundBuffer_GetFormat(p,a,b,c) (p)->lpVtbl->GetFormat(p,a,b,c) -#define IDirectSoundBuffer_GetVolume(p,a) (p)->lpVtbl->GetVolume(p,a) -#define IDirectSoundBuffer_GetPan(p,a) (p)->lpVtbl->GetPan(p,a) -#define IDirectSoundBuffer_GetFrequency(p,a) (p)->lpVtbl->GetFrequency(p,a) -#define IDirectSoundBuffer_GetStatus(p,a) (p)->lpVtbl->GetStatus(p,a) -#define IDirectSoundBuffer_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b) -#define IDirectSoundBuffer_Lock(p,a,b,c,d,e,f,g) (p)->lpVtbl->Lock(p,a,b,c,d,e,f,g) -#define IDirectSoundBuffer_Play(p,a,b,c) (p)->lpVtbl->Play(p,a,b,c) -#define IDirectSoundBuffer_SetCurrentPosition(p,a) (p)->lpVtbl->SetCurrentPosition(p,a) -#define IDirectSoundBuffer_SetFormat(p,a) (p)->lpVtbl->SetFormat(p,a) -#define IDirectSoundBuffer_SetVolume(p,a) (p)->lpVtbl->SetVolume(p,a) -#define IDirectSoundBuffer_SetPan(p,a) (p)->lpVtbl->SetPan(p,a) -#define IDirectSoundBuffer_SetFrequency(p,a) (p)->lpVtbl->SetFrequency(p,a) -#define IDirectSoundBuffer_Stop(p) (p)->lpVtbl->Stop(p) -#define IDirectSoundBuffer_Unlock(p,a,b,c,d) (p)->lpVtbl->Unlock(p,a,b,c,d) -#define IDirectSoundBuffer_Restore(p) (p)->lpVtbl->Restore(p) -#else // !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectSoundBuffer_GetCaps(p,a) (p)->GetCaps(a) -#define IDirectSoundBuffer_GetCurrentPosition(p,a,b) (p)->GetCurrentPosition(a,b) -#define IDirectSoundBuffer_GetFormat(p,a,b,c) (p)->GetFormat(a,b,c) -#define IDirectSoundBuffer_GetVolume(p,a) (p)->GetVolume(a) -#define IDirectSoundBuffer_GetPan(p,a) (p)->GetPan(a) -#define IDirectSoundBuffer_GetFrequency(p,a) (p)->GetFrequency(a) -#define IDirectSoundBuffer_GetStatus(p,a) (p)->GetStatus(a) -#define IDirectSoundBuffer_Initialize(p,a,b) (p)->Initialize(a,b) -#define IDirectSoundBuffer_Lock(p,a,b,c,d,e,f,g) (p)->Lock(a,b,c,d,e,f,g) -#define IDirectSoundBuffer_Play(p,a,b,c) (p)->Play(a,b,c) -#define IDirectSoundBuffer_SetCurrentPosition(p,a) (p)->SetCurrentPosition(a) -#define IDirectSoundBuffer_SetFormat(p,a) (p)->SetFormat(a) -#define IDirectSoundBuffer_SetVolume(p,a) (p)->SetVolume(a) -#define IDirectSoundBuffer_SetPan(p,a) (p)->SetPan(a) -#define IDirectSoundBuffer_SetFrequency(p,a) (p)->SetFrequency(a) -#define IDirectSoundBuffer_Stop(p) (p)->Stop() -#define IDirectSoundBuffer_Unlock(p,a,b,c,d) (p)->Unlock(a,b,c,d) -#define IDirectSoundBuffer_Restore(p) (p)->Restore() -#endif // !defined(__cplusplus) || defined(CINTERFACE) - -#if DIRECTSOUND_VERSION >= 0x0800 - -// -// IDirectSoundBuffer8 -// - -DEFINE_GUID(IID_IDirectSoundBuffer8, 0x6825a449, 0x7524, 0x4d82, 0x92, 0x0f, 0x50, 0xe3, 0x6a, 0xb3, 0xab, 0x1e); - -#undef INTERFACE -#define INTERFACE IDirectSoundBuffer8 - -DECLARE_INTERFACE_(IDirectSoundBuffer8, IDirectSoundBuffer) -{ - // IUnknown methods - STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - // IDirectSoundBuffer methods - STDMETHOD(GetCaps) (THIS_ __out LPDSBCAPS pDSBufferCaps) PURE; - STDMETHOD(GetCurrentPosition) (THIS_ __out_opt LPDWORD pdwCurrentPlayCursor, __out_opt LPDWORD pdwCurrentWriteCursor) PURE; - STDMETHOD(GetFormat) (THIS_ __out_bcount_opt(dwSizeAllocated) LPWAVEFORMATEX pwfxFormat, DWORD dwSizeAllocated, __out_opt LPDWORD pdwSizeWritten) PURE; - STDMETHOD(GetVolume) (THIS_ __out LPLONG plVolume) PURE; - STDMETHOD(GetPan) (THIS_ __out LPLONG plPan) PURE; - STDMETHOD(GetFrequency) (THIS_ __out LPDWORD pdwFrequency) PURE; - STDMETHOD(GetStatus) (THIS_ __out LPDWORD pdwStatus) PURE; - STDMETHOD(Initialize) (THIS_ __in LPDIRECTSOUND pDirectSound, __in LPCDSBUFFERDESC pcDSBufferDesc) PURE; - STDMETHOD(Lock) (THIS_ DWORD dwOffset, DWORD dwBytes, - __deref_out_bcount(*pdwAudioBytes1) LPVOID *ppvAudioPtr1, __out LPDWORD pdwAudioBytes1, - __deref_opt_out_bcount(*pdwAudioBytes2) LPVOID *ppvAudioPtr2, __out_opt LPDWORD pdwAudioBytes2, DWORD dwFlags) PURE; - STDMETHOD(Play) (THIS_ DWORD dwReserved1, DWORD dwPriority, DWORD dwFlags) PURE; - STDMETHOD(SetCurrentPosition) (THIS_ DWORD dwNewPosition) PURE; - STDMETHOD(SetFormat) (THIS_ __in LPCWAVEFORMATEX pcfxFormat) PURE; - STDMETHOD(SetVolume) (THIS_ LONG lVolume) PURE; - STDMETHOD(SetPan) (THIS_ LONG lPan) PURE; - STDMETHOD(SetFrequency) (THIS_ DWORD dwFrequency) PURE; - STDMETHOD(Stop) (THIS) PURE; - STDMETHOD(Unlock) (THIS_ __in_bcount(dwAudioBytes1) LPVOID pvAudioPtr1, DWORD dwAudioBytes1, - __in_bcount_opt(dwAudioBytes2) LPVOID pvAudioPtr2, DWORD dwAudioBytes2) PURE; - STDMETHOD(Restore) (THIS) PURE; - - // IDirectSoundBuffer8 methods - STDMETHOD(SetFX) (THIS_ DWORD dwEffectsCount, __in_ecount_opt(dwEffectsCount) LPDSEFFECTDESC pDSFXDesc, __out_ecount_opt(dwEffectsCount) LPDWORD pdwResultCodes) PURE; - STDMETHOD(AcquireResources) (THIS_ DWORD dwFlags, DWORD dwEffectsCount, __out_ecount(dwEffectsCount) LPDWORD pdwResultCodes) PURE; - STDMETHOD(GetObjectInPath) (THIS_ __in REFGUID rguidObject, DWORD dwIndex, __in REFGUID rguidInterface, __deref_out LPVOID *ppObject) PURE; -}; - -// Special GUID meaning "select all objects" for use in GetObjectInPath() -DEFINE_GUID(GUID_All_Objects, 0xaa114de5, 0xc262, 0x4169, 0xa1, 0xc8, 0x23, 0xd6, 0x98, 0xcc, 0x73, 0xb5); - -#define IDirectSoundBuffer8_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) -#define IDirectSoundBuffer8_AddRef(p) IUnknown_AddRef(p) -#define IDirectSoundBuffer8_Release(p) IUnknown_Release(p) - -#define IDirectSoundBuffer8_GetCaps(p,a) IDirectSoundBuffer_GetCaps(p,a) -#define IDirectSoundBuffer8_GetCurrentPosition(p,a,b) IDirectSoundBuffer_GetCurrentPosition(p,a,b) -#define IDirectSoundBuffer8_GetFormat(p,a,b,c) IDirectSoundBuffer_GetFormat(p,a,b,c) -#define IDirectSoundBuffer8_GetVolume(p,a) IDirectSoundBuffer_GetVolume(p,a) -#define IDirectSoundBuffer8_GetPan(p,a) IDirectSoundBuffer_GetPan(p,a) -#define IDirectSoundBuffer8_GetFrequency(p,a) IDirectSoundBuffer_GetFrequency(p,a) -#define IDirectSoundBuffer8_GetStatus(p,a) IDirectSoundBuffer_GetStatus(p,a) -#define IDirectSoundBuffer8_Initialize(p,a,b) IDirectSoundBuffer_Initialize(p,a,b) -#define IDirectSoundBuffer8_Lock(p,a,b,c,d,e,f,g) IDirectSoundBuffer_Lock(p,a,b,c,d,e,f,g) -#define IDirectSoundBuffer8_Play(p,a,b,c) IDirectSoundBuffer_Play(p,a,b,c) -#define IDirectSoundBuffer8_SetCurrentPosition(p,a) IDirectSoundBuffer_SetCurrentPosition(p,a) -#define IDirectSoundBuffer8_SetFormat(p,a) IDirectSoundBuffer_SetFormat(p,a) -#define IDirectSoundBuffer8_SetVolume(p,a) IDirectSoundBuffer_SetVolume(p,a) -#define IDirectSoundBuffer8_SetPan(p,a) IDirectSoundBuffer_SetPan(p,a) -#define IDirectSoundBuffer8_SetFrequency(p,a) IDirectSoundBuffer_SetFrequency(p,a) -#define IDirectSoundBuffer8_Stop(p) IDirectSoundBuffer_Stop(p) -#define IDirectSoundBuffer8_Unlock(p,a,b,c,d) IDirectSoundBuffer_Unlock(p,a,b,c,d) -#define IDirectSoundBuffer8_Restore(p) IDirectSoundBuffer_Restore(p) - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectSoundBuffer8_SetFX(p,a,b,c) (p)->lpVtbl->SetFX(p,a,b,c) -#define IDirectSoundBuffer8_AcquireResources(p,a,b,c) (p)->lpVtbl->AcquireResources(p,a,b,c) -#define IDirectSoundBuffer8_GetObjectInPath(p,a,b,c,d) (p)->lpVtbl->GetObjectInPath(p,a,b,c,d) -#else // !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectSoundBuffer8_SetFX(p,a,b,c) (p)->SetFX(a,b,c) -#define IDirectSoundBuffer8_AcquireResources(p,a,b,c) (p)->AcquireResources(a,b,c) -#define IDirectSoundBuffer8_GetObjectInPath(p,a,b,c,d) (p)->GetObjectInPath(a,b,c,d) -#endif // !defined(__cplusplus) || defined(CINTERFACE) - -#endif // DIRECTSOUND_VERSION >= 0x0800 - -// -// IDirectSound3DListener -// - -DEFINE_GUID(IID_IDirectSound3DListener, 0x279AFA84, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60); - -#undef INTERFACE -#define INTERFACE IDirectSound3DListener - -DECLARE_INTERFACE_(IDirectSound3DListener, IUnknown) -{ - // IUnknown methods - STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - // IDirectSound3DListener methods - STDMETHOD(GetAllParameters) (THIS_ __out LPDS3DLISTENER pListener) PURE; - STDMETHOD(GetDistanceFactor) (THIS_ __out D3DVALUE* pflDistanceFactor) PURE; - STDMETHOD(GetDopplerFactor) (THIS_ __out D3DVALUE* pflDopplerFactor) PURE; - STDMETHOD(GetOrientation) (THIS_ __out D3DVECTOR* pvOrientFront, __out D3DVECTOR* pvOrientTop) PURE; - STDMETHOD(GetPosition) (THIS_ __out D3DVECTOR* pvPosition) PURE; - STDMETHOD(GetRolloffFactor) (THIS_ __out D3DVALUE* pflRolloffFactor) PURE; - STDMETHOD(GetVelocity) (THIS_ __out D3DVECTOR* pvVelocity) PURE; - STDMETHOD(SetAllParameters) (THIS_ __in LPCDS3DLISTENER pcListener, DWORD dwApply) PURE; - STDMETHOD(SetDistanceFactor) (THIS_ D3DVALUE flDistanceFactor, DWORD dwApply) PURE; - STDMETHOD(SetDopplerFactor) (THIS_ D3DVALUE flDopplerFactor, DWORD dwApply) PURE; - STDMETHOD(SetOrientation) (THIS_ D3DVALUE xFront, D3DVALUE yFront, D3DVALUE zFront, - D3DVALUE xTop, D3DVALUE yTop, D3DVALUE zTop, DWORD dwApply) PURE; - STDMETHOD(SetPosition) (THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) PURE; - STDMETHOD(SetRolloffFactor) (THIS_ D3DVALUE flRolloffFactor, DWORD dwApply) PURE; - STDMETHOD(SetVelocity) (THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) PURE; - STDMETHOD(CommitDeferredSettings) (THIS) PURE; -}; - -#define IDirectSound3DListener_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) -#define IDirectSound3DListener_AddRef(p) IUnknown_AddRef(p) -#define IDirectSound3DListener_Release(p) IUnknown_Release(p) - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectSound3DListener_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a) -#define IDirectSound3DListener_GetDistanceFactor(p,a) (p)->lpVtbl->GetDistanceFactor(p,a) -#define IDirectSound3DListener_GetDopplerFactor(p,a) (p)->lpVtbl->GetDopplerFactor(p,a) -#define IDirectSound3DListener_GetOrientation(p,a,b) (p)->lpVtbl->GetOrientation(p,a,b) -#define IDirectSound3DListener_GetPosition(p,a) (p)->lpVtbl->GetPosition(p,a) -#define IDirectSound3DListener_GetRolloffFactor(p,a) (p)->lpVtbl->GetRolloffFactor(p,a) -#define IDirectSound3DListener_GetVelocity(p,a) (p)->lpVtbl->GetVelocity(p,a) -#define IDirectSound3DListener_SetAllParameters(p,a,b) (p)->lpVtbl->SetAllParameters(p,a,b) -#define IDirectSound3DListener_SetDistanceFactor(p,a,b) (p)->lpVtbl->SetDistanceFactor(p,a,b) -#define IDirectSound3DListener_SetDopplerFactor(p,a,b) (p)->lpVtbl->SetDopplerFactor(p,a,b) -#define IDirectSound3DListener_SetOrientation(p,a,b,c,d,e,f,g) (p)->lpVtbl->SetOrientation(p,a,b,c,d,e,f,g) -#define IDirectSound3DListener_SetPosition(p,a,b,c,d) (p)->lpVtbl->SetPosition(p,a,b,c,d) -#define IDirectSound3DListener_SetRolloffFactor(p,a,b) (p)->lpVtbl->SetRolloffFactor(p,a,b) -#define IDirectSound3DListener_SetVelocity(p,a,b,c,d) (p)->lpVtbl->SetVelocity(p,a,b,c,d) -#define IDirectSound3DListener_CommitDeferredSettings(p) (p)->lpVtbl->CommitDeferredSettings(p) -#else // !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectSound3DListener_GetAllParameters(p,a) (p)->GetAllParameters(a) -#define IDirectSound3DListener_GetDistanceFactor(p,a) (p)->GetDistanceFactor(a) -#define IDirectSound3DListener_GetDopplerFactor(p,a) (p)->GetDopplerFactor(a) -#define IDirectSound3DListener_GetOrientation(p,a,b) (p)->GetOrientation(a,b) -#define IDirectSound3DListener_GetPosition(p,a) (p)->GetPosition(a) -#define IDirectSound3DListener_GetRolloffFactor(p,a) (p)->GetRolloffFactor(a) -#define IDirectSound3DListener_GetVelocity(p,a) (p)->GetVelocity(a) -#define IDirectSound3DListener_SetAllParameters(p,a,b) (p)->SetAllParameters(a,b) -#define IDirectSound3DListener_SetDistanceFactor(p,a,b) (p)->SetDistanceFactor(a,b) -#define IDirectSound3DListener_SetDopplerFactor(p,a,b) (p)->SetDopplerFactor(a,b) -#define IDirectSound3DListener_SetOrientation(p,a,b,c,d,e,f,g) (p)->SetOrientation(a,b,c,d,e,f,g) -#define IDirectSound3DListener_SetPosition(p,a,b,c,d) (p)->SetPosition(a,b,c,d) -#define IDirectSound3DListener_SetRolloffFactor(p,a,b) (p)->SetRolloffFactor(a,b) -#define IDirectSound3DListener_SetVelocity(p,a,b,c,d) (p)->SetVelocity(a,b,c,d) -#define IDirectSound3DListener_CommitDeferredSettings(p) (p)->CommitDeferredSettings() -#endif // !defined(__cplusplus) || defined(CINTERFACE) - -// -// IDirectSound3DBuffer -// - -DEFINE_GUID(IID_IDirectSound3DBuffer, 0x279AFA86, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60); - -#undef INTERFACE -#define INTERFACE IDirectSound3DBuffer - -DECLARE_INTERFACE_(IDirectSound3DBuffer, IUnknown) -{ - // IUnknown methods - STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - // IDirectSound3DBuffer methods - STDMETHOD(GetAllParameters) (THIS_ __out LPDS3DBUFFER pDs3dBuffer) PURE; - STDMETHOD(GetConeAngles) (THIS_ __out LPDWORD pdwInsideConeAngle, __out LPDWORD pdwOutsideConeAngle) PURE; - STDMETHOD(GetConeOrientation) (THIS_ __out D3DVECTOR* pvOrientation) PURE; - STDMETHOD(GetConeOutsideVolume) (THIS_ __out LPLONG plConeOutsideVolume) PURE; - STDMETHOD(GetMaxDistance) (THIS_ __out D3DVALUE* pflMaxDistance) PURE; - STDMETHOD(GetMinDistance) (THIS_ __out D3DVALUE* pflMinDistance) PURE; - STDMETHOD(GetMode) (THIS_ __out LPDWORD pdwMode) PURE; - STDMETHOD(GetPosition) (THIS_ __out D3DVECTOR* pvPosition) PURE; - STDMETHOD(GetVelocity) (THIS_ __out D3DVECTOR* pvVelocity) PURE; - STDMETHOD(SetAllParameters) (THIS_ __in LPCDS3DBUFFER pcDs3dBuffer, DWORD dwApply) PURE; - STDMETHOD(SetConeAngles) (THIS_ DWORD dwInsideConeAngle, DWORD dwOutsideConeAngle, DWORD dwApply) PURE; - STDMETHOD(SetConeOrientation) (THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) PURE; - STDMETHOD(SetConeOutsideVolume) (THIS_ LONG lConeOutsideVolume, DWORD dwApply) PURE; - STDMETHOD(SetMaxDistance) (THIS_ D3DVALUE flMaxDistance, DWORD dwApply) PURE; - STDMETHOD(SetMinDistance) (THIS_ D3DVALUE flMinDistance, DWORD dwApply) PURE; - STDMETHOD(SetMode) (THIS_ DWORD dwMode, DWORD dwApply) PURE; - STDMETHOD(SetPosition) (THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) PURE; - STDMETHOD(SetVelocity) (THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) PURE; -}; - -#define IDirectSound3DBuffer_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) -#define IDirectSound3DBuffer_AddRef(p) IUnknown_AddRef(p) -#define IDirectSound3DBuffer_Release(p) IUnknown_Release(p) - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectSound3DBuffer_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a) -#define IDirectSound3DBuffer_GetConeAngles(p,a,b) (p)->lpVtbl->GetConeAngles(p,a,b) -#define IDirectSound3DBuffer_GetConeOrientation(p,a) (p)->lpVtbl->GetConeOrientation(p,a) -#define IDirectSound3DBuffer_GetConeOutsideVolume(p,a) (p)->lpVtbl->GetConeOutsideVolume(p,a) -#define IDirectSound3DBuffer_GetPosition(p,a) (p)->lpVtbl->GetPosition(p,a) -#define IDirectSound3DBuffer_GetMinDistance(p,a) (p)->lpVtbl->GetMinDistance(p,a) -#define IDirectSound3DBuffer_GetMaxDistance(p,a) (p)->lpVtbl->GetMaxDistance(p,a) -#define IDirectSound3DBuffer_GetMode(p,a) (p)->lpVtbl->GetMode(p,a) -#define IDirectSound3DBuffer_GetVelocity(p,a) (p)->lpVtbl->GetVelocity(p,a) -#define IDirectSound3DBuffer_SetAllParameters(p,a,b) (p)->lpVtbl->SetAllParameters(p,a,b) -#define IDirectSound3DBuffer_SetConeAngles(p,a,b,c) (p)->lpVtbl->SetConeAngles(p,a,b,c) -#define IDirectSound3DBuffer_SetConeOrientation(p,a,b,c,d) (p)->lpVtbl->SetConeOrientation(p,a,b,c,d) -#define IDirectSound3DBuffer_SetConeOutsideVolume(p,a,b) (p)->lpVtbl->SetConeOutsideVolume(p,a,b) -#define IDirectSound3DBuffer_SetPosition(p,a,b,c,d) (p)->lpVtbl->SetPosition(p,a,b,c,d) -#define IDirectSound3DBuffer_SetMinDistance(p,a,b) (p)->lpVtbl->SetMinDistance(p,a,b) -#define IDirectSound3DBuffer_SetMaxDistance(p,a,b) (p)->lpVtbl->SetMaxDistance(p,a,b) -#define IDirectSound3DBuffer_SetMode(p,a,b) (p)->lpVtbl->SetMode(p,a,b) -#define IDirectSound3DBuffer_SetVelocity(p,a,b,c,d) (p)->lpVtbl->SetVelocity(p,a,b,c,d) -#else // !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectSound3DBuffer_GetAllParameters(p,a) (p)->GetAllParameters(a) -#define IDirectSound3DBuffer_GetConeAngles(p,a,b) (p)->GetConeAngles(a,b) -#define IDirectSound3DBuffer_GetConeOrientation(p,a) (p)->GetConeOrientation(a) -#define IDirectSound3DBuffer_GetConeOutsideVolume(p,a) (p)->GetConeOutsideVolume(a) -#define IDirectSound3DBuffer_GetPosition(p,a) (p)->GetPosition(a) -#define IDirectSound3DBuffer_GetMinDistance(p,a) (p)->GetMinDistance(a) -#define IDirectSound3DBuffer_GetMaxDistance(p,a) (p)->GetMaxDistance(a) -#define IDirectSound3DBuffer_GetMode(p,a) (p)->GetMode(a) -#define IDirectSound3DBuffer_GetVelocity(p,a) (p)->GetVelocity(a) -#define IDirectSound3DBuffer_SetAllParameters(p,a,b) (p)->SetAllParameters(a,b) -#define IDirectSound3DBuffer_SetConeAngles(p,a,b,c) (p)->SetConeAngles(a,b,c) -#define IDirectSound3DBuffer_SetConeOrientation(p,a,b,c,d) (p)->SetConeOrientation(a,b,c,d) -#define IDirectSound3DBuffer_SetConeOutsideVolume(p,a,b) (p)->SetConeOutsideVolume(a,b) -#define IDirectSound3DBuffer_SetPosition(p,a,b,c,d) (p)->SetPosition(a,b,c,d) -#define IDirectSound3DBuffer_SetMinDistance(p,a,b) (p)->SetMinDistance(a,b) -#define IDirectSound3DBuffer_SetMaxDistance(p,a,b) (p)->SetMaxDistance(a,b) -#define IDirectSound3DBuffer_SetMode(p,a,b) (p)->SetMode(a,b) -#define IDirectSound3DBuffer_SetVelocity(p,a,b,c,d) (p)->SetVelocity(a,b,c,d) -#endif // !defined(__cplusplus) || defined(CINTERFACE) - -// -// IDirectSoundCapture -// - -DEFINE_GUID(IID_IDirectSoundCapture, 0xb0210781, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16); - -#undef INTERFACE -#define INTERFACE IDirectSoundCapture - -DECLARE_INTERFACE_(IDirectSoundCapture, IUnknown) -{ - // IUnknown methods - STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - // IDirectSoundCapture methods - STDMETHOD(CreateCaptureBuffer) (THIS_ __in LPCDSCBUFFERDESC pcDSCBufferDesc, __deref_out LPDIRECTSOUNDCAPTUREBUFFER *ppDSCBuffer, __null LPUNKNOWN pUnkOuter) PURE; - STDMETHOD(GetCaps) (THIS_ __out LPDSCCAPS pDSCCaps) PURE; - STDMETHOD(Initialize) (THIS_ __in_opt LPCGUID pcGuidDevice) PURE; -}; - -#define IDirectSoundCapture_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) -#define IDirectSoundCapture_AddRef(p) IUnknown_AddRef(p) -#define IDirectSoundCapture_Release(p) IUnknown_Release(p) - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectSoundCapture_CreateCaptureBuffer(p,a,b,c) (p)->lpVtbl->CreateCaptureBuffer(p,a,b,c) -#define IDirectSoundCapture_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a) -#define IDirectSoundCapture_Initialize(p,a) (p)->lpVtbl->Initialize(p,a) -#else // !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectSoundCapture_CreateCaptureBuffer(p,a,b,c) (p)->CreateCaptureBuffer(a,b,c) -#define IDirectSoundCapture_GetCaps(p,a) (p)->GetCaps(a) -#define IDirectSoundCapture_Initialize(p,a) (p)->Initialize(a) -#endif // !defined(__cplusplus) || defined(CINTERFACE) - -// -// IDirectSoundCaptureBuffer -// - -DEFINE_GUID(IID_IDirectSoundCaptureBuffer, 0xb0210782, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16); - -#undef INTERFACE -#define INTERFACE IDirectSoundCaptureBuffer - -DECLARE_INTERFACE_(IDirectSoundCaptureBuffer, IUnknown) -{ - // IUnknown methods - STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - // IDirectSoundCaptureBuffer methods - STDMETHOD(GetCaps) (THIS_ __out LPDSCBCAPS pDSCBCaps) PURE; - STDMETHOD(GetCurrentPosition) (THIS_ __out_opt LPDWORD pdwCapturePosition, __out_opt LPDWORD pdwReadPosition) PURE; - STDMETHOD(GetFormat) (THIS_ __out_bcount_opt(dwSizeAllocated) LPWAVEFORMATEX pwfxFormat, DWORD dwSizeAllocated, __out_opt LPDWORD pdwSizeWritten) PURE; - STDMETHOD(GetStatus) (THIS_ __out LPDWORD pdwStatus) PURE; - STDMETHOD(Initialize) (THIS_ __in LPDIRECTSOUNDCAPTURE pDirectSoundCapture, __in LPCDSCBUFFERDESC pcDSCBufferDesc) PURE; - STDMETHOD(Lock) (THIS_ DWORD dwOffset, DWORD dwBytes, - __deref_out_bcount(*pdwAudioBytes1) LPVOID *ppvAudioPtr1, __out LPDWORD pdwAudioBytes1, - __deref_opt_out_bcount(*pdwAudioBytes2) LPVOID *ppvAudioPtr2, __out_opt LPDWORD pdwAudioBytes2, DWORD dwFlags) PURE; - STDMETHOD(Start) (THIS_ DWORD dwFlags) PURE; - STDMETHOD(Stop) (THIS) PURE; - STDMETHOD(Unlock) (THIS_ __in_bcount(dwAudioBytes1) LPVOID pvAudioPtr1, DWORD dwAudioBytes1, - __in_bcount_opt(dwAudioBytes2) LPVOID pvAudioPtr2, DWORD dwAudioBytes2) PURE; -}; - -#define IDirectSoundCaptureBuffer_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) -#define IDirectSoundCaptureBuffer_AddRef(p) IUnknown_AddRef(p) -#define IDirectSoundCaptureBuffer_Release(p) IUnknown_Release(p) - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectSoundCaptureBuffer_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a) -#define IDirectSoundCaptureBuffer_GetCurrentPosition(p,a,b) (p)->lpVtbl->GetCurrentPosition(p,a,b) -#define IDirectSoundCaptureBuffer_GetFormat(p,a,b,c) (p)->lpVtbl->GetFormat(p,a,b,c) -#define IDirectSoundCaptureBuffer_GetStatus(p,a) (p)->lpVtbl->GetStatus(p,a) -#define IDirectSoundCaptureBuffer_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b) -#define IDirectSoundCaptureBuffer_Lock(p,a,b,c,d,e,f,g) (p)->lpVtbl->Lock(p,a,b,c,d,e,f,g) -#define IDirectSoundCaptureBuffer_Start(p,a) (p)->lpVtbl->Start(p,a) -#define IDirectSoundCaptureBuffer_Stop(p) (p)->lpVtbl->Stop(p) -#define IDirectSoundCaptureBuffer_Unlock(p,a,b,c,d) (p)->lpVtbl->Unlock(p,a,b,c,d) -#else // !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectSoundCaptureBuffer_GetCaps(p,a) (p)->GetCaps(a) -#define IDirectSoundCaptureBuffer_GetCurrentPosition(p,a,b) (p)->GetCurrentPosition(a,b) -#define IDirectSoundCaptureBuffer_GetFormat(p,a,b,c) (p)->GetFormat(a,b,c) -#define IDirectSoundCaptureBuffer_GetStatus(p,a) (p)->GetStatus(a) -#define IDirectSoundCaptureBuffer_Initialize(p,a,b) (p)->Initialize(a,b) -#define IDirectSoundCaptureBuffer_Lock(p,a,b,c,d,e,f,g) (p)->Lock(a,b,c,d,e,f,g) -#define IDirectSoundCaptureBuffer_Start(p,a) (p)->Start(a) -#define IDirectSoundCaptureBuffer_Stop(p) (p)->Stop() -#define IDirectSoundCaptureBuffer_Unlock(p,a,b,c,d) (p)->Unlock(a,b,c,d) -#endif // !defined(__cplusplus) || defined(CINTERFACE) - -#if DIRECTSOUND_VERSION >= 0x0800 - -// -// IDirectSoundCaptureBuffer8 -// - -DEFINE_GUID(IID_IDirectSoundCaptureBuffer8, 0x990df4, 0xdbb, 0x4872, 0x83, 0x3e, 0x6d, 0x30, 0x3e, 0x80, 0xae, 0xb6); - -#undef INTERFACE -#define INTERFACE IDirectSoundCaptureBuffer8 - -DECLARE_INTERFACE_(IDirectSoundCaptureBuffer8, IDirectSoundCaptureBuffer) -{ - // IUnknown methods - STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - // IDirectSoundCaptureBuffer methods - STDMETHOD(GetCaps) (THIS_ __out LPDSCBCAPS pDSCBCaps) PURE; - STDMETHOD(GetCurrentPosition) (THIS_ __out_opt LPDWORD pdwCapturePosition, __out_opt LPDWORD pdwReadPosition) PURE; - STDMETHOD(GetFormat) (THIS_ __out_bcount_opt(dwSizeAllocated) LPWAVEFORMATEX pwfxFormat, DWORD dwSizeAllocated, __out_opt LPDWORD pdwSizeWritten) PURE; - STDMETHOD(GetStatus) (THIS_ __out LPDWORD pdwStatus) PURE; - STDMETHOD(Initialize) (THIS_ __in LPDIRECTSOUNDCAPTURE pDirectSoundCapture, __in LPCDSCBUFFERDESC pcDSCBufferDesc) PURE; - STDMETHOD(Lock) (THIS_ DWORD dwOffset, DWORD dwBytes, - __deref_out_bcount(*pdwAudioBytes1) LPVOID *ppvAudioPtr1, __out LPDWORD pdwAudioBytes1, - __deref_opt_out_bcount(*pdwAudioBytes2) LPVOID *ppvAudioPtr2, __out_opt LPDWORD pdwAudioBytes2, DWORD dwFlags) PURE; - STDMETHOD(Start) (THIS_ DWORD dwFlags) PURE; - STDMETHOD(Stop) (THIS) PURE; - STDMETHOD(Unlock) (THIS_ __in_bcount(dwAudioBytes1) LPVOID pvAudioPtr1, DWORD dwAudioBytes1, - __in_bcount_opt(dwAudioBytes2) LPVOID pvAudioPtr2, DWORD dwAudioBytes2) PURE; - - // IDirectSoundCaptureBuffer8 methods - STDMETHOD(GetObjectInPath) (THIS_ __in REFGUID rguidObject, DWORD dwIndex, __in REFGUID rguidInterface, __deref_out LPVOID *ppObject) PURE; - STDMETHOD(GetFXStatus) (DWORD dwEffectsCount, __out_ecount(dwEffectsCount) LPDWORD pdwFXStatus) PURE; -}; - -#define IDirectSoundCaptureBuffer8_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) -#define IDirectSoundCaptureBuffer8_AddRef(p) IUnknown_AddRef(p) -#define IDirectSoundCaptureBuffer8_Release(p) IUnknown_Release(p) - -#define IDirectSoundCaptureBuffer8_GetCaps(p,a) IDirectSoundCaptureBuffer_GetCaps(p,a) -#define IDirectSoundCaptureBuffer8_GetCurrentPosition(p,a,b) IDirectSoundCaptureBuffer_GetCurrentPosition(p,a,b) -#define IDirectSoundCaptureBuffer8_GetFormat(p,a,b,c) IDirectSoundCaptureBuffer_GetFormat(p,a,b,c) -#define IDirectSoundCaptureBuffer8_GetStatus(p,a) IDirectSoundCaptureBuffer_GetStatus(p,a) -#define IDirectSoundCaptureBuffer8_Initialize(p,a,b) IDirectSoundCaptureBuffer_Initialize(p,a,b) -#define IDirectSoundCaptureBuffer8_Lock(p,a,b,c,d,e,f,g) IDirectSoundCaptureBuffer_Lock(p,a,b,c,d,e,f,g) -#define IDirectSoundCaptureBuffer8_Start(p,a) IDirectSoundCaptureBuffer_Start(p,a) -#define IDirectSoundCaptureBuffer8_Stop(p) IDirectSoundCaptureBuffer_Stop(p)) -#define IDirectSoundCaptureBuffer8_Unlock(p,a,b,c,d) IDirectSoundCaptureBuffer_Unlock(p,a,b,c,d) - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectSoundCaptureBuffer8_GetObjectInPath(p,a,b,c,d) (p)->lpVtbl->GetObjectInPath(p,a,b,c,d) -#define IDirectSoundCaptureBuffer8_GetFXStatus(p,a,b) (p)->lpVtbl->GetFXStatus(p,a,b) -#else // !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectSoundCaptureBuffer8_GetObjectInPath(p,a,b,c,d) (p)->GetObjectInPath(a,b,c,d) -#define IDirectSoundCaptureBuffer8_GetFXStatus(p,a,b) (p)->GetFXStatus(a,b) -#endif // !defined(__cplusplus) || defined(CINTERFACE) - -#endif // DIRECTSOUND_VERSION >= 0x0800 - -// -// IDirectSoundNotify -// - -DEFINE_GUID(IID_IDirectSoundNotify, 0xb0210783, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16); - -#undef INTERFACE -#define INTERFACE IDirectSoundNotify - -DECLARE_INTERFACE_(IDirectSoundNotify, IUnknown) -{ - // IUnknown methods - STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - // IDirectSoundNotify methods - STDMETHOD(SetNotificationPositions) (THIS_ DWORD dwPositionNotifies, __in_ecount(dwPositionNotifies) LPCDSBPOSITIONNOTIFY pcPositionNotifies) PURE; -}; - -#define IDirectSoundNotify_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) -#define IDirectSoundNotify_AddRef(p) IUnknown_AddRef(p) -#define IDirectSoundNotify_Release(p) IUnknown_Release(p) - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectSoundNotify_SetNotificationPositions(p,a,b) (p)->lpVtbl->SetNotificationPositions(p,a,b) -#else // !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectSoundNotify_SetNotificationPositions(p,a,b) (p)->SetNotificationPositions(a,b) -#endif // !defined(__cplusplus) || defined(CINTERFACE) - -// -// IKsPropertySet -// - -#ifndef _IKsPropertySet_ -#define _IKsPropertySet_ - -#ifdef __cplusplus -// 'struct' not 'class' per the way DECLARE_INTERFACE_ is defined -struct IKsPropertySet; -#endif // __cplusplus - -typedef struct IKsPropertySet *LPKSPROPERTYSET; - -#define KSPROPERTY_SUPPORT_GET 0x00000001 -#define KSPROPERTY_SUPPORT_SET 0x00000002 - -DEFINE_GUID(IID_IKsPropertySet, 0x31efac30, 0x515c, 0x11d0, 0xa9, 0xaa, 0x00, 0xaa, 0x00, 0x61, 0xbe, 0x93); - -#undef INTERFACE -#define INTERFACE IKsPropertySet - -DECLARE_INTERFACE_(IKsPropertySet, IUnknown) -{ - // IUnknown methods - STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - // IKsPropertySet methods - STDMETHOD(Get) (THIS_ __in REFGUID rguidPropSet, ULONG ulId, __in_bcount(ulInstanceLength) LPVOID pInstanceData, ULONG ulInstanceLength, - __out_bcount(ulDataLength) LPVOID pPropertyData, ULONG ulDataLength, __out PULONG pulBytesReturned) PURE; - STDMETHOD(Set) (THIS_ __in REFGUID rguidPropSet, ULONG ulId, __in_bcount(ulInstanceLength) LPVOID pInstanceData, ULONG ulInstanceLength, - __in_bcount(ulDataLength) LPVOID pPropertyData, ULONG ulDataLength) PURE; - STDMETHOD(QuerySupport) (THIS_ __in REFGUID rguidPropSet, ULONG ulId, __out PULONG pulTypeSupport) PURE; -}; - -#define IKsPropertySet_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) -#define IKsPropertySet_AddRef(p) IUnknown_AddRef(p) -#define IKsPropertySet_Release(p) IUnknown_Release(p) - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IKsPropertySet_Get(p,a,b,c,d,e,f,g) (p)->lpVtbl->Get(p,a,b,c,d,e,f,g) -#define IKsPropertySet_Set(p,a,b,c,d,e,f) (p)->lpVtbl->Set(p,a,b,c,d,e,f) -#define IKsPropertySet_QuerySupport(p,a,b,c) (p)->lpVtbl->QuerySupport(p,a,b,c) -#else // !defined(__cplusplus) || defined(CINTERFACE) -#define IKsPropertySet_Get(p,a,b,c,d,e,f,g) (p)->Get(a,b,c,d,e,f,g) -#define IKsPropertySet_Set(p,a,b,c,d,e,f) (p)->Set(a,b,c,d,e,f) -#define IKsPropertySet_QuerySupport(p,a,b,c) (p)->QuerySupport(a,b,c) -#endif // !defined(__cplusplus) || defined(CINTERFACE) - -#endif // _IKsPropertySet_ - -#if DIRECTSOUND_VERSION >= 0x0800 - -// -// IDirectSoundFXGargle -// - -DEFINE_GUID(IID_IDirectSoundFXGargle, 0xd616f352, 0xd622, 0x11ce, 0xaa, 0xc5, 0x00, 0x20, 0xaf, 0x0b, 0x99, 0xa3); - -typedef struct _DSFXGargle -{ - DWORD dwRateHz; // Rate of modulation in hz - DWORD dwWaveShape; // DSFXGARGLE_WAVE_xxx -} DSFXGargle, *LPDSFXGargle; - -#define DSFXGARGLE_WAVE_TRIANGLE 0 -#define DSFXGARGLE_WAVE_SQUARE 1 - -typedef const DSFXGargle *LPCDSFXGargle; - -#define DSFXGARGLE_RATEHZ_MIN 1 -#define DSFXGARGLE_RATEHZ_MAX 1000 - -#undef INTERFACE -#define INTERFACE IDirectSoundFXGargle - -DECLARE_INTERFACE_(IDirectSoundFXGargle, IUnknown) -{ - // IUnknown methods - STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - // IDirectSoundFXGargle methods - STDMETHOD(SetAllParameters) (THIS_ __in LPCDSFXGargle pcDsFxGargle) PURE; - STDMETHOD(GetAllParameters) (THIS_ __out LPDSFXGargle pDsFxGargle) PURE; -}; - -#define IDirectSoundFXGargle_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) -#define IDirectSoundFXGargle_AddRef(p) IUnknown_AddRef(p) -#define IDirectSoundFXGargle_Release(p) IUnknown_Release(p) - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectSoundFXGargle_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a) -#define IDirectSoundFXGargle_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a) -#else // !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectSoundFXGargle_SetAllParameters(p,a) (p)->SetAllParameters(a) -#define IDirectSoundFXGargle_GetAllParameters(p,a) (p)->GetAllParameters(a) -#endif // !defined(__cplusplus) || defined(CINTERFACE) - -// -// IDirectSoundFXChorus -// - -DEFINE_GUID(IID_IDirectSoundFXChorus, 0x880842e3, 0x145f, 0x43e6, 0xa9, 0x34, 0xa7, 0x18, 0x06, 0xe5, 0x05, 0x47); - -typedef struct _DSFXChorus -{ - FLOAT fWetDryMix; - FLOAT fDepth; - FLOAT fFeedback; - FLOAT fFrequency; - LONG lWaveform; // LFO shape; DSFXCHORUS_WAVE_xxx - FLOAT fDelay; - LONG lPhase; -} DSFXChorus, *LPDSFXChorus; - -typedef const DSFXChorus *LPCDSFXChorus; - -#define DSFXCHORUS_WAVE_TRIANGLE 0 -#define DSFXCHORUS_WAVE_SIN 1 - -#define DSFXCHORUS_WETDRYMIX_MIN 0.0f -#define DSFXCHORUS_WETDRYMIX_MAX 100.0f -#define DSFXCHORUS_DEPTH_MIN 0.0f -#define DSFXCHORUS_DEPTH_MAX 100.0f -#define DSFXCHORUS_FEEDBACK_MIN -99.0f -#define DSFXCHORUS_FEEDBACK_MAX 99.0f -#define DSFXCHORUS_FREQUENCY_MIN 0.0f -#define DSFXCHORUS_FREQUENCY_MAX 10.0f -#define DSFXCHORUS_DELAY_MIN 0.0f -#define DSFXCHORUS_DELAY_MAX 20.0f -#define DSFXCHORUS_PHASE_MIN 0 -#define DSFXCHORUS_PHASE_MAX 4 - -#define DSFXCHORUS_PHASE_NEG_180 0 -#define DSFXCHORUS_PHASE_NEG_90 1 -#define DSFXCHORUS_PHASE_ZERO 2 -#define DSFXCHORUS_PHASE_90 3 -#define DSFXCHORUS_PHASE_180 4 - -#undef INTERFACE -#define INTERFACE IDirectSoundFXChorus - -DECLARE_INTERFACE_(IDirectSoundFXChorus, IUnknown) -{ - // IUnknown methods - STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - // IDirectSoundFXChorus methods - STDMETHOD(SetAllParameters) (THIS_ __in LPCDSFXChorus pcDsFxChorus) PURE; - STDMETHOD(GetAllParameters) (THIS_ __out LPDSFXChorus pDsFxChorus) PURE; -}; - -#define IDirectSoundFXChorus_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) -#define IDirectSoundFXChorus_AddRef(p) IUnknown_AddRef(p) -#define IDirectSoundFXChorus_Release(p) IUnknown_Release(p) - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectSoundFXChorus_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a) -#define IDirectSoundFXChorus_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a) -#else // !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectSoundFXChorus_SetAllParameters(p,a) (p)->SetAllParameters(a) -#define IDirectSoundFXChorus_GetAllParameters(p,a) (p)->GetAllParameters(a) -#endif // !defined(__cplusplus) || defined(CINTERFACE) - -// -// IDirectSoundFXFlanger -// - -DEFINE_GUID(IID_IDirectSoundFXFlanger, 0x903e9878, 0x2c92, 0x4072, 0x9b, 0x2c, 0xea, 0x68, 0xf5, 0x39, 0x67, 0x83); - -typedef struct _DSFXFlanger -{ - FLOAT fWetDryMix; - FLOAT fDepth; - FLOAT fFeedback; - FLOAT fFrequency; - LONG lWaveform; - FLOAT fDelay; - LONG lPhase; -} DSFXFlanger, *LPDSFXFlanger; - -typedef const DSFXFlanger *LPCDSFXFlanger; - -#define DSFXFLANGER_WAVE_TRIANGLE 0 -#define DSFXFLANGER_WAVE_SIN 1 - -#define DSFXFLANGER_WETDRYMIX_MIN 0.0f -#define DSFXFLANGER_WETDRYMIX_MAX 100.0f -#define DSFXFLANGER_FREQUENCY_MIN 0.0f -#define DSFXFLANGER_FREQUENCY_MAX 10.0f -#define DSFXFLANGER_DEPTH_MIN 0.0f -#define DSFXFLANGER_DEPTH_MAX 100.0f -#define DSFXFLANGER_PHASE_MIN 0 -#define DSFXFLANGER_PHASE_MAX 4 -#define DSFXFLANGER_FEEDBACK_MIN -99.0f -#define DSFXFLANGER_FEEDBACK_MAX 99.0f -#define DSFXFLANGER_DELAY_MIN 0.0f -#define DSFXFLANGER_DELAY_MAX 4.0f - -#define DSFXFLANGER_PHASE_NEG_180 0 -#define DSFXFLANGER_PHASE_NEG_90 1 -#define DSFXFLANGER_PHASE_ZERO 2 -#define DSFXFLANGER_PHASE_90 3 -#define DSFXFLANGER_PHASE_180 4 - -#undef INTERFACE -#define INTERFACE IDirectSoundFXFlanger - -DECLARE_INTERFACE_(IDirectSoundFXFlanger, IUnknown) -{ - // IUnknown methods - STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - // IDirectSoundFXFlanger methods - STDMETHOD(SetAllParameters) (THIS_ __in LPCDSFXFlanger pcDsFxFlanger) PURE; - STDMETHOD(GetAllParameters) (THIS_ __out LPDSFXFlanger pDsFxFlanger) PURE; -}; - -#define IDirectSoundFXFlanger_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) -#define IDirectSoundFXFlanger_AddRef(p) IUnknown_AddRef(p) -#define IDirectSoundFXFlanger_Release(p) IUnknown_Release(p) - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectSoundFXFlanger_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a) -#define IDirectSoundFXFlanger_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a) -#else // !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectSoundFXFlanger_SetAllParameters(p,a) (p)->SetAllParameters(a) -#define IDirectSoundFXFlanger_GetAllParameters(p,a) (p)->GetAllParameters(a) -#endif // !defined(__cplusplus) || defined(CINTERFACE) - -// -// IDirectSoundFXEcho -// - -DEFINE_GUID(IID_IDirectSoundFXEcho, 0x8bd28edf, 0x50db, 0x4e92, 0xa2, 0xbd, 0x44, 0x54, 0x88, 0xd1, 0xed, 0x42); - -typedef struct _DSFXEcho -{ - FLOAT fWetDryMix; - FLOAT fFeedback; - FLOAT fLeftDelay; - FLOAT fRightDelay; - LONG lPanDelay; -} DSFXEcho, *LPDSFXEcho; - -typedef const DSFXEcho *LPCDSFXEcho; - -#define DSFXECHO_WETDRYMIX_MIN 0.0f -#define DSFXECHO_WETDRYMIX_MAX 100.0f -#define DSFXECHO_FEEDBACK_MIN 0.0f -#define DSFXECHO_FEEDBACK_MAX 100.0f -#define DSFXECHO_LEFTDELAY_MIN 1.0f -#define DSFXECHO_LEFTDELAY_MAX 2000.0f -#define DSFXECHO_RIGHTDELAY_MIN 1.0f -#define DSFXECHO_RIGHTDELAY_MAX 2000.0f -#define DSFXECHO_PANDELAY_MIN 0 -#define DSFXECHO_PANDELAY_MAX 1 - -#undef INTERFACE -#define INTERFACE IDirectSoundFXEcho - -DECLARE_INTERFACE_(IDirectSoundFXEcho, IUnknown) -{ - // IUnknown methods - STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - // IDirectSoundFXEcho methods - STDMETHOD(SetAllParameters) (THIS_ __in LPCDSFXEcho pcDsFxEcho) PURE; - STDMETHOD(GetAllParameters) (THIS_ __out LPDSFXEcho pDsFxEcho) PURE; -}; - -#define IDirectSoundFXEcho_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) -#define IDirectSoundFXEcho_AddRef(p) IUnknown_AddRef(p) -#define IDirectSoundFXEcho_Release(p) IUnknown_Release(p) - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectSoundFXEcho_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a) -#define IDirectSoundFXEcho_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a) -#else // !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectSoundFXEcho_SetAllParameters(p,a) (p)->SetAllParameters(a) -#define IDirectSoundFXEcho_GetAllParameters(p,a) (p)->GetAllParameters(a) -#endif // !defined(__cplusplus) || defined(CINTERFACE) - -// -// IDirectSoundFXDistortion -// - -DEFINE_GUID(IID_IDirectSoundFXDistortion, 0x8ecf4326, 0x455f, 0x4d8b, 0xbd, 0xa9, 0x8d, 0x5d, 0x3e, 0x9e, 0x3e, 0x0b); - -typedef struct _DSFXDistortion -{ - FLOAT fGain; - FLOAT fEdge; - FLOAT fPostEQCenterFrequency; - FLOAT fPostEQBandwidth; - FLOAT fPreLowpassCutoff; -} DSFXDistortion, *LPDSFXDistortion; - -typedef const DSFXDistortion *LPCDSFXDistortion; - -#define DSFXDISTORTION_GAIN_MIN -60.0f -#define DSFXDISTORTION_GAIN_MAX 0.0f -#define DSFXDISTORTION_EDGE_MIN 0.0f -#define DSFXDISTORTION_EDGE_MAX 100.0f -#define DSFXDISTORTION_POSTEQCENTERFREQUENCY_MIN 100.0f -#define DSFXDISTORTION_POSTEQCENTERFREQUENCY_MAX 8000.0f -#define DSFXDISTORTION_POSTEQBANDWIDTH_MIN 100.0f -#define DSFXDISTORTION_POSTEQBANDWIDTH_MAX 8000.0f -#define DSFXDISTORTION_PRELOWPASSCUTOFF_MIN 100.0f -#define DSFXDISTORTION_PRELOWPASSCUTOFF_MAX 8000.0f - -#undef INTERFACE -#define INTERFACE IDirectSoundFXDistortion - -DECLARE_INTERFACE_(IDirectSoundFXDistortion, IUnknown) -{ - // IUnknown methods - STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - // IDirectSoundFXDistortion methods - STDMETHOD(SetAllParameters) (THIS_ __in LPCDSFXDistortion pcDsFxDistortion) PURE; - STDMETHOD(GetAllParameters) (THIS_ __out LPDSFXDistortion pDsFxDistortion) PURE; -}; - -#define IDirectSoundFXDistortion_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) -#define IDirectSoundFXDistortion_AddRef(p) IUnknown_AddRef(p) -#define IDirectSoundFXDistortion_Release(p) IUnknown_Release(p) - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectSoundFXDistortion_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a) -#define IDirectSoundFXDistortion_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a) -#else // !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectSoundFXDistortion_SetAllParameters(p,a) (p)->SetAllParameters(a) -#define IDirectSoundFXDistortion_GetAllParameters(p,a) (p)->GetAllParameters(a) -#endif // !defined(__cplusplus) || defined(CINTERFACE) - -// -// IDirectSoundFXCompressor -// - -DEFINE_GUID(IID_IDirectSoundFXCompressor, 0x4bbd1154, 0x62f6, 0x4e2c, 0xa1, 0x5c, 0xd3, 0xb6, 0xc4, 0x17, 0xf7, 0xa0); - -typedef struct _DSFXCompressor -{ - FLOAT fGain; - FLOAT fAttack; - FLOAT fRelease; - FLOAT fThreshold; - FLOAT fRatio; - FLOAT fPredelay; -} DSFXCompressor, *LPDSFXCompressor; - -typedef const DSFXCompressor *LPCDSFXCompressor; - -#define DSFXCOMPRESSOR_GAIN_MIN -60.0f -#define DSFXCOMPRESSOR_GAIN_MAX 60.0f -#define DSFXCOMPRESSOR_ATTACK_MIN 0.01f -#define DSFXCOMPRESSOR_ATTACK_MAX 500.0f -#define DSFXCOMPRESSOR_RELEASE_MIN 50.0f -#define DSFXCOMPRESSOR_RELEASE_MAX 3000.0f -#define DSFXCOMPRESSOR_THRESHOLD_MIN -60.0f -#define DSFXCOMPRESSOR_THRESHOLD_MAX 0.0f -#define DSFXCOMPRESSOR_RATIO_MIN 1.0f -#define DSFXCOMPRESSOR_RATIO_MAX 100.0f -#define DSFXCOMPRESSOR_PREDELAY_MIN 0.0f -#define DSFXCOMPRESSOR_PREDELAY_MAX 4.0f - -#undef INTERFACE -#define INTERFACE IDirectSoundFXCompressor - -DECLARE_INTERFACE_(IDirectSoundFXCompressor, IUnknown) -{ - // IUnknown methods - STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - // IDirectSoundFXCompressor methods - STDMETHOD(SetAllParameters) (THIS_ __in LPCDSFXCompressor pcDsFxCompressor) PURE; - STDMETHOD(GetAllParameters) (THIS_ __out LPDSFXCompressor pDsFxCompressor) PURE; -}; - -#define IDirectSoundFXCompressor_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) -#define IDirectSoundFXCompressor_AddRef(p) IUnknown_AddRef(p) -#define IDirectSoundFXCompressor_Release(p) IUnknown_Release(p) - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectSoundFXCompressor_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a) -#define IDirectSoundFXCompressor_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a) -#else // !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectSoundFXCompressor_SetAllParameters(p,a) (p)->SetAllParameters(a) -#define IDirectSoundFXCompressor_GetAllParameters(p,a) (p)->GetAllParameters(a) -#endif // !defined(__cplusplus) || defined(CINTERFACE) - -// -// IDirectSoundFXParamEq -// - -DEFINE_GUID(IID_IDirectSoundFXParamEq, 0xc03ca9fe, 0xfe90, 0x4204, 0x80, 0x78, 0x82, 0x33, 0x4c, 0xd1, 0x77, 0xda); - -typedef struct _DSFXParamEq -{ - FLOAT fCenter; - FLOAT fBandwidth; - FLOAT fGain; -} DSFXParamEq, *LPDSFXParamEq; - -typedef const DSFXParamEq *LPCDSFXParamEq; - -#define DSFXPARAMEQ_CENTER_MIN 80.0f -#define DSFXPARAMEQ_CENTER_MAX 16000.0f -#define DSFXPARAMEQ_BANDWIDTH_MIN 1.0f -#define DSFXPARAMEQ_BANDWIDTH_MAX 36.0f -#define DSFXPARAMEQ_GAIN_MIN -15.0f -#define DSFXPARAMEQ_GAIN_MAX 15.0f - -#undef INTERFACE -#define INTERFACE IDirectSoundFXParamEq - -DECLARE_INTERFACE_(IDirectSoundFXParamEq, IUnknown) -{ - // IUnknown methods - STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - // IDirectSoundFXParamEq methods - STDMETHOD(SetAllParameters) (THIS_ __in LPCDSFXParamEq pcDsFxParamEq) PURE; - STDMETHOD(GetAllParameters) (THIS_ __out LPDSFXParamEq pDsFxParamEq) PURE; -}; - -#define IDirectSoundFXParamEq_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) -#define IDirectSoundFXParamEq_AddRef(p) IUnknown_AddRef(p) -#define IDirectSoundFXParamEq_Release(p) IUnknown_Release(p) - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectSoundFXParamEq_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a) -#define IDirectSoundFXParamEq_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a) -#else // !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectSoundFXParamEq_SetAllParameters(p,a) (p)->SetAllParameters(a) -#define IDirectSoundFXParamEq_GetAllParameters(p,a) (p)->GetAllParameters(a) -#endif // !defined(__cplusplus) || defined(CINTERFACE) - -// -// IDirectSoundFXI3DL2Reverb -// - -DEFINE_GUID(IID_IDirectSoundFXI3DL2Reverb, 0x4b166a6a, 0x0d66, 0x43f3, 0x80, 0xe3, 0xee, 0x62, 0x80, 0xde, 0xe1, 0xa4); - -typedef struct _DSFXI3DL2Reverb -{ - LONG lRoom; // [-10000, 0] default: -1000 mB - LONG lRoomHF; // [-10000, 0] default: 0 mB - FLOAT flRoomRolloffFactor; // [0.0, 10.0] default: 0.0 - FLOAT flDecayTime; // [0.1, 20.0] default: 1.49s - FLOAT flDecayHFRatio; // [0.1, 2.0] default: 0.83 - LONG lReflections; // [-10000, 1000] default: -2602 mB - FLOAT flReflectionsDelay; // [0.0, 0.3] default: 0.007 s - LONG lReverb; // [-10000, 2000] default: 200 mB - FLOAT flReverbDelay; // [0.0, 0.1] default: 0.011 s - FLOAT flDiffusion; // [0.0, 100.0] default: 100.0 % - FLOAT flDensity; // [0.0, 100.0] default: 100.0 % - FLOAT flHFReference; // [20.0, 20000.0] default: 5000.0 Hz -} DSFXI3DL2Reverb, *LPDSFXI3DL2Reverb; - -typedef const DSFXI3DL2Reverb *LPCDSFXI3DL2Reverb; - -#define DSFX_I3DL2REVERB_ROOM_MIN (-10000) -#define DSFX_I3DL2REVERB_ROOM_MAX 0 -#define DSFX_I3DL2REVERB_ROOM_DEFAULT (-1000) - -#define DSFX_I3DL2REVERB_ROOMHF_MIN (-10000) -#define DSFX_I3DL2REVERB_ROOMHF_MAX 0 -#define DSFX_I3DL2REVERB_ROOMHF_DEFAULT (-100) - -#define DSFX_I3DL2REVERB_ROOMROLLOFFFACTOR_MIN 0.0f -#define DSFX_I3DL2REVERB_ROOMROLLOFFFACTOR_MAX 10.0f -#define DSFX_I3DL2REVERB_ROOMROLLOFFFACTOR_DEFAULT 0.0f - -#define DSFX_I3DL2REVERB_DECAYTIME_MIN 0.1f -#define DSFX_I3DL2REVERB_DECAYTIME_MAX 20.0f -#define DSFX_I3DL2REVERB_DECAYTIME_DEFAULT 1.49f - -#define DSFX_I3DL2REVERB_DECAYHFRATIO_MIN 0.1f -#define DSFX_I3DL2REVERB_DECAYHFRATIO_MAX 2.0f -#define DSFX_I3DL2REVERB_DECAYHFRATIO_DEFAULT 0.83f - -#define DSFX_I3DL2REVERB_REFLECTIONS_MIN (-10000) -#define DSFX_I3DL2REVERB_REFLECTIONS_MAX 1000 -#define DSFX_I3DL2REVERB_REFLECTIONS_DEFAULT (-2602) - -#define DSFX_I3DL2REVERB_REFLECTIONSDELAY_MIN 0.0f -#define DSFX_I3DL2REVERB_REFLECTIONSDELAY_MAX 0.3f -#define DSFX_I3DL2REVERB_REFLECTIONSDELAY_DEFAULT 0.007f - -#define DSFX_I3DL2REVERB_REVERB_MIN (-10000) -#define DSFX_I3DL2REVERB_REVERB_MAX 2000 -#define DSFX_I3DL2REVERB_REVERB_DEFAULT (200) - -#define DSFX_I3DL2REVERB_REVERBDELAY_MIN 0.0f -#define DSFX_I3DL2REVERB_REVERBDELAY_MAX 0.1f -#define DSFX_I3DL2REVERB_REVERBDELAY_DEFAULT 0.011f - -#define DSFX_I3DL2REVERB_DIFFUSION_MIN 0.0f -#define DSFX_I3DL2REVERB_DIFFUSION_MAX 100.0f -#define DSFX_I3DL2REVERB_DIFFUSION_DEFAULT 100.0f - -#define DSFX_I3DL2REVERB_DENSITY_MIN 0.0f -#define DSFX_I3DL2REVERB_DENSITY_MAX 100.0f -#define DSFX_I3DL2REVERB_DENSITY_DEFAULT 100.0f - -#define DSFX_I3DL2REVERB_HFREFERENCE_MIN 20.0f -#define DSFX_I3DL2REVERB_HFREFERENCE_MAX 20000.0f -#define DSFX_I3DL2REVERB_HFREFERENCE_DEFAULT 5000.0f - -#define DSFX_I3DL2REVERB_QUALITY_MIN 0 -#define DSFX_I3DL2REVERB_QUALITY_MAX 3 -#define DSFX_I3DL2REVERB_QUALITY_DEFAULT 2 - -#undef INTERFACE -#define INTERFACE IDirectSoundFXI3DL2Reverb - -DECLARE_INTERFACE_(IDirectSoundFXI3DL2Reverb, IUnknown) -{ - // IUnknown methods - STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - // IDirectSoundFXI3DL2Reverb methods - STDMETHOD(SetAllParameters) (THIS_ __in LPCDSFXI3DL2Reverb pcDsFxI3DL2Reverb) PURE; - STDMETHOD(GetAllParameters) (THIS_ __out LPDSFXI3DL2Reverb pDsFxI3DL2Reverb) PURE; - STDMETHOD(SetPreset) (THIS_ DWORD dwPreset) PURE; - STDMETHOD(GetPreset) (THIS_ __out LPDWORD pdwPreset) PURE; - STDMETHOD(SetQuality) (THIS_ LONG lQuality) PURE; - STDMETHOD(GetQuality) (THIS_ __out LONG *plQuality) PURE; -}; - -#define IDirectSoundFXI3DL2Reverb_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) -#define IDirectSoundFXI3DL2Reverb_AddRef(p) IUnknown_AddRef(p) -#define IDirectSoundFXI3DL2Reverb_Release(p) IUnknown_Release(p) - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectSoundFXI3DL2Reverb_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a) -#define IDirectSoundFXI3DL2Reverb_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a) -#define IDirectSoundFXI3DL2Reverb_SetPreset(p,a) (p)->lpVtbl->SetPreset(p,a) -#define IDirectSoundFXI3DL2Reverb_GetPreset(p,a) (p)->lpVtbl->GetPreset(p,a) -#else // !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectSoundFXI3DL2Reverb_SetAllParameters(p,a) (p)->SetAllParameters(a) -#define IDirectSoundFXI3DL2Reverb_GetAllParameters(p,a) (p)->GetAllParameters(a) -#define IDirectSoundFXI3DL2Reverb_SetPreset(p,a) (p)->SetPreset(a) -#define IDirectSoundFXI3DL2Reverb_GetPreset(p,a) (p)->GetPreset(a) -#endif // !defined(__cplusplus) || defined(CINTERFACE) - -// -// IDirectSoundFXWavesReverb -// - -DEFINE_GUID(IID_IDirectSoundFXWavesReverb,0x46858c3a,0x0dc6,0x45e3,0xb7,0x60,0xd4,0xee,0xf1,0x6c,0xb3,0x25); - -typedef struct _DSFXWavesReverb -{ - FLOAT fInGain; // [-96.0,0.0] default: 0.0 dB - FLOAT fReverbMix; // [-96.0,0.0] default: 0.0 db - FLOAT fReverbTime; // [0.001,3000.0] default: 1000.0 ms - FLOAT fHighFreqRTRatio; // [0.001,0.999] default: 0.001 -} DSFXWavesReverb, *LPDSFXWavesReverb; - -typedef const DSFXWavesReverb *LPCDSFXWavesReverb; - -#define DSFX_WAVESREVERB_INGAIN_MIN -96.0f -#define DSFX_WAVESREVERB_INGAIN_MAX 0.0f -#define DSFX_WAVESREVERB_INGAIN_DEFAULT 0.0f -#define DSFX_WAVESREVERB_REVERBMIX_MIN -96.0f -#define DSFX_WAVESREVERB_REVERBMIX_MAX 0.0f -#define DSFX_WAVESREVERB_REVERBMIX_DEFAULT 0.0f -#define DSFX_WAVESREVERB_REVERBTIME_MIN 0.001f -#define DSFX_WAVESREVERB_REVERBTIME_MAX 3000.0f -#define DSFX_WAVESREVERB_REVERBTIME_DEFAULT 1000.0f -#define DSFX_WAVESREVERB_HIGHFREQRTRATIO_MIN 0.001f -#define DSFX_WAVESREVERB_HIGHFREQRTRATIO_MAX 0.999f -#define DSFX_WAVESREVERB_HIGHFREQRTRATIO_DEFAULT 0.001f - -#undef INTERFACE -#define INTERFACE IDirectSoundFXWavesReverb - -DECLARE_INTERFACE_(IDirectSoundFXWavesReverb, IUnknown) -{ - // IUnknown methods - STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - // IDirectSoundFXWavesReverb methods - STDMETHOD(SetAllParameters) (THIS_ __in LPCDSFXWavesReverb pcDsFxWavesReverb) PURE; - STDMETHOD(GetAllParameters) (THIS_ __out LPDSFXWavesReverb pDsFxWavesReverb) PURE; -}; - -#define IDirectSoundFXWavesReverb_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) -#define IDirectSoundFXWavesReverb_AddRef(p) IUnknown_AddRef(p) -#define IDirectSoundFXWavesReverb_Release(p) IUnknown_Release(p) - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectSoundFXWavesReverb_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a) -#define IDirectSoundFXWavesReverb_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a) -#else // !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectSoundFXWavesReverb_SetAllParameters(p,a) (p)->SetAllParameters(a) -#define IDirectSoundFXWavesReverb_GetAllParameters(p,a) (p)->GetAllParameters(a) -#endif // !defined(__cplusplus) || defined(CINTERFACE) - -// -// IDirectSoundCaptureFXAec -// - -DEFINE_GUID(IID_IDirectSoundCaptureFXAec, 0xad74143d, 0x903d, 0x4ab7, 0x80, 0x66, 0x28, 0xd3, 0x63, 0x03, 0x6d, 0x65); - -typedef struct _DSCFXAec -{ - BOOL fEnable; - BOOL fNoiseFill; - DWORD dwMode; -} DSCFXAec, *LPDSCFXAec; - -typedef const DSCFXAec *LPCDSCFXAec; - -// These match the AEC_MODE_* constants in the DDK's ksmedia.h file -#define DSCFX_AEC_MODE_PASS_THROUGH 0x0 -#define DSCFX_AEC_MODE_HALF_DUPLEX 0x1 -#define DSCFX_AEC_MODE_FULL_DUPLEX 0x2 - -// These match the AEC_STATUS_* constants in ksmedia.h -#define DSCFX_AEC_STATUS_HISTORY_UNINITIALIZED 0x0 -#define DSCFX_AEC_STATUS_HISTORY_CONTINUOUSLY_CONVERGED 0x1 -#define DSCFX_AEC_STATUS_HISTORY_PREVIOUSLY_DIVERGED 0x2 -#define DSCFX_AEC_STATUS_CURRENTLY_CONVERGED 0x8 - -#undef INTERFACE -#define INTERFACE IDirectSoundCaptureFXAec - -DECLARE_INTERFACE_(IDirectSoundCaptureFXAec, IUnknown) -{ - // IUnknown methods - STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - // IDirectSoundCaptureFXAec methods - STDMETHOD(SetAllParameters) (THIS_ __in LPCDSCFXAec pDscFxAec) PURE; - STDMETHOD(GetAllParameters) (THIS_ __out LPDSCFXAec pDscFxAec) PURE; - STDMETHOD(GetStatus) (THIS_ __out LPDWORD pdwStatus) PURE; - STDMETHOD(Reset) (THIS) PURE; -}; - -#define IDirectSoundCaptureFXAec_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) -#define IDirectSoundCaptureFXAec_AddRef(p) IUnknown_AddRef(p) -#define IDirectSoundCaptureFXAec_Release(p) IUnknown_Release(p) - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectSoundCaptureFXAec_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a) -#define IDirectSoundCaptureFXAec_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a) -#else // !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectSoundCaptureFXAec_SetAllParameters(p,a) (p)->SetAllParameters(a) -#define IDirectSoundCaptureFXAec_GetAllParameters(p,a) (p)->GetAllParameters(a) -#endif // !defined(__cplusplus) || defined(CINTERFACE) - - -// -// IDirectSoundCaptureFXNoiseSuppress -// - -DEFINE_GUID(IID_IDirectSoundCaptureFXNoiseSuppress, 0xed311e41, 0xfbae, 0x4175, 0x96, 0x25, 0xcd, 0x8, 0x54, 0xf6, 0x93, 0xca); - -typedef struct _DSCFXNoiseSuppress -{ - BOOL fEnable; -} DSCFXNoiseSuppress, *LPDSCFXNoiseSuppress; - -typedef const DSCFXNoiseSuppress *LPCDSCFXNoiseSuppress; - -#undef INTERFACE -#define INTERFACE IDirectSoundCaptureFXNoiseSuppress - -DECLARE_INTERFACE_(IDirectSoundCaptureFXNoiseSuppress, IUnknown) -{ - // IUnknown methods - STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - // IDirectSoundCaptureFXNoiseSuppress methods - STDMETHOD(SetAllParameters) (THIS_ __in LPCDSCFXNoiseSuppress pcDscFxNoiseSuppress) PURE; - STDMETHOD(GetAllParameters) (THIS_ __out LPDSCFXNoiseSuppress pDscFxNoiseSuppress) PURE; - STDMETHOD(Reset) (THIS) PURE; -}; - -#define IDirectSoundCaptureFXNoiseSuppress_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) -#define IDirectSoundCaptureFXNoiseSuppress_AddRef(p) IUnknown_AddRef(p) -#define IDirectSoundCaptureFXNoiseSuppress_Release(p) IUnknown_Release(p) - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectSoundCaptureFXNoiseSuppress_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a) -#define IDirectSoundCaptureFXNoiseSuppress_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a) -#else // !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectSoundCaptureFXNoiseSuppress_SetAllParameters(p,a) (p)->SetAllParameters(a) -#define IDirectSoundCaptureFXNoiseSuppress_GetAllParameters(p,a) (p)->GetAllParameters(a) -#endif // !defined(__cplusplus) || defined(CINTERFACE) - - -// -// IDirectSoundFullDuplex -// - -#ifndef _IDirectSoundFullDuplex_ -#define _IDirectSoundFullDuplex_ - -#ifdef __cplusplus -// 'struct' not 'class' per the way DECLARE_INTERFACE_ is defined -struct IDirectSoundFullDuplex; -#endif // __cplusplus - -typedef struct IDirectSoundFullDuplex *LPDIRECTSOUNDFULLDUPLEX; - -DEFINE_GUID(IID_IDirectSoundFullDuplex, 0xedcb4c7a, 0xdaab, 0x4216, 0xa4, 0x2e, 0x6c, 0x50, 0x59, 0x6d, 0xdc, 0x1d); - -#undef INTERFACE -#define INTERFACE IDirectSoundFullDuplex - -DECLARE_INTERFACE_(IDirectSoundFullDuplex, IUnknown) -{ - // IUnknown methods - STDMETHOD(QueryInterface) (THIS_ __in REFIID, __deref_out LPVOID*) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - // IDirectSoundFullDuplex methods - STDMETHOD(Initialize) (THIS_ __in LPCGUID pCaptureGuid, __in LPCGUID pRenderGuid, __in LPCDSCBUFFERDESC lpDscBufferDesc, __in LPCDSBUFFERDESC lpDsBufferDesc, HWND hWnd, DWORD dwLevel, - __deref_out LPLPDIRECTSOUNDCAPTUREBUFFER8 lplpDirectSoundCaptureBuffer8, __deref_out LPLPDIRECTSOUNDBUFFER8 lplpDirectSoundBuffer8) PURE; -}; - -#define IDirectSoundFullDuplex_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) -#define IDirectSoundFullDuplex_AddRef(p) IUnknown_AddRef(p) -#define IDirectSoundFullDuplex_Release(p) IUnknown_Release(p) - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectSoundFullDuplex_Initialize(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->Initialize(p,a,b,c,d,e,f,g,h) -#else // !defined(__cplusplus) || defined(CINTERFACE) -#define IDirectSoundFullDuplex_Initialize(p,a,b,c,d,e,f,g,h) (p)->Initialize(a,b,c,d,e,f,g,h) -#endif // !defined(__cplusplus) || defined(CINTERFACE) - -#endif // _IDirectSoundFullDuplex_ - -#endif // DIRECTSOUND_VERSION >= 0x0800 - -// -// Return Codes -// - -// The function completed successfully -#define DS_OK S_OK - -// The call succeeded, but we had to substitute the 3D algorithm -#define DS_NO_VIRTUALIZATION MAKE_HRESULT(0, _FACDS, 10) - -// The call failed because resources (such as a priority level) -// were already being used by another caller -#define DSERR_ALLOCATED MAKE_DSHRESULT(10) - -// The control (vol, pan, etc.) requested by the caller is not available -#define DSERR_CONTROLUNAVAIL MAKE_DSHRESULT(30) - -// An invalid parameter was passed to the returning function -#define DSERR_INVALIDPARAM E_INVALIDARG - -// This call is not valid for the current state of this object -#define DSERR_INVALIDCALL MAKE_DSHRESULT(50) - -// An undetermined error occurred inside the DirectSound subsystem -#define DSERR_GENERIC E_FAIL - -// The caller does not have the priority level required for the function to -// succeed -#define DSERR_PRIOLEVELNEEDED MAKE_DSHRESULT(70) - -// Not enough free memory is available to complete the operation -#define DSERR_OUTOFMEMORY E_OUTOFMEMORY - -// The specified WAVE format is not supported -#define DSERR_BADFORMAT MAKE_DSHRESULT(100) - -// The function called is not supported at this time -#define DSERR_UNSUPPORTED E_NOTIMPL - -// No sound driver is available for use -#define DSERR_NODRIVER MAKE_DSHRESULT(120) - -// This object is already initialized -#define DSERR_ALREADYINITIALIZED MAKE_DSHRESULT(130) - -// This object does not support aggregation -#define DSERR_NOAGGREGATION CLASS_E_NOAGGREGATION - -// The buffer memory has been lost, and must be restored -#define DSERR_BUFFERLOST MAKE_DSHRESULT(150) - -// Another app has a higher priority level, preventing this call from -// succeeding -#define DSERR_OTHERAPPHASPRIO MAKE_DSHRESULT(160) - -// This object has not been initialized -#define DSERR_UNINITIALIZED MAKE_DSHRESULT(170) - -// The requested COM interface is not available -#define DSERR_NOINTERFACE E_NOINTERFACE - -// Access is denied -#define DSERR_ACCESSDENIED E_ACCESSDENIED - -// Tried to create a DSBCAPS_CTRLFX buffer shorter than DSBSIZE_FX_MIN milliseconds -#define DSERR_BUFFERTOOSMALL MAKE_DSHRESULT(180) - -// Attempt to use DirectSound 8 functionality on an older DirectSound object -#define DSERR_DS8_REQUIRED MAKE_DSHRESULT(190) - -// A circular loop of send effects was detected -#define DSERR_SENDLOOP MAKE_DSHRESULT(200) - -// The GUID specified in an audiopath file does not match a valid MIXIN buffer -#define DSERR_BADSENDBUFFERGUID MAKE_DSHRESULT(210) - -// The object requested was not found (numerically equal to DMUS_E_NOT_FOUND) -#define DSERR_OBJECTNOTFOUND MAKE_DSHRESULT(4449) - -// The effects requested could not be found on the system, or they were found -// but in the wrong order, or in the wrong hardware/software locations. -#define DSERR_FXUNAVAILABLE MAKE_DSHRESULT(220) - -// -// Flags -// - -#define DSCAPS_PRIMARYMONO 0x00000001 -#define DSCAPS_PRIMARYSTEREO 0x00000002 -#define DSCAPS_PRIMARY8BIT 0x00000004 -#define DSCAPS_PRIMARY16BIT 0x00000008 -#define DSCAPS_CONTINUOUSRATE 0x00000010 -#define DSCAPS_EMULDRIVER 0x00000020 -#define DSCAPS_CERTIFIED 0x00000040 -#define DSCAPS_SECONDARYMONO 0x00000100 -#define DSCAPS_SECONDARYSTEREO 0x00000200 -#define DSCAPS_SECONDARY8BIT 0x00000400 -#define DSCAPS_SECONDARY16BIT 0x00000800 - -#define DSSCL_NORMAL 0x00000001 -#define DSSCL_PRIORITY 0x00000002 -#define DSSCL_EXCLUSIVE 0x00000003 -#define DSSCL_WRITEPRIMARY 0x00000004 - -#define DSSPEAKER_DIRECTOUT 0x00000000 -#define DSSPEAKER_HEADPHONE 0x00000001 -#define DSSPEAKER_MONO 0x00000002 -#define DSSPEAKER_QUAD 0x00000003 -#define DSSPEAKER_STEREO 0x00000004 -#define DSSPEAKER_SURROUND 0x00000005 -#define DSSPEAKER_5POINT1 0x00000006 // obsolete 5.1 setting -#define DSSPEAKER_7POINT1 0x00000007 // obsolete 7.1 setting -#define DSSPEAKER_7POINT1_SURROUND 0x00000008 // correct 7.1 Home Theater setting -#define DSSPEAKER_5POINT1_SURROUND 0x00000009 // correct 5.1 setting -#define DSSPEAKER_7POINT1_WIDE DSSPEAKER_7POINT1 -#define DSSPEAKER_5POINT1_BACK DSSPEAKER_5POINT1 - -#define DSSPEAKER_GEOMETRY_MIN 0x00000005 // 5 degrees -#define DSSPEAKER_GEOMETRY_NARROW 0x0000000A // 10 degrees -#define DSSPEAKER_GEOMETRY_WIDE 0x00000014 // 20 degrees -#define DSSPEAKER_GEOMETRY_MAX 0x000000B4 // 180 degrees - -#define DSSPEAKER_COMBINED(c, g) ((DWORD)(((BYTE)(c)) | ((DWORD)((BYTE)(g))) << 16)) -#define DSSPEAKER_CONFIG(a) ((BYTE)(a)) -#define DSSPEAKER_GEOMETRY(a) ((BYTE)(((DWORD)(a) >> 16) & 0x00FF)) - -#define DSBCAPS_PRIMARYBUFFER 0x00000001 -#define DSBCAPS_STATIC 0x00000002 -#define DSBCAPS_LOCHARDWARE 0x00000004 -#define DSBCAPS_LOCSOFTWARE 0x00000008 -#define DSBCAPS_CTRL3D 0x00000010 -#define DSBCAPS_CTRLFREQUENCY 0x00000020 -#define DSBCAPS_CTRLPAN 0x00000040 -#define DSBCAPS_CTRLVOLUME 0x00000080 -#define DSBCAPS_CTRLPOSITIONNOTIFY 0x00000100 -#define DSBCAPS_CTRLFX 0x00000200 -#define DSBCAPS_STICKYFOCUS 0x00004000 -#define DSBCAPS_GLOBALFOCUS 0x00008000 -#define DSBCAPS_GETCURRENTPOSITION2 0x00010000 -#define DSBCAPS_MUTE3DATMAXDISTANCE 0x00020000 -#define DSBCAPS_LOCDEFER 0x00040000 -#define DSBCAPS_TRUEPLAYPOSITION 0x00080000 - -#define DSBPLAY_LOOPING 0x00000001 -#define DSBPLAY_LOCHARDWARE 0x00000002 -#define DSBPLAY_LOCSOFTWARE 0x00000004 -#define DSBPLAY_TERMINATEBY_TIME 0x00000008 -#define DSBPLAY_TERMINATEBY_DISTANCE 0x000000010 -#define DSBPLAY_TERMINATEBY_PRIORITY 0x000000020 - -#define DSBSTATUS_PLAYING 0x00000001 -#define DSBSTATUS_BUFFERLOST 0x00000002 -#define DSBSTATUS_LOOPING 0x00000004 -#define DSBSTATUS_LOCHARDWARE 0x00000008 -#define DSBSTATUS_LOCSOFTWARE 0x00000010 -#define DSBSTATUS_TERMINATED 0x00000020 - -#define DSBLOCK_FROMWRITECURSOR 0x00000001 -#define DSBLOCK_ENTIREBUFFER 0x00000002 - -#define DSBFREQUENCY_ORIGINAL 0 -#define DSBFREQUENCY_MIN 100 -#if DIRECTSOUND_VERSION >= 0x0900 -#define DSBFREQUENCY_MAX 200000 -#else -#define DSBFREQUENCY_MAX 100000 -#endif - -#define DSBPAN_LEFT -10000 -#define DSBPAN_CENTER 0 -#define DSBPAN_RIGHT 10000 - -#define DSBVOLUME_MIN -10000 -#define DSBVOLUME_MAX 0 - -#define DSBSIZE_MIN 4 -#define DSBSIZE_MAX 0x0FFFFFFF -#define DSBSIZE_FX_MIN 150 // NOTE: Milliseconds, not bytes - -#define DSBNOTIFICATIONS_MAX 100000UL - -#define DS3DMODE_NORMAL 0x00000000 -#define DS3DMODE_HEADRELATIVE 0x00000001 -#define DS3DMODE_DISABLE 0x00000002 - -#define DS3D_IMMEDIATE 0x00000000 -#define DS3D_DEFERRED 0x00000001 - -#define DS3D_MINDISTANCEFACTOR FLT_MIN -#define DS3D_MAXDISTANCEFACTOR FLT_MAX -#define DS3D_DEFAULTDISTANCEFACTOR 1.0f - -#define DS3D_MINROLLOFFFACTOR 0.0f -#define DS3D_MAXROLLOFFFACTOR 10.0f -#define DS3D_DEFAULTROLLOFFFACTOR 1.0f - -#define DS3D_MINDOPPLERFACTOR 0.0f -#define DS3D_MAXDOPPLERFACTOR 10.0f -#define DS3D_DEFAULTDOPPLERFACTOR 1.0f - -#define DS3D_DEFAULTMINDISTANCE 1.0f -#define DS3D_DEFAULTMAXDISTANCE 1000000000.0f - -#define DS3D_MINCONEANGLE 0 -#define DS3D_MAXCONEANGLE 360 -#define DS3D_DEFAULTCONEANGLE 360 - -#define DS3D_DEFAULTCONEOUTSIDEVOLUME DSBVOLUME_MAX - -// IDirectSoundCapture attributes - -#define DSCCAPS_EMULDRIVER DSCAPS_EMULDRIVER -#define DSCCAPS_CERTIFIED DSCAPS_CERTIFIED -#define DSCCAPS_MULTIPLECAPTURE 0x00000001 - -// IDirectSoundCaptureBuffer attributes - -#define DSCBCAPS_WAVEMAPPED 0x80000000 -#if DIRECTSOUND_VERSION >= 0x0800 -#define DSCBCAPS_CTRLFX 0x00000200 -#endif - -#define DSCBLOCK_ENTIREBUFFER 0x00000001 - -#define DSCBSTATUS_CAPTURING 0x00000001 -#define DSCBSTATUS_LOOPING 0x00000002 - -#define DSCBSTART_LOOPING 0x00000001 - -#define DSBPN_OFFSETSTOP 0xFFFFFFFF - -#define DS_CERTIFIED 0x00000000 -#define DS_UNCERTIFIED 0x00000001 - -// -// Flags for the I3DL2 effects -// - -// -// I3DL2 Material Presets -// - -enum -{ - DSFX_I3DL2_MATERIAL_PRESET_SINGLEWINDOW, - DSFX_I3DL2_MATERIAL_PRESET_DOUBLEWINDOW, - DSFX_I3DL2_MATERIAL_PRESET_THINDOOR, - DSFX_I3DL2_MATERIAL_PRESET_THICKDOOR, - DSFX_I3DL2_MATERIAL_PRESET_WOODWALL, - DSFX_I3DL2_MATERIAL_PRESET_BRICKWALL, - DSFX_I3DL2_MATERIAL_PRESET_STONEWALL, - DSFX_I3DL2_MATERIAL_PRESET_CURTAIN -}; - -#define I3DL2_MATERIAL_PRESET_SINGLEWINDOW -2800,0.71f -#define I3DL2_MATERIAL_PRESET_DOUBLEWINDOW -5000,0.40f -#define I3DL2_MATERIAL_PRESET_THINDOOR -1800,0.66f -#define I3DL2_MATERIAL_PRESET_THICKDOOR -4400,0.64f -#define I3DL2_MATERIAL_PRESET_WOODWALL -4000,0.50f -#define I3DL2_MATERIAL_PRESET_BRICKWALL -5000,0.60f -#define I3DL2_MATERIAL_PRESET_STONEWALL -6000,0.68f -#define I3DL2_MATERIAL_PRESET_CURTAIN -1200,0.15f - -enum -{ - DSFX_I3DL2_ENVIRONMENT_PRESET_DEFAULT, - DSFX_I3DL2_ENVIRONMENT_PRESET_GENERIC, - DSFX_I3DL2_ENVIRONMENT_PRESET_PADDEDCELL, - DSFX_I3DL2_ENVIRONMENT_PRESET_ROOM, - DSFX_I3DL2_ENVIRONMENT_PRESET_BATHROOM, - DSFX_I3DL2_ENVIRONMENT_PRESET_LIVINGROOM, - DSFX_I3DL2_ENVIRONMENT_PRESET_STONEROOM, - DSFX_I3DL2_ENVIRONMENT_PRESET_AUDITORIUM, - DSFX_I3DL2_ENVIRONMENT_PRESET_CONCERTHALL, - DSFX_I3DL2_ENVIRONMENT_PRESET_CAVE, - DSFX_I3DL2_ENVIRONMENT_PRESET_ARENA, - DSFX_I3DL2_ENVIRONMENT_PRESET_HANGAR, - DSFX_I3DL2_ENVIRONMENT_PRESET_CARPETEDHALLWAY, - DSFX_I3DL2_ENVIRONMENT_PRESET_HALLWAY, - DSFX_I3DL2_ENVIRONMENT_PRESET_STONECORRIDOR, - DSFX_I3DL2_ENVIRONMENT_PRESET_ALLEY, - DSFX_I3DL2_ENVIRONMENT_PRESET_FOREST, - DSFX_I3DL2_ENVIRONMENT_PRESET_CITY, - DSFX_I3DL2_ENVIRONMENT_PRESET_MOUNTAINS, - DSFX_I3DL2_ENVIRONMENT_PRESET_QUARRY, - DSFX_I3DL2_ENVIRONMENT_PRESET_PLAIN, - DSFX_I3DL2_ENVIRONMENT_PRESET_PARKINGLOT, - DSFX_I3DL2_ENVIRONMENT_PRESET_SEWERPIPE, - DSFX_I3DL2_ENVIRONMENT_PRESET_UNDERWATER, - DSFX_I3DL2_ENVIRONMENT_PRESET_SMALLROOM, - DSFX_I3DL2_ENVIRONMENT_PRESET_MEDIUMROOM, - DSFX_I3DL2_ENVIRONMENT_PRESET_LARGEROOM, - DSFX_I3DL2_ENVIRONMENT_PRESET_MEDIUMHALL, - DSFX_I3DL2_ENVIRONMENT_PRESET_LARGEHALL, - DSFX_I3DL2_ENVIRONMENT_PRESET_PLATE -}; - -// -// I3DL2 Reverberation Presets Values -// - -#define I3DL2_ENVIRONMENT_PRESET_DEFAULT -1000, -100, 0.0f, 1.49f, 0.83f, -2602, 0.007f, 200, 0.011f, 100.0f, 100.0f, 5000.0f -#define I3DL2_ENVIRONMENT_PRESET_GENERIC -1000, -100, 0.0f, 1.49f, 0.83f, -2602, 0.007f, 200, 0.011f, 100.0f, 100.0f, 5000.0f -#define I3DL2_ENVIRONMENT_PRESET_PADDEDCELL -1000,-6000, 0.0f, 0.17f, 0.10f, -1204, 0.001f, 207, 0.002f, 100.0f, 100.0f, 5000.0f -#define I3DL2_ENVIRONMENT_PRESET_ROOM -1000, -454, 0.0f, 0.40f, 0.83f, -1646, 0.002f, 53, 0.003f, 100.0f, 100.0f, 5000.0f -#define I3DL2_ENVIRONMENT_PRESET_BATHROOM -1000,-1200, 0.0f, 1.49f, 0.54f, -370, 0.007f, 1030, 0.011f, 100.0f, 60.0f, 5000.0f -#define I3DL2_ENVIRONMENT_PRESET_LIVINGROOM -1000,-6000, 0.0f, 0.50f, 0.10f, -1376, 0.003f, -1104, 0.004f, 100.0f, 100.0f, 5000.0f -#define I3DL2_ENVIRONMENT_PRESET_STONEROOM -1000, -300, 0.0f, 2.31f, 0.64f, -711, 0.012f, 83, 0.017f, 100.0f, 100.0f, 5000.0f -#define I3DL2_ENVIRONMENT_PRESET_AUDITORIUM -1000, -476, 0.0f, 4.32f, 0.59f, -789, 0.020f, -289, 0.030f, 100.0f, 100.0f, 5000.0f -#define I3DL2_ENVIRONMENT_PRESET_CONCERTHALL -1000, -500, 0.0f, 3.92f, 0.70f, -1230, 0.020f, -2, 0.029f, 100.0f, 100.0f, 5000.0f -#define I3DL2_ENVIRONMENT_PRESET_CAVE -1000, 0, 0.0f, 2.91f, 1.30f, -602, 0.015f, -302, 0.022f, 100.0f, 100.0f, 5000.0f -#define I3DL2_ENVIRONMENT_PRESET_ARENA -1000, -698, 0.0f, 7.24f, 0.33f, -1166, 0.020f, 16, 0.030f, 100.0f, 100.0f, 5000.0f -#define I3DL2_ENVIRONMENT_PRESET_HANGAR -1000,-1000, 0.0f,10.05f, 0.23f, -602, 0.020f, 198, 0.030f, 100.0f, 100.0f, 5000.0f -#define I3DL2_ENVIRONMENT_PRESET_CARPETEDHALLWAY -1000,-4000, 0.0f, 0.30f, 0.10f, -1831, 0.002f, -1630, 0.030f, 100.0f, 100.0f, 5000.0f -#define I3DL2_ENVIRONMENT_PRESET_HALLWAY -1000, -300, 0.0f, 1.49f, 0.59f, -1219, 0.007f, 441, 0.011f, 100.0f, 100.0f, 5000.0f -#define I3DL2_ENVIRONMENT_PRESET_STONECORRIDOR -1000, -237, 0.0f, 2.70f, 0.79f, -1214, 0.013f, 395, 0.020f, 100.0f, 100.0f, 5000.0f -#define I3DL2_ENVIRONMENT_PRESET_ALLEY -1000, -270, 0.0f, 1.49f, 0.86f, -1204, 0.007f, -4, 0.011f, 100.0f, 100.0f, 5000.0f -#define I3DL2_ENVIRONMENT_PRESET_FOREST -1000,-3300, 0.0f, 1.49f, 0.54f, -2560, 0.162f, -613, 0.088f, 79.0f, 100.0f, 5000.0f -#define I3DL2_ENVIRONMENT_PRESET_CITY -1000, -800, 0.0f, 1.49f, 0.67f, -2273, 0.007f, -2217, 0.011f, 50.0f, 100.0f, 5000.0f -#define I3DL2_ENVIRONMENT_PRESET_MOUNTAINS -1000,-2500, 0.0f, 1.49f, 0.21f, -2780, 0.300f, -2014, 0.100f, 27.0f, 100.0f, 5000.0f -#define I3DL2_ENVIRONMENT_PRESET_QUARRY -1000,-1000, 0.0f, 1.49f, 0.83f,-10000, 0.061f, 500, 0.025f, 100.0f, 100.0f, 5000.0f -#define I3DL2_ENVIRONMENT_PRESET_PLAIN -1000,-2000, 0.0f, 1.49f, 0.50f, -2466, 0.179f, -2514, 0.100f, 21.0f, 100.0f, 5000.0f -#define I3DL2_ENVIRONMENT_PRESET_PARKINGLOT -1000, 0, 0.0f, 1.65f, 1.50f, -1363, 0.008f, -1153, 0.012f, 100.0f, 100.0f, 5000.0f -#define I3DL2_ENVIRONMENT_PRESET_SEWERPIPE -1000,-1000, 0.0f, 2.81f, 0.14f, 429, 0.014f, 648, 0.021f, 80.0f, 60.0f, 5000.0f -#define I3DL2_ENVIRONMENT_PRESET_UNDERWATER -1000,-4000, 0.0f, 1.49f, 0.10f, -449, 0.007f, 1700, 0.011f, 100.0f, 100.0f, 5000.0f - -// -// Examples simulating 'musical' reverb presets -// -// Name Decay time Description -// Small Room 1.1s A small size room with a length of 5m or so. -// Medium Room 1.3s A medium size room with a length of 10m or so. -// Large Room 1.5s A large size room suitable for live performances. -// Medium Hall 1.8s A medium size concert hall. -// Large Hall 1.8s A large size concert hall suitable for a full orchestra. -// Plate 1.3s A plate reverb simulation. -// - -#define I3DL2_ENVIRONMENT_PRESET_SMALLROOM -1000, -600, 0.0f, 1.10f, 0.83f, -400, 0.005f, 500, 0.010f, 100.0f, 100.0f, 5000.0f -#define I3DL2_ENVIRONMENT_PRESET_MEDIUMROOM -1000, -600, 0.0f, 1.30f, 0.83f, -1000, 0.010f, -200, 0.020f, 100.0f, 100.0f, 5000.0f -#define I3DL2_ENVIRONMENT_PRESET_LARGEROOM -1000, -600, 0.0f, 1.50f, 0.83f, -1600, 0.020f, -1000, 0.040f, 100.0f, 100.0f, 5000.0f -#define I3DL2_ENVIRONMENT_PRESET_MEDIUMHALL -1000, -600, 0.0f, 1.80f, 0.70f, -1300, 0.015f, -800, 0.030f, 100.0f, 100.0f, 5000.0f -#define I3DL2_ENVIRONMENT_PRESET_LARGEHALL -1000, -600, 0.0f, 1.80f, 0.70f, -2000, 0.030f, -1400, 0.060f, 100.0f, 100.0f, 5000.0f -#define I3DL2_ENVIRONMENT_PRESET_PLATE -1000, -200, 0.0f, 1.30f, 0.90f, 0, 0.002f, 0, 0.010f, 100.0f, 75.0f, 5000.0f - -// -// DirectSound3D Algorithms -// - -// Default DirectSound3D algorithm {00000000-0000-0000-0000-000000000000} -#define DS3DALG_DEFAULT GUID_NULL - -// No virtualization (Pan3D) {C241333F-1C1B-11d2-94F5-00C04FC28ACA} -DEFINE_GUID(DS3DALG_NO_VIRTUALIZATION, 0xc241333f, 0x1c1b, 0x11d2, 0x94, 0xf5, 0x0, 0xc0, 0x4f, 0xc2, 0x8a, 0xca); - -// High-quality HRTF algorithm {C2413340-1C1B-11d2-94F5-00C04FC28ACA} -DEFINE_GUID(DS3DALG_HRTF_FULL, 0xc2413340, 0x1c1b, 0x11d2, 0x94, 0xf5, 0x0, 0xc0, 0x4f, 0xc2, 0x8a, 0xca); - -// Lower-quality HRTF algorithm {C2413342-1C1B-11d2-94F5-00C04FC28ACA} -DEFINE_GUID(DS3DALG_HRTF_LIGHT, 0xc2413342, 0x1c1b, 0x11d2, 0x94, 0xf5, 0x0, 0xc0, 0x4f, 0xc2, 0x8a, 0xca); - - -#if DIRECTSOUND_VERSION >= 0x0800 - -// -// DirectSound Internal Effect Algorithms -// - - -// Gargle {DAFD8210-5711-4B91-9FE3-F75B7AE279BF} -DEFINE_GUID(GUID_DSFX_STANDARD_GARGLE, 0xdafd8210, 0x5711, 0x4b91, 0x9f, 0xe3, 0xf7, 0x5b, 0x7a, 0xe2, 0x79, 0xbf); - -// Chorus {EFE6629C-81F7-4281-BD91-C9D604A95AF6} -DEFINE_GUID(GUID_DSFX_STANDARD_CHORUS, 0xefe6629c, 0x81f7, 0x4281, 0xbd, 0x91, 0xc9, 0xd6, 0x04, 0xa9, 0x5a, 0xf6); - -// Flanger {EFCA3D92-DFD8-4672-A603-7420894BAD98} -DEFINE_GUID(GUID_DSFX_STANDARD_FLANGER, 0xefca3d92, 0xdfd8, 0x4672, 0xa6, 0x03, 0x74, 0x20, 0x89, 0x4b, 0xad, 0x98); - -// Echo/Delay {EF3E932C-D40B-4F51-8CCF-3F98F1B29D5D} -DEFINE_GUID(GUID_DSFX_STANDARD_ECHO, 0xef3e932c, 0xd40b, 0x4f51, 0x8c, 0xcf, 0x3f, 0x98, 0xf1, 0xb2, 0x9d, 0x5d); - -// Distortion {EF114C90-CD1D-484E-96E5-09CFAF912A21} -DEFINE_GUID(GUID_DSFX_STANDARD_DISTORTION, 0xef114c90, 0xcd1d, 0x484e, 0x96, 0xe5, 0x09, 0xcf, 0xaf, 0x91, 0x2a, 0x21); - -// Compressor/Limiter {EF011F79-4000-406D-87AF-BFFB3FC39D57} -DEFINE_GUID(GUID_DSFX_STANDARD_COMPRESSOR, 0xef011f79, 0x4000, 0x406d, 0x87, 0xaf, 0xbf, 0xfb, 0x3f, 0xc3, 0x9d, 0x57); - -// Parametric Equalization {120CED89-3BF4-4173-A132-3CB406CF3231} -DEFINE_GUID(GUID_DSFX_STANDARD_PARAMEQ, 0x120ced89, 0x3bf4, 0x4173, 0xa1, 0x32, 0x3c, 0xb4, 0x06, 0xcf, 0x32, 0x31); - -// I3DL2 Environmental Reverberation: Reverb (Listener) Effect {EF985E71-D5C7-42D4-BA4D-2D073E2E96F4} -DEFINE_GUID(GUID_DSFX_STANDARD_I3DL2REVERB, 0xef985e71, 0xd5c7, 0x42d4, 0xba, 0x4d, 0x2d, 0x07, 0x3e, 0x2e, 0x96, 0xf4); - -// Waves Reverberation {87FC0268-9A55-4360-95AA-004A1D9DE26C} -DEFINE_GUID(GUID_DSFX_WAVES_REVERB, 0x87fc0268, 0x9a55, 0x4360, 0x95, 0xaa, 0x00, 0x4a, 0x1d, 0x9d, 0xe2, 0x6c); - -// -// DirectSound Capture Effect Algorithms -// - - -// Acoustic Echo Canceller {BF963D80-C559-11D0-8A2B-00A0C9255AC1} -// Matches KSNODETYPE_ACOUSTIC_ECHO_CANCEL in ksmedia.h -DEFINE_GUID(GUID_DSCFX_CLASS_AEC, 0xBF963D80L, 0xC559, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1); - -// Microsoft AEC {CDEBB919-379A-488a-8765-F53CFD36DE40} -DEFINE_GUID(GUID_DSCFX_MS_AEC, 0xcdebb919, 0x379a, 0x488a, 0x87, 0x65, 0xf5, 0x3c, 0xfd, 0x36, 0xde, 0x40); - -// System AEC {1C22C56D-9879-4f5b-A389-27996DDC2810} -DEFINE_GUID(GUID_DSCFX_SYSTEM_AEC, 0x1c22c56d, 0x9879, 0x4f5b, 0xa3, 0x89, 0x27, 0x99, 0x6d, 0xdc, 0x28, 0x10); - -// Noise Supression {E07F903F-62FD-4e60-8CDD-DEA7236665B5} -// Matches KSNODETYPE_NOISE_SUPPRESS in post Windows ME DDK's ksmedia.h -DEFINE_GUID(GUID_DSCFX_CLASS_NS, 0xe07f903f, 0x62fd, 0x4e60, 0x8c, 0xdd, 0xde, 0xa7, 0x23, 0x66, 0x65, 0xb5); - -// Microsoft Noise Suppresion {11C5C73B-66E9-4ba1-A0BA-E814C6EED92D} -DEFINE_GUID(GUID_DSCFX_MS_NS, 0x11c5c73b, 0x66e9, 0x4ba1, 0xa0, 0xba, 0xe8, 0x14, 0xc6, 0xee, 0xd9, 0x2d); - -// System Noise Suppresion {5AB0882E-7274-4516-877D-4EEE99BA4FD0} -DEFINE_GUID(GUID_DSCFX_SYSTEM_NS, 0x5ab0882e, 0x7274, 0x4516, 0x87, 0x7d, 0x4e, 0xee, 0x99, 0xba, 0x4f, 0xd0); - -#endif // DIRECTSOUND_VERSION >= 0x0800 - -#endif // __DSOUND_INCLUDED__ - - - -#ifdef __cplusplus -}; -#endif // __cplusplus - diff --git a/event.cpp b/event.cpp deleted file mode 100644 index dc17bab..0000000 --- a/event.cpp +++ /dev/null @@ -1,4010 +0,0 @@ -// Event.cpp -// - -#pragma once - -using namespace std; - -#include -#include -#include -#include -#include -#include "def.h" -#include "resource.h" -#include "pixmap.h" -#include "sound.h" -#include "decor.h" -#include "movie.h" -#include "button.h" -#include "menu.h" -#include "jauge.h" -#include "event.h" -#include "text.h" -#include "misc.h" -#include "network.h" - -#pragma warning (disable : 4996) -#pragma warning (disable : 4700) - -#define DEF_TIME_HELP 10000 -#define DEF_TIME_DEMO 1000 -#define MAXDEMO 2000 -#define MAXINDEX 20 - - -typedef struct -{ - short majRev; - short minRev; - short reserve1[9]; - short exercice; // exercice en cours (0..n) - short mission; // mission en cours (0..n) - short multi; - short lives; - short bHiliInfoButton; - short pPlayerName; - short speed; - short bMovie; - short maxMission; // derni�re mission effectu�e (0..n) - short scrollSpeed; - short audioVolume; - short midiVolume; - short bAccessBuild; - short prive; - short skill; - short reserve2[93]; -} -DescInfo; - - - - - -// Toutes les premi�res lettres doivent -// �tre diff�rentes ! - -static char cheat_code[25][60] = -{ - "XMISSION", // 0 (xnjttjpo) - "OPENDOORS", // 1 - "CLEANALL", // 2 - "MEGABLUPI", // 3 - "LAYEGG", // 4 - "KILLEGG", // 5 - "FUNSKATE", // 6 - "GIVECOPTER", // 7 - "JEEPDRIVE", // 8 - "ALLTREASURE", - "ENDGOAL", - "SHOWSECRET", - "ROUNDSHIELD", - "QUICKLOLLIPOP", - "TENBOMBS", - "BIRDLIME", - "DRIVETANK", - "POWERCHARGE", - "HIDEDRINK", - "NETPACKED", - "ZNETDEBUG", - "YNOSMOOTH", - "IOVERCRAFT", - "UDYNAMITE", - "WELLKEYS", -}; - - - -///////////////////////////////////////////////////////////////////////////// - - -static Phase table[] = -{ - { - WM_PHASE_TESTCD, - "init.blp", - FALSE, - FALSE, - { - { - 0 - }, - }, - }, - - { - WM_PHASE_INIT, - "init.blp", - FALSE, - FALSE, - { - { - WM_PHASE_GAMER, - 0, {1,48}, - 86, 410, - {1,TX_BUTTON_APPRENDRE}, - }, - { - WM_PHASE_DEMO, - 0, {1,84}, - 128, 410, - {1,TX_BUTTON_DEMO}, - }, - { - WM_PHASE_BYE, -//? WM_CLOSE, - 0, {1,6}, - 540, 410, - {1,TX_BUTTON_QUITTER}, - }, - { - 0 - }, - }, - }, - - { - WM_PHASE_GAMER, - "gamer.blp", - FALSE, - FALSE, - { - { - WM_BUTTON1, - 0, {0,0}, - 60, 58, - {1,TX_CHOOSEPLAYER}, - }, - { - WM_BUTTON2, - 0, {0,0}, - 60, 98, - {1,TX_CHOOSEPLAYER}, - }, - { - WM_BUTTON3, - 0, {0,0}, - 60, 138, - {1,TX_CHOOSEPLAYER}, - }, - { - WM_BUTTON4, - 0, {0,0}, - 60, 178, - {1,TX_CHOOSEPLAYER}, - }, - { - WM_BUTTON5, - 0, {0,0}, - 60, 218, - {1,TX_CHOOSEPLAYER}, - }, - { - WM_BUTTON6, - 0, {0,0}, - 60, 258, - {1,TX_CHOOSEPLAYER}, - }, - { - WM_BUTTON7, - 0, {0,0}, - 60, 298, - {1,TX_CHOOSEPLAYER}, - }, - { - WM_BUTTON8, - 0, {0,0}, - 60, 338, - {1,TX_CHOOSEPLAYER}, - }, - { - WM_PHASE_NAMEg, - 0, {1,46}, - 546, 178, - {1,TX_PLAYERSNAME}, - }, - { - WM_PHASE_CLEARg, - 0, {1,36}, - 546, 220, - {1, TX_CLEARPLAYER}, - }, - { - WM_PHASE_DOPLAY, - 0, {1, 48}, - 65, 414, - {1, TX_SINGLEPLAYER}, - }, - { - WM_PHASE_SERVICE, - 0, {1, 83}, - 107, 414, - {1, TX_MUTLIPLAYER}, - }, - { - WM_PHASE_PRIVATE, - 0, {1, 49}, - 149, 414, - {1, TX_DESIGN}, - }, - { - WM_PHASE_GREAD, - 0, {1, 52}, - 191, 414, - {1, TX_OPEN}, - }, - { - WM_PHASE_SETUP, - 0, {1, 47}, - 330, 414, - {1, TX_SETTINGS}, - }, - { - WM_PHASE_INIT, - 0, {1, 40}, - 540, 414, - {1, TX_BUTTON_TERM}, - }, - { - 0 - }, - }, - }, - - { - WM_PHASE_NAMEg, - "name.blp", - FALSE, - FALSE, - { - { - WM_PHASE_CONFIRM, - 0, {1,18}, - 222, 326, - {1, TX_CONFIRM}, - }, - { - WM_PHASE_GAMER, - 0, {1,36}, - 378, 326, - {1, TX_CANCEL}, - }, - { - 0 - }, - }, - }, - - { - WM_PHASE_CLEARg, - "clear.blp", - FALSE, - FALSE, - { - { - WM_PHASE_YES, - 0, {1,18}, - 222, 326, - {1,TX_YES}, - }, - { - WM_PHASE_GAMER, - 0, {1,36}, - 378, 326, - {1,TX_NO}, - }, - { - 0 - }, - }, - }, - - { - WM_PHASE_SERVICE, - "service.blp", - FALSE, - FALSE, - { - { - WM_BUTTON1, - 0, {1,51}, - 140, 110, - 0, - }, - { - WM_BUTTON2, - 0, {1,51}, - 140, 150, - 0, - }, - { - WM_BUTTON3, - 0, {1,51}, - 140, 190, - 0, - }, - { - WM_BUTTON4, - 0, {1,51}, - 140, 230, - 0, - }, - { - WM_BUTTON5, - 0, {1,51}, - 140, 270, - 0, - }, - { - WM_BUTTON6, - 0, {1, 51}, - 140, 310, - 0, - }, - { - WM_BUTTON10, - 0, {1, 72}, - 466, 110, - {1, TX_SHOWCONNECTION}, - }, - { - WM_BUTTON11, - 0, {1, 73}, - 466, 310, - {1, TX_SHOWNEXT}, - }, - { - WM_PHASE_DPLAY_DO_SERVICE, - 0, {1, 18}, - 222, 389, - {1, TX_CONFIRM}, - }, - { - WM_PHASE_DPLAY_CANCEL_SERVICE, - 0, {1, 36}, - 380, 389, - {1, TX_CANCEL}, - }, - { - 0 - }, - }, - }, - - { - WM_PHASE_SESSION, - "session.blp", - FALSE, - FALSE, - { - { - WM_BUTTON1, - 0, {1,51}, - 120, 100, - 0, - }, - { - WM_BUTTON2, - 0, {1,51}, - 120, 150, - 0, - }, - { - WM_BUTTON3, - 0, {1,51}, - 120, 190, - 0, - }, - { - WM_BUTTON4, - 0, {1,51}, - 120, 230, - 0, - }, - { - WM_BUTTON5, - 0, {1,51}, - 120, 270, - 0, - }, - { - WM_BUTTON6, - 0, {1,51}, - 120, 310, - 0, - }, - { - WM_BUTTON7, - 0, {1,72}, - 490, 330, - {1,TX_SHOWPREV}, - }, - { - WM_BUTTON8, - 0, {1,73}, - 490, 310, - {1,TX_SHOWNEXT}, - }, - { - WM_PHASE_JOINGAME, - 0, {1,45}, - 120, 389, - {1,TX_GAMEJOIN}, - }, - { - WM_PHASE_DPLAY_CREATE_LOBBY, - 0, {1, 43}, - 162, 389, - {1, TX_CREATE_MULTIGAME}, - }, - { - WM_PHASE_DPLAY_REFRESH, - 0, {1, 72}, - 260, 389, - {1, TX_UPDATELIST}, - }, - { - WM_PHASE_DPLAY_CANCEL_SESSION, - 0, {1, 36}, - 485, 389, - {1, TX_CANCEL}, - }, - { - 0 - }, - }, - }, - - { - WM_PHASE_SETUPp, - "setup.blp", - FALSE, - FALSE, - { - { - WM_BUTTON1, - 0, {1,50}, - 54, 330, - {1,TX_BUTTON_SETUP1}, - }, - { - WM_BUTTON2, - 0, {1,51}, - 54+40, 330, - {1,TX_BUTTON_SETUP2}, - }, - { - WM_BUTTON3, - 0, {1,50}, - 284, 330, - {1,TX_BUTTON_SETUP3}, - }, - { - WM_BUTTON4, - 0, {1,51}, - 284+40, 330, - {1,TX_BUTTON_SETUP4}, - }, - { - WM_BUTTON5, - 0, {1,50}, - 399, 330, - {1,TX_BUTTON_SETUP5}, - }, - { - WM_BUTTON6, - 0, {1,51}, - 399+40, 330, - {1,TX_BUTTON_SETUP6}, - }, -#if !_EGAMES - { - WM_BUTTON7, - 0, {1,50}, - 514, 330, - {1,TX_BUTTON_SETUP7}, - }, - { - WM_BUTTON8, - 0, {1,51}, - 514+40, 330, - {1,TX_BUTTON_SETUP8}, - }, -#endif - { - WM_PHASE_PLAY, - 0, {1,77}, - 11, 424, - {1,TX_BUTTON_CONTP}, - }, - { - 0 - }, - }, - }, - - { - WM_PHASE_READ, - "read.blp", - FALSE, - FALSE, - { - { - WM_READ0, - 0, {0}, - 420, 30+42*0, - 0, - }, - { - WM_READ1, - 0, {0}, - 420, 30+42*1, - 0, - }, - { - WM_READ2, - 0, {0}, - 420, 30+42*2, - 0, - }, - { - WM_READ3, - 0, {0}, - 420, 30+42*3, - 0, - }, - { - WM_READ4, - 0, {0}, - 420, 30+42*4, - 0, - }, - { - WM_READ5, - 0, {0}, - 420, 30+42*5, - 0, - }, - { - WM_READ6, - 0, {0}, - 420, 30+42*6, - 0, - }, - { - WM_READ7, - 0, {0}, - 420, 30+42*7, - 0, - }, - { - WM_READ8, - 0, {0}, - 420, 30+42*8, - 0, - }, - { - WM_READ9, - 0, {0}, - 420, 30+42*9, - 0, - }, - { - WM_PHASE_STOP, - 0, {1,40}, - 16, 424, - {1,TX_BUTTON_TERM}, - }, - { - 0 - }, - }, - }, - - { - WM_PHASE_WRITE, - "write.blp", - FALSE, - FALSE, - { - { - WM_WRITE0, - 0, {0}, - 420, 30+42*0, - 0, - }, - { - WM_WRITE1, - 0, {0}, - 420, 30+42*1, - 0, - }, - { - WM_WRITE2, - 0, {0}, - 420, 30+42*2, - 0, - }, - { - WM_WRITE3, - 0, {0}, - 420, 30+42*3, - 0, - }, - { - WM_WRITE4, - 0, {0}, - 420, 30+42*4, - 0, - }, - { - WM_WRITE5, - 0, {0}, - 420, 30+42*5, - 0, - }, - { - WM_WRITE6, - 0, {0}, - 420, 30+42*6, - 0, - }, - { - WM_WRITE7, - 0, {0}, - 420, 30+42*7, - 0, - }, - { - WM_WRITE8, - 0, {0}, - 420, 30+42*8, - 0, - }, - { - WM_WRITE9, - 0, {0}, - 420, 30+42*9, - 0, - }, - { - WM_PHASE_STOP, - 0, {1,40}, - 16, 424, - {1,TX_BUTTON_TERM}, - }, - { - 0 - }, - }, - }, - - { - WM_PHASE_WRITEp, - "write.blp", - FALSE, - FALSE, - { - { - WM_WRITE0, - 0, {0}, - 420, 30+42*0, - 0, - }, - { - WM_WRITE1, - 0, {0}, - 420, 30+42*1, - 0, - }, - { - WM_WRITE2, - 0, {0}, - 420, 30+42*2, - 0, - }, - { - WM_WRITE3, - 0, {0}, - 420, 30+42*3, - 0, - }, - { - WM_WRITE4, - 0, {0}, - 420, 30+42*4, - 0, - }, - { - WM_WRITE5, - 0, {0}, - 420, 30+42*5, - 0, - }, - { - WM_WRITE6, - 0, {0}, - 420, 30+42*6, - 0, - }, - { - WM_WRITE7, - 0, {0}, - 420, 30+42*7, - 0, - }, - { - WM_WRITE8, - 0, {0}, - 420, 30+42*8, - 0, - }, - { - WM_WRITE9, - 0, {0}, - 420, 30+42*9, - 0, - }, - { - WM_PHASE_PLAY, - 0, {1,77}, - 16, 424, - {1,TX_BUTTON_CONTP}, - }, - { - 0 - }, - }, - }, - - { - WM_PHASE_LOST, - "lost.blp", - TRUE, - TRUE, - { - { - WM_PHASE_INFO, - 0, {1,50}, - 9, 431, - {1,TX_BUTTON_REPEAT}, - }, - { - 0 - }, - }, - }, - - { - WM_PHASE_WIN, - "win.blp", - TRUE, - TRUE, - { - { - WM_NEXT, - 0, {1,51}, - 9, 431, - {1,TX_BUTTON_NEXTP}, - }, - { - 0 - }, - }, - }, - - { - WM_PHASE_LASTWIN, - "last%.3d.blp", - TRUE, - TRUE, - { - { - WM_PHASE_INIT, - 0, {1,51}, - 9, 431, - {1,TX_BUTTON_NEXTP}, - }, - { - 0 - }, - }, - }, - - { - WM_PHASE_BUILD, - "build.blp", - TRUE, - TRUE, - { - { - WM_DECOR1, // pose des sols - 0, {6, 0,1,2,3,4,25}, - 11+42*2, 190+42*0, - {6,TX_OBJ_HERBE,TX_OBJ_MOUSSE,TX_OBJ_TERRE, - TX_OBJ_EAU,TX_OBJ_DALLESPEC,TX_OBJ_COUVTELE}, - }, - { - WM_DECOR2, // pose des plantes - 0, {4, 6,7,8,11}, - 11+42*2, 190+42*1, - {4,TX_OBJ_DELOBJ,TX_OBJ_PLANTE, - TX_OBJ_ARBRE,TX_OBJ_FLEUR1}, - }, - { - WM_DECOR3, // pose des batiments - 0, {11, 18,81,33,61,82,93,20,21,22,57,58}, - 11+42*2, 190+42*2, - {11,TX_OBJ_DELOBJ,TX_OBJ_BATIMENT,TX_OBJ_TOUR, - TX_OBJ_MINEFER,TX_OBJ_BATENNEMIS,TX_OBJ_BARENNEMIS, - TX_OBJ_MURPAL,TX_OBJ_ROC,TX_OBJ_OBJET, - TX_OBJ_ARME,TX_OBJ_VEHICULE}, - }, - { - WM_DECOR4, // pose des blupi - 0, {10, 12,13,14,85,15,16,17,38,75,56}, - 11+42*2, 190+42*3, - {10,TX_OBJ_DELPERSO,TX_OBJ_BLUPIf,TX_OBJ_BLUPI, - TX_OBJ_DISCIPLE,TX_OBJ_ARAIGNEE,TX_OBJ_VIRUS, - TX_OBJ_TRACKS,TX_OBJ_BOMBE,TX_OBJ_ELECTRO, - TX_OBJ_ROBOT}, - }, - { - WM_DECOR5, // pose les catastrophes - 0, {2, 36,37}, - 11+42*2, 190+42*4, - {2,TX_OBJ_DELFEU,TX_OBJ_STARTFEU}, - }, - { - WM_PHASE_REGION, - 0, {1,5}, - 11+42*0, 190+42*1, - {1,TX_BUTTON_REGION}, - }, - { - WM_PHASE_INFO, - 0, {1,40}, - 11+42*0, 424, - {1,TX_BUTTON_TERMC}, - }, - { - 0 - }, - }, - }, - - { - WM_PHASE_BUTTON, - "button00.blp", - TRUE, - TRUE, - { - { - WM_BUTTON1, // stop - 0, {1,40}, - 170+42*0, 30+52*0, - {1,TX_ACTION_STOP}, - }, - { - WM_BUTTON0, // go - 0, {1,24}, - 170+42*1, 30+52*0, - {1,TX_ACTION_GO}, - }, - { - WM_BUTTON3, // carry - 0, {1,30}, - 170+42*3, 30+52*0, - {1,TX_ACTION_CARRY}, - }, - { - WM_BUTTON4, // depose - 0, {1,31}, - 170+42*4, 30+52*0, - {1,TX_ACTION_DEPOSE}, - }, - { - WM_BUTTON32, // r�p�te - 0, {1,100}, - 170+42*6, 30+52*0, - {1,TX_ACTION_REPEAT}, - }, - - { - WM_BUTTON5, // abat - 0, {1,22}, - 170+42*0, 30+52*1, - {1,TX_ACTION_ABAT}, - }, - { - WM_BUTTON16, // abat n - 0, {1,42}, - 170+42*1, 30+52*1, - {1,TX_ACTION_ABATn}, - }, - { - WM_BUTTON6, // roc - 0, {1,27}, - 170+42*3, 30+52*1, - {1,TX_ACTION_ROC}, - }, - { - WM_BUTTON17, // roc n - 0, {1,43}, - 170+42*4, 30+52*1, - {1,TX_ACTION_ROCn}, - }, - { - WM_BUTTON22, // fleurs - 0, {1,54}, - 170+42*6, 30+52*1, - {1,TX_ACTION_FLEUR}, - }, - { - WM_BUTTON23, // fleurs n - 0, {1,55}, - 170+42*7, 30+52*1, - {1,TX_ACTION_FLEURn}, - }, - - { - WM_BUTTON9, // build2 (couveuse) - 0, {1,25}, - 170+42*0, 30+52*2, - {1,TX_ACTION_BUILD2}, - }, - { - WM_BUTTON15, // palis - 0, {1,26}, - 170+42*1, 30+52*2, - {1,TX_ACTION_PALIS}, - }, - { - WM_BUTTON18, // pont - 0, {1,23}, - 170+42*2, 30+52*2, - {1,TX_ACTION_PONT}, - }, - { - WM_BUTTON25, // bateau - 0, {1,58}, - 170+42*3, 30+52*2, - {1,TX_ACTION_BATEAU}, - }, - { - WM_BUTTON13, // build6 (t�l�porteur) - 0, {1,101}, - 170+42*4, 30+52*2, - {1,TX_ACTION_BUILD6}, - }, - { - WM_BUTTON14, // mur - 0, {1,20}, - 170+42*6, 30+52*2, - {1,TX_ACTION_MUR}, - }, - { - WM_BUTTON19, // tour - 0, {1,33}, - 170+42*7, 30+52*2, - {1,TX_ACTION_TOUR}, - }, - - { - WM_BUTTON8, // build1 (cabane) - 0, {1,19}, - 170+42*0, 30+52*3, - {1,TX_ACTION_BUILD1}, - }, - { - WM_BUTTON7, // cultive - 0, {1,28}, - 170+42*1, 30+52*3, - {1,TX_ACTION_CULTIVE}, - }, - { - WM_BUTTON2, // mange - 0, {1,32}, - 170+42*2, 30+52*3, - {1,TX_ACTION_MANGE}, - }, - - { - WM_BUTTON10, // build3 (laboratoire) - 0, {1,35}, - 170+42*0, 30+52*4, - {1,TX_ACTION_BUILD3}, - }, - { - WM_BUTTON21, // laboratoire - 0, {1,39}, - 170+42*1, 30+52*4, - {1,TX_ACTION_LABO}, - }, - { - WM_BUTTON20, // boit - 0, {1,34}, - 170+42*2, 30+52*4, - {1,TX_ACTION_BOIT}, - }, - { - WM_BUTTON24, // dynamite - 0, {1,41}, - 170+42*3, 30+52*4, - {1,TX_ACTION_DYNAMITE}, - }, - - { - WM_BUTTON27, // drapeau - 0, {1,64}, - 170+42*0, 30+52*5, - {1,TX_ACTION_DRAPEAU}, - }, - { - WM_BUTTON11, // build4 (mine) - 0, {1,61}, - 170+42*1, 30+52*5, - {1,TX_ACTION_BUILD4}, - }, - { - WM_BUTTON28, // extrait - 0, {1,62}, - 170+42*2, 30+52*5, - {1,TX_ACTION_EXTRAIT}, - }, - { - WM_BUTTON12, // build5 (usine) - 0, {1,59}, - 170+42*4, 30+52*5, - {1,TX_ACTION_BUILD5}, - }, - { - WM_BUTTON29, // fabrique jeep - 0, {1,65}, - 170+42*5, 30+52*5, - {1,TX_ACTION_FABJEEP}, - }, - { - WM_BUTTON30, // fabrique mine - 0, {1,63}, - 170+42*6, 30+52*5, - {1,TX_ACTION_FABMINE}, - }, - { - WM_BUTTON34, // fabrique armure - 0, {1,106}, - 170+42*7, 30+52*5, - {1,TX_ACTION_FABARMURE}, - }, - { - WM_BUTTON31, // fabrique disciple - 0, {1,83}, - 170+42*8, 30+52*5, - {1,TX_ACTION_FABDISC}, - }, - -// { -// WM_BUTTON13, // build6 -// 0, {0}, -// 170+42*2, 30+52*5, -// {1,TX_ACTION_BUILD6}, -// }, - { - WM_PHASE_BUILD, - 0, {1,50}, - 11, 424, - {1,TX_BUTTON_TERM}, - }, - { - 0 - }, - }, - }, - - { - WM_PHASE_TERM, - "term.blp", - TRUE, - TRUE, - { - { - WM_PHASE_BUILD, - 0, {1,50}, - 11, 424, - {1,TX_BUTTON_TERM}, - }, - { - 0 - }, - }, - }, - - { - WM_PHASE_MUSIC, - "music.blp", - TRUE, - TRUE, - { - - { - WM_PHASE_BUILD, - 0, {1,50}, - 11, 424, - {1,TX_BUTTON_TERM}, - }, - { - 0 - }, - }, - }, - - { - WM_PHASE_REGION, - "region.blp", - TRUE, - TRUE, - { - - { - WM_PHASE_BUILD, - 0, {1,50}, - 11, 424, - {1,TX_BUTTON_TERM}, - }, - { - 0 - }, - }, - }, - - { - WM_PHASE_PLAYMOVIE, - "movie.blp", - FALSE, - FALSE, - { - { - 0 - }, - }, - }, - - { - WM_PHASE_WINMOVIE, - "movie.blp", - FALSE, - FALSE, - { - { - 0 - }, - }, - }, - - { - WM_PHASE_H0MOVIE, - "image\\movie.blp", - FALSE, - FALSE, - { - { - 0 - }, - }, - }, - - { - WM_PHASE_H1MOVIE, - "image\\movie.blp", - FALSE, - FALSE, - { - { - 0 - }, - }, - }, - - { - WM_PHASE_H2MOVIE, - "image\\movie.blp", - FALSE, - FALSE, - { - { - 0 - }, - }, - }, - - { - WM_PHASE_BYE, - "image16\\bye.blp", - FALSE, - FALSE, - { - { - 0 - }, - }, - }, - - { - WM_PHASE_INSERT, - "insert.blp", - FALSE, - FALSE, - { -//? { -//? WM_PHASE_INFO, -//? 0, {1,48}, -//? 16, 424-42, -//? {1,TX_BUTTON_PLAYP}, -//? }, - { - WM_PHASE_INIT, - 0, {1,40}, - 16, 424, - {1,TX_BUTTON_QUITTER}, - }, - { - 0 - }, - }, - }, - - { - 0 - } -}; - -// Constructor - -CEvent::CEvent() -{ - int i; - int* menuIndex; - - - CMenu(m_menu); - - new CButton; - - m_somethingJoystick = 0; - m_bFullScreen = TRUE; - m_mouseType = MOUSETYPEGRA; - m_saveIndex = -1; - m_index = -1; - m_exercice = 0; - m_mission = 1; - m_private = 1; - m_maxMission = 0; - m_phase = 0; - m_bSchool = FALSE; - m_bPrivate = FALSE; - m_bAccessBuild = FALSE; - m_bRunMovie = FALSE; - m_bBuildModify = FALSE; - m_bMousePress = FALSE; - m_bMouseDown = FALSE; - m_oldMousePos.x = 0; - m_oldMousePos.y = 0; - m_mouseSprite = 0; - m_bFillMouse = FALSE; - m_bWaitMouse = FALSE; - m_bHideMouse = FALSE; - m_bShowMouse = FALSE; - m_tryPhase = 0; - m_rankCheat = -1; - m_posCheat = 0; - m_speed = 1; - m_bMovie = TRUE; - m_bAllMissions = FALSE; - m_bHiliInfoButton = TRUE; - m_bSpeed = FALSE; - m_bHelp = FALSE; - m_bChangeCheat = FALSE; - m_scrollSpeed = 1; - m_bPause = FALSE; - m_bShift = FALSE; - m_shiftPhase = 0; - m_movieToStart[0] = 0; - m_bInfoHelp = FALSE; - m_bDemoRec = FALSE; - m_bDemoPlay = FALSE; - m_pDemoBuffer = NULL; - m_demoTime = 0; - m_bCtrlDown = FALSE; - m_input = 0; - - for (i = 0; i < MAXINDEX; i++) - { - m_menuIndex = 0; - } - - m_menuDecor[10] = 1; - - return; -} - -// Destructor - -CEvent::~CEvent() -{ - char filename[260]; - - WriteInfo(m_gamer, filename); // Read the file "info.blp" - OutputDebug(filename); - - return; -} - -void CEvent::Create(HINSTANCE hInstance, HWND hWnd, CPixmap *pPixmap, CDecor *pDecor, - CSound *pSound, CMovie *pMovie, CNetwork *pNetwork) -{ - POINT pos; - - m_hInstance = hInstance; - m_hWnd = hWnd; - m_pPixmap = pPixmap; - m_pDecor = pDecor; - m_pSound = pSound; - m_pMovie = pMovie; - m_pNetwork = pNetwork; - m_gamer = 1; - - ReadInfo(1); - return; -} - -int CEvent::GetButtonIndex(int button) -{ - int i=0; - - while ( table[m_index].buttons[i].message != 0 ) - { - if ( (UINT)button == table[m_index].buttons[i].message ) - { - return i; - } - i ++; - } - - return -1; -} - -int CEvent::GetState(int button) -{ - int index; - - index = GetButtonIndex(button); - if ( index < 0 ) return 0; - - return m_buttons[index].GetState(); -} - -// Returns the mouse position - -POINT CEvent::GetMousePos() -{ - POINT pos; - - GetCursorPos(&pos); - ScreenToClient(m_hWnd, &pos); - - return pos; -} - -void CEvent::SetFullScreen(BOOL bFullScreen) -{ - m_bFullScreen = bFullScreen; -} - -// Initializes the mouse type. - -void CEvent::SetMouseType(int mouseType) -{ - m_mouseType = mouseType; -} - -// Creates the event handler. - - - -// Returns the index of the button. - - - -void CEvent::SetState(int button, int state) -{ - int index; - - index = GetButtonIndex(button); - if ( index < 0 ) return; - - m_buttons[index].SetState(state); -} - -BOOL CEvent::GetEnable(int button) -{ - int index; - - index = GetButtonIndex(button); - if ( index < 0 ) return 0; - - return FALSE; -} - -void CEvent::SetEnable(int button, int bEnable) -{ - int index; - - index = GetButtonIndex(button); - if ( index < 0 ) return; - - m_buttons[index].SetEnable(bEnable); -} - -void CEvent::SetIconMenu(int button, int* icon, int iconMenu) -{ - int index; - - index = GetButtonIndex(button); - if (index < 0) return; - m_buttons[index].SetIconMenu(icon, iconMenu); - -} - -/* -BOOL CEvent::GetHide(int button) -{ - int index; - - index = GetButtonIndex(button); - if (index < 0) return 0; - - return m_buttons[index].GetHide(); -} -*/ - -void CEvent::SetHide(int button, BOOL bHide) -{ - int index; - - index = GetButtonIndex(button); - if (index < 0) return; - - m_buttons[index].SetHide(bHide); -} - -int CEvent::GetMenu(int button) -{ - int index; - - index = GetButtonIndex(button); - if ( index < 0 ) return 0; - - return m_buttons[index].GetMenu(); -} - -void CEvent::SetMenu(int button, int menu) -{ - int index; - - index = GetButtonIndex(button); - if ( index < 0 ) return; - - m_buttons[index].SetMenu(menu); -} - -// Restore the game after activation in fullScreen mode. - -void CEvent::RestoreGame() -{ - int i; - - if (m_phase == WM_PHASE_PLAY || m_phase == WM_PHASE_PLAYTEST) - { - HideMouse(FALSE); - WaitMouse(TRUE); - WaitMouse(FALSE); - return; - } - FillMouse(TRUE); - return; - -} - -void CEvent::FlushInput() -{ - m_input = 0; - - m_pDecor->SetInput(0); - return; - -} - -BOOL CEvent::CreateButtons() -{ - int i = 0, message, nb; - POINT pos; - BOOL bMinimizeRedraw = FALSE; - - while (table[m_index].buttons[i].message != 0) - { - pos.x = table[m_index].buttons[i].x; - pos.y = table[m_index].buttons[i].y; - message = table[m_index].buttons[i].message; - - m_buttons[i].Create(m_hWnd, m_pPixmap, m_pSound, pos, - table[m_index].buttons[i].type, - bMinimizeRedraw, - message); - - nb = table[m_index].buttons[i].iconMenu[0]; - if (!m_bAccessBuild && - m_phase == WM_PHASE_BUILD && - message == WM_DECOR11) - { - nb -= 6; // voir (*+) - } - m_buttons[i].SetIconMenu(table[m_index].buttons[i].iconMenu + 1, nb); - m_buttons[i].SetToolTips(table[m_index].buttons[i].toolTips + 1, - table[m_index].buttons[i].toolTips[0]); - i++; - } - - return TRUE; - -} - -void CEvent::ReadInput() -{ - BOOL something; - MMRESULT joyPos; - int i; - UINT keyInput; - JOYINFOEX* joyInfo; - BOOL bSkateboard; - BOOL bHelicopter; - BOOL bCar; - BOOL bWater; - JOYINFOEX joy; - UINT bJoyID; - - - if (m_bMulti != FALSE) - { - //m_pDecor->TreatNetData(); - } - - if ((m_somethingJoystick == NULL) || (m_bDemoPlay != FALSE)) - { - m_pDecor->SetJoystickEnable(FALSE); - } - else - { - m_pDecor->GetBlupiInfo(bHelicopter, bCar, bSkateboard, bWater); - something = TRUE; - - if (((bHelicopter != FALSE) || (bCar != FALSE)) || (bSkateboard != FALSE)) - { - something = FALSE; - } - bJoyID = m_joyID; - joyInfo = &joy; - - for (i != 0; i = 13; i++) - { - joyInfo->dwSize = 0; - joyInfo = (JOYINFOEX*)&joyInfo->dwFlags; - } - joy.dwSize = 52; - joy.dwFlags = 255; - - joyPos = joyGetPosEx(bJoyID, &joy); - - if (joyPos == 0) - { - m_input = 0; - - if ((int)joy.dwXpos < 16384) - { - m_input = KEY_LEFT; - } - if ((m_input == KEY_NONE) && ((int)joy.dwYpos < 16384)) - { - m_input = KEY_UP; - } - if (((m_input == KEY_NONE) || (something)) && (49152 < (int)joy.dwYpos)) - { - m_input = m_input | KEY_DOWN; - } - if (((BYTE)joy.dwButtons & JOY_BUTTON1) != 0) - { - m_input = m_input & ~(INPUT_DOWN | INPUT_UP) | KEY_JUMP; - } - if (((BYTE)joy.dwButtons & JOY_BUTTON2) != 0) - { - if (bSkateboard == FALSE) - { - keyInput = m_input & ~INPUT_DOWN | KEY_UP | KEY_JUMP; - } - else - { - keyInput = m_input & ~(INPUT_DOWN | INPUT_UP) | KEY_JUMP; - } - m_input = keyInput; - } - if (((BYTE)joy.dwButtons & JOY_BUTTON3) != 0) - { - if (bHelicopter == FALSE) - { - if (bSkateboard == FALSE) - { - keyInput = m_input | KEY_DOWN | KEY_JUMP; - } - else - { - keyInput = m_input & ~(INPUT_DOWN | INPUT_UP) | KEY_JUMP; - } - } - else - { - keyInput = m_input | KEY_DOWN; - } - m_input = keyInput; - m_input = keyInput & ~INPUT_UP; - } - if (((BYTE)joy.dwButtons & JOY_BUTTON4) != 0) - { - m_input = m_input & ~(INPUT_DOWN | INPUT_UP) | KEY_FIRE; - } - m_pDecor->SetInput(m_input); - m_pDecor->SetJoystickEnable(TRUE); - return; - } - } - return; -} - - -// CNetwork function needs to be implemented - -void CEvent::NetSetPause(BOOL bPause, int players) -{ - BOOL bPause_; - - bPause_ = bPause; - m_pDecor->SetPause(bPause); - if ((m_phase == WM_PHASE_PLAY) || (m_phase == WM_PHASE_PLAYTEST)) - { - if (bPause_ == FALSE) - { - m_pSound->RestartMusic(); - } - else - { - m_pSound->SuspendMusic(); - } - } - if ((m_bMulti != FALSE) && (players != 0)) - { - m_pNetwork->Send(&bPause, 3, DPSEND_GUARANTEED); - } - return; -} - -void CEvent::NetSendLobby() -{ - NetPlayer* player; - UCHAR (packet)[132]; - CNetwork* pNetwork; - - *(UCHAR*)packet = m_multi; - pNetwork = m_pNetwork; - packet[0] = 132; - packet[1] = MESS_LOBBY; - player = pNetwork->m_players; - memcpy(packet, pNetwork, 128); - pNetwork->Send(packet, 132, DPSEND_GUARANTEED); - return; -} - -int CEvent::NetSearchPlayer(DPID dpid) -{ - int i; - BYTE* pDpid; - - i = 0; - for (pDpid = (BYTE*)m_pNetwork->m_players[0].dpid; !pDpid[-4] == 0 || (dpid != *pDpid); pDpid += 32) - { - if (i++ >= 4) - { - return -1; - } - } - return i; -} - -void CEvent::NetStartPlay() -{ - BOOL host; - int i; - int* player; - char message[2]; - char str[52]; - CNetwork* pNetwork; - - OutputNetDebug("CEvent::NetStartPlay"); - host = m_pNetwork->IsHost(); - - if (host != FALSE) - { - message[0] = '\x02'; - message[1] = '\a'; - m_pNetwork->Send(message, 2, DPSEND_GUARANTEED); - OutputNetDebug("Sending_MESS_START"); - } - m_pDecor->SetTeam(0); - pNetwork = m_pNetwork; - - i = 0; - player = (int*) & pNetwork->m_players[0].dpid; - - while ((((NetPlayer*)(player + -1))->bIsPresent == FALSE || (pNetwork->m_dpid != (DPID)player))) - { - i++; - player = player + 8; - if (3 < i) - { - m_bMulti = TRUE; - m_bPrivate = FALSE; - m_pDecor->SetMulti(TRUE); - return; - } - } - m_pDecor->SetTeam((int)pNetwork->m_players[i].team); - sprintf(str, "color=%d", (int)m_pNetwork->m_players[i].team); - OutputNetDebug(str); -} - -void CEvent::NetSend(NetMessageType message, USHORT data) -{ - UCHAR packet[4]; - - packet[2] = '\0'; - packet[3] = '\0'; - packet[1] = message; - packet[0] = 4; - *(USHORT*)packet = data; - m_pNetwork->Send(packet, 4, DPSEND_GUARANTEED); - return; -} - -void CEvent::NetDraw() -{ - int player; - - player = NetSearchPlayer(m_pNetwork->m_dpid); - //m_pDecor->DrawMap(TRUE, player); - return; -} - -void CEvent::ChatSend() -{ - int netplay; - UINT i; - char* text; - char end[4]; - POINT* pos; - DPID dpid; - LPVOID data[25]; - char textInput[100]; - - text = m_textInput; - if (m_textInput[0] != '\0') - { - netplay = NetSearchPlayer(m_pNetwork->m_dpid); - strcpy(textInput, "<"); - } - if (netplay != -1) - { - strcat(textInput, (const char*)m_pNetwork->m_players[netplay].name); - strcat(textInput, "> "); - strcat(textInput, text); - //ChatMessageSound((char*)textInput); - end[0] = 108; - end[1] = 11; - dpid = m_pNetwork->m_dpid; - m_pNetwork->Send(&end, 108, 1); - text = 0; - pos[132].x = 0; - pos[132].y = strlen(text); - pos[133].x = 0; - m_textHiliEnd = i - 1; - m_textCursorIndex = 0; - SetEnable((WMessage)WM_BUTTON20, 0); - } - return; -} - -/* -void CEvent::ChatMessageSound(char* data) -{ - int num; - int i = 0; - char* chatZone; - char(*chat)[5]; - POINT pos; - - num = 3; - chatZone = m_chatZone[0]; - for (i = 0; i < 6; i++) - { - if (chatZone == '\0') - { - chat = m_chatZone + i * 20; - goto LABEL; - } - chatZone = chatZone + 100; - } - HandleChatBuffer(); - chat = (char(*) [5])m_text; - return; - -LABEL: - strcpy((char*)chat, data); - pos.x = 320; - pos.y = 240; - m_pSound->PlayImage(11, pos, -1); -} -*/ - -void CEvent::HandleChatBuffer() -{ - char (*chatZone)[5]; - int num; - int result; - char* text; - - num = 5; - chatZone = m_chatZone; - do - { - result = strlen((const char*)chatZone + 100) + 1; - text = (char*)chatZone; - chatZone += 100; - memcpy(text, chatZone, result); - --num; - } while (num); - *((BYTE*)m_text) = 0; - return; -} - -void CEvent::OutputNetDebug(const char* str) -{ - char* stream; - FILE* streamf; - UINT element; - - streamf = (FILE*)m_pDecor->GetNetDebug(); - - if (m_pDecor->GetNetDebug() != FALSE) - { - if (fopen("debug.txt", "ab") != (FILE*)0) - { - fwrite(str, 1, strlen(str), streamf); - streamf = (FILE*)fclose(streamf); - } - } - return; -} - -void AddCheatCode(char *pDst, char *pSrc) -{ - int i, j; - - if ( pDst[0] != 0 ) strcat(pDst, " / "); - - i = 0; - j = strlen(pDst); - while ( pSrc[i] != 0 ) - { - pDst[j++] = tolower(pSrc[i++]); - } - pDst[j] = 0; -} - - -void CEvent::DrawTextCenter(int res, int x, int y, int font) -{ - char text[100]; - POINT pos; - - LoadString(res, text, 100); - pos.x = x; - pos.y = y; - ::DrawTextCenter(m_pPixmap, pos, text, font); -} - -BOOL CEvent::PlaceMenu(int celX, int celY, int wParam, int* object) -{ - POINT cel; - POINT pos; - - cel.x = celX; - cel.y = celY; - - if ((((-1 < celX) && (celX < 641)) && (-1 < celY)) && (celY < 481)) - { - if (wParam & 2U != 0) - { - pos = m_pDecor->ScreenPosToCelPos((POINT*)&celX, cel); - m_pDecor->DeleteCel(pos.x, (pos.y)); - return TRUE; - } - } -} - -BOOL CEvent::DrawButtons() -{ - int i; - int levels[2]; - int types[2]; - int world, time, lg, button, volume, pente, icon, sound; - int nice; - BOOL soundEnabled; - char res[100]; - char textLeft[24]; - char text[100]; - char pText[100]; - POINT pos; - RECT rect; - BOOL bEnable; - int phase; - - if ( (m_phase == WM_PHASE_INSERT && m_phase == WM_PHASE_BYE )) - { - m_bChangeCheat = FALSE; - - text[0] = 0; - if (m_bAccessBuild != 0) - { - AddCheatCode(text, cheat_code[0]); - } - if (m_posHelpButton.y != 0) - { - AddCheatCode(text, cheat_code[1]); - } - if ( m_pDecor->GetInvincible() ) - { - AddCheatCode(text, cheat_code[3]); - } - if ( m_pDecor->GetShowSecret() ) - { - AddCheatCode(text, cheat_code[11]); - } - if ( m_pDecor->GetNetPacked() ) - { - AddCheatCode(text, cheat_code[19]); - } - if (m_pDecor->GetNetMovePredict()) - { - AddCheatCode(text, cheat_code[21]); - } - } - m_pDecor->OutputNetDebug(text); - - - - if (((m_phase != WM_PHASE_PLAY) && (m_phase != WM_PHASE_PLAYTEST)) && (m_phase != WM_PHASE_BUILD)) - { - rect.right = 302; - rect.left = 2; - rect.top = 2; - rect.bottom = 14; - pos.x = 2; - pos.y = 2; - m_pPixmap->DrawPart(-1, 0, pos, rect, 1, FALSE); - } - pos.x = 2; - pos.y = 2; - DrawTextLeft(m_pPixmap, pos, text, 10); - - if (m_phase == WM_PHASE_INIT) - { - pos.x = 508; - pos.y = 446; - DrawTextB(m_pPixmap, pos, (char*)"Version 2.0", FONTLITTLE); - } - - i = 0; - while (table[m_index].buttons[i].message != 0) - { - m_buttons[i].Draw(); - i++; - } - - if (m_phase == WM_PHASE_GAMER) - { - LoadString(TX_CHOOSEGAMER, res, 100); - lg = GetTextWidth(res, 0); - pos.y = 26; - pos.x = LXIMAGE / 2 - lg / 2; - DrawTextLeft(m_pPixmap, pos, res, 1); - *(char*)pText = m_gamerNameList[10][100]; - lg = 8; - nice = 69; - do - { - pos.y = 69; - pos.x = 110; - DrawTextB(m_pPixmap, pos, pText, 0); - nice = 69 + 40; - *(char*)pText += 100; - lg++; - } while (lg != 0); - SetEnable(WM_PHASE_CLEARg, (int)(m_filenameBuffer + -1) + m_gamer * 4 + 212); - } - - if (m_phase == WM_PHASE_PLAY && m_phase == WM_PHASE_PLAYTEST && m_phase == WM_PHASE_BUILD) - m_pPixmap->DrawPart(-1, 0, pos, rect, 1, 0); - if (m_phase == WM_PHASE_CREATE) - { - LoadString(TX_MULTI_CREATE, res, 50); - lg=GetTextWidth(res); - pos.x = (320 - lg) / 2; - pos.y = 103; - DrawTextLeft(m_pPixmap, pos, res, FONTSLIM); - LoadString(TX_MULTI_GNAME, res, 100); - pos.x = (320 - lg) / 2; - pos.y = 190; - DrawTextLeft(m_pPixmap, pos, res, FONTSLIM); - } - - if (m_phase == WM_PHASE_NAMEg) - { - LoadString(TX_CHOOSEPLAYER, res, 100); - lg = GetTextWidth(res, 0); - pos.x = 320 - lg / 2; - pos.y = 102; - DrawTextLeft(m_pPixmap, pos, res, 1); - LoadString(TX_WRITENAME, res, 100); - pos.x = 320 - lg / 2; - pos.y = 190; - DrawTextLeft(m_pPixmap, pos, res, 0); - pos.x = 320; - pos.y = 232; - PutTextInputBox(pos); - } - - if (m_phase == WM_PHASE_CLEARg) - { - LoadString(TX_CHOOSEGAMER, res, 100); - lg = GetTextWidth(res, 0); - pos.x = 320 - lg / 2; - pos.y = 102; - DrawTextLeft(m_pPixmap, pos, res, 1); - LoadString(TX_DISCARDGAME, res, 100); - pos.x = 320 - lg / 2; - pos.y = 210; - DrawTextLeft(m_pPixmap, pos, res, 0); - strcpy(res, m_gamerName); - strcat(res, " ?"); - pos.x = 320 - lg / 2; - pos.y = 230; - DrawTextLeft(m_pPixmap, pos, res, 0); - } - - if (m_phase == WM_PHASE_CLEARd) - { - LoadString(TX_DESIGNMISSION, res, 100); - lg = GetTextWidth(res, 0); - pos.x = 320 - lg / 2; - pos.y = 104; - DrawTextLeft(m_pPixmap, pos, res, 1); - LoadString(TX_DELETEMISSION, res, 100); - GetWorld(); - sprintf(text, res); - lg = GetTextWidth(text, 0); - pos.x = 320 - lg / 2; - pos.y = 210; - DrawTextLeft(m_pPixmap, pos, text, 0); - strcpy(res, m_pDecor->GetMissionTitle()); - if (res[0] == '\0') LoadString(TX_NONAME, res, 100); - strcat(res, " ?"); - lg = GetTextWidth(res, 0); - pos.x = 320 - lg / 2; - pos.y = 230; - DrawTextLeft(m_pPixmap, pos, res, 0); - } - - if (m_phase == WM_PHASE_SETUP || m_phase == WM_PHASE_SETUPp) - { - sound = m_pSound->GetAudioVolume(); - soundEnabled = TRUE; - if ((sound == 0) || (m_pSound->GetEnable()) == FALSE) - { - soundEnabled = FALSE; - } - } - if (m_phase == WM_PHASE_PLAY || m_phase == WM_PHASE_PLAYTEST) - { - if (m_pDecor->GetPause() == 0) - { - if (m_bDemoRec != 0) - { - LoadString(TX_DEMOREC, res, 100); - DrawTextLeft(m_pPixmap, pos, res, FONTRED); - } - if (m_bDemoPlay != 0) - { - LoadString(TX_DEMOPLAY, res, 100); - DrawTextLeft(m_pPixmap, pos, res, FONTRED); - } - } - else - { - if (m_pDecor->GetTime() % 20 < 15) - { - DrawTextCenter(TX_PAUSE, 320, 240, 0); - } - } - if (m_speed > 1) - { - sprintf(res, "x%d", m_speed); - DrawTextLeft(m_pPixmap, pos, res, FONTWHITE); - } - } - if (m_phase == WM_PHASE_STOP) - { - LoadString(TX_GAMEPAUSE, res, 100); - lg = GetTextWidth(res); - pos.x = (319 - lg) / 2; - pos.y = 103; - DrawTextLeft(m_pPixmap, pos, res, FONTRED); - } - if (m_phase == WM_PHASE_MUSIC) - { - LoadString(TX_MUSIC, res, 100); - lg=GetTextWidth(res); - pos.x = (320 - lg) / 2; - pos.y = 84; - DrawTextLeft(m_pPixmap, pos, res, FONTRED); - } - if (m_phase == WM_PHASE_REGION) - { - LoadString(TX_REGION, res, 100); - lg = GetTextWidth(res); - pos.x = (320 - lg) / 2; - pos.y = 26; - DrawTextLeft(m_pPixmap, pos, res, FONTRED); - } - if (m_phase == WM_PHASE_LOST || m_phase == WM_PHASE_LOSTd || m_phase == WM_PHASE_WINm) - { - LoadString(TX_LOST1 + GetWorld() % 5, res, 50); - DrawTextLeft(m_pPixmap, pos, res, FONTWHITE); - } - if (m_phase == WM_PHASE_WIN || m_phase == WM_PHASE_WINd || m_phase == WM_PHASE_LOSTm) - { - LoadString(TX_WIN1 + GetWorld() % 5, res, 50); - DrawTextLeft(m_pPixmap, pos, res, FONTWHITE); - } - if (m_phase == WM_PHASE_READd) - { - - } - if (m_phase == WM_PHASE_GREAD || m_phase == WM_PHASE_GREADp || m_phase == WM_PHASE_GWRITE) - { - if (m_phase == WM_PHASE_GREAD) - { - LoadString(TX_SAVE_CGAME, res, 50); - } - else - { - LoadString(TX_LOAD_CGAME, res, 50); - } - } - if (m_phase == WM_PHASE_BYE) - { - LoadString(TX_FULL_END1, res, 100); - lg = GetTextWidth(res); - pos.x = (320 - lg) / 2; - pos.y = 20; - DrawTextLeft(m_pPixmap, pos, res, FONTRED); - LoadString(TX_FULL_END2, res, 100); - lg = GetTextWidth(res); - pos.x = (320 - lg) / 2; - pos.y = 40; - DrawTextLeft(m_pPixmap, pos, res, FONTRED); - LoadString(TX_FULL_END3, res, 100); - lg = GetTextWidth(res); - pos.x = (320 - lg) / 2; - pos.y = 430; - DrawTextLeft(m_pPixmap, pos, res, FONTRED); - LoadString(TX_FULL_END4, res, 100); - lg = GetTextWidth(res); - pos.x = (320 - lg) / 2; - pos.y = 450; - DrawTextLeft(m_pPixmap, pos, res, FONTRED); - } - if (m_phase == WM_PHASE_INSERT) - { - DrawTextCenter(TX_INSERT, LXIMAGE / 2, 20); - } - if (m_textToolTips[0] != '\0') - { - DrawTextLeft(m_pPixmap, m_posToolTips, m_textToolTips, FONTWHITE); - } - if (m_phase == WM_PHASE_CLEARg) - { - LoadString(TX_CHOOSEGAMER, res, 100); - lg = GetTextWidth((char*)res, 0); - pos.y = 102; - pos.x = 320 - lg / 2; - DrawTextLeft(m_pPixmap, pos, (char*)res, 1); - LoadString(TX_DISCARDGAME, res, 100); - lg = GetTextWidth(res, 0); - strcpy(text, (const char*)m_gamerName); - strcat(text, "?"); - lg = GetTextWidth(text, 0); - DrawTextLeft(m_pPixmap, pos, res, 0); - } - if (m_phase == WM_PHASE_CLEARd) - { - LoadString(TX_DESIGNMISSION, res, 100); - lg = GetTextWidth(res, 0); - pos.y = 104; - pos.x = 320 - lg / 2; - DrawTextLeft(m_pPixmap, pos, res, 1); - LoadString(TX_DELETEMISSION, res, 100); - GetWorld(); - sprintf(text, res); - lg = GetTextWidth(text, 0); - pos.y = 210; - pos.x = 320 - lg / 2; - DrawTextLeft(m_pPixmap, pos, text, 0); - strcpy(text, (char*)m_pDecor->GetMissionTitle()); - - if (text[0] == '\0') - { - LoadString(TX_NONAME, res, 100); - } - strcat(text, "?"); - lg = GetTextWidth(text, 0); - pos.y = 230; - pos.x = 320 - lg / 2; - DrawTextLeft(m_pPixmap, pos, res, 0); - } - if (m_phase == WM_PHASE_INFO) - { - LoadString(TX_DESIGNMISSION, res, 100); - lg = GetTextWidth(res, 0); - pos.y = 37; - pos.x = 320 - lg / 2; - DrawTextLeft(m_pPixmap, pos, res, 0); - // Unknown Field - // DrawIcon - // End of if function - LoadString(TX_MISSIONNUM, res, 100); - sprintf(text, res); - lg = GetTextWidth(text, 0); - pos.y = 106; - pos.x = 250 - lg / 2; - DrawTextLeft(m_pPixmap, pos, text, 1); - strcpy(text, (char*)m_pDecor->GetMissionTitle()); - if (res[0] == '\0') - { - LoadString(TX_NONAME, res, 100); - } - lg = GetTextWidth(res, 0); - pos.y = 269; - pos.x = 250 - lg / 2; - DrawTextLeft(m_pPixmap, pos, res, 0); - } - - return TRUE; -} - -void CEvent::PutTextInputBox(POINT pos) -{ - char textInput[100]; - char* textConst; - int text; - CPixmap* pPixmap; - int num; - UINT textHili; - LONG posD; - - text = GetTextWidth(m_textInput, 0); - posD = pos.x - text / 2; - textHili = m_textHiliStart; - - if (0 < (int)textHili) - { - memcpy(textInput, textConst, textHili); - pPixmap = m_pPixmap; - textInput[textHili] = 0; - DrawTextLeft(pPixmap, pos, textInput, 0); - text += GetTextWidth(textInput, 0); - } - if (m_textHiliStart < m_textHiliEnd) - { - textHili = m_textHiliEnd - m_textHiliStart; - memcpy(textInput, m_textInput + m_textHiliStart, text); - pPixmap = m_pPixmap; - textInput[textHili] = 0; - DrawTextLeft(pPixmap, pos, textInput, 2); - text += GetTextWidth(textInput, 0); - } - if (m_textCursorIndex % 16 < 8) - { - pPixmap = m_pPixmap; - DrawTextLeft(pPixmap, pos, (char*)"|", 0); - } - num = m_textCursorIndex; - - if (num < (int)strlen((const char*)m_textInput)) - { - pPixmap = m_pPixmap; - strcpy(textInput, num + m_textInput); - DrawTextLeft(pPixmap, pos, textInput, 0); - } - m_textCursorIndex = m_textCursorIndex + 1; - return; -} - -/* -BOOL CEvent::TextSomething() -{ - int textHiliStart; - char pText; - - m_textHiliStart = textHiliStart; - - if (m_textHiliEnd < textHiliStart) - { - return 0; - } - - do { - m_textInput[textHiliStart] = - m_textHiliEnd + textHiliStart; - pText = m_textInput + textHiliStart; - textHiliStart = textHiliStart + 1; - } while (pText != '\0'); - m_textHiliEnd = m_textHiliStart; - return 1; -} -*/ - -BOOL CEvent::LoadDecorRegion() -{ - int index; - char buffer[100]; - - index = m_index; - - strcpy(buffer, table[index].backName); - - if (buffer[0] && table[index].bCDrom != FALSE) - { - AddCDPath(buffer); - } - return m_pPixmap->CacheAll(FALSE, m_hWnd, TRUE, TRUE, TRUE, 1, buffer, m_pDecor->GetRegion()); -} - -POINT CEvent::GetLastMousePos() -{ - return m_oldMousePos; -} - -BOOL CEvent::TreatEvent(UINT message, WPARAM wParam, LPARAM lParam) -{ - if (m_bDemoPlay) - { - if (message == WM_KEYDOWN || - message == WM_KEYUP || - message == WM_LBUTTONUP || - message == WM_RBUTTONUP) - { - DemoPlayStop(); - return TRUE; - } - if (message == WM_MOUSEMOVE) - { - return TRUE; - } - } - - return TreatEventBase(message, wParam, lParam); -} - -BOOL CEvent::TreatEventBase(UINT message, WPARAM wParam, LPARAM lParam) -{ - POINT pos; - int fwKeys; - int i, sound; - int celX, celY; - char c; - BOOL bEnable; - - pos = ConvLongToPos(lParam); - fwKeys = wParam; - celX = pos.x; - celY = pos.y; - - switch (message) - { - case WM_KEYDOWN: - if (wParam >= 'A' && wParam <= 'Z') - { - if (m_posCheat == 0) - { - m_rankCheat = -1; - - for (i = 0; i < 9; i++) - { - if ((char)wParam == cheat_code[i][0]) - { - m_rankCheat = i; - break; - } - } - } - if (m_rankCheat != -1) - { - c = cheat_code[m_rankCheat][m_posCheat]; - if (m_posCheat != 0 && m_rankCheat == 0) c++; - bEnable = TRUE; - if ((char)wParam == c) - { - m_posCheat++; - if (m_rankCheat == 0) - { - m_bAccessBuild = !m_bAccessBuild; - bEnable = m_bAccessBuild; - m_pDecor->SetAccessBuild(bEnable); - bEnable = m_bAccessBuild; - - if (m_phase != WM_PHASE_PLAY) - { - ChangePhase(m_phase); - } - if (bEnable) - { - pos.x = 320; - pos.y = LYIMAGE / 2; - m_pSound->PlayImage(SOUND_3_JUMPEND, pos, -1); - } - else - { - pos.x = 320; - pos.y = LYIMAGE / 2; - m_pSound->PlayImage(SOUND_41_RESSORT, pos, -1); - } - m_rankCheat = -1; - m_posCheat = 1; - } - return TRUE; - } - } - } - m_rankCheat = -1; - m_posCheat = 0; - - if (m_phase == WM_PHASE_INIT) - { - ChangePhase(WM_PHASE_INIT); - return TRUE; - } - - if (m_phase == WM_PHASE_BYE) - { - PostMessageA(m_hWnd, WM_CLOSE, 0, 0); - } - - switch (wParam) - { - case VK_END: - DemoRecStop(); - return TRUE; - case VK_ESCAPE: - if (m_bRunMovie) - { - StopMovie(); - m_pSound->SetSuspendSkip(1); - return TRUE; - } - if (m_phase = WM_PHASE_PLAY) - { - if ((m_bPrivate == FALSE) && (m_bMulti == FALSE)) - { - if (m_mission == 1) - { - return ChangePhase(WM_PHASE_GAMER); - } - if ((m_mission % 10 == 0) && (m_mission != 10)) - { - SetMission(1); - m_phase = WM_PHASE_PLAY; - return ChangePhase(WM_PHASE_PLAY); - } - } - } - else if ((m_phase != WM_PHASE_GREADp) && (m_phase != WM_PHASE_GWRITE)) - { - if ((m_phase == WM_PHASE_SETUP) || - (((m_phase == WM_PHASE_NAMEg || (m_phase == WM_PHASE_HELP)) || (m_phase == WM_PHASE_GREAD)))) - { - ChangePhase(WM_PHASE_GAMER); - return TRUE; - } - if (((m_phase == WM_PHASE_SETUPp) || (m_phase == WM_PHASE_HELP)) || (m_phase == WM_PHASE_STOP)) - { - ChangePhase(WM_PHASE_PLAY); - return TRUE; - } - if (m_phase != WM_PHASE_PLAYTEST) - { - if (((m_phase != WM_PHASE_LOST) && (m_phase != WM_PHASE_LOSTd)) && - ((m_phase != WM_PHASE_BUILD && - ((((m_phase != WM_PHASE_REGION && (m_phase != WM_PHASE_NAMEd)) && (m_phase != WM_PHASE_MUSIC)) - && ((m_phase != WM_PHASE_READd && (m_phase != WM_PHASE_WRITEd)))))))) - { - if ((m_phase == WM_PHASE_INFO) || (m_phase == WM_PHASE_WINm)) - { - ChangePhase(WM_PHASE_GAMER); - return TRUE; - } - if (m_phase == WM_PHASE_GAMER) - { - ChangePhase(WM_PHASE_INIT); - return TRUE; - } - if (m_phase == WM_PHASE_SERVICE) - { - ChangePhase(WM_PHASE_DPLAY_CANCEL_SERVICE); - return TRUE; - } - if (m_phase == WM_PHASE_SESSION) - { - ChangePhase(WM_PHASE_DPLAY_CANCEL_SESSION); - return TRUE; - } - if (m_phase == WM_PHASE_CREATE) - { - ChangePhase(WM_PHASE_DPLAY_CANCEL_MULTI); - return TRUE; - } - if (m_phase == WM_PHASE_BYE) - { - PostMessageA(m_hWnd, WM_CLOSE, 0, 0); - return FALSE; - } - return TRUE; - } - ChangePhase(WM_PHASE_INFO); - return TRUE; - } - ChangePhase(WM_PHASE_608); - return TRUE; - } - - ChangePhase(WM_PHASE_STOP); - return TRUE; - case VK_SHIFT: - m_input | KEY_FIRE; - case VK_LEFT: - m_input | KEY_LEFT; - break; - case VK_UP: - m_input | KEY_UP; - break; - case VK_RIGHT: - m_input | KEY_RIGHT; - break; - case VK_DOWN: - m_input | KEY_DOWN; - break; - case VK_HOME: - return TRUE; - case VK_SPACE: - if (m_bRunMovie) - { - StopMovie(); - m_pSound->SetSuspendSkip(1); - return TRUE; - } - case VK_PAUSE: - m_bPause = !m_bPause; - NetSetPause((m_pDecor->GetPause()), m_bPause); - return TRUE; - case VK_CONTROL: - m_input | KEY_JUMP; - break; - case VK_F1: - if (m_phase == WM_PHASE_PLAY) - { - ChangePhase(WM_PHASE_HELP); - return TRUE; - } - return TRUE; - case VK_F2: - if (m_phase == WM_PHASE_PLAY) - { - ChangePhase(WM_PHASE_SETUPp); - return TRUE; - } - return TRUE; - case VK_F3: - if (m_phase == WM_PHASE_PLAY) - { - ChangePhase(WM_PHASE_GWRITE); - return TRUE; - } - return TRUE; - case VK_F4: - if (m_phase == WM_PHASE_PLAY) - { - ChangePhase(WM_PHASE_GREADp); - return TRUE; - } - return TRUE; - } - case WM_KEYUP: - switch (wParam) - { - case VK_CONTROL: - m_bCtrlDown = FALSE; - m_bFillMouse = FALSE; - MouseSprite(GetMousePos()); - return TRUE; - } - break; - case WM_LBUTTONDOWN: - case WM_RBUTTONDOWN: - m_bMouseDown = TRUE; - MouseSprite(pos); - if (EventButtons(message, wParam, lParam) ) return TRUE; - if ((m_phase == WM_PHASE_BUILD) && (PlaceMenu(celX, celY, wParam, (int*)1)) ) - { - return TRUE; - } - if ((m_phase != WM_PHASE_PLAY) && (m_phase != WM_PHASE_PLAYTEST)) - { - return FALSE; - } - if (BuildUp() != FALSE) - { - return TRUE; - } - return FALSE; - case WM_MOUSEMOVE: - if (m_mouseType == MOUSETYPEGRA) - { - if (m_bShowMouse) - { - ShowCursor(FALSE); - m_pPixmap->MouseShow(TRUE); - m_bShowMouse = FALSE; - } - } - if (m_mouseType == MOUSETYPEWINPOS && - (pos.x != m_oldMousePos.x || - pos.y != m_oldMousePos.y)) - { - m_oldMousePos = pos; - ClientToScreen(m_hWnd, &m_oldMousePos); - SetCursorPos(m_oldMousePos.x, m_oldMousePos.y); - } - m_oldMousePos = pos; - - MouseSprite(pos); - if (EventButtons(message, wParam, lParam)) return TRUE; - break; - - case WM_NCMOUSEMOVE: - if (m_mouseType == MOUSETYPEGRA) - { - if (!m_bShowMouse) - { - ShowCursor(TRUE); - m_pPixmap->MouseShow(FALSE); - m_bShowMouse = TRUE; - } - } - break; - case WM_RBUTTONUP: - m_bMousePress = FALSE; - MouseSprite(pos); - if (EventButtons(message, wParam, lParam)) return TRUE; - if ((m_phase == WM_PHASE_BUILD) && (BuildUp() != FALSE)) return TRUE; - if (((m_phase == WM_PHASE_PLAY) || (m_phase == WM_PHASE_PLAYTEST)) && (BuildUp() != FALSE)) return TRUE; - if (m_phase == WM_PHASE_BYE) - { - PostMessageA(m_hWnd, WM_CLOSE, 0, 0); - return FALSE; - } - return FALSE; - case WM_PHASE_INIT: - case WM_PHASE_PLAY: - case WM_PHASE_BUILD: - case WM_PHASE_NAMEg: - case WM_PHASE_CLEARg: - case WM_PHASE_INFO: - case WM_PHASE_PLAYTEST: - case WM_PHASE_SETUP: - case WM_PHASE_MUSIC: - case WM_PHASE_PLAYMOVIE: - case WM_PHASE_WINMOVIE: - case WM_PHASE_SETUPp: - case WM_PHASE_REGION: - case WM_PHASE_GAMER: - case WM_PHASE_WINMOVIEd: - case WM_PHASE_WINMOVIEm: - case WM_PHASE_BYE: - case WM_PHASE_NAMEd: - case WM_PHASE_WRITEd: - case WM_PHASE_READd: - case WM_PHASE_CLEARd: - case WM_PHASE_SERVICE: - case WM_PHASE_DPLAY_DO_SERVICE: - case WM_PHASE_DPLAY_CANCEL_SERVICE: - case WM_PHASE_SESSION: - case WM_PHASE_JOINGAME: - case WM_PHASE_DPLAY_CREATE_LOBBY: - case WM_PHASE_DPLAY_REFRESH: - case WM_PHASE_DPLAY_CANCEL_SESSION: - case WM_PHASE_MULTI: - case WM_PHASE_DPLAY_START_GAME_2: - case WM_PHASE_DPLAY_CANCEL_MULTI: - case WM_PHASE_CREATE: - case WM_PHASE_DPLAY_CREATE: - case WM_PHASE_DPLAY_CANCEL_CREATE: - case WM_PHASE_STOP: - case WM_PHASE_HELP: - case WM_PHASE_GWRITE: - case WM_PHASE_GREADp: - case WM_PHASE_GREAD: - case WM_PHASE_DOQUIT: - case WM_PHASE_634: - if (ChangePhase(message) != FALSE) - { - return TRUE; - } - return FALSE; - case WM_PHASE_PRIVATE: - m_bPrivate = TRUE; - if (ChangePhase(WM_PHASE_INFO) != FALSE) - { - return TRUE; - } - return FALSE; - case WM_PHASE_DEMO: - m_demoNumber = 0; - DemoPlayStart(); - return FALSE; - - case WM_PREV: - if (m_phase == WM_PHASE_MULTI) - { - m_multi - (((m_input & KEY_JUMP) != 0) & 9) + 1; - if (m_multi < 1) - { - m_multi = 1; - } - // m_pDecor->CurrentRead(m_gamer, m_multi + 200, FALSE); - if (m_bDrawMap != FALSE) - { - - } - NetSendLobby(); - //NetAdjustLobbyButtons() - return TRUE; - } - if (m_bPrivate == FALSE) - { - m_mission--; - if (m_mission < 1) m_mission = 1; - else - { - m_private--; - if (m_private < 1) - { - if (ChangePhase(WM_PHASE_INFO) != FALSE) return TRUE; - } - return FALSE; - } - } - if (ChangePhase(WM_PHASE_INFO) != FALSE) - { - return TRUE; - } - return FALSE; - - case WM_DECOR2: - SetState(WM_DECOR1, 0); - SetState(WM_DECOR2, 1); - SetState(WM_DECOR3, 0); - SetState(WM_DECOR4, 0); - SetState(WM_DECOR5, 0); - SetState(WM_DECOR6, 0); - SetState(WM_DECOR7, 0); - SetState(WM_DECOR8, 0); - SetState(WM_DECOR9, 0); - SetState(WM_DECOR10, 0); - SetState(WM_DECOR11, 0); - m_pDecor->FindAndSetMenus(2, GetMenu(WM_DECOR2)); - m_menuIndex = 1; - m_menuDecor[1] = GetMenu(WM_DECOR2); - return FALSE; - case WM_DECOR3: - SetState(WM_DECOR1, 0); - SetState(WM_DECOR2, 0); - SetState(WM_DECOR3, 1); - SetState(WM_DECOR4, 0); - SetState(WM_DECOR5, 0); - SetState(WM_DECOR6, 0); - SetState(WM_DECOR7, 0); - SetState(WM_DECOR8, 0); - SetState(WM_DECOR9, 0); - SetState(WM_DECOR10, 0); - SetState(WM_DECOR11, 0); - m_pDecor->FindAndSetMenus(3, GetMenu(WM_DECOR3)); - m_menuIndex = 2; - m_menuDecor[2] = GetMenu(WM_DECOR3); - return FALSE; - } - - return FALSE; -} - -BOOL CEvent::LoadState(BOOL save) -{ - BOOL saveNum; - CEvent* pEvent; - - saveNum = save; - - if (m_pDecor->Read(m_gamer, save, (BOOL*)&pEvent, &save) == FALSE) - { - return FALSE; - } - m_bPrivate = save; - SetMission((int)pEvent); - m_saveIndex = saveNum; - return TRUE; -} - -int CEvent::MousePosToSprite(POINT pos) -{ - int sprite; - - sprite = SPRITE_POINTER; - - if (m_phase == WM_PHASE_PLAY || - m_phase == WM_PHASE_PLAYTEST || - m_phase == WM_PHASE_BUILD || - m_phase == WM_PHASE_BYE || - !MouseOnButton(pos)) - { - sprite = SPRITE_POINTER; - } - if (m_bWaitMouse) - { - sprite = SPRITE_WAIT; - } - if (m_bHideMouse) - { - sprite = SPRITE_EMPTY; - } - if (m_bFillMouse) - { - sprite = SPRITE_FILL; - } - - return sprite; -} - -void CEvent::MouseSprite(POINT pos) -{ - m_mouseSprite = MousePosToSprite(pos); - - m_pPixmap->SetMousePosSprite(pos, m_mouseSprite, m_bDemoPlay); - ChangeSprite(m_mouseSprite); -} - -void CEvent::WaitMouse(BOOL bWait) -{ - m_bWaitMouse = bWait; - - if ( bWait ) - { - m_mouseSprite = SPRITE_WAIT; - } - else - { - m_mouseSprite = MousePosToSprite(GetMousePos()); - } - m_pPixmap->SetMouseSprite(m_mouseSprite, m_bDemoPlay); - ChangeSprite(m_mouseSprite); -} - -void CEvent::HideMouse(BOOL bHide) -{ - m_bWaitMouse = bHide; - - if ( bHide ) - { - m_mouseSprite = SPRITE_EMPTY; - } - else - { - m_mouseSprite = MousePosToSprite(GetMousePos()); - } - m_pPixmap->SetMouseSprite(m_mouseSprite, m_bDemoPlay); - ChangeSprite(m_mouseSprite); -} - -void CEvent::FillMouse(int bFill) -{ - m_bFillMouse = bFill; - - if (bFill) - { - m_mouseSprite = SPRITE_FILL; - } - else - { - m_mouseSprite = MousePosToSprite(GetMousePos()); - } - m_pPixmap->SetMouseSprite(m_mouseSprite, m_bDemoPlay); - ChangeSprite(m_mouseSprite); -} - -BOOL CEvent::EventButtons(UINT message, WPARAM wParam, LPARAM lParam) -{ - POINT pos, test; - int i, lg, oldx, sound, res; - UINT uid; - - m_textToolTips[0] = 0; - oldx = m_posToolTips.x; - m_posToolTips.x = -1; - if (m_phase != WM_PHASE_PLAY && m_phase != WM_PHASE_PLAYTEST) - { - for (i = 0; i < 2; i++) - { - if (!m_jauges[i].GetHide()) - { - - uid = 0xFFFFFFF; - - if (uid < 0) - { - LoadString(TX_NOTINDEMO + i, m_textToolTips, 50); - lg = GetTextWidth(m_textToolTips); - test.x += (DIMJAUGEX - lg) / 2; - test.y += 4; - m_posToolTips = test; - break; - } - } - } - if (oldx != m_posToolTips.x) - { - for (i = 0; i < 2; i++) - { - m_jauges[i].Redraw(); - } - } - } - else - { - i = 0; - while (table[m_index].buttons[i].message != 0) - { - res = m_buttons[i].GetToolTips(pos); - if (res != -1) - { - LoadString(res, m_textToolTips, 50); - lg = GetTextWidth(m_textToolTips); - pos.x += 10; - pos.y += 20; - if (pos.x > LXIMAGE - lg) pos.x = LXIMAGE - lg; - if (pos.y > LYIMAGE - 14) pos.y = LYIMAGE - 14; - m_posToolTips = pos; - break; - } - i++; - } - } - i = 0; - while (table[m_index].buttons[i].message != 0) - { - if (m_buttons[i].TreatEvent(message, wParam, lParam)) return TRUE; - i++; - } - if (m_phase == WM_PHASE_PLAY || m_phase == WM_PHASE_PLAYTEST) - { - if (m_menu.TreatEvent(message, wParam, lParam)) return TRUE; - } - return FALSE; -} - -BOOL CEvent::MouseOnButton(POINT pos) -{ - int i; - - i = 0; - while ( table[m_index].buttons[i].message != 0 ) - { - if ( m_buttons[i].MouseOnButton(pos) ) return TRUE; - i ++; - } - - return FALSE; -} - -int CEvent::SearchPhase(UINT phase) -{ - int i = 0; - - while (table[i].phase != 0) - { - if (table[i].phase == phase) return i; - i++; - } - - return -1; -} - -int CEvent::GetWorld() -{ - //m_mission = mission; - if (m_bPrivate) return m_bPrivate; - if (m_bMulti) return m_multi+200; - else return m_mission; -} - -int CEvent::GetPhysicalWorld() -{ - if ( m_bPrivate ) return m_bPrivate; - if ( m_bMulti ) return m_multi+200; - else return m_mission; -} - -BOOL CEvent::IsPrivate() -{ - return m_bPrivate; -} - -BOOL CEvent::IsMulti() -{ - return m_bMulti; -} - -void CEvent::ChangeButtons(int message) -{ - int button, state, volume, max; - int i; - char* pButtonExist; - char playerName[260]; - Term* pTerm; - - if (((m_phase == WM_PHASE_GAMER) && (WM_BUTTON0 < message)) && (WM_BUTTON11 > message)) - { - m_gamer = message + 0x4c8; - for (i = 0; i < 10; i++) - { - SetState(i + WM_BUTTON1, m_gamer + -1 == i); - } - ReadInfo(m_gamer); - } - if ((m_phase == WM_PHASE_NAMEg) && (message == WM_PHASE_CONFIRM)) - { - strcpy(m_gamerName, m_textInput); - WriteInfo(m_gamer, playerName); - } - if ((m_phase == WM_PHASE_NAMEd) && (message == WM_PHASE_61C)) - { - m_pDecor->SetGamerName(m_textInput); - ChangePhase(WM_PHASE_INFO); - } - if ((m_phase == WM_PHASE_CLEARg) && (message == WM_PHASE_YES)) - { - ReadPlayer(m_gamer); - ChangePhase(WM_PHASE_GAMER); - } - if ((m_phase == WM_PHASE_CLEARd) && (message == WM_PHASE_61F)) - { - m_pDecor->SomethingMissionPath(m_gamer, GetWorld(), m_bAccessBuild == FALSE); - ChangePhase(WM_PHASE_INFO); - } - if (m_phase == WM_PHASE_MUSIC) - { - m_pDecor->SetMusic(message + ~WM_BUTTON0); - ChangePhase(m_phase); - } - if (m_phase == WM_PHASE_REGION) - { - if ((WM_BUTTON0 < message) && (WM_BUTTON33 > message)) - { - m_pDecor->SetRegion(message + ~WM_BUTTON0); - ChangePhase(m_phase); - } - } -} -int CEvent::GetWorldGroup() -{ - int mission; - m_mission = mission; - - if (m_mission % 10 != 0 && m_mission != 99) - { - m_mission = (mission / 10) * 10; - return -(m_mission >> 31); - } - m_mission = 1; - return m_mission / 10; -} - -void CEvent::SetMission(int index) -{ - if (m_bPrivate != 0) - { - m_private = index; - return; - } - if (m_bMulti != 0) - { - m_multi = index; - return; - } - m_mission = index; - return; -} - -UINT CDecor::GetPhase() -{ - return m_phase; -} - -void CEvent::TryInsert() -{ - if ( m_tryInsertCount == 0 ) - { - ChangePhase(m_tryPhase); - } - else - { - m_tryInsertCount --; - } -} - -void CEvent::ReadAll() -{ - BOOL mission; - BOOL read; - BOOL bUser; - BOOL bPrivate; - BOOL bMission; - - if ((-1 < m_fileIndex) && (*(int*)((int)(m_filenameBuffer + -1) + m_fileIndex * 4 + 216) != 0)) - { - //mission = m_pDecor->MissionStart(m_gamer, 999, bUser); - - if (mission != FALSE) - { - read = m_pDecor->Read(m_gamer, m_fileIndex, &bMission, &bPrivate); - - if (read != FALSE) - { - //m_pDecor->DrawMap(FALSE, -1); - } - m_pDecor->Read(m_gamer, 999, &bMission, &bPrivate); - } - } - return; -} - -BOOL CEvent::SaveState(int rank) -{ - BOOL bMission; - BOOL bUser; - char str[100]; - - //bMission = m_pDecor->MissionStart(m_gamer, rank, bUser); - - if (bMission == FALSE) - { - return FALSE; - } - LoadString(TX_GAMESAVED, str, 100); - m_pDecor->NotifPush(str); - // m_field959_0x6d10 = rank; - return TRUE; -} - -void CEvent::SomethingUserMissions(char* lpFilename, LPCSTR fileSomething) -{ - UINT buffer; - char* folderName; - - mkdir("\\User"); - strcpy(lpFilename, "\\User\\"); - strcat(lpFilename, fileSomething); - - if ((folderName = strstr(folderName, ".xch")) || ((buffer = 0, folderName - lpFilename != strlen(lpFilename) - 4))) - { - buffer = 0; - strcat(lpFilename, ".xch"); - } - return; -} - -// Add SomethingHubWorld once figured out. - -// Very rough code, needs improvement - -BOOL CEvent::ChangePhase(UINT phase) -{ - int index, music, i, j, nb, oldPhase; - POINT totalDim, iconDim; - char filename[MAX_PATH]; - char* pButtonExist; - BOOL bEnable, bHide; - Term* pTerm; - char* playerName; - char doors[200]; - char text[100]; - char res[100]; - BYTE door[200]; - - -// sprintf(filename, "CEvent::ChangePhase [Begin] --- % ", phase - WM_USER); -// OutputNetDebug(filename); - if (phase == WM_PHASE_634) - { - PostMessageA(m_hWnd, 16, 0, 0); - return TRUE; - } - m_pDecor->SetSpeedY(m_bDemoPlay); - if (m_mouseType == MOUSETYPEGRA && m_bFullScreen) - { - ShowCursor(FALSE); - m_bShowMouse = FALSE; - } - if (phase == WM_PHASE_608) - { - //m_pDecor->CurrentRead(999, 1, m_gamer); - phase = WM_PHASE_BUILD; - } - - if (m_bDemoPlay == FALSE && - phase == WM_PHASE_PLAY || - phase == WM_PHASE_PLAY || - phase == WM_PHASE_STOP || - phase == WM_PHASE_SETUP || - phase == WM_PHASE_HELP || - phase == WM_PHASE_GREAD || - phase == WM_PHASE_GREADp || - phase == WM_PHASE_GWRITE) - { - m_pSound->StopMusic(); - } - - m_textToolTips[0] = 0; - m_posToolTips.x = -1; - m_pDecor->SetPause(FALSE); - m_bPause = FALSE; - m_bCtrlDown = FALSE; - m_bMouseDown = FALSE; - m_bInfoHelp = FALSE; - m_bHiliInfoButton = FALSE; - m_bHiliHelpButton = FALSE; - - if ((((((m_bMulti != FALSE) && (phase != WM_PHASE_PLAY)) && (phase != WM_PHASE_DOQUIT)) && ((phase != WM_PHASE_STOP && (phase != WM_PHASE_SETUPp)))) && ((phase != WM_PHASE_HELP && ((phase != WM_PHASE_GREAD && (phase != WM_PHASE_GREADp)))))) && (phase != WM_PHASE_GWRITE)) - { - //m_pNetwork->Close(); - m_bMulti = FALSE; - m_pDecor->SetMulti(FALSE); - } - - if (m_phase == WM_PHASE_INIT) - { - m_demoTime = 0; - } - - if (phase == WM_PHASE_PLAY) - { - if (((m_bDemoPlay == FALSE) && (index = GetWorld(), 299 < index)) && (index = GetWorld(), index < LXIMAGE / 2)) - { - DemoRecStart(); - } - } - else - { - DemoRecStop(); - } - - if (phase == WM_PHASE_DOQUIT) - { - if (m_bPrivate == FALSE) - { - int mission; - mission = m_mission; - if (mission != 1) - { - if (mission == 99 || mission % 10 == 0) - { - mission = 1; - } - else - { - mission = (mission / 10) * 10; - } - SetMission(m_mission); - m_phase = WM_PHASE_PLAY; - - return ChangePhase(WM_PHASE_PLAY); - } - return ChangePhase(WM_PHASE_GAMER); - } - } - - - if (phase == WM_PHASE_DPLAY_DO_SERVICE) - { - if (NetCreate(m_fileIndex) != FALSE) - { - m_pNetwork->FreeProviderList(); - if (NetEnumSessions() != FALSE) - return ChangePhase(WM_PHASE_SESSION); - } - m_pNetwork->FreeProviderList(); - return ChangePhase(WM_PHASE_SERVICE); - } - - if (phase == WM_PHASE_DPLAY_CANCEL_SERVICE) - { - m_pNetwork->FreeProviderList(); - return ChangePhase(WM_PHASE_GAMER); - } - - index = SearchPhase(phase); - if (index < 0) return FALSE; - - m_pPixmap->MouseInvalidate(); - HideMouse(FALSE); - WaitMouse(TRUE); - - if (phase == WM_PHASE_GAMER || phase == WM_PHASE_PLAY) - { - OutputNetDebug("CEvent::ChangePhase_[WriteInfo]\r\n"); - WriteInfo(m_gamer, playerName); - } - - oldPhase = m_phase; - m_phase = phase; - m_index = index; - - if ((((oldPhase == WM_PHASE_BUILD) && (phase == WM_PHASE_INFO)) || (oldPhase == WM_PHASE_REGION)) || ((oldPhase == WM_PHASE_NAMEd || (oldPhase == WM_PHASE_MUSIC)))) - { - //m_pDecor->CurrentWrite(m_gamer, GetWorld(), (m_bAccessBuild == FALSE)); - } - - if (m_phase == WM_PHASE_GAMER) - { - char* playername; - WriteInfo(m_gamer, playername); - char buff[100]; - char buffer[100]; - char gamer[100]; - int i; - for (i = 0; i < 8; i++) - { - int f, n; - n = 0; - f = (n + 1225); - if (ReadInfo(f + 1) == FALSE) - { - LoadString(TX_PLAYERFREE, buff, 100); - } - else - { - strcpy((char*)m_gamerNameList, m_gamerName); - for (i = 0; i < 200; i++) - { - int num = 0; - if (door[i] == 0) - { - num++; - } - } - m_pDecor->InitalizeDoors(door); - if (door == (BYTE*)1) - { - LoadString(TX_NUMDOOROPEN, buffer, 100); - sprintf(buffer, gamer, 1); - strcat((char*)m_gamerNameList, buffer); - } - if ((BYTE*)1 < door) - { - LoadString(TX_NUMDOORSOPEN, buffer, 100); - sprintf(buffer, gamer, door); - strcat((char*)m_gamerNameList, buffer); - } - SetState(f, (m_gamer + -1 == n)); - f++; - n++; - - } - } - ReadInfo(m_gamer); - } - - CreateButtons(); - m_bMenu = FALSE; - m_menu.Delete(); - - WaitMouse(FALSE); - - if ((m_phase == WM_PHASE_PLAY) || (m_phase == WM_PHASE_PLAYTEST)) - { - FillMouse(TRUE); - } - m_pDecor->ChangePhase(phase); - return TRUE; -} - -UINT CEvent::GetPhase() -{ - return m_phase; -} - -// Implement LoadLevel - -void CEvent::MovieToStart() -{ - if (m_movieToStart[0] != 0) - { - HideMouse(TRUE); - - if (StartMovie(m_movieToStart)) - { - m_phase = m_phaseAfterMovie; - } - else - { - ChangePhase(m_phaseAfterMovie); - } - - m_movieToStart[0] = 0; - } -} - -BOOL CEvent::CreateCelPosForMenu(UINT celX, UINT celY, WPARAM wParam) -{ - POINT cel; - - if ((wParam & 3) != 0) - { - /// Menu function - } - cel.x = celX; - cel.y = celY; - //m_pDecor->SetCelPosFromScreenPos(cel); - return TRUE; -} - -/* -void CEvent::ChatLength() -{ - int i; - char (*text)[5]; - - text = m_chatZone; - - for (i = 0; i < 5; i--) - { - const char* n; - text += 100; - memcpy(m_chatZone, text, strlen(text + 100) + 1) - } -} -*/ - -BOOL CEvent::BuildDown(POINT pos, int fwKeys, BOOL bMix) -{ - POINT cel; - int menu, channel, icon; - - if (pos.x < POSDRAWX || pos.x > POSDRAWX + DIMDRAWX || - pos.y < POSDRAWY || pos.y > POSDRAWY + DIMDRAWY) return FALSE; - - if (GetState(WM_DECOR1) == 1) - { - //cel = m_pDecor->ConvPosToCel2(pos); - //m_pDecor->BlupiDelete(pos); - } - if (GetState(WM_DECOR2) == 2) - { - //cel = m_pDecor->ConvPosToCel2(pos); - menu = GetMenu(WM_DECOR2); - } -} - -BOOL CEvent::BuildMove(POINT pos, int fwKeys) -{ - if (fwKeys & MK_LBUTTON) - { - BuildDown(pos, fwKeys, FALSE); - } - //m_pDecor->ConvPosToCel2(pos); - return TRUE; -} - -void CEvent::MouseRelease() -{ - m_bMouseRelease = TRUE; - ShowCursor(TRUE); - return; -} - -void CEvent::MouseCapture() -{ - m_bMouseRelease = FALSE; - ShowCursor(FALSE); - return; -} - -BOOL CEvent::NetCreate(int session) -{ - BOOL created; - - MouseRelease(); - created = m_pNetwork->CreateProvider(session); - MouseCapture(); - return created; -} - -BOOL CEvent::NetEnumSessions() -{ - BOOL enumSess; - - MouseRelease(); - enumSess = m_pNetwork->EnumProviders(); - MouseCapture(); - return enumSess; -} - -BOOL CEvent::BuildUp() -{ - return TRUE; -} - -void CEvent::TryPhase() -{ - m_tryPhase = 1; - ShowCursor(1); -} - -void CEvent::UnTryPhase() -{ - m_tryPhase = 0; - ShowCursor(1); -} - -int CEvent::GetTryPhase() -{ - return m_tryPhase; -} - -BOOL CEvent::StartMovie(char* pFilename) -{ - RECT rect; - char filename[MAX_PATH]; - - if (!m_pMovie->GetEnable()) return FALSE; - if (!m_bMovie) return FALSE; - - if (!m_pMovie->IsExist(pFilename)) return FALSE; - - rect.left = 1; - rect.top = 1; - rect.right = LXIMAGE - 2; - rect.bottom = LYIMAGE - 2; - - m_pSound->StopMusic(); - m_pPixmap->SavePalette(); - - strcpy(filename, pFilename); - strcpy(filename + strlen(filename) - 4, ".blp"); - m_pSound->Cache(SOUND_MOVIE, filename); - - if (m_pMovie->Play(m_hWnd, rect, pFilename)) return FALSE; - m_bRunMovie = TRUE; - m_pSound->Play(SOUND_MOVIE, 0, 0); - return TRUE; -} - -void CEvent::StopMovie() -{ - m_pMovie->Stop(m_hWnd); - m_pPixmap->RestorePalette(); - m_pPixmap->MouseInvalidate(); - m_pSound->Flush(SOUND_MOVIE); - ChangePhase(m_phase); - m_bRunMovie = FALSE; -} - -BOOL CEvent::IsMovie() -{ - return m_bRunMovie; -} - -BOOL CEvent::ReadLibelle(int world, BOOL bSchool, BOOL bHelp) -{ - FILE* file = NULL; - char* pBuffer = NULL; - char* pText; - char* pDest; - char indic; - int nb, h1, h2; - - pBuffer = (char*)malloc(sizeof(char) * 2560); - if (pBuffer == NULL) goto error; - memset(pBuffer, 0, sizeof(char) * 2560); - - //file = fopen - - -error: - if (pBuffer != NULL) free(pBuffer); - if (file != NULL) fclose(file); - return FALSE; -} - -void CEvent::SetLives(int lives) -{ - m_lives = lives; -} - -void CEvent::SetSpeed(int speed) -{ - int max; - - if ( m_bSpeed ) max = 2; - - if ( speed > max ) speed = max; - - m_speed = speed; -} - -int CEvent::GetSpeed() -{ - return m_speed; -} - -BOOL CEvent::GetPause() -{ - return m_bPause; -} - -int CEvent::MissionBack() -{ - int num = m_mission; - - if (num % 10 == 0 || - num == 99) - { - m_mission = 1; - return num / 10; - } - else - { - m_mission = num / 10 * 10; - return (num < 0); - } -} - -void CEvent::DemoRecStart() -{ - m_pDemoBuffer = (DemoEvent*)malloc(MAXDEMO*sizeof(DemoEvent)); - if ( m_pDemoBuffer == NULL ) return; - memset(m_pDemoBuffer, 0, MAXDEMO*sizeof(DemoEvent)); - - m_demoTime = 0; - m_demoIndex = 0; - m_bDemoRec = TRUE; - m_bDemoPlay = FALSE; - - InitRandom(); - m_pDecor->SetTime(0); - m_speed = 1; -} - -void CEvent::DemoRecStop() -{ - FILE* file = NULL; - DemoHeader header; - - if ( m_bDemoPlay ) return; - - if ( m_pDemoBuffer != NULL ) - { - DeleteFileA("data\\demo.3d.blp"); - file = fopen("data\\demo.3d.blp", "wb"); - if ( file != NULL ) - { - memset(&header, 0, sizeof(DemoHeader)); - header.majRev = 1; - header.minRev = 0; - header.bSchool = m_bSchool; - header.bPrivate = m_bPrivate; - fwrite(&header, sizeof(DemoHeader), 1, file); - fwrite(m_pDemoBuffer, sizeof(DemoEvent), m_demoIndex, file); - fclose(file); - } - free(m_pDemoBuffer); - m_pDemoBuffer = NULL; - } - - m_bDemoRec = FALSE; - m_demoTime = 0; -} - -BOOL CEvent::DemoPlayStart() -{ - char filename[MAX_PATH]; - FILE* file = NULL; - DemoHeader header; - int nb, world, time, total, mission; - - m_pDemoBuffer = (DemoEvent*)malloc(MAXDEMO * sizeof(DemoEvent)); - if (m_pDemoBuffer == NULL) return FALSE; - memset(m_pDemoBuffer, 0, MAXDEMO * sizeof(DemoEvent)); - - sprintf(filename, "data\\demo%.3d.blp", m_demoNumber); - AddCDPath(filename); // ajoute l'acc�s au CD-Rom - file = fopen(filename, "rb"); - if (file == NULL) - { - DemoPlayStop(); - return FALSE; - } - - nb = fread(&header, sizeof(DemoHeader), 1, file); - if (nb < 1) - { - DemoPlayStop(); - return FALSE; - } - m_bSchool = header.bSchool; - m_bPrivate = header.bPrivate; - //m_pDecor->SetSkill(header.skill); - - m_demoEnd = fread(m_pDemoBuffer, sizeof(DemoEvent), MAXDEMO, file); - fclose(file); - - m_demoTime = 0; - m_demoIndex = 0; - m_bDemoPlay = TRUE; - m_bDemoRec = FALSE; - - /* - if (!m_pDecor->CurrentRead(m_gamer, mission, FALSE)) - { - DemoPlayStop(); - return FALSE; - } - ChangePhase(WM_PHASE_PLAY); - InitRandom(); - m_pDecor->SetTime(0); - m_speed = 1; - */ - return TRUE; -} - -void CEvent::DemoPlayStop() -{ - if (m_pDemoBuffer != NULL) - { - free(m_pDemoBuffer); - m_pDemoBuffer = NULL; - } - m_bDemoPlay = FALSE; - m_bDemoRec = FALSE; - m_demoTime = 0; - m_input = 0; - m_pDecor->SetInput(0); - m_private = 1; - ChangePhase(WM_PHASE_INIT); -} - -void CEvent::DemoStep() -{ - int time; - UINT message; - WPARAM wParam; - LPARAM lParam; - POINT pos; - - if (m_phase == WM_PHASE_INIT) - { - if (m_demoTime > DEF_TIME_DEMO) // ~30 secondes �coul�es ? - { - m_demoNumber = 0; - DemoPlayStart(); // d�marre une d�mo automatique - } - } - - if (m_bDemoPlay && // d�mo en lecture ? - m_pDemoBuffer != NULL) - { - while (TRUE) - { - time = m_pDemoBuffer[m_demoIndex].time; - if (time > m_demoTime) break; - - message = m_pDemoBuffer[m_demoIndex].message; - wParam = m_pDemoBuffer[m_demoIndex].wParam; - lParam = m_pDemoBuffer[m_demoIndex].lParam; - m_demoIndex++; - - if (message == WM_MOUSEMOVE && - m_mouseType == MOUSETYPEWIN) - { - pos = ConvLongToPos(lParam); - ClientToScreen(m_hWnd, &pos); - SetCursorPos(pos.x, pos.y); - } - - TreatEventBase(message, wParam, lParam); - - if (m_demoIndex >= m_demoEnd) - { - m_demoNumber++; // d�mo suivante - if (!DemoPlayStart()) // d�marre la d�mo suivante - { - m_demoNumber = 0; // premi�re d�mo - DemoPlayStart(); // d�marre la d�mo - } - return; - } - } - } - - m_demoTime++; -} - -void CEvent::DemoRecEvent(UINT message, UINT input, WPARAM wParam, LPARAM lParam) -{ - if (m_demoIndex > 0 && - m_pDemoBuffer[m_demoIndex - 1].time == m_demoTime && - m_pDemoBuffer[m_demoIndex - 1].input == m_input) - - m_demoIndex++; - if (m_demoIndex >= MAXDEMO) - { - DemoRecStop(); - } -} - -BOOL CEvent::WriteInfo(int gamer, char* playername) -{ - char filename[MAX_PATH]; - FILE* file = NULL; - DescInfo info; - int nb; - int doors; - BYTE door[200]; - char text[100]; - - sprintf(filename, "data\\info%.3d.blp", gamer); - AddUserPath(filename); - file = fopen(filename, "wb"); - if (file == NULL) goto error; - - strcpy(text, (const char*)m_gamerName); - - info.majRev = 1; - info.prive = m_private; - info.mission = m_mission; - info.multi = m_multi; - info.lives = m_lives; - info.speed = m_speed; - info.bMovie = m_bMovie; - info.bHiliInfoButton = m_bHiliInfoButton; - info.bAccessBuild = m_bAccessBuild; - - m_pDecor->InitalizeDoors(door); - - info.audioVolume = m_pSound->GetAudioVolume(); - info.midiVolume = m_pSound->GetMidiVolume(); - - - - nb = fwrite(&info, sizeof(DescInfo), 1, file); - if (nb < 1) goto error; - - fclose(file); - return TRUE; - -error: - if (file != NULL) fclose(file); - return FALSE; -} - -BOOL CEvent::ReadInfo(int gamer) -{ - char filename[MAX_PATH]; - FILE* file = NULL; - DescInfo info; - int nb; - BYTE doors[200]; - char buffer[100]; - - m_playerIndex = 1; - m_pDecor->InitGamer(); - m_lives = 3; - m_mission = 1; - m_private = 1; - m_multi = 1; - - LoadString(TX_READINFO, buffer, 100); - sprintf(m_gamerName, buffer, gamer); - sprintf(filename, "data\\info%.3d.blp", gamer); - AddUserPath(filename); - - - file = fopen(filename, "rb"); - if (file == NULL) goto error; - - nb = fread(&info, sizeof(DescInfo), 1, file); - if (nb < 1) goto error; - - if ((BYTE*)m_gamerName) - { - strcpy((char*)m_gamerName, buffer); - } - - info.majRev = 1; - info.prive = m_private; - info.mission = m_mission; - info.multi = m_multi; - info.lives = m_lives; - info.speed = m_speed; - info.bMovie = m_bMovie; - info.bHiliInfoButton = m_bHiliInfoButton; - info.bAccessBuild = m_bAccessBuild; - - m_pDecor->SetAccessBuild(info.bAccessBuild); - - m_pSound->SetAudioVolume(info.audioVolume); - m_pSound->SetMidiVolume(info.midiVolume); - m_pDecor->MemorizeDoors(doors); - - fclose(file); - return TRUE; - -error: - if (file != NULL) fclose(file); - return FALSE; -} - -BOOL CEvent::ReadPlayer(int gamer) -{ - char filename[MAX_PATH]; - - m_playerIndex = 0; - - sprintf(filename, "data\\info%.3d.blp", gamer); - AddUserPath(filename); - remove(filename); - return TRUE; -} - diff --git a/event.h b/event.h deleted file mode 100644 index 31e5bfd..0000000 --- a/event.h +++ /dev/null @@ -1,357 +0,0 @@ -// Event.h - - - -///////////////////////////////////////////////////////////////////////////// - -#pragma once - -using namespace std; - -#include "movie.h" -#include "menu.h" -#include "button.h" - - -typedef struct -{ - UINT message; - int type; - int iconMenu[20]; - int x, y; - int toolTips[20]; -} -Button; - -typedef struct -{ - UINT phase; - char backName[36]; - BOOL bCDrom; - BOOL bUnk; - Button buttons[MAXBUTTON]; -} -Phase; - -typedef struct -{ - int HeaderLength[10]; - int DoorsLength[200]; - int GamerLength[10 + 200]; - int MaxGamer[3]; - int TotalLength[10 + (10 + 200) + 3]; - BYTE data; -} -GameData; - -typedef struct -{ - short majRev; - short minRev; - short bSchool; - short bPrivate; - short world; - short skill; - short reserve1[99]; -} -DemoHeader; - -typedef struct -{ - int time; - short input; - UINT message; - WPARAM wParam; - LPARAM lParam; -} -DemoEvent; - -typedef enum -{ - cheat_cleanall = 2, - cheat_funskate = 6, - cheat_givecopter = 7, - cheat_jeepdrive = 8, - cheat_alltreasure = 9, - cheat_endgoal = 10, - cheat_roundshield = 12, - cheat_quicklollipop = 13, - cheat_tenbombs = 14, - cheat_birdlime = 15, - cheat_drivetank = 16, - cheat_powercharge = 17, - cheat_hidedrink = 18, - cheat_iovercraft = 22, - cheat_udynamite = 23, - cheat_wellkeys = 24 -} -cheat; - -typedef enum -{ - KEY_NONE, - KEY_LEFT, - KEY_RIGHT, - KEY_UP, - KEY_DOWN, - KEY_JUMP, - INPUT_DOWN, - INPUT_UP, - KEY_FIRE -}; - -class CEvent -{ -public: - CEvent(); - ~CEvent(); - - - void OutputNetDebug(const char* str); - POINT GetMousePos(); - void Create(HINSTANCE hInstance, HWND hWnd, CPixmap *pPixmap, CDecor *pDecor, CSound *pSound, CMovie *pMovie, CNetwork *pNetwork); - void SetFullScreen(BOOL bFullScreen); - void SetMouseType(int mouseType); - int GetWorld(); - int GetWorldGroup(); - void SetMission(int index); - int GetPhysicalWorld(); - int GetImageWorld(); - BOOL IsHelpHide(); - BOOL ChangePhase(UINT phase); - UINT GetPhase(); - void MovieToStart(); - BOOL NetworkNuggets(int fuck); - void HandleInputs(); - void ReadInput(); - void TryInsert(); - void SomethingUserMissions(LPCSTR lpFileName, LPCSTR thing); - void RestoreGame(); - int MissionBack(); - void TableSomething(); - - int GetButtonIndex(int button); - int GetState(int button); - void SetState(int button, int state); - BOOL GetEnable(int button); - void SetEnable(int button, int bEnable); - void SetIconMenu(int button, int* icon, int iconMenu); - BOOL GetHide(int button); - void SetHide(int button, BOOL bHide); - int GetMenu(int button); - void SetMenu(int button, int menu); - void SomethingDecor(); - - void NetSetPause(BOOL bPause, int players); - void NetSendLobby(); - - BOOL DrawButtons(); - BOOL TextSomething(); - int MousePosToSprite(POINT pos); - void MouseSprite(POINT pos); - void WaitMouse(BOOL bWait); - void HideMouse(BOOL bHide); - void FillMouse(int bFill); - POINT GetLastMousePos(); - BOOL TreatEvent(UINT message, WPARAM wParam, LPARAM lParam); - BOOL TreatEventBase(UINT message, WPARAM wParam, LPARAM lParam); - - void DecorAutoShift(POINT pos); - - BOOL StartMovie(char *pFilename); - void StopMovie(); - BOOL IsMovie(); - - void FlushInput(); - - BOOL FlipObject(); - - void Read(int message); - void Write(int message); - - void SetSpeed(int speed); - int GetSpeed(); - BOOL GetPause(); - void GetDoors(int doors); - BOOL IsShift(); - BOOL IsMulti(); - BOOL IsPrivate(); - - void DemoStep(); - void DebugDisplay(char m); - - void IntroStep(); - void SetLives(int lives); - - void ReadAll(); - BOOL SaveState(int rank); - BOOL LoadDecorRegion(); - BOOL CreateCelPosForMenu(UINT celX, UINT celY, WPARAM wParam); - void SomethingUserMissions(char* lpFilename, LPCSTR fileSomething); - - - - -protected: - void DrawTextCenter(int res, int x, int y, int font=0); - BOOL CreateButtons(); - BOOL EventButtons(UINT message, WPARAM wParam, LPARAM lParam); - BOOL MouseOnButton(POINT pos); - int SearchPhase(UINT phase); - void DecorShift(int dx, int dy); - - BOOL PlayDown(POINT pos, int fwKeys); - BOOL PlayMove(POINT pos, int fwKeys); - BOOL PlayUp(POINT pos, int fwKeys); - void ChangeButtons(int message); - - void BuildFloor(POINT cel, int insIcon); - void BuildWater(POINT cel, int insIcon); - BOOL BuildDown(POINT pos, int fwKeys, BOOL bMix=TRUE); - BOOL BuildMove(POINT pos, int fwKeys); - BOOL BuildUp(); - BOOL PlaceMenu(int celX, int celY, int WPARAM, int* object); - - void PrivateLibelle(); - BOOL ReadLibelle(int world, BOOL bSchool, BOOL bHelp); - BOOL WriteInfo(int gamer, char* playername); - BOOL ReadInfo(int gamer); - BOOL LoadState(BOOL save); - void TryPhase(); - void UnTryPhase(); - int GetTryPhase(); - BOOL ReadPlayer(int gamer); - void PutTextInputBox(POINT pos); - void ChatLength(); - - - void DemoRecStart(); - void DemoRecStop(); - BOOL DemoPlayStart(); - void DemoPlayStop(); - void DemoRecEvent(UINT message, UINT input, WPARAM wParam, LPARAM lParam); - - // Network Functions - BOOL NetCreate(int session); - BOOL NetEnumSessions(); - int NetSearchPlayer(DPID dpid); - void NetStartPlay(); - void NetSend(NetMessageType message, USHORT data); - void NetDraw(); - void ChatSend(); - void HandleChatBuffer(); - void ChatMessageSound(char* data); - - void MouseRelease(); - void MouseCapture(); - - -protected: - int m_speed; - int m_exercice; - int m_mission; - char m_gamerName[100]; - char m_gamerNameList[10][100]; - void* m_somethingJoystick; - int m_menuIndex; - int m_fileIndex; - int m_saveIndex; - int m_menuDecor[10]; - BOOL m_bMouseRelease; - int m_private; - int m_maxMission; - int m_phase; - int m_index; - int m_playerIndex; - BOOL m_bSchool; - BOOL m_bPrivate; - BOOL m_bMulti; - BOOL m_bAccessBuild; - BOOL m_bFullScreen; - BOOL m_bDrawMap; - int m_mouseType; - HWND m_hWnd; - CPixmap* m_pPixmap; - CDecor* m_pDecor; - CSound* m_pSound; - CMovie* m_pMovie; - CNetwork* m_pNetwork; - char m_movieToStart[MAX_PATH]; - WMessage m_phaseAfterMovie; - CButton m_buttons[MAXBUTTON]; - int m_lastFloor[MAXBUTTON]; - int m_lastObject[MAXBUTTON]; - int m_lastHome[MAXBUTTON]; - BOOL m_bRunMovie; - BOOL m_bBuildModify; - CJauge m_jauges[2]; - CMenu m_menu; - BOOL m_bMenu; - POINT m_menuPos; - int m_menuNb; - int m_menuButtons[MAXBUTTON]; - int m_menuErrors[MAXBUTTON]; - int m_menuPerso; - POINT m_menuCel; - POINT m_oldMousePos; - BOOL m_bMousePress; - BOOL m_bMouseDown; - BOOL m_bHili; - int m_fileWorld[10]; - int m_fileTime[10]; - POINT m_posToolTips; - char m_textToolTips[50]; - int m_mouseSprite; - BOOL m_bFillMouse; - BOOL m_bWaitMouse; - BOOL m_bHideMouse; - BOOL m_bShowMouse; - int m_rankCheat; - int m_posCheat; - BOOL m_bMovie; - BOOL m_bSpeed; - BOOL m_bHelp; - BOOL m_bAllMissions; - BOOL m_bChangeCheat; - int m_scrollSpeed; - BOOL m_bPause; - BOOL m_bShift; - int m_shiftPhase; - POINT m_shiftVector; - POINT m_shiftOffset; - char m_libelle[1000]; - char m_filenameBuffer[100][256]; - int m_tryPhase; - int m_tryInsertCount; - POINT m_posInfoButton; - POINT m_posHelpButton; - BOOL m_bHiliInfoButton; - BOOL m_bHiliHelpButton; - BOOL m_bInfoHelp; - BOOL m_bDemoRec; - BOOL m_bDemoPlay; - DemoEvent* m_pDemoBuffer; - int m_demoTime; - int m_input; - int m_demoIndex; - int m_demoEnd; - int m_demoNumber; - BOOL m_bCtrlDown; - POINT m_debugPos; - int m_introTime; - int m_joyID; - int m_gamer; - int m_textHiliStart; - int m_textHiliEnd; - int m_textCursorIndex; - char m_textInput[100]; - char m_pPlayerName[100]; - int m_lives; - int m_multi; - HINSTANCE m_hInstance; - char m_chatZone[100][5]; - char m_text[100]; -}; - -extern -int DirectoryThing(LPCSTR filename); \ No newline at end of file diff --git a/fifo.h b/fifo.h deleted file mode 100644 index b89b924..0000000 --- a/fifo.h +++ /dev/null @@ -1,33 +0,0 @@ - -#pragma once - - - - - - -typedef struct -{ - long pos; - long dist; -} -Element; - - - - -class CPileTriee -{ -private: - long m_taille; - long m_max; - long m_out; - Element* m_data; - -public: - CPileTriee(long taille); - ~CPileTriee(); - - void put(long pos, long dist); - long get(); -}; \ No newline at end of file diff --git a/icon1.ico b/icon1.ico deleted file mode 100644 index 5d06b9f2857b39f0b5d3395e3e7999ba6bcc3a38..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 45451 zcmeHQ2V4`$_n!>`f|LYoh=qWPSiy=FB49<4^YlDC1oTw&lwubJvRJ^5oLDFdo((IW z*bpR96!ApE*^r{)4iE(uM5G8w{xgB)x2_3AY2KgtFnKfc-n{pHZ`JR%LyWA^>Ijs5h#!!DKZ6<{ARP;Z)WQ z%>g()gwV$Z;XMI(w3^Td>rl`75JDdtETRL@{VV`mZLBA#x6x?>)v8aLXgM8elUh`Q z#BO=`LR4EZeS$eS_n^ybSfM+OojMkPKmAlI=0Z$B#ciVP3IH_XP{!`KhR+9}P530s zu`|}%zkP1CsB3a3{`*Xq&9AyUKAzJjCUVX{?Yi7cqHm<1?do<=St)r4DzgMu3+ z8%zG|YM{VZ7WR7a=w+ZP=)Bc6hIfBZdoXO5_S(?kUk$+0c7GOlnZ#LwXWH}r^^6Gp z1kP*TiZ6FCdV*!#_jMcH|{@C(TfwziW> z-aXHZi`dk~<$2VK6DzcTQhuPaLogF$#Tj)@jgKGir8t{~9h^ZAJ7qF$*!k<%ug54k zZ^2Dn#sg-z(HU{BKr`v~IA9;M*8k9G_urGlx@soHjRQ}gJ}uNb!={bA*bTqn8t_Im z;?4_Jjl?|91i=fw+z$9I1I}$Ga7E(gVwiiU-z@Kf9lQwtZkzw{Lbj2 z2N=H6->r-a9I*T8Lylb$g9SEq96_Ulwf%piGr;a~JK&*s&2l^ZU1zxs{(jn`<=r+o zIN1Hqt_!%G_8U1ou*xj^^xnk%WVZ#Oey$>3#2caTa#U2*#fujMl22WVj9j5_blFD} zxT)oL$7n#!#)+N^j}5)GJE1n8tbx#$w)Yii*U|D2#DEW6yA?9xduX2DCHHtqXNJAZ zPqVmkp``EHPeqIEb*812(BUCg--E8kBN8#++u^?p6b;uql#RT9|NbiR3z$AWP_^QIJyG2iex!r4M5u@QK}1I#x4h>ssPRL+4)K~oqzs^bE1xO ztvO3cMYQqCv3~vf9TiH>rE`zWun3aPF>h#s{9qA+acwn?0*y zPv}gqmt%FkF8YBX8PWN%Q?IxR(b?xiU$46YL$lKriAj)?m65@Ie(loZP94_wGz+fS zQ5bnsiI!yS=Sx>Bd#exn7p$Df-z^+QOVVOWo4SMkk!w*ClNN>_v!MA@#IiuoeqFST zvr2q{;gR>daXp>`oufAuiFjNRD~hrEJZhtP($TwT3ARrj~lRFJZrO)@+}SsSn@$E8a;|{MhiQT ze(}e5LSctPT{EE8DRG|V?yGTEI%lAI$=jS1ELIa7%kmQG_z0o62`wz(c=^W)`bH@X=Dcxwl6?h6#PeM8n(?ii&SCs^Fl8xszi-776TZS)YHIPFhA2orKsgs#uI zW&%Y{_Fwkg{jLR~_tUOCOii7gqiZ{${J!~1dZ{G{=)L}}L-D6V^;md%t(ctK@7|IH zu`_OkfKUcLDARsT{)@bhy+`RdTH|JPPT;b0(IsiHVQ^K0{|^x&W@NI_pa+Za5tx_- z#*L49VfvRnFJbr*4C*%r0oui>+`#Kz{y&UYNK`4<3=9V*mWWS3%j?)_^$@-%%|j1N z?y~0K^<7Y8u2f_rFmy}5BpF%qX`Iqdr2}mm)qWm*^~|KrDD z#h=D)lXme27tfTZ@_e9<7k`5lG!HiDKPu+jxy2C85 z2}c5%{Gy_j_OzgnFN1l1S*?cklt`x!T1jUD108aDMkgv~S1CFP#1e z0>-G096EIGgHZ0M2<-lDi)ksvXI3oJDoDL#men(?)65;C(_-m{c67&u3k~4ODtl;{ z{qkb2mzQZo%1eDPZ|+>ZsZ*w84Gl9jaea|!ReX}cX>W1(?%lg9;iWf5>9NK5ppHiN ziA##3I$?|v?S8hiOI*Ualyyt^@Zog(z7yi!^W544y*mrFFb!p!o>31k#>9jqSJ<@0 z`)oJV+-K-O8=@Uaei*p{#J#KQA+xh%2DXvPzk+HFdewsDw(Ty8py%e>l zn3fLudxB}jOo#mBK@}ZO(b&0L@Mo#1lcS@f4|0o(iwjTl{Rf{A96jk^z3TXW-V2Q- zX_;;DUmv#z9M!3q%^EG6M@GuwL6_gAJ)a3UeRqyB*^4>014As{GH?dJ?b)=*TnnHN zm_uCebMJ#*Z^z0>AvDjbt}_{g=Ri&l1m=XETzpwv6R zJsc5#8te|?4Xww3uj<-!CP1w00dA)EI;#E%4rIZkan_dS%pEttQ8j?0a^MIv8mdcE z<;cCVTscCPmd(x0!PKc!!OuVc41S&WD{ygf0q$$pf=wGYf}=-{f{1ew;9Ar*kR%X* z$B!R_ms!~$FE0T7W!Qw7mF#UF|(GMSY- zcb(!7JE*E6?RD0VDJv85mA=55ocI&Ieop_x^3o`h;$9gj`SFn>Pm>o<+43}aev@&& z`aJ4VR8l-&h*zE8; zX8%!2_y_$(ej@)7Rj8uMRg_spb*rdZ73D&T;)I5k@DGzx9Ck-_Y5J0)`&2f}9GI)` zQ{ii!>O{Fut-eQfuDnO}@$muv{{A2+Fz~Z`)!VmjSKptOm6cViYb~@!pfv*DR|KRd z=mvqTAtN#Wr&$IUHdPB~XjBbM$=7LR4fxW#GHGa#8ASPWzB(mgSbh0~UJOI3zU+@- zYH%!}pa%KUKdOEVYopF!sJD^Nrz6GihDM%#MZ|!^4>^1l)UK|sB9D(@G<9`!+b0hn zykmgqYvNbN09pCcf7JTF)Chd3<5F}|7}WS8uMjTyhmz74d;%Q7ChcF+u4F#!UCjn) z|00-D6G-|0*kAHLXG{4~qg6i?Hsnk1tqBn-8_tcOB$9372p~%k$3;WX%JG9l0>>k| z@M$x%pkcEv)Mo}W7iLKT9J-XkVM_&I5@sc6oWg>c4RiH41&vLJBx9U{#wKW75)u+3 z9h;!%=jhov@!Xu~+Dcm^&>Dg7KLWDHDQ!pz`3Nt(L_!nRU|ppuVMLv#LQ_$}RI2NA zObLk)bp{QiDU<3dNSrLM!a(BH^3n>q4pmE^_!0J`!f?#+dA+h)jh8OvLcBym;J--d zUXQO(kE{%3;dO+si|!2@X)2$pkeJFhaB2Gq-R``TaRmD&)n3trZ3;SqW!*!zU{8YkF=f)y7t@^5w~B-`kngOImiA?ORo?HceH_qcQnZogR^3Cw3MZ%4S7=`ZrLrM6CbPt#YqxH(d8<377avaZ%DMcb zSo`&uHy_vC6KiihpbC;-9rNerUbb@C6VJTP@V=Eu$Cs2oe8qF?ywlWZ6URJ78P=22 z-&tLmB=8%pN!vQVGdTB;)iiFh^N!cfY`Rv$08p`c%wGMt*jN+UE7ymle&~rhBmr9iH8*^>2p_D4n~7wdjUxg?;cHmm}|g z4Vba%m)I4Y9=SBWU%9QoZxX{hVTL+pC>q$)N5OxQDjtz;y{~NimFVbS-oAM=BP}gW zl(})Ef@E6KJ~-p+H)rRwaOzu0sO2~~?aTnAz7ietx7sLt_ADH}Wv)2!N=q*+_&C^- zT5c7`<4R1`9WZl_(Nv6mom((Q^f1pVjw`N+lF)Tnw2>znAh|Sqyl&tpRsEfk;Zaa_l$5^BDjTV^gbTBjL?9ak7#24nL>kcUv3WX7e zOg(c2VO{mYe0|!mua@jzY?`&1l{D4@B&d$k+4CZ_uh?Cm{_qhC6n1>_Yp`>(xy#b*NZd8)CB*o4x|&;jK~7Q)F8 zr*GdL$L+8;eK5O3BVi2v_Fva%yMwJ9)1F7KIeq{BRLHVZHH_8D&;gIT(^D+~TXhp> z6a&oP$lBruI6pDGufmEiYl|=7>|=Njhn4Lt#st7#vWcTj11a6b8?qfYOgGQy%9|GNscBXoH-3P9%qzd3GI8`Bad_9m`F8{& ziBXYYn)BktCuiH*zIXb&f62P*zT)93eLx1oc^1tp6nfL;NH%NYHUN%04n-O#cd)<# zSm@XvRmSf#hZUXkT5wWf((X;1cMK2)rv=);DYu4jB5pf4=c3Jc02I3ee8YPUI*U!iVV+l9>E~e5<28ZLjt8RTxzghJ9fIm&;-JnqgMgYQ7(ZpO7>W8YfI`;I7yZ;{i=W%l z6jo~jr7lCI`dD<%%U!|c5ph9)L1VAbJ2rX=jRWSp1Vu?ko>2kV?mrjji1W@H06Hh$ zJbzQWGb)CiVWaks?x-YCSXAZ?Li=-HighI!g1-vir0`C;>U!h}3}A3aGxtad%B9SQf z>Dge>g=c-rQnH)^LfgBu!N`TnCUWkE8qwI8l?83GI7Sm}{aIVfrZC43Ozd|@59`V6 zO2=s<)Kv`2ob^CJ!dxis%EZEU#3SAuI&L21Ll3C9tO@50qJC);fMKr%B}cfXg-*}? zB?dito^+0qbxg@2vs~+K5`$}yzdu*=#pqsPYIJ=0Nge%s4MPPi%+r$C3h|7!Yj96GK2PURnjl(XX?M`>Q9-)bi>{8Hv9N&A5e^n*_odAN4~t?@b4M&} z_vPNhpVFV*UXRW8GUBvd{?FU^9Fq#$6>&Xp%@TVY<1v@z2d{tf^eI!^?@(r}Bq{&O zTeHv-8v9yOS&6u-#}${K{JM#b@a`^qb#U_;mGfJHjls%y4(mkkl_XYddiso8K_Hj` z76d(r_ACCh%KS72jadN0NAq8JPLFWtbyUZ3Dn5pe>qkBiO?#A=ym-3$c>{ho8pq%E zWt!9Lk9k8*D*fEnQ56fjb#aA6@4DAP+fzt|Ih-IkHE!GAdC7s7b&@VmRGG^FJ$D5; zxgJT57(8_-KM26{q2jKfa@WY@h!u83gTeiXH7R+?BTgZ+>Tn}ve#q;+PBe1W6R?D~ zlnt~xA1qH!%1iDPfvhTEyPvt)&-pRJ!6^oI;D{Oct)so3q(c5r3U-V{U4ep4>1h1- zOgqOgB{FHivH1)~8-(FeGX^`X(P z{R-i=$g8k?{L7pik!I4_M<=G0AMsesz-M_069NZ2Rlqg|Z@p`UX(x4zRn*h&+RD4S z*z=KGag5n-JAj)wuViOJ-&2BvqjCheOG47%n|Xh$fE=NhP$!uX zbz`EGSS$5x;^$deS&7va?Y9#-*x401joomLdpqnfjdf!tAI^0@9Thc#t8{UKSMof! zgAN7xo`(Igg2(xt_r!B^9(08qi$3=!CWriP;&r$uI8^G%>eS}UxpSWevj;>KT)A-J zU%>{&HR}e3Gr+7icZcG>8zYSe4co(V9F8A2n(Xk)FCUzKuzX!)-jmm9(W`=jf(>cT z>JM(defRDsI9E+HCMjTLkL9-|a8jgrkD+~(b$)klNI(!^4WRb`Js5waq^F-5Hf-3b z>(|FfRNO`{F1?U6LC0%TnRwZ~0pO1rF^4ZIavt|_d<^IP!#U}XgyC(Bx7u0!-rF?A z>aOsiapBG-6~DRY+q4IN?Cb+v`<0$N zQmn(j8W$J0#HGa1O)1&TWk12`SbHqh;FwrACvMhz8$Xr-%`t#yV<=dXWXaYd`-kiD9Ra2zdr12i9?z(PATMf(wjVQ)>iTBhVUwuZaM>4`spZ2D1QW zNejye6Am+aP~G4O>NSR02y;vGn~EnNVsvcC095&o^iplLmZR2WW-UXECMv3*Y8Snln@JQ1Q0<|7{VV z#*-TF=G^wkHWd#Q@3(p1y8lz-NsTvk`&0SfTBqu#)~Wibc$<3rQ}KLjo$4>OPSxMi z{D(7k7sn|THGcuLg!;la!Y9N-ej-_-jiBGV|1Qoh z)#C#=1MIVX0c~^CM)-(i3BL(S@Q6A=<+Zo8?T_%LrKDE-h;XCrO>A?*4Tt+go_5rettTJ__$zs4TC&CHs$Xlh1=S zo%aZT<@qVEy`}r_w`*7Rwv%_wCw#AIJAbeKlg9$G&i7>B|BL=3pWxS&WZvsheJA@* zY;P*1_G#(+Kf(*YEG5lU?6T@qf2nn9pXTw~X^2b$b!pn@Z)$QQPZMhbxYo{r;cu zkBXOQr&4)x)b`ryvV2F!!uNXptIc0BU!L#Kf5-p2|BdN8iXHWQN{%}!Q}^eFs#ERA zsyDXpE!qF3@V%w_-&DT0ME{%8_m<{=Q~OT!AFiaTelAa(j~eQHN7X~bNgQ9KU(in?LR7`7&P`g z=$7DnmH%kXkB}OJW~w_POii7juW0R0bFP0uwr!f)Z?e6r7&OOzfP6P5V`4%A_;G6~m437g zHK31|wbEMSApIyfjFa@E;E=+&O2Y=fv?-;!Rn)ACa;qrZIEW9sODXIwrLen{q7QZA zkgp3VA5t?&3n1k}T1)!;KV`9DC-}_>_>X5>Q)>j8G6HbSgvQtr4LEkH>zEAL- zu>Tipq?^GH$FK1L;$*{&#+h}ES7XZ6dpkhfp#*mHe9qO?waK1Opl1N^KLV2D5mDc5 zK#qM=Vke&2Ae%(|5d8}L)%^*bO-&mEKlOQRL)XbMYQU`Vxdg7LUM6#!0j_2Y!Tu zSWAQEPosFFjLHZP;>p4)tF5{4lh?!`yo5gp4|&ZC!i?H#%4ENqV*f$*WUXHzFd`lq z6VWb@l4Y9;KU!}E632l& zKGEKk_{p|VnOM_~u*h1oj$~xvB-#)q>ujq1pRkFpQv??BHH+Z4bo>Y(S}%$+88f*| z_$RBax#N#8)wTwPz%P%I{c6npN1pv}ZEwY2d8bLNQR6O;M{cjJ+}QgM*?vRgNB0olD}IEX^8BsAo?lVpT;Do*o5?E6!Vb5C zTT40r$ihst$-(YeU+hSpyzdeE5v^~$sq$o9xB5xd(_ZI@T1YOll^Edw?;r#1S+Qyp$SeXkth;|bupq`0N{TphVzg9pHRYI z=s)rstD*{3RJn>WtEg@jHLIdrNKxFR@s!T)BE^*wXEaZX4KoL3;{W;JELdqxwMGD* zlhO4>2y;VSC(*SEuhlRVfO0ksXqSq=Rt(U#)Ng-(f4R?!>pQ+gx~hE2uPp|I@Ab7& zn>?YnzV@m2iS?}$xW0G$gdeq0YJ3R!Z}p$hL;XH9dXGx}4m7e)$dbzqWuJJLg}y~c ze5aQDPK#`lTy7})Kg#5HQbZd;iC8q0ee}+h&`r>q-lI08{hHp3%6kvmkoE~( zHGPv0#e|R}mm4bngl>7?#3S1zmmAtXfrCnsO>!pq-)f(%vp(fk`<36jYKZs~u_VWz z+(wjT(dM*IUK`t(*MC`llWoHogf^x9`r1a=i0wr9Lf+Q3m5DxxevR#hvj4TVW!WeD zRG0F%*siiK9e*P|b+Jd5`BvLi_R+l$F<$>#>W6fFZG!gEJ&-gGUxCH(YwiAj>?eI} z0Dns1YB0D2jM=~$=`@3x3$vsEKJh4kYuQTCI<~5Wo>Q=3X2VQ8r{K_GrIAv7_a`b0 z)SrCJ)l^2Z^7_~1Tv}UyVjN0Pq!ZyGXl?z8?`g{#S0g<&^(W5(MfR!xv!J&Ag#Tph z1a5-XWS{6SYkq2d`V)Gnv@ZC`u_kPyHX_#rKiMwP57DY~`4`VikWR!W_an+gf1)px vHI}#k5wcVo5)y*8y8vc3wJ)k8`?X}$7ah_Kn$R;(zCt~-GL&alJ}>=0A=}t% diff --git a/jauge.cpp b/jauge.cpp deleted file mode 100644 index a06509f..0000000 --- a/jauge.cpp +++ /dev/null @@ -1,149 +0,0 @@ -// Jauge.cpp -// - -using namespace std; -#pragma once - -#include -#include -#include -#include -#include -#include -#include "def.h" -#include "pixmap.h" -#include "sound.h" -#include "decor.h" -#include "jauge.h" -#include "misc.h" - - - -///////////////////////////////////////////////////////////////// - -// Constructor - -CJauge::CJauge() -{ - m_type = 0; - m_bHide = TRUE; - m_bMinimizeRedraw = FALSE; - m_bRedraw = FALSE; -} - -// Destructor - -CJauge::~CJauge() -{ -} - -// Create a new Button. - -BOOL CJauge::Create(HWND hWnd, CPixmap *pPixmap, CSound *pSound, - POINT pos, int type, BOOL bMinimizeRedraw) -{ - m_hWnd = hWnd; - m_pPixmap = pPixmap; - m_pSound = pSound; - m_type = type; - m_bMinimizeRedraw = bMinimizeRedraw; - m_bHide = TRUE; - m_pos = pos; - m_dim.x = DIMJAUGEX; - m_dim.y = DIMJAUGEY; - m_level = 0; - m_bRedraw = TRUE; - return TRUE; -} - -void CJauge::Draw() -{ - RECT rect; - char num2[12]; - - if (m_bMinimizeRedraw && !m_bRedraw) return; - m_bRedraw = FALSE; - - if (m_bHide) // bouton cach� ? - { - rect.right = m_dim.x + m_pos.x; - rect.left = m_pos.x; - rect.top = m_pos.y; - rect.bottom = m_dim.y + m_pos.y; - m_pPixmap->DrawPart(-1, 0, m_pos, rect, 1, FALSE); - return; - } - int num = m_level * 114 / 100; - - *(char*)num2 = (124) << 64; - rect.bottom = 22; - rect.left = LOWORD(num2); - rect.top = HIWORD(num2); - rect.right = HIWORD(num2); - m_pPixmap->DrawPart(-1, 5, m_pos, rect, 0, FALSE); - if (num > 0) - { - rect.bottom = num + 6; - rect.left = m_type * 22; - rect.top = (m_type + 1) * 22; - rect.right = 0; - m_pPixmap->DrawPart(-1, 5, m_pos, rect, 0, FALSE); - } - -} - -void CJauge::Redraw() -{ - m_bRedraw = TRUE; -} - -void CJauge::SetLevel(int level) -{ - if ( level < 0 ) level = 0; - if ( level > 100 ) level = 100; - - if ( m_level != level ) - { - m_bRedraw = TRUE; - } - - m_level = level; -} - -int CJauge::GetLevel() -{ - return m_level; -} - - -int CJauge::GetType() -{ - return m_type; -} - - -void CJauge::SetType(int type) -{ - if ( m_type != type ) - { - m_bRedraw = TRUE; - } - - m_type = type; -} - -BOOL CJauge::GetHide() -{ - return m_bHide; -} - -void CJauge::SetHide(BOOL bHide) -{ - if ( m_bHide != bHide ) - { - m_bRedraw = TRUE; - } - - m_bHide = bHide; -} - diff --git a/jauge.h b/jauge.h deleted file mode 100644 index b8cbb18..0000000 --- a/jauge.h +++ /dev/null @@ -1,53 +0,0 @@ -// Jauge.h - - -using namespace std; - -////////////////////////////////////////////////////////////////////////// -#include -#include -#include -#include -#include - -#include "decor.h" - -#pragma once -#define WIN32_LEAN_AND_MEAN - -class CJauge -{ -public: - CJauge(); - ~CJauge(); - - BOOL Create(HWND hWnd, CPixmap *pPixmap, CSound *pSound, - POINT pos, int type, BOOL bMinimizeRedraw); - void Draw(); - void Redraw(); - - void SetLevel(int level); - int GetLevel(); - void SetType(int type); - int GetType(); - - BOOL GetHide(); - void SetHide(BOOL bHide); - - POINT GetPos(); - void SetRedraw(); - -protected: - HWND m_hWnd; - CPixmap* m_pPixmap; - CSound* m_pSound; - BOOL m_bHide; - POINT m_pos; - POINT m_dim; - int m_type; - int m_level; - BOOL m_bMinimizeRedraw; - BOOL m_bRedraw; -}; - -///////////////////////////////////////////////////////////////////////// \ No newline at end of file diff --git a/menu.cpp b/menu.cpp deleted file mode 100644 index 7b5843b..0000000 --- a/menu.cpp +++ /dev/null @@ -1,168 +0,0 @@ -// Menu.cpp -// - -#include -#include -#include -#include -#include "def.h" -#include "resource.h" -#include "pixmap.h" -#include "sound.h" -#include "decor.h" -#include "button.h" -#include "menu.h" -#include "text.h" -#include "misc.h" - - -///////////////////////////////////////////////////////////////////////////// - - -#define MARGMENU 0 - - -static short table_button_icon[] = -{ - 24, // go - 40, // stop - 32, // mange - 30, // carry - 31, // depose - 22, // abat - 27, // roc - 28, // cultive - 19, // build1 (cabane) - 25, // build2 (couveuse) - 35, // build3 (laboratoire) - 61, // build4 (mine) - 59, // build5 (usine) - 101, // build6 (t�l�porteur) - 20, // mur - 26, // palis - 42, // abat n - 43, // roc n - 23, // pont - 33, // tour - 34, // boit - 39, // labo - 54, // fleur - 55, // fleur n - 41, // dynamite - 58, // bateau - 60, // djeep - 64, // drapeau - 62, // extrait du fer - 65, // fabrique jeep - 63, // fabrique mine - 83, // fabrique disciple - 100, // repeat - 107, // qarmure - 106, // fabarmure -}; - -void GetText(int rank, char *pBuffer, int lgBuffer) -{ - LoadString(TX_ACTION_GO+rank, pBuffer, lgBuffer); -} - -void GetErr(int rank, char *pBuffer, int lgBuffer) -{ - LoadString(TX_ERROR_MISC+rank, pBuffer, lgBuffer); -} - -///////////////////////////////////////////////////////////////////////////// - -CMenu::CMenu() -{ - m_nbButtons = 0; - m_selRank = -1; -} - -CMenu::~CMenu() -{ -} - -void CMenu::Delete() -{ - m_nbButtons = 0; - m_selRank = -1; -} - -BOOL CMenu::TreatEvent(UINT message, WPARAM wParam, LPARAM lParam) -{ - POINT pos; - - if ( m_nbButtons == 0 ) return FALSE; - - pos = ConvLongToPos(lParam); - - switch( message ) - { - case WM_LBUTTONDOWN: - case WM_RBUTTONDOWN: - if ( MouseDown(pos) ) return TRUE; - break; - - case WM_MOUSEMOVE: - if ( MouseMove(pos) ) return TRUE; - break; - case WM_LBUTTONUP: - case WM_RBUTTONUP: - if ( MouseUp(pos) ) return TRUE; - break; - } - - return FALSE; -} - -int CMenu::Detect(POINT pos) -{ - int rank; - - if ( pos.x < m_pos.x || pos.x > m_pos.x+m_dim.x || - pos.y < m_pos.y || pos.y > m_pos.y+m_dim.y ) return -1; - - rank = (pos.y-m_pos.y)/(DIMBUTTONY+MARGMENU); - rank += ((pos.x-m_pos.x)/(DIMBUTTONX+MARGMENU))*m_nbCel.y; - - if ( rank >= m_nbButtons ) return -1; - return rank; -} - -BOOL CMenu::MouseDown(POINT pos) -{ - return FALSE; -} - -BOOL CMenu::MouseMove(POINT pos) -{ - m_mousePos = pos; - m_selRank = Detect(pos); - - if ( pos.x < m_pos.x-(DIMBUTTONX+MARGMENU) || - pos.x > m_pos.x+m_dim.x+(DIMBUTTONX+MARGMENU) || - pos.y < m_pos.y-(DIMBUTTONY+MARGMENU) || - pos.y > m_pos.y+m_dim.y+(DIMBUTTONY+MARGMENU) ) - { - Delete(); // enl�ve le menu si souris trop loin ! - } - - return FALSE; -} - -BOOL CMenu::MouseUp(POINT pos) -{ - m_mousePos = pos; - m_selRank = Detect(pos); - - return FALSE; -} - -void CMenu::Message() -{ - if ( m_selRank != -1 ) - { - PostMessage(m_hWnd, WM_BUTTON0+m_selRank, 0, 0); - } -} diff --git a/menu.h b/menu.h deleted file mode 100644 index 10612db..0000000 --- a/menu.h +++ /dev/null @@ -1,55 +0,0 @@ -// Menu.h - -#pragma once - -using namespace std; - -#include -#include -#include "decor.h" -#include "pixmap.h" - -////////////////////////////////////////////////////////////////////// - -class CMenu -{ -public: - CMenu(); - ~CMenu(); - - BOOL Create(HWND hWnd, CPixmap *pPixmap, CSound *pSound, - POINT pos, int nbm, int *pButtons, int *pErrors, - int perso); - void Update(int nb, int *pButtons, int *pErrors); - void Delete(); - void Draw(); - int GetSel(); - int GetRank(); - BOOL IsError(); - BOOL IsExist(); - void Message(); - - BOOL TreatEvent(UINT message, WPARAM wParam, LPARAM lPararm); - -protected: - int Detect(POINT pos); - BOOL MouseDown(POINT pos); - BOOL MouseMove(POINT pos); - BOOL MouseUp(POINT pos); - -protected: - HWND m_hWnd; - CPixmap* m_pPixmap; - CDecor* m_pDecor; - CSound* m_pSound; - POINT m_pos; - POINT m_dim; - int m_nbButtons; - POINT m_nbCel; - int m_perso; - int m_buttons[MAXBUTTON]; - int m_errors[MAXBUTTON]; - UINT m_messages[MAXBUTTON]; - int m_selRank; - POINT m_mousePos; -}; \ No newline at end of file diff --git a/misc.cpp b/misc.cpp deleted file mode 100644 index efe329b..0000000 --- a/misc.cpp +++ /dev/null @@ -1,379 +0,0 @@ -// Misc.cpp -// - - -#include -#include -#include -#include -#include "def.h" - -#pragma warning (disable : 4996) - - -// Global Variables - -HINSTANCE g_hInstance; -int g_lastSprite = 0; -extern BOOL g_bFullScreen; -extern int g_mouseType; -extern char g_CDPath[MAX_PATH]; - -//Initalize HInstance. - -void InitHInstance(HINSTANCE hInstance) -{ - g_hInstance = hInstance; -} - -void OutputDebug(const char *pMessage) -{ -#ifdef _DEBUG - OutputDebugStringA(pMessage); -#endif -} - -void LoadString(UINT nID, char *pBuffer, int lgBuffer) -{ - LoadStringA(g_hInstance, nID, pBuffer, lgBuffer); -} - -void ChangeSprite(int sprite) -{ - HCURSOR hCursor = nullptr; - - if ( g_mouseType == MOUSETYPEGRA ) return; - if ( g_lastSprite == sprite ) return; - - if ( sprite == SPRITE_ARROW ) hCursor = LoadCursorA(g_hInstance, "IDC_ARROW"); - if ( sprite == SPRITE_POINTER ) hCursor = LoadCursorA(g_hInstance, "IDC_POINTER"); - if ( sprite == SPRITE_MAP ) hCursor = LoadCursorA(g_hInstance, "IDC_MAP"); - if ( sprite == SPRITE_ARROWU ) hCursor = LoadCursorA(g_hInstance, "IDC_ARROWU"); - if ( sprite == SPRITE_ARROWD ) hCursor = LoadCursorA(g_hInstance, "IDC_ARROWD"); - if ( sprite == SPRITE_ARROWL ) hCursor = LoadCursorA(g_hInstance, "IDC_ARROWL"); - if ( sprite == SPRITE_ARROWR ) hCursor = LoadCursorA(g_hInstance, "IDC_ARROWR"); - if ( sprite == SPRITE_ARROWUL ) hCursor = LoadCursorA(g_hInstance, "IDC_ARROWUL"); - if ( sprite == SPRITE_ARROWUR ) hCursor = LoadCursorA(g_hInstance, "IDC_ARROWUR"); - if ( sprite == SPRITE_ARROWDL ) hCursor = LoadCursorA(g_hInstance, "IDC_ARROWDL"); - if ( sprite == SPRITE_ARROWDR ) hCursor = LoadCursorA(g_hInstance, "IDC_ARROWDR"); - if ( sprite == SPRITE_WAIT ) hCursor = LoadCursorA(g_hInstance, "IDC_WAIT"); - if ( sprite == SPRITE_EMPTY ) hCursor = LoadCursorA(g_hInstance, "IDC_EMPTY"); - if ( sprite == SPRITE_FILL ) hCursor = LoadCursorA(g_hInstance, "IDC_FILL"); - SetCursor(hCursor); - - g_lastSprite = sprite; -} - -POINT ConvLongToPos(LPARAM lParam) -{ - POINT pos; - - pos.x = LOWORD(lParam); - pos.y = HIWORD(lParam); - - return pos; -} - -void InitRandom() -{ - srand(1); -} - -int Random(int min, int max) -{ - long n; - - n = rand(); - n = min+(n%(max-min+1)); - - return (int)n; -} - -/* -BOOL IntersectRect(RECT dst, RECT src1, RECT src2) -{ - dst.left = max(src1.left, src2.left); - dst.right = min(src1.right, src2.right); - dst.top = max(src1.top, src2.top); - dst.bottom = min(src1.bottom, src2.bottom); - return IsRectEmpty(dst); -} - -BOOL IsRectEmpty(RECT rect) -{ - return rect.left >= rect.right || rect.top >= rect.bottom; -} -*/ - -void GetCurrentDir(char *pName, int lg) -{ - int i; - - strncpy(pName, _pgmptr, lg-1); - pName[lg-1] = 0; - - lg = strlen(pName); - if ( lg == 0 ) return; - - for ( i=0 ; i 0 ) - { - lg --; - if ( pName[lg] == '\\' ) - { - pName[lg+1] = 0; - break; - } - } - - if ( lg > 6 && strcmp(pName+lg-6, "\\debug\\") == 0 ) - { - pName[lg-5] = 0; // ignore le dossier \debug ! - } -} - -int Speed(double speed, int max) -{ - if (speed > 0.0) - { - return max((int)(speed * (double)max), 1); - } - if (speed < 0.0) - { - return min((int)(speed * (double)max), -1); - } - return 0; -} - -void AddCDPath(char *pFilename) -{ - char temp[MAX_PATH]; - int lg; - BOOL bDaniel = FALSE; - - if ( g_CDPath[0] == 0 ) return; - - lg = strlen(g_CDPath); - if ( lg > 14 && strstr(g_CDPath+lg-14, "\\daniel\\blupi\\") ) - { - bDaniel = TRUE; - } - -#if _DEMO - strcpy(temp, g_CDPath); - strcat(temp, pFilename); -#else - if ( !bDaniel && - (strstr(pFilename, "image08\\") == pFilename || - strstr(pFilename, "data\\") == pFilename || - strstr(pFilename, "image16\\") == pFilename || - strstr(pFilename, "sound\\")) ) - { - strcpy(temp, g_CDPath); - strcat(temp, "..\\"); - strcat(temp, pFilename); - } - else - { - strcpy(temp, g_CDPath); - strcat(temp, pFilename); - } -#endif - - strcpy(pFilename, temp); -} - -void AddUserPath(char *pFilename) -{ - char temp[MAX_PATH]; - char* pText; - int pos; - char last; - SECURITY_ATTRIBUTES att; - - if ( g_CDPath[0] != 0 ) return; - - - - strcpy(temp, "c:\\Speedy_Blupi\\"); - - att.nLength = sizeof(SECURITY_ATTRIBUTES); - att.lpSecurityDescriptor = NULL; - att.bInheritHandle = FALSE; - CreateDirectoryA(temp, &att); - - pText = strstr(pFilename, "\\"); - if ( pText != NULL ) - { - pos = strlen(temp)+(pText-pFilename)+1; - strcat(temp, pFilename); - last = temp[pos]; - temp[pos] = 0; - CreateDirectoryA(temp, &att); - temp[pos] = last; - } - else - { - strcat(temp, pFilename); - } - - strcpy(pFilename, temp); -} - -void TraceErrorDD(HRESULT hErr, const char *sFile, int nLine) -{ - char dderr[256]; - char err[1024]; - - switch (hErr) - { - case DD_OK : sprintf(dderr, "DD_OK"); break; - case DDERR_ALREADYINITIALIZED : sprintf(dderr, "DDERR_ALREADYINITIALIZED"); break; - case DDERR_CANNOTATTACHSURFACE : sprintf(dderr, "DDERR_CANNOTATTACHSURFACE"); break; - case DDERR_CANNOTDETACHSURFACE : sprintf(dderr, "DDERR_CANNOTDETACHSURFACE"); break; - case DDERR_CURRENTLYNOTAVAIL : sprintf(dderr, "DDERR_CURRENTLYNOTAVAIL"); break; - case DDERR_EXCEPTION : sprintf(dderr, "DDERR_EXCEPTION"); break; - case DDERR_GENERIC : sprintf(dderr, "DDERR_GENERIC"); break; - case DDERR_HEIGHTALIGN : sprintf(dderr, "DDERR_HEIGHTALIGN"); break; - case DDERR_INCOMPATIBLEPRIMARY : sprintf(dderr, "DDERR_INCOMPATIBLEPRIMARY"); break; - case DDERR_INVALIDCAPS : sprintf(dderr, "DDERR_INVALIDCAPS"); break; - case DDERR_INVALIDCLIPLIST : sprintf(dderr, "DDERR_INVALIDCLIPLIST"); break; - case DDERR_INVALIDMODE : sprintf(dderr, "DDERR_INVALIDMODE"); break; - case DDERR_INVALIDOBJECT : sprintf(dderr, "DDERR_INVALIDOBJECT"); break; - case DDERR_INVALIDPARAMS : sprintf(dderr, "DDERR_INVALIDPARAMS"); break; - case DDERR_INVALIDPIXELFORMAT : sprintf(dderr, "DDERR_INVALIDPIXELFORMAT"); break; - case DDERR_INVALIDRECT : sprintf(dderr, "DDERR_INVALIDRECT"); break; - case DDERR_LOCKEDSURFACES : sprintf(dderr, "DDERR_LOCKEDSURFACES"); break; - case DDERR_NO3D : sprintf(dderr, "DDERR_NO3D"); break; - case DDERR_NOALPHAHW : sprintf(dderr, "DDERR_NOALPHAHW"); break; - case DDERR_NOCLIPLIST : sprintf(dderr, "DDERR_NOCLIPLIST"); break; - case DDERR_NOCOLORCONVHW : sprintf(dderr, "DDERR_NOCOLORCONVHW"); break; - case DDERR_NOCOOPERATIVELEVELSET : sprintf(dderr, "DDERR_NOCOOPERATIVELEVELSET"); break; - case DDERR_NOCOLORKEY : sprintf(dderr, "DDERR_NOCOLORKEY"); break; - case DDERR_NOCOLORKEYHW : sprintf(dderr, "DDERR_NOCOLORKEYHW"); break; - case DDERR_NODIRECTDRAWSUPPORT : sprintf(dderr, "DDERR_NODIRECTDRAWSUPPORT"); break; - case DDERR_NOEXCLUSIVEMODE : sprintf(dderr, "DDERR_NOEXCLUSIVEMODE"); break; - case DDERR_NOFLIPHW : sprintf(dderr, "DDERR_NOFLIPHW"); break; - case DDERR_NOGDI : sprintf(dderr, "DDERR_NOGDI"); break; - case DDERR_NOMIRRORHW : sprintf(dderr, "DDERR_NOMIRRORHW"); break; - case DDERR_NOTFOUND : sprintf(dderr, "DDERR_NOTFOUND"); break; - case DDERR_NOOVERLAYHW : sprintf(dderr, "DDERR_NOOVERLAYHW"); break; - case DDERR_NORASTEROPHW : sprintf(dderr, "DDERR_NORASTEROPHW"); break; - case DDERR_NOROTATIONHW : sprintf(dderr, "DDERR_NOROTATIONHW"); break; - case DDERR_NOSTRETCHHW : sprintf(dderr, "DDERR_NOSTRETCHHW"); break; - case DDERR_NOT4BITCOLOR : sprintf(dderr, "DDERR_NOT4BITCOLOR"); break; - case DDERR_NOT4BITCOLORINDEX : sprintf(dderr, "DDERR_NOT4BITCOLORINDEX"); break; - case DDERR_NOT8BITCOLOR : sprintf(dderr, "DDERR_NOT8BITCOLOR"); break; - case DDERR_NOTEXTUREHW : sprintf(dderr, "DDERR_NOTEXTUREHW"); break; - case DDERR_NOVSYNCHW : sprintf(dderr, "DDERR_NOVSYNCHW"); break; - case DDERR_NOZBUFFERHW : sprintf(dderr, "DDERR_NOZBUFFERHW"); break; - case DDERR_NOZOVERLAYHW : sprintf(dderr, "DDERR_NOZOVERLAYHW"); break; - case DDERR_OUTOFCAPS : sprintf(dderr, "DDERR_OUTOFCAPS"); break; - case DDERR_OUTOFMEMORY : sprintf(dderr, "DDERR_OUTOFMEMORY"); break; - case DDERR_OUTOFVIDEOMEMORY : sprintf(dderr, "DDERR_OUTOFVIDEOMEMORY"); break; - case DDERR_OVERLAYCANTCLIP : sprintf(dderr, "DDERR_OVERLAYCANTCLIP"); break; - case DDERR_OVERLAYCOLORKEYONLYONEACTIVE : sprintf(dderr, "DDERR_OVERLAYCOLORKEYONLYONEACTIVE"); break; - case DDERR_PALETTEBUSY : sprintf(dderr, "DDERR_PALETTEBUSY"); break; - case DDERR_COLORKEYNOTSET : sprintf(dderr, "DDERR_COLORKEYNOTSET"); break; - case DDERR_SURFACEALREADYATTACHED : sprintf(dderr, "DDERR_SURFACEALREADYATTACHED"); break; - case DDERR_SURFACEALREADYDEPENDENT : sprintf(dderr, "DDERR_SURFACEALREADYDEPENDENT"); break; - case DDERR_SURFACEBUSY : sprintf(dderr, "DDERR_SURFACEBUSY"); break; - case DDERR_CANTLOCKSURFACE : sprintf(dderr, "DDERR_CANTLOCKSURFACE"); break; - case DDERR_SURFACEISOBSCURED : sprintf(dderr, "DDERR_SURFACEISOBSCURED"); break; - case DDERR_SURFACELOST : sprintf(dderr, "DDERR_SURFACELOST"); break; - case DDERR_SURFACENOTATTACHED : sprintf(dderr, "DDERR_SURFACENOTATTACHED"); break; - case DDERR_TOOBIGHEIGHT : sprintf(dderr, "DDERR_TOOBIGHEIGHT"); break; - case DDERR_TOOBIGSIZE : sprintf(dderr, "DDERR_TOOBIGSIZE"); break; - case DDERR_TOOBIGWIDTH : sprintf(dderr, "DDERR_TOOBIGWIDTH"); break; - case DDERR_UNSUPPORTED : sprintf(dderr, "DDERR_UNSUPPORTED"); break; - case DDERR_UNSUPPORTEDFORMAT : sprintf(dderr, "DDERR_UNSUPPORTEDFORMAT"); break; - case DDERR_UNSUPPORTEDMASK : sprintf(dderr, "DDERR_UNSUPPORTEDMASK"); break; - case DDERR_VERTICALBLANKINPROGRESS : sprintf(dderr, "DDERR_VERTICALBLANKINPROGRESS"); break; - case DDERR_WASSTILLDRAWING : sprintf(dderr, "DDERR_WASSTILLDRAWING"); break; - case DDERR_XALIGN : sprintf(dderr, "DDERR_XALIGN"); break; - case DDERR_INVALIDDIRECTDRAWGUID : sprintf(dderr, "DDERR_INVALIDDIRECTDRAWGUID"); break; - case DDERR_DIRECTDRAWALREADYCREATED : sprintf(dderr, "DDERR_DIRECTDRAWALREADYCREATED"); break; - case DDERR_NODIRECTDRAWHW : sprintf(dderr, "DDERR_NODIRECTDRAWHW"); break; - case DDERR_PRIMARYSURFACEALREADYEXISTS : sprintf(dderr, "DDERR_PRIMARYSURFACEALREADYEXISTS"); break; - case DDERR_NOEMULATION : sprintf(dderr, "DDERR_NOEMULATION"); break; - case DDERR_REGIONTOOSMALL : sprintf(dderr, "DDERR_REGIONTOOSMALL"); break; - case DDERR_CLIPPERISUSINGHWND : sprintf(dderr, "DDERR_CLIPPERISUSINGHWND"); break; - case DDERR_NOCLIPPERATTACHED : sprintf(dderr, "DDERR_NOCLIPPERATTACHED"); break; - case DDERR_NOHWND : sprintf(dderr, "DDERR_NOHWND"); break; - case DDERR_HWNDSUBCLASSED : sprintf(dderr, "DDERR_HWNDSUBCLASSED"); break; - case DDERR_HWNDALREADYSET : sprintf(dderr, "DDERR_HWNDALREADYSET"); break; - case DDERR_NOPALETTEATTACHED : sprintf(dderr, "DDERR_NOPALETTEATTACHED"); break; - case DDERR_NOPALETTEHW : sprintf(dderr, "DDERR_NOPALETTEHW"); break; - case DDERR_BLTFASTCANTCLIP : sprintf(dderr, "DDERR_BLTFASTCANTCLIP"); break; - case DDERR_NOBLTHW : sprintf(dderr, "DDERR_NOBLTHW"); break; - case DDERR_NODDROPSHW : sprintf(dderr, "DDERR_NODDROPSHW"); break; - case DDERR_OVERLAYNOTVISIBLE : sprintf(dderr, "DDERR_OVERLAYNOTVISIBLE"); break; - case DDERR_NOOVERLAYDEST : sprintf(dderr, "DDERR_NOOVERLAYDEST"); break; - case DDERR_INVALIDPOSITION : sprintf(dderr, "DDERR_INVALIDPOSITION"); break; - case DDERR_NOTAOVERLAYSURFACE : sprintf(dderr, "DDERR_NOTAOVERLAYSURFACE"); break; - case DDERR_EXCLUSIVEMODEALREADYSET : sprintf(dderr, "DDERR_EXCLUSIVEMODEALREADYSET"); break; - case DDERR_NOTFLIPPABLE : sprintf(dderr, "DDERR_NOTFLIPPABLE"); break; - case DDERR_CANTDUPLICATE : sprintf(dderr, "DDERR_CANTDUPLICATE"); break; - case DDERR_NOTLOCKED : sprintf(dderr, "DDERR_NOTLOCKED"); break; - case DDERR_CANTCREATEDC : sprintf(dderr, "DDERR_CANTCREATEDC"); break; - case DDERR_NODC : sprintf(dderr, "DDERR_NODC"); break; - case DDERR_WRONGMODE : sprintf(dderr, "DDERR_WRONGMODE"); break; - case DDERR_IMPLICITLYCREATED : sprintf(dderr, "DDERR_IMPLICITLYCREATED"); break; - case DDERR_NOTPALETTIZED : sprintf(dderr, "DDERR_NOTPALETTIZED"); break; - case DDERR_UNSUPPORTEDMODE : sprintf(dderr, "DDERR_UNSUPPORTEDMODE"); break; - case DDERR_NOMIPMAPHW : sprintf(dderr, "DDERR_NOMIPMAPHW"); break; - case DDERR_INVALIDSURFACETYPE : sprintf(dderr, "DDERR_INVALIDSURFACETYPE"); break; - case DDERR_DCALREADYCREATED : sprintf(dderr, "DDERR_DCALREADYCREATED"); break; - case DDERR_CANTPAGELOCK : sprintf(dderr, "DDERR_CANTPAGELOCK"); break; - case DDERR_CANTPAGEUNLOCK : sprintf(dderr, "DDERR_CANTPAGEUNLOCK"); break; - case DDERR_NOTPAGELOCKED : sprintf(dderr, "DDERR_NOTPAGELOCKED"); break; - case DDERR_NOTINITIALIZED : sprintf(dderr, "DDERR_NOTINITIALIZED"); break; - - default : sprintf(dderr, "Unknown Error"); break; - } - sprintf(err, "DirectDraw Error %s in file %s at line %d\n", dderr, sFile, nLine); - OutputDebug(err); -} - -//---------------------------------------------------------------------- -// -// Function : TraceErrorDS() -// -// Purpose : Traces an error (DirectSound) -// -//---------------------------------------------------------------------- - -void TraceErrorDS(HRESULT hErr, const char *sFile, int nLine) -{ - char dserr[256]; - char err[1024]; - - switch (hErr) - { - case DS_OK : sprintf(dserr, "DD_OK"); break; - case DSERR_ALLOCATED : sprintf(dserr, "DSERR_ALLOCATED"); break; - case DSERR_CONTROLUNAVAIL : sprintf(dserr, "DSERR_CONTROLUNAVAIL"); break; - case DSERR_INVALIDPARAM : sprintf(dserr, "DSERR_INVALIDPARAM"); break; - case DSERR_INVALIDCALL : sprintf(dserr, "DSERR_INVALIDCALL"); break; - case DSERR_GENERIC : sprintf(dserr, "DSERR_GENERIC"); break; - case DSERR_PRIOLEVELNEEDED : sprintf(dserr, "DSERR_PRIOLEVELNEEDED"); break; - case DSERR_OUTOFMEMORY : sprintf(dserr, "DSERR_OUTOFMEMORY"); break; - case DSERR_BADFORMAT : sprintf(dserr, "DSERR_BADFORMAT"); break; - case DSERR_UNSUPPORTED : sprintf(dserr, "DSERR_UNSUPPORTED"); break; - case DSERR_NODRIVER : sprintf(dserr, "DSERR_NODRIVER"); break; - case DSERR_ALREADYINITIALIZED : sprintf(dserr, "DSERR_ALREADYINITIALIZED"); break; - case DSERR_NOAGGREGATION : sprintf(dserr, "DSERR_NOAGGREGATION"); break; - case DSERR_BUFFERLOST : sprintf(dserr, "DSERR_BUFFERLOST"); break; - case DSERR_OTHERAPPHASPRIO : sprintf(dserr, "DSERR_OTHERAPPHASPRIO"); break; - case DSERR_UNINITIALIZED : sprintf(dserr, "DSERR_UNINITIALIZED"); break; - - default : sprintf(dserr, "Unknown Error"); break; - } - sprintf(err, "DirectSound Error %s in file %s at line %d\n", dserr, sFile, nLine); - OutputDebug(err); -} - diff --git a/misc.h b/misc.h deleted file mode 100644 index 319f0f8..0000000 --- a/misc.h +++ /dev/null @@ -1,25 +0,0 @@ -// misc.h -// -#pragma once -#include -#include -using namespace std; - -extern void InitHInstance(HINSTANCE hInstance); -extern void OutputDebug(const char *pMessage); -extern void LoadString(UINT nID, char *pBuffer, int lgBuffer); -extern void ChangeSprite(int sprite); - -extern POINT ConvLongToPos(LPARAM lParam); - -extern void InitRandom(); -extern int Random(int min, int max); -extern BOOL IsRectEmpty(RECT rect); - -extern int Speed(double speed, int max); -extern void GetCurrentDir(char *pName, int lg); -extern void AddCDPath(char *pFilename); -extern void AddUserPath(char *pFilename); - -extern void TraceErrorDD(HRESULT hErr, const char *sFile, int nLine); -extern void TraceErrorDS(HRESULT hErr, const char *sFile, int nLine); diff --git a/movie.cpp b/movie.cpp deleted file mode 100644 index b1a4120..0000000 --- a/movie.cpp +++ /dev/null @@ -1,304 +0,0 @@ -// movie.cpp -// - -using namespace std; - -#pragma once - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "def.h" -#include "movie.h" -#include "misc.h" - -#pragma warning (disable : 4996) - -//---------------------------------------------------------------------------- - -#define AVI_VIDEO "avivideo" - -#define IDM_PLAY 10 -#define IDM_RPLAY 11 - -//---------------------------------------------------------------------------- - -// Initialize avi libraries. - -BOOL CMovie::initAVI() -{ - MCI_DGV_OPEN_PARMS mciOpen; - - // set up the open parameters - mciOpen.dwCallback = 0L; - mciOpen.wDeviceID = 0; - mciOpen.lpstrDeviceType = (LPWSTR)AVI_VIDEO; - mciOpen.lpstrElementName = NULL; - mciOpen.lpstrAlias = NULL; - mciOpen.dwStyle = 0; - mciOpen.hWndParent = NULL; - - // try to open the driver - return (mciSendCommand(0, MCI_OPEN, (DWORD)(MCI_OPEN_TYPE), - (DWORD)(LPMCI_DGV_OPEN_PARMS)&mciOpen) == 0); -} - -// Closes the opened AVI file and the opened device type. | - -void CMovie::termAVI() -{ - MCIDEVICEID mciID; - MCI_GENERIC_PARMS mciClose; - - // Get the device ID for the opened device type and then close - // the device type. - mciID = mciGetDeviceIDA(AVI_VIDEO); - mciSendCommand(mciID, MCI_CLOSE, 0L, - (DWORD)(LPMCI_GENERIC_PARMS)&mciClose); -} - - -// Sets the movie rectange to be -// centered within the app's window. - -void CMovie::positionMovie(HWND hWnd, RECT rect) -{ - // reposition the playback (child) window - MoveWindow(m_hwndMovie, - rect.left, rect.top, - rect.right, rect.bottom, TRUE); -} - -// Close the movie and anything associated with it. | -// This function clears the and flags | - -void CMovie::fileCloseMovie(HWND hWnd) -{ - MCI_GENERIC_PARMS mciGeneric; - - mciSendCommand(m_wMCIDeviceID, MCI_CLOSE, 0L, - (DWORD)(LPMCI_GENERIC_PARMS)&mciGeneric); - - m_fPlaying = FALSE; // can't be playing any longer - m_fMovieOpen = FALSE; // no more movies open - - // cause a total repaint to occur - InvalidateRect(hWnd, NULL, TRUE); - UpdateWindow(hWnd); -} - - -// Open an AVI movie. Use CommDlg open box to -// open and then handle the initialization to -// show the movie and position it properly. Keep -// the movie paused when opened. -// Sets on success. - -BOOL CMovie::fileOpenMovie(HWND hWnd, RECT rect, char *pFilename) -{ - MCI_DGV_OPEN_PARMS mciOpen; - MCI_DGV_WINDOW_PARMS mciWindow; - MCI_DGV_STATUS_PARMS mciStatus; - char string[MAX_PATH]; - - if ( pFilename[1] == ':' ) // nom complet "D:\REP..." ? - { - strcpy(string, pFilename); - } - else - { - GetCurrentDir(string, MAX_PATH-30); - strcat(string, pFilename); - } - - // we got a filename, now close any old movie and open the new one. */ - if ( m_fMovieOpen ) fileCloseMovie(hWnd); - - // we have a .AVI movie to open, use MCI - // set up the open parameters - mciOpen.dwCallback = 0L; - mciOpen.wDeviceID = 0; - mciOpen.lpstrDeviceType = NULL; - mciOpen.lpstrElementName = (LPWSTR)string; - mciOpen.lpstrAlias = NULL; - mciOpen.dwStyle = WS_CHILD; - mciOpen.hWndParent = hWnd; - - // try to open the file - if ( mciSendCommand(0, MCI_OPEN, - (DWORD)(MCI_OPEN_ELEMENT|MCI_DGV_OPEN_PARENT|MCI_DGV_OPEN_WS), - (DWORD)(LPMCI_DGV_OPEN_PARMS)&mciOpen) == 0 ) - { - // we opened the file o.k., now set up to play it. - m_wMCIDeviceID = mciOpen.wDeviceID; // save ID - m_fMovieOpen = TRUE; // a movie was opened - - // show the playback window - mciWindow.dwCallback = 0L; - mciWindow.hWnd = NULL; - mciWindow.nCmdShow = SW_SHOW; - mciWindow.lpstrText = (LPWSTR)NULL; -// mciSendCommand(m_wMCIDeviceID, MCI_WINDOW, -// MCI_DGV_WINDOW_STATE, -// (DWORD)(LPMCI_DGV_WINDOW_PARMS)&mciWindow); - - // get the window handle - mciStatus.dwItem = MCI_DGV_STATUS_HWND; - mciSendCommand(m_wMCIDeviceID, - MCI_STATUS, MCI_STATUS_ITEM, - (DWORD)(LPMCI_STATUS_PARMS)&mciStatus); - m_hwndMovie = (HWND)mciStatus.dwReturn; - - // now get the movie centered - positionMovie(hWnd, rect); - - // cause an update to occur - InvalidateRect(hWnd, NULL, FALSE); - UpdateWindow(hWnd); - - return TRUE; - } - else - { - // generic error for open - m_fMovieOpen = FALSE; - - return FALSE; - } -} - -// Play/pause the movie depending on the state -// of the flag. | -// This function sets the flag appropriately when done| - -void CMovie::playMovie(HWND hWnd, int nDirection) -{ - m_fPlaying = !m_fPlaying; // swap the play flag - - if( !nDirection ) - m_fPlaying = FALSE; // wDirection == NULL means PAUSE - - // play/pause the AVI movie - if ( m_fPlaying ) - { - DWORD dwFlags; - MCI_DGV_PLAY_PARMS mciPlay; - - // init to play all - mciPlay.dwCallback = MAKELONG(hWnd,0); - mciPlay.dwFrom = mciPlay.dwTo = 0; - dwFlags = MCI_NOTIFY; - if ( nDirection == IDM_RPLAY ) - dwFlags |= MCI_DGV_PLAY_REVERSE; - - mciSendCommand(m_wMCIDeviceID, MCI_PLAY, dwFlags, - (DWORD)(LPMCI_DGV_PLAY_PARMS)&mciPlay); - } - else - { - MCI_DGV_PAUSE_PARMS mciPause; - - // tell it to pause - mciSendCommand(m_wMCIDeviceID,MCI_PAUSE,0L, - (DWORD)(LPMCI_DGV_PAUSE_PARMS)&mciPause); - } -} - - -//---------------------------------------------------------------------------- - - -// Constructeur. - -CMovie::CMovie() -{ - m_bEnable = FALSE; - m_wMCIDeviceID = 0; - m_fPlaying = FALSE; - m_fMovieOpen = FALSE; -} - -// Destructeur. - -CMovie::~CMovie() -{ - termAVI(); -} - -// Ouvre la librairie avi. - -BOOL CMovie::Create() -{ -#if _EGAMES - m_bEnable = FALSE; - return FALSE; -#else - if ( initAVI() ) - { - m_bEnable = TRUE; - return TRUE; - } - else - { - m_bEnable = FALSE; - return FALSE; - } -#endif -} - -// Retourne l'�tat de DirectMovie. - -BOOL CMovie::GetEnable() -{ - return m_bEnable; -} - -// Indique si un film existe. - -BOOL CMovie::IsExist(char *pFilename) -{ - char string[MAX_PATH]; - FILE* file; - - if ( pFilename[1] == ':' ) // nom complet "D:\REP..." ? - { - strcpy(string, pFilename); - } - else - { - GetCurrentDir(string, MAX_PATH-30); - strcat(string, pFilename); - } - - file = fopen(string, "rb"); - if ( file == NULL ) return FALSE; - - fclose(file); - return TRUE; -} - -// Montre un film avi. - -BOOL CMovie::Play(HWND hWnd, RECT rect, char *pFilename) -{ - if ( !m_bEnable ) return FALSE; - if ( !fileOpenMovie(hWnd, rect, pFilename) ) return FALSE; - playMovie(hWnd, IDM_PLAY); - - return TRUE; -} - -// Stoppe le film avi. - -void CMovie::Stop(HWND hWnd) -{ - if ( !m_bEnable ) return; - fileCloseMovie(hWnd); -} diff --git a/movie.h b/movie.h deleted file mode 100644 index ab3b0ec..0000000 --- a/movie.h +++ /dev/null @@ -1,36 +0,0 @@ -// movie.h -// - - -#pragma once -using namespace std; - -#include - -class CMovie -{ -public: - CMovie(); - ~CMovie(); - - BOOL Create(); - BOOL GetEnable(); - BOOL IsExist(char *pFilename); - BOOL Play(HWND hWnd, RECT rect, char *pFilename); - void Stop(HWND hWnd); - -protected: - void playMovie(HWND hWnd, int nDirection); - BOOL fileOpenMovie(HWND hWnd, RECT rect, char *pFilename); - void fileCloseMovie(HWND hWnd); - void positionMovie(HWND hWnd, RECT rect); - void termAVI(); - BOOL initAVI(); - -protected: - BOOL m_bEnable; - MCIDEVICEID m_wMCIDeviceID; - HWND m_hwndMovie; - BOOL m_fPlaying; - BOOL m_fMovieOpen; -}; \ No newline at end of file diff --git a/network.cpp b/network.cpp deleted file mode 100644 index 34338cf..0000000 --- a/network.cpp +++ /dev/null @@ -1,331 +0,0 @@ -// Network.cpp -// - -#include -#include -#include "dplay.h" -#include "misc.h" -#include "network.h" - -#define _CRT_SECURE_NO_WARNINGS_GLOBALS -#define WIN32_LEAN_AND_MEAN -#pragma warning(disable : 4996) -#pragma comment(lib, "dplayx.lib") -#pragma comment(lib, "dxguid.lib") - -// a0f94abe-11c3-d111-be62-0040f6944838 -#define APP_GUID { 0xbe4af9a0, 0xc311, 0x11d1, { 0xbe, 0x62, 0x00, 0x40, 0xf6, 0x94, 0x48, 0x38 } }; - -CNetwork::CNetwork() -{ - 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() -{ - 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((LPDPENUMDPCALLBACK)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_sessions.list) free(m_sessions.list); - - m_sessions.nb = 0; - *m_sessions.list = NULL; -} - -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]; - - switch (hErr) - { - case DPERR_OUTOFMEMORY: sprintf(dperr, "DPERR_OUTOFMEMORY"); break; - case DPERR_UNSUPPORTED: sprintf(dperr, "DPERR_UNSUPPORTED"); break; - case DPERR_NOINTERFACE: sprintf(dperr, "DPERR_NOINTERFACE"); break; - case DPERR_GENERIC: sprintf(dperr, "DPERR_GENERIC"); break; - case DPERR_INVALIDPARAMS: sprintf(dperr, "DPERR_INVALIDPARAMS"); break; - case DPERR_ACTIVEPLAYERS: sprintf(dperr, "DPERR_ACTIVEPLAYERS"); break; - case DPERR_ACCESSDENIED: sprintf(dperr, "DPERR_ACCESSDENIED"); break; - 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_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\n", dperr); - OutputDebug(err); -} \ No newline at end of file diff --git a/network.h b/network.h deleted file mode 100644 index c17889e..0000000 --- a/network.h +++ /dev/null @@ -1,102 +0,0 @@ -// Network.h - -#pragma once - -#include "dplay.h" - -///////////////////////////////////////////////////////////////////////////// - -#define MAXSESSION 100 -#define MAXPLAYERS 4 -#define _CRT_SECURE_NO_WARNINGS_GLOBALS -#define WIN32_LEAN_AND_MEAN - - -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; - -typedef struct -{ - BYTE messageType; - BYTE data1; - short x; - short y; - short channel; -} -NetMessage; - -typedef enum -{ - MESS_RESUME, - MESS_PAUSE, - MESS_START, - MESS_LEAVE, - MESS_LOST, -} -NetMessageType; - -class CNetwork -{ -public: - CNetwork(); - ~CNetwork(); - - 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(); - - NetPlayer m_players[4]; - DPID m_dpid; - -protected: - LPDIRECTPLAY2 m_pDP; - NamedGUIDList m_providers; - NamedGUIDList m_sessions; - NamedGUIDList m_unknown; - BOOL m_bHost; - -// 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/ping.asm b/ping.asm deleted file mode 100644 index e4e9e41..0000000 --- a/ping.asm +++ /dev/null @@ -1 +0,0 @@ - .TITLE PING ; -------------------------------------- ; (C) 1987 - Daniel Roux ; -------------------------------------- .PROC M680002 .REF SMAKY .REF GRA .REV 1,0 .CODE 800,2,B'1111,600,2000,300,2000,2,'N,'R,'F,09 .TEXT "(C) Daniel ROUX et EPSITEC-system sa" IFSMILE = 0 ; 1 => assemblage pour SMILE2 ; En-tte d'un fichier .IMAGE ; --------------------------- .LOC 0 OIMTYP: .BLKB 1 ; H'01 = indique type image OIMCOD: .BLKB 1 ; H'00 = indique pas de codage OIMBIP: .BLKB 1 ; H'01 = 1 bit par point OIMDIR: .BLKB 1 ; H'02 = coord. X-Y comme cran OIMDLX: .BLKB 2 ; largeur image en points OIMDLY: .BLKB 2 ; hauteur image en points OIMNBB: .BLKB 4 ; nb de byte pour l'image .BLKB 20 ; rserve LGHIMA: ; Dfinition de l'entte d'un gnrateur de caractres ; ---------------------------------------------------- OGCMSB = H'04 ; matrix size in bytes OGCMHD = H'06 ; matrix height in dots OGCMWB = H'08 ; matrix width in bytes OGCFCA = H'0A ; ASCII code of first character OGCLCA = H'0B ; ASCII code of last character OGCLMA = H'0C ; left margin of matrix OGCBLI = H'0E ; bottom of matrix to baseline OGCISP = H'16 ; interline space in dots OGCWID = 256 ; 128 x width OGCH1 = 256+128*1 ; 128 x h1 OGCH2 = 256+128*2 ; 128 x h2 OGCMAT = 256+128*3 ; 128 x matrix ; Constantes ; ---------- MAXPOINT= 21 ; nb de points pour gagner VIT1 = 50/8 ; vitesse 1: 8 images/seconde VIT2 = 50/14 ; vitesse 1: 14 images/seconde VIT3 = 50/25 ; vitesse 1: 25 images/seconde MAXVITX = 30 ; vitesse maximale en X MAXVITY = 30 ; vitesse maximale en Y MAXVITS = 10 ; vitesse maximale raquette SMAKY MAXIRAQ = 7 ; inclinaison maximale (45 degrs) ; Caractres standard ; ------------------- GCTXF = 'N ; fonte (N) GCTXS = 'R!2^7 ; style/chasse (RF) GCTXT = 09 ; taille (09) ; Icnes des IPP64 ; ---------------- GCICF = 'I ; fonte (I) GCICS = 'P ; style/chasse (PP) GCICT = 64 ; taille (64) VTANIME = 2 ; vitesse de l'animation de fin NBANIME = 5+1 ; nb d'icnes d'animation (+1 vide) ICOBALLE1= 32 ; balle 1 IDXBALLE1= 17 IDYBALLE1= 17 ICORAQJ = 71 ; raquette horizontale du joueur ICORAQS = 71+16 ; raquette horizontale du SMAKY IDXRAQ = 64 IDYRAQ = 64 ICXRAQ = 31 ICYRAQ = 20 NBABRI = 8 ; nb d'icnes d'animation des briques casses ICOBRIQUE= 96 ; brique du mur de sparation IDXBRI = 35 IDYBRI = 20 ; Positions dans l'image ; ---------------------- LXWDO = 640 ; largeur de l'cran LYWDO = 340 ; hauteur de l'cran MARGH = 41 ; marge en haut MARGB = 33 ; marge en bas MARGG = 9 ; marge  gauche MARGD = 10 ; marge  droite FRONTX = MARGG+((LXWDO-MARGG-MARGD)/2)-1 ; frontire entre les deux camps POSYRAQ = LYWDO-IDYRAQ-33 ; position Y de la raquette POSXRAQ = 133 ; position X de la raquette fixe RAQEL = 10 ; lvation pour le bouton du milieu MAXBRI = 8 ; nb max de briques POSXBRI = FRONTX-(IDXBRI/2) ; position X d'une brique POSYBRI = LYWDO-57 ; position Y d'une brique tout en bas POSYCJ = LYWDO-316 ; position du compteur du joueur POSXCJ = 265 POSYCS = LYWDO-316 ; position du compteur du SMAKY POSXCS = 357 POSYSJ = LYWDO-327 ; position service du joueur POSXSJ = 26 POSYSS = LYWDO-327 ; position service du SMAKY POSXSS = 600 ; Description d'une raquette ; -------------------------- .LOC 0 ORAQPO: .BLKB 4 ; raquette: position (y;x) ORAQIN: .BLKB 2 ; raquette: inclinaison ORAQEL: .BLKB 2 ; raquette: lvation pour tir ORAQIC: .BLKB 1 ; raquette: icne ORAQET: .BLKB 1 ; raquette: tat BRAQL = 0 ; bouton gauche press BRAQR = 1 ; bouton droite press BRAQG = 2 ; clavier pour avancer  gauche BRAQD = 3 ; clavier pour avancer  droite BRAQS = 7 ; service (on lance la balle) .EVEN ORAQDX: .BLKB 2 ; raquette: minimum en X ORAQFX: .BLKB 2 ; raquette: maximum en X LRAQ: ; Descripteur d'un objet en chute libre ; ------------------------------------- .LOC 0 OOBPOS: .BLKB 4 ; position (y;x) au temps t OOBPOO: .BLKB 4 ; position (y;x) au temps t-1 OOBDIM: .BLKB 4 ; dimensions (dy;dx) OOBVIT: .BLKB 4 ; vitesses (vy;vx) OOBCHO: .BLKB 4 ; amortissement en cas de choc (ay;ax) OOBACC: .BLKB 2 ; pesanteur (py) OOBVIM: .BLKB 2 ; dure de vie maximale OOBVIE: .BLKB 2 ; dure de vie de l'objet OOBFIN: .BLKB 2 ; dure de fin de l'objet OOBVIF: .BLKB 2 ; compteur de vitesse de fin OOBICO: .BLKB 1 ; code de l'icne OOBNEW: .BLKB 1 ; 1 => nouvel objet OOBOLD: .BLKB 1 ; 1 => objet mort .EVEN OOBMU1: .BLKB 2 ; bruit: choc avec un bord OOBMU2: .BLKB 2 ; bruit: choc avec la raquette OOBMU3: .BLKB 2 ; bruit: mort de l'objet LOBJ: ; Variables ; --------- .LOC 0 OMACHINE:.BLKB 1 ; type de la machine (SMAKY8/SMAKY100) OINV: .BLKB 1 ; 1 => fond de l'cran blanc .EVEN OPDDIS: .BLKB 4 ; ^descripteur de la fentre OPGICO: .BLKB 4 ; ^gencar des icnes (IPP64) OADRASTER: .BLKB 4 ; adresse de GRA_RASTER OADMATRIX: .BLKB 4 ; adresse de GRA_MATRIX OADDOT: .BLKB 4 ; adresse de GRA_DOT OADTRAME: .BLKB 4 ; adresse de GRA_TRAME OADLINE: .BLKB 4 ; adresse de GRA_LINE OADELLIPSE: .BLKB 4 ; adresse de GRA_ELLIPSE OADFILLO: .BLKB 4 ; adresse de GRA_FILLO OADFILLC: .BLKB 4 ; adresse de GRA_FILLC OADCLEAR: .BLKB 4 ; adresse de GRA_CLEAR OADSET: .BLKB 4 ; adresse de GRA_SET OADINV: .BLKB 4 ; adresse de GRA_INV OADQXDOT: .BLKB 4 ; adresse de GRA_QXDOT OBUDIS: .BLKB 100 ; buffer write-display OPIMA: .BLKB 4 ; ^image principale du jeu ODIMA: .BLKB 4 ; dimensions image OMOUPO: .BLKB 4 ; souris: position ORAQJ: .BLKB LRAQ ; raquette du joueur ORAQS: .BLKB LRAQ ; raquette du SMAKY OBALLE: .BLKB LOBJ ; balle principale OSIMBA: .BLKB LOBJ ; balle de simulation OBRIQUE:.BLKB 2*(MAXBRI+1) ; tat des briques OBRINB: .BLKB 2 ; nb de briques OTIMING:.BLKB 2 ; dure d'une image (unit 20ms) OMODE: .BLKB 1 ; mode gnral BVIT1 = 0 ; vitesse lente BVIT2 = 1 ; vitesse moyenne BVIT3 = 2 ; vitesse rapide BFACILE= 4 ; pour dbutants OFIXE: .BLKB 1 ; 1 => raquette fixe OBEGIN: .BLKB 1 ; 1 => dbut du jeu OEND: .BLKB 1 ; 1 => fin de la partie OHELP: .BLKB 1 ; 1 => appel  l'aide OGAGNE: .BLKB 1 ; 1 => partie gagne OPERDU: .BLKB 1 ; 1 => partie perdue OSTRAT: .BLKB 1 ; stratgie du SMAKY .EVEN OFONCT: .BLKB 2 ; fond: compteur pour le frottement OSERV: .BLKB 1 ; indicateurs de servide OCOMP: .BLKB 1 ; compteurs allums .EVEN OCOMPF: .BLKW 1 ; frquence de clignottement des compteurs OCONJ: .BLKB 2 ; compteur du joueur OCONS: .BLKB 2 ; compteur du SMAKY OHAZA: .BLKB 8 ; registre 63 bits pour gnrateur alatoire OTIME: .BLKB 4 ; marque le temps de dbut LGVAR: ; Programme principal ; ------------------- .LOC 0 START: .IF ~IFSMILE LIB ?OPELIB .ENDIF LOAD.L D4,#LGVAR LOAD.W D1,#MTYPCP GESMEM ?GETMEM ; demande mmoire pour variables JUMP,NE ERFAT LOAD.L A6,A4 ; A6 <-- ^variables 10$: CLR.B (A4+) ; met toutes les variables  zro DEC.W D4 JUMP,NE 10$ LOAD.W D3,#3 LIB ?MOUSE ; souris par le clavier LOAD.W D4,#1 LIB ?WAITMOUSE ; souris reprsente par une flche NTREL ?GETMACHINE ; D4/A3 <-- paramtres RL.L D4,#8 ; D4 <-- type de la machine LOAD.B (A6)+OMACHINE,D4 LIB ?GCHDIS ; D6 <-- canal cran LOAD.W D3,#TYPWDO ; D3 <-- type fentre cran LOAD.L D4,#4 ; D4 <-- longueur demande LOAD.L A4,#(A6)+OPDDIS ; A4 <-- ^buffer FOS ?RSTATUS ; demande le ^rel ! JUMP,NE ERFAT LOAD.L A0,(A6)+OPDDIS ; A0 <-- ^descripteur de la fentre <> LOAD.W D3,#GRA_RASTER LIB_ GETAD JUMP,NE ERFAT LOAD.L (A6)+OADRASTER,A3 LOAD.W D3,#GRA_MATRIX LIB_ GETAD JUMP,NE ERFAT LOAD.L (A6)+OADMATRIX,A3 LOAD.W D3,#GRA_DOT LIB_ GETAD JUMP,NE ERFAT LOAD.L (A6)+OADDOT,A3 LOAD.W D3,#GRA_TRAME LIB_ GETAD JUMP,NE ERFAT LOAD.L (A6)+OADTRAME,A3 LOAD.W D3,#GRA_LINE LIB_ GETAD JUMP,NE ERFAT LOAD.L (A6)+OADLINE,A3 LOAD.W D3,#GRA_ELLIPSE LIB_ GETAD JUMP,NE ERFAT LOAD.L (A6)+OADELLIPSE,A3 LOAD.W D3,#GRA_FILLO LIB_ GETAD JUMP,NE ERFAT LOAD.L (A6)+OADFILLO,A3 LOAD.W D3,#GRA_FILLC LIB_ GETAD JUMP,NE ERFAT LOAD.L (A6)+OADFILLC,A3 LOAD.W D3,#GRA_CLEAR LIB_ GETAD JUMP,NE ERFAT LOAD.L (A6)+OADCLEAR,A3 LOAD.W D3,#GRA_SET LIB_ GETAD JUMP,NE ERFAT LOAD.L (A6)+OADSET,A3 LOAD.W D3,#GRA_INV LIB_ GETAD JUMP,NE ERFAT LOAD.L (A6)+OADINV,A3 LOAD.W D3,#GRA_QXDOT LIB_ GETAD JUMP,NE ERFAT LOAD.L (A6)+OADQXDOT,A3 LIB ?AFTIM .B NOCURS ; pas de curseur ! .B AFCCMO ; pas de flche-souris .B LOADGC ; charge les caractres standards .B GCTXF .B GCTXS .B GCTXT .B 0 .EVEN JUMP,NE ERFAT LIB ?AFTIM .B LOADGC ; charge les icnes IPP64 .B GCICF .B GCICS .B GCICT .B 0 .EVEN JUMP,NE ERFAT LIB ?AFTIM .B USEGC ; utilise les icnes IPP64 .B GCICF .B GCICS .B GCICT .B 0 .EVEN LOAD.L (A6)+OPGICO,(A0)+ODFPGC LIB ?AFTIM .B USEGC ; charge les caractres standard .B GCTXF .B GCTXS .B GCTXT .B 0 .EVEN LOAD.B D3,#ICOBRIQUE LOAD.W D4,#NBABRI 40$: CALL PREPBRI ; prpare les briques de IMP64 INC.B D3 DEC.W D4 JUMP,NE 40$ SET.B (A6)+OINV ; le fond de l'cran est blanc LOAD.B (A6)+OMODE,#2^BVIT2 LOAD.W (A6)+OTIMING,#VIT2 LOAD.L A3,#R16"NMIMA CALL LOADIMAGE ; charge l'image principale de fond JUMP,NE ERFAT LOAD.L (A6)+OPIMA,A4 LOAD.L (A6)+ODIMA,D4 LOAD.W D4,#LYWDO LOAD.W D3,(A0)+ODFDY SUB.W D3,D4 SR.W D3,#1 SWAP.W D3 SWAP.W D4 LOAD.W D4,#LXWDO LOAD.W D3,(A0)+ODFDX SUB.W D3,D4 SR.W D3,#1 LIB ?CREWDO ; cre swdo (utile pour SMAKY 8) LIB ?USEWDO LOAD.L A4,#(A6)+ORAQJ ; A4 <-- ^description raquette joueur LOAD.B (A4)+ORAQIC,#ICORAQJ LOAD.W (A4)+ORAQDX,#MARGG+2 LOAD.W (A4)+ORAQFX,#FRONTX-32-IDXRAQ LOAD.L A4,#(A6)+ORAQS ; A4 <-- ^description raquette SMAKY LOAD.B (A4)+ORAQIC,#ICORAQS LOAD.W (A4)+ORAQDX,#FRONTX+32 LOAD.W (A4)+ORAQFX,#LXWDO-MARGD-IDXRAQ-2 ; Affiche la premire image d'aide, totalement statique. AIDE: LOAD.L A3,#R16"TXMENU0 LIB ?AFMENU ; affiche les soft-keys LOAD.L A3,#R16"NAIMA CALL AFIMAGE ; affiche l'image d'aide 60$: LIB ?GETCAR COMP.W D3,#END JUMP,EQ FINI COMP.W D3,#F0 JUMP,EQ FINI COMP.W D3,#F0+SHIFT JUMP,EQ FINI COMP.W D3,#F1 JUMP,EQ 65$ COMP.W D3,#F1+SHIFT JUMP,EQ 65$ COMP.W D3,#F2 JUMP,EQ 65$ COMP.W D3,#F2+SHIFT JUMP,EQ 65$ COMP.W D3,#F3 JUMP,EQ 65$ COMP.W D3,#F3+SHIFT JUMP,EQ 65$ COMP.W D3,#SPACE JUMP,NE 60$ ; Affiche la deuxime image d'aide, o il est possible d'incliner ; la raquette pour s'y habituer. 65$: CLR.B (A6)+OEND CLR.B (A6)+OHELP CLR.B (A6)+OBEGIN LOAD.L A3,#R16"TXMENU1 LIB ?AFMENU ; affiche les soft-keys PUSH.B (A6)+OMODE PUSH.W (A6)+OTIMING LOAD.B (A6)+OMODE,#2^BVIT2 LOAD.W (A6)+OTIMING,#VIT2 SET.B (A6)+OFIXE ; raquette immobile LOAD.L A3,#R16"NRIMA CALL AFIMAGE ; affiche l'image d'aide LOAD.L (A6)+ORAQJ+ORAQPO,#H'10000*POSYRAQ+POSXRAQ CLR.W (A6)+ORAQJ+ORAQIN LOAD.L D4,(A4)+ORAQPO SWAP.W D4 LOAD.W D4,#POSYRAQ SWAP.W D4 CALL PMOUSE ; met la souris en place 70$: CALL ACTION ; actionne la raquette ... TEST.B (A6)+OEND ; fin de la partie ? JUMP,T 75$ TEST.B (A6)+OBEGIN ; dbut de la partie ? JUMP,F 70$ 75$: CLR.B (A6)+OFIXE ; raquette mobile POP.W (A6)+OTIMING POP.B (A6)+OMODE TEST.B (A6)+OEND ; fin de la partie ? JUMP,T FINI ; Nouvelle partie. Remet toutes les briques et redonne 10 balles. NEWPARTIE: LOAD.L A3,#R16"TXMENU2 LIB ?AFMENU ; affiche les soft-keys LOAD.L A4,(A6)+OPIMA ; A4 <-- ^image principale LOAD.L D4,(A6)+ODIMA ; D4 <-- dimensions CALL SHOWIMAGE ; affiche l'image de fond CLR.B (A6)+OSERV ; indicateurs de services teints CLR.B (A6)+OCOMP ; compteurs teints CLR.W (A6)+OBRINB ; toutes les briques absentes CLR.L (A6)+ORAQJ+ORAQPO ; la raquette n'existe pas CLR.L (A6)+ORAQS+ORAQPO ; la raquette n'existe pas CALL COUPSAC ; gnrateur alatoire: coup de sac LOAD.L A4,#(A6)+ORAQJ ; A4 <-- descripteur raquette joueur CLR.L (A4)+ORAQPO CLR.W (A4)+ORAQIN CLR.W (A4)+ORAQEL LOAD.L D4,#H'10000*POSYRAQ+(FRONTX-200) CLR.W D3 CALL MOVERAQ ; dessine la premire raquette du joueur LOAD.L D4,(A4)+ORAQPO CALL PMOUSE ; et met la souris en place LOAD.L A4,#(A6)+ORAQS ; A4 <-- descripteur raquette SMAKY CLR.L (A4)+ORAQPO CLR.W (A4)+ORAQIN CLR.W (A4)+ORAQEL LOAD.L D4,#H'10000*POSYRAQ+(FRONTX+100) CLR.W D3 CALL MOVERAQ ; dessine la premire raquette du SMAKY CLR.W (A6)+OCONJ ; zro .. CLR.W (A6)+OCONS ; ..  zro ! ; Nouvelle balle. Laisse les briques dans l'tat o elles sont. NEWBALLE: CLR.B (A6)+OBEGIN CLR.B (A6)+OEND CLR.B (A6)+OHELP CLR.B (A6)+OGAGNE CLR.B (A6)+OPERDU CALL JCOMPTE ; affiche le compteur du joueur CALL SCOMPTE ; affiche le compteur du SMAKY CALL ALLBRIQUE ; dessine toutes les briques CALL HAZARD ; D4 <-- nombre alatoire LOAD.B (A6)+OSTRAT,D4 ; choix de la stratgie du SMAKY LOAD.L A5,#(A6)+OBALLE CALL NEWOBJET ; A5 <-- nouvelle balle CALL NEWSERVICE ; D4 <--  qui le service ? TEST.L D4:#0 ; service  faire par le SMAKY ? JUMP,BS 30$ ; oui => 30$ ; Service effectu par le joueur. ; Attend que l'on bouge la souris pour choisir l'emplacement de ; dpart de la balle. CALL JSERVICE LOAD.L A3,#R16"TXMENU3 LIB ?AFMENU ; affiche les soft-keys LOAD.L A4,#(A6)+ORAQJ ; A4 <-- ^description raquette joueur TSET.B (A4)+ORAQET:#BRAQS ; dbut du service LOAD.L D4,(A4)+ORAQPO ; D4 <-- position DEC.W D4 ; D4 <-- pour redessiner avec la balle !! SWAP.W D4 LOAD.W D4,#POSYRAQ SWAP.W D4 LOAD.W D3,(A4)+ORAQIN ; D3 <-- inclinaison CALL MOVERAQ ; dessine la raquette avec la balle LOAD.L D4,(A4)+ORAQPO CALL PMOUSE ; met la souris o est la raquette ! 21$: CALL ACTION ; effectue une action ... CALL VIECOMPTE ; clignottement des compteurs TEST.B (A6)+OHELP ; appel  l'aide ? JUMP,T AIDE TEST.B (A6)+OEND ; fin de la partie ? JUMP,T FINI TEST.B (A6)+OBEGIN ; tir de la balle ? JUMP,F 21$ LOAD.L A5,#(A6)+OBALLE ;;? CALL INVOBJ SUB.W (A5)+OOBPOS+0,#RAQEL ; lve la balle ;;? CALL INVOBJ JUMP 38$ ; Service effectu par le SMAKY. 30$: CALL SSERVICE LOAD.L A4,#(A6)+ORAQS ; A4 <-- ^description raquette SMAK TSET.B (A4)+ORAQET:#BRAQS ; dbut du service LOAD.W D3,(A4)+ORAQDX LOAD.W D4,(A4)+ORAQFX SUB.W D4,#100 CALL MMHAZARD ; D4 <-- position de lancement LOAD.W D0,D4 ; D0 <-- position  atteindre 31$: CALL ACTION ; effectue une action ... CALL VIECOMPTE ; clignottement des compteurs TEST.B (A6)+OHELP ; appel  l'aide ? JUMP,T AIDE TEST.B (A6)+OEND ; fin de la partie ? JUMP,T FINI LOAD.W D4,(A4)+ORAQPO+2 COMP.W D4,D0 JUMP,EQ 34$ JUMP,HI 33$ ; avance vers la gauche => ADD.W D4,#4 COMP.W D4,D0 JUMP,LS 34$ LOAD.W D4,D0 JUMP 34$ 33$: ; avance vers la droite => SUB.W D4,#4 COMP.W D4,D0 JUMP,HS 34$ LOAD.W D4,D0 34$: LOAD.W D3,D4 SUB.W D3,(A4)+ORAQDX MUL.WU D3,#MAXIRAQ LOAD.W D2,(A4)+ORAQFX SUB.W D2,(A4)+ORAQDX DIV.WU D3,D2 ADD.W D3,#3 COMP.W D3,#MAXIRAQ JUMP,LS 35$ LOAD.W D3,#MAXIRAQ 35$: NEG.W D3 ; D3 <-- inclinaison choisie CALL MOVERAQ ; dplace la raquette du SMAKY COMP.W D0,(A4)+ORAQPO+2 JUMP,NE 31$ LOAD.L A5,#(A6)+OBALLE CALL INVOBJ SUB.W (A5)+OOBPOS+0,#RAQEL ; lve la balle CALL INVOBJ ; Lance la balle servie par le joueur ou le SMAKY. 38$: LOAD.L A3,#R16"TMUSSERVICE CALL PATATRA ; banza, c'est parti ! CALL ESERVICE ; efface les indicateurs de service LOAD.L A3,#R16"TXMENU2 LIB ?AFMENU ; affiche les soft-keys CALL MAJOBJET ; A5 <-- met  jour l'objet TCLR.B (A4)+ORAQET:#BRAQS ; fin du service ; Joue avec la balle jusqu' ce qu'elle tombe. CLR.B (A6)+OBEGIN CLR.B (A6)+OEND CLR.B (A6)+OHELP 40$: CALL BEGINTIME ; enregistre le temps systme absolu 41$: TEST.B (A6)+OHELP ; appel  l'aide ? JUMP,T AIDE TEST.B (A6)+OEND ; fin de la partie ? JUMP,T FINI LOAD.L A5,#(A6)+OBALLE TEST.B (A5)+OOBOLD ; objet mort ? JUMP,T 50$ ; oui => 50$ CALL ACTION ; effectue une action ... JUMP,NE 45$ ; si pas d'action effectue => 45$ CALL DELTATIME ; D4 <-- temps coul COMP.W D4,(A6)+OTIMING JUMP,LO 41$ 45$: LOAD.L A5,#(A6)+OBALLE CALL SMAKY ; dplace la raquette du SMAKY CALL MOVEOBJ ; dplace la balle CALL VIEBRIQUE ; volution des briques dtruites CALL VIECOMPTE ; clignottement des compteurs JUMP 40$ ; La balle est casse. Le joueur ou le SMAKY a gagn. 50$: LOAD.W D4,#20 51$: CALL ACTION ; attend encore un peu ... LOAD.L A5,#(A6)+OBALLE CALL SMAKY ; dplace la raquette du SMAKY CALL MOVEOBJ ; dplace la balle CALL VIEBRIQUE ; volution des briques dtruites CALL VIECOMPTE ; clignottement des compteurs DEC.W D4 JUMP,NE 51$ CALL INVOBJ ; efface le rsidu de balle casse INC.W (A6)+OCONJ TEST.B (A6)+OGAGNE JUMP,T 60$ DEC.W (A6)+OCONJ INC.W (A6)+OCONS 60$: LOAD.W D4,(A6)+OCONJ SUB.W D4,(A6)+OCONS JUMP,NC 62$ NEG.W D4 ; D4 <-- |cart| 62$: COMP.W D4,#2 ; au moins 2 points d'cart ? JUMP,LO NEWBALLE ; non => joue encore COMP.W (A6)+OCONJ,#MAXPOINT ; est-ce que le joueur a gagn ? JUMP,HS 70$ COMP.W (A6)+OCONS,#MAXPOINT ; est-ce que le SMAKY a gagn ? JUMP,HS 70$ JUMP NEWBALLE 70$: CALL GAGNE ; affiche gagn/perdu ... COMP.W D3,#F0 JUMP,EQ FINI JUMP NEWPARTIE ; Fin de ce (trs) joli jeu. Libre la mmoire pour SMILE ! FINI: TEST.L (A6)+OPIMA JUMP,EQ 20$ LOAD.L A4,(A6)+OPIMA CALL KILLIMAGE ; libre l'image 20$: LOAD.L A4,A6 LOAD.W D1,#MTYPCP GESMEM ?GIVMEM ; libre la mmoire des variables ERFAT: LIB ?AFTIM .B AFSCMO ; remet la flche-souris .B KILLGC ; libre les icnes IPP64 .B GCICF .B GCICS .B GCICT .B 0 .EVEN .IF ~IFSMILE LIB ?CLOLIB FOS ?STOP .ELSE EXIT .ENDIF ;--------\\ ; GAGNE > ;========/ ; Affiche "gagn ..." ; in - ; out D3.W dernire touche presse (F0/F1) ; mod D3.L, D7.W GAGNE: PUSHM.L D0..D2,D4,A3 LOAD.L A3,#R16"TXMENU1 LIB ?AFMENU ; affiche les soft-keys LOAD.L A3,#R16"NFIMA LOAD.W D3,#F0 CALL AFIMAGE ; affiche l'image de fin JUMP,NE 90$ LOAD.L A3,#R16"01$ CLR.W D0 ; D0 <-- c'est le joueur qui a gagn CLR.L D3 LOAD.W D3,(A6)+OCONJ SUB.W D3,(A6)+OCONS JUMP,NC 03$ NEG.W D3 INC.W D0 ; D0 <-- c'est le SMAKY qui a gagn LOAD.L A3,#R16"02$ 03$: DIV.WU D3,#4 COMP.W D3,#3 JUMP,LS 04$ LOAD.W D3,#3 04$: DEC.W D3 JUMP,NS 08$ 06$: TEST.B (A3+) ; A3 <-- ^le bon texte JUMP,NE 06$ JUMP 04$ 08$: TEST.B (A6)+OINV ; fond de l'cran blanc ? JUMP,F 10$ ; non => 10$ LOAD.B D3,#AFINV ; oui => LIB ?AFCAR ; affiche un inverse vido 10$: LOAD.L D4,#H'10000*(LYWDO-242)+306 11$: LOAD.L D3,D4 LIB ?SETCURS ; met le curseur au dbut de la ligne 12$: LOAD.B D3,(A3+) JUMP,EQ 16$ COMP.B D3,#CR JUMP,EQ 14$ LIB ?AFCAR ; affiche une ligne JUMP 12$ 14$: SWAP.W D4 ADD.W D4,(A0)+ODFCY ; D4 <-- position ligne en dessous SWAP.W D4 JUMP 11$ 16$: LOAD.L A3,#R16"TMUSYOUPIE TEST.W D0 JUMP,EQ 17$ LOAD.L A3,#R16"TMUSPERDU 17$: CALL PATATRA ; jolie/vilaine musique 20$: LIB ?GETCAR ; attend clavier/souris ... LOAD.W D2,#F0 ; D2 <-- F0 COMP.W D3,#F0 JUMP,EQ 60$ COMP.W D3,#F0+SHIFT JUMP,EQ 60$ COMP.W D3,#END JUMP,EQ 60$ LOAD.W D2,#F1 ; D2 <-- F1 COMP.W D3,#F1 JUMP,EQ 60$ COMP.W D3,#F1+SHIFT JUMP,EQ 60$ COMP.W D3,#F2 JUMP,EQ 60$ COMP.W D3,#F2+SHIFT JUMP,EQ 60$ COMP.W D3,#F3 JUMP,EQ 60$ COMP.W D3,#F3+SHIFT JUMP,EQ 60$ COMP.W D3,#KEYMGR JUMP,EQ 20$ COMP.W D3,#KEYMMR JUMP,EQ 20$ COMP.W D3,#KEYMDR JUMP,EQ 20$ 30$: ; petit bruit => LOAD.B D3,#BIPLIT LIB ?BEEP JUMP 20$ 60$: LOAD.W D3,D2 ; D3 <-- dernire touche 90$: LIB ?AFTIM .B AFDIR,0 ; remet la vido normale .EVEN POPM.L D0..D2,D4,A3 RET 01$: .ASCII " BRAVO, vous avez battu" .ASCII " le SMAKY, mais c'tait" .ASCII " de peu ..." .ASCIZ " C'EST BIEN !" ; ; .ASCII " BRAVO, vous avez gagn" .ASCII " contre le SMAKY haut la" .ASCII " main." .ASCIZ " C'EST TRES BIEN !!" ; ; .ASCII " BRAVO, vous avez largement" .ASCII " vaincu le SMAKY." .ASCII "" .ASCIZ " CHAMPION !!!" ; ; .ASCII " BRAVO, vous avez ridiculis" .ASCII " votre adversaire (le SMAKY)." .ASCII "" .ASCIZ " SUPER-CHAMPION !!!" ; ; 02$: .ASCII " DESOLE, mais le SMAKY vous" .ASCII " a battu (de peu c'est vrai)." .ASCII "" .ASCIZ " RECOMMENCEZ ..." ; ; .ASCII " DESOLE, mais c'est le SMAKY" .ASCII " qui a gagn cette partie !" .ASCII "" .ASCIZ " ESSAYEZ ENCORE UNE FOIS ..." ; ; .ASCII " DESOLE, mais le SMAKY vous" .ASCII " a largement battu !" .ASCII " Il reste beaucoup de progrs" .ASCIZ "  faire ..." ; ; .ASCII " DESOLE, mais le SMAKY vous" .ASCII " a littralement aplati !" .ASCII " Recommencez si vous tes" .ASCIZ " trs courrageux ... " ; ; .EVEN ;--------\\ ; ACTION > ;========/ ; Agit selon un vnement clavier/souris. ; in - ; out D7.W EQ => action effectue ; NE => pas d'action (timeout) ; mod D7.W ACTION: PUSHM.L D0..D6,A0..A5 LOAD.L A4,#(A6)+ORAQJ ; A4 <-- description raquette joueur LOAD.W D4,(A6)+OTIMING NTREL ?SETTIM ; met timeout pour 25 images/seconde LIB ?GETKEY ; attend clavier/souris ... LOAD.W D0,D7 LOAD.W D4,#-1 NTREL ?SETTIM ; remet timeout infini TEST.W D0 JUMP,NE MOREPEAT TEST.L D3:#BKPSEUDO JUMP,BC 20$ TEST.L D3:#BKRELEAS JUMP,BC ENDACTION ; touche relche => SWAP.W D3 AND.B D3,#H'7F ; D3 <-- pseudo code (toujours majuscule) COMP.B D3,#'E JUMP,EQ MORIGHTR COMP.B D3,#'T JUMP,EQ MOLEFTR COMP.W D3,#'S JUMP,EQ KEYLEFTR COMP.W D3,#'D JUMP,EQ KEYLEFTR COMP.W D3,#'G JUMP,EQ KEYRIGHTR COMP.W D3,#'F JUMP,EQ KEYRIGHTR JUMP ENDACTION 20$: ; touche presse => COMP.W D3,#'E JUMP,EQ MORIGHTP COMP.W D3,#'e JUMP,EQ MORIGHTP COMP.W D3,#'T JUMP,EQ MOLEFTP COMP.W D3,#'t JUMP,EQ MOLEFTP COMP.W D3,#'S JUMP,EQ KEYLEFTP COMP.W D3,#'s JUMP,EQ KEYLEFTP COMP.W D3,#'D JUMP,EQ KEYLEFTP COMP.W D3,#'d JUMP,EQ KEYLEFTP COMP.W D3,#'G JUMP,EQ KEYRIGHTP COMP.W D3,#'g JUMP,EQ KEYRIGHTP COMP.W D3,#'F JUMP,EQ KEYRIGHTP COMP.W D3,#'f JUMP,EQ KEYRIGHTP COMP.W D3,#KEYMPO JUMP,EQ MOMOVE COMP.W D3,#KEYMDP JUMP,EQ MOLEFTP COMP.W D3,#KEYMDR JUMP,EQ MOLEFTR COMP.W D3,#KEYMGP JUMP,EQ MORIGHTP COMP.W D3,#KEYMGR JUMP,EQ MORIGHTR COMP.W D3,#END JUMP,EQ DOEND COMP.W D3,#F0 JUMP,EQ DOEND COMP.W D3,#F0+SHIFT JUMP,EQ DOEND COMP.W D3,#F1 JUMP,EQ DOBEGIN COMP.W D3,#F1+SHIFT JUMP,EQ DOBEGIN COMP.W D3,#F2 JUMP,EQ DOBEGIN COMP.W D3,#F2+SHIFT JUMP,EQ DOBEGIN COMP.W D3,#F3 JUMP,EQ DOBEGIN COMP.W D3,#F3+SHIFT JUMP,EQ DOBEGIN COMP.W D3,#SPACE JUMP,EQ DOBEGIN COMP.W D3,#KEYMMP JUMP,EQ DOBEGIN1 COMP.W D3,#'R JUMP,EQ DOBEGIN1 COMP.W D3,#'r JUMP,EQ DOBEGIN1 COMP.W D3,#F13 JUMP,EQ DOHELP COMP.W D3,#F13+SHIFT JUMP,EQ DOHELP COMP.W D3,#F14 JUMP,EQ DOHELP COMP.W D3,#F14+SHIFT JUMP,EQ DOHELP COMP.W D3,#F15 JUMP,EQ DOHELP COMP.W D3,#F15+SHIFT JUMP,EQ DOHELP COMP.W D3,#HELP JUMP,EQ DOHELP JUMP ENDACTION MOREPEAT: ; rpte ventuellement qq chose => TEST.B (A4)+ORAQET:#BRAQL JUMP,BS MOLEFTP TEST.B (A4)+ORAQET:#BRAQR JUMP,BS MORIGHTP TEST.B (A4)+ORAQET:#BRAQG JUMP,BS KEYLEFTP TEST.B (A4)+ORAQET:#BRAQD JUMP,BS KEYRIGHTP ;;? TEST.W (A4)+ORAQEL ; raquette leve ? ;;? JUMP,EQ ENDACTION ; non => ENDACTION LOAD.L D4,(A4)+ORAQPO ; D4 <-- position LOAD.W D3,(A4)+ORAQIN ; D3 <-- inclinaison CALL MOVERAQ ; dplace la raquette JUMP ENDACTION MOMOVE: ; souris dplace => CALL IFMOUSE ; D4 <-- position de la souris JUMP,NE ENDACTION MOMOVE1: LOAD.L D3,D4 SWAP.W D3 SUB.W D3,#POSYRAQ ; brusque dplacement contre le haut ? JUMP,HS 40$ ; non => 40$ COMP.W D3,#-10 ; assez brusque ? JUMP,GT 40$ ; non => 40$ LOAD.W (A4)+ORAQEL,#RAQEL ; lve brusquement la raquette 40$: LOAD.W D3,(A4)+ORAQIN ; D3 <-- inclinaison CALL MOVERAQ ; dplace la raquette LOAD.L D4,(A4)+ORAQPO CALL PMOUSE ; met la souris o est la raquette ! JUMP MOREPEAT MOLEFTP: ; [GAUCHE] press => TSET.B (A4)+ORAQET:#BRAQL LOAD.L D4,(A4)+ORAQPO LOAD.W D3,(A4)+ORAQIN ADD.W D3,#+1 COMP.W D3,#+MAXIRAQ JUMP,LT 50$ LOAD.W D3,#+MAXIRAQ TCLR.B (A4)+ORAQET:#BRAQL 50$: CALL MOVERAQ ; dplace la raquette JUMP ENDACTION MOLEFTR: ; [GAUCHE] relch => TCLR.B (A4)+ORAQET:#BRAQL JUMP ENDACTION MORIGHTP: ; [DROITE] press => TSET.B (A4)+ORAQET:#BRAQR LOAD.L D4,(A4)+ORAQPO LOAD.W D3,(A4)+ORAQIN ADD.W D3,#-1 COMP.W D3,#-MAXIRAQ JUMP,GT 50$ LOAD.W D3,#-MAXIRAQ TCLR.B (A4)+ORAQET:#BRAQR 50$: CALL MOVERAQ ; dplace la raquette JUMP ENDACTION MORIGHTR: ; [DROITE] relch => TCLR.B (A4)+ORAQET:#BRAQR JUMP ENDACTION KEYLEFTP: TSET.B (A4)+ORAQET:#BRAQG LOAD.L D4,(A4)+ORAQPO ADD.W D4,#-10 LOAD.W D3,(A4)+ORAQIN ; D3 <-- inclinaison CALL MOVERAQ ; dplace la raquette LOAD.L D4,(A4)+ORAQPO CALL PMOUSE ; met la souris o est la raquette ! JUMP ENDACTION KEYLEFTR: TCLR.B (A4)+ORAQET:#BRAQG JUMP ENDACTION KEYRIGHTP: TSET.B (A4)+ORAQET:#BRAQD LOAD.L D4,(A4)+ORAQPO ADD.W D4,#+10 LOAD.W D3,(A4)+ORAQIN ; D3 <-- inclinaison CALL MOVERAQ ; dplace la raquette LOAD.L D4,(A4)+ORAQPO CALL PMOUSE ; met la souris o est la raquette ! JUMP ENDACTION KEYRIGHTR: TCLR.B (A4)+ORAQET:#BRAQD JUMP ENDACTION DOEND: SET.B (A6)+OEND ; signal la fin de la partie JUMP ENDACTION DOBEGIN: LOAD.W (A4)+ORAQEL,#RAQEL ; lve brusquement la raquette SET.B (A6)+OBEGIN ; signal le dbut de la partie JUMP ENDACTION DOBEGIN1: LOAD.W (A4)+ORAQEL,#RAQEL ; lve brusquement la raquette TEST.B (A6)+OFIXE ; raquette fixe ? JUMP,T ENDACTION ; oui => ENDACTION SET.B (A6)+OBEGIN ; non => signal le dbut de la partie JUMP ENDACTION DOHELP: SET.B (A6)+OHELP ; signal un appel  l'aide SET.B (A6)+OEND ; signal la fin de la partie JUMP ENDACTION ENDACTION: LOAD.W D7,D0 ; D7 <-- action ou pas POPM.L D0..D6,A0..A5 TEST.W D7 ; retour EQ/NE RET ;--------\\ ; SMAKY > ;========/ ; Dplace la raquette du SMAKY. ; in A5.L ^description de l'objet ; out - ; mod D7.W SMAKY: PUSHM.L D0..D4,A4 LOAD.L A4,#(A6)+ORAQS ; A4 <-- ^description raquette SMAKY COMP.W (A5)+OOBPOS+2,#FRONTX JUMP,HS 20$ ; Si la balle est dans le camp du joueur, adopte une stratgie ; dfensive (raquette au fond), d'attaque (raquette au filet) ; ou collante (suiveuse) de faon alatoire. TEST.B (A6)+OSTRAT:#1 JUMP,BS 15$ ; stratgie suiveuse => LOAD.W D4,(A6)+ORAQJ+ORAQFX SUB.W D4,(A6)+ORAQJ+ORAQPO+2 ADD.W D4,(A4)+ORAQDX ; D4 <-- miroir de la raquette du joueur JUMP 40$ 15$: LOAD.W D4,(A4)+ORAQDX ; D4 <-- raquette au filet TEST.B (A6)+OSTRAT:#2 JUMP,BS 40$ LOAD.W D4,(A4)+ORAQFX ; D4 <-- raquette au fond JUMP 40$ 20$: TEST.W (A5)+OOBVIT+0 ; balle monte ? JUMP,NS 30$ ; oui => 30$ ; Si la balle descend, calcul une estimation linaire du point ; de chute de la balle. LOAD.L D1,(A5)+OOBPOO ; D1 <-- position balle  t-1 LOAD.L D2,(A5)+OOBPOS ; D2 <-- position balle  t LOAD.L D3,(A5)+OOBDIM SR.W D3,#1 ADD.W D1,D3 ADD.W D2,D3 SWAP.W D1 SWAP.W D2 SWAP.W D3 SR.W D3,#1 ADD.W D1,D3 ADD.W D2,D3 SWAP.W D1 SWAP.W D2 ; SWAP.W D3 LOAD.W D3,#POSYRAQ+22 LOAD.W D4,D3 SWAP.W D3 SWAP.W D4 LOAD.W D3,#IDXRAQ LOAD.W D4,#10000 CALL GAINTERHV ; D0 <-- point d'intersection P1-P2 et P3-P4 JUMP,NE 90$ LOAD.W D4,D0 SUB.W D4,#IDXRAQ/2 JUMP 40$ ; Si la balle monte, met la raquette juste dessous. 30$: LOAD.W D4,(A5)+OOBPOS+2 LOAD.W D3,(A5)+OOBDIM+2 SR.W D3,#1 ADD.W D4,D3 SUB.W D4,#IDXRAQ/2 ; Avance ou recule sur le point de chute prsum, mais sans ; dpasser une vitesse maximale. 40$: COMP.W D4,(A4)+ORAQPO+2 JUMP,EQ 60$ JUMP,LO 50$ ; avance vers la droite => LOAD.W D2,(A4)+ORAQPO+2 ADD.W D2,#MAXVITS COMP.W D4,D2 JUMP,LS 60$ LOAD.W D4,D2 JUMP 60$ 50$: ; avance vers la gauche => LOAD.W D2,(A4)+ORAQPO+2 SUB.W D2,#MAXVITS COMP.W D4,D2 JUMP,HS 60$ LOAD.W D4,D2 60$: CALL SIMRAQIN ; D3 <-- inclinaison de la raquette CALL MOVERAQ ; dplace la raquette du SMAKY 90$: POPM.L D0..D4,A4 RET ;---------\\ ; SIMRAQIN > ;---------/ ; Cherche la meilleure inclinaison pour la raquette du SMAKY. ; Cette routine contient en quelque sorte la "stratgie" de ; jeu du SMAKY ! ; in A5.L ^description de l'objet ; A4.L ^description de la raquette ; out D3.W inclinaison de la raquette du SMAKY ; mod D3.L, D7.W SIMRAQIN: PUSHM.L D2,D4 ; Si la balle touche la raquette et qu'il reste beaucoup de ; briques, smash systmatique ! ; S'il reste peu de briques, ne smash que si la balle ne va ; vraiment pas assez vite. CLR.W D2 ; D2 <-- pas de smash TEST.W (A5)+OOBVIT+0 ; balle descend ? JUMP,NS 20$ ; non => 20$ COMP.W (A6)+OBRINB,#MAXBRI/2 ; reste beaucoup de briques ? JUMP,HS 10$ ; oui => 10$ COMP.W (A5)+OOBVIT+0,#15 ; balle descend rapidement ? JUMP,HS 20$ ; oui => 20$ 10$: COMP.W (A5)+OOBVIT+0,#MAXVITY-2 ; balle descend trs rapidement ? JUMP,HS 20$ ; oui => 20$ LOAD.L D3,(A4)+ORAQPO LOAD.L D4,#H'10000*IDYRAQ+IDXRAQ CALL DETOBJ ; est-ce que la balle arrive sur la raquette ? JUMP,EQ 20$ ; non => 20$ ; oui => INC.W D2 ; D2 <-- smash LOAD.W (A4)+ORAQEL,#RAQEL ; lve brusquement la raquette ; Calcul une inclinaison qui tient compte de la position ; de la raquette. Plus elle est  droite et plus elle ; est incline. 20$: LOAD.W D3,(A4)+ORAQPO+2 SUB.W D3,(A4)+ORAQDX MUL.WU D3,#MAXIRAQ LOAD.W D4,(A4)+ORAQFX SUB.W D4,(A4)+ORAQDX DIV.WU D3,D4 ; Plus la balle avance vite (Vx), plus il faut incliner la ; raquette. CLR.L D4 LOAD.W D4,(A5)+OOBVIT+2 JUMP,NS 30$ DIV.WU D4,#3 ADD.W D3,D4 30$: TEST.W D2 ; smash ? JUMP,EQ 70$ ; non => 70$ ; oui => ADD.W D3,#4 ; D3 <-- incline plus la raquette ; Si la raquette est trop incline, il faut la ramener dans ; une position possible ! 70$: COMP.W D3,#MAXIRAQ ; trop inclin ? JUMP,LS 75$ LOAD.W D3,#MAXIRAQ 75$: TEST.W D3 ; raquette horizontale ? JUMP,NE 80$ INC.W D3 80$: NEG.W D3 POPM.L D2,D4 RET ;----------\\ ; BEGINTIME > ;==========/ ; Mmorise le temps actuel. ; in - ; out - ; mod D7.W BEGINTIME: PUSHM.L D2..D5 NTREL ?GETSYTIME LOAD.L (A6)+OTIME,D4 ; OTIME <-- temps processeur total POPM.L D2..D5 RET ;----------\\ ; DELTATIME > ;==========/ ; Donne l'cart entre l'appel BEGINTIME et cet appel-l. ; in - ; out D4.W cart (unit 20ms) ; mod D4.L, D7.W DELTATIME: PUSHM.L D2,D3,D5 NTREL ?GETSYTIME ; D4 <-- temps processeur total SUB.L D4,(A6)+OTIME ; D4 <-- temps coul (unit 128us) DIV.WU D4,#20000/128 ; D4 <-- temps coul (unit 20ms) POPM.L D2,D3,D5 RET ;----------\\ ; VIEBRIQUE > ;==========/ ; Anime les briques dtruites. ; in - ; out - ; mod D7.W VIEBRIQUE: PUSHM.L D2..D4,A4 CLR.W D4 ; D4 <-- rang initial 20$: CALL PETBRIQUE ; A4 <-- ^tat de la brique LOAD.B D3,(A4)+0 ; D3 <-- tat de la brique JUMP,EQ 50$ COMP.B D3,#-1 JUMP,EQ 50$ DEC.B D3 LOAD.B (A4),D3 SR.B D3,#1 JUMP,CS 50$ SUB.B D3,#NBABRI NEG.B D3 ADD.B D3,(A4)+1 ; D3 <-- code de l'icne LOAD.W D2,#INVDOT CALL DESBRIQUE ; efface un bout de brique 50$: INC.W D4 ; D4 <-- rang suivant COMP.W D4,#MAXBRI JUMP,LO 20$ POPM.L D2..D4,A4 RET ;----------\\ ; ALLBRIQUE > ;==========/ ; Dessine toutes les briques. ; in - ; out - ; mod D7.W ALLBRIQUE: PUSHM.L D2..D4,A3,A4 LOAD.L A3,#R16"00$ ; A3 <-- ^notes de la gamme CLR.W D4 ; D4 <-- rang initial 20$: TEST.W (A6)+OBRINB JUMP,EQ 30$ DEC.W (A6)+OBRINB JUMP 50$ 30$: LOAD.B D3,#ICOBRIQUE LOAD.W D2,#SETDOT CALL DESBRIQUE ; dessine une brique CALL PETBRIQUE ; A4 <-- ^tat de la brique LOAD.B (A4)+0,#-1 PUSHM.L D3..D6 LOAD.W D3,(A3) LOAD.W D4,#SILENCE LOAD.W D5,#SILENCE LOAD.W D6,#H'100*10+0 LIB ?ACCORD POPM.L D3..D6 PUSH.W D4 LOAD.W D4,#50/10 NTREL ?DELMS ; attend trs peu ... POP.W D4 50$: ADD.L A3,#2 ; A3 <-- ^note suivante INC.W D4 ; D4 <-- rang suivant COMP.W D4,#MAXBRI JUMP,LO 20$ LOAD.W (A6)+OBRINB,#MAXBRI POPM.L D2..D4,A3,A4 RET 00$: .W NOTE+OCTAVE*5+SGDO .W NOTE+OCTAVE*5+SGRE .W NOTE+OCTAVE*5+SGMI .W NOTE+OCTAVE*5+SGFA .W NOTE+OCTAVE*5+SGSOL .W NOTE+OCTAVE*5+SGLA .W NOTE+OCTAVE*5+SGSI .W NOTE+OCTAVE*6+SGDO ;----------\\ ; DESBRIQUE > ;==========/ ; Dessine une brique. ; in D4.W rang (0..n) ; D3.B code de l'icne ; D2.W mode ; out - ; mod D7.W DESBRIQUE: PUSHM.L D1..D5 LOAD.B D1,D3 CALL POSBRIQUE ; D3/D4 <-- position/dimensions LOAD.L D5,D4 ; D5 <-- dimensions LOAD.L D4,D3 ; D4 <-- position LOAD.B D3,D1 ; D3 <-- code de l'icne CALL DRICONE POPM.L D1..D5 RET ;----------\\ ; PETBRIQUE > ;----------/ ; Donne le pointeur sur l'tat d'une brique. ; in D4.W rang (0..n) ; out A4.L ^tat ; mod D7.W, A4.L PETBRIQUE: PUSH.L D4 LOAD.L A4,#(A6)+OBRIQUE SL.W D4,#1 ADD.W A4,D4 POP.L D4 RET ;----------\\ ; POSBRIQUE > ;----------/ ; Calcul la position et les dimensions d'une brique. ; Rang: n-1 brique tout en haut ; 0 brique tout en bas ; -1 plus de brique (support) ; in D4.W rang (-1,0..n) ; out D3.L position (y;x) ; D4.L dimensions (dy;dx) ; mod D3.L, D4.L, D7.W POSBRIQUE: LOAD.W D3,D4 INC.W D3 MUL.WU D3,#IDYBRI SUB.W D3,#POSYBRI NEG.W D3 SWAP.W D3 LOAD.W D3,#POSXBRI LOAD.L D4,#H'10000*IDYBRI+IDXBRI RET ;---------\\ ; NEWOBJET > ;=========/ ; Initialise un nouvel objet. ; in A5.L ^descripteur de l'objet ; out - ; mod D7.W NEWOBJET: PUSHM.L D3,D4 LOAD.B (A5)+OOBICO,#ICOBALLE1 LOAD.W (A5)+OOBDIM+2,#IDXBALLE1 LOAD.W (A5)+OOBDIM+0,#IDYBALLE1 LOAD.W (A5)+OOBPOS+2,#LXWDO/2 LOAD.W (A5)+OOBCHO+2,#3 LOAD.W (A5)+OOBCHO+0,#3 LOAD.W (A5)+OOBACC,#2 LOAD.W (A5)+OOBVIM,#-1 ; balle immortelle (pour le temps) LOAD.W (A5)+OOBVIE,(A5)+OOBVIM LOAD.W (A5)+OOBMU1,#TMUSCOLB1-TMUS LOAD.W (A5)+OOBMU2,#TMUSCOLR1-TMUS LOAD.W (A5)+OOBMU3,#TMUSENDB1-TMUS CLR.W (A5)+OOBFIN CLR.W (A5)+OOBVIF SET.B (A5)+OOBNEW ; nouvel objet CLR.B (A5)+OOBOLD ; pas encore mort POPM.L D3,D4 RET ;---------\\ ; MAJOBJET > ;=========/ ; Met  jour un nouvel objet selon la raquette. ; in A5.L ^descripteur de l'objet ; A4.L ^description de la raquette ; out - ; mod D7.W MAJOBJET: PUSHM.L D3,D4,A3 LOAD.W D4,(A4)+ORAQIN ASL.W D4,#1 LOAD.W (A5)+OOBVIT+2,D4 LOAD.L A3,#R16"00$ LOAD.W D3,(A6)+OBRINB ; D3 <-- nb de briques restantes SL.W D3,#1 ADD.W A3,D3 LOAD.W (A5)+OOBVIT+0,(A3) POPM.L D3,D4,A3 RET ; Cette table donne la vitesse d'engagement (Vy) en fonction ; du nombre de briques restantes. 00$: .W -7 ; 0 .W -10 ; 1 .W -12 ; 2 .W -14 ; 3 .W -16 ; 4 .W -18 ; 5 .W -20 ; 6 .W -22 ; 7 .W -23 ; 8 .W -24 ; 9 .W -25 ; 10 ;--------\\ ; MOVEOBJ > ;========/ ; Dplace un objet. ; in A5.L ^descripteur de l'objet ; out - ; mod D7.W MOVEOBJ: PUSHM.L D2..D5,A4 LOAD.L (A5)+OOBPOO,(A5)+OOBPOS LOAD.L D4,(A5)+OOBPOS ; D4 <-- position actuelle LOAD.L D2,D4 ADD.W D4,(A5)+OOBVIT+2 SWAP.W D4 ADD.W D4,(A5)+OOBVIT+0 SWAP.W D4 CALL BORDOBJ ; choc (oh l) avec un bord ? COMP.W (A5)+OOBVIE,#1 ; objet presque mort ? JUMP,LS 30$ ; oui => 30$ CALL BRIOBJ ; choc avec des briques ? LOAD.L A4,#(A6)+ORAQJ ; A4 <-- ^description raquette joueur CALL RAQOBJ ; choc avec la raquette du joueur ? LOAD.L A4,#(A6)+ORAQS ; A4 <-- ^description raquette SMAKY CALL RAQOBJ ; choc avec la raquette du SMAKY ? 30$: TEST.W (A5)+OOBVIE ; objet en vie ? JUMP,NE 40$ ; oui => 40$ ; non => LOAD.L D4,D2 ; D4 <-- ne le dplace plus du tout 40$: LOAD.L D3,(A5)+OOBPOS ; D3 <-- ancienne position LOAD.L D5,(A5)+OOBDIM ; D5 <-- dimensions CALL MOVEIICONE ; dplace l'objet LOAD.L (A5)+OOBPOS,D4 ; mm. nouvelle position LOAD.W D4,(A5)+OOBACC ADD.W (A5)+OOBVIT+0,D4 ; tient compte de la pesanteur ! CALL MAXVIT ; ne va quand mme pas trop vite 90$: POPM.L D2..D5,A4 RET ;--------\\ ; BORDOBJ > ;--------/ ; Teste une collision avec un bord de la fentre. ; in A5.L ^descripteur de l'objet ; D4.L position (y;x) ; out D4.L position (y;x) ; mod D4.L, D7.W BORDOBJ: PUSHM.L D2,D3 CLR.W D2 ; D2 <-- pas de collision SWAP.W D4 ; Teste une collision avec le sol. LOAD.W D3,(A0)+ODFFDY SUB.W D3,#MARGB SUB.W D3,(A5)+OOBDIM+0 COMP.W D4,D3 ; collision avec le sol ? JUMP,LT 20$ LOAD.W D4,D3 COMP.W D4,(A5)+OOBPOS+0 JUMP,NE 14$ DEC.W D2 ; D2 <-- ne fait pas de bruit ! 14$: NEG.W (A5)+OOBVIT+0 ; inverse la vitesse Vy LOAD.W D3,(A5)+OOBCHO+0 CALL UPVIT ; diminue la vitesse contre en haut INC.W D2 ; D2 <-- une collision TEST.W (A5)+OOBVIE ; objet dj mort ? JUMP,EQ 20$ ; oui => 20$ ; non => LOAD.W (A5)+OOBVIE,#1 ; mort de l'objet ! SWAP.W D4 COMP.W D4,#FRONTX JUMP,LT 16$ ; c'est gagn => SET.B (A6)+OGAGNE LOAD.W D3,#FRONTX+30 COMP.W D4,D3 JUMP,HS 18$ LOAD.W D4,D3 JUMP 18$ 16$: ; c'est perdu => SET.B (A6)+OPERDU LOAD.W D3,(A5)+OOBDIM+2 SR.W D3,#1 NEG.W D3 ADD.W D3,#FRONTX-32 COMP.W D4,D3 JUMP,LS 18$ LOAD.W D4,D3 18$: SWAP.W D4 ; Teste une collision avec le plafond. 20$: LOAD.W D3,#MARGH COMP.W D4,D3 ; collision avec le plafond ? JUMP,GT 30$ LOAD.W D4,D3 COMP.W D4,(A5)+OOBPOS+0 JUMP,NE 24$ DEC.W D2 ; D2 <-- ne fait pas de bruit ! 24$: NEG.W (A5)+OOBVIT+0 ; inverse la vitesse Vy LOAD.W D3,(A5)+OOBCHO+0 CALL DOWNVIT ; diminue la vitesse contre en bas INC.W D2 ; D2 <-- une collision ; Teste une collision avec le bord droite. 30$: SWAP.W D4 LOAD.W D3,(A0)+ODFFDX SUB.W D3,#MARGD SUB.W D3,(A5)+OOBDIM+2 COMP.W D4,D3 ; collision avec le bord droite ? JUMP,LT 40$ LOAD.W D4,D3 COMP.W D4,(A5)+OOBPOS+2 JUMP,NE 34$ DEC.W D2 ; D2 <-- ne fait pas de bruit ! 34$: NEG.W (A5)+OOBVIT+2 ; inverse la vitesse Vx LOAD.W D3,(A5)+OOBCHO+2 CALL LEFTVIT ; diminue la vitesse vers la gauche INC.W D2 ; D2 <-- une collision ; Teste une collision avec le bord gauche. 40$: LOAD.W D3,#MARGG COMP.W D4,D3 ; collision avec le bord gauche ? JUMP,GT 50$ LOAD.W D4,D3 COMP.W D4,(A5)+OOBPOS+2 JUMP,NE 44$ DEC.W D2 ; D2 <-- ne fait pas de bruit ! 44$: NEG.W (A5)+OOBVIT+2 ; inverse la vitesse Vx LOAD.W D3,(A5)+OOBCHO+2 CALL RIGHTVIT ; diminue la vitesse vers la droite INC.W D2 ; D2 <-- une collision ; Fait un bruit en cas de collision. 50$: TEST.W D2 ; une collision ? JUMP,EQ 90$ ; non => 90$ ; oui => TEST.W (A5)+OOBVIE ; objet en vie ? JUMP,EQ 90$ ; non => 90$ ; oui => CALL MUS1OBJ ; bruit de collision avec un bord 90$: CALL MAXVIT ; ne va quand mme pas trop vite POPM.L D2,D3 RET ;-------\\ ; BRIOBJ > ;-------/ ; Choc de la balles avec une ou plusieures briques. ; Supprime ventuellement la premire brique (tout en haut). ; in A5.L ^description de l'objet ; D4.L position (y;x) ; out D4.L position (y;x) ; mod D4.L, D7.W BRIOBJ: PUSHM.L D0..D3,D5,A3,A4 LOAD.L D5,D4 ; D5 <-- nouvelle position LOAD.W D4,(A6)+OBRINB DEC.W D4 ; D4 <-- rang de la brique tout en haut LOAD.W D2,D4 PUSH.L (A5)+OOBPOS LOAD.L (A5)+OOBPOS,D5 PUSH.L D4 CALL POSBRIQUE ; D3/D4 <-- position/dimensions CALL DETOBJ ; collision avec la brique ? POP.L D4 POP.L (A5)+OOBPOS TEST.W D7 JUMP,EQ 90$ ; non => 90$ ; oui => COMP.W D2,#-1 ; plus de briques ? JUMP,EQ 50$ ; oui => 50$ CALL PETBRIQUE ; A4 <-- ^tat de la brique COMP.B (A4)+0,#-1 ; brique existe ? JUMP,NE 90$ ; non => 90$ ; oui => LOAD.B (A4)+0,#NBABRI*2 ; enlve la brique LOAD.B (A4)+1,#ICOBRIQUE DEC.W (A6)+OBRINB ; une brique de moins 50$: CALL COUPEBRIQUE ; rebond sur la brique LOAD.L A3,#R16"TMUSCOLBRI1 COMP.W D2,#-1 ; plus de briques ? JUMP,EQ 80$ ; oui => 80$ LOAD.L A3,#R16"TMUSCOLBRI2 80$: CALL PATATRA ; fait un bruit 90$: CALL COUPEMUR ; collision avec le mur ? LOAD.L D4,D5 ; D4 <-- nouvelle position POPM.L D0..D3,D5,A3,A4 RET ;------------\\ ; COUPEBRIQUE > ;------------/ ; Regarde comment une balle coupe une brique, et simule ; un rebond correct sur les 4 faces possibles. ; in A5.L ^description de l'objet ; D5.L nouvelle position de l'objet ; D4.W rang de la brique (-1,0..n) ; out D5.L nouvelle position de l'objet ; mod D5.L, D7.W COUPEBRIQUE: PUSHM.L D0..D4,D6 LOAD.L D1,(A5)+OOBPOS ; D1 <-- position au temps t LOAD.L D2,D5 ; D2 <-- position au temps t+1 CALL POSBRIQUE ; D3/D4 <-- position/dimensions LOAD.L D5,D3 ; D5 <-- position brique LOAD.L D6,D4 ; D6 <-- dimensions brique LOAD.L D4,(A5)+OOBDIM SUB.W D5,D4 ADD.W D6,D4 SWAP.W D4 SWAP.W D5 SWAP.W D6 SUB.W D5,D4 ADD.W D6,D4 SWAP.W D5 SWAP.W D6 LOAD.L D3,D1 LOAD.L D4,D2 SWAP.W D3 SWAP.W D4 COMP.W D3,D4 JUMP,EQ 40$ ; trajectoire horizontale => 40$ JUMP,HI 20$ ; la balle descend => LOAD.L D3,D5 ; D3 <-- position brique LOAD.L D4,D6 ; D4 <-- dimensions brique ADD.W D4,D3 SWAP.W D3 SWAP.W D4 LOAD.W D4,D3 SWAP.W D4 SWAP.W D3 CALL GAINTERHV JUMP,NE 40$ LOAD.L D2,D0 TEST.W (A5)+OOBVIT+0 JUMP,NS 40$ NEG.W (A5)+OOBVIT+0 ; inverse la vitesse Vy LOAD.W D3,#1 CALL UPVIT ; diminue la vitesse contre le haut JUMP 40$ 20$: ; la balle monte => LOAD.L D3,D5 ; D3 <-- position brique LOAD.L D4,D6 ; D4 <-- dimensions brique ADD.W D4,D3 SWAP.W D3 SWAP.W D4 ADD.W D3,D4 LOAD.W D4,D3 SWAP.W D4 SWAP.W D3 CALL GAINTERHV JUMP,NE 40$ LOAD.L D2,D0 TEST.W (A5)+OOBVIT+0 JUMP,NC 40$ NEG.W (A5)+OOBVIT+0 ; inverse la vitesse Vy LOAD.W D3,#5 CALL DOWNVIT ; diminue la vitesse contre le bas 40$: COMP.W D1,D2 JUMP,EQ 90$ ; trajectoire verticale => 90$ JUMP,HI 60$ ; la balle va  droite => LOAD.L D3,D5 ; D3 <-- position brique LOAD.L D4,D6 ; D4 <-- dimensions brique LOAD.W D4,D3 SWAP.W D3 SWAP.W D4 ADD.W D4,D3 SWAP.W D4 SWAP.W D3 CALL GAINTERHV JUMP,NE 90$ LOAD.L D2,D0 TEST.W (A5)+OOBVIT+2 JUMP,NS 90$ NEG.W (A5)+OOBVIT+2 ; inverse la vitesse Vx LOAD.W D3,#1 CALL LEFTVIT ; diminue la vitesse contre la gauche JUMP 90$ 60$: ; la balle va  gauche => LOAD.L D3,D5 ; D3 <-- position brique LOAD.L D4,D6 ; D4 <-- dimensions brique ADD.W D3,D4 LOAD.W D4,D3 SWAP.W D3 SWAP.W D4 ADD.W D4,D3 SWAP.W D4 SWAP.W D3 CALL GAINTERHV JUMP,NE 90$ LOAD.L D2,D0 TEST.W (A5)+OOBVIT+2 JUMP,NC 90$ NEG.W (A5)+OOBVIT+2 ; inverse la vitesse Vx LOAD.W D3,#1 CALL RIGHTVIT ; diminue la vitesse contre la droite 90$: CALL MAXVIT ; ne va quand mme pas trop vite LOAD.L D5,D2 ; D5 <-- nouvelle position POPM.L D0..D4,D6 RET ;---------\\ ; COUPEMUR > ;---------/ ; Regarde comment une balle coupe le mur constitu de toutes ; les briques, sauf celle tout en haut. ; in A5.L ^description de l'objet ; D5.L nouvelle position de l'objet ; out D5.L nouvelle position de l'objet ; mod D5.L, D7.W COUPEMUR: PUSHM.L D0..D4,D6,A3 LOAD.L D1,(A5)+OOBPOS ; D1 <-- position au temps t LOAD.L D2,D5 ; D2 <-- position au temps t+1 LOAD.W D4,(A6)+OBRINB SUB.W D4,#2 JUMP,LO 90$ CALL POSBRIQUE ; D3/D4 <-- position/dimensions SWAP.W D3 LOAD.W D4,(A5)+OOBDIM+0 SR.W D4,#1 SUB.W D3,D4 SWAP.W D3 LOAD.L D5,D3 LOAD.L D6,D3 SUB.W D5,(A5)+OOBDIM+2 ; D5 <-- position mur gauche ADD.W D6,#IDXBRI ; D6 <-- position mur droite COMP.W D2,D5 ; position au temps t+1 dans le mur ? JUMP,LO 90$ ; non => 90$ COMP.W D2,D6 JUMP,HS 90$ LOAD.L D3,D2 SWAP.W D3 SWAP.W D5 COMP.W D3,D5 JUMP,LO 90$ SWAP.W D5 COMP.W D1,D2 JUMP,EQ 90$ ; trajectoire verticale => 90$ JUMP,HI 60$ ; la balle va  droite => LOAD.L D3,D5 ; D3 <-- position mur gauche LOAD.W D4,#LYWDO SWAP.W D4 LOAD.W D4,D3 CALL GAINTERHV JUMP,NE 90$ LOAD.L D2,D0 SUB.W D2,#2 TEST.W (A5)+OOBVIT+2 JUMP,NS 80$ NEG.W (A5)+OOBVIT+2 ; inverse la vitesse Vx LOAD.W D3,#1 CALL LEFTVIT ; diminue la vitesse contre la gauche JUMP 80$ 60$: ; la balle va  gauche => LOAD.L D3,D6 ; D3 <-- position mur droite LOAD.W D4,#LYWDO SWAP.W D4 LOAD.W D4,D3 CALL GAINTERHV JUMP,NE 90$ LOAD.L D2,D0 ADD.W D2,#2 TEST.W (A5)+OOBVIT+2 JUMP,NC 80$ NEG.W (A5)+OOBVIT+2 ; inverse la vitesse Vx LOAD.W D3,#1 CALL RIGHTVIT ; diminue la vitesse contre la droite 80$: LOAD.L A3,#R16"TMUSCOLBRI1 CALL PATATRA ; fait un bruit 90$: CALL MAXVIT ; ne va quand mme pas trop vite LOAD.L D5,D2 ; D5 <-- nouvelle position POPM.L D0..D4,D6,A3 RET ;--------\\ ; RAQOBJ > ;--------/ ; Teste une collision avec la raquette. ; in A5.L ^descripteur de l'objet ; A4.L ^description de la raquette ; D4.L nouvelle position (y;x) ; out D4.L nouvelle position (y;x) ; mod D4.L, D7.W RAQOBJ: PUSHM.L D0..D3,D5 LOAD.L D5,D4 ; D5 <-- nouvelle position JUMP,EQ 90$ TEST.L (A5)+OOBPOS JUMP,EQ 90$ TEST.L (A4)+ORAQPO JUMP,EQ 90$ ;;? TEST.W (A5)+OOBVIT+0 ; est-ce que l'objet descend ? ;;? JUMP,NS 90$ ; non => 90$ CALL RAQDEDANS ; balle heurte la raquette ? JUMP,EQ 90$ ; non => 90$ ; Modifie la position pour tenir compte ( peu prt) du rebond. CALL RAQDESSUS ; D4 <-- ramne dessus la raquette ! ; Modifie la vitesse verticale. NEG.W (A5)+OOBVIT+0 ; inverse la vitesse Vy LOAD.W D3,(A5)+OOBCHO+0 SUB.W D3,(A4)+ORAQEL ; D3 <-- tient compte de l'lvation de la raquette SUB.W D3,(A4)+ORAQEL CALL UPVIT ; diminue/augmente la vitesse contre le haut ; Modifie la vitesse horizontale. ; Lors d'un smash, Vy est augment seulement pour la raquette du joueur. ; Cel lui donne un petit avantage ! CLR.W D3 COMP.B (A4)+ORAQIC,#ICORAQS ; raquette du SMAKY ? JUMP,EQ 50$ ; oui => 50$ LOAD.W D3,(A4)+ORAQEL JUMP,NC 50$ NEG.W D3 50$: LOAD.W D4,(A4)+ORAQIN MUL.WA D4,#3 ADD.W D4,D3 ;;? ADD.W D4,D3 ADD.W (A5)+OOBVIT+2,D4 ; Fait un bruit de collision avec la raquette. TEST.W (A5)+OOBVIE ; objet en vie ? JUMP,EQ 90$ ; non => 90$ ; oui => LOAD.W D3,(A5)+OOBVIT+0 JUMP,NC 70$ NEG.W D3 ; D3 <-- vitesse verticale absolue 70$: COMP.W D3,#4 ; petite vitesse ? JUMP,LO 90$ ; oui => 90$ ; non => CALL MUS2OBJ ; bruit de collision avec la raquette 90$: CALL MAXVIT ; ne va quand mme pas trop vite LOAD.L D4,D5 ; D4 <-- nouvelle position POPM.L D0..D3,D5 RET ;----------\\ ; RAQDEDANS > ;----------/ ; Regarde si la balle touche la raquette. ; in D5.L position de la balle ; out D7.W EQ => pas de collision avec la raquette ; mod D7.W RAQDEDANS: PUSHM.L D3,D4 PUSH.L (A5)+OOBPOS LOAD.L (A5)+OOBPOS,D5 LOAD.L D3,(A4)+ORAQPO SWAP.W D3 ADD.W D3,#22 SWAP.W D3 LOAD.L D4,#H'10000*(IDYRAQ-22)+IDXRAQ CALL DETOBJ ; nouvel objet dans la raquette ? POP.L (A5)+OOBPOS POPM.L D3,D4 TEST.W D7 ; retour EQ/NE RET ;----------\\ ; RAQDESSUS > ;----------/ ; Remne la balle sur la raquette si par hazard elle est descendue ; en dessous ! ; in D5.L position de la balle ; out D5.L position toujours dessus la raquette ; mod D5.L, D7.W RAQDESSUS: PUSHM.L D0..D4 CALL RAQP1P2 ; D1/D2 <-- points P1/P2 de la raquette LOAD.W D0,(A5)+OOBDIM+2 SR.W D0,#1 SUB.W D1,D0 SUB.W D2,D0 SWAP.W D1 SWAP.W D2 LOAD.W D0,(A5)+OOBDIM+0 SUB.W D1,D0 SUB.W D2,D0 SWAP.W D1 SWAP.W D2 LOAD.L D3,D5 LOAD.L D4,D5 SWAP.W D3 SUB.W D3,#100 SWAP.W D3 SWAP.W D4 ADD.W D4,#100 SWAP.W D4 CALL GAINTERHV ; D0 <-- point d'intersection JUMP,NE 90$ SWAP.W D0 SWAP.W D5 COMP.W D5,D0 ; en dessus de la raquette ? JUMP,LO 50$ ; oui => 50$ LOAD.W D5,D0 ; D4 <-- ramne dessus la raquette (en Y) SUB.W D5,#2 50$: SWAP.W D5 90$: POPM.L D0..D4 RET ;--------\\ ; RAQP1P2 > ;--------/ ; Donne les points P1(y,x) et P2(y,x) qui sont les extrmits ; gauche et droite de la raquette (variable selon l'inclinaison). ; in A4.L ^description de la raquette ; out D1.L point P1(y,x) ; D2.L point P2(y,x) ; mod D1.L, D2.L, D7.W RAQP1P2: PUSHM.L D3,A3 LOAD.L A3,#R16"TAIRAQ LOAD.W D3,(A4)+ORAQIN NEG.W D3 ADD.W D3,#MAXIRAQ SL.W D3,#3 ; D3 <-- *8 car table de 4x .W LOAD.L D1,(A3)+(D3.W)+0 ; D1 <-- P1(y,x) LOAD.L D2,(A3)+(D3.W)+4 ; D2 <-- P2(y,x) ADD.W D1,(A4)+ORAQPO+2 SWAP.W D1 SUB.W D1,#IDYRAQ NEG.W D1 ADD.W D1,(A4)+ORAQPO+0 SWAP.W D1 ADD.W D2,(A4)+ORAQPO+2 SWAP.W D2 SUB.W D2,#IDYRAQ NEG.W D2 ADD.W D2,(A4)+ORAQPO+0 SWAP.W D2 POPM.L D3,A3 RET ; Cette table donne les extrmits de la raquette, qui ; varie selon son inclinaison. ; P1 P2 ; y,x y,x TAIRAQ: .W 62,13 18,57 ; raquette \ .W 59,10 21,60 .W 56,07 24,62 .W 55,06 27,63 .W 52,03 31,62 .W 49,03 34,63 .W 46,01 37,62 .W 41,00 41,63 ; raquette - .W 07,01 45,63 .W 34,01 48,61 .W 31,02 51,60 .W 28,01 54,58 .W 25,02 56,56 .W 22,04 59,53 .W 18,06 62,50 ; raquette / ;--------\\ ; DOWNVIT > ;========/ ; Diminue la vitesse de descente. ; in A5.L ^descripteur de l'objet ; D3.W de combien diminuer ; out - ; mod D7.W DOWNVIT: PUSH.L D4 LOAD.W D4,(A5)+OOBVIT+0 SUB.W D4,D3 JUMP,NC 20$ CLR.W D4 20$: LOAD.W (A5)+OOBVIT+0,D4 POP.L D4 RET ;--------\\ ; UPVIT > ;========/ ; Diminue la vitesse de monte. ; in A5.L ^descripteur de l'objet ; D3.W de combien diminuer ; out - ; mod D7.W UPVIT: PUSH.L D4 LOAD.W D4,(A5)+OOBVIT+0 ADD.W D4,D3 JUMP,NS 20$ CLR.W D4 20$: LOAD.W (A5)+OOBVIT+0,D4 POP.L D4 RET ;---------\\ ; RIGHTVIT > ;=========/ ; Diminue la vitesse vers la droite. ; in A5.L ^descripteur de l'objet ; D3.W de combien diminuer ; out - ; mod D7.W RIGHTVIT: PUSH.L D4 LOAD.W D4,(A5)+OOBVIT+2 SUB.W D4,D3 JUMP,NC 20$ CLR.W D4 20$: LOAD.W (A5)+OOBVIT+2,D4 POP.L D4 RET ;--------\\ ; LEFTVIT > ;========/ ; Diminue la vitesse vers la gauche. ; in A5.L ^descripteur de l'objet ; D3.W de combien diminuer ; out - ; mod D7.W LEFTVIT: PUSH.L D4 LOAD.W D4,(A5)+OOBVIT+2 ADD.W D4,D3 JUMP,NS 20$ CLR.W D4 20$: LOAD.W (A5)+OOBVIT+2,D4 POP.L D4 RET ;--------\\ ; MAXVIT > ;========/ ; Tronque les vitesses pour ne pas aller trop vite ! ; in A5.L ^description de l'objet ; out - ; mod D7.W MAXVIT: PUSH.L D4 LOAD.W D4,(A5)+OOBVIT+2 COMP.W D4,#-MAXVITX JUMP,GE 10$ LOAD.W D4,#-MAXVITX 10$: COMP.W D4,#+MAXVITX JUMP,LE 15$ LOAD.W D4,#+MAXVITX 15$: LOAD.W (A5)+OOBVIT+2,D4 LOAD.W D4,(A5)+OOBVIT+0 COMP.W D4,#-MAXVITY JUMP,GE 20$ LOAD.W D4,#-MAXVITY 20$: COMP.W D4,#+MAXVITY JUMP,LE 25$ LOAD.W D4,#+MAXVITY 25$: LOAD.W (A5)+OOBVIT+0,D4 POP.L D4 RET ;--------\\ ; MOVERAQ > ;========/ ; Dplace la raquette. ; in A4.L ^description de la raquette ; D4.W nouvelle position (x) ; D3.W nouvelle inclinaison (+/-) ; out - ; mod D7.W MOVERAQ: PUSHM.L D1..D5,A5 TEST.B (A6)+OMODE:#BFACILE ; mode facile ? JUMP,BC 02$ ; non => 02$ LOAD.W D4,(A5)+OOBPOS+2 LOAD.W D2,(A5)+OOBDIM+2 SR.W D2,#1 ADD.W D4,D2 SUB.W D4,#IDXRAQ/2 ; D4 <-- juste dessous la balle ! 02$: TEST.B (A6)+OFIXE ; raquette fixe ? JUMP,F 05$ ; non => 05$ LOAD.W D4,#POSXRAQ ; D4 <-- impose la position horizontale 05$: TEST.W (A4)+ORAQEL ; raquette leve ? JUMP,EQ 07$ ; non => 07$ DEC.W (A4)+ORAQEL ; oui => rabaisse-la 07$: SWAP.W D4 LOAD.W D4,#POSYRAQ ; D4 <-- impose la position verticale SUB.W D4,(A4)+ORAQEL ; D4 <-- tient compte d'une ventuelle lvation SWAP.W D4 ; Regarde si la position ou l'inclinaison ont chang. ; Si l'un ou l'autre a chang, il faut redessiner la raquette. COMP.L D4,(A4)+ORAQPO JUMP,NE 10$ COMP.W D3,(A4)+ORAQIN JUMP,EQ 90$ 10$: LOAD.L A5,#(A6)+OBALLE ; Vrifie si la position de la souris n'est ni trop  gauche ; ni trop  droite. LOAD.W D2,(A4)+ORAQDX COMP.W D4,D2 ; souris trop  gauche ? JUMP,GE 25$ LOAD.W D4,D2 25$: LOAD.W D2,(A4)+ORAQFX COMP.W D4,D2 ; souris trop  droite ? JUMP,LE 30$ LOAD.W D4,D2 ; Regarde si l'ancienne ou la nouvelle raquette recoupe, mme ; partiellement, la balle. 30$: LOAD.W D1,#1 ; D1 <-- la balle recoupe la raquette TEST.B (A4)+ORAQET:#BRAQS ; lancement de la balle ? JUMP,BS 35$ ; oui => 35$ PUSHM.L D3,D4 LOAD.L D3,(A4)+ORAQPO LOAD.L D4,#H'10000*IDYRAQ+IDXRAQ CALL DETOBJ ; balle recoupe l'ancienne raquette ? LOAD.W D1,D7 ; D1 <-- zro si pas de collision POPM.L D3,D4 TEST.W D1 JUMP,NE 35$ PUSHM.L D3,D4 LOAD.L D3,D4 LOAD.L D4,#H'10000*IDYRAQ+IDXRAQ CALL DETOBJ ; balle recoupe la nouvelle raquette ? LOAD.W D1,D7 ; D1 <-- zro si pas de collision POPM.L D3,D4 ; Dplace la raquette, en effaant puis en remettant la balle ; si elle recoupe l'ancienne ou la nouvelle raquette. 35$: TEST.W D1 JUMP,EQ 40$ TEST.B (A5)+OOBNEW JUMP,T 40$ CALL INVOBJ ; efface la balle ; Si on est en phase de lancement, met la balle sur la raquette, ; en tenant compte de son inclinaison. 40$: TEST.B (A4)+ORAQET:#BRAQS JUMP,BC 50$ LOAD.L D5,D4 ADD.W D5,#IDXRAQ/2 LOAD.W D2,(A5)+OOBDIM+2 SR.W D2,#1 SUB.W D5,D2 LOAD.W D2,(A4)+ORAQIN ASR.W D2,#1 ADD.W D5,D2 SWAP.W D5 ADD.W D5,#22 SUB.W D5,(A5)+OOBDIM+0 LOAD.W D2,(A4)+ORAQIN JUMP,NC 45$ NEG.W D2 45$: SR.W D2,#1 SUB.W D5,D2 SWAP.W D5 LOAD.L (A5)+OOBPOS,D5 ; met la balle sur la raquette ; Maintenant que la balle est ventuellement enleve, dplace ; l'icne de la raquette. 50$: LOAD.W (A4)+ORAQIN,D3 LOAD.W D2,D3 ; D2 <-- nouvelle inclinaison NEG.W D2 ADD.B D2,(A4)+ORAQIC ; D2 <-- code de l'icne LOAD.L D5,#H'10000*IDYRAQ+IDXRAQ ; D5 <-- dimensions LOAD.L D3,(A4)+ORAQPO ; D3 <-- ancienne position CALL MOVELICONE ; dplace l'icne LOAD.L (A4)+ORAQPO,D4 ; Remet la balle si elle avait t enleve. TEST.W D1 JUMP,EQ 90$ CALL INVOBJ ; remet la balle CLR.B (A5)+OOBNEW 90$: POPM.L D1..D5,A5 RET ;--------\\ ; DETOBJ > ;========/ ; Dtecte si un objet (rectangulaire) entre en collision ; avec une zone rectangulaire quelconque. ; in A5.L ^description de l'objet ; D3.L coin sup/gauche (y;x) ; D4.L dimensions (dy;dx) ; out D7.W EQ => pas de collision ; NE => collision ; mod D7.W DETOBJ: PUSHM.L D2..D4 CLR.W D7 ; D7 <-- pas de collision LOAD.W D2,(A5)+OOBPOS+2 ADD.W D2,(A5)+OOBDIM+2 COMP.W D3,D2 JUMP,HS 90$ SUB.W D2,(A5)+OOBDIM+2 ADD.W D3,D4 COMP.W D3,D2 JUMP,LO 90$ SWAP.W D3 SWAP.W D4 LOAD.W D2,(A5)+OOBPOS+0 ADD.W D2,(A5)+OOBDIM+0 COMP.W D3,D2 JUMP,HS 90$ SUB.W D2,(A5)+OOBDIM+0 ADD.W D3,D4 COMP.W D3,D2 JUMP,LO 90$ LOAD.W D7,#1 ; D7 <-- collision 90$: POPM.L D2..D4 TEST.W D7 ; retour EQ/NE RET ;--------\\ ; INVOBJ > ;========/ ; Inverse un objet. ; in A5.L ^descripteur de l'objet ; out - ; mod D7.W INVOBJ: PUSHM.L D2..D5 CALL GETICONE ; D2 <-- code de l'icne LOAD.B D3,D2 ; D3 <-- code de l'icne LOAD.W D2,#INVDOT ; D2 <-- mode LOAD.L D4,(A5)+OOBPOS ; D4 <-- position LOAD.L D5,(A5)+OOBDIM ; D5 <-- dimensions CALL DRICONE ; inverse l'icne POPM.L D2..D5 RET ;-----------\\ ; MOVEIICONE > ;===========/ ; Dplace une icne sur l'cran en l'inversant. ; in A5.L ^description de l'objet ; D3.L ancienne position (y;x) ; D4.L nouvelle position (y;x) ; D5.L dimensions (dy;dx) ; out - ; mod D7.W MOVEIICONE: PUSHM.L D1..D4 CALL GETICONE ; D2 <-- code de l'ancienne icne LOAD.B D1,D2 ; D1 <-- code de l'ancienne icne CALL AGEICONE ; vieilli l'icne ! CALL GETICONE ; D2 <-- code de la nouvelle icne COMP.L D3,D4 ; nouvelle position = ancienne ? JUMP,NE 20$ COMP.B D1,D2 ; nouvelle icne = ancienne ? JUMP,EQ 90$ ; oui => 90$ 20$: PUSH.L D3 LOAD.B D3,D2 ; D3 <-- code de la nouvelle icne LOAD.W D2,#INVDOT ; D2 <-- mode CALL DRICONE ; dessine la nouvelle icne POP.L D3 TEST.B (A5)+OOBNEW JUMP,T 80$ LOAD.L D4,D3 ; D4 <-- ancienne position LOAD.B D3,D1 ; D3 <-- code de l'ancienne icne LOAD.W D2,#INVDOT ; D2 <-- mode CALL DRICONE ; efface l'ancienne icne 80$: CLR.B (A5)+OOBNEW 90$: POPM.L D1..D4 RET ;---------\\ ; GETICONE > ;=========/ ; Donne le code de l'icne d'un objet. ; in A5.L ^description de l'objet ; out D2.B code de l'icne ; mod D2.L, D7.W GETICONE: PUSH.W D3 LOAD.B D2,(A5)+OOBICO ; D2 <-- code de l'icne TEST.W (A5)+OOBVIE JUMP,NE 90$ LOAD.W D3,(A5)+OOBFIN ADD.B D2,D3 COMP.W D3,#NBANIME JUMP,LS 90$ CLR.B D2 90$: POP.W D3 RET ;---------\\ ; AGEICONE > ;=========/ ; Fait vieillir une icne, jusqu' sa mort ! ; in A5.L ^description de l'objet ; out - ; mod D7.W AGEICONE: PUSH.L D3 COMP.W (A5)+OOBVIE,#-1 ; icne immortelle ? JUMP,EQ 90$ ; oui => 90$ TEST.W (A5)+OOBVIE ; icne morte ? JUMP,EQ 20$ ; oui => 20$ DEC.W (A5)+OOBVIE ; oeuvre inxorable du temps ... JUMP 90$ 20$: ; mort de l'icne => TEST.W (A5)+OOBFIN JUMP,NE 30$ TEST.W (A5)+OOBVIF JUMP,NE 30$ CALL MUS3OBJ ; bruit de la mort de l'objet 30$: LOAD.W D3,(A5)+OOBFIN COMP.W D3,#NBANIME JUMP,LO 40$ SET.B (A5)+OOBOLD JUMP 90$ 40$: INC.W (A5)+OOBVIF COMP.W (A5)+OOBVIF,#VTANIME JUMP,LO 90$ CLR.W (A5)+OOBVIF INC.W (A5)+OOBFIN 90$: POP.L D3 RET ;-----------\\ ; MOVELICONE > ;===========/ ; Dplace une icne sur l'cran en mode "load". ; in D2.B code de l'icne ; D3.L ancienne position (y;x) ; D4.L nouvelle position (y;x) ; D5.L dimensions (dy;dx) ; out - ; mod D7.W MOVELICONE: PUSHM.L D2,D3 CALL MOVECLR ; efface ce qui dpasse LOAD.B D3,D2 ; D3 <-- code de l'icne LOAD.W D2,#SETDOT ; D2 <-- mode "load" CALL DRICONE ; dessine la nouvelle icne POPM.L D2,D3 RET ;--------\\ ; MOVECLR > ;--------/ ; Efface la zone laisse vide aprs un dplacement. ; in D3.L ancienne position (y;x) ; D4.L nouvelle position (y;x) ; D5.L dimensions (dy;dx) ; out - ; mod D7.W MOVECLR: PUSHM.L D3..D5 TEST.L D3 ; ancienne position existe ? JUMP,EQ 90$ ; non => 90$ PUSHM.L D3..D5 SUB.W D4,D3 JUMP,NC 10$ NEG.W D4 10$: COMP.W D4,D5 ; trop loin horizontalement ? JUMP,HS 60$ ; oui => 60$ SWAP.W D3 SWAP.W D4 SWAP.W D5 SUB.W D4,D3 JUMP,NC 15$ NEG.W D4 15$: COMP.W D4,D5 ; trop loin verticalement ? JUMP,HS 60$ ; oui => 60$ POPM.L D3..D5 PUSHM.L D3,D4 SWAP.W D4 SWAP.W D5 LOAD.W D4,D5 SWAP.W D5 SWAP.W D4 COMP.W D3,D4 JUMP,EQ 30$ JUMP,HI 20$ SUB.W D4,D3 CALL DRCLEAR ; efface la zone  gauche JUMP 30$ 20$: SUB.W D4,D3 NEG.W D4 ADD.W D3,D5 SUB.W D3,D4 CALL DRCLEAR ; efface la zone  droite 30$: POPM.L D3,D4 LOAD.W D4,D5 SWAP.W D3 SWAP.W D4 SWAP.W D5 COMP.W D3,D4 JUMP,EQ 90$ JUMP,HI 40$ SUB.W D4,D3 SWAP.W D3 SWAP.W D4 CALL DRCLEAR ; efface la zone en haut JUMP 90$ 40$: SUB.W D4,D3 NEG.W D4 ADD.W D3,D5 SUB.W D3,D4 SWAP.W D3 SWAP.W D4 CALL DRCLEAR ; efface la zone en bas JUMP 90$ 60$: POPM.L D3..D5 LOAD.L D4,D5 CALL DRCLEAR ; efface toute l'ancienne zone 90$: POPM.L D3..D5 RET ; Gestion du tableau de bord ; -------------------------- ;-----------\\ ; NEWSERVICE > ;===========/ ; Cherche qui doit effectuer le service, et clignotte plus ; longtemps en cas de changement de service. ; in - ; out D4.W bit zro indique  qui le service ; mod D4.L, D7.W NEWSERVICE: PUSHM.L D3,A3 CLR.L D4 LOAD.W D4,(A6)+OCONJ ADD.W D4,(A6)+OCONS ; D4 <-- total des points COMP.W D4,#MAXPOINT*2 ; prolongation ? JUMP,HS 10$ ; oui => 10$ (change de service chaque fois) DIV.WU D4,#5 ; non => change toute les 5 balles 10$: LOAD.W D3,#1 ; D3 <-- juste une fois SWAP.W D4 TEST.W D4 JUMP,NE 15$ LOAD.W D3,#5 ; D3 <-- beaucoup car changement de service 15$: SWAP.W D4 20$: LOAD.L A3,#R16"TMUSSERV1 TEST.L D4:#0 JUMP,BC 22$ LOAD.L A3,#R16"TMUSSERV2 22$: CALL PATATRA TEST.L D4:#0 JUMP,BS 30$ CALL JSERVICE ; allume service au joueur JUMP 35$ 30$: CALL SSERVICE ; allume service au SMAKY 35$: PUSH.W D4 LOAD.W D4,#8 NTREL ?DELMS POP.W D4 LOAD.L A3,#R16"TMUSSERV1 TEST.L D4:#0 JUMP,BS 42$ LOAD.L A3,#R16"TMUSSERV2 42$: CALL PATATRA CALL ESERVICE ; teint services PUSH.W D4 LOAD.W D4,#8 NTREL ?DELMS POP.W D4 DEC.W D3 JUMP,NE 20$ 90$: POPM.L D3,A3 RET ;---------\\ ; JSERVICE > ;=========/ ; Allume la case de service du joueur. ; in - ; out - ; mod D7.W JSERVICE: TSET.B (A6)+OSERV:#0 JUMP,BS 20$ CALL IJSERVICE ; allume 20$: TCLR.B (A6)+OSERV:#1 JUMP,BC 30$ CALL ISSERVICE ; teint 30$: RET ;---------\\ ; SSERVICE > ;=========/ ; Allume la case de service du SMAKY. ; in - ; out - ; mod D7.W SSERVICE: TCLR.B (A6)+OSERV:#0 JUMP,BC 20$ CALL IJSERVICE ; teint 20$: TSET.B (A6)+OSERV:#1 JUMP,BS 30$ CALL ISSERVICE ; allume 30$: RET ;---------\\ ; ESERVICE > ;=========/ ; Efface les cases de service. ; in - ; out - ; mod D7.W ESERVICE: TCLR.B (A6)+OSERV:#0 JUMP,BC 20$ CALL IJSERVICE ; teint 20$: TCLR.B (A6)+OSERV:#1 JUMP,BC 30$ CALL ISSERVICE ; teint 30$: RET ;----------\\ ; IJSERVICE > ;----------/ ; Inverse la case de service du joueur. ; in - ; out - ; mod D7.W IJSERVICE: PUSHM.L D3,D4 LOAD.L D3,#H'10000*POSYSJ+POSXSJ LOAD.L D4,#H'10000*13+13 CALL DRINV POPM.L D3,D4 RET ;----------\\ ; ISSERVICE > ;----------/ ; Inverse la case de service du SMAKY. ; in - ; out - ; mod D7.W ISSERVICE: PUSHM.L D3,D4 LOAD.L D3,#H'10000*POSYSS+POSXSS LOAD.L D4,#H'10000*13+13 CALL DRINV POPM.L D3,D4 RET ;----------\\ ; VIECOMPTE > ;==========/ ; Fait clignotter le compteur du gagnant. ; in - ; out - ; mod D7.W VIECOMPTE: PUSH.L D4 INC.W (A6)+OCOMPF COMP.W (A6)+OCOMPF,#6 JUMP,LO 90$ CLR.W (A6)+OCOMPF LOAD.W D4,(A6)+OCONJ COMP.W D4,(A6)+OCONS JUMP,EQ 60$ JUMP,LO 40$ 20$: ; joueur gagne => CALL IJCOMPTE CALL CSCOMPTE JUMP 90$ 40$: ; SMAKY gagne => CALL CJCOMPTE CALL ISCOMPTE JUMP 90$ 60$: ; galit => TEST.W D4 ; zro  zro ? JUMP,EQ 90$ ; oui => 90$ CALL IJCOMPTE CALL ISCOMPTE ; JUMP 90$ 90$: POP.L D4 RET ;---------\\ ; SJCOMPTE > ;=========/ ; Allume le compteur du joueur. ; in - ; out - ; mod D7.W SJCOMPTE: TSET.B (A6)+OCOMP:#0 JUMP,BS 90$ CALL IIJCOMPTE 90$: RET ;---------\\ ; CJCOMPTE > ;=========/ ; Eteint le compteur du joueur. ; in - ; out - ; mod D7.W CJCOMPTE: TCLR.B (A6)+OCOMP:#0 JUMP,BC 90$ CALL IIJCOMPTE 90$: RET ;---------\\ ; IJCOMPTE > ;=========/ ; Inverse le compteur du joueur. ; in - ; out - ; mod D7.W IJCOMPTE: TNOT.B (A6)+OCOMP:#0 CALL IIJCOMPTE RET ;---------\\ ; SSCOMPTE > ;=========/ ; Allume le compteur du SMAKY. ; in - ; out - ; mod D7.W SSCOMPTE: TSET.B (A6)+OCOMP:#1 JUMP,BS 90$ CALL IISCOMPTE 90$: RET ;---------\\ ; CSCOMPTE > ;=========/ ; Eteint le compteur du SMAKY. ; in - ; out - ; mod D7.W CSCOMPTE: TCLR.B (A6)+OCOMP:#1 JUMP,BC 90$ CALL IISCOMPTE 90$: RET ;---------\\ ; ISCOMPTE > ;=========/ ; Inverse le compteur du SMAKY. ; in - ; out - ; mod D7.W ISCOMPTE: TNOT.B (A6)+OCOMP:#1 CALL IISCOMPTE RET ;----------\\ ; IIJCOMPTE > ;----------/ ; Inverse la case du compteur du joueur. ; in - ; out - ; mod D7.W IIJCOMPTE: PUSHM.L D3,D4 LOAD.L D3,#H'10000*(POSYCJ-12)+(POSXCJ-2) LOAD.L D4,#H'10000*15+23 CALL DRINV POPM.L D3,D4 RET ;----------\\ ; IISCOMPTE > ;----------/ ; Inverse la case du compteur du SMAKY. ; in - ; out - ; mod D7.W IISCOMPTE: PUSHM.L D3,D4 LOAD.L D3,#H'10000*(POSYCS-12)+(POSXCS-2) LOAD.L D4,#H'10000*15+23 CALL DRINV POPM.L D3,D4 RET ;---------\\ ; SCOMPTE > ;=========/ ; Affiche le compteur du SMAKY. ; in - ; out - ; mod D7.W SCOMPTE: PUSHM.L D4 CALL CSCOMPTE ; teint le compteur LOAD.W D4,(A6)+OCONS LOAD.L D3,#H'10000*POSYCS+POSXCS CALL MAJCOMPTE POPM.L D4 RET ;---------\\ ; JCOMPTE > ;=========/ ; Affiche le compteur du joueur. ; in - ; out - ; mod D7.W JCOMPTE: PUSHM.L D4 CALL CJCOMPTE ; teint le compteur LOAD.W D4,(A6)+OCONJ LOAD.L D3,#H'10000*POSYCJ+POSXCJ CALL MAJCOMPTE POPM.L D4 RET ;----------\\ ; MAJCOMPTE > ;----------/ ; Affiche un compteur sur l'cran. ; in D4.W compteur (..n) ; D3.L position dans l'cran ; out - ; mod D7.W MAJCOMPTE: PUSHM.L D2..D4 LOAD.L D2,D3 TEST.B (A6)+OINV ; fond de l'cran blanc ? JUMP,F 20$ LOAD.B D3,#AFINV LIB ?AFCAR ; passe en vide inverse 20$: LOAD.L D3,D2 LIB ?SETCURS AND.L D4,#H'FFFF DIV.WU D4,#100 CLR.W D4 SWAP.W D4 ; D4 <-- 0..99 DIV.WU D4,#10 LOAD.B D3,D4 ADD.B D3,#'0 LIB ?AFCAR ; affiche les dizaines LOAD.L D3,D2 ADD.W D3,#13 LIB ?SETCURS SWAP.W D4 LOAD.B D3,D4 ADD.B D3,#'0 LIB ?AFCAR ; affiche les units LOAD.B D3,#AFDIR LIB ?AFCAR POPM.L D2..D4 RET ; Routines de GA (gomtrie analytique) ; ------------------------------------- ;----------\\ ; GAINTERHV > ;==========/ ; Trouve le point d'intersection d'une droite quelconque P1(y,x)-P2(y,x) ; avec une droite horizontale ou verticale P3(y,x)-P4(y,x). ; in D1.L P1(y,x) ; D2.L P2(y,x) ; D3.L P3(y,x) ; D4.L P4(y,x) ; out D0.L I(y,x) ; D7.W erreur ; mod D0.L, D7.W GAINTERHV: PUSHM.L D1..D4 LOAD.W D7,#1 ; D7 <-- erreur COMP.W D3,D4 ; droite verticale ? JUMP,EQ 50$ SWAP.W D3 SWAP.W D4 COMP.W D3,D4 ; droite horizontale ? JUMP,NE 90$ SWAP.W D4 SWAP.W D3 ; droite horizontale => LOAD.L D0,D3 CALL GAINTERH JUMP,NE 90$ EX.L D0,D3 ; D0 <-- I(y,x) LOAD.W D7,#1 COMP.W D0,D3 JUMP,LO 90$ COMP.W D0,D4 JUMP,HS 90$ CLR.W D7 ; D7 <-- ok JUMP 90$ 50$: ; droite verticale => LOAD.L D0,D3 CALL GAINTERV JUMP,NE 90$ EX.L D0,D3 ; D0 <-- I(y,x) LOAD.W D7,#1 SWAP.W D0 SWAP.W D3 SWAP.W D4 COMP.W D0,D3 JUMP,LO 90$ COMP.W D0,D4 JUMP,HS 90$ SWAP.W D0 CLR.W D7 ; D7 <-- ok 90$: POPM.L D1..D4 TEST.W D7 ; retour EQ/NE RET ;---------\\ ; GAINTERH > ;---------/ ; Trouve le point d'intersection d'une droite P1(y,x)-P2(y,x) ; quelconque avec une droite horizontale. ; (P2x-P1x) * (Iy-P1y) ; Ix = ---------------------- + P1x ; (P2y-P1y) ; in D1.L P1(y,x) ; D2.L P2(y,x) ; D3.L I(y,?) ; out D3.L I(y,x) ; D7.W erreur ; mod D3.L, D7.W GAINTERH: SWAP.W D1 SWAP.W D2 ; swap x <--> y SWAP.W D3 CALL GAINTERV ; comme si vertical ! SWAP.W D3 SWAP.W D2 ; swap y <--> x SWAP.W D1 TEST.W D7 ; retour EQ/NE RET ;---------\\ ; GAINTERV > ;---------/ ; Trouve le point d'intersection d'une droite P1(y,x)-P2(y,x) ; quelconque avec une droite verticale. ; (P2y-P1y) * (Ix-P1x) ; Iy = ---------------------- + P1y ; (P2x-P1x) ; in D1.L P1(y,x) ; D2.L P2(y,x) ; D3.L I(?,x) ; out D3.L I(y,x) ; D7.W erreur ; mod D3.L, D7.W GAINTERV: PUSHM.L D0..D2 LOAD.W D7,#1 ; D7 <-- erreur SUB.W D2,D1 ; D2 <-- P2x-P1x JUMP,EQ 90$ SWAP.W D1 SWAP.W D2 SUB.W D2,D1 ; D2 <-- P2y-P1y SWAP.W D1 LOAD.W D0,D3 SUB.W D0,D1 ; D0 <-- Ix-P1x MUL.WA D0,D2 ; D2 <-- (P2y-P1) * (Ix-P1x) SWAP.W D2 DIV.WA D0,D2 SWAP.W D1 ADD.W D0,D1 SWAP.W D3 LOAD.W D3,D0 ; D3 <-- Iy SWAP.W D3 CLR.W D7 ; D7 <-- ok 90$: POPM.L D0..D2 TEST.W D7 ; retour EQ/NE RET ; Gestion des bruits ; ------------------ ;--------\\ ; MUS1OBJ > ;========/ ; Fait entendre un bruit numro 1 li  un objet spcifique. ; in A5.L ^description de l'objet ; out - ; mod D7.W MUS1OBJ: PUSH.L A3 LOAD.L A3,#R16"TMUS ADD.W A3,(A5)+OOBMU1 CALL PATATRA POP.L A3 RET ;--------\\ ; MUS2OBJ > ;========/ ; Fait entendre un bruit numro 2 li  un objet spcifique. ; in A5.L ^description de l'objet ; out - ; mod D7.W MUS2OBJ: PUSH.L A3 LOAD.L A3,#R16"TMUS ADD.W A3,(A5)+OOBMU2 CALL PATATRA POP.L A3 RET ;--------\\ ; MUS3OBJ > ;========/ ; Fait entendre un bruit numro 3 li  un objet spcifique. ; in A5.L ^description de l'objet ; out - ; mod D7.W MUS3OBJ: PUSH.L A3 LOAD.L A3,#R16"TMUS ADD.W A3,(A5)+OOBMU3 CALL PATATRA POP.L A3 RET ;--------\\ ; PATATRA > ;========/ ; Fait un bruit rigolo ! ; in A3.L ^table de bruit ; out - ; mod D7.W PATATRA: PUSH.L A4 LOAD.L A4,A3 TEST.W (A4) JUMP,EQ 90$ LIB ?PLAY 90$: POP.L A4 RET TMUS: TMUSCOLB1: .W PERIODE+3000,PERIODE+3001,PERIODE+3002,H'100*20+0 .W 0 TMUSCOLR1: .W PERIODE+2000,PERIODE+2001,PERIODE+2002,H'100*20+0 .W 0 TMUSENDB1: .W PERIODE+3567,PERIODE+3254,BRUIT+31,H'100*50+0 .W 0 TMUSCOLBRI1: .W PERIODE+3000,PERIODE+3001,PERIODE+3002,H'100*10+0 .W 0 TMUSCOLBRI2: .W BRUIT+4,SILENCE,SILENCE,H'100*50+0 .W 0 TMUSSERV1: .W NOTE+OCTAVE*6,NOTE+OCTAVE*5,NOTE+OCTAVE*4,H'100*10+0 .W 0 TMUSSERV2: .W NOTE+OCTAVE*5,NOTE+OCTAVE*4,NOTE+OCTAVE*3,H'100*10+0 .W 0 TMUSSERVICE: .W PERIODE+1000,SILENCE,SILENCE,H'100*255+2 .W PERIODE+900,SILENCE,SILENCE,H'100*255+2 .W PERIODE+800,SILENCE,SILENCE,H'100*255+2 .W PERIODE+700,SILENCE,SILENCE,H'100*255+2 .W PERIODE+600,SILENCE,SILENCE,H'100*255+2 .W PERIODE+500,SILENCE,SILENCE,H'100*255+2 .W PERIODE+400,SILENCE,SILENCE,H'100*255+2 .W PERIODE+300,SILENCE,SILENCE,H'100*255+2 .W PERIODE+200,SILENCE,SILENCE,H'100*255+2 .W PERIODE+100,SILENCE,SILENCE,H'100*2+2 .W 0 TMUSYOUPIE: .W PERIODE+800,PERIODE+400,PERIODE+600,H'100*10+4 .W PERIODE+300,PERIODE+600,PERIODE+400,H'100*10+4 .W PERIODE+250,PERIODE+500,PERIODE+1000,H'100*10+4 .W PERIODE+600,PERIODE+300,PERIODE+400,H'100*10+4 .W PERIODE+1000,PERIODE+500,PERIODE+1500,H'100*10+4 .W PERIODE+500,PERIODE+1000,PERIODE+750,H'100*10+4 .W PERIODE+200,PERIODE+300,PERIODE+400,H'100*10+4 .W PERIODE+400,PERIODE+500,PERIODE+600,H'100*10+1 .W 0 TMUSPERDU: .W NOTE+14,NOTE+12+14,NOTE+14+34,H'100*50+30 .W NOTE+13,NOTE+12+13,NOTE+14+33,H'100*50+30 .W NOTE+12,NOTE+12+12,NOTE+14+32,H'100*50+30 .W NOTE+11,NOTE+12+11,NOTE+14+31,H'100*60+0 .W 0 ; Gestion de la souris ; -------------------- ;--------\\ ; IFMOUSE > ;========/ ; Donne la position de la souris dans la swdo. ; in - ; out D4.L position de la souris (y;x) ; D7.W erreur ; mod D4.L, D7.W IFMOUSE: PUSH.L D3 LIB ?IFMOUSE JUMP',NE 90$ SUB.W D4,(A0)+ODFFX JUMP',HS 20$ CLR.W D4 LOAD.W D7,#ERDIOUT 20$: SWAP.W D4 SUB.W D4,(A0)+ODFFY JUMP',HS 30$ CLR.W D4 LOAD.W D7,#ERDIOUT 30$: SWAP.W D4 90$: POP.L D3 TEST.W D7 ; retour EQ/NE RET ;--------\\ ; PMOUSE > ;========/ ; Positionne la souris en (y;x). ; in D4.L nouvelle position y;x ; out - ; mod D7.W PMOUSE: PUSHM.L D3,D4,D6,A4 LOAD.L (A6)+OMOUPO,D4 ; mm. la position de la souris ADD.W D4,(A0)+ODFFX SWAP.W D4 ADD.W D4,(A0)+ODFFY SWAP.W D4 ; Ramne la position dans la fentre si elle en sort. TEST.W D4 ; trop  gauche ? JUMP',NC 10$ CLR.W D4 10$: COMP.W D4,(A0)+ODFDX ; trop  droite ? JUMP',LT 15$ LOAD.W D4,(A0)+ODFDX DEC.W D4 15$: SWAP.W D4 TEST.W D4 ; trop en haut ? JUMP',NC 20$ CLR.W D4 20$: COMP.W D4,(A0)+ODFDY ; trop en bas ? JUMP',LT 25$ LOAD.W D4,(A0)+ODFDY DEC.W D4 25$: SWAP.W D4 ; Calcul la position absolue dans le grand bitmap $DIS_0. ADD.W D4,(A0)+ODFX SWAP.W D4 ADD.W D4,(A0)+ODFY SWAP.W D4 ; D4 <-- position dans $DIS_0 ! ; Envoie la commande secrte et mystrieuse de positionnement. LOAD.L A4,#(A6)+OBUDIS+1 LOAD.B (A4)+0,#'P ;

LOAD.L (A4)+1,D4 ; CLR.B (A4)+5 LOAD.W D3,#TYPIO ; D3 <-- type du driver souris LIB ?GCHMOU ; D6 <-- canal souris FOS ?COMMAND POPM.L D3,D4,D6,A4 RET ; Routines graphiques rapides ; --------------------------- ;--------\\ ; PREPBRI > ;========/ ; Prpare un caractre pour pouvoir l'animer rapidement ; en mode inverse (petite recette de cuisine secrte) ! ; ATTENTION: On gnre directement la matrice dans le ; gencar, d'o incompatibilit si plusieurs programmes ; utilisent ce mme gencar. ; in D3.B code de l'icne ; out - ; mod D7.W PREPBRI: PUSHM.L D1..D6,A2..A4 LOAD.L A2,(A6)+OPGICO ; A2 <-- ^gencar IMP64 AND.W D3,#H'FF MUL.WU D3,(A2)+OGCMSB LOAD.L A3,#(A2)+OGCMAT ADD.L A3,D3 ; A3 <-- ^matrice source LOAD.L A4,A3 ADD.W A4,(A2)+OGCMSB ; A4 <-- ^matrice destination CLR.W D5 LOAD.B D5,(A2)+OGCMWB ; D5 <-- largeur en bytes LOAD.W D6,D5 LOAD.L D3,#H'10000*IDYBRI CLR.L D4 LOAD.L D1,#H'10000*IDYBRI+IDXBRI LOAD.W D2,#SETDOT CALL DRRASTER LOAD.L A3,A4 LOAD.W D2,#INVDOT CALL DRRASTER POPM.L D1..D6,A2..A4 RET ;--------\\ ; DRICONE > ;========/ ; Dessine une icne de IPP64. ; in D3.B code de l'icne (0..127) ; D4.L position coin inf/gauche (y;x) ; D5.L dimensions (dy;dx) ; D2.W mode ; out - ; mod D7.W DRICONE: PUSHM.L D0..D5,A1,A2,A4 CLR.W D1 LOAD.B D1,D3 ; D1 <-- code de l'icne LOAD.L A4,(A6)+OPGICO ; A4 <-- ^gencar IPP64 LOAD.L D3,D5 ; D3 <-- dimensions CLR.W D5 LOAD.B D5,(A4)+OGCMWB ; D5 <-- largeur en bytes MUL.WU D1,(A4)+OGCMSB ADD.L A4,#OGCMAT ADD.L A4,D1 ; A4 <-- ^la bonne matrice LOAD.W D1,D2 ; D1 <-- mode CLR.B D2 ; D2 <-- pas d'inversion vido COMP.B D1,#INVDOT JUMP,EQ 50$ TEST.B (A6)+OINV ; fond de l'cran blanc ? JUMP,F 50$ ; non => 50$ NOT.B D2 ; D2 <-- inversion vido 50$: LOAD.L A2,A0 ; A2 <-- ^descripteur de la fentre LOAD.L A1,(A6)+OADMATRIX CALL (A1) ; appel de GRA_MATRIX POPM.L D0..D5,A1,A2,A4 RET ;--------\\ ; DRRECT > ;========/ ; Dessine un rectangle. ; in D3.L coordonne origine (y;x) ; D4.L dimensions (dy;dx) ; D2.W mode ; out - ; mod D7.W DRRECT: PUSHM.L D3..D5 LOAD.L D5,D4 ; D5 <-- dimensions (dy;dx) AND.L D4,#H'FFFF CALL DRLINE ; trace ligne suprieure LOAD.L D4,D5 CLR.W D4 CALL DRLINE ; trace ligne de droite LOAD.L D4,D5 AND.L D4,#H'FFFF NEG.W D4 CALL DRLINE ; trace ligne infrieure LOAD.L D4,D5 SWAP.W D4 NEG.W D4 SWAP.W D4 CLR.W D4 CALL DRLINE ; trace ligne de gauche POPM.L D3..D5 RET ;---------\\ ; DRRASTER > ;=========/ ; Dplace une surface rectangulaire mmoire/cran --> mmoire/cran. ; in D3.L coordonne source (y;x) ; A3.L ^mmoire source/^nil si cran ; D5.W Iy source (si mmoire) ; ---- ; D4.L coordonne destination (y;x) ; A4.L ^mmoire destination/^nil si cran ; D6.W Iy destination (si mmoire) ; ---- ; D1.L hauteur/largeur (y;x) ; D2.B opration (INVDOT, SETDOT, CLRDOT ou LOADDOT) ; out - ; mod D7.W DRRASTER: PUSHM.L D1,D2,A1,A2 TEST.W D1 ; dx <= 0 ? JUMP',LE 90$ SWAP.W D1 TEST.W D1 ; dy <= 0 ? JUMP',LE 90$ SWAP.W D1 EX.L D1,D2 ; D2/D1 <-- mode/dimensions LOAD.L A2,A0 ; A2 <-- ^descripteur de la fentre LOAD.L A1,(A6)+OADRASTER CALL (A1) ; appel de GRA_RASTER 90$: POPM.L D1,D2,A1,A2 RET ;-------\\ ; DRDOT > ;=======/ ; Dessine un point. ; in D3.L coordonne (y;x) ; D2.W mode ; out - ; mod D7.W DRDOT: PUSHM.L D1..D4,A1,A2 LOAD.W D1,D2 ; D1 <-- mode LOAD.L D4,D3 ; D4 <-- y;x LOAD.L A2,A0 ; A2 <-- ^descripteur de la fentre LOAD.L A1,(A6)+OADDOT CALL (A1) ; appel de GRA_DOT POPM.L D1..D4,A1,A2 RET ;--------\\ ; DRLINE > ;========/ ; Dessine un segment de droite. ; in D3.L coordonne origine (y;x) ; D4.L dimensions (dy;dx) ; D2.W mode ; out D3.L coordonne d'arrive (y;x) ; mod D3.L, D7.W DRLINE: PUSHM.L D1,D2,D4,A1,A2 LOAD.W D1,D2 ; D1 <-- mode EX.L D3,D4 ; D4/D3 <-- y;x/dy;dx LOAD.L A2,A0 ; A2 <-- ^descripteur de la fentre LOAD.L A1,(A6)+OADLINE CALL (A1) ; appel de GRA_LINE EX.L D3,D4 ADD.W D3,D4 ; D3 <-- arrive en X SWAP.W D3 SWAP.W D4 ADD.W D3,D4 ; D3 <-- arrive en Y SWAP.W D3 ; SWAP.W D4 POPM.L D1,D2,D4,A1,A2 RET ;----------\\ ; DRELLIPSE > ;==========/ ; Dessine une ellipse, ou un arc d'ellipse. ; in D3.L coordonne centre (y;x) ; D4.L rayons (dy;dx) ; D2.W mode ; D1.B bitmap des octants  dessiner ; out - ; mod D7.W DRELLIPSE: PUSHM.L D1..D4,A1,A2 EX.L D1,D2 ; D2/D1 <-- mode/octants EX.L D3,D4 ; D4/D3 <-- y;x/dy;dx LOAD.L A2,A0 ; A2 <-- ^descripteur de la fentre LOAD.L A1,(A6)+OADELLIPSE CALL (A1) ; appel de GRA_ELLIPSE POPM.L D1..D4,A1,A2 RET ;---------\\ ; DRTRADEF > ;=========/ ; Dfinit une trame. ; in D3.L trame ; D4.L trame ; out - ; mod D7.W DRTRADEF: PUSHM.L D1..D4 COMP.B (A6)+OMACHINE,#SMAKY100 JUMP',NE 80$ ; si SMAKY100 => LOAD.W D1,#4-1 20$: CALL FLIP RR.L D3,#8 DECJ.W,NMO D1,20$ EX.L D3,D4 LOAD.W D1,#4-1 30$: CALL FLIP RR.L D3,#8 DECJ.W,NMO D1,30$ EX.L D4,D3 80$: LOAD.L (A0)+ODFTRA+0,D3 LOAD.L (A0)+ODFTRA+4,D4 POPM.L D1..D4 RET ;--------\\ ; FLIP > ;--------/ ; Permute tous les bits de D3.B. Pas de boucle pour tre ; rapide, et pas de table de 256 bytes pour conomiser la RAM ! ; in D3.B byte ; out D3.B byte "flipp" ; mod D2.B, D3.B FLIP: RLX.B D3 RRX.B D2 ; D2 <-- bit 0 RLX.B D3 RRX.B D2 ; D2 <-- bit 1 RLX.B D3 RRX.B D2 ; D2 <-- bit 2 RLX.B D3 RRX.B D2 ; D2 <-- bit 3 RLX.B D3 RRX.B D2 ; D2 <-- bit 4 RLX.B D3 RRX.B D2 ; D2 <-- bit 5 RLX.B D3 RRX.B D2 ; D2 <-- bit 6 RLX.B D3 RRX.B D2 ; D2 <-- bit 7 LOAD.B D3,D2 ; D3 <-- byte "flipp" RET ;---------\\ ; DRTRAME > ;=========/ ; Dessine une surface rectangulaire. ; in D3.L coordonne origine (y;x) ; D4.L dimensions (dy;dx) ; D2.W mode ; out - ; mod D7.W DRTRAME: PUSHM.L D1..D4,A1,A2,A4 TEST.W D4 ; dx <= 0 ? JUMP',LE 90$ SWAP.W D4 TEST.W D4 ; dy <= 0 ? JUMP',LE 90$ SWAP.W D4 LOAD.W D1,D2 ; D1 <-- mode EX.L D3,D4 ; D4/D3 <-- y;x/dy;dx LOAD.L A4,#(A0)+ODFTRA ; A4 <-- ^trame utilisateur LOAD.L A2,A0 ; A2 <-- ^descripteur de la fentre LOAD.L A1,(A6)+OADTRAME CALL (A1) ; appel de GRA_TRAME 90$: POPM.L D1..D4,A1,A2,A4 RET ;--------\\ ; DRZONE > ;========/ ; Efface, allume ou inverse une surface rectangulaire. ; in D3.L coordonne origine (y;x) ; D4.L dimensions (dy;dx) ; D2.W mode ; out - ; mod D7.W DRZONE: COMP.B D2,#INVDOT JUMP,EQ DRINV COMP.B D2,#SETDOT JUMP,EQ DRSET ;---------\\ ; DRCLEAR > ;=========/ ; Efface une surface rectangulaire. ; in D3.L coordonne origine (y;x) ; D4.L dimensions (dy;dx) ; out - ; mod D7.W DRCLEAR: TEST.B (A6)+OINV ; fond de l'cran blanc ? JUMP,T DRSET0 ; oui => DRSET0 DRCLEAR0: PUSHM.L D1..D4,A1,A2 TEST.W D4 ; dx <= 0 ? JUMP',LE 90$ SWAP.W D4 TEST.W D4 ; dy <= 0 ? JUMP',LE 90$ SWAP.W D4 LOAD.W D1,D2 ; D1 <-- mode EX.L D3,D4 ; D4/D3 <-- y;x/dy;dx LOAD.L A2,A0 ; A2 <-- ^descripteur de la fentre LOAD.L A1,(A6)+OADCLEAR CALL (A1) ; appel de GRA_SET 90$: POPM.L D1..D4,A1,A2 RET ;---------\\ ; DRSET > ;=========/ ; Allume une surface rectangulaire. ; in D3.L coordonne origine (y;x) ; D4.L dimensions (dy;dx) ; out - ; mod D7.W DRSET: TEST.B (A6)+OINV ; fond de l'cran blanc ? JUMP,T DRCLEAR0 ; oui => DRCLEAR0 DRSET0: PUSHM.L D1..D4,A1,A2 TEST.W D4 ; dx <= 0 ? JUMP',LE 90$ SWAP.W D4 TEST.W D4 ; dy <= 0 ? JUMP',LE 90$ SWAP.W D4 LOAD.W D1,D2 ; D1 <-- mode EX.L D3,D4 ; D4/D3 <-- y;x/dy;dx LOAD.L A2,A0 ; A2 <-- ^descripteur de la fentre LOAD.L A1,(A6)+OADSET CALL (A1) ; appel de GRA_SET 90$: POPM.L D1..D4,A1,A2 RET ;---------\\ ; DRINV > ;=========/ ; Inverse une surface rectangulaire. ; in D3.L coordonne origine (y;x) ; D4.L dimensions (dy;dx) ; out - ; mod D7.W DRINV: PUSHM.L D1..D4,A1,A2 TEST.W D4 ; dx <= 0 ? JUMP',LE 90$ SWAP.W D4 TEST.W D4 ; dy <= 0 ? JUMP',LE 90$ SWAP.W D4 LOAD.W D1,D2 ; D1 <-- mode EX.L D3,D4 ; D4/D3 <-- y;x/dy;dx LOAD.L A2,A0 ; A2 <-- ^descripteur de la fentre LOAD.L A1,(A6)+OADINV CALL (A1) ; appel de GRA_INV 90$: POPM.L D1..D4,A1,A2 RET ;--------\\ ; DRFILL > ;========/ ; Rempli une surface quelconque. ; in D3.L point de remplissage (y;x) ; out D7.W erreur ; mod D7.W DRFILL: PUSHM.L D1..D4,A1,A2 LOAD.L D4,D3 ; D4 <-- y;x LOAD.L A2,A0 ; A2 <-- ^descripteur de la fentre LOAD.L A1,(A6)+OADFILLO CALL (A1) ; appel de GRA_FILLO PUSH.W D7 LOAD.L A1,(A6)+OADFILLC CALL (A1) ; appel de GRA_FILLC POP.W D7 POPM.L D1..D4,A1,A2 TEST.W D7 ; retour EQ/NE RET ;--------\\ ; AFIMAGE > ;========/ ; Affiche une image, sans la conserver en mmoire. ; in A3.L ^nom de l'image ; out D7.W erreur ; mod D7.W AFIMAGE: PUSH.L A4 CALL LOADIMAGE ; charge l'image en mmoire JUMP,NE 90$ CALL SHOWIMAGE ; affiche l'image CALL KILLIMAGE ; libre la mmoire 90$: POP.L A4 TEST.W D7 ; retour EQ/NE RET ;----------\\ ; LOADIMAGE > ;==========/ ; Charge une image en mmoire. ; in A3.L ^nom de l'image ; out A4.L ^image ; D4.L dimensions (dy;dx) ; D7.W erreur ; mod A4.L, D7.W, A4.L LOADIMAGE: PUSHM.L D0,D1,D3,D6,A1..A3,A5 LOAD.L A5,A3 ; A5 <-- ^nom de l'image LOAD.L D4,#LGHIMA LOAD.W D1,#MTYPCP GESMEM ?GETMEM ; demande un buffer pour l'en-tte JUMP,NE 90$ LOAD.L A2,A4 ; A2 <-- ^en-tte LOAD.W D3,#2^BOPRD!2^BOPSYS ; D3 <-- mode d'ouverture FOS ?OPEN ; ouvre l'image JUMP,NE 84$ LOAD.L A4,A2 FOS ?RDBYTE ; lit l'en-tte JUMP,NE 82$ COMP.B (A2)+OIMTYP,#H'82 ; image du LAMI ? JUMP',NE 20$ ; non => 20$ ; oui => CLR.B D3 LOAD.L D4,#256 FOS ?SPOS ; saute la stupide en-tte de 256 bytes ! JUMP,NE 82$ LOAD.L D4,#LGHIMA FOS ?RDBYTE ; lit l'en-tte JUMP,NE 82$ 20$: LOAD.W D0,(A2)+OIMDLX ; D0 <-- largeur de l'image LOAD.W D1,(A2)+OIMDLY ; D1 <-- hauteur de l'image LOAD.W D4,D0 SR.W D4,#3 MUL.WU D4,D1 ; D4 <-- largeur*hauteur/8 ADD.L D4,#IMLBUF ; D4 <-- rserve pour codage PUSH.W D1 LOAD.W D1,#MTYPCP GESMEM ?GETMEM ; demande un buffer pour toute l'image POPM.W D1 JUMP,NE 82$ LOAD.L A1,#(A4)+IMLBUF ; A1 <-- ^image LOAD.L D4,(A2)+OIMNBB ; D4 <-- longueur  lire TEST.B (A2)+OIMCOD ; image code ? JUMP',NE 30$ ; oui => 30$ ; non => LOAD.L A4,A1 FOS ?RDBYTE ; lit toute l'image dcode JUMP,NE 80$ JUMP' 35$ 30$: FOS ?RDBYTE ; lit toute l'image code JUMP,NE 80$ LOAD.L A3,A1 GRA_ DECOIMA ; dcode l'image ... JUMP,NE 80$ 35$: TEST.B (A6)+OINV ; fond de l'cran blanc ? JUMP,T 40$ ; oui => 40$ CALL INVIMAGE ; inverse compltement l'image 40$: LOAD.L A4,A1 ; A4 <-- ^image LOAD.W D4,D1 SWAP.W D4 LOAD.W D4,D0 ; D4 <-- dimensions de l'image CLR.W D7 ; D7 <-- ok JUMP 82$ 80$: PUSH.W D7 LOAD.L A4,#(A1)-IMLBUF LOAD.W D1,#MTYPCP GESMEM ?GIVMEM ; rend la mmoire de l'image POP.W D7 82$: PUSH.W D7 FOS ?CLOSE ; ferme l'image POP.W D7 84$: PUSHM.L D7,A4 LOAD.L A4,A2 LOAD.W D1,#MTYPCP GESMEM ?GIVMEM ; rend le buffer pour l'en-tete POPM.L D7,A4 90$: POPM.L D0,D1,D3,D6,A1..A3,A5 TEST.W D7 ; retour EQ/NE RET ;----------\\ ; SHOWIMAGE > ;==========/ ; Affiche une image dans la (sous-)fentre. ; Si elle est trop petite, elle est centre au milieu de l'cran. ; Si elle est trop grande, on affiche sa partie centrale. ; in A4.L ^image ; D4.L dimensions (dy;dx) ; out - ; mod D7.W SHOWIMAGE: PUSHM.L D0,D1,D3,D4,A3 LIB ?AFTIM .B NOCURS ; plus de curseur .B EOP ; efface toute la fentre .B 0 .EVEN LOAD.W D0,D4 ; D0 <-- largeur de l'image SWAP.W D4 LOAD.W D1,D4 ; D1 <-- hauteur de l'image LOAD.L A3,#(A6)+OBUDIS ; A3 <-- ^buffer pour DRAWRASTER LOAD.W D3,D0 SR.W D3,#3 LOAD.W (A3)+10,D3 ; source: CLR.W (A3)+20 ; destination: LOAD.L D4,(A0)+ODFFDY ; D4 <-- dimensions de la fentre COMP.W D0,D4 ; image trop large ? JUMP',HI 50$ ; oui => 50$ CLR.W (A3)+2 ; source: LOAD.W (A3)+22,D0 ; image: SUB.W D4,D0 SR.W D4,#1 LOAD.W (A3)+12,D4 ; destination: JUMP' 55$ 50$: SUB.W D0,D4 SR.W D0,#1 LOAD.W (A3)+2,D0 ; source: CLR.W (A3)+12 ; destination: LOAD.W (A3)+22,D4 ; image: 55$: SWAP.W D4 COMP.W D1,D4 ; image trop haute ? JUMP',HI 60$ ; oui => 60$ CLR.W (A3)+4 ; source: LOAD.W (A3)+24,D1 ; image: SUB.W D4,D1 SR.W D4,#1 LOAD.W (A3)+14,D4 ; destination: JUMP' 65$ 60$: SUB.W D1,D4 SR.W D1,#1 LOAD.W (A3)+4,D1 ; source: ; ADD.W (A3)+14,#0 ; destination: LOAD.W (A3)+24,D4 ; image: 65$: LOAD.W (A3)+0,#DRAWRASTER LOAD.L (A3)+6,A4 ; source: CLR.L (A3)+16 ; destination: LOAD.B (A3)+26,#SETDOT ; image: LOAD.W D3,#1+26 ; D3 <-- longueur LIB ?STRING ; affiche l'image POPM.L D0,D1,D3,D4,A3 RET ;----------\\ ; KILLIMAGE > ;==========/ ; Libre la mmoire d'une image. ; in A4.L ^image ; out - ; mod - KILLIMAGE: PUSHM.L D1,D7,A4 LOAD.L A4,#(A4)-IMLBUF LOAD.W D1,#MTYPCP GESMEM ?GIVMEM ; rend la mmoire de l'image POPM.L D1,D7,A4 RET ;---------\ ; INVIMAGE > ;---------/ ; Inverse compltement une image. ; in A1.L ^image ; D0.W largeur ; D1.W hauteur ; out - ; mod D7.W INVIMAGE: PUSHM.L D0,A1 SR.W D0,#3 ; D0 <-- largeur en bytes MUL.WU D0,D1 ; D0 <-- nb total de bytes SR.W D0,#2 ; D0 <-- nb total de .L DEC.W D0 ; D0 <-- -1  cause NMO 20$: NOT.L (A1+) DECJ.W,NMO D0,20$ POPM.L D0,A1 RET ; Tirage de nombres alatoires ; ---------------------------- ;--------\\ ; COUPSAC > ;========/ ; Coup de sac pour le gnrateur alatoire. ; in - ; out - ; mod D7.W COUPSAC: PUSHM.L D3,D4 LIB ?RDCLOCK ; D3/D4 <-- date et heure RR.L D3,#3 RL.L D4,#7 ; savante cuisine NOT.L D3 XOR.L D4,D3 LOAD.L (A6)+OHAZA+0,D3 LOAD.L (A6)+OHAZA+4,D4 LOAD.W D3,#10-1 20$: CALL HAZARD ; tire qq nombres DECJ.W,NMO D3,20$ POPM.L D3,D4 RET ;---------\\ ; MMHAZARD > ;=========/ ; Tire un nombre alatoire (16 bits) compris entre deux bornes. ; in D3.W +/- borne infrieure (min) ; D4.W +/- borne suprieure (max+1) ; out D4.W +/- nombre alatoire: D3 <= n < D4 ; mod D4.L, D7.W MMHAZARD: PUSH.W D2 LOAD.W D2,D4 SUB.W D2,D3 ; D2 <-- sup - inf CALL HAZARD AND.L D4,#H'FFFF DIV.WU D4,D2 SWAP.W D4 ; D4 <-- reste de la division ADD.W D4,D3 POP.W D2 RET ;--------\\ ; HAZARD > ;========/ ; Tire un nombre alatoire de 32 bits. ; On utilise un registre  dcalage de 63 bits, avec un XNOR entre ; les bits 0 et 60 pour calculer le nouveau bit inject. ; in - ; out D4.L nombre ; mod D4.L, D7.W HAZARD: PUSHM.L D2,D3 LOAD.W D2,#32-1 LOAD.L D3,(A6)+OHAZA+0 LOAD.L D4,(A6)+OHAZA+4 10$: TEST.L D4:#1 JUMP,BC 20$ TEST.L D3:#30 JUMP,BC 35$ JUMP 30$ 20$: TEST.L D3:#30 JUMP,BS 35$ 30$: CLRX RRX.L D3,#1 RRX.L D4,#1 JUMP 40$ 35$: SETX RRX.L D3,#1 RRX.L D4,#1 40$: LOAD.L (A6)+OHAZA+0,D3 LOAD.L (A6)+OHAZA+4,D4 DECJ.W,NMO D2,10$ POPM.L D2,D3 RET ; Debug ; ----- DRD0: PUSHM.L D2..D4 LOAD.W D2,#INVDOT LOAD.L D3,D0 SUB.W D3,#10 CLR.L D4 LOAD.W D4,#20 LIB ?DRSEG LOAD.L D3,D0 SWAP.W D3 SUB.W D3,#10 SWAP.W D3 LOAD.W D4,#20 SWAP.W D4 CLR.W D4 LIB ?DRSEG POPM.L D2..D4 RET DRD0C: PUSHM.L D2..D4 LOAD.W D2,#CLRDOT LOAD.L D3,D0 SUB.W D3,#10 CLR.L D4 LOAD.W D4,#20 LIB ?DRSEG LOAD.L D3,D0 SWAP.W D3 SUB.W D3,#10 SWAP.W D3 LOAD.W D4,#20 SWAP.W D4 CLR.W D4 LIB ?DRSEG POPM.L D2..D4 RET AFCOOR: PUSH.L D4 LIB ?AFTIM .ASCIZ " x=" .EVEN CALL AFD4 SWAP.W D4 LIB ?AFTIM .ASCIZ " y=" .EVEN CALL AFD4 POP.L D4 RET AFD4: PUSHM.L D2..D4 AND.L D4,#H'FFFF TEST.W D4 JUMP,NC 20$ LOAD.B D3,#'- LIB ?AFCAR NEG.W D4 20$: LOAD.W D3,#8 LOAD.W D2,#2^BAFDCM LIB ?AFDEC POPM.L D2..D4 RET ; Textes ; ------ TXMENU0: .ASCIZ "" .ASCIZ "Fin" .ASCIZ "Suite des" .ASCIZ "explications ..." .ASCIZ "" .ASCIZ "" .ASCIZ "" .ASCIZ "" .ASCIZ "" .ASCIZ "" .ASCIZ "" .ASCIZ "" TXMENU1: .ASCIZ "" .ASCIZ "Fin" .ASCIZ "" .ASCIZ "Dbut du jeu" .ASCIZ "" .ASCIZ "" .ASCIZ "" .ASCIZ "" .ASCIZ "" .ASCIZ "" .ASCIZ "" .ASCIZ "" TXMENU2: .ASCIZ "" .ASCIZ "Fin" .ASCIZ "" .ASCIZ "" .ASCIZ "" .ASCIZ "" .ASCIZ "" .ASCIZ "" .ASCIZ "" .ASCIZ "" .ASCIZ "" .ASCIZ "Aide" TXMENU3: .ASCIZ "" .ASCIZ "Fin" .ASCIZ "" .ASCIZ "Lance la balle" .ASCIZ "" .ASCIZ "" .ASCIZ "" .ASCIZ "" .ASCIZ "" .ASCIZ "" .ASCIZ "" .ASCIZ "Aide" NAIMA: .ASCIZ "PING_AIDE.IMAGE" NRIMA: .ASCIZ "PING_RAQ.IMAGE" NMIMA: .ASCIZ "PING_JEU.IMAGE" NFIMA: .ASCIZ "PING_FIN.IMAGE" .EVEN .END START \ No newline at end of file diff --git a/pixmap.cpp b/pixmap.cpp deleted file mode 100644 index 765dd60..0000000 --- a/pixmap.cpp +++ /dev/null @@ -1,1984 +0,0 @@ -// CPixmap.cpp -// - -#include -#include -#include -#include -#include -#include -#include "def.h" -#include "pixmap.h" -#include "misc.h" -#include "ddutil.h" -#include "blupi.cpp" - -#pragma comment(lib, "ddraw.lib") -#define DIRECTDRAW_VERSION 0x0500 - - -///////////////////////////////////////////////////////////////////////////// - - -// Constructeur. - -CPixmap::CPixmap() -{ - int i; - - m_bFullScreen = FALSE; - m_bBenchmarkSuccess = TRUE; - m_bTrueColor = FALSE; - m_bTrueColorDecor = FALSE; - m_mouseType = MOUSETYPEGRA; - m_bDebug = TRUE; - m_bPalette = TRUE; - - m_mouseSprite = SPRITE_WAIT; - MouseHotSpot(); - m_mousePos.x = LXIMAGE/2; - m_mousePos.y = LYIMAGE/2; - m_mouseBackPos = m_mousePos; - m_bMouseBack = FALSE; - m_bMouseShow = TRUE; - m_bBackDisplayed = FALSE; - - m_lpDD = NULL; - m_lpDDSPrimary = NULL; - m_lpDDSBack = NULL; - m_lpDDSMouse = NULL; - m_lpDDPal = NULL; - m_lpClipper = NULL; - - for ( i=0 ; iRelease(); - m_lpDDSPrimary = NULL; - } - - if ( m_lpDDSBack != NULL ) - { - m_lpDDSBack->Release(); - m_lpDDSBack = NULL; - } - - if ( m_lpDDSMouse != NULL ) - { - m_lpDDSMouse->Release(); - m_lpDDSMouse = NULL; - } - - if ( m_lpDDPal != NULL ) - { - m_lpDDPal->Release(); - m_lpDDPal = NULL; - } - - for ( i=0 ; iRelease(); - m_lpDDSurface[i]= NULL; - } - } - - if ( m_lpClipper != NULL ) - { - m_lpClipper->Release(); - m_lpClipper = NULL; - } - - m_lpDD->Release(); - m_lpDD = NULL; - } -} - - -void CPixmap::SetDebug(BOOL bDebug) -{ - m_bDebug = bDebug; - DDSetDebug(bDebug); -} - - -// Cr�e l'objet DirectDraw principal. -// Retourne FALSE en cas d'erreur. - -BOOL CPixmap::Create(HWND hwnd, POINT dim, - BOOL bFullScreen, int mouseType, BOOL bTrueColorDecor, BOOL bTrueColor) -{ - DDSURFACEDESC ddsd; - int devcap; - HRESULT ddrval; - POINT pos; - HDC hdc; - DWORD colorMode; - - hdc = CreateCompatibleDC(NULL); - - if (hdc == NULL) - { - bTrueColor = 0; - bTrueColorDecor = 0; - } - else - { - devcap = GetDeviceCaps(hdc, SIZEPALETTE); - if ((devcap != NULL) && (devcap < 257)) - { - bTrueColor = 0; - bTrueColorDecor = 0; - } - DeleteDC(hdc); - } - - m_hWnd = hwnd; - m_bFullScreen = bFullScreen; - m_mouseType = mouseType; - m_dim = dim; - m_bTrueColorDecor = bTrueColorDecor; - m_bTrueColor = bTrueColor; - - if ( m_mouseType == MOUSETYPEGRA ) - { - // Cache d�finitivement la vilaine souris Windows. - ShowCursor(FALSE); - - pos = m_mousePos; - ClientToScreen(m_hWnd, &pos); - SetCursorPos(pos.x, pos.y); // met la souris au centre - } - - m_clipRect.left = 0; - m_clipRect.top = 0; - m_clipRect.right = dim.x; - m_clipRect.bottom = dim.y; - - // Create the main DirectDraw object - ddrval = DirectDrawCreate(NULL, &m_lpDD, NULL); - if ( ddrval != DD_OK ) - { - OutputDebug("Fatal error: DirectDrawCreate\n"); - return FALSE; - } - - // Get exclusive mode. - if ( m_bFullScreen ) - { - ddrval = m_lpDD->SetCooperativeLevel(hwnd, DDSCL_EXCLUSIVE|DDSCL_FULLSCREEN); - } - else - { - ddrval = m_lpDD->SetCooperativeLevel(hwnd, DDSCL_NORMAL); - } - if ( ddrval != DD_OK ) - { - OutputDebug("Fatal error: SetCooperativeLevel\n"); - return FALSE; - } - - // Set the video mode to 640x480x8. - if ( m_bFullScreen != FALSE) - { - if ((bTrueColor != 0) || (colorMode = 8, bTrueColorDecor != FALSE)) - { - colorMode = 16; - } - - ddrval = m_lpDD->SetDisplayMode(dim.x, dim.y, colorMode); - if ( ddrval != DD_OK ) - { - OutputDebug("Fatal error: SetDisplayMode\n"); - return FALSE; - } - } - - // Create the primary surface with 1 back buffer. - ZeroMemory(&ddsd, sizeof(ddsd)); - ddsd.dwSize = sizeof(ddsd); - ddsd.dwFlags = DDSD_CAPS; - ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; - - ddrval = m_lpDD->CreateSurface(&ddsd, &m_lpDDSPrimary, NULL); - if ( ddrval != DD_OK ) - { - TraceErrorDD(ddrval, "pixmap", 0); - OutputDebug("Fatal error: CreateSurface\n"); - return FALSE; - } - - // Create the back buffer. - ZeroMemory(&ddsd, sizeof(ddsd)); - ddsd.dwSize = sizeof(ddsd); - ddsd.dwFlags = DDSD_CAPS|DDSD_HEIGHT|DDSD_WIDTH; -//? ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; - ddsd.ddsCaps.dwCaps = DDSCAPS_SYSTEMMEMORY; - ddsd.dwWidth = dim.x; - ddsd.dwHeight = dim.y; - - ddrval = m_lpDD->CreateSurface(&ddsd, &m_lpDDSBack, NULL); - if ( ddrval != DD_OK ) - { - TraceErrorDD(ddrval, "pixmap", 0); - OutputDebug("Fatal error: CreateBackSurface\n"); - return FALSE; - } - - // Create the mouse buffer. - ZeroMemory(&ddsd, sizeof(ddsd)); - ddsd.dwSize = sizeof(ddsd); - ddsd.dwFlags = DDSD_CAPS|DDSD_HEIGHT|DDSD_WIDTH; -//? ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; - ddsd.ddsCaps.dwCaps = DDSCAPS_SYSTEMMEMORY; - ddsd.dwWidth = DIMBLUPIX; - ddsd.dwHeight = DIMBLUPIY; - - ddrval = m_lpDD->CreateSurface(&ddsd, &m_lpDDSMouse, NULL); - if ( ddrval != DD_OK ) - { - TraceErrorDD(ddrval, "pixmap", 0); - OutputDebug("Fatal error: CreateMouseSurface\n"); - return FALSE; - } - - // Create a DirectDrawClipper object. The object enables clipping to the - // window boundaries in the IDirectDrawSurface::Blt function for the - // primary surface. - if ( !m_bFullScreen ) - { - ddrval = m_lpDD->CreateClipper(0, &m_lpClipper, NULL); - if ( ddrval != DD_OK ) - { - TraceErrorDD(ddrval, "pixmap", 0); - OutputDebug("Can't create clipper\n"); - return FALSE; - } - - ddrval = m_lpClipper->SetHWnd(0, hwnd); - if ( ddrval != DD_OK ) - { - TraceErrorDD(ddrval, "pixmap", 0); - OutputDebug("Can't set clipper window handle\n"); - return FALSE; - } - - ddrval = m_lpDDSPrimary->SetClipper(m_lpClipper); - if ( ddrval != DD_OK ) - { - TraceErrorDD(ddrval, "pixmap", 0); - OutputDebug("Can't attach clipper to primary surface\n"); - return FALSE; - } - } - - return TRUE; -} - -// Lib�re les bitmaps. - -BOOL CPixmap::Flush() -{ - return TRUE; -} - -// Restitue les bitmaps. - -BOOL CPixmap::Restore() -{ - RestoreAll(); - return TRUE; -} - - -void CPixmap::QuickIcon(int channel, int rank, POINT pos) -{ - int num; - tagRECT rect; - - if (channel == CHOBJECT) - { - if (g_objectMax <= rank) - { - return; - } - num = rank * 12; - rect.left = (LONG)g_object[rank * 6]; - rect.top = (LONG)g_object[rank * 6 + 1]; - rect.right = g_object[rank * 6 + 4] + rect.left; - rect.bottom = g_object[rank * 6 + 2]; - pos.x = pos.x + g_object[rank * 6 + 2]; - num = (int)g_object[rank * 6 + 3]; - } - else if (channel == CHELEMENT) - { - if (g_elementMax <= rank) - { - return; - } - num = rank * 12; - rect.left = (LONG)g_element[rank * 6]; - rect.top = (LONG)g_element[rank * 6 + 1]; - rect.right = g_element[rank * 6 + 4] + rect.left; - rect.bottom = g_element[rank * 6 + 5] + rect.top; - pos.x = pos.x + g_element[rank * 6 + 2]; - num = (int)g_element[rank * 6 + 3]; - } - else if ((((channel == CHBLUPI) || (channel == CHBLUPI1)) || (channel == CHBLUPI2)) || (channel == CHBLUPI3)) - { - if (g_blupiMax <= rank) - { - return; - } - num = rank * 12; - rect.left = (LONG)g_blupiCh[rank * 6]; - rect.top = (LONG)g_blupiCh[rank * 6 + 1]; - rect.right = g_blupiCh[rank * 6 + 4] + rect.left; - rect.bottom = g_blupiCh[rank * 6 + 5] + rect.top; - pos.x = pos.x + g_blupiCh[rank * 6 + 2]; - num = (int)g_blupiCh[rank * 6 + 3]; - } - else - { - if (channel != CHEXPLO) - { - rect.right = m_iconDim[channel].x; - num = m_totalDim[channel].x / rect.right; - rect.bottom = m_iconDim[channel].y; - if (rank < 0) - { - return; - } - if ((m_totalDim[channel].y / rect.bottom) * num <= rank) - { - return; - } - rect.left = (rank % num) * rect.right; - rect.right = rect.left + rect.right; - rect.top = (rank / num) * rect.bottom; - rect.bottom = rect.top + rect.bottom; - goto LABEL_1; - } - if ((int)g_exploMax <= rank) - { - return; - } - rect.left = (LONG)g_explo[rank * 6]; - rect.top = (LONG)g_explo[rank * 6 + 1]; - rect.right = g_explo[rank * 6 + 4] + rect.left; - rect.bottom = g_explo[rank * 6 + 5] + rect.top; - pos.x = pos.x + g_explo[rank * 6 + 2]; - num = (int)g_explo[rank * 6 + 3]; - } - pos.y = pos.y + num; - -LABEL_1: - num = m_clipRect.left; - if (pos.x < num) - { - num = num - pos.x; - pos.x = m_clipRect.left; - rect.left = rect.left + num; - } - num = (m_clipRect.right + rect.left) - pos.x; - if (num < rect.right) - { - rect.right = num; - } - num = m_clipRect.top; - if (pos.y < num) - { - num = num - pos.y; - pos.y = m_clipRect.top; - rect.top = rect.top + num; - } - num = (m_clipRect.bottom + rect.top) - pos.y; - if (num < rect.bottom) - { - rect.bottom = num; - } - if ((rect.left < rect.right) && (rect.top < rect.bottom)) - { - while (num = (m_lpDDSBack->BltFast(pos.x, pos.y, m_lpDDSurface[channel], &rect, 1), num != 0)) - { - if ((num == 0x7789FE3E) && (num = RestoreAll(), num != 0)) - { - return; - } - if (num != 0x7789FE3E) - { - return; - } - } - } - return; -} - - - -// Initialise la palette syst�me. - -BOOL CPixmap::InitSysPalette() -{ - HDC hdc; - int caps; - - hdc = CreateCompatibleDC(NULL); - if ( hdc == NULL ) return FALSE; - - if ( !m_bFullScreen ) - { - caps = GetDeviceCaps(hdc, SIZEPALETTE); - if ( caps == 0 ) m_bPalette = FALSE; - else m_bPalette = TRUE; - } - - GetSystemPaletteEntries(hdc, 0, 256, m_sysPal); - DeleteDC(hdc); - return TRUE; -} - -BOOL CPixmap::GetTrueColor() -{ - return m_bTrueColor; -} - -void CPixmap::SetBenchmarkSuccess(BOOL bSuccess) -{ - m_bBenchmarkSuccess = bSuccess; -} - -void CPixmap::SetTrueColor(BOOL bTrueColor) -{ - m_bTrueColor = bTrueColor; -} - -void CPixmap::SetTrueColorDecor(BOOL bTrueColorDecor) -{ - m_bTrueColorDecor = bTrueColorDecor; -} -/* -void CPixmap::DrawChar(int rank, POINT pos, double size) -{ - pos.x = (int)((double)pos.x + originX); - pos.y = (int)((double)pos.y + originY); - RECT rect; - rect.left = pos.x, - rect.top = pos.y, - rect.right = pos.x + (int)(32.0 * size), - rect.bottom = pos.y + (int)(32.0 * size); - DrawIcon(6, rank, rect, 1.0, FALSE); -} -*/ - -// Indique si l'on utilise une palette. - -BOOL CPixmap::IsPalette() -{ - return m_bPalette; -} - - -// Rempli une zone rectangulaire avec une couleur uniforme. - -void CPixmap::Fill(RECT rect, COLORREF color) -{ - // � faire si n�cessaire ... -} - - -// Restore all lost objects. - -HRESULT CPixmap::RestoreAll() -{ - if ( m_bDebug ) OutputDebug("CPixmap::RestoreAll\n"); - int i; - HRESULT ddrval; - - if ( m_lpDDSPrimary && m_lpDDSPrimary->IsLost() ) - { - ddrval = m_lpDDSPrimary->Restore(); -// if( ddrval != DD_OK ) return ddrval; - } - - if ( m_lpDDSBack && m_lpDDSBack->IsLost() ) - { - ddrval = m_lpDDSBack->Restore(); -// if( ddrval != DD_OK ) return ddrval; - } - - if ( m_lpDDSMouse && m_lpDDSMouse->IsLost() ) - { - ddrval = m_lpDDSMouse->Restore(); -// if( ddrval != DD_OK ) return ddrval; - } - - for ( i=0 ; iIsLost() ) - { - ddrval = m_lpDDSurface[i]->Restore(); - if( ddrval == DD_OK ) - { - DDReLoadBitmap(m_lpDDSurface[i], m_filename[i]); - } - } - } - return DD_OK; -} - -// Effectue un appel BltFast. -// Les modes sont 0=transparent, 1=opaque. - -HRESULT CPixmap::BltFast(int chDst, int channel, - POINT dst, RECT rcRect, int mode) -{ - DWORD dwTrans; - HRESULT ddrval; - int limit; - - if ( mode == 0 ) dwTrans = DDBLTFAST_SRCCOLORKEY; - else dwTrans = DDBLTFAST_NOCOLORKEY; - - // Effectue un peu de clipping. - if ( dst.x < m_clipRect.left ) - { - rcRect.left += m_clipRect.left-dst.x; - dst.x = m_clipRect.left; - } - limit = (m_clipRect.right-dst.x)+rcRect.left; - if ( rcRect.right > limit ) - { - rcRect.right = limit; - } - if ( dst.y < m_clipRect.top ) - { - rcRect.top += m_clipRect.top-dst.y; - dst.y = m_clipRect.top; - } - limit = (m_clipRect.bottom-dst.y)+rcRect.top; - if ( rcRect.bottom > limit ) - { - rcRect.bottom = limit; - } - - if ( rcRect.left >= rcRect.right || - rcRect.top >= rcRect.bottom ) return DD_OK; - - while( TRUE ) - { - if ( chDst < 0 ) - { - ddrval = m_lpDDSBack->BltFast(dst.x, dst.y, - m_lpDDSurface[channel], - &rcRect, dwTrans); - } - else - { - ddrval = m_lpDDSurface[chDst]->BltFast(dst.x, dst.y, - m_lpDDSurface[channel], - &rcRect, dwTrans); - } - if ( ddrval == DD_OK ) break; - - if ( ddrval == DDERR_SURFACELOST ) - { - ddrval = RestoreAll(); - if ( ddrval != DD_OK ) break; - } - - if ( ddrval != DDERR_WASSTILLDRAWING ) break; - } - - return ddrval; -} - -// Effectue un appel BltFast. -// Les modes sont 0=transparent, 1=opaque. - -HRESULT CPixmap::BltFast(LPDIRECTDRAWSURFACE lpDD, - int channel, POINT dst, RECT rcRect, int mode) -{ - DWORD dwTrans; - HRESULT ddrval; - - if ( mode == 0 ) dwTrans = DDBLTFAST_SRCCOLORKEY; - else dwTrans = DDBLTFAST_NOCOLORKEY; - - while( TRUE ) - { - ddrval = lpDD->BltFast(dst.x, dst.y, - m_lpDDSurface[channel], - &rcRect, dwTrans); - if ( ddrval == DD_OK ) break; - - if ( ddrval == DDERR_SURFACELOST ) - { - ddrval = RestoreAll(); - if ( ddrval != DD_OK ) break; - } - - if ( ddrval != DDERR_WASSTILLDRAWING ) break; - } - - return ddrval; -} - -BOOL CPixmap::DrawMap(int channel, RECT src, RECT dest) -{ - HRESULT hErr; - - if ((channel < 0) || (channel > MAXIMAGE)) - { - return FALSE; - } - - while (hErr == DDERR_WASSTILLDRAWING) - { - hErr = m_lpDDSurface[channel]->Blt(&dest, m_lpDDSBack, &src, DDBLT_WAIT, NULL); - if (hErr == DD_OK) break; - if (hErr == DDERR_SURFACELOST) hErr = RestoreAll(); if (hErr != DD_OK) break;; - } - return (hErr == DD_OK); -} - -// Sauve toute la palette de couleurs. - -BOOL CPixmap::SavePalette() -{ - HRESULT ddrval; - - if ( m_lpDDPal == NULL ) return FALSE; - - ddrval = m_lpDDPal->GetEntries(0, 0, 256, m_pal); - - if ( ddrval != DD_OK ) return FALSE; - return TRUE; -} - -// Restitue toute la palette de couleurs. - -BOOL CPixmap::RestorePalette() -{ - HRESULT ddrval; - - ddrval = m_lpDDPal->SetEntries(0, 0, 256, m_pal); - - if ( ddrval != DD_OK ) return FALSE; - return TRUE; -} - -// Cherche une couleur dans la palette principale. -// En mode plein �cran, il faut chercher dans la palette -// correspondant aux images (obtenue avec SavePalette), -// alors qu'en mode fen�tre, il faut chercher dans la -// palette syst�me (obtenue avec InitSysPalette) !!! - -int CPixmap::SearchColor(int red, int green, int blue) -{ - int i, j, delta, min; - - if ( m_bFullScreen ) - { - for ( i=0 ; i<256 ; i++ ) - { - if ( red == m_pal[i].peRed && - green == m_pal[i].peGreen && - blue == m_pal[i].peBlue ) return i; - } - - // Cherche la couleur la plus proche. - min = 10000; - j = -1; - for ( i=0 ; i<256 ; i++ ) - { - delta = abs(red - m_pal[i].peRed )+ - abs(green - m_pal[i].peGreen)+ - abs(blue - m_pal[i].peBlue ); - - if ( delta < min ) - { - min = delta; - j = i; - } - } - } - else - { - if ( m_bPalette ) - { - for ( i=0 ; i<256 ; i++ ) - { - if ( red == m_sysPal[i].peRed && - green == m_sysPal[i].peGreen && - blue == m_sysPal[i].peBlue ) return i; - } - - // Cherche la couleur la plus proche. - min = 10000; - j = -1; - for ( i=0 ; i<256 ; i++ ) - { - delta = abs(red - m_sysPal[i].peRed )+ - abs(green - m_sysPal[i].peGreen)+ - abs(blue - m_sysPal[i].peBlue ); - - if ( delta < min ) - { - min = delta; - j = i; - } - } - } - else - { - j = (blue >>3) &0x001F; - j |= ((green>>2)<< 5)&0x07E0; - j |= ((red >>3)<<11)&0xF800; // mode 5-6-5 -//? j = (blue >>3) &0x001F; -//? j |= ((green>>3)<< 5)&0x03E0; -//? j |= ((red >>3)<<10)&0x7C00; // mode 5-5-5 - } - } - return j; -} - - -// Cache une image contenant des ic�nes. - -/* -BOOL CPixmap::Cache(int channel, char *pFilename, POINT totalDim, POINT iconDim, - BOOL bUsePalette) -{ - HRESULT ddrval; - - if ( channel < 0 || channel >= MAXIMAGE ) return FALSE; - - if ( m_lpDDSurface[channel] != NULL ) - { - Flush(channel); - } - - // Create and set the palette. - if ( bUsePalette ) - { - if ( m_bDebug ) OutputDebug("Use palette\n"); - if ( m_lpDDPal != NULL ) - { - if ( m_bDebug ) OutputDebug("Release palette\n"); - m_lpDDPal->Release(); - m_lpDDPal = NULL; - } - - m_lpDDPal = DDLoadPalette(m_lpDD, pFilename); - - if ( m_lpDDPal ) - { - if ( m_bDebug ) OutputDebug("Set palette\n"); - m_lpDDSPrimary->SetPalette(NULL); // indispensable ! - ddrval = m_lpDDSPrimary->SetPalette(m_lpDDPal); - if ( ddrval != DD_OK ) - { - TraceErrorDD(ddrval, pFilename, 1); - } - } - } - - // Create the offscreen surface, by loading our bitmap. - m_lpDDSurface[channel] = DDLoadBitmap(m_lpDD, pFilename, 0, 0); - - if ( m_lpDDSurface[channel] == NULL ) - { - OutputDebug("Fatal error: DDLoadBitmap\n"); - return FALSE; - } - - // Set the color key to white - if ( m_bDebug ) OutputDebug("DDSetColorKey\n"); - DDSetColorKey(m_lpDDSurface[channel], RGB(255,255,255)); // blanc - - strcpy(m_filename[channel], pFilename); - - m_totalDim[channel] = totalDim; - m_iconDim[channel] = iconDim; - - return TRUE; -} -*/ - -// Cache une image globale. - -BOOL CPixmap::Cache2(int channel, LPCSTR pFilename, POINT totalDim, POINT iconDim, BOOL bUsePalette) -{ - HRESULT hErr; - - - if ((channel < 0) || (channel >= MAXIMAGE)) - { - return FALSE; - } - - if (m_lpDDSurface[channel] != NULL) - { - Flush(channel); - } - - if ( bUsePalette ) - { - if ( m_bDebug ) OutputDebug("Use Palette\n"); - if (m_lpDDPal != NULL) - { - if ( m_bDebug ) OutputDebug("Release palette"); - m_lpDDPal->Release(); - m_lpDDPal = NULL; - } - } - m_lpDDPal = DDLoadPalette(m_lpDD, pFilename); - - if ( m_lpDDPal ) - { - if ( m_bDebug ) OutputDebug("Set palette\n"); - m_lpDDSPrimary->SetPalette(NULL); - hErr = (m_lpDDSPrimary->SetPalette(m_lpDDPal)); - if (hErr != DD_OK) - { - TraceErrorDD(hErr, pFilename, 1); - } - } - m_lpDDSurface[channel] = DDLoadBitmap(m_lpDD, pFilename, 0, 0); - if (m_lpDDSurface[channel] == NULL) - { - OutputDebug("Fatal error: DDLoadBitmap\n"); - return FALSE; - } - if ( m_bDebug ) OutputDebug("DDSetColorKey\n"); - DDSetColorKey(m_lpDDSurface[channel], RGB(255, 255, 255)); - - strcpy(m_filename[channel], pFilename); - - m_totalDim[channel] = totalDim; - m_iconDim[channel] = iconDim; - - return TRUE; -} - -// Cache une image provenant d'un bitmap. - -// Probably not needed? - - -/* -BOOL CPixmap::Cache(int channel, HBITMAP hbm, POINT totalDim) -{ - if ( channel < 0 || channel >= MAXIMAGE ) return FALSE; - - if ( m_lpDDSurface[channel] != NULL ) - { - Flush(channel); - } - - // Create the offscreen surface, by loading our bitmap. - m_lpDDSurface[channel] = DDConnectBitmap(m_lpDD, hbm); - - if ( m_lpDDSurface[channel] == NULL ) - { - OutputDebug("Fatal error: DDLoadBitmap\n"); - return FALSE; - } - - // Set the color key to white - DDSetColorKey(m_lpDDSurface[channel], RGB(255,255,255)); // blanc - - m_totalDim[channel] = totalDim; - m_iconDim[channel] = totalDim; - - return TRUE; -} -*/ - -BOOL CPixmap::BackgroundCache(int channel, const char* pFilename, POINT totalDim, POINT iconDim, BOOL bUsePalette) -{ - BOOL decor; - char file[100]; - - decor = strstr(pFilename, "blupi") != pFilename && - strstr(pFilename, "element") != pFilename && - strstr(pFilename, "explo") != pFilename && - strstr(pFilename, "object") != pFilename; - if ( bUsePalette ) - { - goto LABEL1; - } - if (decor) - { - if (m_bTrueColor == FALSE) - { - if (decor) goto LABEL1; - if (m_bTrueColorDecor == FALSE) goto LABEL1; - } - } - strcpy(file, "image16\\"); - strcat(file, pFilename); - if (Cache2(channel, file, totalDim, iconDim, FALSE) != FALSE) - { - return TRUE; - } -LABEL1: - strcpy(file, "image08\\"); - strcat(file, (char*)pFilename); - return Cache2(channel, file, totalDim, iconDim, bUsePalette); -} - -BOOL CPixmap::CacheAll(BOOL cache, HWND hWnd, BOOL bFullScreen, BOOL bTrueColor, BOOL bTrueColorDecor, int mouseType, const char* pFilename, int region) -{ - SetDebug(TRUE); - char filename[100]; - char image[12]; - POINT totalDim; - POINT iconDim; - RECT rect; - POINT dim; - - - totalDim.x = 640; - totalDim.y = 480; - iconDim.x = 0; - iconDim.y = 0; - - dim.x = LXIMAGE; - dim.y = LYIMAGE; - - if (cache == FALSE) - { - delete this; - hWnd = m_hWnd; - bFullScreen = m_bFullScreen; - bTrueColor = m_bTrueColor; - bTrueColorDecor = m_bTrueColorDecor; - mouseType = m_mouseType; - } - - if (Create(hWnd, dim, bFullScreen, mouseType, bTrueColorDecor, bTrueColor) == FALSE) - { - return FALSE; - } - - OutputDebug("Image:_init\n"); - if (BackgroundCache(0, "init.blp", totalDim, iconDim, TRUE) == FALSE) - { - return FALSE; - } - - OutputDebug("SavePalette\n"); - SavePalette(); - OutputDebug("InitSysPalette\n"); - InitSysPalette(); - - if (cache == FALSE) - { - if (BackgroundCache(0, pFilename, totalDim, iconDim, FALSE) == FALSE) - { - return FALSE; - } - } - else - { - - rect.right = LXIMAGE; - rect.bottom = LYIMAGE; - rect.left = 0; - rect.top = 0; - DrawImage(0, 0, rect, 1); - Display(); - } - totalDim.x = 1024; - totalDim.y = 1280; - iconDim.x = 64; - iconDim.y = 64; - if (!BackgroundCache(CHOBJECT, "object.blp", totalDim, iconDim, FALSE) ) - { - return FALSE; - } - SetTransparent(CHOBJECT, RGB(0, 0, 255)); - totalDim.x = 960; - totalDim.y = 1200; - iconDim.x = 60; - iconDim.y = 60; - if (BackgroundCache(CHBLUPI, "blupi000.blp", totalDim, iconDim, FALSE) == FALSE) - { - return FALSE; - } - SetTransparent(CHBLUPI, RGB(0, 0, 255)); - totalDim.x = 960; - totalDim.y = 1200; - iconDim.x = 60; - iconDim.y = 60; - if (BackgroundCache(CHBLUPI1, "blupi001.blp", totalDim, iconDim, FALSE) == FALSE) - { - return FALSE; - } - SetTransparent(CHBLUPI1, RGB(0, 0, 255)); - totalDim.x = 960; - totalDim.y = 1200; - iconDim.x = 60; - iconDim.y = 60; - if (BackgroundCache(CHBLUPI2, "blupi002.blp", totalDim, iconDim, FALSE) == FALSE) - { - return FALSE; - } - SetTransparent(CHBLUPI2, RGB(0, 0, 255)); - totalDim.x = 960; - totalDim.y = 1200; - iconDim.x = 60; - iconDim.y = 60; - if (BackgroundCache(CHBLUPI3, "blupi003.blp", totalDim, iconDim, FALSE) == FALSE) - { - return FALSE; - } - SetTransparent(CHBLUPI3, RGB(0, 0, 255)); - totalDim.x = 64; - totalDim.y = 64; - iconDim.x = 64; - iconDim.y = 64; - if (BackgroundCache(CHTEMP, "temp.blp", totalDim, iconDim, FALSE) == FALSE) - { - return FALSE; - } - SetTransparent(CHTEMP, RGB(0, 0, 255)); - totalDim.x = 208; - totalDim.y = 160; - iconDim.x = 208; - iconDim.y = 160; - if (BackgroundCache(CHMAP, "map.blp", totalDim, iconDim, FALSE) == FALSE) - { - return FALSE; - } - SetTransparent(CHMAP, RGB(0, 0, 255)); - totalDim.x = 960; - totalDim.y = 1200; - iconDim.x = 60; - iconDim.y = 60; - if (BackgroundCache(CHELEMENT, "element.blp", totalDim, iconDim, FALSE) == FALSE) - { - return FALSE; - } - SetTransparent(CHELEMENT, RGB(0, 0, 255)); - totalDim.x = 2048; - totalDim.y = 640; - iconDim.x = 128; - iconDim.y = 128; - if (BackgroundCache(CHEXPLO, "explo.blp", totalDim, iconDim, FALSE) == FALSE) - { - return FALSE; - } - SetTransparent(CHEXPLO, RGB(0, 0, 255)); - sprintf(filename, "decor%.3d.blp", region); - totalDim.x = LXIMAGE; - totalDim.y = LYIMAGE; - iconDim.x = 0; - iconDim.y = 0; - if (BackgroundCache(CHDECOR, filename, totalDim, iconDim, FALSE) == FALSE) - { - return FALSE; - } - totalDim.x = 240; - totalDim.y = 1040; - iconDim.x = 40; - iconDim.y = 40; - if (BackgroundCache(CHBUTTON, "button00.blp", totalDim, iconDim, FALSE) == FALSE) - { - return FALSE; - } - SetTransparent(CHBUTTON, RGB(0, 0, 255)); - totalDim.x = 124; - totalDim.y = 88; - iconDim.x = 124; - iconDim.y = 22; - if (BackgroundCache(CHJAUGE, "jauge.blp", totalDim, iconDim, FALSE) == FALSE) - { - return FALSE; - } - SetTransparent(CHJAUGE, RGB(0, 0, 255)); - totalDim.x = 256; - totalDim.y = 384; - iconDim.x = 16; - iconDim.y = 16; - if (BackgroundCache(CHTEXT, "text.blp", totalDim, iconDim, FALSE) != FALSE) - { - SetTransparent(CHTEXT, RGB(0, 0, 255)); - totalDim.x = 256; - totalDim.y = 96; - iconDim.x = 16; - iconDim.y = 12; - if (BackgroundCache(CHLITTLE, "little.blp", totalDim, iconDim, FALSE) != FALSE) - { - SetTransparent(CHLITTLE, RGB(0, 0, 255)); - Benchmark(); - return TRUE; - } - return FALSE; - } - return FALSE; -} - -int CPixmap::Benchmark() -{ - struct _timeb tstruct; - int i, j, t1, t2, time; - RECT rect; - POINT dest; - - _ftime(&tstruct); - t1 = tstruct.millitm; - - for (j = 0; j < 10; j++) - { - dest.x = POSDRAWX; - dest.y = POSDRAWY; - rect.left = 29; - rect.right = 29 + LXIMAGE; - rect.top = 29; - rect.bottom = 29 + LYIMAGE; - DrawPart(-1, CHDECOR, dest, rect, 1); - - dest.x = 13; // position quelconque non-multiple de 16 - dest.y = 13; - for (i = 0; i < 120; i++) - { - QuickIcon(CHOBJECT, 1, dest); - } - } - - _ftime(&tstruct); - t2 = tstruct.millitm; - - if (t1 > t2) t2 += 1000; - time = t2 - t1; - - FILE* file = NULL; - char string[100]; - sprintf(string, "Benchmark = %d\r\n", time); - file = fopen("data\\bench.blp", "wb"); - if (file == NULL) return time; - fwrite(string, strlen(string), 1, file); - fclose(file); - - return time; -} - - -// Purge une image. - -void CPixmap::Flush(int channel) -{ - if ( channel < 0 || channel >= MAXIMAGE ) return; - if ( m_lpDDSurface[channel] == NULL ) return; - - m_lpDDSurface[channel]->Release(); - m_lpDDSurface[channel]= NULL; -} - -// D�finition de la couleur transparente. - -void CPixmap::SetTransparent(int channel, COLORREF color) -{ - if ( channel < 0 || channel >= MAXIMAGE ) return; - if ( m_lpDDSurface[channel] == NULL ) return; - - DDSetColorKey(m_lpDDSurface[channel], color); - m_colorSurface[2*channel+0] = color; - m_colorSurface[2*channel+1] = color; -} - -// D�finition de la couleur transparente. - -void CPixmap::SetTransparent2(int channel, COLORREF color1, COLORREF color2) -{ - if ( channel < 0 || channel >= MAXIMAGE ) return; - if ( m_lpDDSurface[channel] == NULL ) return; - - DDSetColorKey2(m_lpDDSurface[channel], color1, color2); - m_colorSurface[2*channel+0] = color1; - m_colorSurface[2*channel+1] = color2; -} - - -// Modifie la r�gion de clipping. - -void CPixmap::SetClipping(RECT clip) -{ - m_clipRect.left = clip.left; - m_clipRect.top = clip.top; - m_clipRect.right = clip.right; - m_clipRect.bottom = clip.bottom; -} - -// Retourne la r�gion de clipping. - -RECT CPixmap::GetClipping(RECT* rect) -{ - return m_clipRect; -} - - -// Teste si un point fait partie d'une ic�ne. -//Rough rewritten code, might need improvement - - - - -// Dessine une partie d'image rectangulaire. -// Les modes sont 0=transparent, 1=opaque. - -BOOL CPixmap::DrawIcon(int chDst, int channel, int rank, POINT pos, - int mode, BOOL bMask) -{ - int nbx, nby; - short rank1, rank2, rank3, rank4; - LONG lRank5; - RECT rect; - HRESULT ddrval; - COLORREF oldColor1, oldColor2; - - if (channel == CHOBJECT) - { - if (g_objectMax <= rank) - { - return FALSE; - } - rank1 = g_object[rank * 6]; - rank2 = g_object[rank * 6 + 1]; - rank3 = g_object[rank * 6 + 3]; - rank4 = g_object[rank * 6 + 4] + rank1; - lRank5 = g_object[rank * 6 + 5] + rank2; - pos.x = pos.x + g_object[rank * +2]; - } - else if (channel == CHELEMENT) - { - if (g_elementMax <= rank) { - return FALSE; - } - rank1 = g_element[rank * 6]; - rank2 = g_element[rank * 6 + 1]; - rank3 = g_element[rank * 6 + 3]; - rank4 = g_element[rank * 6 + 4] + rank1; - lRank5 = g_element[rank * 6 + 5] + rank2; - pos.x = pos.x + g_element[rank * 6 + 2]; - - } - else if (channel == CHBLUPI || - channel == CHBLUPI1 || - channel == CHBLUPI2 || - channel == CHBLUPI3) - { - if (g_blupiMax <= rank) - { - return FALSE; - } - rank1 = g_blupiCh[rank * 6]; - rank2 = g_blupiCh[rank * 6 + 1]; - rank3 = g_blupiCh[rank * 6 + 4] + rank1; - rank4 = g_blupiCh[rank * 6 + 5] + rank2; - lRank5 = g_blupiCh[rank * 6 + 2]; - pos.x = pos.x + g_blupiCh[rank * 6 + 2]; - } - else - { - if (channel != CHEXPLO) - { - - if (channel < 0 || channel >= MAXIMAGE) return FALSE; - if (m_lpDDSurface[channel] == NULL) return FALSE; - if (m_iconDim[channel].x == 0 || - m_iconDim[channel].y == 0) return FALSE; - nbx = m_totalDim[channel].x / m_iconDim[channel].x; - nby = m_totalDim[channel].y / m_iconDim[channel].y; - if (rank < 0 || rank >= nbx * nby) return FALSE; - - } - - if ((int)g_exploMax <= rank) return FALSE; - - rank1 = g_explo[rank * 6]; - rank2 = g_explo[rank * 6 + 1]; - rank3 = g_explo[rank * 6 + 4] + rank1; - rank4 = g_explo[rank * 6 + 4] + rank2; - lRank5 = g_explo[rank * 6 + 2]; - pos.x = pos.x + g_explo[rank * 6 + 2]; - } - pos.y = pos.y + rank3; - - nbx = m_totalDim[channel].x / m_iconDim[channel].x; - nby = m_totalDim[channel].y / m_iconDim[channel].y; - - rect.left = (rank % nbx) * m_iconDim[channel].x; - rect.top = (rank / nbx) * m_iconDim[channel].y; - rect.right = rect.left + m_iconDim[channel].x; - rect.bottom = rect.top + m_iconDim[channel].y; - - oldColor1 = m_colorSurface[2*channel+0]; - oldColor2 = m_colorSurface[2*channel+1]; - if ( bMask ) SetTransparent(channel, RGB(255,255,255)); // blanc - ddrval = BltFast(chDst, channel, pos, rect, mode); - if ( bMask ) SetTransparent2(channel, oldColor1, oldColor2); - - if ( ddrval != DD_OK ) return FALSE; - return TRUE; -} - -// Dessine une partie d'image rectangulaire. -// Les modes sont 0=transparent, 1=opaque. -// -// Correspondances in,out : -// 0,0 2,1 ... -// 1,16 3,17 -// -// 32,32 34,33 -// 33,48 35,49 - -BOOL CPixmap::DrawIconDemi(int chDst, int channel, int rank, POINT pos, - int mode, BOOL bMask) -{ - int nbx, nby; - RECT rect; - HRESULT ddrval; - COLORREF oldColor1, oldColor2; - - if ( channel < 0 || channel >= MAXIMAGE ) return FALSE; - if ( m_lpDDSurface[channel] == NULL ) return FALSE; - - if ( m_iconDim[channel].x == 0 || - m_iconDim[channel].y == 0 ) return FALSE; - - nbx = m_totalDim[channel].x / m_iconDim[channel].x; - nby = m_totalDim[channel].y / (m_iconDim[channel].y/2); - - rank = (rank/32)*32+((rank%32)/2)+((rank%2)*16); - - if ( rank < 0 || rank >= nbx*nby ) return FALSE; - - rect.left = (rank%nbx)* m_iconDim[channel].x; - rect.top = (rank/nbx)*(m_iconDim[channel].y/2); - rect.right = rect.left + m_iconDim[channel].x; - rect.bottom = rect.top +(m_iconDim[channel].y/2); - - oldColor1 = m_colorSurface[2*channel+0]; - oldColor2 = m_colorSurface[2*channel+1]; - if ( bMask ) SetTransparent(channel, RGB(255,255,255)); // blanc - ddrval = BltFast(chDst, channel, pos, rect, mode); - if ( bMask ) SetTransparent2(channel, oldColor1, oldColor2); - - if ( ddrval != DD_OK ) return FALSE; - return TRUE; -} - -// Dessine une partie d'image rectangulaire. -// Les modes sont 0=transparent, 1=opaque. - -BOOL CPixmap::DrawIconPart(int chDst, int channel, int rank, POINT pos, - int startY, int endY, - int mode, BOOL bMask) -{ - int nbx, nby; - RECT rect; - HRESULT ddrval; - COLORREF oldColor1, oldColor2; - - if ( channel < 0 || channel >= MAXIMAGE ) return FALSE; - if ( m_lpDDSurface[channel] == NULL ) return FALSE; - - if ( m_iconDim[channel].x == 0 || - m_iconDim[channel].y == 0 ) return FALSE; - - nbx = m_totalDim[channel].x / m_iconDim[channel].x; - nby = m_totalDim[channel].y / m_iconDim[channel].y; - - if ( rank < 0 || rank >= nbx*nby ) return FALSE; - - rect.left = (rank%nbx)*m_iconDim[channel].x; - rect.top = (rank/nbx)*m_iconDim[channel].y; - rect.right = rect.left + m_iconDim[channel].x; - rect.bottom = rect.top + endY; - - pos.y += startY; - rect.top += startY; - - oldColor1 = m_colorSurface[2*channel+0]; - oldColor2 = m_colorSurface[2*channel+1]; - if ( bMask ) SetTransparent(channel, RGB(255,255,255)); // blanc - ddrval = BltFast(chDst, channel, pos, rect, mode); - if ( bMask ) SetTransparent2(channel, oldColor1, oldColor2); - - if ( ddrval != DD_OK ) return FALSE; - return TRUE; -} - -// Dessine une partie d'image n'importe o�. -// Les modes sont 0=transparent, 1=opaque. - -BOOL CPixmap::DrawPart(int chDst, int channel, POINT dest, RECT rect, - int mode, BOOL bMask) -{ - HRESULT ddrval; - COLORREF oldColor1, oldColor2; - - if ( channel < 0 || channel >= MAXIMAGE ) return FALSE; - if ( m_lpDDSurface[channel] == NULL ) return FALSE; - - oldColor1 = m_colorSurface[2*channel+0]; - oldColor2 = m_colorSurface[2*channel+1]; - if ( bMask ) SetTransparent(channel, RGB(255,255,255)); // blanc - ddrval = BltFast(chDst, channel, dest, rect, mode); - if ( bMask ) SetTransparent2(channel, oldColor1, oldColor2); - - if ( ddrval != DD_OK ) return FALSE; - return TRUE; -} - -// Dessine une partie d'image rectangulaire. -// Les modes sont 0=transparent, 1=opaque. - -BOOL CPixmap::DrawImage(int chDst, int channel, RECT rect, int mode) -{ - POINT dst; - HRESULT ddrval; - - if ( channel < 0 || channel >= MAXIMAGE ) return FALSE; - if ( m_lpDDSurface[channel] == NULL ) return FALSE; - - dst.x = rect.left; - dst.y = rect.top; - - ddrval = BltFast(chDst, channel, dst, rect, mode); - - if ( ddrval != DD_OK ) return FALSE; - - if ( channel == CHBACK ) - { - MouseBackSave(); // sauve ce qui sera sous la souris - m_bBackDisplayed = FALSE; - } - - return TRUE; -} - - -// Construit une ic�ne en utilisant un masque. - -BOOL CPixmap::BuildIconMask(int channelMask, int rankMask, - int channel, int rankSrc, int rankDst) -{ - int nbx, nby; - POINT posDst; - RECT rect; - HRESULT ddrval; - - if ( channel < 0 || channel >= MAXIMAGE ) return FALSE; - if ( m_lpDDSurface[channel] == NULL ) return FALSE; - - if ( m_iconDim[channel].x == 0 || - m_iconDim[channel].y == 0 ) return FALSE; - - nbx = m_totalDim[channel].x / m_iconDim[channel].x; - nby = m_totalDim[channel].y / m_iconDim[channel].y; - - if ( rankSrc < 0 || rankSrc >= nbx*nby ) return FALSE; - if ( rankDst < 0 || rankDst >= nbx*nby ) return FALSE; - - rect.left = (rankSrc%nbx)*m_iconDim[channel].x; - rect.top = (rankSrc/nbx)*m_iconDim[channel].y; - rect.right = rect.left + m_iconDim[channel].x; - rect.bottom = rect.top + m_iconDim[channel].y; - posDst.x = (rankDst%nbx)*m_iconDim[channel].x; - posDst.y = (rankDst/nbx)*m_iconDim[channel].y; - ddrval = BltFast(m_lpDDSurface[channel], channel, posDst, rect, 1); - if ( ddrval != DD_OK ) return FALSE; - - if ( m_iconDim[channelMask].x == 0 || - m_iconDim[channelMask].y == 0 ) return FALSE; - - nbx = m_totalDim[channelMask].x / m_iconDim[channelMask].x; - nby = m_totalDim[channelMask].y / m_iconDim[channelMask].y; - - if ( rankMask < 0 || rankMask >= nbx*nby ) return FALSE; - - rect.left = (rankMask%nbx)*m_iconDim[channelMask].x; - rect.top = (rankMask/nbx)*m_iconDim[channelMask].y; - rect.right = rect.left + m_iconDim[channelMask].x; - rect.bottom = rect.top + m_iconDim[channelMask].y; - ddrval = BltFast(m_lpDDSurface[channel], channelMask, posDst, rect, 0); - if ( ddrval != DD_OK ) return FALSE; - - return TRUE; -} - - -// Affiche le pixmap � l'�cran. -// Retourne FALSE en cas d'erreur. - -BOOL CPixmap::Display() -{ - HRESULT ddrval; - RECT DestRect, MapRect; - - m_bBackDisplayed = TRUE; - - // Get screen coordinates of client window for blit - GetClientRect(m_hWnd, &DestRect); - ClientToScreen(m_hWnd, (LPPOINT)&DestRect); - ClientToScreen(m_hWnd, (LPPOINT)&DestRect+1); - - MapRect.left = 0; - MapRect.top = 0; - MapRect.right = m_dim.x; - MapRect.bottom = m_dim.y; - - // do the blit from back surface - ddrval = m_lpDDSPrimary->Blt - ( - &DestRect, // destination rect - m_lpDDSBack, - &MapRect, // source rect - DDBLT_WAIT, - &m_DDbltfx - ); - if ( ddrval == DDERR_SURFACELOST ) - { - ddrval = RestoreAll(); - } - if ( ddrval != DD_OK ) return FALSE; - return TRUE; -} - - -// Positionne la souris et change le lutin. - -void CPixmap::SetMousePosSprite(POINT pos, int sprite, BOOL bDemoPlay) -{ - if ( m_mousePos.x == pos.x && - m_mousePos.y == pos.y && - m_mouseSprite == sprite ) return; - - m_mousePos = pos; - m_mouseSprite = sprite; - MouseHotSpot(); - - if ( !bDemoPlay ) - { - MouseUpdate(); - } -} - -// Positionne la souris. - -void CPixmap::SetMousePos(POINT pos, BOOL bDemoPlay) -{ - if ( m_mousePos.x == pos.x && - m_mousePos.y == pos.y ) return; - - m_mousePos = pos; - - if ( !bDemoPlay ) - { - MouseUpdate(); - } -} - -// Change le lutin de la souris. - -void CPixmap::SetMouseSprite(int sprite, BOOL bDemoPlay) -{ - if ( m_mouseSprite == sprite ) return; - - m_mouseSprite = sprite; - MouseHotSpot(); - - if ( !bDemoPlay ) - { - MouseUpdate(); - } -} - -// Montre ou cache la souris. - -void CPixmap::MouseShow(BOOL bShow) -{ - m_bMouseShow = bShow; -} - -// Met � jour le dessin de la souris. - -void CPixmap::MouseUpdate() -{ - RECT oldRect, newRect, rcRect; - - if ( m_lpDDSurface[CHBLUPI] == NULL ) return; - if ( m_mouseType != MOUSETYPEGRA ) return; - if ( m_mouseSprite == SPRITE_EMPTY ) return; - if ( !m_bMouseShow ) return; - - oldRect.left = m_mouseBackPos.x; - oldRect.top = m_mouseBackPos.y; - oldRect.right = m_mouseBackPos.x + DIMBLUPIX; - oldRect.bottom = m_mouseBackPos.y + DIMBLUPIY; - - newRect.left = m_mousePos.x - m_mouseHotSpot.x; - newRect.top = m_mousePos.y - m_mouseHotSpot.y; - newRect.right = newRect.left + DIMBLUPIX; - newRect.bottom = newRect.top + DIMBLUPIY; - - MouseBackRestore(); // enl�ve la souris dans m_lpDDSBack - MouseBackDraw(); // dessine la souris dans m_lpDDSBack - - if ( m_bBackDisplayed ) - { - if ( IntersectRect(&rcRect, &oldRect, &newRect) ) - { - UnionRect(&rcRect, &oldRect, &newRect); - MouseQuickDraw(rcRect); - } - else - { - MouseQuickDraw(oldRect); - MouseQuickDraw(newRect); - } - } -} - -// Dessine rapidement la souris dans l'�cran. -// Il s'agit en fait de dessiner un petit morceau rectangulaire -// de m_lpDDSBack dans l'�cran. - -BOOL CPixmap::MouseQuickDraw(RECT rect) -{ - HRESULT ddrval; - RECT DestRect; - - if ( rect.left < 0 ) rect.left = 0; - if ( rect.right > LXIMAGE ) rect.right = LXIMAGE; - if ( rect.top < 0 ) rect.top = 0; - if ( rect.bottom > LYIMAGE ) rect.bottom = LYIMAGE; - - // Get screen coordinates of client window for blit - DestRect = rect; - ClientToScreen(m_hWnd, (LPPOINT)&DestRect); - ClientToScreen(m_hWnd, (LPPOINT)&DestRect+1); - - // do the blit from back surface - ddrval = m_lpDDSPrimary->Blt - ( - &DestRect, // destination rect - m_lpDDSBack, - &rect, // source rect - DDBLT_WAIT, - &m_DDbltfx - ); - if ( ddrval == DDERR_SURFACELOST ) - { - ddrval = RestoreAll(); - } - if ( ddrval != DD_OK ) return FALSE; - return TRUE; -} - -// Invalide la copie sous la souris. - -void CPixmap::MouseInvalidate() -{ - m_bMouseBack = FALSE; -} - -// Enl�ve la souris dans m_lpDDSBack. - -void CPixmap::MouseBackClear() -{ - if ( m_mouseType != MOUSETYPEGRA ) return; - MouseBackRestore(); // enl�ve la souris dans m_lpDDSBack -} - -// Dessine la souris dans m_lpDDSBack. - -void CPixmap::MouseBackDraw() -{ - POINT dst; - RECT rcRect; - - if ( m_lpDDSurface[CHBLUPI] == NULL ) return; - if ( m_mouseType != MOUSETYPEGRA ) return; - if ( m_mouseSprite == SPRITE_EMPTY ) return; - if ( !m_bMouseShow ) return; - - MouseBackSave(); // sauve ce qui sera sous la souris - - dst.x = m_mousePos.x - m_mouseHotSpot.x; - dst.y = m_mousePos.y - m_mouseHotSpot.y; - rcRect = MouseRectSprite(); - - if ( dst.x < 0 ) - { - rcRect.left -= dst.x; - dst.x = 0; - } - if ( dst.x+DIMBLUPIX > LXIMAGE ) - { - rcRect.right -= (dst.x+DIMBLUPIX)-LXIMAGE; - } - if ( dst.y < 0 ) - { - rcRect.top -= dst.y; - dst.y = 0; - } - if ( dst.y+DIMBLUPIY > LYIMAGE ) - { - rcRect.bottom -= (dst.y+DIMBLUPIY)-LYIMAGE; - } - - // Dessine le lutin dans m_lpDDSBack. - BltFast(m_lpDDSBack, CHBLUPI, dst, rcRect, 0); -} - -// Sauve le fond sous la souris. -// m_lpDDSMouse <- m_lpDDSBack - -void CPixmap::MouseBackSave() -{ - HRESULT ddrval; - POINT dst; - RECT rcRect; - - if ( m_lpDDSurface[CHBLUPI] == NULL ) return; - if ( m_mouseType != MOUSETYPEGRA ) return; - if ( m_mouseSprite == SPRITE_EMPTY ) return; - if ( !m_bMouseShow ) return; - - m_mouseBackPos.x = m_mousePos.x - m_mouseHotSpot.x; - m_mouseBackPos.y = m_mousePos.y - m_mouseHotSpot.y; - m_bMouseBack = TRUE; - - dst.x = 0; - dst.y = 0; - - rcRect.left = m_mouseBackPos.x; - rcRect.top = m_mouseBackPos.y; - rcRect.right = m_mouseBackPos.x + DIMBLUPIX; - rcRect.bottom = m_mouseBackPos.y + DIMBLUPIY; - - if ( rcRect.left < 0 ) - { - dst.x -= rcRect.left; - rcRect.left = 0; - } - if ( rcRect.right > LXIMAGE ) - { - rcRect.right = LXIMAGE; - } - if ( rcRect.top < 0 ) - { - dst.y -= rcRect.top; - rcRect.top = 0; - } - if ( rcRect.bottom > LYIMAGE ) - { - rcRect.bottom = LYIMAGE; - } - - while( TRUE ) - { - ddrval = m_lpDDSMouse->BltFast(dst.x, dst.y, - m_lpDDSBack, - &rcRect, DDBLTFAST_NOCOLORKEY); - if ( ddrval == DD_OK ) break; - - if ( ddrval == DDERR_SURFACELOST ) - { - ddrval = RestoreAll(); - if ( ddrval != DD_OK ) break; - } - - if ( ddrval != DDERR_WASSTILLDRAWING ) break; - } -} - -// Restitue le fond sous la souris. -// m_lpDDSBack <- m_lpDDSMouse - -void CPixmap::MouseBackRestore() -{ - HRESULT ddrval; - POINT dst; - RECT rcRect; - - if ( m_lpDDSurface[CHBLUPI] == NULL ) return; - if ( !m_bMouseBack ) return; - - dst.x = m_mouseBackPos.x; - dst.y = m_mouseBackPos.y; - - rcRect.left = 0; - rcRect.top = 0; - rcRect.right = DIMBLUPIX; - rcRect.bottom = DIMBLUPIY; - - if ( dst.x < 0 ) - { - rcRect.left -= dst.x; - dst.x = 0; - } - if ( dst.x+DIMBLUPIX > LXIMAGE ) - { - rcRect.right -= (dst.x+DIMBLUPIX)-LXIMAGE; - } - if ( dst.y < 0 ) - { - rcRect.top -= dst.y; - dst.y = 0; - } - if ( dst.y+DIMBLUPIY > LYIMAGE ) - { - rcRect.bottom -= (dst.y+DIMBLUPIY)-LYIMAGE; - } - - while( TRUE ) - { - ddrval = m_lpDDSBack->BltFast(dst.x, dst.y, - m_lpDDSMouse, - &rcRect, DDBLTFAST_NOCOLORKEY); - if ( ddrval == DD_OK ) break; - - if ( ddrval == DDERR_SURFACELOST ) - { - ddrval = RestoreAll(); - if ( ddrval != DD_OK ) break; - } - - if ( ddrval != DDERR_WASSTILLDRAWING ) break; - } -} - -// Affiche le contenu de m_lpDDSMouse dans le -// coin sup/gauche. - -void CPixmap::MouseBackDebug() -{ - HRESULT ddrval; - RECT DestRect, MapRect; - - // Get screen coordinates of client window for blit - GetClientRect(m_hWnd, &DestRect); - ClientToScreen(m_hWnd, (LPPOINT)&DestRect); - ClientToScreen(m_hWnd, (LPPOINT)&DestRect+1); - - MapRect.left = 0; - MapRect.top = 0; - MapRect.right = DIMBLUPIX; - MapRect.bottom = DIMBLUPIY; - - DestRect.right = DestRect.left + DIMBLUPIX; - DestRect.bottom = DestRect.top + DIMBLUPIY; - - // do the blit from back surface - ddrval = m_lpDDSPrimary->Blt - ( - &DestRect, // destination rect - m_lpDDSMouse, - &MapRect, // source rect - DDBLT_WAIT, - &m_DDbltfx - ); - if ( ddrval == DDERR_SURFACELOST ) - { - ddrval = RestoreAll(); - } -} - -// Retourne le rectangle correspondant au sprite -// de la souris dans CHBLUPI. - -RECT CPixmap::MouseRectSprite() -{ - int rank, nbx; - RECT rcRect; - - rank = 348; - if ( m_mouseSprite == SPRITE_ARROW ) rank = 348; - if ( m_mouseSprite == SPRITE_POINTER ) rank = 349; - if ( m_mouseSprite == SPRITE_MAP ) rank = 350; - if ( m_mouseSprite == SPRITE_WAIT ) rank = 351; - if ( m_mouseSprite == SPRITE_FILL ) rank = 352; - if ( m_mouseSprite == SPRITE_ARROWL ) rank = 353; - if ( m_mouseSprite == SPRITE_ARROWR ) rank = 354; - if ( m_mouseSprite == SPRITE_ARROWU ) rank = 355; - if ( m_mouseSprite == SPRITE_ARROWD ) rank = 356; - if ( m_mouseSprite == SPRITE_ARROWDL ) rank = 357; - if ( m_mouseSprite == SPRITE_ARROWDR ) rank = 358; - if ( m_mouseSprite == SPRITE_ARROWUL ) rank = 359; - if ( m_mouseSprite == SPRITE_ARROWUR ) rank = 360; - - nbx = m_totalDim[CHBLUPI].x / m_iconDim[CHBLUPI].x; - - rcRect.left = (rank%nbx)*m_iconDim[CHBLUPI].x; - rcRect.top = (rank/nbx)*m_iconDim[CHBLUPI].y; - rcRect.right = rcRect.left+m_iconDim[CHBLUPI].x; - rcRect.bottom = rcRect.top +m_iconDim[CHBLUPI].y; - - return rcRect; -} - -// Initialise le hot spot selon le sprite en cours. - -void CPixmap::MouseHotSpot() -{ - int rank; - - static int table_mouse_hotspot[14*2] = - { - 30, 30, // SPRITE_ARROW - 20, 15, // SPRITE_POINTER - 31, 26, // SPRITE_MAP - 25, 14, // SPRITE_ARROWU - 24, 35, // SPRITE_ARROWD - 15, 24, // SPRITE_ARROWL - 35, 24, // SPRITE_ARROWR - 18, 16, // SPRITE_ARROWUL - 32, 18, // SPRITE_ARROWUR - 17, 30, // SPRITE_ARROWDL - 32, 32, // SPRITE_ARROWDR - 30, 30, // SPRITE_WAIT - 30, 30, // SPRITE_EMPTY - 21, 51, // SPRITE_FILL - }; - - if ( m_mouseSprite >= SPRITE_ARROW && - m_mouseSprite <= SPRITE_FILL ) - { - rank = m_mouseSprite - SPRITE_ARROW; // rank <- 0..n - - m_mouseHotSpot.x = table_mouse_hotspot[rank*2+0]; - m_mouseHotSpot.y = table_mouse_hotspot[rank*2+1]; - } - else - { - m_mouseHotSpot.x = 0; - m_mouseHotSpot.y = 0; - } -} - - diff --git a/pixmap.h b/pixmap.h deleted file mode 100644 index a2fdcde..0000000 --- a/pixmap.h +++ /dev/null @@ -1,128 +0,0 @@ -// CPixmap.h - -using namespace std; - -#pragma once - -#include - -///////////////////////////////////////////////////////////// - -#define MAXIMAGE 100 -#define DIRECTDRAW_VERSION 0x0500 - -class CPixmap -{ -public: - CPixmap(); - ~CPixmap(); - - void SetDebug(BOOL bDebug); - - BOOL Create(HWND hwnd, POINT dim, BOOL bFullScreen, int mouseType, BOOL bTrueColor, BOOL bTrueColorDecor); - BOOL Flush(); - BOOL Restore(); - BOOL InitSysPalette(); - BOOL IsPalette(); - void Fill(RECT rect, COLORREF color); - - BOOL SavePalette(); - BOOL RestorePalette(); - int SearchColor(int red, int green, int blue); - BOOL Cache(int channel, char *pFilename, POINT totalDim, POINT iconDim, BOOL bUsePalette); - BOOL Cache2(int channel, const char *pFilename, POINT totalDim, POINT iconDim, BOOL bUsePalette); - BOOL Cache(int channel, HBITMAP hbm, POINT totalDim); - BOOL BackgroundCache(int channel, const char* pFilename, POINT totalDim, POINT iconDim, BOOL bUsePalette); - BOOL CacheAll(BOOL cache, HWND hWnd, BOOL bFullScreen, BOOL bTrueColor, BOOL bTrueColorDecor, int mouseType, const char* pFilename, int region); - int Benchmark(); - void Flush(int channel); - void SetTransparent(int channel, COLORREF color); - void SetTransparent2(int channel, COLORREF color1, COLORREF color2); - void SetClipping(RECT clip); - RECT GetClipping(RECT* rect); - void HudIcon(int channel, int rank, POINT pos); - void QuickIcon(int channel, int rank, POINT pos); - - BOOL IsIconPixel(int channel, int rank, POINT pos); - - void DrawChar(int rank, POINT pos, double size); - BOOL DrawIcon(int chDst, int channel, int rank, POINT pos, int mode=0, BOOL bMask=FALSE); - BOOL DrawIconDemi(int chDst, int channel, int rank, POINT pos, int mode=0, BOOL bMask=FALSE); - BOOL DrawIconPart(int chDst, int channel, int rank, POINT pos, int startY, int endY, int mode=0, BOOL bMask=FALSE); - BOOL DrawPart(int chDst, int channel, POINT dest, RECT rect, int mode=0, BOOL bMask=FALSE); - BOOL DrawImage(int chDst, int channel, RECT rect, int mode=0); - BOOL DrawMap(int channel, RECT src, RECT dest); - - BOOL BuildIconMask(int channelMask, int rankMask, - int channel, int rankSrc, int rankDst); - - BOOL Display(); - - void SetMousePosSprite(POINT pos, int sprite, BOOL bDemoPlay); - void SetMousePos(POINT pos, BOOL bDemoPlay); - void SetMouseSprite(int sprite, BOOL bDemoPlay); - void MouseShow(BOOL bShow); - void MouseInvalidate(); - void MouseBackClear(); - void MouseBackDraw(); - void SetBenchmarkSuccess(BOOL bSuccess); - void SetTrueColor(BOOL bTrueColor); - void SetTrueColorDecor(BOOL bTrueColorDecor); - -protected: - HRESULT RestoreAll(); - HRESULT BltFast(int chDst, int channel, POINT dst, RECT rcRect, int mode); - HRESULT BltFast(LPDIRECTDRAWSURFACE lpDD, - int channel, POINT dst, RECT rcRect, int mode); - - void MouseUpdate(); - BOOL MouseQuickDraw(RECT rect); - void MouseBackSave(); - void MouseBackRestore(); - void MouseBackDebug(); - RECT MouseRectSprite(); - void MouseHotSpot(); - BOOL GetTrueColor(); - - - -protected: - BOOL m_bFullScreen; - BOOL m_bBenchmarkSuccess; - BOOL m_bTrueColor; - BOOL m_bTrueColorDecor; - BOOL m_field5_0x14; //Need to figure out - BOOL m_field5_0x18; //Need to figure out - int m_mouseType; - BOOL m_bDebug; - BOOL m_bPalette; - HWND m_hWnd; - POINT m_dim; - RECT m_clipRect; - double originX; - double originY; - - POINT m_mousePos; - int m_mouseSprite; - POINT m_mouseHotSpot; - POINT m_mouseBackPos; - BOOL m_bMouseBack; - BOOL m_bMouseShow; - BOOL m_bBackDisplayed; - - LPDIRECTDRAW m_lpDD; - LPDIRECTDRAWSURFACE m_lpDDSPrimary; - LPDIRECTDRAWSURFACE m_lpDDSBack; - LPDIRECTDRAWSURFACE m_lpDDSMouse; - IDirectDrawPalette* m_lpDDPal; - LPDIRECTDRAWSURFACE m_lpDDSurface[MAXIMAGE]; - LPDIRECTDRAWCLIPPER m_lpClipper; - PALETTEENTRY m_pal[256]; - PALETTEENTRY m_sysPal[256]; - COLORREF m_colorSurface[2*MAXIMAGE]; - - char m_filename[MAXIMAGE][20]; - POINT m_totalDim[MAXIMAGE]; - POINT m_iconDim[MAXIMAGE]; - DDBLTFX m_DDbltfx; -}; \ No newline at end of file diff --git a/resource.h b/resource.h deleted file mode 100644 index f1c2001..0000000 --- a/resource.h +++ /dev/null @@ -1,284 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by Eggbert 2.rc -// -#define TX_ACTION_GO 1 -#define TX_ACTION_STOP 2 -#define TX_ACTION_MANGE 3 -#define TX_ACTION_CARRY 4 -#define TX_ACTION_DEPOSE 5 -#define TX_ACTION_ABAT 6 -#define TX_ACTION_ROC 7 -#define TX_ACTION_CULTIVE 8 -#define TX_ACTION_BUILD1 9 -#define TX_ACTION_BUILD2 10 -#define TX_ACTION_BUILD3 11 -#define TX_ACTION_BUILD4 12 -#define TX_ACTION_BUILD5 13 -#define TX_ACTION_BUILD6 14 -#define TX_ACTION_MUR 15 -#define TX_ACTION_PALIS 16 -#define TX_ACTION_ABATn 17 -#define TX_ACTION_ROCn 18 -#define TX_ACTION_PONT 19 -#define TX_ACTION_TOUR 20 -#define TX_ACTION_BOIT 21 -#define TX_ACTION_LABO 22 -#define TX_ACTION_FLEUR 23 -#define TX_ACTION_FLEURn 24 -#define TX_ACTION_DYNAMITE 25 -#define TX_ACTION_BATEAU 26 -#define TX_ACTION_DJEEP 27 -#define TX_ACTION_DRAPEAU 28 -#define TX_ACTION_EXTRAIT 29 -#define TX_ACTION_FABJEEP 30 -#define TX_ACTION_FABMINE 31 -#define TX_ACTION_FABDISC 32 -#define TX_ACTION_REPEAT 33 -#define TX_ACTION_QARMURE 34 -#define TX_ACTION_FABARMURE 35 -#define TX_IONAMEEX 100 -#define TX_IOFREE 101 -#define TX_OWNMISSION 102 -#define TX_TESTMISSION 103 -#define TX_BUTTON_JOUER 104 -#define TX_BUTTON_APPRENDRE 105 -#define TX_BUTTON_QUITTER 106 -#define TX_BUTTON_PREVP 107 -#define TX_BUTTON_NEXTP 108 -#define TX_BUTTON_PLAYP 109 -#define TX_BUTTON_BUILDP 110 -#define TX_BUTTON_TERM 111 -#define TX_BUTTON_READP 112 -#define TX_BUTTON_WRITEP 113 -#define TX_BUTTON_CANCELP 114 -#define TX_BUTTON_CONTP 115 -#define TX_BUTTON_REPEAT 116 -#define TX_CHOOSEPLAYER 117 -#define TX_PLAYERSNAME 118 -#define TX_BUTTON_TERMC 119 -#define TX_CHOOSESIZE 120 -#define TX_BUTTON_HVSCROLL 121 -#define TX_BUTTON_ONLYHSCROLL 122 -#define TX_BUTTON_ONLYVSCROLL 123 -#define TX_BUTTON_TESTMISSION 124 -#define TX_PAUSE 125 -#define TX_TINY 126 -#define TX_CLEARPLAYER 127 -#define TX_SETTINGS 128 -#define TX_CHOOSEMUSIC 129 -#define TX_BUTTON_SETUP1 130 -#define TX_BUTTON_SETUP2 131 -#define TX_BUTTON_SETUP3 132 -#define TX_BUTTON_SETUP4 133 -#define TX_NOMUSIC 134 -#define TX_MUSIC1 135 -#define TX_MUSIC2 136 -#define TX_MUSIC3 137 -#define TX_MUSIC4 138 -#define TX_MUSIC5 139 -#define TX_MUSIC6 140 -#define TX_MUSIC7 141 -#define TX_MUSIC8 142 -#define TX_MUSIC9 143 -#define TX_BUTTON_REGION 144 -#define TX_DISCARDGAME 145 -#define TX_EGGBERT 146 -#define TX_DESIGNMISSION 147 -#define TX_CHOOSEGAMER 148 -#define TX_MUSIC 149 -#define TX_TRAININGNUM 150 -#define TX_MISSIONNUM 151 -#define TX_MISSIONTIME 152 -#define TX_SIZE 153 -#define TX_BUTTON_SETUP5 154 -#define TX_BUTTON_SETUP6 155 -#define TX_BUTTON_SETUP7 156 -#define TX_BUTTON_SETUP8 157 -#define TX_CONFYES 158 -#define TX_CONFNO 159 -#define TX_SETTING 160 -#define TX_SAVECURRENTMISS 161 -#define TX_SOUNDVOL 162 -#define TX_MUSICVOL 163 -#define TX_COLORDEP 164 -#define TX_INPUT 165 -#define TX_OPENMISS 166 -#define TX_READINFO 167 -#define TX_PLAYERFREE 168 -#define TX_NUMDOOROPEN 169 -#define TX_NUMDOORSOPEN 170 -#define TX_MUSIC10 171 -#define TX_WRITENAME 172 -#define TX_NONE 173 -#define TX_CONFIRM 174 -#define TX_CANCEL 175 -#define TX_YES 176 -#define TX_NO 177 -#define TX_REGION 178 -#define TX_SUS 179 -#define TX_BUTTON_SETUP 180 -#define TX_SAVES 181 -#define TX_INSERT 182 -#define TX_DELETEMISS 183 -#define TX_DELETEMISSION 184 -#define TX_NAMEOFMISS 185 -#define TX_NAMEOFMISSION 186 -#define TX_NONAME 187 -#define TX_DESIGN 188 -#define TX_MISSNUM 189 -#define TX_MISSTIME 190 -#define TX_MISSION2D 191 -#define TX_SHOWNEXT 192 -#define TX_SHOWPREV 193 -#define TX_CONTENT 194 -#define TX_SINGLEPLAYER 195 -#define TX_MUTLIPLAYER 196 -#define TX_GAMEPAUSE 197 -#define TX_FULL_END1 203 -#define TX_FULL_END2 204 -#define TX_FULL_END3 205 -#define TX_FULL_END4 206 -#define TX_BUTTON_SKILL 209 -#define TX_BUTTON_DEMO 212 -#define TX_DEMOREC 213 -#define TX_DEMOPLAY 214 -#define TX_SHOWCONNECTION 242 -#define TX_GAMEJOIN 247 -#define TX_CREATE_MULTIGAME 248 -#define TX_UPDATELIST 249 -#define TX_MULTI_CREATE 250 -#define TX_MULTI_GNAME 251 -#define TX_OPEN 264 -#define TX_HELP 268 -#define TX_LOAD_CGAME 269 -#define TX_SAVE_CGAME 270 -#define TX_MISSIONFREE 272 -#define TX_GAMESAVED 288 -#define TX_NOTINDEMO 289 -#define TX_REPEAT_CULTIVE 500 -#define TX_REPEAT_FLEUR 501 -#define TX_REPEAT_FLEURQ 502 -#define TX_REPEAT_FABMINE 503 -#define TX_REPEAT_FABJEEP 504 -#define TX_REPEAT_PALIS 505 -#define TX_REPEAT_PALISQ 506 -#define TX_REPEAT_PONT 507 -#define TX_REPEAT_PONTQ 508 -#define TX_REPEAT_BATEAU 509 -#define TX_REPEAT_BATEAUQ 510 -#define TX_REPEAT_FABARMURE 511 -#define TX_DIRECT_N 512 -#define TX_DIRECT_S 513 -#define TX_DIRECT_E 514 -#define TX_DIRECT_O 515 -#define IDR_WAVE_BOING 1000 -#define TX_ERROR_MISC 1000 -#define IDR_WAVE_BLOW 1001 -#define TX_ERROR_GROUND 1001 -#define TX_ERROR_FREE 1002 -#define TX_ERROR_PONTOP 1003 -#define TX_ERROR_PONTTERM 1004 -#define TX_ERROR_TOURISOL 1005 -#define TX_ERROR_TOUREAU 1006 -#define TX_ERROR_TELE2 1007 -#define TX_OBJ_BLUPIm 2000 -#define TX_OBJ_BLUPIf 2001 -#define TX_OBJ_BLUPI 2002 -#define TX_OBJ_BATEAU 2003 -#define TX_OBJ_JEEP 2004 -#define TX_OBJ_PIEGE 2005 -#define TX_OBJ_POISON 2006 -#define TX_OBJ_DYNAMITE 2007 -#define TX_OBJ_MINE 2008 -#define TX_OBJ_TOMATE 2009 -#define TX_OBJ_POTION 2010 -#define TX_OBJ_PLANCHE 2011 -#define TX_OBJ_PIERRE 2012 -#define TX_OBJ_DRAPEAU 2013 -#define TX_OBJ_FER 2014 -#define TX_OBJ_FLEUR1 2015 -#define TX_OBJ_FLEUR2 2016 -#define TX_OBJ_FLEUR3 2017 -#define TX_OBJ_CABANE 2018 -#define TX_OBJ_LABO 2019 -#define TX_OBJ_MINEFER 2020 -#define TX_OBJ_USINE 2021 -#define TX_OBJ_TOUR 2022 -#define TX_OBJ_FEU 2023 -#define TX_OBJ_ROBOT 2024 -#define TX_OBJ_TRACKS 2025 -#define TX_OBJ_BOMBE 2026 -#define TX_OBJ_ARAIGNEE 2027 -#define TX_OBJ_VIRUS 2028 -#define TX_OBJ_ELECTRO 2029 -#define TX_OBJ_ARBRE 2030 -#define TX_OBJ_MUR 2031 -#define TX_OBJ_ARBREb 2032 -#define TX_OBJ_ROC 2033 -#define TX_OBJ_OEUF 2034 -#define TX_OBJ_PALISSADE 2035 -#define TX_OBJ_ENNEMIp 2036 -#define TX_OBJ_ENNEMI 2037 -#define TX_OBJ_HERBE 2038 -#define TX_OBJ_MOUSSE 2039 -#define TX_OBJ_TERRE 2040 -#define TX_OBJ_EAU 2041 -#define TX_OBJ_RIVE 2042 -#define TX_OBJ_MIXTE 2043 -#define TX_OBJ_PONT 2044 -#define TX_OBJ_COUVEUSE 2045 -#define TX_OBJ_GLACE 2046 -#define TX_OBJ_MAISON 2047 -#define TX_OBJ_HACHURE 2048 -#define TX_OBJ_MOUSSEb 2049 -#define TX_OBJ_BOUQUET1 2050 -#define TX_OBJ_BOUQUET2 2051 -#define TX_OBJ_BOUQUET3 2052 -#define TX_OBJ_DALLE 2053 -#define TX_OBJ_ENNEMIs 2054 -#define TX_OBJ_DISCIPLE 2055 -#define TX_OBJ_METAL 2056 -#define TX_OBJ_FUSEE 2057 -#define TX_OBJ_TELEPORTE 2058 -#define TX_OBJ_ARMURE 2059 -#define TX_OBJ_DALLESPEC 2060 -#define TX_OBJ_COUVTELE 2061 -#define TX_OBJ_BATIMENT 2062 -#define TX_OBJ_BATENNEMIS 2063 -#define TX_OBJ_MURPAL 2064 -#define TX_OBJ_OBJET 2065 -#define TX_OBJ_ARME 2066 -#define TX_OBJ_VEHICULE 2067 -#define TX_OBJ_STARTFEU 2068 -#define TX_OBJ_DELOBJ 2069 -#define TX_OBJ_DELPERSO 2070 -#define TX_OBJ_DELFEU 2071 -#define TX_OBJ_PLANTE 2072 -#define TX_OBJ_BARENNEMIS 2073 -#define TX_WIN1 3000 -#define TX_WIN2 3001 -#define TX_WIN3 3002 -#define TX_WIN4 3003 -#define TX_WIN5 3004 -#define TX_LOST1 3100 -#define TX_LOST2 3101 -#define TX_LOST3 3102 -#define TX_LOST4 3103 -#define TX_LOST5 3104 -#define TX_LASTWIN1 3200 -#define TX_LASTWIN2 3201 -#define TX_LASTWIN3 3202 -#define TX_BUTTON_CREATE 6900 -#define IDM_EXIT 40001 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 194 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1000 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/resource1.h b/resource1.h deleted file mode 100644 index eaa8950..0000000 --- a/resource1.h +++ /dev/null @@ -1,87 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by Eggbert2.rc -// -#define IDS_STRING101 101 -#define IDS_STRING102 102 -#define IDC_CURSOR1 102 -#define IDS_STRING103 103 -#define IDC_CURSOR2 103 -#define IDS_STRING104 104 -#define IDC_CURSOR3 104 -#define IDS_STRING105 105 -#define IDC_CURSOR4 105 -#define IDS_STRING106 106 -#define IDC_CURSOR5 106 -#define IDS_STRING107 107 -#define IDC_CURSOR6 107 -#define IDS_STRING108 108 -#define IDC_CURSOR7 108 -#define IDS_STRING109 109 -#define IDC_CURSOR8 109 -#define IDS_STRING110 110 -#define IDC_CURSOR9 110 -#define IDS_STRING111 111 -#define IDC_CURSOR10 111 -#define IDS_STRING112 112 -#define IDC_CURSOR11 112 -#define IDS_STRING113 113 -#define IDC_CURSOR12 113 -#define IDS_STRING114 114 -#define IDC_CURSOR13 114 -#define IDS_STRING115 115 -#define IDC_CURSOR14 115 -#define IDS_STRING116 116 -#define IDC_CURSOR15 116 -#define IDS_STRING117 117 -#define IDI_ICON1 117 -#define IDS_STRING118 118 -#define IDD_DIALOG1 118 -#define IDS_STRING119 119 -#define IDS_STRING120 120 -#define IDS_STRING121 121 -#define IDS_STRING122 122 -#define IDS_STRING123 123 -#define IDS_STRING124 124 -#define IDS_STRING125 125 -#define IDS_STRING126 126 -#define IDS_STRING127 127 -#define IDS_STRING128 128 -#define IDS_STRING129 129 -#define IDS_STRING130 130 -#define IDS_STRING131 131 -#define IDS_STRING132 132 -#define IDS_STRING133 133 -#define IDS_STRING134 134 -#define IDS_STRING135 135 -#define IDS_STRING136 136 -#define IDS_STRING137 137 -#define IDS_STRING198 149 -#define IDS_STRING150 178 -#define IDS_STRING197 197 -#define IDS_STRING213 213 -#define IDS_STRING214 214 -#define IDS_STRING250 250 -#define IDS_STRING3005 269 -#define IDS_STRING270 270 -#define IDS_STRING3105 3000 -#define IDS_STRING3001 3001 -#define IDS_STRING3002 3002 -#define IDS_STRING3003 3003 -#define IDS_STRING3004 3004 -#define IDS_STRING138 3100 -#define IDS_STRING3101 3101 -#define IDS_STRING3102 3102 -#define IDS_STRING3103 3103 -#define IDS_STRING3104 3104 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 120 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1001 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/resource2.h b/resource2.h deleted file mode 100644 index 7c27dc8..0000000 --- a/resource2.h +++ /dev/null @@ -1,108 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by Resource.rc -// -#define TX_IONAMEEX 100 -#define TX_IOFREE 101 -#define TX_OWNMISSION 102 -#define TX_TESTMISSION 103 -#define TX_BUTTON_JOUER 104 -#define TX_BUTTON_APPRENDRE 105 -#define TX_BUTTON_QUITTER 106 -#define TX_BUTTON_PREVP 107 -#define TX_BUTTON_NEXTP 108 -#define TX_BUTTON_PLAYP 109 -#define TX_BUTTON_BUILDP 110 -#define TX_BUTTON_TERM 111 -#define TX_BUTTON_READP 112 -#define TX_BUTTON_WRITEP 113 -#define TX_BUTTON_CANCELP 114 -#define TX_BUTTON_CONTP 115 -#define TX_BUTTON_REPEAT 116 -#define TX_CHOOSEPLAYER 117 -#define TX_PLAYERSNAME 118 -#define TX_BUTTON_TERMC 119 -#define TX_CHOOSESIZE 120 -#define TX_BUTTON_HVSCROLL 121 -#define TX_BUTTON_ONLYHSSCROLL 122 -#define TX_BUTTON_ONLYVSCROLL 123 -#define TX_BUTTON_TESTMISSION 124 -#define TX_PAUSE 125 -#define TX_TINY 126 -#define TX_CLEARPLAYER 127 -#define TX_SETTINGS 128 -#define TX_CHOOSEMUSIC 129 -#define TX_BUTTON_SETUP1 130 -#define TX_BUTTON_SETUP2 131 -#define TX_BUTTON_SETUP3 132 -#define TX_BUTTON_SETUP4 133 -#define TX_NOMUSIC 134 -#define TX_MUSIC1 135 -#define TX_MUSIC2 136 -#define TX_MUSIC3 137 -#define TX_MUSIC4 138 -#define TX_MUSIC5 139 -#define TX_MUSIC6 140 -#define TX_MUSIC7 141 -#define TX_MUSIC8 142 -#define TX_MUSIC9 143 -#define TX_BUTTON_REGION 144 -#define TX_DISCARDGAME 145 -#define TX_EGGBERT 146 -#define TX_DESIGNMISSION 147 -#define TX_CHOOSEGAMER 148 -#define TX_MUSIC 149 -#define TX_TRAININGNUM 150 -#define TX_MISSIONNUM 151 -#define TX_MISSIONTIME 152 -#define TX_SIZE 153 -#define TX_BUTTON_SETUP5 154 -#define TX_BUTTON_SETUP6 155 -#define TX_BUTTON_SETUP7 156 -#define TX_BUTTON_SETUP8 157 -#define TX_CONFYES 158 -#define TX_CONFNO 159 -#define TX_SETTING 160 -#define TX_SAVECURRENTMISS 161 -#define TX_SOUNDVOL 162 -#define TX_MUSICVOL 163 -#define TX_COLORDEP 164 -#define TX_INPUT 165 -#define TX_OPENMISS 166 -#define TX_READINFO 167 -#define TX_PLAYERFREE 168 -#define TX_NUMDOOROPEN 169 -#define TX_NUMDOORSOPEN 170 -#define TX_MUSIC10 171 -#define TX_WRITENAME 172 -#define TX_NONE 173 -#define TX_CONFIRM 174 -#define TX_CANCEL 175 -#define TX_YES 176 -#define TX_NO 177 -#define TX_REGION 178 -#define TX_SUS 179 -#define TX_BUTTON_SETUP 180 -#define TX_SAVES 181 -#define TX_INSERT 182 -#define TX_DELETEMISS 183 -#define TX_DELETEMISSION 184 -#define TX_NAMEOFMISS 185 -#define TX_NAMEOFMISSION 186 -#define TX_NONAME 187 -#define TX_DESIGN 188 -#define TX_MISSNUM 189 -#define TX_MISSTIME 190 -#define IDI_ICON1 190 -#define TX_MISSION2D 191 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 191 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1001 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/sound.cpp b/sound.cpp deleted file mode 100644 index ce151e1..0000000 --- a/sound.cpp +++ /dev/null @@ -1,685 +0,0 @@ -// sound.cpp -// - -#include -#include -#include -#include "sound.h" -#include "misc.h" -#include "def.h" -#include "resource.h" - -#pragma warning (disable : 4996) -#pragma comment(lib, "dsound.lib") - -using namespace std; - - -///////////////////////////////////////////////////////////////////////////// - - - -// The following macro are used for proper error handling for DirectSound. -#define TRY_DS(exp) { { HRESULT rval = exp; if (rval != DS_OK) { TraceErrorDS(rval, __FILE__, __LINE__); return FALSE; } } } - - -struct WaveHeader -{ - BYTE RIFF[4]; // "RIFF" - DWORD dwSize; // Size of data to follow - BYTE WAVE[4]; // "WAVE" - BYTE fmt_[4]; // "fmt " - DWORD dw16; // 16 - WORD wOne_0; // 1 - WORD wChnls; // Number of Channels - DWORD dwSRate; // Sample Rate - DWORD BytesPerSec; // Sample Rate - WORD wBlkAlign; // 1 - WORD BitsPerSample; // Sample size - BYTE DATA[4]; // "DATA" - DWORD dwDSize; // Number of Samples -}; - - - - -// Creates a DirectSound buffer. - -BOOL CSound::CreateSoundBuffer(int dwBuf, DWORD dwBufSize, DWORD dwFreq, DWORD dwBitsPerSample, DWORD dwBlkAlign, BOOL bStereo) -{ - PCMWAVEFORMAT pcmwf; - DSBUFFERDESC dsbdesc; - - // Set up wave format structure. - memset( &pcmwf, 0, sizeof(PCMWAVEFORMAT) ); - pcmwf.wf.wFormatTag = WAVE_FORMAT_PCM; - pcmwf.wf.nChannels = bStereo ? 2 : 1; - pcmwf.wf.nSamplesPerSec = dwFreq; - pcmwf.wf.nBlockAlign = (WORD)dwBlkAlign; - pcmwf.wf.nAvgBytesPerSec = pcmwf.wf.nSamplesPerSec * pcmwf.wf.nBlockAlign; - pcmwf.wBitsPerSample = (WORD)dwBitsPerSample; - - // Set up DSBUFFERDESC structure. - memset(&dsbdesc, 0, sizeof(DSBUFFERDESC)); // Zero it out. - dsbdesc.dwSize = sizeof(DSBUFFERDESC); - dsbdesc.dwFlags = DSBCAPS_CTRLFREQUENCY | DSBCAPS_CTRLPAN | DSBCAPS_CTRLVOLUME; - dsbdesc.dwBufferBytes = dwBufSize; - dsbdesc.lpwfxFormat = (LPWAVEFORMATEX)&pcmwf; - - TRY_DS(m_lpDS->CreateSoundBuffer(&dsbdesc, &m_lpDSB[dwBuf], NULL), 63) - return TRUE; -} - -// I dunno what the fuck this does. -/* -BOOL CSound::ErrorSomething() -{ - if (m_lpDS || - m_lpDSB != 0) - { - m_lpDS, m_lpDSB->TraceErrorDS; - return FALSE; - } - return TRUE; -} -*/ - - -// Reads in data from a wave file. - -BOOL CSound::ReadData(LPDIRECTSOUNDBUFFER lpDSB, FILE* pFile, DWORD dwSize, DWORD dwPos) -{ - // Seek to correct position in file (if necessary) - if ( dwPos != 0xffffffff ) - { - if ( fseek(pFile, dwPos, SEEK_SET) != 0 ) - { - return FALSE; - } - } - - // Lock data in buffer for writing - LPVOID pData1; - DWORD dwData1Size; - LPVOID pData2; - DWORD dwData2Size; - HRESULT rval; - - rval = lpDSB->Lock(0, dwSize, &pData1, &dwData1Size, &pData2, &dwData2Size, DSBLOCK_FROMWRITECURSOR); - if ( rval != DS_OK ) - { - return FALSE; - } - - // Read in first chunk of data - if ( dwData1Size > 0 ) - { - if ( fread(pData1, dwData1Size, 1, pFile) != 1 ) - { - char holder[256]; - wsprintfA(holder,"Data1 : %d, dwdata: %d, pFile: %d",pData1,dwData1Size,pFile); - OutputDebug(holder); - return FALSE; - } - } - - // read in second chunk if necessary - if ( dwData2Size > 0 ) - { - if ( fread(pData2, dwData2Size, 1, pFile) != 1 ) - { - return FALSE; - } - } - - // Unlock data in buffer - rval = lpDSB->Unlock(pData1, dwData1Size, pData2, dwData2Size); - if ( rval != DS_OK ) - { - return FALSE; - } - - return TRUE; -} - -// Creates a DirectSound buffer from a wave file. - -BOOL CSound::CreateBufferFromWaveFile(int dwBuf, char *pFileName) -{ - // Open the wave file - FILE* pFile = fopen(pFileName, "rb"); - if ( pFile == NULL ) return FALSE; - - // Read in the wave header - WaveHeader wavHdr; - if ( fread(&wavHdr, sizeof(wavHdr), 1, pFile) != 1 ) - { - fclose(pFile); - return NULL; - } - - // Figure out the size of the data region - DWORD dwSize = wavHdr.dwDSize; - - // Is this a stereo or mono file? - BOOL bStereo = wavHdr.wChnls > 1 ? TRUE : FALSE; - - // Create the sound buffer for the wave file - if ( !CreateSoundBuffer(dwBuf, dwSize, wavHdr.dwSRate, - wavHdr.BitsPerSample, wavHdr.wBlkAlign, bStereo) ) - { - // Close the file - fclose(pFile); - - return FALSE; - } - - // Read the data for the wave file into the sound buffer - if ( !ReadData(m_lpDSB[dwBuf], pFile, dwSize, sizeof(wavHdr)) ) - { - fclose(pFile); - return FALSE; - } - - // Close out the wave file - fclose(pFile); - - return TRUE; -} - -// Stops all sounds. - -BOOL CSound::StopAllSounds() -{ - // Make sure we have a valid sound buffer - for (int i = 0; i < MAXSOUND; i ++) - { - if ( m_lpDSB[i] ) - { - DWORD dwStatus; - TRY_DS(m_lpDSB[i]->GetStatus(&dwStatus)); - - if ( (dwStatus & DSBSTATUS_PLAYING) == DSBSTATUS_PLAYING ) - { - TRY_DS(m_lpDSB[i]->Stop()) - } - } - } - - return TRUE; -} - -// Plays a sound using direct sound. - -BOOL CSound::PlaySoundDS(DWORD dwSound, DWORD dwFlags) -{ - // Make sure the sound is valid - if ( dwSound >= MAXSOUND ) return FALSE; - - // Make sure we have a valid sound buffer - if ( m_lpDSB[dwSound] ) - { - DWORD dwStatus; - TRY_DS(m_lpDSB[dwSound]->GetStatus(&dwStatus)); - - if ( (dwStatus & DSBSTATUS_PLAYING) != DSBSTATUS_PLAYING ) - { - // Play the sound - TRY_DS(m_lpDSB[dwSound]->Play(0, 0, dwFlags)); - } - } - - return TRUE; -} - - - -///////////////////////////////////////////////////////////////////////////// - - -// Modifie le volume midi. -// Le volume est compris entre 0 et 20 ! - -void InitMidiVolume(int volume) -{ - int nb, i, n; - MMRESULT result; - HMIDIOUT hmo = 0; - - static int table[21] = - { - 0x00000000, - 0x11111111, - 0x22222222, - 0x33333333, - 0x44444444, - 0x55555555, - 0x66666666, - 0x77777777, - 0x88888888, - 0x99999999, - 0xAAAAAAAA, - 0xBBBBBBBB, - 0xCCCCCCCC, - 0xDDDDDDDD, - 0xEEEEEEEE, - 0xF222F222, - 0xF555F555, - 0xF777F777, - 0xFAAAFAAA, - 0xFDDDFDDD, - 0xFFFFFFFF, - }; - - if ( volume < 0 ) volume = 0; - if ( volume > MAXVOLUME ) volume = MAXVOLUME; - - nb = midiOutGetNumDevs(); - for ( i=0 ; iRelease(); - m_lpDSB[i]= NULL; - } - } - - if ( m_lpDS != NULL ) - { - m_lpDS->Release(); - m_lpDS = NULL; - } -} - - -// Initialisation de DirectSound. - -BOOL CSound::Create(HWND hWnd) -{ - if ( !DirectSoundCreate(NULL, &m_lpDS, NULL) == DS_OK ) - { - OutputDebug("Fatal error: DirectSoundCreate\n"); - m_bEnable = FALSE; - return FALSE; - } - - m_lpDS->SetCooperativeLevel(hWnd, DSSCL_NORMAL); - m_bEnable = TRUE; - m_hWnd = hWnd; - return TRUE; -} - - -// Retourne l'�tat de DirectSound. - -BOOL CSound::GetEnable() -{ - return m_bEnable; -} - - -// Enclenche ou d�clenche le son. - -void CSound::SetState(BOOL bState) -{ - m_bState = bState; -} - - -// Gestion des volumes audio (.wav) et midi (.mid). - -void CSound::SetAudioVolume(int volume) -{ - m_audioVolume = volume; -} - -int CSound::GetAudioVolume() -{ - if ( !m_bEnable ) return 0; - return m_audioVolume; -} - -void CSound::SetMidiVolume(int volume) -{ - m_midiVolume = volume; -} - -int CSound::GetMidiVolume() -{ - if ( !m_bEnable ) return 0; - return m_midiVolume; -} - - -// Cache tous les ficheirs son (.wav). - -void CSound::CacheAll() -{ - int i; - char name[50]; - - if ( !m_bEnable ) return; - - for ( i=0 ; i= MAXSOUND ) return FALSE; - - if ( m_lpDSB[channel] != NULL ) - { - Flush(channel); - } - - return CreateBufferFromWaveFile(channel, pFilename); -} - -// D�charge un son. - -void CSound::Flush(int channel) -{ - if ( !m_bEnable ) return; - if ( channel < 0 || channel >= MAXSOUND ) return; - - if ( m_lpDSB[channel] != NULL ) - { - m_lpDSB[channel]->Release(); - m_lpDSB[channel]= NULL; - } -} - -// Fait entendre un son. -// Le volume est compris entre 0 (max) et -10000 (silence). -// Le panoramique est compris entre -10000 (gauche), 0 (centre) -// et +10000 (droite). - -BOOL CSound::Play(int channel, int volume, int pan) -{ - if ( !m_bEnable ) return TRUE; - if ( !m_bState || m_audioVolume == 0 ) return TRUE; - - volume -= (MAXVOLUME-m_audioVolume)*((10000/4)/MAXVOLUME); - -//? if ( volume == -10000 ) return TRUE; - if ( volume <= -10000/4 ) return TRUE; - - if ( channel < 0 || channel >= MAXSOUND ) return FALSE; - if ( m_lpDSB[channel] == NULL ) return FALSE; - - m_lpDSB[channel]->SetVolume(volume); - m_lpDSB[channel]->SetPan(pan); - m_lpDSB[channel]->Play(0, 0, 0); - - return TRUE; -} - -BOOL CSound::StopSound(Sound channel) -{ - if (m_bEnable) return FALSE; - if (m_bState || m_audioVolume == 0) return FALSE; - - if (0 < channel || channel < MAXSOUND) - { - if (m_lpDSB[channel] == NULL) - return (BOOL)m_lpDSB[channel]; - m_lpDSB[channel]->Stop(); - m_lpDSB[channel]->SetCurrentPosition(0); - return TRUE; - } - return FALSE; -} - -// Fait entendre un son dans une image. -// Si rank != -1, il indique le rang du blupi dont il faudra -// �ventuellement stopper le dernier son en cours ! - -BOOL CSound::PlayImage(int channel, POINT pos, int rank) -{ - int stopCh, volumex, volumey, volume, pan; - - if ( rank >= 0 && rank < MAXBLUPI ) - { - stopCh = m_channelBlupi[rank]; - if ( stopCh >= 0 && m_lpDSB[stopCh] != NULL ) - { - m_lpDSB[stopCh]->Stop(); // stoppe le son pr�c�dent - m_lpDSB[stopCh]->SetCurrentPosition(0); - } - - m_channelBlupi[rank] = channel; - } - -//? pan = (int)(((long)pos.x*20000L)/LXIMAGE)-10000L; -//? pan = (int)(((long)pos.x*10000L)/LXIMAGE)-5000L; - pan = (int)(((long)pos.x*5000L)/LXIMAGE)-2500L; - - volumex = 0; // volume maximum - if ( pos.x < 0 ) - { - volumex = (pos.x*2500)/LXIMAGE; - } - if ( pos.x > LXIMAGE ) - { - pos.x -= LXIMAGE; - volumex = (-pos.x*2500)/LXIMAGE; - } - if ( volumex < -10000 ) volumex = -10000; - - volumey = 0; // volume maximum - if ( pos.y < 0 ) - { - volumey = (pos.y*2500)/LYIMAGE; - } - if ( pos.y > LYIMAGE ) - { - pos.y -= LYIMAGE; - volumey = (-pos.y*2500)/LYIMAGE; - } - if ( volumey < -10000 ) volumey = -10000; - - if ( volumex < volumey ) volume = volumex; - else volume = volumey; - - return Play(channel, volume, pan); -} - - -// Uses MCI to play a MIDI file. The window procedure -// is notified when playback is complete. - -BOOL CSound::PlayMusic(HWND hWnd, LPSTR lpszMIDIFilename) -{ - MCI_OPEN_PARMS mciOpenParms; - MCI_PLAY_PARMS mciPlayParms; - DWORD dwReturn; - char string[MAX_PATH]; - - if ( !m_bEnable ) return TRUE; - if ( m_midiVolume == 0 ) return TRUE; - InitMidiVolume(m_midiVolume); - m_lastMidiVolume = m_midiVolume; - - if ( lpszMIDIFilename[1] == ':' ) // nom complet "D:\REP..." ? - { - strcpy(string, lpszMIDIFilename); - } - else - { - GetCurrentDir(string, MAX_PATH-30); - strcat(string, lpszMIDIFilename); - } - - // Open the device by specifying the device and filename. - // MCI will attempt to choose the MIDI mapper as the output port. - mciOpenParms.lpstrDeviceType = (LPCWSTR)"sequencer"; - mciOpenParms.lpstrElementName = (LPCWSTR)string; - dwReturn = mciSendCommand(NULL, - MCI_OPEN, - MCI_OPEN_TYPE|MCI_OPEN_ELEMENT, - (DWORD)(LPVOID)&mciOpenParms); - if ( dwReturn != 0 ) - { - OutputDebug("PlayMusic-1\n"); - mciGetErrorStringA(dwReturn, string, 128); - OutputDebug(string); - // Failed to open device. Don't close it; just return error. - return FALSE; - } - - // The device opened successfully; get the device ID. - m_MidiDeviceID = mciOpenParms.wDeviceID; - - // Begin playback. - mciPlayParms.dwCallback = (DWORD)hWnd; - dwReturn = mciSendCommand(m_MidiDeviceID, - MCI_PLAY, - MCI_NOTIFY, - (DWORD)(LPVOID)&mciPlayParms); - if ( dwReturn != 0 ) - { - OutputDebug("PlayMusic-2\n"); - mciGetErrorStringA(dwReturn, string, 128); - OutputDebug(string); - StopMusic(); - return FALSE; - } - - strcpy(m_MIDIFilename, lpszMIDIFilename); - - return TRUE; -} - -// Restart the MIDI player. - -BOOL CSound::RestartMusic() -{ - OutputDebug("RestartMusic\n"); - if ( !m_bEnable ) return TRUE; - if ( m_midiVolume == 0 ) return TRUE; - if ( m_MIDIFilename[0] == 0 ) return FALSE; - - return PlayMusic(m_hWnd, m_MIDIFilename); -} - -// Shuts down the MIDI player. - -void CSound::SuspendMusic() -{ - if ( !m_bEnable ) return; - - if ( m_nbSuspendSkip != 0 ) - { - m_nbSuspendSkip --; - return; - } - - if ( m_MidiDeviceID && m_midiVolume != 0 ) - { - mciSendCommand(m_MidiDeviceID, MCI_CLOSE, 0, NULL); - } - m_MidiDeviceID = 0; -} - -// Shuts down the MIDI player. - -void CSound::StopMusic() -{ - SuspendMusic(); - m_MIDIFilename[0] = 0; -} - -// Retourne TRUE si une musique est en cours. - -BOOL CSound::IsPlayingMusic() -{ - return (m_MIDIFilename[0] != 0); -} - -// Adapte le volume de la musique en cours, si n�cessaire. - -void CSound::AdaptVolumeMusic() -{ - if ( m_midiVolume != m_lastMidiVolume ) - { - InitMidiVolume(m_midiVolume); - m_lastMidiVolume = m_midiVolume; - RestartMusic(); - } -} - -// Indique le nombre de suspend � sauter. - -void CSound::SetSuspendSkip(int nb) -{ - m_nbSuspendSkip = nb; -} - diff --git a/sound.h b/sound.h deleted file mode 100644 index aa053bb..0000000 --- a/sound.h +++ /dev/null @@ -1,103 +0,0 @@ -// sound.h -// - -using namespace std; - -#pragma once - -#include -#include -#include "dsound.h" -#include - -typedef enum -{ - SOUND_1_CLICK, - SOUND_3_JUMPEND, - SOUND_10_BOUM, - SOUND_11_TRESOR, - SOUND_13_ENDKO, - SOUND_14_ENDOK, - SOUND_16_HELICOHIGH, - SOUND_18_HELICOLOW, - SOUND_23_PLOUF, - SOUND_24_BLUP, - SOUND_29_JEEPHIGH, - SOUND_31_JEEPLOW, - SOUND_33_DOOR, - SOUND_41_RESSORT, - SOUND_42_STARTSHIELD, - SOUND_50_SUCETTE, - SOUND_51_GLU, - SOUND_57_DRINK, - SOUND_58_CHARGE, - SOUND_59_ELECTRO, - SOUND_60_PERSOTAKE, - SOUND_64_TIPLOUF, - SOUND_69_BLITZ, - SOUND_74_ANGEL, - SOUND_75_SCIE, - SOUND_76_SWITCHOFF, - SOUND_92_FOLLOW -} -Sound; - -/////////////////////////////////////////////////////////////////////////// - -#define MAXSOUND 100 -#define MAXVOLUME 20 -#define MAXBLUPI 100 -#define WIN32_LEAN_AND_MEAN - -class CSound -{ -public: - CSound(); - ~CSound(); - - BOOL Create(HWND hWnd); - void SetState(BOOL bState); - BOOL GetEnable(); - - void SetAudioVolume(int volume); - int GetAudioVolume(); - void SetMidiVolume(int volume); - int GetMidiVolume(); - - void CacheAll(); - BOOL Cache(int channel, char *pFilename); - void Flush(int channel); - - BOOL Play (int channel, int volume=0, int pan=0); - BOOL StopSound(Sound channel); - BOOL PlayImage(int channel, POINT pos, int rank=-1); - BOOL PlayMusic(HWND hWnd, LPSTR lpszMIDIFilename); - BOOL RestartMusic(); - void SuspendMusic(); - void StopMusic(); - BOOL IsPlayingMusic(); - void AdaptVolumeMusic(); - void SetSuspendSkip(int nb); - -protected: - BOOL CreateSoundBuffer(int dwBuf, DWORD dwBufSize, DWORD dwFreq, DWORD dwBitsPerSample, DWORD dwBlkAlign, BOOL bStereo); - BOOL ReadData(LPDIRECTSOUNDBUFFER lpDSB, FILE* pFile, DWORD dwSize, DWORD dwPos); - BOOL CreateBufferFromWaveFile(int dwBuf, char *pFileName); - BOOL StopAllSounds(); - BOOL PlaySoundDS(DWORD dwSound, DWORD dwFlags); - -protected: - HWND m_hWnd; - BOOL m_bEnable; - BOOL m_bState; - BOOL m_bCDAudio; - LPDIRECTSOUND m_lpDS; - LPDIRECTSOUNDBUFFER m_lpDSB[MAXSOUND]; - short m_channelBlupi[MAXBLUPI]; - UINT m_MidiDeviceID; - char m_MIDIFilename[50]; - int m_audioVolume; - int m_midiVolume; - int m_lastMidiVolume; - int m_nbSuspendSkip; -}; \ No newline at end of file diff --git a/text.cpp b/text.cpp deleted file mode 100644 index a08f9ab..0000000 --- a/text.cpp +++ /dev/null @@ -1,378 +0,0 @@ -// Text.cpp - -#include -#include -#include -#include -#include "def.h" -#include "pixmap.h" -#include "text.h" -#include "texttables.h" - -#pragma warning (disable: 4996) - -///////////////////////////////////////////////////////////////////////////// - - -// Retourne l'offset pour un caract�re donn�. - -int GetOffset(char c) -{ - int i; - - static unsigned char table_accents[15] = - { - 0xFC, 0xE0, 0xE2, 0xE9, 0xE8, 0xEB, 0xEA, 0xEF, - 0xEE, 0xF4, 0xF9, 0xFB, 0xE4, 0xF6, 0xE7 - }; - - for ( i=0 ; i<15 ; i++ ) - { - if ( (unsigned char)c == table_accents[i] ) - { - return 15+i; - } - } - if ( c<0 || c>128 ) return 1; // carr� - - return c; -} - -// Retourne la longueur d'un caract�re. - -int GetCharWidth(char c, int font) -{ - static unsigned char table_width[128] = - { - 9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,8, - 9,9,8,8,8,8,5,5,8,8,8,9,8,8,10,10, - 5,6,9,13,11,12,12,6,6,6,12,12,5,9,6,9, - 8,8,9,9,8,9,8,8,9,9,6,6,8,9,10,11, - 12,8,9,9,9,8,8,8,9,4,8,9,8,10,9,9, - 8,9,8,9,10,8,9,11,9,8,10,7,10,7,13,13, - 9,9,8,8,8,8,6,8,8,4,6,8,4,12,8,8, - 8,8,7,6,7,8,8,10,8,8,7,6,6,6,10,0, - }; - - static unsigned char table_width_little[128] = - { - 6,6,6,6,6,6,6,6,6,6,6,6,5,6,6,7, - 6,6,6,6,6,6,3,3,6,6,6,6,6,6,5,5, - 3,3,5,8,5,11,9,3,4,4,6,6,3,4,3,6, - 5,5,5,5,5,5,5,5,5,5,3,3,7,6,7,6, - 9,8,6,7,7,5,5,8,7,2,4,7,5,10,7,8, - 6,8,7,6,6,6,8,12,7,6,6,3,5,3,6,8, - 4,6,6,6,6,6,4,6,6,2,3,5,2,10,6,6, - 6,6,3,5,3,6,6,8,6,6,5,4,6,4,7,0, - }; - - if ( font == FONTLITTLE ) - { - return table_width_little[GetOffset(c)]; - } - else - { - return table_width[GetOffset(c)]-1; - } -} - -// Affiche un texte. - -void DrawTextB(CPixmap *pPixmap, POINT pos, char *pText, int font) -{ - int rank; - - if ( font == FONTLITTLE ) - { - while ( *pText != 0 ) - { - rank = GetOffset(*pText); - pPixmap->DrawIcon(-1, CHLITTLE, rank, pos); - - pos.x += GetCharWidth(*pText++, font); - } - } - else - { - while ( *pText != 0 ) - { - rank = GetOffset(*pText); - rank += 128*font; - pPixmap->DrawIcon(-1, CHTEXT, rank, pos); - - pos.x += GetCharWidth(*pText++, font); - } - } -} - -void DrawTextLeft(CPixmap* pPixmap, POINT pos, char *text, int font) -{ - DrawTextB(pPixmap, pos, text, font); - return; -} - - -//Implement later - -void DrawChar(CPixmap* pPixmap, POINT* pos, char c, int font) -{ - POINT pos1; - int width; - UINT index; - - index = (UINT)(BYTE)c; - -} - -void DrawCharSingle(CPixmap pPixmap, POINT pos, char* pText, int font) -{ - if (font == FONTLITTLE) - { - pPixmap.DrawIcon(-1, CHLITTLE, (int)pText, pos, 0, FALSE); - return; - } - pPixmap.DrawIcon(-1, CHTEXT, (int)(pText + font * 128), pos, 0, FALSE); - return; -} - -// Affiche un texte pench�. - -void DrawTextPente(CPixmap *pPixmap, POINT pos, char *pText, - int pente, int font) -{ - int rank, lg, rel, start; - - start = pos.y; - rel = 0; - while ( *pText != 0 ) - { - rank = GetOffset(*pText); - rank += 128*font; - pPixmap->DrawIcon(-1, CHTEXT, rank, pos); - - lg = GetCharWidth(*pText++, font); - rel += lg; - pos.x += lg; - pos.y = start + rel/pente; - } -} - -// Affiche un pav� de texte. -// Une ligne vide est affich�e avec un demi interligne ! -// Si part != -1, n'affiche que les lignes qui commencent -// par "n|", avec n=part. - -void DrawTextRect(CPixmap *pPixmap, POINT pos, char *pText, - int pente, int font, int part) -{ - char text[100]; - char* pDest; - int itl; - - if ( font == FONTLITTLE ) itl = DIMLITTLEY; - else itl = DIMTEXTY; - - while ( *pText != 0 ) - { - pDest = text; - while ( *pText != 0 && *pText != '\r' && *pText != '\n' ) - { - *pDest++ = *pText++; - } - *pDest = 0; - if ( *pText == '\r' ) pText ++; // saute '\r' - if ( *pText == '\n' ) pText ++; // saute '\n' - - pDest = text; - if ( text[0] != 0 && text[1] == '|' ) // commence par "n|" ? - { - if ( part != -1 && part != text[0]-'0' ) continue; - pDest += 2; // saute "n|" - } - else - { - if ( part != -1 ) continue; - } - - if ( pente == 0 ) - { - DrawTextB(pPixmap, pos, pDest, font); - } - else - { - DrawTextPente(pPixmap, pos, pDest, pente, font); - } - - if ( pDest[0] == 0 ) // ligne vide ? - { - pos.y += itl/2; // descend de 1/2 ligne - } - else - { - pos.y += itl; // passe � la ligne suivante - } - } -} - -// Affiche un texte centr� pouvant �ventuellement -// contenir plusieurs lignes s�par�es par des '\n'. - -void DrawTextCenter(CPixmap *pPixmap, POINT pos, char *pText, int font) -{ - char text[100]; - char* pDest; - int itl; - POINT start; - - if ( font == FONTLITTLE ) itl = DIMLITTLEY; - else itl = DIMTEXTY; - - while ( *pText != 0 ) - { - pDest = text; - while ( *pText != 0 && *pText != '\r' && *pText != '\n' ) - { - *pDest++ = *pText++; - } - *pDest = 0; - if ( *pText == '\r' ) pText ++; // saute '\r' - if ( *pText == '\n' ) pText ++; // saute '\n' - - pDest = text; - start.x = pos.x - GetTextWidth(pDest)/2; - start.y = pos.y; - DrawTextB(pPixmap, start, pDest, font); - - if ( pDest[0] == 0 ) // ligne vide ? - { - pos.y += itl/2; // descend de 1/2 ligne - } - else - { - pos.y += itl; // passe � la ligne suivante - } - } -} - -// Retourne la hauteur d'un texte. - -int GetTextHeight(char *pText, int font, int part) -{ - char text[100]; - char* pDest; - int itl; - int h=0; - - if ( font == FONTLITTLE ) itl = DIMLITTLEY; - else itl = DIMTEXTY; - - while ( *pText != 0 ) - { - pDest = text; - while ( *pText != 0 && *pText != '\r' && *pText != '\n' ) - { - *pDest++ = *pText++; - } - *pDest = 0; - if ( *pText == '\r' ) pText ++; // saute '\r' - if ( *pText == '\n' ) pText ++; // saute '\n' - - pDest = text; - if ( text[0] != 0 && text[1] == '|' ) // commence par "n|" ? - { - if ( part != -1 && part != text[0]-'0' ) continue; - pDest += 2; // saute "n|" - } - else - { - if ( part != -1 ) continue; - } - - if ( pDest[0] == 0 ) // ligne vide ? - { - h += itl/2; // descend de 1/2 ligne - } - else - { - h += itl; // passe � la ligne suivante - } - } - - return h; -} - -// Retourne la longueur d'un texte. - -int GetTextWidth(char *pText, int font) -{ - int width = 0; - - while ( *pText != 0 ) - { - width += GetCharWidth(*pText++, font); - } - - return width; -} - - -// Retourne la longueur d'un grand chiffre. - -void GetBignumInfo(int num, int &start, int &lg) -{ - static int table[11] = - { - 0,53,87,133,164,217,253,297,340,382,426 - }; - - start = table[num]; - lg = table[num+1]-table[num]; -} - -// Affiche un grand nombre. - -void DrawBignum(CPixmap *pPixmap, POINT pos, int num) -{ - char string[10]; - int i = 0; - int start, lg; - RECT rect; - - sprintf(string, "%d", num); - - rect.top = 0; - rect.bottom = 52; - while ( string[i] != 0 ) - { - GetBignumInfo(string[i]-'0', start, lg); - - rect.left = start; - rect.right = start+lg; - pPixmap->DrawPart(-1, CHBIGNUM, pos, rect); - pos.x += lg+4; - - i ++; - } -} - -// Retourne la longueur d'un grand nombre. - -int GetBignumWidth(int num) -{ - char string[10]; - int i = 0; - int start, lg; - int width = -4; - - sprintf(string, "%d", num); - - while ( string[i] != 0 ) - { - GetBignumInfo(string[i]-'0', start, lg); - width += lg+4; - i ++; - } - - return width; -} - diff --git a/text.h b/text.h deleted file mode 100644 index d7d329d..0000000 --- a/text.h +++ /dev/null @@ -1,61 +0,0 @@ -// Text.h - -#pragma once - -#define FONTWHITE 0 -#define FONTRED 1 -#define FONTSLIM 2 -#define FONTLITTLE 10 - -typedef struct -{ - char charIcon; - char charOffsetX; - char charOffsetY; - char accentIcon; - char accentOffsetX; - char accentOffsetY; -} -CharOffset; - -extern -void DrawTextB(CPixmap *pPixmap, POINT pos, char *pText, int font); - -extern -void DrawTextLeft(CPixmap* pPixmap, POINT pos, char *text, int font); - -extern -void DrawTextNew(CPixmap *pPixmap, POINT pos, char* pText, int font); - -extern -void DrawChar(CPixmap* pPixmap, POINT pos, char* pText, double size); - -extern -void DrawCharSingle(CPixmap* pPixmap, POINT pos, int rank, double size); - -extern -void DrawTextNew(CPixmap* pPixmap, POINT pos, char* pText, int font); - -extern -void DrawTextPente(CPixmap *pPixmap, POINT pos, char *pText, - int pente, int font=0); - -extern -void DrawTextRect(CPixmap *pPixmap, POINT pos, char *pText, - int pente, int font=0, int part=-1); - -extern -void DrawTextCenter(CPixmap *pPixmap, POINT pos, char *pText, int font=0); - -extern -int GetTextHeight(char *pText, int font=0, int part=-1); - -extern -int GetTextWidth(char *pText, int font=0); - -extern -void DrawBignum(CPixmap *pPixmap, POINT pos, int num); - -extern -int GetBignumWidth(int num); - diff --git a/texttables.h b/texttables.h deleted file mode 100644 index b55801b..0000000 --- a/texttables.h +++ /dev/null @@ -1,1673 +0,0 @@ -#pragma once -extern int table_width[] -{ - 32, - 32, - 32, - 32, - 32, - 32, - 32, - 32, - 32, - 32, - 32, - 32, - 32, - 32, - 14, - 13, - 15, - 15, - 15, - 15, - 15, - 15, - 11, - 12, - 14, - 13, - 13, - 15, - 15, - 14, - 0, - 0, - 9, - 5, - 10, - 25, - 17, - 22, - 18, - 5, - 9, - 9, - 14, - 13, - 6, - 10, - 6, - 14, - 18, - 10, - 14, - 14, - 17, - 16, - 16, - 17, - 15, - 16, - 5, - 6, - 9, - 12, - 10, - 14, - 25, - 18, - 16, - 17, - 18, - 16, - 16, - 19, - 20, - 15, - 15, - 15, - 14, - 24, - 22, - 22, - 15, - 24, - 16, - 18, - 15, - 19, - 18, - 29, - 20, - 18, - 19, - 8, - 13, - 8, - 12, - 20, - 7, - 15, - 15, - 13, - 15, - 15, - 13, - 14, - 14, - 6, - 8, - 14, - 6, - 21, - 16, - 14, - 14, - 13, - 12, - 14, - 11, - 13, - 13, - 19, - 16, - 15, - 14, - 10, - 5, - 11, - 16, - 0 -}; - - -extern char table_char[] - { - 0, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 2, - 0, - 0, - -1, - 0, - 0, - 3, - 0, - 0, - -1, - 0, - 0, - 4, - 0, - 0, - -1, - 0, - 0, - 5, - 0, - 0, - -1, - 0, - 0, - 6, - 0, - 0, - -1, - 0, - 0, - 7, - 0, - 0, - -1, - 0, - 0, - 8, - 0, - 0, - -1, - 0, - 0, - 9, - 0, - 0, - -1, - 0, - 0, - 10, - 0, - 0, - -1, - 0, - 0, - 11, - 0, - 0, - -1, - 0, - 0, - 12, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 14, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 32, - 0, - 0, - -1, - 0, - 0, - 33, - 0, - 0, - -1, - 0, - 0, - 34, - 0, - 0, - -1, - 0, - 0, - 35, - 0, - 0, - -1, - 0, - 0, - 36, - 0, - 0, - -1, - 0, - 0, - 37, - 0, - 0, - -1, - 0, - 0, - 38, - 0, - 0, - -1, - 0, - 0, - 39, - 0, - 0, - -1, - 0, - 0, - 40, - 0, - 0, - -1, - 0, - 0, - 41, - 0, - 0, - -1, - 0, - 0, - 42, - 0, - 0, - -1, - 0, - 0, - 43, - 0, - 0, - -1, - 0, - 0, - 44, - 0, - 0, - -1, - 0, - 0, - 45, - 0, - 0, - -1, - 0, - 0, - 46, - 0, - 0, - -1, - 0, - 0, - 47, - 0, - 0, - -1, - 0, - 0, - 48, - 0, - 0, - -1, - 0, - 0, - 49, - 0, - 0, - -1, - 0, - 0, - 50, - 0, - 0, - -1, - 0, - 0, - 51, - 0, - 0, - -1, - 0, - 0, - 52, - 0, - 0, - -1, - 0, - 0, - 53, - 0, - 0, - -1, - 0, - 0, - 54, - 0, - 0, - -1, - 0, - 0, - 55, - 0, - 0, - -1, - 0, - 0, - 56, - 0, - 0, - -1, - 0, - 0, - 57, - 0, - 0, - -1, - 0, - 0, - 58, - 0, - 0, - -1, - 0, - 0, - 59, - 0, - 0, - -1, - 0, - 0, - 60, - 0, - 0, - -1, - 0, - 0, - 61, - 0, - 0, - -1, - 0, - 0, - 62, - 0, - 0, - -1, - 0, - 0, - 63, - 0, - 0, - -1, - 0, - 0, - 64, - 0, - 0, - -1, - 0, - 0, - 65, - 0, - 0, - -1, - 0, - 0, - 66, - 0, - 0, - -1, - 0, - 0, - 67, - 0, - 0, - -1, - 0, - 0, - 68, - 0, - 0, - -1, - 0, - 0, - 69, - 0, - 0, - -1, - 0, - 0, - 70, - 0, - 0, - -1, - 0, - 0, - 71, - 0, - 0, - -1, - 0, - 0, - 72, - 0, - 0, - -1, - 0, - 0, - 73, - 0, - 0, - -1, - 0, - 0, - 74, - 0, - 0, - -1, - 0, - 0, - 75, - 0, - 0, - -1, - 0, - 0, - 76, - 0, - 0, - -1, - 0, - 0, - 77, - 0, - 0, - -1, - 0, - 0, - 78, - 0, - 0, - -1, - 0, - 0, - 79, - 0, - 0, - -1, - 0, - 0, - 80, - 0, - 0, - -1, - 0, - 0, - 81, - 0, - 0, - -1, - 0, - 0, - 82, - 0, - 0, - -1, - 0, - 0, - 83, - 0, - 0, - -1, - 0, - 0, - 84, - 0, - 0, - -1, - 0, - 0, - 85, - 0, - 0, - -1, - 0, - 0, - 86, - 0, - 0, - -1, - 0, - 0, - 87, - 0, - 0, - -1, - 0, - 0, - 88, - 0, - 0, - -1, - 0, - 0, - 89, - 0, - 0, - -1, - 0, - 0, - 90, - 0, - 0, - -1, - 0, - 0, - 91, - 0, - 0, - -1, - 0, - 0, - 92, - 0, - 0, - -1, - 0, - 0, - 93, - 0, - 0, - -1, - 0, - 0, - 94, - 0, - 0, - -1, - 0, - 0, - 95, - 0, - 0, - -1, - 0, - 0, - 96, - 0, - 0, - -1, - 0, - 0, - 97, - 0, - 0, - -1, - 0, - 0, - 98, - 0, - 0, - -1, - 0, - 0, - 99, - 0, - 0, - -1, - 0, - 0, - 100, - 0, - 0, - -1, - 0, - 0, - 101, - 0, - 0, - -1, - 0, - 0, - 102, - 0, - 0, - -1, - 0, - 0, - 103, - 0, - 0, - -1, - 0, - 0, - 104, - 0, - 0, - -1, - 0, - 0, - 105, - 0, - 0, - -1, - 0, - 0, - 106, - 0, - 0, - -1, - 0, - 0, - 107, - 0, - 0, - -1, - 0, - 0, - 108, - 0, - 0, - -1, - 0, - 0, - 109, - 0, - 0, - -1, - 0, - 0, - 110, - 0, - 0, - -1, - 0, - 0, - 111, - 0, - 0, - -1, - 0, - 0, - 112, - 0, - 0, - -1, - 0, - 0, - 113, - 0, - 0, - -1, - 0, - 0, - 114, - 0, - 0, - -1, - 0, - 0, - 115, - 0, - 0, - -1, - 0, - 0, - 116, - 0, - 0, - -1, - 0, - 0, - 117, - 0, - 0, - -1, - 0, - 0, - 118, - 0, - 0, - -1, - 0, - 0, - 119, - 0, - 0, - -1, - 0, - 0, - 120, - 0, - 0, - -1, - 0, - 0, - 121, - 0, - 0, - -1, - 0, - 0, - 122, - 0, - 0, - -1, - 0, - 0, - 123, - 0, - 0, - -1, - 0, - 0, - 124, - 0, - 0, - -1, - 0, - 0, - 125, - 0, - 0, - -1, - 0, - 0, - 126, - 0, - 0, - -1, - 0, - 0, - 127, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 5, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 4, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 16, - 0, - 0, - -1, - 0, - 0, - 97, - 0, - 0, - 2, - 2, - 0, - 17, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 27, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 29, - 0, - 0, - -1, - 0, - 0, - 19, - 0, - 0, - -1, - 0, - 0, - 18, - 0, - 0, - -1, - 0, - 0, - 21, - 0, - 0, - -1, - 0, - 0, - 20, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 105, - 0, - 0, - 2, - -1, - 0, - 23, - 0, - 0, - -1, - 0, - 0, - 22, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 110, - 0, - 0, - 126, - -1, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 111, - 0, - 0, - 2, - 1, - 0, - 24, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 28, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 25, - 0, - 0, - -1, - 0, - 0, - 117, - 0, - 0, - 2, - 2, - 0, - 26, - 0, - 0, - -1, - 0, - 0, - 15, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0, - 1, - 0, - 0, - -1, - 0, - 0 - }; diff --git a/wave.cpp b/wave.cpp deleted file mode 100644 index f11a909..0000000 --- a/wave.cpp +++ /dev/null @@ -1,270 +0,0 @@ - -/***************************************************************** - * - * Copyright (c) 1996 Microsoft Corporation - * - * File: wave.cpp - * Content: Routines for getting waves from resources - * Author: Dave Edson; modified by Peter Donnelly - * - ******************************************************************/ - -#include -#include "wave.h" - -typedef struct tagWAVEFILE - { - DWORD cbSize; // Size of file - LPWAVEFORMATEX pwfxInfo; // Wave Header - LPBYTE pbData; // Wave Bits - } -WAVEFILE, *LPWAVEFILE; - - -// Function Prototypes -BOOL wave_ParseWaveMemory(void *pvRes, - WAVEFORMATEX **ppWaveHeader, - BYTE **ppbWaveData, - DWORD *pcbWaveSize); - - -///////////////////////////////////////////////////////////////// -// -// WAVE_LoadResource: Gets a wave file into the memory pointed -// to by pWaveFile from a resource. -// -///////////////////////////////////////////////////////////////// - -LPVOID WAVE_LoadResource - (int ID, // ID of resource - HMODULE hModule, // hInst of app with WAVE - LPWAVEFILE pWaveFile) // Points to the struct to fill -{ - HRSRC hResInfo; - HGLOBAL hResData; - void *pvRes; - DWORD dwSize; - LPVOID lpMemory; - - // Find the resource and load into memory - if (((hResInfo = FindResourceA(hModule, MAKEINTRESOURCEA(ID), "WAVE")) != NULL) && - ((hResData = LoadResource(hModule, hResInfo)) != NULL) && - ((pvRes = LockResource(hResData)) != NULL)) - { - // If we found it, copy the bits from the resource into - // our own chunk of memory - dwSize = SizeofResource(hModule, hResInfo); - lpMemory = malloc (dwSize); - memcpy (lpMemory, pvRes, dwSize); - UnlockResource(hResData); - FreeResource(hResData); - - // Parse it out - if (wave_ParseWaveMemory(lpMemory, - &(pWaveFile->pwfxInfo), - &(pWaveFile->pbData), - &(pWaveFile->cbSize))) - { - return lpMemory; // OK - } - } - - return NULL; -} - -////////////////////////////////////////////////////////////////// -// -// wave_ParseWaveMemory -// Parses a chunk of memory into the header and samples. -// This is done by looking for the "fmt " and "data" -// fields in the memory. -// -////////////////////////////////////////////////////////////////// - -BOOL wave_ParseWaveMemory - - (LPVOID lpChunkOfMemory, // Points to raw ram - LPWAVEFORMATEX *lplpWaveHeader, // Points to pointer to header - LPBYTE *lplpWaveSamples,// Points to pointer to samples - LPDWORD lpcbWaveSize) // Points to size -{ - LPDWORD pdw; - LPDWORD pdwEnd; - DWORD dwRiff; - DWORD dwType; - DWORD dwLength; - - // Set defaults to NULL or zero - if (lplpWaveHeader) - *lplpWaveHeader = NULL; - - if (lplpWaveSamples) - *lplpWaveSamples = NULL; - - if (lpcbWaveSize) - *lpcbWaveSize = 0; - - // Set up DWORD pointers to the start of the chunk - // of memory. - pdw = (DWORD *)lpChunkOfMemory; - - // Get the type and length of the chunk of memory - dwRiff = *pdw++; - dwLength = *pdw++; - dwType = *pdw++; - - // Using the mmioFOURCC macro (part of Windows SDK), ensure - // that this is a RIFF WAVE chunk of memory - if (dwRiff != mmioFOURCC('R', 'I', 'F', 'F')) - return FALSE; // not even RIFF - - if (dwType != mmioFOURCC('W', 'A', 'V', 'E')) - return FALSE; // not a WAV - - // Find the pointer to the end of the chunk of memory - pdwEnd = (DWORD *)((BYTE *)pdw + dwLength-4); - - // Run through the bytes looking for the tags - while (pdw < pdwEnd) - { - dwType = *pdw++; - dwLength = *pdw++; - - switch (dwType) - { - // Found the format part - case mmioFOURCC('f', 'm', 't', ' '): - - if (lplpWaveHeader && !*lplpWaveHeader) - { - if (dwLength < sizeof(WAVEFORMAT)) - return FALSE; // something's wrong! Not a WAV - - // Set the lplpWaveHeader to point to this part of - // the memory chunk - *lplpWaveHeader = (LPWAVEFORMATEX)pdw; - - // Check to see if the other two items have been - // filled out yet (the bits and the size of the - // bits). If so, then this chunk of memory has - // been parsed out and we can exit - if ((!lplpWaveSamples || *lplpWaveSamples) && - (!lpcbWaveSize || *lpcbWaveSize)) - { - return TRUE; - } - } - break; - - // Found the samples - case mmioFOURCC('d', 'a', 't', 'a'): - - if ((lplpWaveSamples && !*lplpWaveSamples) || - (lpcbWaveSize && !*lpcbWaveSize)) - { - // Point the samples pointer to this part of the - // chunk of memory. - if (lplpWaveSamples) *lplpWaveSamples = (LPBYTE)pdw; - - // Set the size of the wave - if (lpcbWaveSize) *lpcbWaveSize = dwLength; - - // Make sure we have our header pointer set up. - // If we do, we can exit - if (!lplpWaveHeader || *lplpWaveHeader) - return TRUE; - } - break; - - } // End case - - // Move the pointer through the chunk of memory - pdw = (DWORD *)((BYTE *)pdw + ((dwLength+1)&~1)); - } - - // Failed! If we made it here, we did not get all the pieces - // of the wave - return FALSE; -} // wave_ParseWaveMemory - - -////////////////////////////////////////////////////////////////// -// -// LoadWave -// Gets the sound data and loads it into a DirectSound -// secondary buffer. -// -// -////////////////////////////////////////////////////////////////// - -void LoadWave(HINSTANCE hinst, int ResourceID, - LPDIRECTSOUND lpds, - LPDIRECTSOUNDBUFFER &lpDSB) - { -// These variables are used in Steps 1 and 2 - LPVOID lpWaveData; - WAVEFILE WaveFile; - DSBUFFERDESC dsbd; - - // These variables are used in step 3, further down below - LPVOID pbData = NULL; - LPVOID pbData2 = NULL; - DWORD dwLength; - DWORD dwLength2; - - - lpWaveData = WAVE_LoadResource (ResourceID, hinst, &WaveFile ); - - // Step 1: Set up the direct sound buffer. - memset(&dsbd, 0, sizeof(DSBUFFERDESC)); - - dsbd.dwSize = sizeof(DSBUFFERDESC); - // We want a buffer that lives on the sound card's memory - // (DSBCAPS_STATIC) and can have the pan, volume, and - // frequency adjusted (DSBCAPS_CTRLDEFAULT) - dsbd.dwFlags = DSBCAPS_CTRLFREQUENCY | DSBCAPS_CTRLPAN | DSBCAPS_CTRLVOLUME | DSBCAPS_STATIC ; - - // Set up the size and format - dsbd.dwBufferBytes = WaveFile.cbSize; - dsbd.lpwfxFormat = WaveFile.pwfxInfo; // Must be a PCM format! - - // Step 2: Create the buffer - if (DS_OK != lpds->CreateSoundBuffer(&dsbd, &lpDSB, NULL)) - { - OutputDebugStringA("Failed to create sound buffer\n"); - return; - } -// Once this code succeeds, lpDSB will point to a DirectSoundBuffer. -// At this point, you can copy blocks of sound data into the buffer, -// using the Lock and Unlock interfaces on the DirectSoundBuffer: - - // Lock down the DirectSound buffer - if (DS_OK == lpDSB->Lock - (0, // Offset into buffer to start writing - WaveFile.cbSize, // Size of wave file to copy in - &pbData, // Points to first block of sound data - &dwLength, // Length of first block of data - &pbData2, // Points to second block of sound data - &dwLength2, // Length of second block of data - 0L)) // Flags - { - // Copy first chunk - memcpy(pbData, WaveFile.pbData, dwLength); - - // Copy second chunk - if (dwLength2) - memcpy(pbData2, WaveFile.pbData+dwLength , dwLength2); - - // Free up the memory allocated in the WAVE_LoadFile function, since we - // have copied it to the buffer - free (lpWaveData); - - // Unlock the buffer - if (DS_OK != lpDSB->Unlock(pbData, dwLength, pbData2, dwLength2)) - OutputDebugStringA("Unlock failed"); - } - else - { - OutputDebugStringA("Lock failed"); - } - } // LoadWave diff --git a/wave.h b/wave.h deleted file mode 100644 index 1384aa9..0000000 --- a/wave.h +++ /dev/null @@ -1,14 +0,0 @@ -/*********************************************** - * Sound related stuff, I dunno -************************************************/ - - - - - - -#include - -void LoadWave(HINSTANCE hinst, int ResourceID, - LPDIRECTSOUND lpds, - LPDIRECTSOUNDBUFFER &lpDSB); \ No newline at end of file