From 7579449f98e62f8abaff66d99d437af85cf0fcac Mon Sep 17 00:00:00 2001 From: HMVocaloid <66088611+HMVocaloid@users.noreply.github.com> Date: Thu, 30 May 2024 21:58:09 -0400 Subject: [PATCH] Progress on CDecor Added some network code, among other changes. --- blupi.cpp | 526 +++++++++++- button.cpp | 18 +- button.h | 3 +- decblupi.cpp | 24 + decor.cpp | 15 + decor.h | 668 ++++++++++++++++ def.h | 618 +++++++++++++++ dplay.h | 2154 ++++++++++++++++++++++++++++++++++++++++++++++++++ event.cpp | 325 +++++++- event.h | 21 +- network.cpp | 54 ++ network.h | 19 + pixmap.cpp | 28 +- pixmap.h | 7 +- 14 files changed, 4436 insertions(+), 44 deletions(-) create mode 100644 decblupi.cpp create mode 100644 decor.h create mode 100644 def.h create mode 100644 dplay.h create mode 100644 network.cpp create mode 100644 network.h diff --git a/blupi.cpp b/blupi.cpp index d65ca4a..bd33870 100644 --- a/blupi.cpp +++ b/blupi.cpp @@ -35,11 +35,17 @@ 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 @@ -65,6 +71,7 @@ BOOL ReadConfig (LPSTR lpCmdLine) char buffer[200]; char* pText; int nb; + int i; file = fopen("data\\config.def", "rb"); if ( file == NULL ) return FALSE; @@ -151,5 +158,522 @@ BOOL ReadConfig (LPSTR lpCmdLine) 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 = 0; + if (i == 16) g_bTrueColor = 1; + g_bTrueColorDecor = g_bTrueColor; + } + + pText = strstr(buffer, "TrueColorBack="); + if ( pText != NULL ) + { + i = GetNum(pText+14); + if (i == 8) g_bTrueColor = 0; + + if (i == 16) g_bTrueColor = 1; + } + + pText = strstr(buffer, "TrueColorDecor="); + if ( pText != NULL ) + { + i = GetNum(pText + 15); + if (i == 8) g_bTrueColorDecor = 0; + + if (i == 16) g_bTrueColorDecor = 1; + } + return TRUE; -} \ No newline at end of file +} + +// Rewrite Variables + +void UpdateFrame(void) +{ + RECT clip, rcRect; + UINT phase; + POINT posMouse; + int i, term, speed; + + g_pPixmap->MouseBackClear(); // enl�ve la souris dans "back" + posMouse = g_pEvent->GetLastMousePos(); + + phase = g_pEvent->GetPhase(); + + if ( phase == g_lastPhase && + phase == WM_PHASE_PLAY || phase == WM_PHASE_PLAYTEST || phase == WM_PHASE_BUILD ) + { +//? rcRect.left = POSDRAWX; +//? rcRect.top = POSDRAWY; +//? rcRect.right = POSDRAWX+DIMDRAWX; +//? rcRect.bottom = POSDRAWY+DIMDRAWY; +//? g_pPixmap->DrawImage(-1, CHBACK, rcRect, 1); // dessine le fond + } + else + { + rcRect.left = 0; + rcRect.top = 0; + rcRect.right = LXIMAGE; + rcRect.bottom = LYIMAGE; + g_pPixmap->DrawImage(-1, CHBACK, rcRect, 1); // dessine le fond + } + + if ( phase == WM_PHASE_INTRO1 || + phase == WM_PHASE_INTRO2 ) + { + g_pEvent->IntroStep(); + } + + if ( phase == WM_PHASE_PLAY ) + { + clip.left = POSDRAWX; + clip.top = POSDRAWY+g_pDecor->GetInfoHeight(); + clip.right = POSDRAWX+DIMDRAWX; + clip.bottom = POSDRAWY+DIMDRAWY; + + if ( g_pEvent->IsShift() ) // shift en cours ? + { + g_pEvent->DecorAutoShift(posMouse); + g_pDecor->Build(clip, posMouse); // construit juste le d�cor + } + else + { + if ( !g_pEvent->GetPause() ) + { + speed = g_pEvent->GetSpeed() * g_speedRate; + for ( i=0 ; iBlupiStep(i==0); // avance tous les blupi + g_pDecor->MoveStep(i==0); // avance tous les d�cors + g_pEvent->DemoStep(); // avance enregistrement/reproduction + } + } + + g_pEvent->DecorAutoShift(posMouse); + g_pDecor->Build(clip, posMouse); // construit le d�cor + g_pDecor->NextPhase(1); // refait la carte de temps en temps + } + } + + if ( phase == WM_PHASE_BUILD ) + { + clip.left = POSDRAWX; + clip.top = POSDRAWY; + clip.right = POSDRAWX+DIMDRAWX; + clip.bottom = POSDRAWY+DIMDRAWY; + g_pEvent->DecorAutoShift(posMouse); + g_pDecor->Build(clip, posMouse); // construit le d�cor + g_pDecor->NextPhase(-1); // refait la carte chaque fois + } + + if ( phase == WM_PHASE_INIT ) + { + g_pEvent->DemoStep(); // d�marre �v. d�mo automatique + } + + g_pEvent->DrawButtons(); + + g_lastPhase = phase; + + if ( phase == WM_PHASE_H0MOVIE || + phase == WM_PHASE_H1MOVIE || + phase == WM_PHASE_H2MOVIE || + phase == WM_PHASE_PLAYMOVIE || + phase == WM_PHASE_WINMOVIE ) + { + g_pEvent->MovieToStart(); // fait d�marrer un film si n�cessaire + } + + if ( phase == WM_PHASE_INSERT ) + { + g_pEvent->TryInsert(); + } + + if ( phase == WM_PHASE_PLAY ) + { + term = g_pDecor->IsTerminated(); + if ( term == 1 ) g_pEvent->ChangePhase(WM_PHASE_LOST); // perdu + if ( term == 2 ) g_pEvent->ChangePhase(WM_PHASE_WINMOVIE); // gagn� + } + + g_pPixmap->MouseBackDraw(); // remet la souris dans "back" +} + +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 0 + if ( message != WM_TIMER ) + { + char s[100]; + sprintf(s, "message=%d,%d\n", message, wParam); + OutputDebug(s); + } +#endif + + 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_bActive ) + { + if ( g_bFullScreen ) + { + RestoreGame(); + g_lastPhase = 999; + } + if ( !g_bFullScreen && g_bTermInit ) + { + totalDim.x = 64; + totalDim.y = 66; + iconDim.x = 64; + iconDim.y = 66/2; + g_pPixmap->Cache(CHLITTLE, "image16\\little.blp", totalDim, iconDim, TRUE); + g_pPixmap->SetTransparent(CHLITTLE, RGB(0,0,255)); + + g_pPixmap->SavePalette(); + g_pPixmap->InitSysPalette(); + } + SetWindowText(hWnd, "Blupi"); + if ( g_pSound != NULL ) g_pSound->RestartMusic(); + } + else + { + if ( g_bFullScreen ) + { + FlushGame(); + } + SetWindowText(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); + +} + +BOOL InitFail(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, ")"); + MessageBox(g_hWnd, buffer, TITLE, MB_OK); + + FinishObjects(); + DestroyWindow(g_hWnd); + return FALSE; +} + +static BOOL DoInit(HINSTANCE hInstance, LPSTR lpCmdLine, int nCmdShow) +{ + WNDCLASS 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 = LoadIcon(hInstance, "IDR_MAINFRAME"); + wc.hCursor = LoadCursor(hInstance, "IDC_POINTER"); + wc.hbrBackground = GetStockBrush(BLACK_BRUSH); + wc.lpszMenuMane = NAME; + wc.lpszClassName = NAME; + RegisterClass(&wc); + + if ( g_bFullScreen ) + { + g_hWnd = CreateWindowEx + ( + 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 = CreateWindow + ( + 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); + + 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) ) + return InitFail("Create pixmap", TRUE); + + OutputDebug("Image: init\n"); + totalDim.x = LXIMAGE; + totalDim.y = LYIMAGE; + iconDim.x = 0; + iconDim.y = 0; +#if _INTRO + if ( !g_pPixmap->Cache(CHBACK, "image16\\init.blp", totalDim, iconDim, TRUE) ) +#else + if ( !g_pPixmap->Cache(CHBACK, "image16\\init.blp", totalDim, iconDim, TRUE) ) +#endif + return FALSE; + + OutputDebug("SavePalette\n"); + g_pPixmap->SavePalette(); + OutputDebug("InitSysPalette\n"); + g_pPixmap->InitSysPalette(); + + +} + +int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, + LPSTR lpCmdLine, int nCmdShow) +{ + MSG msg; + + if ( !DoInit(hInstance, lpCmdLine, nCmdShow) ) + { + return FALSE; + } + + SetTimer(g_hWnd, 1, g_timerInterval, NULL); + + while ( TRUE ) + { + if ( PeekMessage(&msg, NULL, 0,0, PM_NOREMOVE) ) + { + if ( !GetMessage(&msg, NULL, 0, 0) ) + { + return msg.wParam; + } + TranslateMessage(&msg); + DispatchMessage(&msg); + } + else + { + if ( !g_bActive ) WaitMessage(); + } + } + + return msg.wParam; +} diff --git a/button.cpp b/button.cpp index 0e475e5..99c1804 100644 --- a/button.cpp +++ b/button.cpp @@ -18,14 +18,15 @@ // Constructor -CButton:CButton() +CButton::CButton() { m_type = 0; m_bEnable = TRUE; m_bHide = FALSE; + m_bSomething = 0; m_state = 0; m_mouseState = 0; - m_mbMenu = 0; + m_nbMenu = 0; m_nbToolTips = 0; m_selMenu = 0; m_bMouseDown = FALSE; @@ -35,7 +36,7 @@ CButton:CButton() // Destructor -CButton:~CButton() +CButton::~CButton() { } @@ -68,9 +69,12 @@ BOOL CButton::Create(HWND hWnd, CPixmap *pPixmap, CSound *pSound, m_bMinimizeRedraw = bMinimizeRedraw; m_bEnable = TRUE; m_bHide = FALSE; + m_bSomething = 0; m_message = message; - m_pos = pos; - m_dim = iconDim; + m_pos.x = pos.x; + m_pos.y = pos.y; + m_dim.x = iconDim.x; + m_dim.y = iconDim.y; m_nbMenu = nbMenu; m_nbToolTips = nbToolTips; m_selMenu = 0; @@ -144,7 +148,7 @@ void CButton::Draw() if( m_bEnable ) { - m_pPixmap->DrawIcon(-1, CHBUTTON+m_type, m_mousestatre, m_pos); + m_pPixmap->DrawIcon(-1, CHBUTTON+m_type, m_mousestate, m_pos); } else { @@ -257,7 +261,7 @@ BOOL CButton::TreatEvent(UINT message, WPARAM wParam, LPARAM lParam) switch( message ) { case WM_LBUTTONDOWN: - case WM_RBUTTONDOWN; + case WM_RBUTTONDOWN: if ( MouseDown(pos) ) return TRUE; break; diff --git a/button.h b/button.h index b994e8e..6caa468 100644 --- a/button.h +++ b/button.h @@ -54,7 +54,8 @@ protected: 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; // sous-menu s�lectionn� + int m_selMenu; + int m_bSomething; // sous-menu s�lectionn� BOOL m_bMouseDown; // TRUE -> bouton souris press� BOOL m_bMinimizeRedraw; BOOL m_bRedraw; // TRUE -> doit �tre redessin� diff --git a/decblupi.cpp b/decblupi.cpp new file mode 100644 index 0000000..c08cc82 --- /dev/null +++ b/decblupi.cpp @@ -0,0 +1,24 @@ +// DecBlupi.cpp +// + +#include "DEF.H" +#include "DECOR.H" +#include "ACTION.H" +#include "MISC.H" +#include "RESOURCE.H" +#include "decgoal.h" + +void CDecor::BlupiCheat(int cheat) +{ + +} + +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/decor.cpp b/decor.cpp index a7ef3ea..ce7ff78 100644 --- a/decor.cpp +++ b/decor.cpp @@ -56,4 +56,19 @@ CDecor::CDecor() CDecor::~CDecor() { UndoClose(); +} + +void CDecor::SetTime(int time) +{ + m_time = time; +} + +int CDecor::GetTime() +{ + return m_time; +} + +int CDecor::GetTargetLevel(int mission) +{ + m_targetMission = mission; } \ No newline at end of file diff --git a/decor.h b/decor.h new file mode 100644 index 0000000..7daa38e --- /dev/null +++ b/decor.h @@ -0,0 +1,668 @@ +// Decor.h + +#pragma once + +#include + +#include "DEF.H" +#include "SOUND.H" +#include "PIXMAP.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 + +// 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; +} +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; // personnage, voir (*) + + 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 + + +// 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; + + +#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(BOOL bFirst); + 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 rank, BOOL bUser, int world, int time, int total); + BOOL Read(int rank, BOOL bUser, int &world, int &time, int &total); + 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); + void Init(int channel, int icon); + void InitAfterBuild(); + void ResetHili(); + BOOL LoadImages(); + 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(); + + 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(); + + +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; + Object m_objects[100][100]; + Explo m_explos[100][100]; + Perso m_persos[200]; + int m_input; + int m_previousInput; + POINT m_cameraPos; + POINT m_worldDims; + POINT m_selectedCelPos; + WMessage m_phrase; + int m_targetMission; + int m_missionTitle; + int m_nbCases; + int m_caseIndexes[200]; + int m_nbSomethings; + int m_somethingIndexes; + POINT m_pos; + POINT m_safePos; + Action m_action; + int m_direction; + int m_actionFrameCount; + POINT m_velocity; + Icon4 m_blupiIcon; + /* + undefined + undefined + undefined + undefined + */ + IconChannel m_blupiChannel; + POINT m_activeConveyorVelocity; + int m_activeLiftIndex; + BOOL m_bPlayerHasControl; + BOOL m_bIsFalling; + BOOL m_bHelicopter; + BOOL m_bHovercraft; + BOOL m_bJeep; + BOOL m_bTank; + BOOL m_bSkateboard; + BOOL m_bInDeepWater; + BOOL m_bInSurfaceWater; + BOOL m_bInWind; + BOOL m_bIsHangingFromBar; + BOOL m_bHeadache; + BOOL m_bShield; + BOOL m_bLollipop; + BOOL m_bPowercharge; + BOOL m_bInvisible; + BOOL m_bInverter; + BOOL m_bWaspSting; + BOOL m_bCrushed; + BOOL m_bUseSafePosition; + BOOL m_bIsTerminating; + int m_glue; + int m_keys; + int m_personalBombs; + int m_dynamite; + int m_powerEnergy; + int m_queuedActionFrames; + Action m_queuedAction; + 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; + SoundEvent m_soundEvents[20]; + int m_soundEventIndex1; + 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_AllMissions; // 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 + 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; + int m_menuSelections[112]; + BYTE m_overloadProtection[100000]; + Cellule* m_pUndoDecor; + Cellule m_decor[MAXCELX/2][MAXCELY/2]; + 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_bInvincible; // TRUE -> cheat code + 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 + int m_phase; // phase pour la carte + 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 + Term 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 GetTargetLevel(int mission); + BOOL GetShowSecret(); + 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/def.h b/def.h new file mode 100644 index 0000000..8cc7f56 --- /dev/null +++ b/def.h @@ -0,0 +1,618 @@ +// 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 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 2 +#define CHOBJECTo 3 +#define CHBLUPI 4 +#define CHHILI 5 +#define CHFOG 6 +#define CHMASK1 7 +#define CHLITTLE 8 +#define CHMAP 9 +#define CHBUTTON 10 +#define CHGROUND 11 +#define CHJAUGE 12 +#define CHTEXT 13 +#define CHBIGNUM 14 + +#define FOGHIDE 4 + + +// 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 0 // arr�t +#define ACTION_STOPf 1 // arr�t fatigu� +#define ACTION_MARCHE 2 // marche +#define ACTION_MARCHEf 3 // marche fatigu� +#define ACTION_BUILD 4 // construit +#define ACTION_PIOCHE 5 // pioche +#define ACTION_ENERGY 6 // prend de l'�nergie +#define ACTION_TAKE 8 // fait sauter un objet sur la t�te (est) +#define ACTION_DEPOSE 9 // repose l'objet sur la t�te (est) +#define ACTION_SCIE 10 // scie du bois +#define ACTION_BRULE 11 // blupi crame ! +#define ACTION_TCHAO 12 // blupi disparait ! +#define ACTION_MANGE 13 // blupi mange +#define ACTION_NAISSANCE 14 // naissance +#define ACTION_SAUTE2 15 // saute par-dessus un obstacle +#define ACTION_SAUTE3 16 // saute par-dessus un obstacle +#define ACTION_SAUTE4 17 // saute par-dessus un obstacle +#define ACTION_SAUTE5 18 // saute par-dessus un obstacle +#define ACTION_PONT 19 // pousse un pont +#define ACTION_MISC1 20 // divers 1 (hausse les �paules) +#define ACTION_MISC2 21 // divers 2 (grat-grat) +#define ACTION_MISC3 22 // divers 3 (yoyo) +#define ACTION_MISC1f 23 // divers 1 fatigu� (bof-bof) +#define ACTION_GLISSE 24 // glisse en marchant +#define ACTION_BOIT 25 // blupi boit +#define ACTION_LABO 26 // blupi travaille dans son laboratoire +#define ACTION_DYNAMITE 27 // blupi fait p�ter la dynamite +#define ACTION_DELAY 28 // blupi attend un frame +#define ACTION_CUEILLE1 29 // blupi cueille des fleurs +#define ACTION_CUEILLE2 30 // blupi cueille des fleurs +#define ACTION_MECHE 31 // blupi se bouche les oreilles +#define ACTION_STOPb 32 // arr�t en bateau +#define ACTION_MARCHEb 33 // avance en bateau +#define ACTION_STOPj 34 // arr�t en jeep +#define ACTION_MARCHEj 35 // avance en jeep +#define ACTION_ELECTRO 36 // blupi �lectrocut� +#define ACTION_GRILLE1 37 // blupi grille (phase 1) +#define ACTION_GRILLE2 38 // blupi grille (phase 2) +#define ACTION_GRILLE3 39 // blupi grille (phase 3) +#define ACTION_MISC4 40 // divers 4 (ferme les yeux) +#define ACTION_CONTENT 41 // blupi est content +#define ACTION_ARROSE 42 // blupi arrose +#define ACTION_BECHE 43 // blupi b�che +#define ACTION_CUEILLE3 44 // blupi cueille des fleurs +#define ACTION_BUILDBREF 45 // construit +#define ACTION_BUILDSEC 46 // construit +#define ACTION_BUILDSOURD 47 // construit +#define ACTION_BUILDPIERRE 48 // construit +#define ACTION_PIOCHEPIERRE 49 // pioche +#define ACTION_PIOCHESOURD 50 // pioche +#define ACTION_MISC5 51 // divers 5 (oh�) +#define ACTION_TELEPORTE1 52 // t�l�porte +#define ACTION_TELEPORTE2 53 // t�l�porte +#define ACTION_TELEPORTE3 54 // t�l�porte +#define ACTION_STOPa 55 // arr�t armure +#define ACTION_MARCHEa 56 // marche armure +#define ACTION_ARMUREOPEN 57 // ouvre armure +#define ACTION_ARMURECLOSE 58 // ferme armure +#define ACTION_SAUTE1 59 // saute dans la jeep +#define ACTION_MISC6 60 // divers 6 (diabolo) + +#define ACTION_A_STOP 100 // araign�e: arr�t +#define ACTION_A_MARCHE 101 // araign�e: marche +#define ACTION_A_SAUT 102 // araign�e: saute +#define ACTION_A_GRILLE 103 // araign�e: grille dans rayon +#define ACTION_A_POISON 105 // araign�e: empoison�e +#define ACTION_A_MORT1 106 // araign�e: meurt +#define ACTION_A_MORT2 107 // araign�e: meurt +#define ACTION_A_MORT3 108 // araign�e: meurt + +#define ACTION_V_STOP 200 // virus: arr�t +#define ACTION_V_MARCHE 201 // virus: marche +#define ACTION_V_GRILLE 202 // virus: grille dans rayon + +#define ACTION_T_STOP 300 // tracks: arr�t +#define ACTION_T_MARCHE 301 // tracks: marche +#define ACTION_T_ECRASE 302 // tracks: �crase un objet + +#define ACTION_R_STOP 400 // robot: arr�t +#define ACTION_R_MARCHE 401 // robot: marche +#define ACTION_R_APLAT 402 // robot: applatit +#define ACTION_R_BUILD 403 // robot: construit +#define ACTION_R_DELAY 404 // robot: construit +#define ACTION_R_CHARGE 405 // robot: recharge +#define ACTION_R_ECRASE 406 // robot: �crase un objet + +#define ACTION_B_STOP 500 // bombe: arr�t +#define ACTION_B_MARCHE 501 // bombe: marche + +#define ACTION_D_DELAY 600 // d�tonnateur: attend + +#define ACTION_E_STOP 700 // �lectro: arr�t +#define ACTION_E_MARCHE 701 // �lectro: marche +#define ACTION_E_DEBUT 702 // �lectro: d�bute +#define ACTION_E_RAYON 703 // �lectro: rayonne + +#define ACTION_D_STOP 800 // disciple: arr�t +#define ACTION_D_MARCHE 801 // disciple: marche +#define ACTION_D_BUILD 802 // disciple: construit +#define ACTION_D_PIOCHE 803 // disciple: pioche +#define ACTION_D_SCIE 804 // disciple: scie du bois +#define ACTION_D_TCHAO 805 // disciple: disparait ! +#define ACTION_D_CUEILLE1 806 // disciple: cueille des fleurs +#define ACTION_D_CUEILLE2 807 // disciple: cueille des fleurs +#define ACTION_D_MECHE 808 // disciple: se bouche les oreilles +#define ACTION_D_ARROSE 809 // disciple: arrose +#define ACTION_D_BECHE 810 // disciple: b�che + + +// Sons : + +#define SOUND_CLICK 0 +#define SOUND_BOING 1 +#define SOUND_OK1 2 +#define SOUND_OK2 3 +#define SOUND_OK3 4 +#define SOUND_GO1 5 +#define SOUND_GO2 6 +#define SOUND_GO3 7 +#define SOUND_TERM1 8 +#define SOUND_TERM2 9 +#define SOUND_TERM3 10 +#define SOUND_COUPTERRE 11 +#define SOUND_COUPTOC 12 +#define SOUND_SAUT 13 +#define SOUND_HOP 14 +#define SOUND_SCIE 15 +#define SOUND_FEU 16 +#define SOUND_BRULE 17 +#define SOUND_TCHAO 18 +#define SOUND_MANGE 19 +#define SOUND_NAISSANCE 20 +#define SOUND_A_SAUT 21 +#define SOUND_A_HIHI 22 +#define SOUND_PLOUF 23 +#define SOUND_BUT 24 +#define SOUND_RAYON1 25 +#define SOUND_RAYON2 26 +#define SOUND_VIRUS 27 +#define SOUND_GLISSE 28 +#define SOUND_BOIT 29 +#define SOUND_LABO 30 +#define SOUND_DYNAMITE 31 +#define SOUND_PORTE 32 +#define SOUND_FLEUR 33 +#define SOUND_T_MOTEUR 34 +#define SOUND_T_ECRASE 35 +#define SOUND_PIEGE 36 +#define SOUND_AIE 37 +#define SOUND_A_POISON 38 +#define SOUND_R_MOTEUR 39 +#define SOUND_R_APLAT 40 +#define SOUND_R_ROTATE 41 +#define SOUND_R_CHARGE 42 +#define SOUND_B_SAUT 43 +#define SOUND_BATEAU 44 +#define SOUND_JEEP 45 +#define SOUND_MINE 46 +#define SOUND_USINE 47 +#define SOUND_E_RAYON 48 +#define SOUND_E_TOURNE 49 +#define SOUND_ARROSE 50 +#define SOUND_BECHE 51 +#define SOUND_D_BOING 52 +#define SOUND_D_OK 53 +#define SOUND_D_GO 54 +#define SOUND_D_TERM 55 +#define SOUND_BOING1 56 +#define SOUND_BOING2 57 +#define SOUND_BOING3 58 +#define SOUND_OK4 59 +#define SOUND_OK5 60 +#define SOUND_OK6 61 +#define SOUND_OK1f 62 +#define SOUND_OK2f 63 +#define SOUND_OK3f 64 +#define SOUND_OK1e 65 +#define SOUND_OK2e 66 +#define SOUND_OK3e 67 +#define SOUND_GO4 68 +#define SOUND_GO5 69 +#define SOUND_GO6 70 +#define SOUND_TERM4 71 +#define SOUND_TERM5 72 +#define SOUND_TERM6 73 +#define SOUND_COUPSEC 74 +#define SOUND_COUPPIERRE 75 +#define SOUND_COUPSOURD 76 +#define SOUND_COUPBREF 77 +#define SOUND_OPEN 78 +#define SOUND_CLOSE 79 +#define SOUND_TELEPORTE 80 +#define SOUND_ARMUREOPEN 81 +#define SOUND_ARMURECLOSE 82 +#define SOUND_WIN 83 +#define SOUND_LOST 84 +#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 + + +// 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_ACTION_GO (WM_USER+30) +#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_STOP (WM_USER+510) +#define WM_PHASE_SETUP (WM_USER+511) +#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 (WM_USER+524) +#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 (WM_USER+535) +#define WM_PHASE_INTRO1 (WM_USER+536) +#define WM_PHASE_INTRO2 (WM_USER+537) +#define WM_PHASE_PLAYTEST (WM_USER+538) + +#define WM_PREV (WM_USER+600) +#define WM_NEXT (WM_USER+601) +#define WM_MOVIE (WM_USER+602) + + + +// 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 new file mode 100644 index 0000000..d91c0a5 --- /dev/null +++ b/dplay.h @@ -0,0 +1,2154 @@ +/*==========================================================================; + * + * 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/event.cpp b/event.cpp index 5c65c67..1f9d125 100644 --- a/event.cpp +++ b/event.cpp @@ -18,6 +18,7 @@ #include "action.h" #include "text.h" #include "misc.h" +#include "network.h" #define DEF_TIME_HELP 10000 @@ -50,17 +51,33 @@ DescInfo; // Toutes les premi�res lettres doivent // �tre diff�rentes ! -static char cheat_code[9][20] = +static char cheat_code[25][60] = { - "VISION", // 0 - "POWER", // 1 - "LONESOME", // 2 - "ALLMISSIONS", // 3 - "QUICK", // 4 - "HELPME", // 5 - "INVINCIBLE", // 6 - "SUPERBLUPI", // 7 - "CONSTRUIRE", // 8 (CPOTUSVJSF) + "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", }; @@ -72,7 +89,7 @@ static Phase table[] = { { WM_PHASE_TESTCD, - "image\\init.blp", + "image16\\init.blp", FALSE, { { @@ -94,7 +111,7 @@ static Phase table[] = { WM_PHASE_INTRO2, - "image\\intro2.blp", + "image16\\intro2.blp", FALSE, { { @@ -105,7 +122,7 @@ static Phase table[] = { WM_PHASE_INIT, - "image\\init.blp", + "image16\\init.blp", FALSE, { { @@ -195,7 +212,7 @@ static Phase table[] = { WM_PHASE_INFO, - "image\\info%.3d.blp", + "image16\\info%.3d.blp", FALSE, { { @@ -291,7 +308,7 @@ static Phase table[] = { WM_PHASE_STOP, - "image\\stop%.3d.blp", + "image16\\stop%.3d.blp", FALSE, { { @@ -340,7 +357,7 @@ static Phase table[] = { WM_PHASE_HELP, - "image\\help.blp", + "image16\\help.blp", TRUE, { { @@ -381,7 +398,7 @@ static Phase table[] = { WM_PHASE_SETUP, - "image\\setup.blp", + "image16\\setup.blp", FALSE, { { @@ -460,7 +477,7 @@ static Phase table[] = { WM_PHASE_SETUPp, - "image\\setup.blp", + "image16\\setup.blp", FALSE, { { @@ -539,7 +556,7 @@ static Phase table[] = { WM_PHASE_READ, - "image\\read.blp", + "image16\\read.blp", FALSE, { { @@ -616,7 +633,7 @@ static Phase table[] = { WM_PHASE_WRITE, - "image\\write.blp", + "image16\\write.blp", FALSE, { { @@ -693,7 +710,7 @@ static Phase table[] = { WM_PHASE_WRITEp, - "image\\write.blp", + "image16\\write.blp", FALSE, { { @@ -770,7 +787,7 @@ static Phase table[] = { WM_PHASE_LOST, - "image\\lost.blp", + "image16\\lost.blp", TRUE, { { @@ -787,7 +804,7 @@ static Phase table[] = { WM_PHASE_WIN, - "image\\win.blp", + "image16\\win.blp", TRUE, { { @@ -906,7 +923,7 @@ static Phase table[] = { WM_PHASE_BUTTON, - "image\\button.blp", + "image16\\button00.blp", TRUE, { { @@ -1222,7 +1239,7 @@ static Phase table[] = { WM_PHASE_MUSIC, - "image\\music.blp", + "image16\\music.blp", TRUE, { { @@ -1299,7 +1316,7 @@ static Phase table[] = { WM_PHASE_REGION, - "image\\region.blp", + "image16\\region.blp", TRUE, { { @@ -1395,7 +1412,7 @@ static Phase table[] = { WM_PHASE_BYE, - "image\\bye.blp", + "image16\\bye.blp", FALSE, { { @@ -1529,16 +1546,17 @@ void CEvent::SetMouseType(int mouseType) // Creates the event handler. -void CEvent::Create(HWND hWnd, CPixmap *pPixmap, CDecor *pDecor, +void CEvent::Create(HINSTANCE hInstance, HWND hWnd, CPixmap *pPixmap, CDecor *pDecor, CSound *pSound, CMovie *pMovie, CNetwork *pNetwork) { POINT pos; m_hWnd = hWnd; - m_pPixmap = pPixmapl + m_pPixmap = pPixmap; m_pDecor = pDecor; m_pSound = pSound; m_pMovie = pMovie; + m_pNetwork = pNetwork; ReadInfo(); } @@ -1574,7 +1592,7 @@ int CEvent::GetState(int button) void CEvent::SetState(int button, int state) { - ind index; + int index; index = GetButtonIndex(button); if ( index < 0 ) return; @@ -1611,3 +1629,250 @@ int CEvent::GetMenu(int button) 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); +} + + +/* +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::DrawButtons() +{ + int i; + int levels[2]; + int types[2]; + int world, time, lg, button, volume, pente, icon; + char res[100]; + char text[100]; + POINT pos; + RECT rect; + BOOL bEnable; + + if ( (m_phase == WM_PHASE_INSERT && m_phase == WM_PHASE_BYE )) + { + m_bChangeCheat = FALSE; + + text[0] = 0; + 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]); + } + } +} + +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_WAIT; + } + else + { + m_mouseSprite = MousePosToSprite(GetMousePos()); + } + m_pPixmap->SetMouseSprite(m_mouseSprite, m_bDemoPlay); + ChangeSprite(m_mouseSprite); +} + +/* +void CEvent::SomethingDecor() +{ + m_input = 0; + m_pDecor->TreatEvent(); +} +*/ + +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::GetWorld() +{ + 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; +} + +UINT CDecor::GetPhase() +{ + return m_phase; +} + +void CEvent::TryInsert() +{ + if ( m_tryInsertCount == 0 ) + { + ChangePhase(m_tryPhase); + } + else + { + m_tryInsertCount --; + } +} + +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; +} + +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 ) + { + DeleteFile("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_pDemoBufferm sizeof(DemoEvent), m_demoIndex, file); + fclose(file); + } + free(m_pDemoBuffer); + m_pDemoBuffer = NULL; + } + + m_bDemoRec = FALSE; + m_demoTime = 0; +} \ No newline at end of file diff --git a/event.h b/event.h index 8e7c421..0c56f8a 100644 --- a/event.h +++ b/event.h @@ -53,7 +53,7 @@ public: ~CEvent(); POINT GetMousePos(); - void Create(HWND hWnd, CPixmap *pPixmap, CDecor *pDecor, CSound *pSound, CMovie *pMovie); + 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(); @@ -142,11 +142,12 @@ protected: int m_mission; int m_private; int m_maxMission; - int m_phase; + WMessage m_phase; int m_index; BOOL m_bSchool; BOOL m_bPrivate; - BOOL m_bAccesBuild; + BOOL m_bMulti; + BOOL m_bAccessBuild; BOOL m_bFullScreen; int m_mouseType; HWND m_hWnd; @@ -154,6 +155,7 @@ protected: CDecor* m_pDecor; CSound* m_pSound; CMovie* m_pMovie; + CNetwork* m_pNetwork; char m_movieToStart[MAX_PATH]; int m_phaseAfterMovie; CButton m_buttons[MAXBUTTON]; @@ -217,4 +219,17 @@ protected: BOOL m_bCtrlDown; POINT m_debugPos; int m_introTime; + int m_joyID; + BOOL m_gamer; + int m_textHiliStart; + int m_textHiliEnd; + int m_textCursorIndex; + char m_textInput[100]; + char m_pPlayerName[100]; + int m_lives; + int m_mission; + int m_multi; + HINSTANCE m_hInstance; + char m_chatZone[100][5]; + char m_text[100]; }; \ No newline at end of file diff --git a/network.cpp b/network.cpp new file mode 100644 index 0000000..26e24ca --- /dev/null +++ b/network.cpp @@ -0,0 +1,54 @@ +// Network.cpp +// + +#include "dplay.h" +#include +#include "decor.h" +#include "event.h" +#include +#include +#include "misc.h" +#include "network.h" + +CNetwork::CNetwork() +{ + m_field0_0x0; + m_field8_0x20; + m_field7_0x1c; + m_pUnkC; + m_pSessions; + m_field3_0xc; + m_field4_0x10; + m_field5_0x14; + m_field6_0x18; +} + +void TraceErrorDP(HRESULT hErr, char *sFile, int nLine) +{ + 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_CAPSNOTAVAILABLEYET : sprintf(dperr, "DPERR_CAPTSNOTAVAILABLEYET"); break; + case DPERR_ALREADYINITIALIZED : sprintf(dperr, "DPERR_ALREADYINITIALIZED"); break; + case DPERR_NOAGGREGATION : sprintf(dperr, "DPERR_NOAGGREGATION"); break; + case DPERR_BUFFERTOOSMALL : sprintf(dperr, "DPERR_BUFFERTOOSMALL"); break; + case DPERR_OTHERAPPHASPRIO : sprintf(dperr, "DPERR_OTHERAPPHASPRIO"); break; + case DPERR_UNINITIALIZED : sprintf(dperr, "DPERR_UNINITIALIZED"); break; + + default : sprintf(dperr, "Unknown Error"); break; + } + sprintf(err, "DirectPlay Error %s in file %s at line %d\n", dperr, sFile, nLine); + OutputDebug(err); +} \ No newline at end of file diff --git a/network.h b/network.h new file mode 100644 index 0000000..e4f35d4 --- /dev/null +++ b/network.h @@ -0,0 +1,19 @@ +class CNetwork +{ +public: + CNetwork(); + ~CNetwork(); + + BOOL Create(); +protected: + int m_field0_0x0; + int m_field8_0x20; + int m_field7_0x1c; + int m_pUnkC; + void m_pSessions; + int m_field3_0xc; + void m_field4_0x10; + int m_field5_0x14; + int m_field6_0x18; + NetPlayer m_players[4]; +}; \ No newline at end of file diff --git a/pixmap.cpp b/pixmap.cpp index ed20619..d95dfe3 100644 --- a/pixmap.cpp +++ b/pixmap.cpp @@ -22,6 +22,9 @@ 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; @@ -294,6 +297,26 @@ BOOL CPixmap::InitSysPalette() 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; +} + // Indique si l'on utilise une palette. BOOL CPixmap::IsPalette() @@ -693,7 +716,10 @@ void CPixmap::SetTransparent2(int channel, COLORREF color1, COLORREF color2) void CPixmap::SetClipping(RECT clip) { - m_clipRect = 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. diff --git a/pixmap.h b/pixmap.h index 32816f6..42209bf 100644 --- a/pixmap.h +++ b/pixmap.h @@ -70,6 +70,11 @@ protected: void MouseBackDebug(); RECT MouseRectSprite(); void MouseHotSpot(); + BOOL GetTrueColor(); + + void SetBenchmarkSuccess(BOOL bSuccess); + void SetTrueColor(BOOL bTrueColor); + void SetTrueColorDecor(BOOL bTrueColorDecor); protected: BOOL m_bFullScreen; @@ -107,5 +112,5 @@ protected: char m_filename[MAXIMAGE][20]; POINT m_totalDim[MAXIMAGE]; POINT m_iconDim[MAXIMAGE]; - DDBLTFX m_DDbltfx + DDBLTFX m_DDbltfx } \ No newline at end of file