mirror of
https://github.com/jummy0/sb2-decomp
synced 2025-03-14 20:23:30 +01:00
WE SHMOOVIN'
This commit is contained in:
parent
4b335e4710
commit
ce33104782
2403
src/decblupi.cpp
2403
src/decblupi.cpp
File diff suppressed because it is too large
Load Diff
239
src/decmove.cpp
239
src/decmove.cpp
@ -8,6 +8,56 @@
|
||||
|
||||
void CDecor::MoveObjectPollution()
|
||||
{
|
||||
POINT blupiPos = m_blupiPos;
|
||||
POINT pos;
|
||||
BOOL bPollution;
|
||||
pos = { 0, 0 };
|
||||
int num = 20;
|
||||
bPollution = FALSE;
|
||||
if (m_blupiAction == 3)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (m_blupiHelico)
|
||||
{
|
||||
if (m_blupiVitesse.y < -5.0)
|
||||
{
|
||||
if (m_time % 20 != 0 &&
|
||||
m_time % 20 != 2 &&
|
||||
m_time % 20 != 5 &&
|
||||
m_time % 20 != 8 &&
|
||||
m_time % 20 != 10 &&
|
||||
m_time % 20 != 11 &&
|
||||
m_time % 20 != 16 &&
|
||||
m_time % 20 != 18)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (m_blupiVitesse.x == 0.0)
|
||||
{
|
||||
if (m_time % 50 != 0 &&
|
||||
m_time % 50 != 12 &&
|
||||
m_time % 50 != 30)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (m_time % 20 != 0 &&
|
||||
m_time % 20 != 3 &&
|
||||
m_time % 20 != 5 &&
|
||||
m_time % 20 != 11 &&
|
||||
m_time % 20 != 15)
|
||||
{
|
||||
return;
|
||||
}
|
||||
pos.x = 22;
|
||||
bPollution = TRUE;
|
||||
}
|
||||
if (m_blupiOver)
|
||||
{
|
||||
// more
|
||||
}
|
||||
}
|
||||
|
||||
void CDecor::MoveObjectPlouf(POINT pos)
|
||||
@ -386,7 +436,7 @@ void CDecor::MoveObjectStepLine(int i)
|
||||
MoveObject moveObject;
|
||||
POINT tinyPoint;
|
||||
BOOL flag = FALSE;
|
||||
RECT tinyRect;
|
||||
RECT tinyRect { 0, 0, 0, 0 };
|
||||
if (m_moveObject[i].type == 1 || m_moveObject[i].type == 47 || m_moveObject[i].type == 48 && !m_blupiSuspend)
|
||||
{
|
||||
RECT src;
|
||||
@ -1458,7 +1508,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;
|
||||
RECT tinyRect { 0, 0, 0, 0 };
|
||||
if (IntersectRect(&tinyRect, &src2, &src))
|
||||
{
|
||||
if (m_moveObject[i].type == 12)
|
||||
@ -1522,7 +1572,7 @@ int CDecor::AscenseurDetect(RECT rect, POINT oldpos, POINT newpos)
|
||||
src.bottom = m_moveObject[i].posCurrent.y + 16;
|
||||
if (num < 30)
|
||||
{
|
||||
RECT tinyRect;
|
||||
RECT tinyRect { 0, 0, 0, 0 };
|
||||
if (IntersectRect(&tinyRect, &src, &rect))
|
||||
{
|
||||
return i;
|
||||
@ -1535,7 +1585,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;
|
||||
RECT tinyRect { 0, 0, 0, 0 };
|
||||
if (IntersectRect(&tinyRect, &src, &src2))
|
||||
{
|
||||
return i;
|
||||
@ -1639,8 +1689,34 @@ BOOL CDecor::TestPushCaisse(int i, POINT pos, BOOL bPop)
|
||||
|
||||
BOOL CDecor::TestPushOneCaisse(int i, POINT move, int b)
|
||||
{
|
||||
// TODO
|
||||
return FALSE;
|
||||
int num;
|
||||
RECT rect;
|
||||
num = m_moveObject[i].posCurrent.x + move.x;
|
||||
rect.left = num;
|
||||
rect.right = num + 64;
|
||||
rect.top = m_moveObject[i].posCurrent.y;
|
||||
rect.bottom = m_moveObject[i].posCurrent.y + 64;
|
||||
if (DecorDetect(rect, FALSE))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
if (m_moveObject[i].posCurrent.y != b)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
rect.left = num;
|
||||
rect.right = num + 20;
|
||||
rect.top = m_moveObject[i].posCurrent.y + 64;
|
||||
rect.bottom = m_moveObject[i].posCurrent.y + 64 + 2;
|
||||
if (!DecorDetect(rect))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
rect.left = num + 64 - 20;
|
||||
rect.right = num + 64;
|
||||
rect.top = m_moveObject[i].posCurrent.y + 64;
|
||||
rect.bottom = m_moveObject[i].posCurrent.y + 64 + 2;
|
||||
return DecorDetect(rect);
|
||||
}
|
||||
|
||||
void CDecor::SearchLinkCaisse(int rank, BOOL bPop)
|
||||
@ -1677,7 +1753,7 @@ void CDecor::SearchLinkCaisse(int rank, BOOL bPop)
|
||||
src2.top = m_moveObject[num2].posCurrent.y - 1;
|
||||
src2.right = src2.left + 64 + 1;
|
||||
src2.bottom = src2.top + 64 + 1;
|
||||
RECT tinyRect;
|
||||
RECT tinyRect { 0,0,0,0 };
|
||||
if (IntersectRect(&tinyRect, &src2, &src) && AddLinkCaisse(num2))
|
||||
{
|
||||
flag = TRUE;
|
||||
@ -1800,7 +1876,7 @@ int CDecor::MockeryDetect(POINT pos)
|
||||
src2.right = m_moveObject[i].posCurrent.x + 60;
|
||||
src2.top = m_moveObject[i].posCurrent.y + 36;
|
||||
src2.bottom = m_moveObject[i].posCurrent.y + 60;
|
||||
RECT tinyRect;
|
||||
RECT tinyRect{ 0,0,0,0 };
|
||||
if (IntersectRect(&tinyRect, &src2, &src))
|
||||
{
|
||||
if (m_moveObject[i].type == 54)
|
||||
@ -1839,10 +1915,9 @@ int CDecor::MockeryDetect(POINT pos)
|
||||
|
||||
BOOL CDecor::BlupiElectro(POINT pos)
|
||||
{
|
||||
if (m_blupiCloud)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
if (m_phase == WM_PHASE_BUILD) return FALSE;
|
||||
if (!m_blupiCloud) return FALSE;
|
||||
|
||||
RECT src;
|
||||
src.left = pos.x + 16;
|
||||
src.right = pos.x + 60 - 16;
|
||||
@ -1853,7 +1928,7 @@ BOOL CDecor::BlupiElectro(POINT pos)
|
||||
src2.right = m_blupiPos.x + 60 + 16 + 40;
|
||||
src2.top = m_blupiPos.y + 11 - 40;
|
||||
src2.bottom = m_blupiPos.y + 60 - 2 + 40;
|
||||
RECT tinyRect;
|
||||
RECT tinyRect{ 0,0,0,0 };
|
||||
return IntersectRect(&tinyRect, &src, &src2);
|
||||
}
|
||||
|
||||
@ -1875,7 +1950,7 @@ void CDecor::MoveObjectFollow(POINT pos)
|
||||
src2.right = m_moveObject[i].posCurrent.x + 60 + 100;
|
||||
src2.top = m_moveObject[i].posCurrent.y - 100;
|
||||
src2.bottom = m_moveObject[i].posCurrent.y + 60 + 100;
|
||||
RECT tinyRect;
|
||||
RECT tinyRect { 0, 0, 0, 0 };
|
||||
if (IntersectRect(&tinyRect, &src2, &src))
|
||||
{
|
||||
m_moveObject[i].type = 97;
|
||||
@ -1910,9 +1985,64 @@ int CDecor::MoveObjectDetect(POINT pos, BOOL* pbNear)
|
||||
m_moveObject[i].type != 12)
|
||||
{
|
||||
RECT src3;
|
||||
// TODO
|
||||
src3.left = m_moveObject[i].posCurrent.x + 16;
|
||||
src3.right = m_moveObject[i].posCurrent.x + 60 - 16;
|
||||
src3.top = m_moveObject[i].posCurrent.y + 36;
|
||||
src3.bottom = m_moveObject[i].posCurrent.y + 60;
|
||||
if (m_moveObject[i].type == 3)
|
||||
{
|
||||
if (m_blupiAction == 6)
|
||||
{
|
||||
//goto IL_427;
|
||||
}
|
||||
src3.top = m_moveObject[i].posCurrent.y;
|
||||
src3.bottom = m_moveObject[i].posCurrent.y + 69 - 36;
|
||||
}
|
||||
if (m_moveObject[i].type == 12)
|
||||
{
|
||||
src3.left = m_moveObject[i].posCurrent.x - 16;
|
||||
src3.right = m_moveObject[i].posCurrent.x + 64 + 16;
|
||||
src3.top = m_moveObject[i].posCurrent.y;
|
||||
src3.bottom = m_moveObject[i].posCurrent.y + 64;
|
||||
if (m_blupiDir == 1)
|
||||
{
|
||||
src3.left += 20;
|
||||
}
|
||||
else
|
||||
{
|
||||
src3.right -= 20;
|
||||
}
|
||||
}
|
||||
if (m_moveObject[i].type == 17 ||
|
||||
m_moveObject[i].type == 20 ||
|
||||
m_moveObject[i].type == 44 ||
|
||||
m_moveObject[i].type == 54)
|
||||
{
|
||||
src3.top = m_moveObject[i].posCurrent.y + 16;
|
||||
src3.bottom = m_moveObject[i].posCurrent.y + 60 - 16;
|
||||
}
|
||||
if (m_moveObject[i].type == 23)
|
||||
{
|
||||
src3.left = m_moveObject[i].posCurrent.x + 24;
|
||||
src3.right = m_moveObject[i].posCurrent.x + 64 - 24;
|
||||
src3.top = m_moveObject[i].posCurrent.y + 10;
|
||||
src3.bottom = m_moveObject[i].posCurrent.y + 60 - 32;
|
||||
}
|
||||
RECT rect;
|
||||
rect = { 0, 0, 0, 0 };
|
||||
if (IntersectRect(&rect, &src3, &src))
|
||||
{
|
||||
*pbNear = TRUE;
|
||||
return i;
|
||||
}
|
||||
if (m_moveObject[i].type == 2 && IntersectRect(&rect, &src3, &src2))
|
||||
{
|
||||
*pbNear = FALSE;
|
||||
return i;
|
||||
}
|
||||
}
|
||||
}
|
||||
*pbNear = FALSE;
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -1936,7 +2066,7 @@ int CDecor::MoveAscenseurDetect(POINT pos, int height)
|
||||
src2.right = m_moveObject[i].posCurrent.x + 64;
|
||||
src2.top = m_moveObject[i].posCurrent.y;
|
||||
src2.bottom = m_moveObject[i].posCurrent.y + 16;
|
||||
RECT tinyRect;
|
||||
RECT tinyRect { 0, 0, 0, 0 };
|
||||
if (IntersectRect(&tinyRect, &src2, &src))
|
||||
{
|
||||
return i;
|
||||
@ -1962,7 +2092,7 @@ int CDecor::MoveChargeDetect(POINT pos)
|
||||
src2.right = m_moveObject[i].posCurrent.x + 60 + 10;
|
||||
src2.top = m_moveObject[i].posCurrent.y + 36;
|
||||
src2.bottom = m_moveObject[i].posCurrent.y + 60;
|
||||
RECT tinyRect;
|
||||
RECT tinyRect { 0, 0, 0, 0 };
|
||||
if (IntersectRect(&tinyRect, &src2, &src))
|
||||
{
|
||||
return i;
|
||||
@ -1975,6 +2105,7 @@ int CDecor::MoveChargeDetect(POINT pos)
|
||||
int CDecor::MovePersoDetect(POINT pos)
|
||||
{
|
||||
RECT src;
|
||||
if (m_phase == WM_PHASE_BUILD) return -1;
|
||||
src.left = pos.x + 16;
|
||||
src.right = pos.x + 60 - 16;
|
||||
src.top = pos.y + 11;
|
||||
@ -1988,7 +2119,7 @@ int CDecor::MovePersoDetect(POINT pos)
|
||||
src2.right = m_moveObject[i].posCurrent.x + 60 + 16;
|
||||
src2.top = m_moveObject[i].posCurrent.y + 36;
|
||||
src2.bottom = m_moveObject[i].posCurrent.y + 60;
|
||||
RECT tinyRect;
|
||||
RECT tinyRect { 0, 0, 0, 0 };
|
||||
if (IntersectRect(&tinyRect, &src2, &src))
|
||||
{
|
||||
return i;
|
||||
@ -2000,8 +2131,36 @@ int CDecor::MovePersoDetect(POINT pos)
|
||||
|
||||
int CDecor::MoveBalleDetect(POINT pos)
|
||||
{
|
||||
// TODO
|
||||
return -1;
|
||||
RECT rcSrc1, rcSrc2;
|
||||
tagRECT rcDst;
|
||||
int i;
|
||||
if (m_phase == WM_PHASE_BUILD)
|
||||
return -1;
|
||||
rcSrc2.right = pos.x + 44;
|
||||
rcSrc2.left = pos.x + 20;
|
||||
rcSrc2.top = pos.y + 10;
|
||||
rcSrc2.bottom = pos.y + 28;
|
||||
for (i = 0; i < MAXMOVEOBJECT - 1; i++)
|
||||
{
|
||||
if (m_moveObject->type == TYPE_BULLDOZER ||
|
||||
m_moveObject->type == TYPE_POISSON ||
|
||||
m_moveObject->type == TYPE_OISEAU ||
|
||||
m_moveObject->type == TYPE_GUEPE ||
|
||||
m_moveObject->type == TYPE_BLUPIHELICO ||
|
||||
m_moveObject->type == TYPE_BLUPITANK)
|
||||
{
|
||||
rcSrc1.right = m_moveObject->posCurrent.x + 44;
|
||||
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 };
|
||||
if (IntersectRect(&rcDst, &rcSrc1, &rcSrc2))
|
||||
break;
|
||||
}
|
||||
if (i >= 200)
|
||||
return -1;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
int CDecor::MoveObjectDelete(POINT cel)
|
||||
@ -2041,11 +2200,14 @@ int CDecor::MoveObjectFree()
|
||||
|
||||
int CDecor::SortGetType(int type)
|
||||
{
|
||||
if (type == 2 || type == 3 || type == 96 || type == 97)
|
||||
if (type == TYPE_BOMBEDOWN ||
|
||||
type == TYPE_BOMBEUP ||
|
||||
type == TYPE_BOMBEFOLLOW1 ||
|
||||
type == TYPE_BOMBEFOLLOW2)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
if (type == 12)
|
||||
if (type == TYPE_CAISSE)
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
@ -2092,7 +2254,40 @@ void CDecor::MoveObjectSort()
|
||||
|
||||
void CDecor::MoveObjectPriority(int i)
|
||||
{
|
||||
MoveObject src;
|
||||
int j;
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (m_moveObject[i].type != 23)
|
||||
{
|
||||
return;
|
||||
}
|
||||
j = 0;
|
||||
while (j < MAXMOVEOBJECT)
|
||||
{
|
||||
if (m_moveObject[j].type != 23)
|
||||
{
|
||||
if (j > i)
|
||||
{
|
||||
return;
|
||||
}
|
||||
MoveObjectCopy(src, m_moveObject[i]);
|
||||
MoveObjectCopy(m_moveObject[i], m_moveObject[j]);
|
||||
MoveObjectCopy(m_moveObject[j], src);
|
||||
if (m_moveObject[i].type == 12 || m_moveObject[j].type == 12)
|
||||
{
|
||||
UpdateCaisse();
|
||||
}
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
j++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int CDecor::MoveObjectSearch(POINT pos, int type)
|
||||
|
@ -106,11 +106,17 @@ void CDecor::FUN_15da0(int index, short step)
|
||||
|
||||
void CDecor::NetPlayerCollide(POINT pos, int* out)
|
||||
{
|
||||
int i;
|
||||
tagRECT rect1;
|
||||
RECT rect2;
|
||||
RECT rect3;
|
||||
//TODO
|
||||
|
||||
rect2.right = pos.x + 44;
|
||||
rect2.left = pos.x + 16;
|
||||
rect2.top = pos.y + 11;
|
||||
rect2.bottom = pos.y + 58;
|
||||
|
||||
// more
|
||||
}
|
||||
|
||||
void CDecor::NetMessageIndexFlush()
|
||||
|
@ -297,12 +297,12 @@ void CDecor::PlayPrepare(BOOL bTest)
|
||||
m_moveObject[i].type = 0;
|
||||
}
|
||||
|
||||
if ((m_bMulti) &&
|
||||
(m_moveObject[i].type == TYPE_CAISSE) ||
|
||||
(m_moveObject[i].type == TYPE_GOAL) ||
|
||||
(m_moveObject[i].type == TYPE_CLE) ||
|
||||
(m_moveObject[i].type == TYPE_BLUPIHELICO) ||
|
||||
(m_moveObject[i].type == TYPE_BLUPITANK))
|
||||
if (m_bMulti &&
|
||||
(m_moveObject[i].type == TYPE_CAISSE ||
|
||||
m_moveObject[i].type == TYPE_GOAL ||
|
||||
m_moveObject[i].type == TYPE_CLE ||
|
||||
m_moveObject[i].type == TYPE_BLUPIHELICO ||
|
||||
m_moveObject[i].type == TYPE_BLUPITANK))
|
||||
{
|
||||
m_moveObject[i].type = 0;
|
||||
}
|
||||
@ -388,16 +388,16 @@ void CDecor::MoveStep()
|
||||
}
|
||||
if (m_keyPress & KEY_DOWN) {
|
||||
m_posDecor.y += 50;
|
||||
int max = (m_dimDecor.y > 0) ? (m_dimDecor.y - LYIMAGE) : 0;
|
||||
int max = (m_dimDecor.y > 0) ? (MAXCELY * DIMOBJY - LYIMAGE) : 0;
|
||||
if (m_posDecor.y > max) {
|
||||
m_posDecor.y = max;
|
||||
}
|
||||
m_posCelHili.x = -1;
|
||||
}
|
||||
if (m_keyPress & KEY_UP) {
|
||||
m_posDecor.x -= 50;
|
||||
if (m_posDecor.x < 0) {
|
||||
m_posDecor.x = 0;
|
||||
m_posDecor.y -= 50;
|
||||
if (m_posDecor.y < 0) {
|
||||
m_posDecor.y = 0;
|
||||
}
|
||||
m_posCelHili.x = -1;
|
||||
}
|
||||
@ -1667,6 +1667,8 @@ void CDecor::DoorsLost()
|
||||
// more...
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Winphone functions, likely unnecessary
|
||||
/*
|
||||
BOOL CDecor::SearchGold(int n, POINT cel)
|
||||
|
40
src/decor.h
40
src/decor.h
@ -421,6 +421,11 @@ public:
|
||||
inline BOOL IsValidCel(POINT cel);
|
||||
inline void MoveObjectCopy(MoveObject src, MoveObject dest);
|
||||
inline void StopVehicleSound();
|
||||
inline BOOL IsDeadAction(int action);
|
||||
inline void StopBlupi(BOOL bFocus = FALSE);
|
||||
inline BOOL IsBlupiVehicle();
|
||||
inline BOOL IsBlupiMotorVehicle();
|
||||
inline BOOL IsBlupiStanding();
|
||||
|
||||
protected:
|
||||
HWND m_hWnd;
|
||||
@ -586,4 +591,39 @@ inline void CDecor::StopVehicleSound()
|
||||
StopSound(SOUND_HELICOLOW);
|
||||
StopSound(SOUND_JEEPHIGH);
|
||||
StopSound(SOUND_JEEPLOW);
|
||||
}
|
||||
|
||||
inline BOOL CDecor::IsDeadAction(int action)
|
||||
{
|
||||
return action == ACTION_CLEAR1 || (action >= ACTION_CLEAR2 && action <= ACTION_CLEAR8);
|
||||
}
|
||||
|
||||
inline void CDecor::StopBlupi(BOOL bSetFocus)
|
||||
{
|
||||
m_blupiAction = ACTION_STOP;
|
||||
m_blupiPhase = 0;
|
||||
if (bSetFocus) m_blupiFocus = TRUE;
|
||||
}
|
||||
|
||||
inline BOOL CDecor::IsBlupiVehicle()
|
||||
{
|
||||
return m_blupiHelico || m_blupiOver || m_blupiJeep || m_blupiTank || m_blupiSkate;
|
||||
}
|
||||
|
||||
inline BOOL CDecor::IsBlupiMotorVehicle()
|
||||
{
|
||||
return m_blupiHelico || m_blupiOver || m_blupiJeep || m_blupiTank;
|
||||
}
|
||||
|
||||
inline BOOL CDecor::IsBlupiStanding()
|
||||
{
|
||||
return !(m_blupiAction == ACTION_TURN ||
|
||||
m_blupiAction == ACTION_JUMP ||
|
||||
m_blupiAction == ACTION_AIR ||
|
||||
m_blupiAction == ACTION_VERTIGO ||
|
||||
m_blupiAction == ACTION_ADVANCE ||
|
||||
m_blupiAction == ACTION_RECEDE) &&
|
||||
!IsBlupiVehicle() &&
|
||||
!(m_blupiAir || m_blupiBalloon || m_blupiEcrase ||
|
||||
m_blupiNage || m_blupiSurf || m_blupiSuspend);
|
||||
}
|
154
src/dectables.h
154
src/dectables.h
@ -23,30 +23,33 @@ extern int table_vitesse_surf[]
|
||||
0, 2, 5, 8, 3, 0
|
||||
};
|
||||
|
||||
extern int table_bulldozer_left[8]{ 66, 66, 67, 67, 66, 66, 65, 65 };
|
||||
extern int table_bulldozer_left[]{ 8, 66, 66, 67, 67, 66, 66, 65, 65 };
|
||||
|
||||
extern int table_bulldozer_right[8]{ 58, 58, 57, 57, 58, 58, 59, 59 };
|
||||
extern int table_bulldozer_right[]{ 8, 58, 58, 57, 57, 58, 58, 59, 59 };
|
||||
|
||||
extern int table_bulldozer_turn2l[22]
|
||||
extern int table_bulldozer_turn2l[]
|
||||
{
|
||||
22,
|
||||
58, 59, 59, 59, 60, 60, 60, 61, 61, 62,
|
||||
62, 63, 63, 64, 64, 64, 65, 65, 65, 66,
|
||||
66, 66
|
||||
};
|
||||
|
||||
extern int table_bulldozer_turn2r[22]
|
||||
extern int table_bulldozer_turn2r[]
|
||||
{
|
||||
22,
|
||||
66, 65, 65, 65, 64, 64, 64, 63, 63, 62,
|
||||
62, 61, 61, 60, 60, 60, 59, 59, 59, 58,
|
||||
58, 58
|
||||
};
|
||||
|
||||
extern int table_poisson_left[8]{ 82, 82, 81, 81, 82, 82, 83, 83 };
|
||||
extern int table_poisson_left[]{ 8, 82, 82, 81, 81, 82, 82, 83, 83 };
|
||||
|
||||
extern int table_poisson_right[8]{ 79, 79, 78, 78, 79, 79, 80, 80 };
|
||||
extern int table_poisson_right[]{ 8, 79, 79, 78, 78, 79, 79, 80, 80 };
|
||||
|
||||
extern int table_poisson_turn2l[48]
|
||||
extern int table_poisson_turn2l[]
|
||||
{
|
||||
48,
|
||||
79, 79, 80, 80, 84, 84, 85, 85, 86, 86,
|
||||
87, 87, 88, 88, 83, 83, 82, 82, 83, 83,
|
||||
88, 88, 87, 87, 86, 86, 85, 85, 84, 84,
|
||||
@ -54,8 +57,9 @@ extern int table_poisson_turn2l[48]
|
||||
86, 86, 87, 87, 88, 88, 83, 83
|
||||
};
|
||||
|
||||
extern int table_poisson_turn2r[48]
|
||||
extern int table_poisson_turn2r[]
|
||||
{
|
||||
48,
|
||||
82, 82, 83, 83, 88, 88, 87, 87, 86, 86,
|
||||
85, 85, 84, 84, 79, 79, 79, 79, 80, 80,
|
||||
84, 84, 85, 85, 86, 86, 87, 87, 88, 88,
|
||||
@ -63,28 +67,29 @@ extern int table_poisson_turn2r[48]
|
||||
86, 86, 85, 85, 84, 84, 79, 79
|
||||
};
|
||||
|
||||
extern int table_oiseau_left[8]{ 98, 99, 100, 101, 102, 103, 104, 105 };
|
||||
extern int table_oiseau_left[]{ 8, 98, 99, 100, 101, 102, 103, 104, 105 };
|
||||
|
||||
extern int table_oiseau_right[8]{ 90, 91, 92, 93, 94, 95, 96, 97 };
|
||||
extern int table_oiseau_right[]{ 8, 90, 91, 92, 93, 94, 95, 96, 97 };
|
||||
|
||||
extern int table_oiseau_turn2l[10]{ 106, 107, 108, 109, 110, 111, 112, 113, 105, 105 };
|
||||
extern int table_oiseau_turn2l[]{ 10, 106, 107, 108, 109, 110, 111, 112, 113, 105, 105 };
|
||||
|
||||
extern int table_oiseau_turn2r[10]{ 114, 115, 116, 117, 118, 119, 120, 121, 97, 97 };
|
||||
extern int table_oiseau_turn2r[]{ 10, 114, 115, 116, 117, 118, 119, 120, 121, 97, 97 };
|
||||
|
||||
extern int table_guepe_left[6]{ 195, 196, 197, 198, 197, 196 };
|
||||
extern int table_guepe_left[]{ 6, 195, 196, 197, 198, 197, 196 };
|
||||
|
||||
extern int table_guepe_right[6]{ 199, 200, 201, 202, 201, 200 };
|
||||
extern int table_guepe_right[]{ 6, 199, 200, 201, 202, 201, 200 };
|
||||
|
||||
extern int table_guepe_turn2l[5]{ 207, 206, 205, 204, 203 };
|
||||
extern int table_guepe_turn2l[]{ 5, 207, 206, 205, 204, 203 };
|
||||
|
||||
extern int table_guepe_turn2r[5]{ 203, 204, 205, 206, 207 };
|
||||
extern int table_guepe_turn2r[]{ 5, 203, 204, 205, 206, 207 };
|
||||
|
||||
extern int table_creature_left[8]{ 247, 248, 249, 250, 251, 250, 249, 248 };
|
||||
extern int table_creature_left[]{ 8, 247, 248, 249, 250, 251, 250, 249, 248 };
|
||||
|
||||
extern int table_creature_right[8]{ 247, 248, 249, 250, 251, 250, 249, 248 };
|
||||
extern int table_creature_right[]{ 8, 247, 248, 249, 250, 251, 250, 249, 248 };
|
||||
|
||||
extern int table_creature_turn2[152]
|
||||
extern int table_creature_turn2[]
|
||||
{
|
||||
152,
|
||||
244, 244, 244, 244, 244, 244, 244, 244, 243, 243,
|
||||
242, 242, 242, 242, 242, 242, 242, 242, 243, 243,
|
||||
244, 244, 245, 245, 246, 246, 246, 246, 246, 246,
|
||||
@ -103,74 +108,83 @@ extern int table_creature_turn2[152]
|
||||
244, 244
|
||||
};
|
||||
|
||||
extern int table_blupih_left[8]{ 66, 67, 68, 67, 66, 69, 70, 69 };
|
||||
extern int table_blupih_left[]{ 8, 66, 67, 68, 67, 66, 69, 70, 69 };
|
||||
|
||||
extern int table_blupih_right[8]{ 61, 62, 63, 62, 61, 64, 65, 64 };
|
||||
extern int table_blupih_right[]{ 8, 61, 62, 63, 62, 61, 64, 65, 64 };
|
||||
|
||||
extern int table_blupih_turn2l[26]
|
||||
extern int table_blupih_turn2l[]
|
||||
{
|
||||
26,
|
||||
71, 71, 72, 72, 73, 73, 74, 74, 75, 75,
|
||||
68, 68, 275, 275, 271, 271, 271, 271, 272, 272,
|
||||
273, 273, 273, 273, 275, 275
|
||||
};
|
||||
|
||||
extern int table_blupih_turn2r[26]
|
||||
extern int table_blupih_turn2r[]
|
||||
{
|
||||
26,
|
||||
75, 75, 74, 74, 73, 73, 72, 72, 71, 71,
|
||||
63, 63, 274, 274, 271, 271, 271, 271, 272, 272,
|
||||
273, 273, 273, 273, 274, 274
|
||||
};
|
||||
|
||||
extern int table_blupit_left[8]{ 249, 249, 250, 250, 249, 249, 248, 248 };
|
||||
extern int table_blupit_left[]{ 8, 249, 249, 250, 250, 249, 249, 248, 248 };
|
||||
|
||||
extern int table_blupit_right[8]{ 238, 238, 237, 237, 238, 238, 239, 239 };
|
||||
extern int table_blupit_right[]{ 8, 238, 238, 237, 237, 238, 238, 239, 239 };
|
||||
|
||||
extern int table_blupit_turn2l[24]
|
||||
extern int table_blupit_turn2l[]
|
||||
{
|
||||
24,
|
||||
238, 238, 251, 251, 238, 238, 238, 239, 240, 241,
|
||||
242, 243, 244, 245, 246, 247, 248, 249, 249, 249,
|
||||
252, 252, 249, 249
|
||||
};
|
||||
|
||||
extern int table_blupit_turn2r[24]
|
||||
extern int table_blupit_turn2r[]
|
||||
{
|
||||
24,
|
||||
249, 249, 252, 252, 249, 249, 249, 248, 247, 246,
|
||||
245, 244, 243, 242, 241, 240, 239, 238, 238, 238,
|
||||
251, 251, 238, 238
|
||||
};
|
||||
|
||||
extern int table_explo1[39]
|
||||
extern int table_explo1[]
|
||||
{
|
||||
39,
|
||||
0, 0, 1, 1, 2, 2, 3, 3, 4, 3,
|
||||
4, 4, 3, 4, 3, 3, 4, 4, 5, 5,
|
||||
4, 5, 6, 5, 6, 6, 5, 5, 6, 7,
|
||||
7, 8, 8, 9, 9, 10, 10, 11, 11
|
||||
};
|
||||
|
||||
extern int table_explo2[20]
|
||||
extern int table_explo2[]
|
||||
{
|
||||
20,
|
||||
12, -1, 13, 14, -1, 15, 13, -1, 14, 15,
|
||||
12, -1, 13, 15, 14, 14, -1, 14, 15, 13
|
||||
};
|
||||
|
||||
extern int table_explo3[20]
|
||||
extern int table_explo3[]
|
||||
{
|
||||
20,
|
||||
32, 32, 34, 34, 32, 32, 34, 34, 32, 32,
|
||||
34, 34, 32, 32, 35, 35, 32, 32, 35, 35
|
||||
};
|
||||
|
||||
extern int table_explo4[9]{ 12, 13, 14, 15, 7, 8, 9, 10, 11 };
|
||||
extern int table_explo4[]{ 9, 12, 13, 14, 15, 7, 8, 9, 10, 11 };
|
||||
|
||||
extern int table_explo5[12]
|
||||
extern int table_explo5[]
|
||||
{
|
||||
12,
|
||||
54, -1, 55, -1, 56, -1, 57, -1, 58, -1,
|
||||
59, -1
|
||||
};
|
||||
|
||||
extern int table_explo6[6]{ 54, 55, 56, 57, 58, 59 };
|
||||
extern int table_explo6[]{ 6, 54, 55, 56, 57, 58, 59 };
|
||||
|
||||
extern int table_explo7[128]
|
||||
extern int table_explo7[]
|
||||
{
|
||||
128,
|
||||
60, 61, -1, 63, 64, 65, 62, 64, 62, 60,
|
||||
62, -1, 65, -1, 60, 65, 63, 61, 62, -1,
|
||||
64, 65, -1, 62, 64, 61, 62, 63, -1, 65,
|
||||
@ -186,24 +200,27 @@ extern int table_explo7[128]
|
||||
-1, 61, -1, -1, -1, 60, -1, -1
|
||||
};
|
||||
|
||||
extern int table_explo8[5]{ 7, 8, 9, 10, 11 };
|
||||
extern int table_explo8[]{ 5, 7, 8, 9, 10, 11 };
|
||||
|
||||
extern int table_sploutch1[10]{ 90, 91, 92, 93, 94, 95, 96, 97, 98, 99 };
|
||||
extern int table_sploutch1[]{ 10, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99 };
|
||||
|
||||
extern int table_sploutch2[13]
|
||||
extern int table_sploutch2[]
|
||||
{
|
||||
13,
|
||||
-1, -1, -1, 90, 91, 92, 93, 94, 95, 96,
|
||||
97, 98, 99
|
||||
};
|
||||
|
||||
extern int table_sploutch3[18]
|
||||
extern int table_sploutch3[]
|
||||
{
|
||||
18,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, 90, 91,
|
||||
92, 93, 94, 95, 96, 97, 98, 99
|
||||
};
|
||||
|
||||
extern int table_tentacule[45]
|
||||
extern int table_tentacule[]
|
||||
{
|
||||
45,
|
||||
86, 85, 84, 83, 84, 85, 86, -1, 86, 85,
|
||||
84, 83, 82, 81, 80, 79, 78, 77, 76, 75,
|
||||
74, 73, 72, 71, 70, 70, 70, 70, 71, 72,
|
||||
@ -211,8 +228,9 @@ extern int table_tentacule[45]
|
||||
83, 84, 85, 86, -1
|
||||
};
|
||||
|
||||
extern int table_bridge[157]
|
||||
extern int table_bridge[]
|
||||
{
|
||||
157,
|
||||
365, 366, 365, 366, 365, 366, 365, 366, 365, 366,
|
||||
365, 366, 365, 366, 365, 366, 367, 367, 368, 368,
|
||||
369, 369, 370, 370, 371, 371, 372, 372, -1, -1,
|
||||
@ -231,51 +249,57 @@ extern int table_bridge[157]
|
||||
367, 367, 366, 366, 365, 365, 364
|
||||
};
|
||||
|
||||
extern int table_pollution[8]{ 179, 180, 181, 182, 183, 184, 185, 186 };
|
||||
extern int table_pollution[]{ 8, 179, 180, 181, 182, 183, 184, 185, 186 };
|
||||
|
||||
extern int table_invertstart[8]{ 179, 180, 181, 182, 183, 184, 185, 186 };
|
||||
extern int table_invertstart[]{ 8, 179, 180, 181, 182, 183, 184, 185, 186 };
|
||||
|
||||
extern int table_invertstop[8]{ 186, 185, 184, 183, 182, 181, 180, 179 };
|
||||
extern int table_invertstop[]{ 8, 186, 185, 184, 183, 182, 181, 180, 179 };
|
||||
|
||||
extern int table_invertpanel[8]{ 187, 188, 189, 190, 191, 192, 193, 194 };
|
||||
extern int table_invertpanel[]{ 8, 187, 188, 189, 190, 191, 192, 193, 194 };
|
||||
|
||||
extern int table_plouf[7]{ 99, 100, 101, 102, 101, 100, 99 };
|
||||
extern int table_plouf[]{ 7, 99, 100, 101, 102, 101, 100, 99 };
|
||||
|
||||
extern int table_tiplouf[3]{ 244, 99, 244 };
|
||||
extern int table_tiplouf[]{ 3, 244, 99, 244 };
|
||||
|
||||
extern int table_blup[20]
|
||||
extern int table_blup[]
|
||||
{
|
||||
20,
|
||||
103, 104, 105, 106, 104, 103, 106, 105, 103, 104,
|
||||
103, 105, 106, 103, 105, 106, 103, 104, 106, 105
|
||||
};
|
||||
|
||||
extern int table_follow1[26]
|
||||
extern int table_follow1[]
|
||||
{
|
||||
26,
|
||||
256, 256, 256, 257, 257, 258, 259, 260, 261, 262,
|
||||
263, 264, 264, 265, 265, 265, 264, 264, 263, 262,
|
||||
261, 260, 259, 258, 257, 257
|
||||
};
|
||||
|
||||
extern int table_follow2[5]{ 256, 258, 260, 262, 264 };
|
||||
extern int table_follow2[]{ 5, 256, 258, 260, 262, 264 };
|
||||
|
||||
extern int table_cle[12]
|
||||
extern int table_cle[]
|
||||
{
|
||||
12,
|
||||
122, 123, 124, 125, 126, 127, 128, 127, 126, 125,
|
||||
124, 123
|
||||
};
|
||||
|
||||
extern int table_cle1[12]
|
||||
extern int table_cle1[]
|
||||
{
|
||||
12,
|
||||
209, 210, 211, 212, 213, 214, 215, 214, 213, 212, 211, 210
|
||||
};
|
||||
|
||||
extern int table_cle2[12]
|
||||
extern int table_cle2[]
|
||||
{
|
||||
12,
|
||||
220, 221, 222, 221, 220, 219, 218, 217, 216, 217, 218, 219
|
||||
};
|
||||
|
||||
extern int table_cle3[12]
|
||||
extern int table_cle3[]
|
||||
{
|
||||
12,
|
||||
229, 228, 227, 226, 225, 224, 223, 224, 225, 226, 227, 228
|
||||
};
|
||||
|
||||
@ -315,8 +339,9 @@ extern int table_decor_action[]
|
||||
0
|
||||
};
|
||||
|
||||
extern int table_dynamitef[100]
|
||||
extern int table_dynamitef[]
|
||||
{
|
||||
100,
|
||||
253, 252, 254, 252, 252, 255, 252, 254, 253, 252,
|
||||
253, 254, 255, 252, 255, 253, 252, 254, 252, 255,
|
||||
253, 254, 252, 253, 255, 254, 255, 252, 253, 254,
|
||||
@ -329,23 +354,26 @@ extern int table_dynamitef[100]
|
||||
255, 253, 253, 254, 255, 254, 252, 253, 254, 255
|
||||
};
|
||||
|
||||
extern int table_skate[34]
|
||||
extern int table_skate[]
|
||||
{
|
||||
34,
|
||||
129, 129, 129, 129, 130, 130, 130, 131, 131, 132,
|
||||
132, 133, 133, 134, 134, 134, 135, 135, 135, 135,
|
||||
134, 134, 134, 133, 133, 132, 132, 131, 131, 131,
|
||||
130, 130, 130, 130
|
||||
};
|
||||
|
||||
extern int table_glu[25]
|
||||
extern int table_glu[]
|
||||
{
|
||||
25,
|
||||
168, 168, 169, 169, 170, 170, 171, 171, 170, 170,
|
||||
169, 169, 168, 168, 169, 169, 169, 168, 168, 169,
|
||||
169, 170, 170, 169, 168
|
||||
};
|
||||
|
||||
extern int table_clear[70]
|
||||
extern int table_clear[]
|
||||
{
|
||||
70,
|
||||
40, 40, 40, 40, 41, 41, 41, 41, 40, 40,
|
||||
40, 40, 40, 40, 40, 41, 41, 41, 40, 40,
|
||||
40, 40, 40, 40, 40, 41, 41, 41, 40, 40,
|
||||
@ -355,8 +383,9 @@ extern int table_clear[70]
|
||||
47, 47, 46, 46, 47, 47, 46, 46, 47, 47
|
||||
};
|
||||
|
||||
extern int table_electro[90]
|
||||
extern int table_electro[]
|
||||
{
|
||||
90,
|
||||
266, 267, 266, 267, 266, 267, 266, 267, 266, 267,
|
||||
266, 267, 266, 267, 266, 267, 266, 267, 266, 267,
|
||||
266, 267, 266, 267, 266, 267, 266, 267, 266, 267,
|
||||
@ -368,11 +397,11 @@ extern int table_electro[90]
|
||||
46, 46, 47, 47, 46, 46, 47, 47, 46, 46
|
||||
};
|
||||
|
||||
extern int table_chenille[6]{ 311, 312, 313, 314, 315, 316 };
|
||||
extern int table_chenille[]{ 6, 311, 312, 313, 314, 315, 316 };
|
||||
|
||||
extern int table_chenillei[6]{ 316, 315, 314, 313, 312, 311 };
|
||||
extern int table_chenillei[]{ 6, 316, 315, 314, 313, 312, 311 };
|
||||
|
||||
extern int table_adapt_decor[144]
|
||||
extern int table_adapt_decor[]
|
||||
{
|
||||
153, 147, 148, 146, 40, 151, 150, 144, 39, 152,
|
||||
149, 145, 38, 36, 37, 35, 153, 147, 148, 146,
|
||||
@ -391,8 +420,9 @@ extern int table_adapt_decor[144]
|
||||
251, 250, 256, 250
|
||||
};
|
||||
|
||||
extern int table_adapt_fromage[32]
|
||||
extern int table_adapt_fromage[]
|
||||
{
|
||||
32
|
||||
-1, 265, 264, 268, 267, 273, 271, 275, 266, 272,
|
||||
270, 274, 269, 277, 276, 278, -1, 286, 285, 289,
|
||||
288, 294, 292, 296, 287, 293, 291, 295, 290, 298,
|
||||
|
241
src/def.h
241
src/def.h
@ -114,42 +114,42 @@ enum {
|
||||
|
||||
// Actions :
|
||||
|
||||
#define ACTION_STOP 1
|
||||
#define ACTION_MARCH 2
|
||||
#define ACTION_STOP 1 // stand still
|
||||
#define ACTION_MARCH 2 // walk
|
||||
#define ACTION_TURN 3
|
||||
#define ACTION_JUMP 4
|
||||
#define ACTION_JUMP 4 // beginning to jump
|
||||
#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_DOWN 6 // look down
|
||||
#define ACTION_UP 7 // look up
|
||||
#define ACTION_VERTIGO 8 // "whoops"
|
||||
#define ACTION_RECEDE 9 // back away from edge
|
||||
#define ACTION_ADVANCE 10 // walk forward away from edge
|
||||
#define ACTION_CLEAR1 11
|
||||
#define ACTION_SET 12
|
||||
#define ACTION_WIN 13
|
||||
#define ACTION_PUSH 14
|
||||
#define ACTION_PUSH 14 // pushing a case
|
||||
#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_STOPNAGE 18 // stopped in deep water
|
||||
#define ACTION_MARCHNAGE 19 // swimming in deep water
|
||||
#define ACTION_TURNNAGE 20 // turning in deep water
|
||||
#define ACTION_STOPSURF 21 // stopped on water surface
|
||||
#define ACTION_MARCHSURF 22 // swimming at water surface
|
||||
#define ACTION_TURNSURF 23 // turning at water surface
|
||||
#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_STOPPOP 28 // pulling a case, stopped
|
||||
#define ACTION_POP 29 // pulling a case
|
||||
#define ACTION_BYE 30 // "au au"
|
||||
#define ACTION_STOPSUSPEND 31 // stopped on bars
|
||||
#define ACTION_MARCHSUSPEND 32 // moving on bars
|
||||
#define ACTION_TURNSUSPEND 33 // turning on bars
|
||||
#define ACTION_JUMPSUSPEND 34 // pulling up from bars
|
||||
#define ACTION_HIDE 35 // invisible
|
||||
#define ACTION_JUMPAIE 36 // headache
|
||||
#define ACTION_STOPSKATE 37
|
||||
#define ACTION_MARCHSKATE 38
|
||||
#define ACTION_TURNSKATE 39
|
||||
@ -160,14 +160,14 @@ enum {
|
||||
#define ACTION_OUF1a 44
|
||||
#define ACTION_OUF1b 45
|
||||
#define ACTION_OUF2 46
|
||||
#define ACTION_OUF3 47
|
||||
#define ACTION_OUF3 47 // stop moving case "gahh...!"
|
||||
#define ACTION_OUF4 48
|
||||
#define ACTION_SUCETTE 49
|
||||
#define ACTION_SUCETTE 49 // eating lollipop
|
||||
#define ACTION_STOPTANK 50
|
||||
#define ACTION_MARCHTANK 51
|
||||
#define ACTION_TURNTANK 52
|
||||
#define ACTION_FIRETANK 53
|
||||
#define ACTION_GLU 54
|
||||
#define ACTION_GLU 54 // glued
|
||||
#define ACTION_DRINK 55
|
||||
#define ACTION_CHARGE 56
|
||||
#define ACTION_ELECTRO 57
|
||||
@ -179,10 +179,10 @@ enum {
|
||||
#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_BALLOON 66 // stung by wasp
|
||||
#define ACTION_STOPOVER 67 // stopped in hovercraft
|
||||
#define ACTION_MARCHOVER 68 // moving in hovercraft
|
||||
#define ACTION_TURNOVER 69 // turning in hovercraft
|
||||
#define ACTION_RECEDEq 70
|
||||
#define ACTION_ADVANCEq 71
|
||||
#define ACTION_STOPECRASE 72
|
||||
@ -197,7 +197,7 @@ enum {
|
||||
#define ACTION_CLEAR8 81
|
||||
#define ACTION_SWITCH 82
|
||||
#define ACTION_MOCKERYp 83
|
||||
#define ACTION_NON 84
|
||||
#define ACTION_NON 84 // can't place personal bomb
|
||||
#define ACTION_SLOWDOWNSKATE 85
|
||||
#define ACTION_TAKEDYNAMITE 86
|
||||
#define ACTION_PUTDYNAMITE 87
|
||||
@ -213,9 +213,9 @@ enum {
|
||||
|
||||
// Types :
|
||||
|
||||
#define TYPE_ASCENSEUR 1
|
||||
#define TYPE_BOMBEDOWN 2
|
||||
#define TYPE_BOMBEUP 3
|
||||
#define TYPE_ASCENSEUR 1 // lift
|
||||
#define TYPE_BOMBEDOWN 2 // floor bomb
|
||||
#define TYPE_BOMBEUP 3 // hanging bomb
|
||||
#define TYPE_BULLDOZER 4
|
||||
#define TYPE_TRESOR 5
|
||||
#define TYPE_EGG 6
|
||||
@ -229,61 +229,61 @@ enum {
|
||||
#define TYPE_PLOUF 14
|
||||
#define TYPE_BLUP 15
|
||||
#define TYPE_BOMBEMOVE 16
|
||||
#define TYPE_POISSON 17
|
||||
#define TYPE_POISSON 17 // fish
|
||||
#define TYPE_TOMATES 18 // unused
|
||||
#define TYPE_JEEP 19
|
||||
#define TYPE_OISEAU 20
|
||||
#define TYPE_CLE 21
|
||||
#define TYPE_OISEAU 20 // bird
|
||||
#define TYPE_CLE 21 // gold key
|
||||
#define TYPE_DOOR 22
|
||||
#define TYPE_BALLE 23
|
||||
#define TYPE_BALLE 23 // glue ball
|
||||
#define TYPE_SKATE 24
|
||||
#define TYPE_SHIELD 25
|
||||
#define TYPE_POWER 26
|
||||
#define TYPE_MAGICTRACK 27
|
||||
#define TYPE_POWER 26 // lollipop
|
||||
#define TYPE_MAGICTRACK 27 // sparkles
|
||||
#define TYPE_TANK 28
|
||||
#define TYPE_BULLET 29
|
||||
#define TYPE_DRINK 30
|
||||
#define TYPE_CHARGE 31
|
||||
#define TYPE_CHARGE 31 // charging device
|
||||
#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_CLEAR 37 // burned blupi
|
||||
#define TYPE_ELECTRO 38 // shocked blupi
|
||||
#define TYPE_TRESORTRACK 39 // sparkles
|
||||
#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_GUEPE 44 // wasp
|
||||
#define TYPE_OVER 46 // hovercraft
|
||||
#define TYPE_ASCENSEURs 47 // conveyor belt right
|
||||
#define TYPE_ASCENSEURsi 48 // conveyor belt left
|
||||
#define TYPE_CLE1 49 // red key
|
||||
#define TYPE_CLE2 50 // green key
|
||||
#define TYPE_CLE3 51 // blue key
|
||||
#define TYPE_BRIDGE 52 // fragile bridge
|
||||
#define TYPE_TENTACULE 53 // slime tentacle effect
|
||||
#define TYPE_CREATURE 54 // moving slime creature
|
||||
#define TYPE_DYNAMITE 55
|
||||
#define TYPE_DYNAMITEf 56
|
||||
#define TYPE_SHIELDTRACK 57
|
||||
#define TYPE_HIDETRACK 58
|
||||
#define TYPE_DYNAMITEf 56 // lit dynamite
|
||||
#define TYPE_SHIELDTRACK 57 // particles
|
||||
#define TYPE_HIDETRACK 58 // particles
|
||||
#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 TYPE_BOMBEFOLLOW1 96 // homing bomb, stopped
|
||||
#define TYPE_BOMBEFOLLOW2 97 // homing bomb, moving
|
||||
#define TYPE_SPLOUTCH1 98 // particles
|
||||
#define TYPE_SPLOUTCH2 99 // particles
|
||||
#define TYPE_SPLOUTCH3 100 // particles
|
||||
#define TYPE_BOMBEPERSO1 200 // player 1 personal bomb (yellow)
|
||||
#define TYPE_BOMBEPERSO2 201 // player 2 personal bomb (orange)
|
||||
#define TYPE_BOMBEPERSO3 202 // player 3 personal bomb (blue)
|
||||
#define TYPE_BOMBEPERSO4 203 // player 4 personal bomb (green)
|
||||
|
||||
// Steps :
|
||||
|
||||
@ -297,15 +297,15 @@ enum {
|
||||
// Sons :
|
||||
|
||||
#define SOUND_CLICK 0
|
||||
#define SOUND_JUMP1 1
|
||||
#define SOUND_JUMP2 2
|
||||
#define SOUND_JUMPEND 3
|
||||
#define SOUND_JUMPTOC 4
|
||||
#define SOUND_JUMP1 1 // medium jump
|
||||
#define SOUND_JUMP2 2 // high jump
|
||||
#define SOUND_JUMPEND 3 // step on stone
|
||||
#define SOUND_JUMPTOC 4 // hit stone
|
||||
#define SOUND_TURN 5
|
||||
#define SOUND_VERTIGO 6
|
||||
#define SOUND_DOWN 7
|
||||
#define SOUND_VERTIGO 6 // "whoops"
|
||||
#define SOUND_DOWN 7 // look down
|
||||
#define SOUND_FALL 8
|
||||
#define SOUND_NEW 9
|
||||
#define SOUND_NEW 9 // respawn
|
||||
#define SOUND_BOUM 10
|
||||
#define SOUND_TRESOR 11
|
||||
#define SOUND_EGG 12
|
||||
@ -316,79 +316,79 @@ enum {
|
||||
#define SOUND_HELICOSTOP 17
|
||||
#define SOUND_HELICOLOW 18
|
||||
#define SOUND_LASTTRESOR 19
|
||||
#define SOUND_UP 20
|
||||
#define SOUND_UP 20 // partially unused sound when pressing left+right+down
|
||||
#define SOUND_LOOKUP 21
|
||||
#define SOUND_JUMP0 22
|
||||
#define SOUND_JUMP0 22 // low jump
|
||||
#define SOUND_PLOUF 23
|
||||
#define SOUND_BLUP 24
|
||||
#define SOUND_SURF 25
|
||||
#define SOUND_SURF 25 // inhale
|
||||
#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_BYE 32 // "au au"
|
||||
#define SOUND_DOOR 33 // door creak
|
||||
#define SOUND_SUSPENDTOC 34 // grab bar
|
||||
#define SOUND_SUSPENDJUMP 35 // pull up from bar
|
||||
#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_PUSH 38 // pushing crate
|
||||
#define SOUND_POP 39 // pulling crate
|
||||
#define SOUND_JUMPAIE 40 // headache "aie"
|
||||
#define SOUND_RESSORT 41 // spring
|
||||
#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_STARTPOWER 44 // lollipop activate
|
||||
#define SOUND_STOPPOWER 45 // lollipop deactivate
|
||||
#define SOUND_OUF1 46 // exit water "phew"
|
||||
#define SOUND_OUF2 47 // scared "huaaaahhhhh--!"
|
||||
#define SOUND_OUF3 48 // stop moving case "gahh...!"
|
||||
#define SOUND_OUF4 49 // shriek, heartbeat
|
||||
#define SOUND_SUCETTE 50 // lick lollipop
|
||||
#define SOUND_GLU 51 // buaaaaaaaaaaaah
|
||||
#define SOUND_FIREOK 52
|
||||
#define SOUND_FIREKO 53 // ratchet
|
||||
#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_PERSOTAKE 60 // "wow!"
|
||||
#define SOUND_PERSOPOSE 61 // *evil laugh*
|
||||
#define SOUND_STARTHIDE 62
|
||||
#define SOUND_STOPHIDE 63
|
||||
#define SOUND_TIPLOUF 64
|
||||
#define SOUND_TIPLOUF 64 // light splash
|
||||
#define SOUND_MOCKERY 65
|
||||
#define SOUND_INVERTSTART 66
|
||||
#define SOUND_INVERTSTOP 67
|
||||
#define SOUND_OVERSTOP 68
|
||||
#define SOUND_BLITZ 69
|
||||
#define SOUND_OVERSTOP 68 // hovercraft stall
|
||||
#define SOUND_BLITZ 69 // lightning buzz
|
||||
#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_BRIDGE1 72 // bridge fall
|
||||
#define SOUND_BRIDGE2 73 // bridge appear
|
||||
#define SOUND_ANGEL 74 // "uie uie uie, aie aie aie"
|
||||
#define SOUND_SCIE 75 // saw
|
||||
#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 SOUND_JUMPENDb 78 // step on wood
|
||||
#define SOUND_JUMPTOCb 79 // hit wood
|
||||
#define SOUND_JUMPENDm 80 // step on metal
|
||||
#define SOUND_JUMPTOCm 81 // hit metal
|
||||
#define SOUND_JUMPENDg 82 // step on cave
|
||||
#define SOUND_JUMPTOCg 83 // hit cave
|
||||
#define SOUND_JUMPENDo 84 // step on slime
|
||||
#define SOUND_JUMPTOCo 85 // hit slime
|
||||
#define SOUND_JUMPENDk 86 // step on plastic
|
||||
#define SOUND_JUMPTOCk 87 // hit plastic
|
||||
#define SOUND_JUMPENDf 88 // step on cheese
|
||||
#define SOUND_JUMPTOCf 89 // hit cheese
|
||||
#define SOUND_JUMPENDh 90 // step on grass
|
||||
#define SOUND_JUMPTOCh 91 // hit grass
|
||||
#define SOUND_FOLLOW 92 // homing bomb "be-be-beep"
|
||||
#define SOUND_MOVIE 99
|
||||
|
||||
//
|
||||
@ -1190,6 +1190,9 @@ namespace Object {
|
||||
#define CLE_GREEN (1 << 1)
|
||||
#define CLE_BLUE (1 << 2)
|
||||
|
||||
#define JAUGE_AIR 0
|
||||
#define JAUGE_POWER 1
|
||||
|
||||
// helpers for POINT
|
||||
|
||||
POINT operator+(POINT p, const POINT& a)
|
||||
|
@ -2440,6 +2440,8 @@ BOOL CEvent::DrawButtons()
|
||||
BOOL bEnable;
|
||||
int phase;
|
||||
|
||||
|
||||
|
||||
if (m_phase != WM_PHASE_INSERT && m_phase != WM_PHASE_BYE)
|
||||
{
|
||||
m_bChangeCheat = FALSE;
|
||||
@ -2528,6 +2530,38 @@ BOOL CEvent::DrawButtons()
|
||||
|
||||
PutTextInputBox({ 320, 232 });
|
||||
}
|
||||
/*
|
||||
// TEMP DEBUG
|
||||
if (m_keyPress & KEY_LEFT)
|
||||
{
|
||||
DrawTextLeft(m_pPixmap, { LXIMAGE - 30, 15 }, "<", 0);
|
||||
}
|
||||
if (m_keyPress & KEY_RIGHT)
|
||||
{
|
||||
DrawTextLeft(m_pPixmap, { LXIMAGE - 10, 15 }, ">", 0);
|
||||
}
|
||||
if (m_keyPress & KEY_UP)
|
||||
{
|
||||
DrawTextLeft(m_pPixmap, { LXIMAGE - 20, 5 }, "^", 0);
|
||||
}
|
||||
if (m_keyPress & KEY_DOWN)
|
||||
{
|
||||
DrawTextLeft(m_pPixmap, { LXIMAGE - 20, 15 }, "v", 0);
|
||||
}
|
||||
if (m_keyPress & KEY_FIRE)
|
||||
{
|
||||
DrawTextLeft(m_pPixmap, { LXIMAGE - 60, 15 }, "F", 0);
|
||||
}
|
||||
if (m_keyPress & KEY_JUMP)
|
||||
{
|
||||
DrawTextLeft(m_pPixmap, { LXIMAGE - 50, 15 }, "J", 0);
|
||||
}
|
||||
sprintf(res, "%d", m_keyPress);
|
||||
DrawTextLeft(m_pPixmap, { LXIMAGE - 60, 30 }, res, 0);
|
||||
sprintf(res, "demoTime %d", m_demoTime);
|
||||
DrawTextLeft(m_pPixmap, { 60, 0 }, res, m_demoTime % 20 < 10 ? FONTGOLD : FONTWHITE);
|
||||
if (m_demoTime % 20 == 0 && m_demoTime > 0) m_pSound->PlayImage(93, { 320, 240 });
|
||||
*/
|
||||
|
||||
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);
|
||||
|
@ -90,7 +90,7 @@ public:
|
||||
void SetState(int button, int state);
|
||||
BOOL GetEnable(int button);
|
||||
void SetEnable(int button, int bEnable);
|
||||
void SetSomething(int button, int bSomething);
|
||||
void SetIconMenu(int button, int bSomething);
|
||||
BOOL GetHide(int button);
|
||||
void SetHide(int button, BOOL bHide);
|
||||
int GetMenu(int button);
|
||||
|
548
src/network.cpp
548
src/network.cpp
@ -10,161 +10,208 @@
|
||||
// a0f94abe-11c3-d111-be62-0040f6944838
|
||||
#define APP_GUID { 0xbe4af9a0, 0xc311, 0x11d1, { 0xbe, 0x62, 0x00, 0x40, 0xf6, 0x94, 0x48, 0x38 } };
|
||||
|
||||
extern "C" {
|
||||
CNetwork::CNetwork()
|
||||
CNetwork::CNetwork()
|
||||
{
|
||||
m_pDP = NULL;
|
||||
m_dpid = 0;
|
||||
m_bHost = FALSE;
|
||||
m_providers.nb = 0;
|
||||
m_providers.pList = NULL;
|
||||
m_sessions.nb = 0;
|
||||
m_sessions.pList = NULL;
|
||||
m_unknown.nb = 0;
|
||||
m_unknown.pList = NULL;
|
||||
}
|
||||
|
||||
CNetwork::~CNetwork()
|
||||
{
|
||||
FreeProviderList();
|
||||
FreeSessionList();
|
||||
FreeUnknownList();
|
||||
if (m_pDP) m_pDP->Release();
|
||||
}
|
||||
|
||||
static BOOL EnumProvidersCallback(LPGUID lpguidSP, LPSTR lpSPName,
|
||||
DWORD dwMajorVersion, DWORD dwMinorVersion, NamedGUIDList* lpContext)
|
||||
{
|
||||
if (lpContext->nb < MAXSESSION)
|
||||
{
|
||||
m_pDP = NULL;
|
||||
m_dpid = 0;
|
||||
m_bHost = FALSE;
|
||||
m_providers.nb = 0;
|
||||
m_providers.pList = NULL;
|
||||
m_sessions.nb = 0;
|
||||
m_sessions.pList = NULL;
|
||||
m_unknown.nb = 0;
|
||||
m_unknown.pList = NULL;
|
||||
lpContext->pList[lpContext->nb]->guid = *lpguidSP;
|
||||
strcpy(lpContext->pList[lpContext->nb]->name, lpSPName);
|
||||
lpContext->nb++;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
CNetwork::~CNetwork()
|
||||
{
|
||||
FreeProviderList();
|
||||
FreeSessionList();
|
||||
FreeUnknownList();
|
||||
if (m_pDP) m_pDP->Release();
|
||||
}
|
||||
BOOL CNetwork::EnumProviders()
|
||||
{
|
||||
FreeProviderList();
|
||||
m_providers.nb = 0;
|
||||
m_providers.pList = (NamedGUID(*)[MAXSESSION]) malloc(MAXSESSION * sizeof(NamedGUID));
|
||||
|
||||
static BOOL EnumProvidersCallback(LPGUID lpguidSP, LPSTR lpSPName,
|
||||
DWORD dwMajorVersion, DWORD dwMinorVersion, NamedGUIDList* lpContext)
|
||||
{
|
||||
if (lpContext->nb < MAXSESSION)
|
||||
{
|
||||
lpContext->pList[lpContext->nb]->guid = *lpguidSP;
|
||||
strcpy(lpContext->pList[lpContext->nb]->name, lpSPName);
|
||||
lpContext->nb++;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL CNetwork::EnumProviders()
|
||||
{
|
||||
FreeProviderList();
|
||||
m_providers.nb = 0;
|
||||
m_providers.pList = (NamedGUID(*)[MAXSESSION]) malloc(MAXSESSION * sizeof(NamedGUID));
|
||||
|
||||
if (!m_providers.pList) return FALSE;
|
||||
if (!m_providers.pList) return FALSE;
|
||||
#ifdef _UNICODE
|
||||
if (DirectPlayEnumerate((LPDPENUMDPCALLBACK)EnumProvidersCallback, &m_providers) != DP_OK)
|
||||
if (DirectPlayEnumerate((LPDPENUMDPCALLBACK)EnumProvidersCallback, &m_providers) != DP_OK)
|
||||
#else
|
||||
if (DirectPlayEnumerate((LPDPENUMDPCALLBACKA)EnumProvidersCallback, &m_providers) != DP_OK)
|
||||
if (DirectPlayEnumerate((LPDPENUMDPCALLBACKA)EnumProvidersCallback, &m_providers) != DP_OK)
|
||||
#endif
|
||||
{
|
||||
FreeProviderList();
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int CNetwork::GetNbProviders()
|
||||
{
|
||||
return m_providers.nb;
|
||||
}
|
||||
|
||||
char* CNetwork::GetProviderName(int index)
|
||||
{
|
||||
if (index >= m_providers.nb) return NULL;
|
||||
return m_providers.pList[index]->name;
|
||||
}
|
||||
|
||||
BOOL CNetwork::CreateProvider(int index)
|
||||
{
|
||||
LPDIRECTPLAY lpDP;
|
||||
BOOL bOK = FALSE;
|
||||
|
||||
if (index >= m_providers.nb) return FALSE;
|
||||
|
||||
if (DirectPlayCreate(&m_providers.pList[index]->guid, &lpDP, 0) == DP_OK)
|
||||
{
|
||||
if (lpDP->QueryInterface(IID_IDirectPlay2A, (LPVOID*)&m_pDP) == DP_OK)
|
||||
{
|
||||
FreeProviderList();
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int CNetwork::GetNbProviders()
|
||||
if (lpDP) lpDP->Release();
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void CNetwork::FreeProviderList()
|
||||
{
|
||||
if (m_providers.pList) free(m_providers.pList); // wrong
|
||||
|
||||
m_providers.nb = 0;
|
||||
m_providers.pList = NULL;
|
||||
}
|
||||
|
||||
|
||||
static BOOL EnumSessionsCallback(LPDPSESSIONDESC2 lpThisSD,
|
||||
LPDWORD lpdwTimeOut, DWORD dwFlags, NamedGUIDList* lpContext)
|
||||
{
|
||||
if (dwFlags & DPESC_TIMEDOUT) return FALSE;
|
||||
|
||||
if (lpContext->nb < MAXSESSION)
|
||||
{
|
||||
return m_providers.nb;
|
||||
lpContext->pList[lpContext->nb]->guid = lpThisSD->guidInstance;
|
||||
strcpy(lpContext->pList[lpContext->nb]->name, lpThisSD->lpszSessionNameA);
|
||||
lpContext->nb++;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
char* CNetwork::GetProviderName(int index)
|
||||
BOOL CNetwork::EnumSessions()
|
||||
{
|
||||
DPSESSIONDESC2 desc;
|
||||
|
||||
FreeSessionList();
|
||||
m_sessions.nb = 0;
|
||||
m_sessions.pList = (NamedGUID(*)[MAXSESSION]) malloc(MAXSESSION * sizeof(NamedGUID));
|
||||
|
||||
if (!m_sessions.pList) return FALSE;
|
||||
|
||||
ZeroMemory(&desc, sizeof(desc));
|
||||
|
||||
desc.guidApplication = APP_GUID;
|
||||
desc.dwSize = sizeof(desc);
|
||||
|
||||
if (m_pDP->EnumSessions(&desc, 0, (LPDPENUMSESSIONSCALLBACK2)EnumSessionsCallback, &m_sessions, DPENUMSESSIONS_AVAILABLE) != DP_OK)
|
||||
{
|
||||
if (index >= m_providers.nb) return NULL;
|
||||
return m_providers.pList[index]->name;
|
||||
}
|
||||
|
||||
BOOL CNetwork::CreateProvider(int index)
|
||||
{
|
||||
LPDIRECTPLAY lpDP;
|
||||
BOOL bOK = FALSE;
|
||||
|
||||
if (index >= m_providers.nb) return FALSE;
|
||||
|
||||
if (DirectPlayCreate(&m_providers.pList[index]->guid, &lpDP, 0) == DP_OK)
|
||||
{
|
||||
if (lpDP->QueryInterface(IID_IDirectPlay2A, (LPVOID*)&m_pDP) == DP_OK)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
if (lpDP) lpDP->Release();
|
||||
FreeSessionList();
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void CNetwork::FreeProviderList()
|
||||
{
|
||||
if (m_providers.pList) free(m_providers.pList); // wrong
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
m_providers.nb = 0;
|
||||
m_providers.pList = NULL;
|
||||
char* CNetwork::GetSessionName(int index)
|
||||
{
|
||||
if (index >= m_sessions.nb) return NULL;
|
||||
return m_sessions.pList[index]->name;
|
||||
}
|
||||
|
||||
BOOL CNetwork::JoinSession(int index, char* pPlayerName)
|
||||
{
|
||||
DPNAME name;
|
||||
DPSESSIONDESC2 desc;
|
||||
HRESULT hr;
|
||||
|
||||
if (index > m_sessions.nb) return FALSE;
|
||||
|
||||
ZeroMemory(&desc, sizeof(desc));
|
||||
|
||||
desc.guidInstance = m_sessions.pList[index]->guid;
|
||||
|
||||
hr = m_pDP->Open(&desc, DPOPEN_OPENSESSION);
|
||||
if (hr != DP_OK)
|
||||
{
|
||||
TraceErrorDP(hr);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
static BOOL EnumSessionsCallback(LPDPSESSIONDESC2 lpThisSD,
|
||||
LPDWORD lpdwTimeOut, DWORD dwFlags, NamedGUIDList* lpContext)
|
||||
name.dwSize = sizeof(name);
|
||||
name.dwFlags = 0;
|
||||
name.lpszShortNameA = pPlayerName;
|
||||
name.lpszLongNameA = NULL;
|
||||
hr = m_pDP->CreatePlayer(&m_dpid, &name, NULL, NULL, 0, 0);
|
||||
if (hr != DP_OK)
|
||||
{
|
||||
if (dwFlags & DPESC_TIMEDOUT) return FALSE;
|
||||
|
||||
if (lpContext->nb < MAXSESSION)
|
||||
{
|
||||
lpContext->pList[lpContext->nb]->guid = lpThisSD->guidInstance;
|
||||
strcpy(lpContext->pList[lpContext->nb]->name, lpThisSD->lpszSessionNameA);
|
||||
lpContext->nb++;
|
||||
}
|
||||
TraceErrorDP(hr);
|
||||
m_pDP->Close();
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_bHost = FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
BOOL CNetwork::EnumSessions()
|
||||
void CNetwork::FreeSessionList()
|
||||
{
|
||||
if (m_sessions.pList) free(m_sessions.pList);
|
||||
|
||||
m_sessions.nb = 0;
|
||||
m_sessions.pList = NULL;
|
||||
}
|
||||
|
||||
BOOL CNetwork::CreateSession(char* pSessionName, char* pPlayerName)
|
||||
{
|
||||
DPNAME name;
|
||||
DPSESSIONDESC2 desc;
|
||||
HRESULT hr;
|
||||
|
||||
ZeroMemory(&desc, sizeof(desc));
|
||||
|
||||
desc.guidApplication = APP_GUID;
|
||||
desc.lpszSessionNameA = pSessionName;
|
||||
desc.dwSize = sizeof(desc);
|
||||
desc.dwFlags = DPSESSION_KEEPALIVE | DPSESSION_MIGRATEHOST;
|
||||
desc.dwMaxPlayers = MAXPLAYERS;
|
||||
|
||||
hr = m_pDP->Open(&desc, DPOPEN_CREATE);
|
||||
if (hr != DP_OK)
|
||||
{
|
||||
DPSESSIONDESC2 desc;
|
||||
|
||||
FreeSessionList();
|
||||
m_sessions.nb = 0;
|
||||
m_sessions.pList = (NamedGUID(*)[MAXSESSION]) malloc(MAXSESSION * sizeof(NamedGUID));
|
||||
|
||||
if (!m_sessions.pList) return FALSE;
|
||||
|
||||
ZeroMemory(&desc, sizeof(desc));
|
||||
|
||||
desc.guidApplication = APP_GUID;
|
||||
desc.dwSize = sizeof(desc);
|
||||
|
||||
if (m_pDP->EnumSessions(&desc, 0, (LPDPENUMSESSIONSCALLBACK2)EnumSessionsCallback, &m_sessions, DPENUMSESSIONS_AVAILABLE) != DP_OK)
|
||||
{
|
||||
FreeSessionList();
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
TraceErrorDP(hr);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
char* CNetwork::GetSessionName(int index)
|
||||
else
|
||||
{
|
||||
if (index >= m_sessions.nb) return NULL;
|
||||
return m_sessions.pList[index]->name;
|
||||
}
|
||||
|
||||
BOOL CNetwork::JoinSession(int index, char* pPlayerName)
|
||||
{
|
||||
DPNAME name;
|
||||
DPSESSIONDESC2 desc;
|
||||
HRESULT hr;
|
||||
|
||||
if (index > m_sessions.nb) return FALSE;
|
||||
|
||||
ZeroMemory(&desc, sizeof(desc));
|
||||
|
||||
desc.guidInstance = m_sessions.pList[index]->guid;
|
||||
|
||||
hr = m_pDP->Open(&desc, DPOPEN_OPENSESSION);
|
||||
if (hr != DP_OK)
|
||||
{
|
||||
TraceErrorDP(hr);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
name.dwSize = sizeof(name);
|
||||
name.dwFlags = 0;
|
||||
name.lpszShortNameA = pPlayerName;
|
||||
@ -178,168 +225,119 @@ extern "C" {
|
||||
}
|
||||
else
|
||||
{
|
||||
m_bHost = FALSE;
|
||||
m_bHost = TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CNetwork::FreeSessionList()
|
||||
BOOL CNetwork::Send(LPVOID lpData, DWORD dwDataSize, DWORD dwFlags)
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
if (!m_pDP) return FALSE;
|
||||
|
||||
if (hr = m_pDP->Send(m_dpid, 0, !!dwFlags, lpData, dwDataSize), hr != DP_OK)
|
||||
{
|
||||
if (m_sessions.pList) free(m_sessions.pList);
|
||||
TraceErrorDP(hr);
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
m_sessions.nb = 0;
|
||||
m_sessions.pList = NULL;
|
||||
BOOL CNetwork::Receive(LPVOID pDest, DWORD dwDataSize, LPDWORD lpdwPlayer)
|
||||
{
|
||||
DPID from = 0, to = 0;
|
||||
DWORD dataSize = 500;
|
||||
char dataBuffer[500];
|
||||
HRESULT hr;
|
||||
|
||||
hr = m_pDP->Receive(&from, &to, DPRECEIVE_ALL, dataBuffer, &dataSize);
|
||||
if (hr != DP_OK)
|
||||
{
|
||||
if (hr != DPERR_NOMESSAGES) TraceErrorDP(hr);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL CNetwork::CreateSession(char* pSessionName, char* pPlayerName)
|
||||
ZeroMemory(pDest, dwDataSize);
|
||||
|
||||
*lpdwPlayer = -1;
|
||||
for (int i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
DPNAME name;
|
||||
DPSESSIONDESC2 desc;
|
||||
HRESULT hr;
|
||||
|
||||
ZeroMemory(&desc, sizeof(desc));
|
||||
|
||||
desc.guidApplication = APP_GUID;
|
||||
desc.lpszSessionNameA = pSessionName;
|
||||
desc.dwSize = sizeof(desc);
|
||||
desc.dwFlags = DPSESSION_KEEPALIVE | DPSESSION_MIGRATEHOST;
|
||||
desc.dwMaxPlayers = MAXPLAYERS;
|
||||
|
||||
hr = m_pDP->Open(&desc, DPOPEN_CREATE);
|
||||
if (hr != DP_OK)
|
||||
if (m_players[i].bIsPresent && from == i)
|
||||
{
|
||||
TraceErrorDP(hr);
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
name.dwSize = sizeof(name);
|
||||
name.dwFlags = 0;
|
||||
name.lpszShortNameA = pPlayerName;
|
||||
name.lpszLongNameA = NULL;
|
||||
hr = m_pDP->CreatePlayer(&m_dpid, &name, NULL, NULL, 0, 0);
|
||||
if (hr != DP_OK)
|
||||
{
|
||||
TraceErrorDP(hr);
|
||||
m_pDP->Close();
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_bHost = TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
*lpdwPlayer = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
BOOL CNetwork::Send(LPVOID lpData, DWORD dwDataSize, DWORD dwFlags)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL CNetwork::Close()
|
||||
{
|
||||
return m_pDP->Close() == DP_OK;
|
||||
}
|
||||
|
||||
void CNetwork::FreeUnknownList()
|
||||
{
|
||||
if (m_unknown.pList) free(m_unknown.pList);
|
||||
|
||||
m_unknown.nb = 0;
|
||||
m_unknown.pList = NULL;
|
||||
}
|
||||
|
||||
BOOL CNetwork::IsHost()
|
||||
{
|
||||
return m_bHost;
|
||||
}
|
||||
|
||||
void TraceErrorDP(HRESULT hErr)
|
||||
{
|
||||
char dperr[256];
|
||||
char err[1024];
|
||||
|
||||
switch (hErr)
|
||||
{
|
||||
HRESULT hr;
|
||||
case DPERR_OUTOFMEMORY: sprintf(dperr, "DPERR_OUTOFMEMORY"); break;
|
||||
case DPERR_UNSUPPORTED: sprintf(dperr, "DPERR_UNSUPPORTED"); break;
|
||||
case DPERR_NOINTERFACE: sprintf(dperr, "DPERR_NOINTERFACE"); break;
|
||||
case DPERR_GENERIC: sprintf(dperr, "DPERR_GENERIC"); break;
|
||||
case DPERR_INVALIDPARAMS: sprintf(dperr, "DPERR_INVALIDPARAMS"); break;
|
||||
case DPERR_ACTIVEPLAYERS: sprintf(dperr, "DPERR_ACTIVEPLAYERS"); break;
|
||||
case DPERR_ACCESSDENIED: sprintf(dperr, "DPERR_ACCESSDENIED"); break;
|
||||
case DPERR_CANTADDPLAYER: sprintf(dperr, "DPERR_CANTADDPLAYER"); break;
|
||||
case DPERR_CANTCREATEPLAYER: sprintf(dperr, "DPERR_CANTCREATEPLAYER"); break;
|
||||
case DPERR_CANTCREATEGROUP: sprintf(dperr, "DPERR_CANTCREATEGROUP"); break;
|
||||
case DPERR_CANTCREATESESSION: sprintf(dperr, "DPERR_CANTCREATESESSION"); break;
|
||||
case DPERR_CAPSNOTAVAILABLEYET: sprintf(dperr, "DPERR_CAPTSNOTAVAILABLEYET"); break;
|
||||
case DPERR_ALREADYINITIALIZED: sprintf(dperr, "DPERR_ALREADYINITIALIZED"); break;
|
||||
case DPERR_INVALIDFLAGS: sprintf(dperr, "DPERR_INVALIDFLAGS"); break;
|
||||
case DPERR_EXCEPTION: sprintf(dperr, "DPERR_EXCEPTION"); break;
|
||||
case DPERR_INVALIDPLAYER: sprintf(dperr, "DPERR_INVALIDPLAYER"); break;
|
||||
case DPERR_INVALIDOBJECT: sprintf(dperr, "DPERR_INVALIDOBJECT"); break;
|
||||
case DPERR_NOCONNECTION: sprintf(dperr, "DPERR_NOCONNECTION"); break;
|
||||
case DPERR_NONAMESERVERFOUND: sprintf(dperr, "DPERR_NONAMESERVERFOUND"); break;
|
||||
case DPERR_NOMESSAGES: sprintf(dperr, "DPERR_NOMESSAGES"); break;
|
||||
case DPERR_NOSESSIONS: sprintf(dperr, "DPERR_NOSESSIONS"); break;
|
||||
case DPERR_NOPLAYERS: sprintf(dperr, "DPERR_NOPLAYERS"); break;
|
||||
case DPERR_TIMEOUT: sprintf(dperr, "DPERR_TIMEOUT"); break;
|
||||
case DPERR_SENDTOOBIG: sprintf(dperr, "DPERR_SENDTOOBIG"); break;
|
||||
case DPERR_BUSY: sprintf(dperr, "DPERR_BUSY"); break;
|
||||
case DPERR_UNAVAILABLE: sprintf(dperr, "DPERR_UNAVAILABLE"); break;
|
||||
case DPERR_PLAYERLOST: sprintf(dperr, "DPERR_PLAYERLOST"); break;
|
||||
case DPERR_USERCANCEL: sprintf(dperr, "DPERR_USERCANCEL"); break;
|
||||
case DPERR_BUFFERTOOLARGE: sprintf(dperr, "DPERR_BUFFERTOOLARGE"); break;
|
||||
case DPERR_SESSIONLOST: sprintf(dperr, "DPERR_SESSIONLOST"); break;
|
||||
case DPERR_APPNOTSTARTED: sprintf(dperr, "DPERR_APPNOTSTARTED"); break;
|
||||
case DPERR_CANTCREATEPROCESS: sprintf(dperr, "DPERR_CANTCREATEPROCESS"); break;
|
||||
case DPERR_UNKNOWNAPPLICATION: sprintf(dperr, "DPERR_UNKNOWNAPPLICATION"); break;
|
||||
case DPERR_INVALIDINTERFACE: sprintf(dperr, "DPERR_INVALIDINTERFACE"); break;
|
||||
case DPERR_NOTLOBBIED: sprintf(dperr, "DPERR_NOTLOBBIED"); break;
|
||||
case DP_OK: sprintf(dperr, "DP_OK"); break;
|
||||
|
||||
if (!m_pDP) return FALSE;
|
||||
|
||||
if (hr = m_pDP->Send(m_dpid, 0, !!dwFlags, lpData, dwDataSize), hr != DP_OK)
|
||||
{
|
||||
TraceErrorDP(hr);
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL CNetwork::Receive(LPVOID pDest, DWORD dwDataSize, LPDWORD lpdwPlayer)
|
||||
{
|
||||
DPID from = 0, to = 0;
|
||||
DWORD dataSize = 500;
|
||||
char dataBuffer[500];
|
||||
HRESULT hr;
|
||||
|
||||
hr = m_pDP->Receive(&from, &to, DPRECEIVE_ALL, dataBuffer, &dataSize);
|
||||
if (hr != DP_OK)
|
||||
{
|
||||
if (hr != DPERR_NOMESSAGES) TraceErrorDP(hr);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
ZeroMemory(pDest, dwDataSize);
|
||||
|
||||
*lpdwPlayer = -1;
|
||||
for (int i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
if (m_players[i].bIsPresent && from == i)
|
||||
{
|
||||
*lpdwPlayer = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL CNetwork::Close()
|
||||
{
|
||||
return m_pDP->Close() == DP_OK;
|
||||
}
|
||||
|
||||
void CNetwork::FreeUnknownList()
|
||||
{
|
||||
if (m_unknown.pList) free(m_unknown.pList);
|
||||
|
||||
m_unknown.nb = 0;
|
||||
m_unknown.pList = NULL;
|
||||
}
|
||||
|
||||
BOOL CNetwork::IsHost()
|
||||
{
|
||||
return m_bHost;
|
||||
}
|
||||
|
||||
void TraceErrorDP(HRESULT hErr)
|
||||
{
|
||||
char dperr[256];
|
||||
char err[1024];
|
||||
|
||||
switch (hErr)
|
||||
{
|
||||
case DPERR_OUTOFMEMORY: sprintf(dperr, "DPERR_OUTOFMEMORY"); break;
|
||||
case DPERR_UNSUPPORTED: sprintf(dperr, "DPERR_UNSUPPORTED"); break;
|
||||
case DPERR_NOINTERFACE: sprintf(dperr, "DPERR_NOINTERFACE"); break;
|
||||
case DPERR_GENERIC: sprintf(dperr, "DPERR_GENERIC"); break;
|
||||
case DPERR_INVALIDPARAMS: sprintf(dperr, "DPERR_INVALIDPARAMS"); break;
|
||||
case DPERR_ACTIVEPLAYERS: sprintf(dperr, "DPERR_ACTIVEPLAYERS"); break;
|
||||
case DPERR_ACCESSDENIED: sprintf(dperr, "DPERR_ACCESSDENIED"); break;
|
||||
case DPERR_CANTADDPLAYER: sprintf(dperr, "DPERR_CANTADDPLAYER"); break;
|
||||
case DPERR_CANTCREATEPLAYER: sprintf(dperr, "DPERR_CANTCREATEPLAYER"); break;
|
||||
case DPERR_CANTCREATEGROUP: sprintf(dperr, "DPERR_CANTCREATEGROUP"); break;
|
||||
case DPERR_CANTCREATESESSION: sprintf(dperr, "DPERR_CANTCREATESESSION"); break;
|
||||
case DPERR_CAPSNOTAVAILABLEYET: sprintf(dperr, "DPERR_CAPTSNOTAVAILABLEYET"); break;
|
||||
case DPERR_ALREADYINITIALIZED: sprintf(dperr, "DPERR_ALREADYINITIALIZED"); break;
|
||||
case DPERR_INVALIDFLAGS: sprintf(dperr, "DPERR_INVALIDFLAGS"); break;
|
||||
case DPERR_EXCEPTION: sprintf(dperr, "DPERR_EXCEPTION"); break;
|
||||
case DPERR_INVALIDPLAYER: sprintf(dperr, "DPERR_INVALIDPLAYER"); break;
|
||||
case DPERR_INVALIDOBJECT: sprintf(dperr, "DPERR_INVALIDOBJECT"); break;
|
||||
case DPERR_NOCONNECTION: sprintf(dperr, "DPERR_NOCONNECTION"); break;
|
||||
case DPERR_NONAMESERVERFOUND: sprintf(dperr, "DPERR_NONAMESERVERFOUND"); break;
|
||||
case DPERR_NOMESSAGES: sprintf(dperr, "DPERR_NOMESSAGES"); break;
|
||||
case DPERR_NOSESSIONS: sprintf(dperr, "DPERR_NOSESSIONS"); break;
|
||||
case DPERR_NOPLAYERS: sprintf(dperr, "DPERR_NOPLAYERS"); break;
|
||||
case DPERR_TIMEOUT: sprintf(dperr, "DPERR_TIMEOUT"); break;
|
||||
case DPERR_SENDTOOBIG: sprintf(dperr, "DPERR_SENDTOOBIG"); break;
|
||||
case DPERR_BUSY: sprintf(dperr, "DPERR_BUSY"); break;
|
||||
case DPERR_UNAVAILABLE: sprintf(dperr, "DPERR_UNAVAILABLE"); break;
|
||||
case DPERR_PLAYERLOST: sprintf(dperr, "DPERR_PLAYERLOST"); break;
|
||||
case DPERR_USERCANCEL: sprintf(dperr, "DPERR_USERCANCEL"); break;
|
||||
case DPERR_BUFFERTOOLARGE: sprintf(dperr, "DPERR_BUFFERTOOLARGE"); break;
|
||||
case DPERR_SESSIONLOST: sprintf(dperr, "DPERR_SESSIONLOST"); break;
|
||||
case DPERR_APPNOTSTARTED: sprintf(dperr, "DPERR_APPNOTSTARTED"); break;
|
||||
case DPERR_CANTCREATEPROCESS: sprintf(dperr, "DPERR_CANTCREATEPROCESS"); break;
|
||||
case DPERR_UNKNOWNAPPLICATION: sprintf(dperr, "DPERR_UNKNOWNAPPLICATION"); break;
|
||||
case DPERR_INVALIDINTERFACE: sprintf(dperr, "DPERR_INVALIDINTERFACE"); break;
|
||||
case DPERR_NOTLOBBIED: sprintf(dperr, "DPERR_NOTLOBBIED"); break;
|
||||
case DP_OK: sprintf(dperr, "DP_OK"); break;
|
||||
|
||||
default: sprintf(dperr, "Unknown Error"); break;
|
||||
}
|
||||
sprintf(err, "DirectPlay Error %s\n", dperr);
|
||||
OutputDebug(err);
|
||||
default: sprintf(dperr, "Unknown Error"); break;
|
||||
}
|
||||
sprintf(err, "DirectPlay Error %s\n", dperr);
|
||||
OutputDebug(err);
|
||||
}
|
121
src/network.h
121
src/network.h
@ -9,74 +9,71 @@
|
||||
#define MAXSESSION 100
|
||||
#define MAXPLAYERS 4
|
||||
|
||||
extern "C" {
|
||||
typedef struct
|
||||
{
|
||||
char bIsPresent;
|
||||
char ready;
|
||||
char unk_2;
|
||||
char unk_3;
|
||||
DPID dpid;
|
||||
short team;
|
||||
char name[22];
|
||||
}
|
||||
NetPlayer;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char bIsPresent;
|
||||
char ready;
|
||||
char unk_2;
|
||||
char unk_3;
|
||||
DPID dpid;
|
||||
short team;
|
||||
char name[22];
|
||||
}
|
||||
NetPlayer;
|
||||
typedef struct
|
||||
{
|
||||
GUID guid;
|
||||
char name[100];
|
||||
}
|
||||
NamedGUID;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
GUID guid;
|
||||
char name[100];
|
||||
}
|
||||
NamedGUID;
|
||||
typedef struct
|
||||
{
|
||||
int nb;
|
||||
NamedGUID (*pList)[MAXSESSION];
|
||||
}
|
||||
NamedGUIDList;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int nb;
|
||||
NamedGUID(*pList)[MAXSESSION];
|
||||
}
|
||||
NamedGUIDList;
|
||||
class CNetwork
|
||||
{
|
||||
public:
|
||||
CNetwork();
|
||||
~CNetwork();
|
||||
|
||||
class CNetwork
|
||||
{
|
||||
public:
|
||||
CNetwork();
|
||||
~CNetwork();
|
||||
BOOL EnumProviders();
|
||||
BOOL GetNbProviders();
|
||||
char* GetProviderName(int index);
|
||||
BOOL CreateProvider(int index);
|
||||
void FreeProviderList();
|
||||
BOOL EnumSessions();
|
||||
char* GetSessionName(int index);
|
||||
BOOL JoinSession(int index, char* pPlayerName);
|
||||
void FreeSessionList();
|
||||
BOOL CreateSession(char* pSessionName, char* pPlayerName);
|
||||
BOOL Send(LPVOID lpData, DWORD dwDataSize, DWORD dwFlags);
|
||||
BOOL Receive(LPVOID pDest, DWORD dwDataSize, LPDWORD lpdwPlayer);
|
||||
BOOL Close();
|
||||
void FreeUnknownList();
|
||||
BOOL IsHost();
|
||||
|
||||
BOOL EnumProviders();
|
||||
BOOL GetNbProviders();
|
||||
char* GetProviderName(int index);
|
||||
BOOL CreateProvider(int index);
|
||||
void FreeProviderList();
|
||||
BOOL EnumSessions();
|
||||
char* GetSessionName(int index);
|
||||
BOOL JoinSession(int index, char* pPlayerName);
|
||||
void FreeSessionList();
|
||||
BOOL CreateSession(char* pSessionName, char* pPlayerName);
|
||||
BOOL Send(LPVOID lpData, DWORD dwDataSize, DWORD dwFlags);
|
||||
BOOL Receive(LPVOID pDest, DWORD dwDataSize, LPDWORD lpdwPlayer);
|
||||
BOOL Close();
|
||||
void FreeUnknownList();
|
||||
BOOL IsHost();
|
||||
NetPlayer m_players[4];
|
||||
DPID m_dpid;
|
||||
|
||||
NetPlayer m_players[4];
|
||||
DPID m_dpid;
|
||||
protected:
|
||||
LPDIRECTPLAY2 m_pDP;
|
||||
NamedGUIDList m_providers;
|
||||
NamedGUIDList m_sessions;
|
||||
NamedGUIDList m_unknown;
|
||||
BOOL m_bHost;
|
||||
|
||||
// NetPlayer m_players[4];
|
||||
};
|
||||
|
||||
protected:
|
||||
LPDIRECTPLAY2 m_pDP;
|
||||
NamedGUIDList m_providers;
|
||||
NamedGUIDList m_sessions;
|
||||
NamedGUIDList m_unknown;
|
||||
BOOL m_bHost;
|
||||
static BOOL EnumProvidersCallback(LPGUID lpguidSP, LPSTR lpSTName,
|
||||
DWORD dwMajorVersion, DWORD dwMinorVersion, NamedGUIDList* lpContext);
|
||||
|
||||
// NetPlayer m_players[4];
|
||||
};
|
||||
static BOOL EnumSessionsCallback(LPDPSESSIONDESC2 lpThisSD,
|
||||
LPDWORD lpdwTimeOut, DWORD dwFlags, NamedGUIDList* lpContext);
|
||||
|
||||
static BOOL EnumProvidersCallback(LPGUID lpguidSP, LPSTR lpSTName,
|
||||
DWORD dwMajorVersion, DWORD dwMinorVersion, NamedGUIDList* lpContext);
|
||||
|
||||
static BOOL EnumSessionsCallback(LPDPSESSIONDESC2 lpThisSD,
|
||||
LPDWORD lpdwTimeOut, DWORD dwFlags, NamedGUIDList* lpContext);
|
||||
|
||||
void TraceErrorDP(HRESULT hErr);
|
||||
}
|
||||
void TraceErrorDP(HRESULT hErr);
|
Loading…
x
Reference in New Issue
Block a user