mirror of
https://github.com/jummy0/sb2-decomp
synced 2025-03-14 20:23:30 +01:00
compat with visual studio 5
This commit is contained in:
parent
3f2dc320f1
commit
7252bd99cf
6
.gitignore
vendored
6
.gitignore
vendored
@ -2,6 +2,7 @@
|
||||
# This .gitignore file was automatically created by Microsoft(R) Visual Studio.
|
||||
################################################################################
|
||||
|
||||
*.exe
|
||||
/.vs
|
||||
/Debug
|
||||
/Release
|
||||
@ -12,4 +13,9 @@
|
||||
/SOUND
|
||||
/MOVIE
|
||||
/DATA
|
||||
/msvc5/*.ncb
|
||||
/msvc5/*.opt
|
||||
/msvc5/sb2decomp/*.plg
|
||||
/msvc5/sb2decomp/Debug
|
||||
/msvc5/sb2decomp/Release
|
||||
Speedy Eggbert 2 Source.vcxproj.user
|
@ -92,6 +92,7 @@
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>
|
||||
<EnableCOMDATFolding>false</EnableCOMDATFolding>
|
||||
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
@ -115,6 +116,7 @@
|
||||
<AdditionalOptions>/DYNAMICBASE "legacy_stdio_definitions.lib" %(AdditionalOptions) /VERBOSE</AdditionalOptions>
|
||||
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
|
||||
<AdditionalDependencies>dxsdk3/sdk/lib/*.lib;winmm.lib;kernel32.lib;user32.lib;gdi32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
@ -137,6 +139,7 @@
|
||||
<AdditionalDependencies>dxsdk3/sdk/lib/*.lib;winmm.lib;kernel32.lib;user32.lib;gdi32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<TreatLinkerWarningAsErrors>false</TreatLinkerWarningAsErrors>
|
||||
<EnableCOMDATFolding>false</EnableCOMDATFolding>
|
||||
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
@ -160,6 +163,7 @@
|
||||
<AdditionalOptions>/DYNAMICBASE "legacy_stdio_definitions.lib" %(AdditionalOptions) /VERBOSE</AdditionalOptions>
|
||||
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
|
||||
<AdditionalDependencies>dxsdk3/sdk/lib/*.lib;winmm.lib;kernel32.lib;user32.lib;gdi32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
|
29
msvc5/msvc5.dsw
Normal file
29
msvc5/msvc5.dsw
Normal file
@ -0,0 +1,29 @@
|
||||
Microsoft Developer Studio Workspace File, Format Version 5.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "sb2decomp"=".\sb2decomp\sb2decomp.dsp" - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
250
msvc5/sb2decomp/sb2decomp.dsp
Normal file
250
msvc5/sb2decomp/sb2decomp.dsp
Normal file
@ -0,0 +1,250 @@
|
||||
# Microsoft Developer Studio Project File - Name="sb2decomp" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 5.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Application" 0x0101
|
||||
|
||||
CFG=sb2decomp - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "sb2decomp.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "sb2decomp.mak" CFG="sb2decomp - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "sb2decomp - Win32 Release" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "sb2decomp - Win32 Debug" (based on "Win32 (x86) Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "sb2decomp - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD CPP /nologo /W3 /Gi /GX /O2 /I "..\..\dxsdk3\sdk\inc" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /libpath:"..\..\dxsdk3\sdk\lib"
|
||||
|
||||
!ELSEIF "$(CFG)" == "sb2decomp - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD CPP /nologo /W3 /Gm /Gi /GX /Zi /Od /I "..\..\dxsdk3\sdk\inc" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept /libpath:"..\..\dxsdk3\sdk\lib"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "sb2decomp - Win32 Release"
|
||||
# Name "sb2decomp - Win32 Debug"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\blupi.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\button.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\button.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\ddutil.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\ddutil.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\decblock.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\decblupi.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\decdesign.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\decio.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\decmove.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\decnet.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\decor.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\decor.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\dectables.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\def.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\event.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\event.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\jauge.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\jauge.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\menu.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\menu.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\misc.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\misc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\movie.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\movie.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\network.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\network.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\obstacle.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\pixmap.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\pixmap.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\pixtables.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\resource.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\resource1.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\sound.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\sound.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\text.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\text.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\texttables.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\wave.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\wave.h
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
@ -21,10 +21,9 @@
|
||||
#include "movie.h"
|
||||
#include "button.h"
|
||||
#include "menu.h"
|
||||
#include "jauge.h"
|
||||
#include "event.h"
|
||||
#include "misc.h"
|
||||
#include "network.h"
|
||||
#include "misc.h"
|
||||
|
||||
// Define Globals
|
||||
|
||||
@ -335,7 +334,7 @@ void SetDecor(void)
|
||||
|
||||
phase = g_pEvent->GetPhase();
|
||||
|
||||
rect = { 0, 0, LXIMAGE, LYIMAGE };
|
||||
rect = RECT( 0, 0, LXIMAGE, LYIMAGE );
|
||||
|
||||
if (phase == WM_PHASE_PLAY || phase == WM_PHASE_PLAYTEST || phase == WM_PHASE_BUILD)
|
||||
{
|
||||
@ -483,7 +482,7 @@ LRESULT CALLBACK WindowProc(HWND hWnd, UINT message,
|
||||
}
|
||||
if (!g_bFullScreen && g_bTermInit)
|
||||
{
|
||||
g_pPixmap->BackgroundCache(CHLITTLE, "little.blp", { 256, 96 }, { DIMLITTLEX , DIMLITTLEY }, TRUE);
|
||||
g_pPixmap->BackgroundCache(CHLITTLE, "little.blp", POINT( 256, 96 ), POINT( DIMLITTLEX , DIMLITTLEY ), TRUE);
|
||||
g_pPixmap->SetTransparent(CHLITTLE, RGB(0, 0, 255)); // bleu
|
||||
|
||||
g_pPixmap->SavePalette();
|
||||
|
@ -6,7 +6,9 @@
|
||||
//#include <stdio.h>
|
||||
//#include <ddraw.h>
|
||||
|
||||
//#include <windef.h>
|
||||
#ifndef POINT
|
||||
#include <windef.h>
|
||||
#endif
|
||||
|
||||
#include "button.h"
|
||||
#include "misc.h"
|
||||
|
20
src/button.h
20
src/button.h
@ -1,6 +1,8 @@
|
||||
#pragma once
|
||||
#ifndef BUTTON_H
|
||||
#define BUTTON_H
|
||||
|
||||
#include <windef.h>
|
||||
|
||||
//#include <windef.h>
|
||||
#include "decor.h"
|
||||
#include "pixmap.h"
|
||||
#include "sound.h"
|
||||
@ -50,19 +52,21 @@ protected:
|
||||
CSound* m_pSound;
|
||||
int m_type; // type de bouton
|
||||
BOOL m_bEnable; // TRUE si bouton actif
|
||||
BOOL m_bHide; // TRUE si bouton cach<EFBFBD>
|
||||
UINT m_message; // message envoy<EFBFBD> si bouton actionn<6E>
|
||||
BOOL m_bHide; // TRUE si bouton caché
|
||||
UINT m_message; // message envoyé si bouton actionné
|
||||
POINT m_pos; // coin sup/gauche
|
||||
POINT m_dim; // dimensions
|
||||
int m_state;
|
||||
int m_mouseState;
|
||||
int m_iconMenu[20]; // ic<EFBFBD>nes du sous-menu
|
||||
int m_iconMenu[20]; // icônes du sous-menu
|
||||
int m_toolTips[20]; // info-bulles
|
||||
int m_nbMenu; // nb de case du sous-menu
|
||||
int m_nbToolTips; // nb d'info-bulles
|
||||
int m_selMenu;
|
||||
int m_bSomething; // sous-menu s<EFBFBD>lectionn<EFBFBD>
|
||||
BOOL m_bMouseDown; // TRUE -> bouton souris press<EFBFBD>
|
||||
int m_bSomething; // sous-menu sélectionné
|
||||
BOOL m_bMouseDown; // TRUE -> bouton souris pressé
|
||||
BOOL m_bMinimizeRedraw;
|
||||
BOOL m_bRedraw;
|
||||
};
|
||||
};
|
||||
|
||||
#endif
|
@ -1,3 +1,5 @@
|
||||
#ifndef DDUTIL_H
|
||||
#define DDUTIL_H
|
||||
/*==========================================================================
|
||||
*
|
||||
* Copyright (C) 1995 Microsoft Corporation. All Rights Reserved.
|
||||
@ -9,7 +11,6 @@
|
||||
|
||||
#define DIRECTDRAW_VERSION 0x0500
|
||||
|
||||
#pragma once
|
||||
#include <ddraw.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
@ -28,3 +29,5 @@ extern HRESULT DDSetColorKey2(IDirectDrawSurface* pdds, COLORREF rg
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif
|
@ -576,6 +576,8 @@ BOOL CDecor::IsRightBorder(POINT pos, POINT offset)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE; // temp.
|
||||
}
|
||||
|
||||
|
||||
@ -600,19 +602,19 @@ void CDecor::AdaptMidBorder(POINT cel)
|
||||
if (!IsValidCel(cel)) return;
|
||||
|
||||
int num = 15;
|
||||
if (!IsRightBorder({ cel.x, cel.y + 1 }, { 0, -1 }))
|
||||
if (!IsRightBorder(POINT( cel.x, cel.y + 1 ), POINT( 0, -1 )))
|
||||
{
|
||||
num &= -2;
|
||||
}
|
||||
if (!IsRightBorder({ cel.x, cel.y + 1 }, { 0, 1 }))
|
||||
if (!IsRightBorder(POINT( cel.x, cel.y + 1 ), POINT( 0, 1 )))
|
||||
{
|
||||
num &= -3;
|
||||
}
|
||||
if (!IsRightBorder({ cel.x + 1, cel.y }, { -1, 0 }))
|
||||
if (!IsRightBorder(POINT( cel.x + 1, cel.y ), POINT( -1, 0 )))
|
||||
{
|
||||
num &= -5;
|
||||
}
|
||||
if (!IsRightBorder({ cel.x - 1, cel.y }, { 1, 0 }))
|
||||
if (!IsRightBorder(POINT( cel.x - 1, cel.y ), POINT( 1, 0 )))
|
||||
{
|
||||
num &= -9;
|
||||
}
|
||||
@ -678,19 +680,19 @@ void CDecor::AdaptMidBorder(POINT cel)
|
||||
if (num2 == -1 || (num2 >= 264 && num2 <= 282))
|
||||
{
|
||||
num = 15;
|
||||
if (!IsFromage(cel + POINT{ 0,1 }))
|
||||
if (!IsFromage(POINT(cel.x, cel.y + 1)))
|
||||
{
|
||||
num &= -2;
|
||||
}
|
||||
if (!IsFromage(cel - POINT{ 0,1 }))
|
||||
if (!IsFromage(POINT(cel.x, cel.y - 1)))
|
||||
{
|
||||
num &= -3;
|
||||
}
|
||||
if (!IsFromage(cel + POINT{ 1,0 }))
|
||||
if (!IsFromage(POINT(cel.x + 1, cel.y)))
|
||||
{
|
||||
num &= -5;
|
||||
}
|
||||
if (!IsFromage(cel - POINT{ 1,0 }))
|
||||
if (!IsFromage(POINT(cel.x - 1, cel.y)))
|
||||
{
|
||||
num &= -9;
|
||||
}
|
||||
@ -717,19 +719,19 @@ void CDecor::AdaptMidBorder(POINT cel)
|
||||
if (num2 == -1 || (num2 >= 285 && num2 <= 303 && num2 != 301))
|
||||
{
|
||||
num = 15;
|
||||
if (!IsGrotte(cel+POINT{0,1}))
|
||||
if (!IsGrotte(POINT(cel.x, cel.y + 1)))
|
||||
{
|
||||
num &= -2;
|
||||
}
|
||||
if (!IsGrotte(cel-POINT{0,1}))
|
||||
if (!IsGrotte(POINT(cel.x, cel.y - 1)))
|
||||
{
|
||||
num &= -3;
|
||||
}
|
||||
if (!IsGrotte(cel+POINT{1,0}))
|
||||
if (!IsGrotte(POINT(cel.x + 1, cel.y)))
|
||||
{
|
||||
num &= -5;
|
||||
}
|
||||
if (!IsGrotte(cel-POINT{1,0}))
|
||||
if (!IsGrotte(POINT(cel.x - 1, cel.y)))
|
||||
{
|
||||
num &= -9;
|
||||
}
|
||||
@ -753,10 +755,10 @@ void CDecor::AdaptMidBorder(POINT cel)
|
||||
void CDecor::AdaptBorder(POINT cel)
|
||||
{
|
||||
AdaptMidBorder(cel);
|
||||
AdaptMidBorder(cel + POINT{1, 0});
|
||||
AdaptMidBorder(cel - POINT{1, 0});
|
||||
AdaptMidBorder(cel + POINT{ 0,1 });
|
||||
AdaptMidBorder(cel - POINT{ 0,1 });
|
||||
AdaptMidBorder(POINT(cel.x + 1, cel.y));
|
||||
AdaptMidBorder(POINT(cel.x - 1, cel.y));
|
||||
AdaptMidBorder(POINT(cel.x, cel.y + 1));
|
||||
AdaptMidBorder(POINT(cel.x, cel.y - 1));
|
||||
int icon = m_decor[cel.x][cel.y].icon;
|
||||
if (icon != -1 && !IsPassIcon(icon))
|
||||
{
|
||||
|
@ -283,13 +283,14 @@ RECT CDecor::BlupiRect(POINT pos)
|
||||
// prevent blupi from getting stuck in blocks
|
||||
void CDecor::BlupiAdjust()
|
||||
{
|
||||
int i;
|
||||
RECT tinyRect = BlupiRect(m_blupiPos);
|
||||
|
||||
if (!DecorDetect(tinyRect))
|
||||
{
|
||||
return;
|
||||
}
|
||||
for (int i = 0; i < 50; i++)
|
||||
for (i = 0; i < 50; i++)
|
||||
{
|
||||
RECT rect = tinyRect;
|
||||
rect.bottom = rect.top + 2;
|
||||
@ -303,7 +304,7 @@ void CDecor::BlupiAdjust()
|
||||
tinyRect.bottom += 2;
|
||||
m_blupiPos.y = m_blupiPos.y + 2;
|
||||
}
|
||||
for (int i = 0; i < 50; i++)
|
||||
for (i = 0; i < 50; i++)
|
||||
{
|
||||
RECT rect = tinyRect;
|
||||
rect.right = rect.left + 2;
|
||||
@ -317,7 +318,7 @@ void CDecor::BlupiAdjust()
|
||||
tinyRect.right += 2;
|
||||
m_blupiPos.x = m_blupiPos.x + 2;
|
||||
}
|
||||
for (int i = 0; i < 50; i++)
|
||||
for (i = 0; i < 50; i++)
|
||||
{
|
||||
RECT rect = tinyRect;
|
||||
rect.left = rect.right - 2;
|
||||
@ -331,7 +332,7 @@ void CDecor::BlupiAdjust()
|
||||
tinyRect.right -= 2;
|
||||
m_blupiPos.x = m_blupiPos.x - 2;
|
||||
}
|
||||
for (int i = 0; i < 50; i++)
|
||||
for (i = 0; i < 50; i++)
|
||||
{
|
||||
RECT rect = tinyRect;
|
||||
rect.right = rect.left + 2;
|
||||
@ -343,7 +344,7 @@ void CDecor::BlupiAdjust()
|
||||
tinyRect.right += 2;
|
||||
m_blupiPos.x = m_blupiPos.x + 2;
|
||||
}
|
||||
for (int i = 0; i < 50; i++)
|
||||
for (i = 0; i < 50; i++)
|
||||
{
|
||||
RECT rect = tinyRect;
|
||||
rect.left = rect.right - 2;
|
||||
@ -1294,7 +1295,7 @@ void CDecor::BlupiStep()
|
||||
{
|
||||
m_blupiVitesse.x -= 2;
|
||||
}
|
||||
if (BlupiBloque({ end.x + m_blupiVitesse.x, end.y }, -1))
|
||||
if (BlupiBloque(POINT( end.x + m_blupiVitesse.x, end.y ), -1))
|
||||
{
|
||||
m_blupiVitesse.x = 0;
|
||||
}
|
||||
@ -1305,7 +1306,7 @@ void CDecor::BlupiStep()
|
||||
{
|
||||
m_blupiVitesse.x += 2;
|
||||
}
|
||||
if (BlupiBloque({ end.x + m_blupiVitesse.x, end.y }, -1))
|
||||
if (BlupiBloque(POINT( end.x + m_blupiVitesse.x, end.y ), -1))
|
||||
{
|
||||
m_blupiVitesse.x = 0;
|
||||
}
|
||||
@ -3678,7 +3679,7 @@ void CDecor::BlupiStep()
|
||||
}
|
||||
if (m_blupiAction == 74 && m_blupiPhase == 128)
|
||||
{
|
||||
POINT blupiPos2 { 0,0 };
|
||||
POINT blupiPos2 = { 0,0 };
|
||||
if (SearchTeleporte(m_blupiPos, blupiPos2))
|
||||
{
|
||||
m_blupiPos = blupiPos2;
|
||||
|
@ -9,12 +9,12 @@
|
||||
POINT CDecor::ScreenPosToCelPos(POINT pos)
|
||||
{
|
||||
if (pos.x >= 0 && pos.x < LXIMAGE && pos.y >= 0 && pos.y < LYIMAGE) {
|
||||
return {
|
||||
(m_posDecor.x + m_dimCelHili.x * -32 + 32 + pos.x) / 64,
|
||||
(m_posDecor.y + m_dimCelHili.y * -32 + 32 + pos.y) / 64
|
||||
};
|
||||
return POINT(
|
||||
(m_posDecor.x + m_dimCelHili.x * -32 + 32 + pos.x) / DIMOBJX,
|
||||
(m_posDecor.y + m_dimCelHili.y * -32 + 32 + pos.y) / DIMOBJY
|
||||
);
|
||||
}
|
||||
else return { -1, -1 };
|
||||
else return POINT( -1, -1 );
|
||||
}
|
||||
|
||||
void CDecor::SetCelPosFromScreenPos(POINT pos)
|
||||
@ -24,8 +24,8 @@ void CDecor::SetCelPosFromScreenPos(POINT pos)
|
||||
|
||||
void CDecor::SetFieldCC38AndStuff(int _foo, int _bar)
|
||||
{
|
||||
m_dimCelHili = { 1, 1 };
|
||||
if (_foo == 2 && _bar != 3 && _bar != 9 && _bar != 10) m_dimCelHili = { 2, 2 };
|
||||
m_dimCelHili = POINT( 1, 1 );
|
||||
if (_foo == 2 && _bar != 3 && _bar != 9 && _bar != 10) m_dimCelHili = POINT( 2, 2 );
|
||||
if (_foo == 3) m_iconLift = _bar;
|
||||
if (_foo == 4) m_iconLift = _bar + 20;
|
||||
if (_foo == 5) m_iconLift = _bar + 40;
|
||||
@ -250,7 +250,7 @@ void CDecor::PlaceItemFromMenu5(POINT cel, int index, BYTE flags, int currentIco
|
||||
pMob->stepRecede = 1;
|
||||
pMob->timeStopStart = 0;
|
||||
pMob->timeStopEnd = 0;
|
||||
pMob->posStart = { cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 4 };
|
||||
pMob->posStart = POINT( cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 4 );
|
||||
pMob->posEnd = pMob->posStart;
|
||||
pMob->posCurrent = pMob->posStart;
|
||||
pMob->step = STEP_STOPSTART;
|
||||
@ -269,7 +269,7 @@ void CDecor::PlaceItemFromMenu5(POINT cel, int index, BYTE flags, int currentIco
|
||||
pMob->stepRecede = 1;
|
||||
pMob->timeStopStart = 0;
|
||||
pMob->timeStopEnd = 0;
|
||||
pMob->posStart = { cel.x * DIMOBJX + 2, cel.y * DIMOBJY };
|
||||
pMob->posStart = POINT( cel.x * DIMOBJX + 2, cel.y * DIMOBJY );
|
||||
pMob->posEnd = pMob->posStart;
|
||||
pMob->posCurrent = pMob->posStart;
|
||||
pMob->step = STEP_STOPSTART;
|
||||
@ -288,7 +288,7 @@ void CDecor::PlaceItemFromMenu5(POINT cel, int index, BYTE flags, int currentIco
|
||||
pMob->stepRecede = 1;
|
||||
pMob->timeStopStart = 0;
|
||||
pMob->timeStopEnd = 0;
|
||||
pMob->posStart = { cel.x * DIMOBJX, cel.y * DIMOBJY };
|
||||
pMob->posStart = POINT( cel.x * DIMOBJX, cel.y * DIMOBJY );
|
||||
pMob->posEnd = pMob->posStart;
|
||||
pMob->posCurrent = pMob->posStart;
|
||||
pMob->step = STEP_STOPSTART;
|
||||
@ -325,7 +325,7 @@ void CDecor::PlaceItemFromMenu5(POINT cel, int index, BYTE flags, int currentIco
|
||||
pMob->stepRecede = 1;
|
||||
pMob->timeStopStart = 0;
|
||||
pMob->timeStopEnd = 0;
|
||||
pMob->posStart = { cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 8 };
|
||||
pMob->posStart = POINT( cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 8 );
|
||||
pMob->posEnd = pMob->posStart;
|
||||
pMob->posCurrent = pMob->posStart;
|
||||
pMob->step = STEP_STOPSTART;
|
||||
@ -396,7 +396,7 @@ void CDecor::PlaceItemFromMenu7(POINT cel, int index, BYTE flags, int currentIco
|
||||
pMob->stepRecede = 1;
|
||||
pMob->timeStopStart = 0;
|
||||
pMob->timeStopEnd = 0;
|
||||
pMob->posStart = { cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 4 };
|
||||
pMob->posStart = POINT( cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 4 );
|
||||
pMob->posEnd = pMob->posStart;
|
||||
pMob->posCurrent = pMob->posStart;
|
||||
pMob->step = STEP_STOPSTART;
|
||||
@ -415,7 +415,7 @@ void CDecor::PlaceItemFromMenu7(POINT cel, int index, BYTE flags, int currentIco
|
||||
pMob->stepRecede = 1;
|
||||
pMob->timeStopStart = 0;
|
||||
pMob->timeStopEnd = 0;
|
||||
pMob->posStart = { cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 8 };
|
||||
pMob->posStart = POINT( cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 8 );
|
||||
pMob->posEnd = pMob->posStart;
|
||||
pMob->posCurrent = pMob->posStart;
|
||||
pMob->step = STEP_STOPSTART;
|
||||
@ -434,7 +434,7 @@ void CDecor::PlaceItemFromMenu7(POINT cel, int index, BYTE flags, int currentIco
|
||||
pMob->stepRecede = 1;
|
||||
pMob->timeStopStart = 0;
|
||||
pMob->timeStopEnd = 0;
|
||||
pMob->posStart = { cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 8 };
|
||||
pMob->posStart = POINT( cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 8 );
|
||||
pMob->posEnd = pMob->posStart;
|
||||
pMob->posCurrent = pMob->posStart;
|
||||
pMob->step = STEP_STOPSTART;
|
||||
@ -453,7 +453,7 @@ void CDecor::PlaceItemFromMenu7(POINT cel, int index, BYTE flags, int currentIco
|
||||
pMob->stepRecede = 1;
|
||||
pMob->timeStopStart = 0;
|
||||
pMob->timeStopEnd = 0;
|
||||
pMob->posStart = { cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 8 };
|
||||
pMob->posStart = POINT( cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 8 );
|
||||
pMob->posEnd = pMob->posStart;
|
||||
pMob->posCurrent = pMob->posStart;
|
||||
pMob->step = STEP_STOPSTART;
|
||||
@ -472,7 +472,7 @@ void CDecor::PlaceItemFromMenu7(POINT cel, int index, BYTE flags, int currentIco
|
||||
pMob->stepRecede = 1;
|
||||
pMob->timeStopStart = 0;
|
||||
pMob->timeStopEnd = 0;
|
||||
pMob->posStart = { cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 6 };
|
||||
pMob->posStart = POINT( cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 6 );
|
||||
pMob->posEnd = pMob->posStart;
|
||||
pMob->posCurrent = pMob->posStart;
|
||||
pMob->step = STEP_STOPSTART;
|
||||
@ -491,7 +491,7 @@ void CDecor::PlaceItemFromMenu7(POINT cel, int index, BYTE flags, int currentIco
|
||||
pMob->stepRecede = 1;
|
||||
pMob->timeStopStart = 0;
|
||||
pMob->timeStopEnd = 0;
|
||||
pMob->posStart = { cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 4 };
|
||||
pMob->posStart = POINT( cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 4 );
|
||||
pMob->posEnd = pMob->posStart;
|
||||
pMob->posCurrent = pMob->posStart;
|
||||
pMob->step = STEP_STOPSTART;
|
||||
@ -510,7 +510,7 @@ void CDecor::PlaceItemFromMenu7(POINT cel, int index, BYTE flags, int currentIco
|
||||
pMob->stepRecede = 1;
|
||||
pMob->timeStopStart = 0;
|
||||
pMob->timeStopEnd = 0;
|
||||
pMob->posStart = { cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 4 };
|
||||
pMob->posStart = POINT( cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 4 );
|
||||
pMob->posEnd = pMob->posStart;
|
||||
pMob->posCurrent = pMob->posStart;
|
||||
pMob->step = STEP_STOPSTART;
|
||||
@ -540,7 +540,7 @@ void CDecor::PlaceItemFromMenu7(POINT cel, int index, BYTE flags, int currentIco
|
||||
pMob->stepRecede = 1;
|
||||
pMob->timeStopStart = 0;
|
||||
pMob->timeStopEnd = 0;
|
||||
pMob->posStart = { cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 6 };
|
||||
pMob->posStart = POINT( cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 6 );
|
||||
pMob->posEnd = pMob->posStart;
|
||||
pMob->posCurrent = pMob->posStart;
|
||||
pMob->step = STEP_STOPSTART;
|
||||
@ -573,7 +573,7 @@ void CDecor::PlaceItemFromMenu7(POINT cel, int index, BYTE flags, int currentIco
|
||||
pMob->stepRecede = 1;
|
||||
pMob->timeStopStart = 0;
|
||||
pMob->timeStopEnd = 0;
|
||||
pMob->posStart = { cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 6 };
|
||||
pMob->posStart = POINT( cel.x * DIMOBJX + 2, cel.y * DIMOBJY + 6 );
|
||||
pMob->posEnd = pMob->posStart;
|
||||
pMob->posCurrent = pMob->posStart;
|
||||
pMob->step = STEP_STOPSTART;
|
||||
|
@ -30,7 +30,7 @@ BOOL CDecor::DeleteMission(int user, int mission, BOOL bUser)
|
||||
BOOL CDecor::Write(int gamer, int mission, BOOL bUser)
|
||||
{
|
||||
char filename[FILENAME_MAX];
|
||||
DescFile* pBuffer;
|
||||
DescFile* pBuffer = NULL;
|
||||
FILE* file;
|
||||
int* blupiDir;
|
||||
POINT* blupiPos;
|
||||
|
@ -9,9 +9,8 @@
|
||||
void CDecor::MoveObjectPollution()
|
||||
{
|
||||
POINT blupiPos = m_blupiPos;
|
||||
POINT pos;
|
||||
POINT pos = { 0, 0 };
|
||||
BOOL bPollution;
|
||||
pos = { 0, 0 };
|
||||
int num = 20;
|
||||
bPollution = FALSE;
|
||||
if (m_blupiAction == 3)
|
||||
@ -388,7 +387,7 @@ BOOL CDecor::ObjectDelete(POINT pos, int type)
|
||||
|
||||
void CDecor::MoveObjectStep()
|
||||
{
|
||||
m_blupiVector = { 0, 0 };
|
||||
m_blupiVector = POINT( 0, 0 );
|
||||
m_blupiTransport = -1;
|
||||
for (int i = 0; i < MAXMOVEOBJECT; i++)
|
||||
{
|
||||
@ -436,7 +435,7 @@ void CDecor::MoveObjectStepLine(int i)
|
||||
MoveObject moveObject;
|
||||
POINT tinyPoint;
|
||||
BOOL flag = FALSE;
|
||||
RECT tinyRect { 0, 0, 0, 0 };
|
||||
RECT tinyRect = { 0, 0, 0, 0 };
|
||||
if (m_moveObject[i].type == TYPE_ASCENSEUR ||
|
||||
m_moveObject[i].type == TYPE_ASCENSEURs ||
|
||||
m_moveObject[i].type == TYPE_ASCENSEURsi &&
|
||||
@ -1540,7 +1539,7 @@ void CDecor::DynamiteStart(int i, int dx, int dy)
|
||||
src2.right = m_moveObject[i].posCurrent.x + 60;
|
||||
src2.top = m_moveObject[i].posCurrent.y;
|
||||
src2.bottom = m_moveObject[i].posCurrent.y + 20;
|
||||
RECT tinyRect { 0, 0, 0, 0 };
|
||||
RECT tinyRect = { 0, 0, 0, 0 };
|
||||
if (IntersectRect(&tinyRect, &src2, &src))
|
||||
{
|
||||
if (m_moveObject[i].type == TYPE_CAISSE)
|
||||
@ -1599,7 +1598,7 @@ int CDecor::AscenseurDetect(RECT rect, POINT oldpos, POINT newpos)
|
||||
src.bottom = m_moveObject[i].posCurrent.y + 16;
|
||||
if (num < 30)
|
||||
{
|
||||
RECT tinyRect { 0, 0, 0, 0 };
|
||||
RECT tinyRect = { 0, 0, 0, 0 };
|
||||
if (IntersectRect(&tinyRect, &src, &rect))
|
||||
{
|
||||
return i;
|
||||
@ -1612,7 +1611,7 @@ int CDecor::AscenseurDetect(RECT rect, POINT oldpos, POINT newpos)
|
||||
src2.bottom -= num / 30 * num2;
|
||||
for (int j = 0; j <= num / 30; j++)
|
||||
{
|
||||
RECT tinyRect { 0, 0, 0, 0 };
|
||||
RECT tinyRect = { 0, 0, 0, 0 };
|
||||
if (IntersectRect(&tinyRect, &src, &src2))
|
||||
{
|
||||
return i;
|
||||
@ -1689,12 +1688,13 @@ void CDecor::UpdateCaisse()
|
||||
BOOL CDecor::TestPushCaisse(int i, POINT pos, BOOL bPop)
|
||||
{
|
||||
POINT move;
|
||||
int j;
|
||||
|
||||
move.x = pos.x - m_moveObject[i].posCurrent.x;
|
||||
move.y = 0;
|
||||
SearchLinkCaisse(i, bPop);
|
||||
int y = m_moveObject[i].posCurrent.y;
|
||||
for (int j = 0; j < m_nbLinkCaisse; j++)
|
||||
for (j = 0; j < m_nbLinkCaisse; j++)
|
||||
{
|
||||
i = m_linkCaisse[j];
|
||||
if (!TestPushOneCaisse(i, move, y))
|
||||
@ -1702,7 +1702,7 @@ BOOL CDecor::TestPushCaisse(int i, POINT pos, BOOL bPop)
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
for (int j = 0; j < m_nbLinkCaisse; j++)
|
||||
for (j = 0; j < m_nbLinkCaisse; j++)
|
||||
{
|
||||
i = m_linkCaisse[j];
|
||||
int num = i;
|
||||
@ -1780,7 +1780,7 @@ void CDecor::SearchLinkCaisse(int rank, BOOL bPop)
|
||||
src2.top = m_moveObject[num2].posCurrent.y - 1;
|
||||
src2.right = src2.left + DIMOBJX + 1;
|
||||
src2.bottom = src2.top + DIMOBJY + 1;
|
||||
RECT tinyRect { 0,0,0,0 };
|
||||
RECT tinyRect = { 0,0,0,0 };
|
||||
if (IntersectRect(&tinyRect, &src2, &src) && AddLinkCaisse(num2))
|
||||
{
|
||||
flag = TRUE;
|
||||
@ -1903,7 +1903,7 @@ int CDecor::MockeryDetect(POINT pos)
|
||||
src2.right = m_moveObject[i].posCurrent.x + DIMBLUPIX;
|
||||
src2.top = m_moveObject[i].posCurrent.y + 36;
|
||||
src2.bottom = m_moveObject[i].posCurrent.y + DIMBLUPIY;
|
||||
RECT tinyRect{ 0,0,0,0 };
|
||||
RECT tinyRect = { 0,0,0,0 };
|
||||
if (IntersectRect(&tinyRect, &src2, &src))
|
||||
{
|
||||
if (m_moveObject[i].type == TYPE_CREATURE)
|
||||
@ -1955,7 +1955,7 @@ BOOL CDecor::BlupiElectro(POINT pos)
|
||||
src2.right = m_blupiPos.x + DIMBLUPIX + 16 + 40;
|
||||
src2.top = m_blupiPos.y + 11 - 40;
|
||||
src2.bottom = m_blupiPos.y + DIMBLUPIY - 2 + 40;
|
||||
RECT tinyRect{ 0,0,0,0 };
|
||||
RECT tinyRect = { 0,0,0,0 };
|
||||
return IntersectRect(&tinyRect, &src, &src2);
|
||||
}
|
||||
|
||||
@ -1975,7 +1975,7 @@ void CDecor::MoveObjectFollow(POINT pos)
|
||||
src2.right = m_moveObject[i].posCurrent.x + DIMBLUPIX + 100;
|
||||
src2.top = m_moveObject[i].posCurrent.y - 100;
|
||||
src2.bottom = m_moveObject[i].posCurrent.y + DIMBLUPIY + 100;
|
||||
RECT tinyRect { 0, 0, 0, 0 };
|
||||
RECT tinyRect = { 0, 0, 0, 0 };
|
||||
if (IntersectRect(&tinyRect, &src2, &src))
|
||||
{
|
||||
m_moveObject[i].type = TYPE_BOMBEFOLLOW2;
|
||||
@ -2053,8 +2053,7 @@ int CDecor::MoveObjectDetect(POINT pos, BOOL* pbNear)
|
||||
src3.top = m_moveObject[i].posCurrent.y + 10;
|
||||
src3.bottom = m_moveObject[i].posCurrent.y + DIMBLUPIY - 32;
|
||||
}
|
||||
RECT rect;
|
||||
rect = { 0, 0, 0, 0 };
|
||||
RECT rect = { 0, 0, 0, 0 };
|
||||
if (IntersectRect(&rect, &src3, &src))
|
||||
{
|
||||
*pbNear = TRUE;
|
||||
@ -2091,7 +2090,7 @@ int CDecor::MoveAscenseurDetect(POINT pos, int height)
|
||||
src2.right = m_moveObject[i].posCurrent.x + DIMOBJX;
|
||||
src2.top = m_moveObject[i].posCurrent.y;
|
||||
src2.bottom = m_moveObject[i].posCurrent.y + 16;
|
||||
RECT tinyRect { 0, 0, 0, 0 };
|
||||
RECT tinyRect = { 0, 0, 0, 0 };
|
||||
if (IntersectRect(&tinyRect, &src2, &src))
|
||||
{
|
||||
return i;
|
||||
@ -2117,7 +2116,7 @@ int CDecor::MoveChargeDetect(POINT pos)
|
||||
src2.right = m_moveObject[i].posCurrent.x + DIMBLUPIX + 10;
|
||||
src2.top = m_moveObject[i].posCurrent.y + 36;
|
||||
src2.bottom = m_moveObject[i].posCurrent.y + DIMBLUPIY;
|
||||
RECT tinyRect { 0, 0, 0, 0 };
|
||||
RECT tinyRect = { 0, 0, 0, 0 };
|
||||
if (IntersectRect(&tinyRect, &src2, &src))
|
||||
{
|
||||
return i;
|
||||
@ -2144,7 +2143,7 @@ int CDecor::MovePersoDetect(POINT pos)
|
||||
src2.right = m_moveObject[i].posCurrent.x + DIMBLUPIX + 16;
|
||||
src2.top = m_moveObject[i].posCurrent.y + 36;
|
||||
src2.bottom = m_moveObject[i].posCurrent.y + DIMBLUPIY;
|
||||
RECT tinyRect { 0, 0, 0, 0 };
|
||||
RECT tinyRect = { 0, 0, 0, 0 };
|
||||
if (IntersectRect(&tinyRect, &src2, &src))
|
||||
{
|
||||
return i;
|
||||
@ -2178,7 +2177,7 @@ int CDecor::MoveBalleDetect(POINT pos)
|
||||
rcSrc1.left = m_moveObject->posCurrent.x + 16;
|
||||
rcSrc1.bottom = m_moveObject->posCurrent.y + 50;
|
||||
rcSrc1.top = m_moveObject->posCurrent.y + 16;
|
||||
rcDst = { 0, 0, 0, 0 };
|
||||
rcDst = RECT( 0, 0, 0, 0 );
|
||||
if (IntersectRect(&rcDst, &rcSrc1, &rcSrc2))
|
||||
return i;
|
||||
}
|
||||
@ -2240,15 +2239,17 @@ int CDecor::SortGetType(int type)
|
||||
void CDecor::MoveObjectSort()
|
||||
{
|
||||
MoveObject src;
|
||||
int i;
|
||||
int num = 0;
|
||||
for (int i = 0; i < MAXMOVEOBJECT; i++)
|
||||
|
||||
for (i = 0; i < MAXMOVEOBJECT; i++)
|
||||
{
|
||||
if (m_moveObject[i].type != 0)
|
||||
{
|
||||
MoveObjectCopy(&m_moveObject[num++], &m_moveObject[i]);
|
||||
}
|
||||
}
|
||||
for (int i = num; i < MAXMOVEOBJECT; i++)
|
||||
for (i = num; i < MAXMOVEOBJECT; i++)
|
||||
{
|
||||
m_moveObject[i].type = 0;
|
||||
}
|
||||
@ -2260,7 +2261,7 @@ void CDecor::MoveObjectSort()
|
||||
do
|
||||
{
|
||||
flag = FALSE;
|
||||
for (int i = 0; i < num - 1; i++)
|
||||
for (i = 0; i < num - 1; i++)
|
||||
{
|
||||
if (SortGetType(m_moveObject[i].type) > SortGetType(m_moveObject[i + 1].type))
|
||||
{
|
||||
|
@ -72,7 +72,11 @@ void CDecor::NetDataFlush()
|
||||
|
||||
void CDecor::NetFUN_155e0(BYTE _foo, short _bar)
|
||||
{
|
||||
char data[4]{ 4, _foo, _bar & 0xff, _bar >> 8 };
|
||||
char data[4];
|
||||
data[0] = 4;
|
||||
data[1] = _foo;
|
||||
data[2] = _bar & 0xff;
|
||||
data[3] = _bar >> 8;
|
||||
m_pNetwork->Send(&data, 4, DPSEND_GUARANTEED);
|
||||
return;
|
||||
}
|
||||
@ -194,7 +198,7 @@ void CDecor::NotifPush(char *str)
|
||||
}
|
||||
strcpy(m_notifText[i], str);
|
||||
m_notifTime = NOTIFDELAY;
|
||||
m_pSound->PlayImage(SOUND_TRESOR, { LXIMAGE / 2, LYIMAGE / 2 }, -1);
|
||||
m_pSound->PlayImage(SOUND_TRESOR, POINT( LXIMAGE / 2, LYIMAGE / 2 ), -1);
|
||||
}
|
||||
|
||||
void CDecor::NotifStep()
|
||||
|
124
src/decor.cpp
124
src/decor.cpp
@ -75,9 +75,9 @@ void CDecor::Create(HWND hWnd, CSound* pSound, CPixmap* pPixmap, CNetwork* pNetw
|
||||
m_bJeepStop = FALSE;
|
||||
InitDecor();
|
||||
|
||||
m_jauges[0].Create(m_hWnd, m_pPixmap, m_pSound, { 169, 450 }, 1, FALSE);
|
||||
m_jauges[0].Create(m_hWnd, m_pPixmap, m_pSound, POINT( 169, 450 ), 1, FALSE);
|
||||
m_jauges[0].SetHide(TRUE);
|
||||
m_jauges[1].Create(m_hWnd, m_pPixmap, m_pSound, { 171, 450 }, 3, FALSE);
|
||||
m_jauges[1].Create(m_hWnd, m_pPixmap, m_pSound, POINT( 171, 450 ), 3, FALSE);
|
||||
m_jauges[1].SetHide(TRUE);
|
||||
NetMessageIndexFlush();
|
||||
NotifFlush();
|
||||
@ -85,14 +85,13 @@ void CDecor::Create(HWND hWnd, CSound* pSound, CPixmap* pPixmap, CNetwork* pNetw
|
||||
|
||||
BOOL CDecor::LoadImages()
|
||||
{
|
||||
POINT totalDim, iconDim;
|
||||
POINT totalDim = { LXIMAGE, LYIMAGE };
|
||||
POINT iconDim = { 0, 0 };
|
||||
char filename[52];
|
||||
|
||||
if (m_lastRegion == m_region) return TRUE;
|
||||
m_lastRegion = m_region;
|
||||
|
||||
totalDim = { LXIMAGE, LYIMAGE };
|
||||
iconDim = { 0, 0 };
|
||||
sprintf(filename, "decor%.3d.blp", m_region);
|
||||
|
||||
return m_pPixmap->BackgroundCache(CHDECOR, filename, totalDim, iconDim, FALSE);
|
||||
@ -106,8 +105,9 @@ void CDecor::InitGamer()
|
||||
|
||||
void CDecor::InitDecor()
|
||||
{
|
||||
m_posDecor = { 0, 0 };
|
||||
m_dimDecor = { 100, 100 };
|
||||
int i;
|
||||
m_posDecor = POINT( 0, 0 );
|
||||
m_dimDecor = POINT( 100, 100 );
|
||||
m_music = 1;
|
||||
m_region = 2;
|
||||
m_missionTitle[0] = '\0';
|
||||
@ -134,7 +134,7 @@ void CDecor::InitDecor()
|
||||
m_moveObject[0].stepRecede = 1;
|
||||
m_moveObject[0].timeStopStart = 0;
|
||||
m_moveObject[0].timeStopEnd = 0;
|
||||
m_moveObject[0].posStart = { 258, 196 };
|
||||
m_moveObject[0].posStart = POINT( 258, 196 );
|
||||
m_moveObject[0].posEnd = m_moveObject[0].posStart;
|
||||
m_moveObject[0].posCurrent = m_moveObject[0].posStart;
|
||||
m_moveObject[0].phase = 0;
|
||||
@ -147,7 +147,7 @@ void CDecor::InitDecor()
|
||||
m_moveObject[1].stepAdvance = 1;
|
||||
m_moveObject[1].timeStopStart = 0;
|
||||
m_moveObject[1].timeStopEnd = 0;
|
||||
m_moveObject[1].posStart = { 322, 196 };
|
||||
m_moveObject[1].posStart = POINT( 322, 196 );
|
||||
m_moveObject[1].posEnd = m_moveObject[1].posStart;
|
||||
m_moveObject[1].posCurrent = m_moveObject[1].posStart;
|
||||
m_moveObject[1].phase = 0;
|
||||
@ -155,13 +155,13 @@ void CDecor::InitDecor()
|
||||
m_moveObject[1].time = 0;
|
||||
m_moveObject[1].channel = CHELEMENT;
|
||||
m_moveObject[1].icon = 29;
|
||||
for (int i = 0; i < MAXFIFOPOS; i++)
|
||||
for (i = 0; i < MAXFIFOPOS; i++)
|
||||
{
|
||||
m_blupiFifoPos[i] = { 0, 0 };
|
||||
m_blupiFifoPos[i] = POINT( 0, 0 );
|
||||
}
|
||||
for (int i = 0; i < MAXNETPLAYER; i++)
|
||||
for (i = 0; i < MAXNETPLAYER; i++)
|
||||
{
|
||||
m_blupiStartPos[i] = { 194, 192 + BLUPIOFFY };
|
||||
m_blupiStartPos[i] = POINT( 194, 192 + BLUPIOFFY );
|
||||
m_blupiStartDir[i] = DIR_RIGHT;
|
||||
}
|
||||
m_blupiAction = ACTION_STOP;
|
||||
@ -190,7 +190,7 @@ void CDecor::InitDecor()
|
||||
m_blupiActionOuf = 0;
|
||||
m_blupiTimeNoAsc = 0;
|
||||
m_blupiTimeMockery = 0;
|
||||
m_blupiVitesse = { 0, 0 };
|
||||
m_blupiVitesse = POINT( 0, 0 );
|
||||
m_blupiValidPos = m_blupiStartPos[0];
|
||||
m_blupiEnergyUnused = 100;
|
||||
m_blupiFront = FALSE;
|
||||
@ -317,7 +317,7 @@ void CDecor::PlayPrepare(BOOL bTest)
|
||||
MoveObjectSort();
|
||||
UpdateCaisse();
|
||||
m_scrollPoint = m_blupiPos;
|
||||
m_scrollAdd = { 0, 0 };
|
||||
m_scrollAdd = POINT( 0, 0 );
|
||||
m_blupiPosHelico.x = -1;
|
||||
m_nbLinkCaisse = 0;
|
||||
m_bHelicoMarch = FALSE;
|
||||
@ -420,6 +420,7 @@ int CDecor::GetIconPerso()
|
||||
void CDecor::Build(RECT rect)
|
||||
{
|
||||
int num = 1;
|
||||
int i, j;
|
||||
POINT tinyPoint;
|
||||
tinyPoint.x = 0;
|
||||
RECT lastClip;
|
||||
@ -430,11 +431,11 @@ void CDecor::Build(RECT rect)
|
||||
POINT posDecor = DecorNextAction();
|
||||
POINT pos = { posDecor.x * 2 / 3 % DIMDECORX, posDecor.y * 2 / 3 % DIMDECORY };
|
||||
|
||||
for (int i = 0; i < ((DIMDECORX - DIMDECORX / LXIMAGE * LXIMAGE) ? 2 : 1) + LXIMAGE / DIMDECORX; i++)
|
||||
for (i = 0; i < ((DIMDECORX - DIMDECORX / LXIMAGE * LXIMAGE) ? 2 : 1) + LXIMAGE / DIMDECORX; i++)
|
||||
{
|
||||
tinyPoint.y = 0;
|
||||
rect.top = pos.y;
|
||||
for (int j = 0; j < ((DIMDECORY - DIMDECORY / LYIMAGE * LYIMAGE) ? 2 : 1) + LYIMAGE / DIMDECORY; j++)
|
||||
for (j = 0; j < ((DIMDECORY - DIMDECORY / LYIMAGE * LYIMAGE) ? 2 : 1) + LYIMAGE / DIMDECORY; j++)
|
||||
{
|
||||
rect.left = i ? 0 : pos.x;
|
||||
rect.right = DIMDECORX;
|
||||
@ -448,9 +449,9 @@ void CDecor::Build(RECT rect)
|
||||
}
|
||||
|
||||
tinyPoint.x = -posDecor.x % DIMOBJX - DIMOBJX;
|
||||
for (int i = posDecor.x / DIMOBJX - 1; i < posDecor.x / DIMOBJX + LXIMAGE / DIMOBJX + 3; i++) {
|
||||
for (i = posDecor.x / DIMOBJX - 1; i < posDecor.x / DIMOBJX + LXIMAGE / DIMOBJX + 3; i++) {
|
||||
tinyPoint.y = -posDecor.y % DIMOBJY + 2 - DIMOBJY;
|
||||
for (int j = posDecor.y / DIMOBJY - 1; j < posDecor.y / DIMOBJY + LYIMAGE / DIMOBJY + 2; j++)
|
||||
for (j = posDecor.y / DIMOBJY - 1; j < posDecor.y / DIMOBJY + LYIMAGE / DIMOBJY + 2; j++)
|
||||
{
|
||||
if (i >= 0 && i < MAXCELX && j >= 0 && j < MAXCELY)
|
||||
{
|
||||
@ -481,10 +482,10 @@ void CDecor::Build(RECT rect)
|
||||
}
|
||||
|
||||
tinyPoint.x = -posDecor.x % DIMOBJX;
|
||||
for (int i = posDecor.x / DIMOBJX; i < posDecor.x / DIMOBJX + LXIMAGE / DIMOBJX + 2; i++)
|
||||
for (i = posDecor.x / DIMOBJX; i < posDecor.x / DIMOBJX + LXIMAGE / DIMOBJX + 2; i++)
|
||||
{
|
||||
tinyPoint.y = -posDecor.y % DIMOBJY;
|
||||
for (int j = posDecor.y / DIMOBJY; j < posDecor.y / DIMOBJY + LYIMAGE / DIMOBJY + 2; j++)
|
||||
for (j = posDecor.y / DIMOBJY; j < posDecor.y / DIMOBJY + LYIMAGE / DIMOBJY + 2; j++)
|
||||
{
|
||||
if (i >= 0 && i < MAXCELX && j >= 0 && j < MAXCELY && m_decor[i][j].icon != -1)
|
||||
{
|
||||
@ -559,18 +560,18 @@ void CDecor::Build(RECT rect)
|
||||
m_blupiSec = SEC_HIDE;
|
||||
if (m_blupiTimeShield > 25 || m_time % 4 < 2)
|
||||
{
|
||||
m_pPixmap->DrawIcon(CHTEMP, CHOBJECT, 0xF5, { 0, 0 }, 0, TRUE);
|
||||
m_pPixmap->DrawIcon(CHTEMP, CHOBJECT, 0xF5, POINT( 0, 0 ), 0, TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pPixmap->DrawIcon(CHTEMP, GetBlupiChannelStandard(), m_blupiIcon, pos, 1, FALSE);
|
||||
m_pPixmap->DrawIcon(CHTEMP, CHOBJECT, 0xED, { 0, 0 }, 0, TRUE);
|
||||
m_pPixmap->DrawIcon(CHTEMP, CHOBJECT, 0xED, POINT( 0, 0 ), 0, TRUE);
|
||||
}
|
||||
}
|
||||
m_pPixmap->QuickIcon(GetBlupiChannelStandard(), m_blupiIcon, tinyPoint);
|
||||
}
|
||||
|
||||
for (int i = 0; i < MAXMOVEOBJECT; i++)
|
||||
for (i = 0; i < MAXMOVEOBJECT; i++)
|
||||
{
|
||||
if (m_moveObject[i].type != 0 && m_moveObject[i].posCurrent.x >= posDecor.x - 64 && m_moveObject[i].posCurrent.y >= posDecor.y - 64 && m_moveObject[i].posCurrent.x <= posDecor.x + LXIMAGE && m_moveObject[i].posCurrent.y <= posDecor.y + LYIMAGE && (m_moveObject[i].type < 8 || m_moveObject[i].type > 11) && (m_moveObject[i].type < 90 || m_moveObject[i].type > 95) && (m_moveObject[i].type < 98 || m_moveObject[i].type > 100) && m_moveObject[i].type != 53 && m_moveObject[i].type != 1 && m_moveObject[i].type != 47 && m_moveObject[i].type != 48)
|
||||
{
|
||||
@ -589,9 +590,9 @@ void CDecor::Build(RECT rect)
|
||||
m_pPixmap->QuickIcon(m_moveObject[i].channel, m_moveObject[i].icon, tinyPoint);
|
||||
if (m_moveObject[i].type == 30)
|
||||
{
|
||||
for (int l = 0; l < sizeof(table_drinkoffset) / sizeof(int); l++)
|
||||
for (int L = 0; L < sizeof(table_drinkoffset) / sizeof(int); L++)
|
||||
{
|
||||
int num4 = (m_time + table_drinkoffset[l]) % 50;
|
||||
int num4 = (m_time + table_drinkoffset[L]) % 50;
|
||||
int rank = table_drinkeffect[num4 % 5];
|
||||
POINT tinyPoint2 = { tinyPoint.x + 2, tinyPoint.y - num4 * 3 };
|
||||
POINT pos2 = tinyPoint2;
|
||||
@ -605,10 +606,10 @@ void CDecor::Build(RECT rect)
|
||||
}
|
||||
}
|
||||
tinyPoint.x = -posDecor.x % 64;
|
||||
for (int i = posDecor.x / 64; i < posDecor.x / 64 + LXIMAGE / 64 + 2; i++)
|
||||
for (i = posDecor.x / 64; i < posDecor.x / 64 + LXIMAGE / 64 + 2; i++)
|
||||
{
|
||||
tinyPoint.y = 0 - posDecor.y % 64;
|
||||
for (int j = posDecor.y / 64; j < posDecor.y / 64 + LYIMAGE / 64 + 2; j++)
|
||||
for (j = posDecor.y / 64; j < posDecor.y / 64 + LYIMAGE / 64 + 2; j++)
|
||||
{
|
||||
if (i >= 0 && i < 100 && j >= 0 && j < 100 && m_decor[i][j].icon != -1)
|
||||
{
|
||||
@ -693,10 +694,10 @@ void CDecor::Build(RECT rect)
|
||||
}
|
||||
}
|
||||
tinyPoint.x = 0 - posDecor.x % 64;
|
||||
for (int i = posDecor.x / 64; i < posDecor.x / 64 + LXIMAGE / 64 + 2; i++)
|
||||
for (i = posDecor.x / 64; i < posDecor.x / 64 + LXIMAGE / 64 + 2; i++)
|
||||
{
|
||||
tinyPoint.y = 0 - posDecor.y % 64;
|
||||
for (int j = posDecor.y / 64; j < posDecor.y / 64 + LYIMAGE / 64 + 2; j++)
|
||||
for (j = posDecor.y / 64; j < posDecor.y / 64 + LYIMAGE / 64 + 2; j++)
|
||||
{
|
||||
if (i >= 0 && i < 100 && j >= 0 && j < 100 && m_decor[i][j].icon != -1)
|
||||
{
|
||||
@ -752,7 +753,7 @@ void CDecor::Build(RECT rect)
|
||||
num2 = table_decor_eau2[(i * 11 + j * 7 + m_time / num5) % 6];
|
||||
m_pPixmap->QuickIcon(1, num2, pos);
|
||||
}
|
||||
if (num2 == 305 && BlitzActif({ i, j }))
|
||||
if (num2 == 305 && BlitzActif(POINT( i, j )))
|
||||
{
|
||||
num2 = rand() % 4 + 305;
|
||||
m_pPixmap->QuickIcon(1, num2, pos);
|
||||
@ -802,7 +803,7 @@ void CDecor::Build(RECT rect)
|
||||
}
|
||||
tinyPoint.x += 64;
|
||||
}
|
||||
for (int i = 0; i < MAXMOVEOBJECT; i++)
|
||||
for (i = 0; i < MAXMOVEOBJECT; i++)
|
||||
{
|
||||
if (m_moveObject[i].type != 0 && m_moveObject[i].posCurrent.x >= posDecor.x - 64 && m_moveObject[i].posCurrent.y >= posDecor.y - 64 && m_moveObject[i].posCurrent.x <= posDecor.x + LXIMAGE && m_moveObject[i].posCurrent.y <= posDecor.y + LYIMAGE && ((m_moveObject[i].type >= 8 && m_moveObject[i].type <= 11) || (m_moveObject[i].type >= 90 && m_moveObject[i].type <= 95) || (m_moveObject[i].type >= 98 && m_moveObject[i].type <= 100) || m_moveObject[i].type == 53))
|
||||
{
|
||||
@ -816,7 +817,7 @@ void CDecor::Build(RECT rect)
|
||||
char str[20];
|
||||
sprintf(str, "#%d", i);
|
||||
DrawText(m_pPixmap, posDecor - m_moveObject[i].posCurrent, str, FONTWHITE);
|
||||
DrawText(m_pPixmap, posDecor - m_moveObject[i].posCurrent + POINT{0, 10}, m_moveObject[i].type ? debugMobTypeNames[m_moveObject[i].type] : "-", FONTWHITE);
|
||||
DrawText(m_pPixmap, posDecor - m_moveObject[i].posCurrent + POINT(0, 10), m_moveObject[i].type ? debugMobTypeNames[m_moveObject[i].type] : "-", FONTWHITE);
|
||||
}
|
||||
////
|
||||
}
|
||||
@ -835,11 +836,12 @@ void CDecor::DrawInfo()
|
||||
{
|
||||
POINT pos;
|
||||
char text[100];
|
||||
int i;
|
||||
|
||||
if (m_phase == WM_PHASE_PLAY || m_phase == WM_PHASE_PLAYTEST)
|
||||
{
|
||||
pos = { 10, 10 };
|
||||
for (int i = 0; i < MAXNOTIF; i++) {
|
||||
pos = POINT( 10, 10 );
|
||||
for (i = 0; i < MAXNOTIF; i++) {
|
||||
if (m_notifText[i][0] != '\0') {
|
||||
DrawText(m_pPixmap, pos, m_notifText[i], FONTWHITE);
|
||||
}
|
||||
@ -847,7 +849,7 @@ void CDecor::DrawInfo()
|
||||
}
|
||||
|
||||
if (m_nbVies > 0) {
|
||||
pos = { -15, 417 };
|
||||
pos = POINT( -15, 417 );
|
||||
for (int i = 0; i < m_nbVies; i++) {
|
||||
m_pPixmap->QuickIcon(GetBlupiChannelActual(), 48, pos);
|
||||
pos.x += 16;
|
||||
@ -855,7 +857,7 @@ void CDecor::DrawInfo()
|
||||
}
|
||||
|
||||
if (m_blupiBullet > 0) {
|
||||
pos = { 398, 442 };
|
||||
pos = POINT( 398, 442 );
|
||||
for (int i = 0; i < m_blupiBullet; i++) {
|
||||
m_pPixmap->QuickIcon(CHELEMENT, 176, pos);
|
||||
pos.x += 4;
|
||||
@ -863,34 +865,34 @@ void CDecor::DrawInfo()
|
||||
}
|
||||
|
||||
if (m_blupiPerso > 0) {
|
||||
m_pPixmap->QuickIcon(CHBUTTON, GetIconPerso(), { 465, 438 });
|
||||
m_pPixmap->QuickIcon(CHBUTTON, GetIconPerso(), POINT( 465, 438 ));
|
||||
sprintf(text, "= %d", m_blupiPerso);
|
||||
DrawText(m_pPixmap, { 497, 452 }, text, FONTWHITE);
|
||||
DrawText(m_pPixmap, POINT( 497, 452 ), text, FONTWHITE);
|
||||
}
|
||||
|
||||
if (m_blupiDynamite > 0) {
|
||||
m_pPixmap->QuickIcon(CHELEMENT, 252, { 505, 414 });
|
||||
m_pPixmap->QuickIcon(CHELEMENT, 252, POINT( 505, 414 ));
|
||||
}
|
||||
|
||||
if (m_blupiCle | CLE_RED) {
|
||||
m_pPixmap->QuickIcon(CHELEMENT, 215, { 520, 418 });
|
||||
m_pPixmap->QuickIcon(CHELEMENT, 215, POINT( 520, 418 ));
|
||||
}
|
||||
|
||||
if (m_blupiCle | CLE_GREEN) {
|
||||
m_pPixmap->QuickIcon(CHELEMENT, 222, { 530, 418 });
|
||||
m_pPixmap->QuickIcon(CHELEMENT, 222, POINT( 530, 418 ));
|
||||
}
|
||||
|
||||
if (m_blupiCle | CLE_BLUE) {
|
||||
m_pPixmap->QuickIcon(CHELEMENT, 229, { 540, 418 });
|
||||
m_pPixmap->QuickIcon(CHELEMENT, 229, POINT( 540, 418 ));
|
||||
}
|
||||
|
||||
if ((m_mission != 1 && m_mission % 10 != 0) || m_bPrivate)
|
||||
{
|
||||
sprintf(text, "%d/%d", m_nbTresor, m_totalTresor);
|
||||
DrawText(m_pPixmap, { 590, 452 }, text, FONTWHITE);
|
||||
DrawText(m_pPixmap, POINT( 590, 452 ), text, FONTWHITE);
|
||||
}
|
||||
|
||||
for (int i = 0; i < 2; i++)
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
if (!(m_jauges[i].GetHide())) m_jauges[i].Draw();
|
||||
}
|
||||
@ -1068,7 +1070,7 @@ void CDecor::VehicleSoundsPhase(int phase)
|
||||
if (m_bHelicoStop) channel = SOUND_HELICOLOW;
|
||||
if (m_bJeepMarch) channel = SOUND_JEEPHIGH;
|
||||
if (m_bJeepStop) channel = SOUND_JEEPLOW;
|
||||
if (channel != -1) m_pSound->PlayImage(channel, { LXIMAGE / 2, LYIMAGE / 2 }, -1);
|
||||
if (channel != -1) m_pSound->PlayImage(channel, POINT( LXIMAGE / 2, LYIMAGE / 2 ), -1);
|
||||
}
|
||||
else {
|
||||
if (m_bHelicoMarch) m_pSound->StopSound(SOUND_HELICOHIGH);
|
||||
@ -1154,11 +1156,12 @@ void CDecor::SetAllMissions(BOOL bAllMissions)
|
||||
void CDecor::CheatAction(int cheat)
|
||||
{
|
||||
MoveObject* mob;
|
||||
int i;
|
||||
|
||||
switch (cheat)
|
||||
{
|
||||
case 2: // cleanall
|
||||
for (int i = 0; i < MAXMOVEOBJECT; i++)
|
||||
for (i = 0; i < MAXMOVEOBJECT; i++)
|
||||
{
|
||||
mob = &m_moveObject[i];
|
||||
switch (mob->type)
|
||||
@ -1179,7 +1182,8 @@ void CDecor::CheatAction(int cheat)
|
||||
m_decorPhase = 0;
|
||||
mob->type = TYPE_EXPLO1;
|
||||
mob->phase = 0;
|
||||
mob->posCurrent -= { 34, 34 };
|
||||
mob->posCurrent.x -= 34;
|
||||
mob->posCurrent.y -= 34;
|
||||
mob->posStart = mob->posCurrent;
|
||||
mob->posEnd = mob->posCurrent;
|
||||
MoveObjectStepIcon(i);
|
||||
@ -1230,7 +1234,7 @@ void CDecor::CheatAction(int cheat)
|
||||
PlaySound(SOUND_JEEPLOW, m_blupiPos, TRUE);
|
||||
break;
|
||||
case 9: // alltreasure
|
||||
for (int i = 0; i < MAXMOVEOBJECT; i++)
|
||||
for (i = 0; i < MAXMOVEOBJECT; i++)
|
||||
{
|
||||
if (m_moveObject[i].type == TYPE_TRESOR)
|
||||
{
|
||||
@ -1242,7 +1246,7 @@ void CDecor::CheatAction(int cheat)
|
||||
}
|
||||
break;
|
||||
case 10: // endgoal
|
||||
for (int i = 0; i < MAXMOVEOBJECT; i++)
|
||||
for (i = 0; i < MAXMOVEOBJECT; i++)
|
||||
{
|
||||
mob = &m_moveObject[i];
|
||||
if (mob->type == TYPE_GOAL || mob->type == TYPE_CLE)
|
||||
@ -1482,7 +1486,7 @@ void CDecor::SetTeam(int team)
|
||||
|
||||
POINT CDecor::VoyageGetPosVie(int nbVies)
|
||||
{
|
||||
return { nbVies * 20 - 5, 417 };
|
||||
return POINT( nbVies * 20 - 5, 417 );
|
||||
}
|
||||
|
||||
void CDecor::VoyageInit(POINT start, POINT end, int icon, int channel)
|
||||
@ -1725,26 +1729,26 @@ BOOL CDecor::SearchWorld(int world, POINT *cel, POINT *newBlupiPos)
|
||||
{
|
||||
if (x > 1 && m_decor[x - 1][y].icon == Object::DoorLevel)
|
||||
{
|
||||
*cel = { x - 1, y };
|
||||
*newBlupiPos = { (x - 2) * DIMOBJX + 2, y * DIMOBJY + 6 };
|
||||
*cel = POINT( x - 1, y );
|
||||
*newBlupiPos = POINT( (x - 2) * DIMOBJX + 2, y * DIMOBJY + 6 );
|
||||
return TRUE;
|
||||
}
|
||||
if (x > 2 && m_decor[x - 2][y].icon == Object::DoorLevel)
|
||||
{
|
||||
*cel = { x - 2, y };
|
||||
*newBlupiPos = { (x - 3) * DIMOBJX + 2, y * DIMOBJY + 6 };
|
||||
*cel = POINT( x - 2, y );
|
||||
*newBlupiPos = POINT( (x - 3) * DIMOBJX + 2, y * DIMOBJY + 6 );
|
||||
return TRUE;
|
||||
}
|
||||
if (x < MAXCELX - 1 && m_decor[x + 1][y].icon == Object::DoorLevel)
|
||||
{
|
||||
*cel = { x + 1, y };
|
||||
*newBlupiPos = { (x + 2) * DIMOBJX + 2, y * DIMOBJY + 6 };
|
||||
*cel = POINT( x + 1, y );
|
||||
*newBlupiPos = POINT( (x + 2) * DIMOBJX + 2, y * DIMOBJY + 6 );
|
||||
return TRUE;
|
||||
}
|
||||
if (x < MAXCELX - 2 && m_decor[x + 2][y].icon == Object::DoorLevel)
|
||||
{
|
||||
*cel = { x + 2, y };
|
||||
*newBlupiPos = { (x + 3) * DIMOBJX + 2, y * DIMOBJY + 6 };
|
||||
*cel = POINT( x + 2, y );
|
||||
*newBlupiPos = POINT( (x + 3) * DIMOBJX + 2, y * DIMOBJY + 6 );
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@ -1862,7 +1866,7 @@ void CDecor::OpenDoorsTresor()
|
||||
int icon = m_decor[x][y].icon;
|
||||
if (icon >= 0x1a5 && icon <= 0x1a5 + m_nbTresor - 1)
|
||||
{
|
||||
OpenDoor({ x, y });
|
||||
OpenDoor(POINT( x, y ));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
// Decor.h
|
||||
#pragma once
|
||||
#ifndef DECOR_H
|
||||
#define DECOR_H
|
||||
|
||||
#include "DEF.H"
|
||||
#include "jauge.h"
|
||||
@ -621,4 +622,6 @@ inline BOOL CDecor::IsBlupiStanding()
|
||||
!IsBlupiVehicle() &&
|
||||
!(m_blupiAir || m_blupiBalloon || m_blupiEcrase ||
|
||||
m_blupiNage || m_blupiSurf || m_blupiSuspend);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
278
src/dectables.h
278
src/dectables.h
File diff suppressed because one or more lines are too long
57
src/def.h
57
src/def.h
@ -1,7 +1,12 @@
|
||||
// Def.h
|
||||
//
|
||||
|
||||
#pragma once
|
||||
#ifndef DEF_H
|
||||
#define DEF_H
|
||||
|
||||
#ifndef WINVER
|
||||
#define WINVER 0x0400
|
||||
#endif
|
||||
|
||||
#include <windows.h>
|
||||
#include <WinDef.h>
|
||||
@ -28,6 +33,7 @@
|
||||
#define MAXMOVEOBJECT 200
|
||||
#define MAXNOTIF 5
|
||||
#define MAXFIFOPOS 10
|
||||
#define MAXCHAT 6
|
||||
|
||||
#define LXIMAGE 640 // dimensions de la fenêtre de jeu
|
||||
#define LYIMAGE 480
|
||||
@ -1292,66 +1298,87 @@ namespace Object {
|
||||
#define JAUGE_AIR 0
|
||||
#define JAUGE_POWER 1
|
||||
|
||||
// hack to mimic array literals in old c++
|
||||
#if __cplusplus < 199711
|
||||
#define RECT(A,B,C,D) MAKE_RECT(A,B,C,D)
|
||||
#define POINT(X,Y) MAKE_POINT(X,Y)
|
||||
|
||||
inline RECT MAKE_RECT (int left, int top, int right, int bottom)
|
||||
{
|
||||
RECT r = {left, top, right, bottom};
|
||||
return r;
|
||||
};
|
||||
|
||||
inline POINT MAKE_POINT (int x, int y)
|
||||
{
|
||||
POINT p = {x, y};
|
||||
return p;
|
||||
};
|
||||
#else
|
||||
#define RECT(A,B,C,D) RECT{A,B,C,D}
|
||||
#define POINT(X,Y) POINT{X,Y}
|
||||
#endif
|
||||
|
||||
// helpers for POINT
|
||||
|
||||
POINT operator+(POINT p, const POINT& a)
|
||||
{
|
||||
return { a.x + p.x, a.y + p.y };
|
||||
return POINT( a.x + p.x, a.y + p.y );
|
||||
}
|
||||
|
||||
POINT operator-(POINT p, const POINT& a)
|
||||
{
|
||||
return { a.x - p.x, a.y - p.y };
|
||||
return POINT( a.x - p.x, a.y - p.y );
|
||||
}
|
||||
|
||||
POINT operator*(POINT p, const POINT& a)
|
||||
{
|
||||
return { a.x * p.x, a.y * p.y };
|
||||
return POINT( a.x * p.x, a.y * p.y );
|
||||
}
|
||||
|
||||
POINT operator/(POINT p, const POINT& a)
|
||||
{
|
||||
return { p.x / a.x, p.y / a.y };
|
||||
return POINT( p.x / a.x, p.y / a.y );
|
||||
}
|
||||
|
||||
POINT operator*(POINT p, const int& a)
|
||||
{
|
||||
return { p.x * a, p.y * a };
|
||||
return POINT( p.x * a, p.y * a );
|
||||
}
|
||||
|
||||
POINT operator/(POINT p, const int& a)
|
||||
{
|
||||
return { p.x / a, p.y / a };
|
||||
return POINT( p.x / a, p.y / a );
|
||||
}
|
||||
|
||||
POINT operator+=(POINT p, const POINT& a)
|
||||
{
|
||||
return { p.x += a.x, p.y += a.y };
|
||||
return POINT( p.x += a.x, p.y += a.y );
|
||||
}
|
||||
|
||||
POINT operator-=(POINT p, const POINT& a)
|
||||
{
|
||||
return { p.x -= a.x, p.y -= a.y };
|
||||
return POINT( p.x -= a.x, p.y -= a.y );
|
||||
}
|
||||
|
||||
POINT operator*=(POINT p, const POINT& a)
|
||||
{
|
||||
return { p.x *= a.x, p.y *= a.y };
|
||||
return POINT( p.x *= a.x, p.y *= a.y );
|
||||
}
|
||||
|
||||
POINT operator/=(POINT p, const POINT& a)
|
||||
{
|
||||
return { p.x /= a.x, p.y /= a.y };
|
||||
return POINT( p.x /= a.x, p.y /= a.y );
|
||||
}
|
||||
|
||||
POINT operator*=(POINT p, const int& a)
|
||||
{
|
||||
return { p.x *= a, p.y *= a };
|
||||
return POINT( p.x *= a, p.y *= a );
|
||||
}
|
||||
|
||||
POINT operator/=(POINT p, const int& a)
|
||||
{
|
||||
return { p.x /= a, p.y /= a };
|
||||
return POINT( p.x /= a, p.y /= a );
|
||||
}
|
||||
|
||||
bool operator!=(POINT a, const POINT& b)
|
||||
@ -1362,4 +1389,6 @@ bool operator!=(POINT a, const POINT& b)
|
||||
bool operator==(POINT a, const POINT& b)
|
||||
{
|
||||
return a.x == b.x && a.y == b.y;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
180
src/event.cpp
180
src/event.cpp
@ -2281,75 +2281,63 @@ void CEvent::NetDraw()
|
||||
|
||||
void CEvent::ChatSend()
|
||||
{
|
||||
int netplay;
|
||||
UINT i;
|
||||
char* text;
|
||||
char end[4];
|
||||
POINT* pos;
|
||||
DPID dpid;
|
||||
LPVOID data[25];
|
||||
char textInput[100];
|
||||
int v3; // edx
|
||||
char v5[4]; // [esp+Ch] [ebp-6Ch] BYREF
|
||||
int dpid; // [esp+10h] [ebp-68h]
|
||||
char str[100]; // [esp+14h] [ebp-64h] BYREF
|
||||
|
||||
text = m_textInput;
|
||||
if (m_textInput[0] != '\0')
|
||||
if (m_textInput[0])
|
||||
{
|
||||
netplay = NetSearchPlayer(m_pNetwork->m_dpid);
|
||||
strcpy(textInput, "<");
|
||||
}
|
||||
if (netplay != -1)
|
||||
{
|
||||
strcat(textInput, (const char*)m_pNetwork->m_players[netplay].name);
|
||||
strcat(textInput, "> ");
|
||||
strcat(textInput, text);
|
||||
//ChatMessageSound((char*)textInput);
|
||||
end[0] = 108;
|
||||
end[1] = 11;
|
||||
v3 = NetSearchPlayer(m_pNetwork->m_dpid);
|
||||
strcpy(str, "<");
|
||||
if (v3 != -1)
|
||||
{
|
||||
strcat(str, m_pNetwork->m_players[v3].name);
|
||||
}
|
||||
strcat(str, "> ");
|
||||
strcat(str, m_textInput);
|
||||
ChatPush(str);
|
||||
v5[0] = 108;
|
||||
v5[1] = 11;
|
||||
dpid = m_pNetwork->m_dpid;
|
||||
m_pNetwork->Send(&end, 108, 1);
|
||||
text = 0;
|
||||
pos[132].x = 0;
|
||||
pos[132].y = strlen(text);
|
||||
pos[133].x = 0;
|
||||
m_textHiliEnd = i - 1;
|
||||
m_pNetwork->Send(v5, 108, 1);
|
||||
m_textInput[0] = '\0';
|
||||
m_textHiliStart = 0;
|
||||
m_textHiliEnd = strlen(m_textInput);
|
||||
m_textCursorIndex = 0;
|
||||
SetEnable(WM_BUTTON20, 0);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
void CEvent::ChatMessageSound(char* data)
|
||||
void CEvent::ChatPush(char *str)
|
||||
{
|
||||
int num;
|
||||
char (*chatZone);
|
||||
char(*chat)[5];
|
||||
POINT pos;
|
||||
int i; // eax
|
||||
char *pText; // edx
|
||||
|
||||
num = 3;
|
||||
chatZone = m_chatZone[0];
|
||||
do
|
||||
for (i = 0; m_chatZone[0] != '\0'; i++)
|
||||
{
|
||||
if (chatZone = '\0')
|
||||
if (i >= MAXCHAT)
|
||||
{
|
||||
chat = m_chatZone + num * 20;
|
||||
goto error;
|
||||
CEvent::ChatPop();
|
||||
pText = m_text;
|
||||
goto LABEL_5;
|
||||
}
|
||||
num++;
|
||||
chatZone = chatZone + 100;
|
||||
} while (num < 6);
|
||||
HandleChatBuffer();
|
||||
chat = (char(*) [5])m_text;
|
||||
return;
|
||||
|
||||
error:
|
||||
strcpy((char*)chat, data);
|
||||
pos.x = 320;
|
||||
pos.y = 240;
|
||||
m_pSound->PlayImage(11, pos, -1);
|
||||
}
|
||||
pText = this->m_chatZone[i];
|
||||
LABEL_5:
|
||||
strcpy(pText, str);
|
||||
m_pSound->PlayImage(11, POINT( LXIMAGE / 2, LYIMAGE / 2 ), -1);
|
||||
}
|
||||
*/
|
||||
|
||||
void CEvent::HandleChatBuffer()
|
||||
void CEvent::ChatFlush()
|
||||
{
|
||||
for (int i = 0; i < MAXCHAT; i++)
|
||||
{
|
||||
m_chatZone[i][0] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
void CEvent::ChatPop()
|
||||
{
|
||||
char (*chatZone)[5];
|
||||
int num;
|
||||
@ -2360,13 +2348,10 @@ void CEvent::HandleChatBuffer()
|
||||
chatZone = m_chatZone;
|
||||
do
|
||||
{
|
||||
result = strlen((const char*)chatZone + 100) + 1;
|
||||
text = (char*)chatZone;
|
||||
chatZone += 100;
|
||||
memcpy(text, chatZone, result);
|
||||
memcpy(m_chatZone[num - 1], m_chatZone[num], strlen(m_chatZone[num]));
|
||||
--num;
|
||||
} while (num);
|
||||
*((BYTE*)m_text) = 0;
|
||||
m_text[0] = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -2459,26 +2444,26 @@ BOOL CEvent::DrawButtons()
|
||||
|
||||
if (m_phase == WM_PHASE_PLAY || m_phase == WM_PHASE_PLAYTEST || m_phase == WM_PHASE_BUILD)
|
||||
{
|
||||
DrawTextLeft(m_pPixmap, { 2, 2 }, text, FONTLITTLE);
|
||||
DrawTextLeft(m_pPixmap, POINT( 2, 2 ), text, FONTLITTLE);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pPixmap->DrawPart(-1, CHBACK, { 2, 2 }, { 2, 2, 302, 14 }, 1, FALSE);
|
||||
m_pPixmap->DrawPart(-1, CHBACK, POINT( 2, 2 ), RECT( 2, 2, 302, 14 ), 1, FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
if (m_phase == WM_PHASE_INIT)
|
||||
{
|
||||
DrawText(m_pPixmap, { 414, 446 }, "Version 2.2", FONTLITTLE);
|
||||
DrawText(m_pPixmap, POINT( 414, 446 ), "Version 2.2", FONTLITTLE);
|
||||
}
|
||||
|
||||
if (m_phase == WM_PHASE_GAMER)
|
||||
{
|
||||
LoadString(TX_CHOOSEGAMER, res, 100);
|
||||
DrawTextLeft(m_pPixmap, { LXIMAGE / 2 - GetTextWidth(res) / 2, 26 }, res, FONTGOLD);
|
||||
DrawTextLeft(m_pPixmap, POINT( LXIMAGE / 2 - GetTextWidth(res) / 2, 26 ), res, FONTGOLD);
|
||||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
DrawText(m_pPixmap, { 110, 69 + i * DIMBUTTONY }, m_gamerNameList[i], FONTWHITE);
|
||||
DrawText(m_pPixmap, POINT( 110, 69 + i * DIMBUTTONY ), m_gamerNameList[i], FONTWHITE);
|
||||
}
|
||||
SetEnable(WM_PHASE_CLEARGAMER, m_gamerExist[m_gamer]);
|
||||
}
|
||||
@ -2496,7 +2481,7 @@ BOOL CEvent::DrawButtons()
|
||||
pos.y = 190;
|
||||
DrawTextLeft(m_pPixmap, pos, res, 0);
|
||||
|
||||
PutTextInputBox({ 320, 232 });
|
||||
PutTextInputBox(POINT( 320, 232 ));
|
||||
}
|
||||
|
||||
if (m_phase == WM_PHASE_NAMEDESIGN)
|
||||
@ -2512,7 +2497,7 @@ BOOL CEvent::DrawButtons()
|
||||
pos.y = 190;
|
||||
DrawTextLeft(m_pPixmap, pos, res, 0);
|
||||
|
||||
PutTextInputBox({ 320, 232 });
|
||||
PutTextInputBox(POINT( 320, 232 ));
|
||||
}
|
||||
|
||||
// now that the decomp is looking convincingly like the retail game,
|
||||
@ -2529,14 +2514,14 @@ BOOL CEvent::DrawButtons()
|
||||
debugTextY = 0;
|
||||
}
|
||||
|
||||
DrawTextLeft(m_pPixmap, { LXIMAGE - GetTextWidth("DECOMPILATION"), debugTextY }, "DECOMPILATION", FONTGOLD);
|
||||
DrawTextLeft(m_pPixmap, { LXIMAGE - GetTextWidth("WORK IN PROGRESS"), debugTextY + 11 }, "WORK IN PROGRESS", FONTGOLD);
|
||||
DrawTextLeft(m_pPixmap, { LXIMAGE - GetTextWidth(__DATE__ " " __TIME__), debugTextY + 22 }, __DATE__ " " __TIME__, FONTGOLD);
|
||||
DrawTextLeft(m_pPixmap, POINT( LXIMAGE - GetTextWidth("DECOMPILATION"), debugTextY ), "DECOMPILATION", FONTGOLD);
|
||||
DrawTextLeft(m_pPixmap, POINT( LXIMAGE - GetTextWidth("WORK IN PROGRESS"), debugTextY + 11 ), "WORK IN PROGRESS", FONTGOLD);
|
||||
DrawTextLeft(m_pPixmap, POINT( LXIMAGE - GetTextWidth(__DATE__ " " __TIME__), debugTextY + 22 ), __DATE__ " " __TIME__, FONTGOLD);
|
||||
}
|
||||
///////
|
||||
|
||||
if (m_phase == WM_PHASE_PLAY && m_phase == WM_PHASE_PLAYTEST && m_phase == WM_PHASE_BUILD)
|
||||
m_pPixmap->DrawPart(-1, 0, pos, rect, 1, 0);
|
||||
if (m_phase != WM_PHASE_PLAY && m_phase != WM_PHASE_PLAYTEST && m_phase != WM_PHASE_BUILD)
|
||||
m_pPixmap->DrawPart(-1, 0, POINT( 2, 2 ), RECT( 2, 2, 302, 14 ), 1, 0);
|
||||
if (m_phase == WM_PHASE_CREATE)
|
||||
{
|
||||
LoadString(TX_MULTI_CREATE, res, 50);
|
||||
@ -2903,7 +2888,7 @@ BOOL CEvent::DrawButtons()
|
||||
DrawTextLeft(m_pPixmap, pos, res, 0);
|
||||
}
|
||||
|
||||
for (int i = 0; table[m_index].buttons[i].message != 0; i++)
|
||||
for (i = 0; table[m_index].buttons[i].message != 0; i++)
|
||||
{
|
||||
m_buttons[i].Draw();
|
||||
}
|
||||
@ -3966,11 +3951,13 @@ BOOL CEvent::EventButtons(UINT message, WPARAM wParam, LPARAM lParam)
|
||||
int i, lg, oldx, res;
|
||||
UINT uid;
|
||||
|
||||
pos = GetMousePos();
|
||||
m_textToolTips[0] = 0;
|
||||
oldx = m_posToolTips.x;
|
||||
m_posToolTips.x = -1;
|
||||
if (m_phase != WM_PHASE_PLAY && m_phase != WM_PHASE_PLAYTEST)
|
||||
if (m_phase != WM_PHASE_PLAY && m_phase != WM_PHASE_PLAYTEST && table[m_index].buttons[0].message)
|
||||
{
|
||||
/* // ????
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
if (!m_jauges[i].GetHide())
|
||||
@ -3996,6 +3983,7 @@ BOOL CEvent::EventButtons(UINT message, WPARAM wParam, LPARAM lParam)
|
||||
m_jauges[i].Redraw();
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -4363,7 +4351,7 @@ BOOL CEvent::ChangePhase(UINT phase)
|
||||
{
|
||||
AddCDPath(str);
|
||||
}
|
||||
if (!m_pPixmap->BackgroundCache(0, str, { LXIMAGE, LYIMAGE }, { 0,0 }, FALSE))
|
||||
if (!m_pPixmap->BackgroundCache(0, str, POINT( LXIMAGE, LYIMAGE ), POINT( 0,0 ), FALSE))
|
||||
{
|
||||
OutputNetDebug("CEvent::ChangePhase [Cache error]\r\n");
|
||||
WaitMouse(FALSE);
|
||||
@ -5404,10 +5392,10 @@ void CEvent::ChangeButtons(int message)
|
||||
SetState(WM_DIMS3, 0);
|
||||
SetState(WM_DIMS4, 0);
|
||||
SetState(message, 1);
|
||||
if (message == WM_DIMS1) m_pDecor->SetDim({ MAXCELX, MAXCELY });
|
||||
if (message == WM_DIMS2) m_pDecor->SetDim({ MAXCELX, 0 });
|
||||
if (message == WM_DIMS3) m_pDecor->SetDim({ 0, MAXCELY });
|
||||
if (message == WM_DIMS4) m_pDecor->SetDim({ 0, 0 });
|
||||
if (message == WM_DIMS1) m_pDecor->SetDim(POINT( MAXCELX, MAXCELY ));
|
||||
if (message == WM_DIMS2) m_pDecor->SetDim(POINT( MAXCELX, 0 ));
|
||||
if (message == WM_DIMS3) m_pDecor->SetDim(POINT( 0, MAXCELY ));
|
||||
if (message == WM_DIMS4) m_pDecor->SetDim(POINT( 0, 0 ));
|
||||
}
|
||||
}
|
||||
if (m_phase == WM_PHASE_SERVICE)
|
||||
@ -5533,7 +5521,7 @@ void CEvent::ChangeButtons(int message)
|
||||
SomethingUserMissions(file, m_filenameBuffer[m_choiceIndex]);
|
||||
bBuild = !m_bBuildOfficialMissions;
|
||||
m_pDecor->GetMissionPath(out, m_gamer, GetWorld(), bBuild);
|
||||
OpenMission(file, out);
|
||||
CopyMission(file, out);
|
||||
ChangePhase(WM_PHASE_INFO);
|
||||
}
|
||||
SetHide(WM_BUTTON10, m_choicePageOffset == 0);
|
||||
@ -5641,40 +5629,6 @@ void CEvent::ChangeButtons(int message)
|
||||
}
|
||||
}
|
||||
|
||||
BOOL CEvent::OpenMission(char* pMission, char* pFile)
|
||||
{
|
||||
FILE* file;
|
||||
FILE* file2;
|
||||
int nb;
|
||||
char* pBuffer = NULL;
|
||||
BOOL bMission = TRUE;
|
||||
|
||||
pBuffer = (char*)malloc(sizeof(2560));
|
||||
if (pBuffer == NULL) goto error;
|
||||
|
||||
file = fopen(pMission, "rb");
|
||||
if (file == NULL) goto error;
|
||||
|
||||
file2 = fopen(pFile, "wb");
|
||||
if (file2 == NULL) goto error;
|
||||
|
||||
do
|
||||
{
|
||||
nb = fread(pBuffer, 1, sizeof(2560), file);
|
||||
if (pBuffer[nb] & 32) break;
|
||||
if (nb <= 0)
|
||||
bMission = FALSE;
|
||||
break;
|
||||
fwrite(pBuffer, 1, nb, file2);
|
||||
} while (pBuffer[nb] & 32);
|
||||
return bMission;
|
||||
|
||||
error:
|
||||
if (file == NULL) free(file);
|
||||
if (file2 == NULL) free(file2);
|
||||
return bMission;
|
||||
}
|
||||
|
||||
BOOL CEvent::ClearGamer(int gamer)
|
||||
{
|
||||
char filename[260];
|
||||
|
17
src/event.h
17
src/event.h
@ -1,9 +1,9 @@
|
||||
// Event.h
|
||||
#ifndef EVENT_H
|
||||
#define EVENT_H
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "movie.h"
|
||||
#include "menu.h"
|
||||
#include "button.h"
|
||||
@ -79,7 +79,7 @@ public:
|
||||
void ReadInput();
|
||||
void TryInsert();
|
||||
//void SomethingUserMissions(LPCSTR lpFileName, LPCSTR thing);
|
||||
BOOL OpenMission(char* pMission, char* pFile);
|
||||
BOOL CopyMission(char* pMission, char* pFile);
|
||||
void RestoreGame();
|
||||
int MissionBack();
|
||||
void TableSomething();
|
||||
@ -182,8 +182,9 @@ protected:
|
||||
void NetSend(int message, USHORT data);
|
||||
void NetDraw();
|
||||
void ChatSend();
|
||||
void HandleChatBuffer();
|
||||
void ChatMessageSound(char* data);
|
||||
void ChatPush(char* str);
|
||||
void ChatPop();
|
||||
void ChatFlush();
|
||||
|
||||
void MouseRelease();
|
||||
void MouseCapture();
|
||||
@ -192,7 +193,6 @@ protected:
|
||||
void DrawMap();
|
||||
BOOL CheckWorld1();
|
||||
void NetAdjustLobbyButtons();
|
||||
BOOL CopyMission(char *srcFileName, char *dstFileName);
|
||||
|
||||
|
||||
protected:
|
||||
@ -254,6 +254,7 @@ protected:
|
||||
int m_fileTime[10];
|
||||
POINT m_posToolTips;
|
||||
char m_textToolTips[50];
|
||||
char m_textToolTips2[50];
|
||||
int m_mouseSprite;
|
||||
BOOL m_bFillMouse;
|
||||
BOOL m_bWaitMouse;
|
||||
@ -315,4 +316,6 @@ protected:
|
||||
};
|
||||
|
||||
extern
|
||||
int DirectoryThing(LPCSTR filename);
|
||||
int DirectoryThing(LPCSTR filename);
|
||||
|
||||
#endif
|
@ -1,6 +1,6 @@
|
||||
// Jauge.h
|
||||
|
||||
#pragma once
|
||||
#ifndef JAUGE_H
|
||||
#define JAUGE_H
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@ -42,4 +42,6 @@ protected:
|
||||
BOOL m_bRedraw;
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#endif
|
@ -1,6 +1,6 @@
|
||||
// Menu.h
|
||||
|
||||
#pragma once
|
||||
#ifndef MENU_H
|
||||
#define MENU_H
|
||||
|
||||
#include "decor.h"
|
||||
#include "pixmap.h"
|
||||
@ -48,4 +48,6 @@ protected:
|
||||
UINT m_messages[MAXBUTTON];
|
||||
int m_selRank;
|
||||
POINT m_mousePos;
|
||||
};
|
||||
};
|
||||
|
||||
#endif
|
@ -36,7 +36,7 @@ void LoadString(UINT nID, char *pBuffer, int lgBuffer)
|
||||
|
||||
void ChangeSprite(int sprite)
|
||||
{
|
||||
HCURSOR hCursor = nullptr;
|
||||
HCURSOR hCursor = NULL;
|
||||
|
||||
if ( g_mouseType == MOUSETYPEGRA ) return;
|
||||
if ( g_lastSprite == sprite ) return;
|
||||
|
@ -1,5 +1,7 @@
|
||||
// misc.h
|
||||
//
|
||||
#ifndef MISC_H
|
||||
#define MISC_H
|
||||
|
||||
#include <WTypes.h>
|
||||
|
||||
@ -20,4 +22,6 @@ extern void AddCDPath(char *pFilename);
|
||||
extern void AddUserPath(char *pFilename);
|
||||
|
||||
extern void TraceErrorDD(HRESULT hErr, const char *sFile, int nLine);
|
||||
extern void TraceErrorDS(HRESULT hErr, const char *sFile, int nLine);
|
||||
extern void TraceErrorDS(HRESULT hErr, const char *sFile, int nLine);
|
||||
|
||||
#endif
|
@ -1,7 +1,7 @@
|
||||
// movie.h
|
||||
//
|
||||
|
||||
#pragma once
|
||||
#ifndef MOVIE_H
|
||||
#define MOVIE_H
|
||||
|
||||
class CMovie
|
||||
{
|
||||
@ -29,4 +29,6 @@ protected:
|
||||
HWND m_hwndMovie;
|
||||
BOOL m_fPlaying;
|
||||
BOOL m_fMovieOpen;
|
||||
};
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include "def.h"
|
||||
|
||||
// a0f94abe-11c3-d111-be62-0040f6944838
|
||||
#define APP_GUID { 0xbe4af9a0, 0xc311, 0x11d1, { 0xbe, 0x62, 0x00, 0x40, 0xf6, 0x94, 0x48, 0x38 } };
|
||||
static const GUID APP_GUID = { 0xbe4af9a0, 0xc311, 0x11d1, { 0xbe, 0x62, 0x00, 0x40, 0xf6, 0x94, 0x48, 0x38 } };
|
||||
|
||||
CNetwork::CNetwork()
|
||||
{
|
||||
|
@ -1,6 +1,7 @@
|
||||
// Network.h
|
||||
|
||||
#pragma once
|
||||
#ifndef NETWORK_H
|
||||
#define NETWORK_H
|
||||
|
||||
#include "dplay.h"
|
||||
|
||||
@ -75,4 +76,6 @@ static BOOL EnumProvidersCallback(LPGUID lpguidSP, LPSTR lpSTName,
|
||||
static BOOL EnumSessionsCallback(LPDPSESSIONDESC2 lpThisSD,
|
||||
LPDWORD lpdwTimeOut, DWORD dwFlags, NamedGUIDList* lpContext);
|
||||
|
||||
void TraceErrorDP(HRESULT hErr);
|
||||
void TraceErrorDP(HRESULT hErr);
|
||||
|
||||
#endif
|
@ -1,4 +1,6 @@
|
||||
#pragma once
|
||||
#ifndef OBSTACLE_H
|
||||
#define OBSTACLE_H
|
||||
|
||||
#define Q_EMPTY \
|
||||
0,0,0,0, \
|
||||
0,0,0,0, \
|
||||
@ -40,7 +42,7 @@
|
||||
0,1,1,0, \
|
||||
0,1,1,0
|
||||
|
||||
extern short table_decor_quart[]
|
||||
extern short table_decor_quart[] =
|
||||
{
|
||||
Q_FULL, // 0
|
||||
Q_FULL,
|
||||
@ -586,4 +588,6 @@ extern short table_decor_quart[]
|
||||
Q_PILLAR,
|
||||
Q_PILLAR,
|
||||
Q_PILLAR
|
||||
};
|
||||
};
|
||||
|
||||
#endif
|
@ -632,11 +632,12 @@ BOOL CPixmap::DrawMap(int channel, RECT src, RECT dest)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
while (hErr == DDERR_WASSTILLDRAWING)
|
||||
while (1)
|
||||
{
|
||||
hErr = m_lpDDSurface[channel]->Blt(&dest, m_lpDDSBack, &src, DDBLT_WAIT, NULL);
|
||||
if (hErr == DD_OK) break;
|
||||
if (hErr == DDERR_SURFACELOST) hErr = RestoreAll(); if (hErr != DD_OK) break;;
|
||||
if (hErr == DDERR_WASSTILLDRAWING) break;
|
||||
}
|
||||
return (hErr == DD_OK);
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
// CPixmap.h
|
||||
|
||||
#pragma once
|
||||
#ifndef PIXMAP_H
|
||||
#define PIXMAP_H
|
||||
|
||||
#include <ddraw.h>
|
||||
|
||||
@ -124,4 +124,6 @@ protected:
|
||||
|
||||
};
|
||||
|
||||
static inline BOOL IsBlupiChannel(int channel);
|
||||
static inline BOOL IsBlupiChannel(int channel);
|
||||
|
||||
#endif
|
@ -1,4 +1,5 @@
|
||||
#pragma once
|
||||
#ifndef PIXTABLES_H
|
||||
#define PIXTABLES_H
|
||||
|
||||
// keep these structs for reference
|
||||
/*
|
||||
@ -15,7 +16,7 @@ typedef struct {
|
||||
*/
|
||||
|
||||
|
||||
extern short table_icon_blupi[]{
|
||||
extern short table_icon_blupi[] = {
|
||||
336,
|
||||
202,185, 17,9, 32,49,
|
||||
194,234, 17,8, 28,50,
|
||||
@ -355,7 +356,7 @@ extern short table_icon_blupi[]{
|
||||
230,25, 5,32, 49,27,
|
||||
};
|
||||
|
||||
extern short table_icon_element[]{
|
||||
extern short table_icon_element[] = {
|
||||
289,
|
||||
308,153, 9,20, 51,40,
|
||||
51,194, 8,19, 52,41,
|
||||
@ -648,7 +649,7 @@ extern short table_icon_element[]{
|
||||
403,153, 7,14, 44,41,
|
||||
};
|
||||
|
||||
extern short table_icon_explo[]{
|
||||
extern short table_icon_explo[] = {
|
||||
100,
|
||||
157,0, 48,51, 32,28,
|
||||
253,132, 36,32, 58,61,
|
||||
@ -752,7 +753,7 @@ extern short table_icon_explo[]{
|
||||
54,0, 9,35, 51,25,
|
||||
};
|
||||
|
||||
extern short table_icon_object[]{
|
||||
extern short table_icon_object[] = {
|
||||
441,
|
||||
504,687, 0,0, 64,64,
|
||||
568,687, 0,0, 64,64,
|
||||
@ -1195,4 +1196,6 @@ extern short table_icon_object[]{
|
||||
958,495, 18,0, 28,64,
|
||||
986,495, 18,0, 28,64,
|
||||
0,559, 18,0, 28,64,
|
||||
};
|
||||
};
|
||||
|
||||
#endif
|
@ -1,7 +1,7 @@
|
||||
// sound.h
|
||||
//
|
||||
|
||||
#pragma once
|
||||
#ifndef SOUND_H
|
||||
#define SOUND_H
|
||||
|
||||
//#include <windef.h>
|
||||
|
||||
@ -71,4 +71,6 @@ protected:
|
||||
int m_midiVolume;
|
||||
int m_lastMidiVolume;
|
||||
int m_nbSuspendSkip;
|
||||
};
|
||||
};
|
||||
|
||||
#endif
|
@ -1,6 +1,6 @@
|
||||
// Text.h
|
||||
|
||||
#pragma once
|
||||
#ifndef TEXT_H
|
||||
#define TEXT_H
|
||||
|
||||
#define FONTWHITE 0
|
||||
#define FONTGOLD 1
|
||||
@ -59,3 +59,4 @@ void DrawBignum(CPixmap *pPixmap, POINT pos, int num);
|
||||
extern
|
||||
int GetBignumWidth(int num);
|
||||
|
||||
#endif
|
@ -1,5 +1,7 @@
|
||||
#pragma once
|
||||
extern int table_width[]
|
||||
#ifndef TEXTTABLES_H
|
||||
#define TEXTTABLES_H
|
||||
|
||||
extern int table_width[] =
|
||||
{
|
||||
32,
|
||||
32,
|
||||
@ -132,7 +134,7 @@ extern int table_width[]
|
||||
};
|
||||
|
||||
|
||||
extern char table_char[]
|
||||
extern char table_char[] =
|
||||
{
|
||||
0,
|
||||
0,
|
||||
@ -1671,3 +1673,5 @@ extern char table_char[]
|
||||
0,
|
||||
0
|
||||
};
|
||||
|
||||
#endif
|
10
src/wave.h
10
src/wave.h
@ -2,13 +2,13 @@
|
||||
* Sound related stuff, I dunno
|
||||
************************************************/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#ifndef WAVE_H
|
||||
#define WAVE_H
|
||||
|
||||
#include <dsound.h>
|
||||
|
||||
void LoadWave(HINSTANCE hinst, int ResourceID,
|
||||
LPDIRECTSOUND lpds,
|
||||
LPDIRECTSOUNDBUFFER &lpDSB);
|
||||
LPDIRECTSOUNDBUFFER &lpDSB);
|
||||
|
||||
#endif
|
Loading…
x
Reference in New Issue
Block a user