1
0
mirror of https://github.com/jummy0/sb2-decomp synced 2025-03-15 04:24:48 +01:00
This commit is contained in:
jummy 2024-06-12 22:36:20 -05:00
parent d8ac097b85
commit 45df02106d
13 changed files with 1549 additions and 1744 deletions

1
.gitignore vendored
View File

@ -3,3 +3,4 @@
################################################################################
/.vs
planetblupi.*

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
@ -42,7 +42,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<PlatformToolset>v141_xp</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
@ -104,10 +104,14 @@
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>
</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>
</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
@ -127,7 +131,6 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="action.h" />
<ClInclude Include="button.h" />
<ClInclude Include="ddraw.h" />
<ClInclude Include="ddutil.h" />
@ -136,7 +139,6 @@
<ClInclude Include="dplay.h" />
<ClInclude Include="dsound.h" />
<ClInclude Include="event.h" />
<ClInclude Include="fifo.h" />
<ClInclude Include="decmove.h" />
<ClInclude Include="jauge.h" />
<ClInclude Include="menu.h" />

10
_fixup.h Normal file
View File

@ -0,0 +1,10 @@
#pragma once
/* To maintain compatibility with the modern Win32 API, some overlapping
* function names need to be cleared up. This file is fabricated,
* and not present in the original Speedy Blupi source code.
*/
#ifdef GetObjectA
#undef GetObject
#endif

243
blupi.cpp
View File

@ -25,19 +25,22 @@
// Define Globals
#define NAME "Blupi"
#define TITLE "Eggbert"
#ifdef _EGAMES
#define TITLE "Eggbert"
#else
#define TITLE "Blupi"
#endif
// Variables Globals
HWND g_hWnd; // handle <EFBFBD> la fen<65>tre
HWND g_hWnd; // handle à la fenêtre
CEvent* g_pEvent = NULL;
CPixmap* g_pPixmap = NULL; // pixmap principal
CSound* g_pSound = NULL; // sound principal
CMovie* g_pMovie = NULL; // movie principal
CDecor* g_pDecor = NULL;
CNetwork* g_pNetwork;
char g_CDPath[MAX_PATH]; // chemin d'acc<EFBFBD>s au CD-Rom
char g_CDPath[MAX_PATH]; // chemin d'accs au CD-Rom
BOOL g_bFullScreen = FALSE; // FALSE si mode de test
int g_speedRate = 1;
int g_timerInterval = 50; // inverval = 50ms
@ -47,7 +50,7 @@ BOOL g_bBenchmarkSuccess;
BOOL g_bTrueColor;
BOOL g_bTrueColorBack;
BOOL g_bTrueColorDecor;
MMRESULT g_updateTimer; // timer g<EFBFBD>n<EFBFBD>ral
MMRESULT g_updateTimer; // timer général
BOOL g_bActive = TRUE; // is application active ?
BOOL g_bTermInit = FALSE; // initialisation en cours
int g_objectMax;
@ -57,6 +60,9 @@ int g_exploMax;
UINT g_lastPhase = 999;
// Lit un numéro décimal.
int GetNum(char *p)
{
int n = 0;
@ -70,6 +76,8 @@ int GetNum(char *p)
return n;
}
// Lit le fichier de configuration.
BOOL ReadConfig (LPSTR lpCmdLine)
{
FILE* file = NULL;
@ -80,7 +88,7 @@ BOOL ReadConfig (LPSTR lpCmdLine)
file = fopen("data\\config.def", "rb");
if ( file == NULL ) return FALSE;
nb = fread(buffer, sizeof(char), 200-1 file);
nb = fread(buffer, sizeof(char), 200-1, file);
buffer[nb] = 0;
fclose(file);
@ -202,7 +210,7 @@ BOOL ReadConfig (LPSTR lpCmdLine)
return TRUE;
}
// Rewrite Variables
// Mise à jour principale. [Rewrite Variables]
void UpdateFrame(void)
{
@ -211,7 +219,7 @@ void UpdateFrame(void)
POINT posMouse;
int i, term, speed;
g_pPixmap->MouseBackClear(); // enl<EFBFBD>ve la souris dans "back"
g_pPixmap->MouseBackClear(); // enlve la souris dans "back"
posMouse = g_pEvent->GetLastMousePos();
phase = g_pEvent->GetPhase();
@ -234,9 +242,16 @@ void UpdateFrame(void)
g_pPixmap->DrawImage(-1, CHBACK, rcRect, 1); // dessine le fond
}
//[this block remains dormant, yet functional in SB]
if (phase == WM_PHASE_INTRO1 ||
phase == WM_PHASE_INTRO2)
{
g_pEvent->IntroStep();
}
if (phase == WM_PHASE_INIT)
{
g_pEvent->DemoStep(); // d<>marre <20>v. d<>mo automatique
g_pEvent->DemoStep(); // démarre év. démo automatique
}
if (phase == WM_PHASE_PLAYMOVIE || phase == WM_PHASE_WINMOVIE || WM_PHASE_WINMOVIEDESIGN || WM_PHASE_WINMOVIEMULTI)
@ -259,7 +274,7 @@ void UpdateFrame(void)
if ( g_pEvent->IsShift() ) // shift en cours ?
{
g_pEvent->DecorAutoShift(posMouse);
g_pDecor->Build(clip, posMouse); // construit juste le d<EFBFBD>cor
g_pDecor->Build(clip, posMouse); // construit juste le dcor
}
else
{
@ -269,13 +284,13 @@ void UpdateFrame(void)
for ( i=0 ; i<speed ; i++ )
{
g_pDecor->BlupiStep(i==0); // avance tous les blupi
g_pDecor->MoveStep(i==0); // avance tous les d<EFBFBD>cors
g_pDecor->MoveStep(i==0); // avance tous les dcors
g_pEvent->DemoStep(); // avance enregistrement/reproduction
}
}
g_pEvent->DecorAutoShift(posMouse);
g_pDecor->Build(clip, posMouse); // construit le d<EFBFBD>cor
g_pDecor->Build(clip, posMouse); // construit le dcor
g_pDecor->NextPhase(1); // refait la carte de temps en temps
}
}
@ -284,15 +299,16 @@ void UpdateFrame(void)
{
term = g_pDecor->IsTerminated();
if ( term == 1 ) g_pEvent->ChangePhase(WM_PHASE_LOST); // perdu
if ( term == 2 ) g_pEvent->ChangePhase(WM_PHASE_WINMOVIE); // gagn<EFBFBD>
if ( term == 2 ) g_pEvent->ChangePhase(WM_PHASE_WINMOVIE); // gagn
}
g_pPixmap->MouseBackDraw(); // remet la souris dans "back"
}
//[excluded from SB release builds]
void Benchmark()
{
int i;
int i;
POINT pos = { 0, 0 };
g_pPixmap->DrawIcon(-1, 2, 10, pos, 0);
@ -317,14 +333,34 @@ void SetDecor()
POINT posMouse;
g_pPixmap->MouseBackClear();
g_pEvent->GetLastMousePos(&posMouse);
phase = g_pEvent->GetPhase;
posMouse = g_pEvent->GetLastMousePos();
phase = g_pEvent->GetPhase();
if (phase == WM_PHASE_PLAY || phase == WM_PHASE_PLAYTEST || phase == WM_PHASE_BUILD)
{
rect.bottom = LYIMAGE;
rect.right = LXIMAGE;
rect.top = 0;
rect.left = 0;
g_pDecor->Build(rect);
}
else {
rect.bottom = LYIMAGE;
rect.right = LXIMAGE;
rect.top = 0;
rect.left = 0;
g_pPixmap->DrawImage(-1, 0, rect, 1);
}
g_pEvent->FUN_1d7d0();
g_lastPhase = phase;
g_pPixmap->MouseBackDraw();
}
// Restitue le jeu après une activation en mode fullScreen.
BOOL RestoreGame()
{
if ( g_pPixmap == NULL ) return FALSE;
@ -333,6 +369,8 @@ BOOL RestoreGame()
return g_pPixmap->Restore();
}
// Libère le jeu avant une désactivation en mode fullScreen.
BOOL FlushGame()
{
if ( g_pPixmap == NULL ) return FALSE;
@ -340,6 +378,9 @@ BOOL FlushGame()
return g_pPixmap->Flush();
}
// Finished with all objects we use; release them.
static void FinishObjects(void)
{
if ( g_pMovie != NULL )
@ -364,7 +405,7 @@ static void FinishObjects(void)
if (g_pSound != NULL )
{
g_pSound->StopMusic();
g_pSound->StopMusic(); // stoppe la musique Midi
delete g_pSound;
g_pSound = NULL;
@ -397,6 +438,9 @@ LRESULT CALLBACK WindowProc (HWND hWnd, UINT message,
}
#endif
// La touche F10 envoie un autre message pour activer
// le menu dans les applications Windows standard !
//[The F10 key sends another message to activate the menu in standard Windows apps!]
if ( message == WM_SYSKEYDOWN && wParam == VK_F10 )
{
message = WM_KEYDOWN;
@ -412,6 +456,16 @@ LRESULT CALLBACK WindowProc (HWND hWnd, UINT message,
switch( message )
{
case WM_TIMER:
case WM_UPDATE:
if (!g_pEvent->IsMovie()) // pas de film en cours ?
{
if (g_bActive)
{
UpdateFrame();
}
g_pPixmap->Display();
}
break;
case WM_SYSCOLORCHANGE:
OutputDebug("Event WM_SYSCOLORCHANGE\n");
break;
@ -422,9 +476,9 @@ LRESULT CALLBACK WindowProc (HWND hWnd, UINT message,
case WM_ACTIVATEAPP:
g_bActive = (wParam != 0);
if (g_pEvent != NULL)
if ( g_pEvent != NULL )
{
g_pEvent->SomethingDecor;
g_pEvent->SomethingDecor();
}
if ( g_bActive )
{
@ -440,7 +494,7 @@ LRESULT CALLBACK WindowProc (HWND hWnd, UINT message,
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->SetTransparent(CHLITTLE, RGB(0,0,255)); // bleu
g_pPixmap->SavePalette();
g_pPixmap->InitSysPalette();
@ -448,7 +502,7 @@ LRESULT CALLBACK WindowProc (HWND hWnd, UINT message,
SetWindowText(hWnd, "Blupi");
if ( g_pSound != NULL ) g_pSound->RestartMusic();
}
else
else // désactive ?
{
if ( g_bFullScreen )
{
@ -459,89 +513,97 @@ LRESULT CALLBACK WindowProc (HWND hWnd, UINT message,
}
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;
}
case WM_DISPLAYCHANGE:
OutputDebug("Event WM_DISPLAYCHANGE\n");
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() )
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() ) // film en cours ?
{
if ( wParam == MCI_NOTIFY_SUCCESSFUL )
{
if ( wParam == MCI_NOTIFY_SUCCESSFUL )
{
g_pEvent->StopMovie();
}
g_pEvent->StopMovie();
}
}
else
{
// music over, play it again
g_pSound->SuspendMusic();
// if music finished, play it again. Otherwise assume that
// it was aborted by the user or otherwise
if ( wParam == MCI_NOTIFY_SUCCESSFUL )
{
OutputDebug("Event MCI_NOTIFY_SUCCESSFUL\n");
g_pSound->RestartMusic();
}
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);
}
char s[50];
sprintf(s, "wParam=%d\n", wParam);
OutputDebug(s);
}
break;
}
break;
case WM_SETCURSOR:
// ChangeSprite();
// SetCursor(NULL); // pas de souris visible !
return TRUE;
case WM_LBUTTONDOWN:
//? Benchmark();
GetCursorPos(&mousePos);
ScreenToClient(hWnd, &mousePos);
break;
case WM_RBUTTONDOWN:
break;
case WM_MOUSEMOVE:
break;
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_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);
}
// Erreur dans DoInit.
BOOL InitFail(char *msg, BOOL bDirectX)
{
char buffer[100];
@ -557,8 +619,9 @@ BOOL InitFail(char *msg, BOOL bDirectX)
return FALSE;
}
//Space for SetTimer
//[Space for SetTimer]
// Initialisation de l'application.
static BOOL DoInit(HINSTANCE hInstance, LPSTR lpCmdLine, int nCmdShow)
{
@ -567,15 +630,17 @@ static BOOL DoInit(HINSTANCE hInstance, LPSTR lpCmdLine, int nCmdShow)
RECT rcRect;
BOOL bOK;
bOK = ReadConfig(lpCmdLine);
bOK = ReadConfig(lpCmdLine); // lit le fichier config.def
InitHInstance(hInstance);
// Set up and register window class.
wc.style = CS_HREDRAW | CS_VREDRAW;
wc.lpfnWndProc = WindowProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = hInstance;
//? wc.hIcon = LoadIcon(hInstance, IDI_APPLICATION);
wc.hIcon = LoadIcon(hInstance, "IDR_MAINFRAME");
wc.hCursor = LoadCursor(hInstance, "IDC_POINTER");
wc.hbrBackground = GetStockBrush(BLACK_BRUSH);
@ -583,6 +648,7 @@ static BOOL DoInit(HINSTANCE hInstance, LPSTR lpCmdLine, int nCmdShow)
wc.lpszClassName = NAME;
RegisterClass(&wc);
// Create a window.
if (g_bFullScreen)
{
g_hWnd = CreateWindowEx
@ -633,13 +699,14 @@ static BOOL DoInit(HINSTANCE hInstance, LPSTR lpCmdLine, int nCmdShow)
UpdateWindow(g_hWnd);
SetFocus(g_hWnd);
ChangeSprite(SPRITE_WAIT);
ChangeSprite(SPRITE_WAIT); // met le sablier maison
if (!bOk)
if (!bOk) // config.def pas correct ?
{
return InitFail("Game not correctly installed", FALSE);
}
// Crée le pixmap principal.
g_pPixmap = new CPixmap;
if (g_pPixmap == NULL) return InitFail("New pixmap", TRUE);
@ -674,7 +741,7 @@ static BOOL DoInit(HINSTANCE hInstance, LPSTR lpCmdLine, int nCmdShow)
g_pSound->Create(g_hWnd);
g_pSound->CacheAll();
g_pSoundSetState(TRUE);
g_pSound->SetState(TRUE);
g_pMovie = new CMovie;
if (g_pMovie == NULL) return InitFail("New movie", FALSE);
@ -703,6 +770,9 @@ static BOOL DoInit(HINSTANCE hInstance, LPSTR lpCmdLine, int nCmdShow)
return TRUE;
}
// Programme principal.
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow)
{
@ -728,6 +798,7 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
}
else
{
// make sure we go to sleep if we have nothing else to do
if ( !g_bActive ) WaitMessage();
}
}

View File

@ -1,4 +1,4 @@
// Button.cpp
// Button.cpp
//
#include <windows.h>
@ -23,7 +23,7 @@ CButton::CButton()
m_type = 0;
m_bEnable = TRUE;
m_bHide = FALSE;
m_bSomething = 0;
m_bSomething = FALSE;
m_state = 0;
m_mouseState = 0;
m_nbMenu = 0;
@ -45,9 +45,9 @@ CButton::~CButton()
BOOL CButton::Create(HWND hWnd, CPixmap *pPixmap, CSound *pSound,
POINT pos, int type, BOOL bMinimizeRedraw,
int *pMenu, int nbMenu,
/*int *pMenu, int nbMenu,
int *pToolTips, int nbToolTips,
int region, UINT message)
int region,*/ UINT message)
{
POINT iconDim;
int i, icon;
@ -69,14 +69,14 @@ BOOL CButton::Create(HWND hWnd, CPixmap *pPixmap, CSound *pSound,
m_bMinimizeRedraw = bMinimizeRedraw;
m_bEnable = TRUE;
m_bHide = FALSE;
m_bSomething = 0;
m_bSomething = FALSE;
m_message = message;
m_pos.x = pos.x;
m_pos.y = pos.y;
m_dim.x = iconDim.x;
m_dim.y = iconDim.y;
m_nbMenu = nbMenu;
m_nbToolTips = nbToolTips;
m_nbMenu = 0;
m_nbToolTips = 0;
m_selMenu = 0;
m_state = 0;
m_mouseState = 0;
@ -84,6 +84,7 @@ BOOL CButton::Create(HWND hWnd, CPixmap *pPixmap, CSound *pSound,
m_bRedraw = TRUE;
/* Do we need this yet?
// No. 👍
///////////////////////////////////////////////////
for ( i=0 ; i<nbMenu ; i++ )
{
@ -122,9 +123,10 @@ BOOL CButton::Create(HWND hWnd, CPixmap *pPixmap, CSound *pSound,
m_toolTips[i] = pToolTips[i];
}
return TRUE;
/////////////////////////////////////////////////////
*/
return TRUE;
}
// Space for unknown menu function.
@ -135,11 +137,11 @@ void CButton::SetSomethingMenu(int somethingMenu)
while (0 < i)
{
//TODO
}
}
// Draw a button in its state
// Draw a button according to its state
void CButton::Draw()
{
@ -150,15 +152,15 @@ void CButton::Draw()
if ( m_bMinimizeRedraw && !m_bRedraw ) return;
m_bRedraw = FALSE, m_bSomething = FALSE;
if ( m_bHide ) // Hidden button
if ( m_bHide ) // is button hidden ?
{
pos.y = m_pos.y;
pos.x = m_pos.x;
m_pPixmap->DrawPart(-1, CHBACK, m_pos, rect, 1); // Draw the background
m_pPixmap->DrawPart(-1, CHBACK, m_pos, rect, 1); // draw the background
return;
}
if( m_bEnable )
if( m_bEnable ) // is button active ?
{
m_pPixmap->DrawIcon(-1, CHBUTTON+m_type, m_mouseState, m_pos);
}
@ -251,15 +253,10 @@ void CButton::SetSomething(BOOL bSomething)
}
/*
// Needed Yet?
/////////////////////////////////////////
BOOL CButton::GetHide()
{
return m_bHide;
}
/////////////////////////////////////////
*/
void CButton::SetHide(BOOL bHide)
@ -272,6 +269,9 @@ void CButton::SetHide(BOOL bHide)
m_bHide = bHide;
}
// Event handling.
BOOL CButton::TreatEvent(UINT message, WPARAM wParam, LPARAM lParam)
{
POINT pos;
@ -293,14 +293,15 @@ BOOL CButton::TreatEvent(UINT message, WPARAM wParam, LPARAM lParam)
case WM_LBUTTONUP:
case WM_RBUTTONUP:
if ( MouseUp(pos) ) return FALSE;
if ( MouseUp(pos) ) return FALSE; // (*)
break;
}
return FALSE;
}
// All buttons must receive the BUTTONUP event!
// (*) All buttons must receive the BUTTONUP event!
// Indicates whether the mouse is over this button.
@ -319,7 +320,7 @@ int CButton::GetToolTips(POINT pos)
if ( m_bHide || !m_bEnable ) return -1;
if ( m_nbMenu > 1 && m_bMouseDown ) // Drop-down submenu?
if ( m_nbMenu > 1 && m_bMouseDown ) // submenu is open?
{
width += 2+(m_dim.x-1)*m_nbMenu;
}
@ -348,13 +349,16 @@ int CButton::GetToolTips(POINT pos)
return m_toolTips[rank];
}
// Detect whether the mouse is on a button.
BOOL CButton::Detect(POINT pos)
{
int width = m_dim.x;
if ( m_bHide || !m_bEnable ) return FALSE;
if ( m_nbMenu > 1 && m_bMouseDown )
if ( m_nbMenu > 1 && m_bMouseDown ) // sub-menu is open?
{
width += 2+(m_dim.x-1)*m_nbMenu;
}
@ -367,6 +371,8 @@ BOOL CButton::Detect(POINT pos)
return TRUE;
}
// Mouse button pressed.
BOOL CButton::MouseDown(POINT pos)
{
if ( !Detect(pos) ) return FALSE;
@ -380,6 +386,8 @@ BOOL CButton::MouseDown(POINT pos)
return TRUE;
}
// Mouse moved.
BOOL CButton::MouseMove(POINT pos)
{
BOOL bDetect;
@ -392,18 +400,18 @@ BOOL CButton::MouseMove(POINT pos)
if ( m_bMouseDown )
{
if ( bDetect ) m_mouseState = 1;
if ( bDetect ) m_mouseState = 1; // pressed
else m_mouseState = m_state;
}
else
{
if ( bDetect ) m_mouseState = m_state+2;
if ( bDetect ) m_mouseState = m_state+2; // hover
else m_mouseState = m_state;
}
if ( m_nbMenu > 1 &&
m_bMouseDown &&
pos.x > m_pos.x+m_dim.x+2 )
pos.x > m_pos.x+m_dim.x+2 ) // is on sub-menu?
{
m_selMenu = (pos.x-(m_pos.x+m_dim.x+2))/(m_dim.x-1);
if ( m_selMenu >= m_nbMenu )
@ -422,6 +430,8 @@ BOOL CButton::MouseMove(POINT pos)
return m_bMouseDown;
}
// Mouse button released.
BOOL CButton::MouseUp(POINT pos)
{
BOOL bDetect;

View File

@ -8,9 +8,9 @@ public:
BOOL Create(HWND hWnd, CPixmap *pPixmap, CSound *pSound,
POINT pos, int type, BOOL bMinimizeRedraw,
int *pMenu, int nbMenu,
/*int *pMenu, int nbMenu,
int *pTooltips, int nbToolTips,
int region, UINT message);
int region,*/ UINT message);
void SetSomethingMenu(int somethingMenu);
void Draw();
void Redraw();

View File

@ -19,7 +19,7 @@
// Le message :
// First-chance exception in Blupi.exe (GDI32.DLL): 0xC0000005: Access Violation.
// appara<EFBFBD>t au endroits marqu<71>s par (@) ...
// apparaît au endroits marqués par (@) ...
BOOL g_bDebug = TRUE;

1068
decor.cpp

File diff suppressed because it is too large Load Diff

1034
decor.h

File diff suppressed because it is too large Load Diff

588
def.h
View File

@ -11,31 +11,20 @@
#define _SE FALSE // TRUE eGames Special Edition
#define LXIMAGE 640 // dimensions de la fen<EFBFBD>tre de jeu
#define LXIMAGE 640 // dimensions de la fentre 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 64 // dimensions d'un objet
#define DIMOBJY 64
#define DIMOBJX 120 // dimensions d'un objet
#define DIMOBJY 120
#define DIMEXPLOX 128
#define DIMEXPLOY 128
#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
@ -43,265 +32,329 @@
#define DIMJAUGEX 124 // dimensions de la jauge
#define DIMJAUGEY 22
#define POSSTATX 12 // statistiques
#define POSSTATX 12
#define POSSTATY 220
#define DIMSTATX 60
#define DIMSTATY 30
#define DIMTEXTX 16 // dimensions max d'un caract<EFBFBD>re
#define DIMTEXTX 16 // dimensions max d'un caractre
#define DIMTEXTY 16
#define DIMLITTLEX 16 // dimensions max d'un petit caract<EFBFBD>re
#define DIMLITTLEX 16 // dimensions max d'un petit caractre
#define DIMLITTLEY 12
#define CHBACK 0
#define CHBLUPI000
#define CHBLUPI001
#define CHBLUPI002
#define CHBLUPI003
#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 CHEXPLO
#define CHELEMENT
#define FOGHIDE 4
#define CHDECOR 0
#define CHOBJECT 1
#define CHBLUPI 2
#define CHBACK 3
#define CHBUTTON 4
#define CHJAUGE 5
#define CHTEXT 6
#define CHLITTLE 7
#define CHMAP 8
#define CHEXPLO 9
#define CHELEMENT 10
#define CHBLUPI1 11
#define CHBLUPI2 12
#define CHBLUPI3 13
#define CHTEMP 14
// 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)
#define DIR_LEFT 1
#define DIR_RIGHT 2
// Actions :
#define ACTION_STOP 0 // arr<72>t
#define ACTION_STOPf 1 // arr<72>t fatigu<67>
#define ACTION_MARCHE 2 // marche
#define ACTION_MARCHEf 3 // marche fatigu<67>
#define ACTION_BUILD 4 // construit
#define ACTION_PIOCHE 5 // pioche
#define ACTION_ENERGY 6 // prend de l'<27>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 <20>paules)
#define ACTION_MISC2 21 // divers 2 (grat-grat)
#define ACTION_MISC3 22 // divers 3 (yoyo)
#define ACTION_MISC1f 23 // divers 1 fatigu<67> (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<72>t en bateau
#define ACTION_MARCHEb 33 // avance en bateau
#define ACTION_STOPj 34 // arr<72>t en jeep
#define ACTION_MARCHEj 35 // avance en jeep
#define ACTION_ELECTRO 36 // blupi <20>lectrocut<75>
#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<6F>)
#define ACTION_TELEPORTE1 52 // t<>l<EFBFBD>porte
#define ACTION_TELEPORTE2 53 // t<>l<EFBFBD>porte
#define ACTION_TELEPORTE3 54 // t<>l<EFBFBD>porte
#define ACTION_STOPa 55 // arr<72>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_STOP 1
#define ACTION_MARCH 2
#define ACTION_TURN 3
#define ACTION_JUMP 4
#define ACTION_AIR 5
#define ACTION_DOWN 6
#define ACTION_UP 7
#define ACTION_VERTIGO 8
#define ACTION_RECEDE 9
#define ACTION_ADVANCE 10
#define ACTION_CLEAR1 11
#define ACTION_SET 12
#define ACTION_WIN 13
#define ACTION_PUSH 14
#define ACTION_STOPHELICO 15
#define ACTION_MARCHHELICO 16
#define ACTION_TURNHELICO 17
#define ACTION_STOPNAGE 18
#define ACTION_MARCHNAGE 19
#define ACTION_TURNNAGE 20
#define ACTION_STOPSURF 21
#define ACTION_MARCHSURF 22
#define ACTION_TURNSURF 23
#define ACTION_DROWN 24
#define ACTION_STOPJEEP 25
#define ACTION_MARCHJEEP 26
#define ACTION_TURNJEEP 27
#define ACTION_STOPPOP 28
#define ACTION_POP 29
#define ACTION_BYE 30
#define ACTION_STOPSUSPEND 31
#define ACTION_MARCHSUSPEND 32
#define ACTION_TURNSUSPEND 33
#define ACTION_JUMPSUSPEND 34
#define ACTION_HIDE 35
#define ACTION_JUMPAIE 36
#define ACTION_STOPSKATE 37
#define ACTION_MARCHSKATE 38
#define ACTION_TURNSKATE 39
#define ACTION_JUMPSKATE 40
#define ACTION_AIRSKATE 41
#define ACTION_TAKESKATE 42
#define ACTION_DEPOSESKATE 43
#define ACTION_OUF1a 44
#define ACTION_OUF1b 45
#define ACTION_OUF2 46
#define ACTION_OUF3 47
#define ACTION_OUF4 48
#define ACTION_SUCETTE 49
#define ACTION_STOPTANK 50
#define ACTION_MARCHTANK 51
#define ACTION_TURNTANK 52
#define ACTION_FIRETANK 53
#define ACTION_GLU 54
#define ACTION_DRINK 55
#define ACTION_CHARGE 56
#define ACTION_ELECTRO 57
#define ACTION_HELICOGLU 58
#define ACTION_TURNAIR 59
#define ACTION_STOPMARCH 60
#define ACTION_STOPJUMP 61
#define ACTION_STOPJUMPh 62
#define ACTION_MOCKERY 63
#define ACTION_MOCKERYi 64
#define ACTION_OUF5 65
#define ACTION_BALLOON 66
#define ACTION_STOPOVER 67
#define ACTION_MARCHOVER 68
#define ACTION_TURNOVER 69
#define ACTION_RECEDEq 70
#define ACTION_ADVANCEq 71
#define ACTION_STOPECRASE 72
#define ACTION_MARCHECRASE 73
#define ACTION_TELEPORTE 74
#define ACTION_CLEAR2 75
#define ACTION_CLEAR3 76
#define ACTION_CLEAR4 77
#define ACTION_CLEAR5 78
#define ACTION_CLEAR6 79
#define ACTION_CLEAR7 80
#define ACTION_CLEAR8 81
#define ACTION_SWITCH 82
#define ACTION_MOCKERYp 83
#define ACTION_NON 84
#define ACTION_SLOWDOWNSKATE 85
#define ACTION_TAKEDYNAMITE 86
#define ACTION_PUTDYNAMITE 87
#define ACTION_A_STOP 100 // araign<67>e: arr<72>t
#define ACTION_A_MARCHE 101 // araign<67>e: marche
#define ACTION_A_SAUT 102 // araign<67>e: saute
#define ACTION_A_GRILLE 103 // araign<67>e: grille dans rayon
#define ACTION_A_POISON 105 // araign<67>e: empoison<6F>e
#define ACTION_A_MORT1 106 // araign<67>e: meurt
#define ACTION_A_MORT2 107 // araign<67>e: meurt
#define ACTION_A_MORT3 108 // araign<67>e: meurt
#define ACTION_V_STOP 200 // virus: arr<72>t
#define ACTION_V_MARCHE 201 // virus: marche
#define ACTION_V_GRILLE 202 // virus: grille dans rayon
// Sécurités :
#define ACTION_T_STOP 300 // tracks: arr<72>t
#define ACTION_T_MARCHE 301 // tracks: marche
#define ACTION_T_ECRASE 302 // tracks: <20>crase un objet
#define SEC_SHIELD 1
#define SEC_POWER 2
#define SEC_CLOUD 3
#define SEC_HIDE 4
#define ACTION_R_STOP 400 // robot: arr<72>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: <20>crase un objet
#define ACTION_B_STOP 500 // bombe: arr<72>t
#define ACTION_B_MARCHE 501 // bombe: marche
// Types :
#define ACTION_D_DELAY 600 // d<>tonnateur: attend
#define TYPE_ASCENSEUR 1
#define TYPE_BOMBEDOWN 2
#define TYPE_BOMBEUP 3
#define TYPE_BULLDOZER 4
#define TYPE_TRESOR 5
#define TYPE_EGG 6
#define TYPE_GOAL 7
#define TYPE_EXPLO1 8
#define TYPE_EXPLO2 9
#define TYPE_EXPLO3 10
#define TYPE_EXPLO4 11
#define TYPE_CAISSE 12
#define TYPE_HELICO 13
#define TYPE_PLOUF 14
#define TYPE_BLUP 15
#define TYPE_BOMBEMOVE 16
#define TYPE_POISSON 17
#define TYPE_TOMATES 18
#define TYPE_JEEP 19
#define TYPE_OISEAU 20
#define TYPE_CLE 21
#define TYPE_DOOR 22
#define TYPE_BALLE 23
#define TYPE_SKATE 24
#define TYPE_SHIELD 25
#define TYPE_POWER 26
#define TYPE_MAGICTRACK 27
#define TYPE_TANK 28
#define TYPE_BULLET 29
#define TYPE_DRINK 30
#define TYPE_CHARGE 31
#define TYPE_BLUPIHELICO 32
#define TYPE_BLUPITANK 33
#define TYPE_GLU 34
#define TYPE_TIPLOUF 35
#define TYPE_POLLUTION 36
#define TYPE_CLEAR 37
#define TYPE_ELECTRO 38
#define TYPE_TRESORTRACK 39
#define TYPE_INVERT 40
#define TYPE_INVERTSTART 41
#define TYPE_INVERTSTOP 42
#define TYPE_GUEPE 44
#define TYPE_OVER 46
#define TYPE_ASCENSEURs 47
#define TYPE_ASCENSEURsi 48
#define TYPE_CLE1 49
#define TYPE_CLE2 50
#define TYPE_CLE3 51
#define TYPE_BRIDGE 52
#define TYPE_TENTACULE 53
#define TYPE_CREATURE 54
#define TYPE_DYNAMITE 55
#define TYPE_DYNAMITEf 56
#define TYPE_SHIELDTRACK 57
#define TYPE_HIDETRACK 58
#define TYPE_EXPLO5 90
#define TYPE_EXPLO6 91
#define TYPE_EXPLO7 92
#define TYPE_EXPLO8 93
#define TYPE_EXPLO9 94
#define TYPE_EXPLO10 95
#define TYPE_BOMBEFOLLOW1 96
#define TYPE_BOMBEFOLLOW2 97
#define TYPE_SPLOUTCH1 98
#define TYPE_SPLOUTCH2 99
#define TYPE_SPLOUTCH3 100
#define TYPE_BOMBEPERSO1 200
#define TYPE_BOMBEPERSO2 201
#define TYPE_BOMBEPERSO3 202
#define TYPE_BOMBEPERSO4 203
#define ACTION_E_STOP 700 // <20>lectro: arr<72>t
#define ACTION_E_MARCHE 701 // <20>lectro: marche
#define ACTION_E_DEBUT 702 // <20>lectro: d<>bute
#define ACTION_E_RAYON 703 // <20>lectro: rayonne
#define ACTION_D_STOP 800 // disciple: arr<72>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
// Steps :
#define STEP_STOPSTART 1
#define STEP_ADVANCE 2
#define STEP_STOPEND 3
#define STEP_RECEDE 4
// 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
#define SOUND_CLICK 0
#define SOUND_JUMP1 1
#define SOUND_JUMP2 2
#define SOUND_JUMPEND 3
#define SOUND_JUMPTOC 4
#define SOUND_TURN 5
#define SOUND_VERTIGO 6
#define SOUND_DOWN 7
#define SOUND_FALL 8
#define SOUND_NEW 9
#define SOUND_BOUM 10
#define SOUND_TRESOR 11
#define SOUND_EGG 12
#define SOUND_ENDKO 13
#define SOUND_ENDOK 14
#define SOUND_HELICOSTART 15
#define SOUND_HELICOHIGH 16
#define SOUND_HELICOSTOP 17
#define SOUND_HELICOLOW 18
#define SOUND_LASTTRESOR 19
#define SOUND_UP 20
#define SOUND_LOOKUP 21
#define SOUND_JUMP0 22
#define SOUND_PLOUF 23
#define SOUND_BLUP 24
#define SOUND_SURF 25
#define SOUND_DROWN 26
#define SOUND_ERROR 27
#define SOUND_JEEPSTART 28
#define SOUND_JEEPHIGH 29
#define SOUND_JEEPSTOP 30
#define SOUND_JEEPLOW 31
#define SOUND_BYE 32
#define SOUND_DOOR 33
#define SOUND_SUSPENDTOC 34
#define SOUND_SUSPENDJUMP 35
#define SOUND_SINGE 36
#define SOUND_PATIENT 37
#define SOUND_PUSH 38
#define SOUND_POP 39
#define SOUND_JUMPAIE 40
#define SOUND_RESSORT 41
#define SOUND_STARTSHIELD 42
#define SOUND_STOPSHIELD 43
#define SOUND_STARTPOWER 44
#define SOUND_STOPPOWER 45
#define SOUND_OUF1 46
#define SOUND_OUF2 47
#define SOUND_OUF3 48
#define SOUND_OUF4 49
#define SOUND_SUCETTE 50
#define SOUND_GLU 51
#define SOUND_FIREOK 52
#define SOUND_FIREKO 53
#define SOUND_TAKEGLU 54
#define SOUND_STARTCLOUD 55
#define SOUND_STOPCLOUD 56
#define SOUND_DRINK 57
#define SOUND_CHARGE 58
#define SOUND_ELECTRO 59
#define SOUND_PERSOTAKE 60
#define SOUND_PERSOPOSE 61
#define SOUND_STARTHIDE 62
#define SOUND_STOPHIDE 63
#define SOUND_TIPLOUF 64
#define SOUND_MOCKERY 65
#define SOUND_INVERTSTART 66
#define SOUND_INVERTSTOP 67
#define SOUND_OVERSTOP 68
#define SOUND_BLITZ 69
#define SOUND_ECRASE 70
#define SOUND_TELEPORTE 71
#define SOUND_BRIDGE1 72
#define SOUND_BRIDGE2 73
#define SOUND_ANGEL 74
#define SOUND_SCIE 75
#define SOUND_SWITCHOFF 76
#define SOUND_SWITCHON 77
#define SOUND_JUMPENDb 78
#define SOUND_JUMPTOCb 79
#define SOUND_JUMPENDm 80
#define SOUND_JUMPTOCm 81
#define SOUND_JUMPENDg 82
#define SOUND_JUMPTOCg 83
#define SOUND_JUMPENDo 84
#define SOUND_JUMPTOCo 85
#define SOUND_JUMPENDk 86
#define SOUND_JUMPTOCk 87
#define SOUND_JUMPENDf 88
#define SOUND_JUMPTOCf 89
#define SOUND_JUMPENDh 90
#define SOUND_JUMPTOCh 91
#define SOUND_FOLLOW 92
//
#define KEY_LEFT (1 << 0)
#define KEY_RIGHT (1 << 1)
#define KEY_UP (1 << 2)
#define KEY_DOWN (1 << 3)
#define KEY_JUMP (1 << 4)
#define KEY_FIRE (1 << 5)
// Boutons (play) :
@ -345,18 +398,6 @@
#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
@ -375,15 +416,6 @@
#define SPRITE_FILL 14
#define TYPE_BALLE
#define TYPE_CAISSE
#define TYPE_GOAL
#define TYPE_CLE
#define TYPE_BLUPIHELICO
#define TYPE_BLUPITANK
#define TYPE_empty
#define MAXMOVEOBJECT = 200;
// User define message
#define WM_UPDATE (WM_USER+1)
@ -621,23 +653,3 @@
#define MOUSETYPEWIN 2
#define MOUSETYPEWINPOS 3
// Conditions pour gagner.
typedef struct
{
short bHachBlupi; // blupi sur dalle hachur<75>e
short bHachPlanche; // planches sur dalle hachur<75>e
short bStopFire; // feu <20>teint
short nbMinBlupi; // nb de blupi n<>cessaires
short nbMaxBlupi; // nb de blupi n<>cessaires
short bHomeBlupi; // blupi <20> la maison
short bKillRobots; // plus d'ennemis
short bHachTomate; // tomates sur dalle hachur<75>e
short bHachMetal; // m<>tal sur dalle hachur<75>e
short bHachRobot; // robot sur dalle hachur<75>e
short reserve[14];
}
Term;

View File

@ -10,7 +10,7 @@ public:
CJauge();
~CJauge();
BOOL Create(HWND hWnd, CPixmap *pPixmap, CDecor *pDecor,
BOOL Create(HWND hWnd, CPixmap *pPixmap, CSound *pSound,
POINT pos, int type, BOOL bMinimizeRedraw);
void Draw();
void Redraw();
@ -29,7 +29,6 @@ public:
protected:
HWND m_hWnd;
CPixmap* m_pPixmap;
CDecor* m_pDecor;
CSound* m_pSound;
BOOL m_bHide;
POINT m_pos;

View File

@ -583,67 +583,7 @@ int CPixmap::SearchColor(int red, int green, int blue)
// Cache une image contenant des ic<69>nes.
BOOL CPixmap::Cache(int channel, char *pFilename, POINT totalDim, POINT iconDim,
BOOL bUsePalette)
{
HRESULT ddrval;
if ( channel < 0 || channel >= MAXIMAGE ) return FALSE;
if ( m_lpDDSurface[channel] != NULL )
{
Flush(channel);
}
// Create and set the palette.
if ( bUsePalette )
{
if ( m_bDebug ) OutputDebug("Use palette\n");
if ( m_lpDDPal != NULL )
{
if ( m_bDebug ) OutputDebug("Release palette\n");
m_lpDDPal->Release();
m_lpDDPal = NULL;
}
m_lpDDPal = DDLoadPalette(m_lpDD, pFilename);
if ( m_lpDDPal )
{
if ( m_bDebug ) OutputDebug("Set palette\n");
m_lpDDSPrimary->SetPalette(NULL); // indispensable !
ddrval = m_lpDDSPrimary->SetPalette(m_lpDDPal);
if ( ddrval != DD_OK )
{
TraceErrorDD(ddrval, pFilename, 1);
}
}
}
// Create the offscreen surface, by loading our bitmap.
m_lpDDSurface[channel] = DDLoadBitmap(m_lpDD, pFilename, 0, 0);
if ( m_lpDDSurface[channel] == NULL )
{
OutputDebug("Fatal error: DDLoadBitmap\n");
return FALSE;
}
// Set the color key to white
if ( m_bDebug ) OutputDebug("DDSetColorKey\n");
DDSetColorKey(m_lpDDSurface[channel], RGB(255,255,255)); // blanc
strcpy(m_filename[channel], pFilename);
m_totalDim[channel] = totalDim;
m_iconDim[channel] = iconDim;
return TRUE;
}
// Cache une image globale.
BOOL CPixmap::Cache2(int channel, char *pFilename, POINT totalDim, BOOL bUsePalette)
BOOL CPixmap::Cache1(int channel, char *pFilename, POINT totalDim, BOOL bUsePalette)
{
POINT iconDim;
@ -670,43 +610,71 @@ BOOL CPixmap::Cache2(int channel, char *pFilename, POINT totalDim, BOOL bUsePale
if (bUsePalette != 0)
{
//TODO: more
}
}
// Cache une image provenant d'un bitmap.
// Probably not needed?
// Cache une image globale.
BOOL CPixmap::Cache(int channel, HBITMAP hbm, POINT totalDim)
BOOL CPixmap::Cache2(int channel, char *pFilename, POINT totalDim, POINT iconDim,
BOOL bUsePalette)
{
if ( channel < 0 || channel >= MAXIMAGE ) return FALSE;
HRESULT ddrval;
if ( m_lpDDSurface[channel] != NULL )
if (channel < 0 || channel >= MAXIMAGE) return FALSE;
if (m_lpDDSurface[channel] != NULL)
{
Flush(channel);
}
// Create the offscreen surface, by loading our bitmap.
m_lpDDSurface[channel] = DDConnectBitmap(m_lpDD, hbm);
// Create and set the palette.
if (bUsePalette)
{
if (m_bDebug) OutputDebug("Use palette\n");
if (m_lpDDPal != NULL)
{
if (m_bDebug) OutputDebug("Release palette\n");
m_lpDDPal->Release();
m_lpDDPal = NULL;
}
if ( m_lpDDSurface[channel] == NULL )
{
m_lpDDPal = DDLoadPalette(m_lpDD, pFilename);
if (m_lpDDPal)
{
if (m_bDebug) OutputDebug("Set palette\n");
m_lpDDSPrimary->SetPalette(NULL); // indispensable !
ddrval = m_lpDDSPrimary->SetPalette(m_lpDDPal);
if (ddrval != DD_OK)
{
TraceErrorDD(ddrval, pFilename, 1);
}
}
}
// Create the offscreen surface, by loading our bitmap.
m_lpDDSurface[channel] = DDLoadBitmap(m_lpDD, pFilename, 0, 0);
if (m_lpDDSurface[channel] == NULL)
{
OutputDebug("Fatal error: DDLoadBitmap\n");
return FALSE;
}
return FALSE;
}
// Set the color key to white
if (m_bDebug) OutputDebug("DDSetColorKey\n");
DDSetColorKey(m_lpDDSurface[channel], RGB(255, 255, 255)); // blanc
strcpy(m_filename[channel], pFilename);
// Set the color key to white
DDSetColorKey(m_lpDDSurface[channel], RGB(255,255,255)); // blanc
m_totalDim[channel] = totalDim;
m_iconDim[channel] = totalDim;
m_iconDim[channel] = iconDim;
return TRUE;
}
// Purge une image.
void CPixmap::Flush(int channel)

144
pixmap.h
View File

@ -6,48 +6,52 @@
/////////////////////////////////////////////////////////////
#define MAXIMAGE 100
#define MAXIMAGE 100
class CPixmap
{
public:
CPixmap();
~CPixmap();
CPixmap();
~CPixmap();
void SetDebug(BOOL bDebug);
BOOL CacheAll(BOOL _foo, HWND hWnd, BOOL bFullScreen, BOOL bTrueColor,
BOOL bTrueColorDecor, int mouseType, char *_str, int _baz);
int Benchmark();
void SetDebug(BOOL bDebug);
BOOL Create(HWND hwnd, POINT dim, BOOL bFullScreen, BOOL bTrueColor,
BOOL bTrueColorDecor, int mouseType);
BOOL Flush();
BOOL Restore();
BOOL InitSysPalette();
BOOL GetTrueColor();
void SetBenchmarkSuccess(BOOL bSuccess);
void SetTrueColor(BOOL bTrueColor);
void SetTrueColorDecor(BOOL bTrueColorDecor);
BOOL FUN_28f60(int channel);
BOOL Create(HWND hwnd, POINT dim, BOOL bFullScreen, int mouseType, BOOL bTrueColor, BOOL bTrueColorDecor);
BOOL Flush();
BOOL Restore();
BOOL InitSysPalette();
BOOL IsPalette();
void Fill(RECT rect, COLORREF color);
BOOL IsPalette();
void Fill(RECT rect, COLORREF color);
BOOL SavePalette();
BOOL RestorePalette();
int SearchColor(int red, int green, int blue);
BOOL Cache(int channel, char *pFilename, POINT totalDim, POINT iconDim, BOOL bUsePalette);
BOOL Cache2(int channel, char *pFilename, POINT totalDim, BOOL bUsePalette);
BOOL Cache(int channel, HBITMAP hbm, POINT totalDim);
void Flush(int channel);
void SetTransparent(int channel, COLORREF color);
void SetTransparent2(int channel, COLORREF color1, COLORREF color2);
void SetClipping(RECT clip);
RECT GetClipping();
void HudIcon(int channel, int rank, POINT pos);
BOOL IsIconPixel(int channel, int rank, POINT pos);
BOOL SavePalette();
BOOL RestorePalette();
int SearchColor(int red, int green, int blue);
BOOL Cache1(int channel, char *pFilename, POINT totalDim, POINT iconDim, BOOL bUsePalette);
BOOL Cache2(int channel, char *pFilename, POINT totalDim, POINT iconDim, BOOL bUsePalette);
void Flush(int channel);
void SetTransparent(int channel, COLORREF color);
void SetTransparent2(int channel, COLORREF color1, COLORREF color2);
void SetClipping(RECT clip);
RECT GetClipping();
void QuickIcon(int channel, int rank, POINT pos);
BOOL DrawIcon(int chDst, int channel, int rank, POINT pos, int mode=0, BOOL bMask=FALSE);
BOOL DrawIconDemi(int chDst, int channel, int rank, POINT pos, int mode=0, BOOL bMask=FALSE);
BOOL DrawIconPart(int chDst, int channel, int rank, POINT pos, int startY, int endY, int mode=0, BOOL bMask=FALSE);
BOOL DrawPart(int chDst, int channel, POINT dest, RECT rect, int mode=0, BOOL bMask=FALSE);
BOOL DrawImage(int chDst, int channel, RECT rect, int mode=0);
BOOL IsIconPixel(int channel, int rank, POINT pos);
BOOL DrawIcon(int chDst, int channel, int rank, POINT pos, int mode = 0, BOOL bMask = FALSE);
BOOL DrawPart(int chDst, int channel, POINT dest, RECT rect, int mode = 0, BOOL bMask = FALSE);
BOOL DrawImage(int chDst, int channel, RECT rect, int mode = 0);
BOOL BuildIconMask(int channelMask, int rankMask,
int channel, int rankSrc, int rankDst);
BOOL Display();
void SetMousePosSprite(POINT pos, int sprite, BOOL bDemoPlay);
@ -62,7 +66,7 @@ protected:
HRESULT RestoreAll();
HRESULT BltFast(int chDst, int channel, POINT dst, RECT rcRect, int mode);
HRESULT BltFast(LPDIRECTDRAWSURFACE lpDD,
int channel, POINT dst, RECT rcRect, int mode);
int channel, POINT dst, RECT rcRect, int mode);
void MouseUpdate();
BOOL MouseQuickDraw(RECT rect);
@ -71,49 +75,45 @@ protected:
void MouseBackDebug();
RECT MouseRectSprite();
void MouseHotSpot();
BOOL GetTrueColor();
void SetBenchmarkSuccess(BOOL bSuccess);
void SetTrueColor(BOOL bTrueColor);
void SetTrueColorDecor(BOOL bTrueColorDecor);
BOOL GetTrueColor();
protected:
BOOL m_bFullScreen;
BOOL m_bBenchmarkSuccess;
BOOL m_bTrueColor;
BOOL m_bTrueColorDecor;
BOOL m_field5_0x14; //Need to figure out
BOOL m_field5_0x18; //Need to figure out
int m_mouseType;
BOOL m_bDebug;
BOOL m_bPalette;
HWND m_hWnd;
POINT m_dim;
RECT m_clipRect;
double originX;
double originY;
BOOL m_bFullScreen;
BOOL m_bBenchmarkSuccess;
BOOL m_bTrueColor;
BOOL m_bTrueColorDecor;
BOOL m_field5_0x14; //Need to figure out
BOOL m_field5_0x18; //Need to figure out
int m_mouseType;
BOOL m_bDebug;
BOOL m_bPalette;
HWND m_hWnd;
POINT m_dim;
RECT m_clipRect;
double originX;
double originY;
POINT m_mousePos;
int m_mouseSprite;
POINT m_mouseHotSpot;
POINT m_mouseBackPos;
BOOL m_bMouseBack;
BOOL m_bMouseShow;
BOOL m_bBackDisplayed;
POINT m_mousePos;
int m_mouseSprite;
POINT m_mouseHotSpot;
POINT m_mouseBackPos;
BOOL m_bMouseBack;
BOOL m_bMouseShow;
BOOL m_bBackDisplayed;
LPDIRECTDRAW m_lpDD;
LPDIRECTDRAWSURFACE m_lpDDSPrimary;
LPDIRECTDRAWSURFACE m_lpDDSBack;
LPDIRECTDRAWSURFACE m_lpDDSMouse;
LPDIRECTDRAWPALETTE m_lpDDPal;
LPDIRECTDRAWSURFACE m_lpDDSurface[MAXIMAGE];
LPDIRECTDRAWCLIPPER m_lpClipper;
PALETTEENTRY m_pal[256];
PALETTEENTRY m_sysPal[256];
COLORREF m_colorSurface[2*MAXIMAGE];
LPDIRECTDRAW m_lpDD;
LPDIRECTDRAWSURFACE m_lpDDSPrimary;
LPDIRECTDRAWSURFACE m_lpDDSBack;
LPDIRECTDRAWSURFACE m_lpDDSMouse;
LPDIRECTDRAWPALETTE m_lpDDPal;
LPDIRECTDRAWSURFACE m_lpDDSurface[MAXIMAGE];
LPDIRECTDRAWCLIPPER m_lpClipper;
PALETTEENTRY m_pal[256];
PALETTEENTRY m_sysPal[256];
COLORREF m_colorSurface[2 * MAXIMAGE];
char m_filename[MAXIMAGE][20];
POINT m_totalDim[MAXIMAGE];
POINT m_iconDim[MAXIMAGE];
DDBLTFX m_DDbltfx
char m_filename[MAXIMAGE][20];
POINT m_totalDim[MAXIMAGE];
POINT m_iconDim[MAXIMAGE];
DDBLTFX m_DDbltfx
}