From ae16984db49eecd31f917ea6e6faacc54563ebdb Mon Sep 17 00:00:00 2001 From: jummy Date: Sun, 6 Oct 2024 01:07:18 -0500 Subject: [PATCH] can you believe it? gaming --- src/decblock.cpp | 26 +- src/decblupi.cpp | 522 ++++++++++++++++++++---------------- src/decio.cpp | 121 +++++---- src/decmove.cpp | 14 +- src/decor.cpp | 203 ++++++++++---- src/decor.h | 21 +- src/dectables.h | 208 ++++++-------- src/def.h | 66 ++--- src/event.cpp | 70 ++--- src/event.h | 2 +- src/misc.cpp | 24 +- src/misc.h | 2 +- src/network.cpp | 5 +- src/network.h | 1 - src/pixmap.cpp | 12 +- src/sound.cpp | 5 - util/extract_tableblupi.py | 15 ++ util/extract_tablemirror.py | 15 ++ 18 files changed, 739 insertions(+), 593 deletions(-) create mode 100644 util/extract_tableblupi.py create mode 100644 util/extract_tablemirror.py diff --git a/src/decblock.cpp b/src/decblock.cpp index 1334eb7..9238d5e 100644 --- a/src/decblock.cpp +++ b/src/decblock.cpp @@ -123,36 +123,36 @@ int CDecor::IsWorld(POINT pos) { pos.x += 30; pos.y += 30; - if (pos.x < 0 || pos.x >= 6400 || pos.y < 0 || pos.y >= 6400) + if (pos.x < 0 || pos.x >= DIMOBJX * MAXCELX || pos.y < 0 || pos.y >= DIMOBJY * MAXCELY) { return -1; } int icon = m_decor[pos.x / DIMOBJX][pos.y / DIMOBJY].icon; - if (icon >= 158 && icon <= 165) + if (icon >= Object::World_1 && icon <= Object::World_8) { - return icon - 158 + 1; + return icon - Object::World_1 + 1; } - if (icon >= 166 && icon <= 173) + if (icon >= Object::WorldDone_1 && icon <= Object::WorldDone_8) { - return icon - 166 + 1; + return icon - Object::WorldDone_1 + 1; } - if (icon == 309 || icon == 310) + if (icon == Object::World_9 || icon == Object::WorldDone_9) { return 9; } - if (icon >= 411 && icon <= 415) + if (icon >= Object::World_10 && icon <= Object::World_14) { - return icon - 411 + 10; + return icon - Object::World_10 + 10; } - if (icon >= 416 && icon <= 420) + if (icon >= Object::WorldDone_10 && icon <= Object::WorldDone_14) { - return icon - 416 + 10; + return icon - Object::WorldDone_10 + 10; } - if (icon >= 174 && icon <= 181) + if (icon >= Object::Level_1 && icon <= Object::Level_8) { - return icon - 174 + 1; + return icon - Object::Level_1 + 1; } - if (icon == 184) + if (icon == Object::WorldBack) { return 199; } diff --git a/src/decblupi.cpp b/src/decblupi.cpp index 4f5eb2c..e3273f1 100644 --- a/src/decblupi.cpp +++ b/src/decblupi.cpp @@ -3,7 +3,7 @@ #include "misc.h" #include "decor.h" -#include "misc.h" +#include "text.h" // debug //#include "resource.h" #include "dectables.h" @@ -36,107 +36,170 @@ void CDecor::GetBlupiInfo(BOOL* bHelico, BOOL* bJeep, BOOL* bSkate, BOOL* bNage) *bNage = m_blupiNage | m_blupiSurf; } +// set blupi's current graphics icon according to his state +// from ghidra void CDecor::BlupiSearchIcon() + { - int num = 0; - int num2 = 2; - int num3 = m_blupiAction; - if (m_blupiVent && m_blupiHelico && m_blupiOver) + int phase; + int action = m_blupiAction; + int icon = 2; + + if (m_blupiVent && !m_blupiHelico && !m_blupiOver) { - if (num3 == 1) - { - num3 = 8; - } - if (num3 == 2) - { - num3 = 14; - } + if (action == 0x1) action = 0x8; + if (action == 0x2) action = 0xe; } + if (m_blupiHelico) { - if (num3 == 1) - { - num3 = 15; - } - if (num3 == 2) - { - num3 = 16; - } - if (num3 == 3) - { - num3 = 17; - } - if (num3 == 10) - { - num3 = 15; - } - if (num3 == 9) - { - num3 = 15; - } + if (action == 0x1) action = 0xf; + if (action == 0x2) action = 0x10; + if (action == 0x3) action = 0x11; + if (action == 0xa) action = 0xf; + if (action == 0x9) action = 0xf; } + if (m_blupiOver) { - if (num3 == 1) - { - num3 = 67; - } - if (num3 == 2) - { - num3 = 68; - } - if (num3 == 3) - { - num3 = 69; - } - if (num3 == 10) - { - num3 = 67; - } - if (num3 == 9) - { - num3 = 67; - } + if (action == 0x1) action = 0x43; + if (action == 0x2) action = 0x44; + if (action == 0x3) action = 0x45; + if (action == 0xa) action = 0x43; + if (action == 0x9) action = 0x43; } + if (m_blupiJeep) { - if (num3 == 1) - { - num3 = 25; - } - if (num3 == 2) - { - num3 = 26; - } - if (num3 == 10) - { - num3 = 26; - } - if (num3 == 3) - { - num3 = 27; - } + if (action == 0x1) action = 0x19; + if (action == 0x2) action = 0x1a; + if (action == 0xa) action = 0x1a; + if (action == 0x3) action = 0x1b; } + if (m_blupiTank) { - if (num3 == 1) + if (action == 0x1) action = 0x32; + if (action == 0x2) action = 0x33; + if (action == 0xa) action = 0x33; + if (action == 0x3) action = 0x34; + } + + if (m_blupiSkate) + { + if (action == 0x1) action = 0x25; + if (action == 0x2) action = 0x26; + if (action == 0xa) action = 0x26; + if (action == 0x3) action = 0x27; + if (action == 0x3b) action = 0x27; + if (action == 0x4) action = 0x28; + if (action == 0x5) action = 0x29; + } + + if (m_blupiNage) + { + if (action == 0x1) action = 0x12; + if (action == 0x2) action = 0x13; + if (action == 0x3) action = 0x14; + if ((m_blupiVitesse).x == 0) { - num3 = 50; - } - if (num3 == 2) - { - num3 = 51; - } - if (num3 == 10) - { - num3 = 51; - } - if (num3 == 3) - { - num3 = 52; + if (action == 0x12) action = 0x15; + if (action == 0x13) action = 0x16; } } - // more...? + + if (m_blupiSurf) + { + if (action == 0x1) action = 0x15; + if (action == 0x2) action = 0x16; + if (action == 0x3) action = 0x17; + } + + if (m_blupiSuspend) + { + if (action == 0x1) action = 0x1f; + if (action == 0x2) action = 0x20; + if (action == 0x3) action = 0x21; + if (action == 0x4) action = 0x22; + } + + if (m_blupiBalloon) action = 0x42; + + if (m_blupiEcrase) + { + if (action == 0x1) action = 0x48; + if (action == 0x2) action = 0x49; + if (action == 0x3) action = 0x49; + } + + if ((action == 0x1) && + ((((((phase = m_blupiPhase % 330, phase == 0x7d || (phase == 0x81)) || (phase == 0x87)) || (((phase == 0x8b || (phase == 0xd7)) || ((phase == 0xdb || ((phase == 0xe1 || (phase == 0xe5)))))))) || + ((phase == 0xeb || (((phase == 0xef || (phase == 0xf5)) || (phase == 0xf9)))))) || (((phase == 0xff || (phase == 0x103)) || ((phase == 0x109 || (phase == 0x10d)))))))) + { + PlaySound(SOUND_PATIENT, m_blupiPos, FALSE); + } + if ((action == 0x1f) && (((phase = m_blupiPhase % 328, phase == 0x76 || (phase == 0xe6)) || (phase == 0x116)))) + { + PlaySound(SOUND_SINGE, m_blupiPos, FALSE); + } + if ((((action == 0x15) || (action == 0x16)) && (m_blupiPhase % 0xc == 0)) && (m_blupiSurf)) + { + MoveObjectTiplouf(m_blupiPos); + } + for (int i = 0; table_blupi[i] != 0; i += table_blupi[i + 1] + 3) + { + if (action == table_blupi[i]) + { + if ((table_blupi[i + 2] == 0 || m_blupiPhase <= table_blupi[i + 2]) && table_blupi[i + 1] != 0) + { + icon = table_blupi[i + 3 + m_blupiPhase % table_blupi[i + 1]]; + } + else + { + icon = table_blupi[i + 3 + table_blupi[i + 2]]; + } + break; + } + } + if ((action == 0xb || action == 0x4b || action == 0x4c || action == 0x36 || action == 0x39) && icon < 0x10a) + { + m_blupiChannel = 10; + } + else + { + m_blupiChannel = 2; + } + if (m_blupiDir == DIR_LEFT || (m_blupiDir == DIR_RIGHT && m_blupiInvert)) + { + if (m_blupiChannel == 2) + { + if (action == 0x1f) + { + if (icon == 0x90) + { + icon = 0x9e; + } + if (icon == 0x8f) + { + icon = 0x91; + } + if (icon == 0x97) + { + icon = 0x92; + } + } + if ((-1 < icon) && (icon < 0x14f)) + { + icon = table_mirror[icon]; + } + } + if (true && m_blupiChannel == 10 && 0xa7 < icon && icon < 0xac) + { + icon = (icon + 4); + } + } + m_blupiIcon = icon; + m_blupiPhase = m_blupiPhase + 1; } BOOL CDecor::BlupiIsGround() @@ -310,76 +373,22 @@ BOOL CDecor::BlupiBloque(POINT pos, int dir) return DecorDetect(rect); } -// rewritten. wip -/* -void CDecor::BlupiStep() -{ - RECT blupiRect, rect; - BOOL flag; - POINT point; - int num; - BlupiAdjust(); - POINT adjustPos = m_blupiPos + m_blupiVector; - if (m_blupiVector.x != 0 || m_blupiVector.y != 0) - { - blupiRect = BlupiRect(m_blupiPos); - rect.top = m_blupiPos.y + 11; - rect.left = m_blupiPos.x; - rect.right = - rect.bottom = m_blupiPos.x + 58; - TestPath(rect, m_blupiPos, &adjustPos); - } - m_blupiVent = FALSE; - if (m_blupiTransport == -1) - { - if (!m_blupiJeep && !m_blupiTank && !m_blupiSkate && m_blupiFocus) - { - int object = m_decor[(adjustPos.x + 32) / 64][(adjustPos.y + 32) / 64].icon; - if (object == 110) adjustPos.x -= 9; // left wind - if (object == 114) adjustPos.x += 9; // right - if (object == 118) adjustPos.y -= 9; // up - if (object == 122) adjustPos.y += 9; // down - if (object >= 110 && object <= 125) - { - m_blupiVent = TRUE; - rect.top = m_blupiPos.y + 11; - rect.left = m_blupiPos.x + 12; - rect.right = m_blupiPos.x + 48; - rect.bottom = m_blupiPos.y + 58; - TestPath(rect, m_blupiPos, &adjustPos); - } - if (object >= 110 && object <= 125) - { - m_blupiVent = TRUE; - rect.left = m_blupiPos.x + 12; - rect.right = m_blupiPos.x + 60 - 12; - rect.top = m_blupiPos.y + 11; - rect.bottom = m_blupiPos.y + 60 - 2; - TestPath(rect, m_blupiPos, &adjustPos); - } - } - m_blupiVent = FALSE; - } -} -*/ - // handle Blupi's movement and current state. -// currently derived from winphone code -/**/ void CDecor::BlupiStep() { BOOL bNear; - BOOL bStopJumpH = FALSE; int icon; POINT tinyPoint; POINT tinyPoint2 = m_blupiPos; // = m_blupiPos ? BlupiAdjust(); //m_blupiLastPos = m_blupiPos; POINT end = m_blupiPos; - BOOL flag = m_blupiAir; int lastBlupiAction = m_blupiAction; - BOOL flag2 = FALSE; - BOOL flag3 = FALSE; + BOOL bLastBlupiAir = m_blupiAir; + BOOL bAirStart = FALSE; + BOOL bIsOpen = FALSE; + BOOL bIsOpen2 = FALSE; + int num; end.x += m_blupiVector.x; end.y += m_blupiVector.y; RECT rect; @@ -391,7 +400,6 @@ void CDecor::BlupiStep() TestPath(rect, m_blupiPos, &end); } m_blupiVent = FALSE; - int num; if (m_blupiTransport == -1 && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && m_blupiFocus) { @@ -428,11 +436,11 @@ void CDecor::BlupiStep() rect = BlupiRect(end); rect.top = end.y + DIMBLUPIY - 2; rect.bottom = end.y + DIMBLUPIY - 1; - flag = !DecorDetect(rect); + bAirStart = !DecorDetect(rect); } else { - flag = FALSE; + bAirStart = FALSE; } rect = BlupiRect(end); rect.top = end.y + 10; @@ -446,7 +454,7 @@ void CDecor::BlupiStep() !m_blupiSurf && !m_blupiSuspend && m_blupiFocus && - DecorDetect(rect)) + bAirStart) { if (m_blupiFocus) { @@ -455,7 +463,7 @@ void CDecor::BlupiStep() } m_blupiVitesse.y = 1; m_blupiAir = TRUE; - flag = TRUE; + bLastBlupiAir = TRUE; } if (!m_blupiNage && !m_blupiSurf && @@ -495,10 +503,10 @@ void CDecor::BlupiStep() m_blupiVitesse.y = (m_blupiPower ? -16 : -10); } m_blupiAir = TRUE; - flag = TRUE; + bLastBlupiAir = TRUE; PlaySound(SOUND_RESSORT, end); } - if (m_keyPress & KEY_LEFT && + if (m_keyPress & KEY_JUMP && !IsBlupiMotorVehicle() && !m_blupiBalloon && !m_blupiEcrase && @@ -521,23 +529,28 @@ void CDecor::BlupiStep() if (m_blupiSkate) { PlaySound(SOUND_JUMP1, end); - m_blupiVitesse.y = (m_blupiPower ? -17 : -13); + m_blupiVitesse.y = (m_blupiPower ? -22 : -16); } else { if (m_keyPress & KEY_UP) { PlaySound(SOUND_JUMP2, end); - m_blupiVitesse.y = (m_blupiPower ? -26 : -16); + m_blupiVitesse.y = (m_blupiPower ? -26 : -22); + } + else if (m_keyPress & KEY_DOWN) + { + PlaySound(SOUND_JUMP0, end); + m_blupiVitesse.y = (m_blupiPower ? -16 : -12); } else { PlaySound(SOUND_JUMP1, end); - m_blupiVitesse.y = (m_blupiPower ? -16 : -12); + m_blupiVitesse.y = (m_blupiPower ? -22 : -16); } } m_blupiAir = TRUE; - flag = TRUE; + bLastBlupiAir = TRUE; } } if (m_blupiAir) @@ -598,7 +611,7 @@ void CDecor::BlupiStep() if (m_blupiVitesse.y >= 0 && icon != -1) { m_blupiTransport = icon; - flag = FALSE; + bAirStart = FALSE; PlaySound(SOUND_JUMPEND, end); end.y = m_moveObject[num].posCurrent.y - DIMOBJY + BLUPIOFFY; if (m_blupiFocus) @@ -739,7 +752,7 @@ void CDecor::BlupiStep() m_blupiPhase = 0; m_blupiVitesse.y = -12; m_blupiAir = TRUE; - bStopJumpH = TRUE; + bLastBlupiAir = TRUE; } case ACTION_SUCETTE: if (m_blupiPhase == 32) @@ -794,7 +807,8 @@ void CDecor::BlupiStep() m_blupiPhase = 0; } - if ( !(m_keyPress & KEY_JUMP) && + if (m_keyPress & KEY_DOWN && + !(m_keyPress & KEY_JUMP) && IsBlupiStanding() && m_blupiAction != ACTION_DOWN && m_blupiAction != ACTION_STOPPOP && @@ -884,7 +898,26 @@ void CDecor::BlupiStep() m_blupiAction != ACTION_POP && m_blupiFocus) { - StopBlupi(); + if (m_keyPress & KEY_LEFT && !(m_lastKeyPress & (KEY_LEFT | KEY_RIGHT)) && !m_blupiAir && m_keyPress & (KEY_UP | KEY_DOWN)) + { + m_blupiAction = 1; + m_blupiPhase = 0; + } + if (!(m_keyPress & (KEY_LEFT | KEY_RIGHT)) && m_lastKeyPress & KEY_LEFT && m_keyPress & (KEY_UP | KEY_DOWN)) + { + m_blupiAction = 1; + m_blupiPhase = 0; + } + if (m_keyPress & KEY_RIGHT && !(m_lastKeyPress & (KEY_LEFT | KEY_RIGHT)) && !m_blupiAir && m_keyPress & (KEY_UP | KEY_DOWN)) + { + m_blupiAction = 1; + m_blupiPhase = 0; + } + if (!(m_keyPress & (KEY_LEFT | KEY_RIGHT)) && m_lastKeyPress & KEY_RIGHT && m_keyPress & (KEY_UP | KEY_DOWN)) + { + m_blupiAction = 1; + m_blupiPhase = 0; + } } int num3; int num4; @@ -944,9 +977,9 @@ void CDecor::BlupiStep() else { num3 = m_blupiPhase; - if (m_blupiPhase > 3 || m_blupiAir) + if (num3 > 3 || m_blupiAir) { - m_blupiPhase = 3; + num3 = 3; } num4 = table_vitesse_march[num3]; if (m_blupiPower) @@ -954,7 +987,7 @@ void CDecor::BlupiStep() num4 *= 3; num4 /= 2; } - end.x += num4; + end.x -= num4; } } if (m_blupiDir == DIR_RIGHT && m_blupiAction == ACTION_POP) @@ -1213,7 +1246,7 @@ void CDecor::BlupiStep() m_blupiTimeFire == 0 && m_blupiAction != ACTION_TURN && m_blupiAction != ACTION_HELICOGLU && - flag) + bAirStart) { if (m_blupiBullet == 0) { @@ -1226,10 +1259,10 @@ void CDecor::BlupiStep() m_blupiFocus = FALSE; } } - ////m_blupiMotorHigh = flag4; + ////m_blupiMotorHigh = bCanUseLift; if (m_blupiAction != ACTION_TURN && m_blupiAction != ACTION_HELICOGLU) { - if (bStopJumpH) + if (bAirStart) { m_blupiAction = ACTION_MARCH; } @@ -1294,20 +1327,20 @@ void CDecor::BlupiStep() MoveObjectPollution(); - if ( !flag2 && m_blupiTransport == -1) + if ( m_keyPress & KEY_DOWN && !bAirStart && m_blupiTransport == -1) { rect.left = m_blupiPos.x + 20; rect.right = m_blupiPos.x + 22; rect.top = m_blupiPos.y + 60 - 2; rect.bottom = m_blupiPos.y + 60; - flag2 = !DecorDetect(rect); + bIsOpen = !DecorDetect(rect); rect.left = m_blupiPos.x + 60 - 22; rect.right = m_blupiPos.x + 60 - 20; rect.top = m_blupiPos.y + 60 - 2; rect.bottom = m_blupiPos.y + 60; - flag3 = !DecorDetect(rect); - if (!flag2 && !flag3) + bIsOpen2 = !DecorDetect(rect); + if (!bIsOpen && !bIsOpen2) { tinyPoint.x = m_blupiPos.x; tinyPoint.y = m_blupiPos.y - BLUPIFLOOR; @@ -1323,10 +1356,10 @@ void CDecor::BlupiStep() } if (m_blupiOver && (m_blupiFocus || m_blupiAction == 58)) { - ////m_blupiMotorHigh = flag4; + ////m_blupiMotorHigh = bCanUseLift; if (m_blupiAction != ACTION_TURN) { - if (flag) + if (bAirStart) { m_blupiAction = ACTION_MARCH; } @@ -1342,13 +1375,13 @@ void CDecor::BlupiStep() rect = BlupiRect(end); rect.top = end.y + 60 - 2; rect.bottom = end.y + 60 + OVERHEIGHT - 1; - bool flag7 = !DecorDetect(rect); + bIsOpen = !DecorDetect(rect); num = MoveAscenseurDetect(m_blupiPos, OVERHEIGHT); if (num != -1) { - flag7 = FALSE; + bIsOpen = FALSE; } - if (m_keyPress & KEY_JUMP && !flag7) + if (m_keyPress & (KEY_JUMP | KEY_UP) && !bIsOpen) { if (m_blupiVitesse.y == 0 && num != -1) { @@ -1370,8 +1403,8 @@ void CDecor::BlupiStep() { m_blupiVitesse.y += 1; } - end.y += (int)m_blupiVitesse.y; - if (m_keyPress & KEY_LEFT && flag) + end.y += m_blupiVitesse.y; + if (m_keyPress & KEY_LEFT && bAirStart) { if (m_blupiVitesse.x > -12) { @@ -1384,7 +1417,7 @@ void CDecor::BlupiStep() m_blupiVitesse.x = 0; } } - else if (m_keyPress & KEY_RIGHT && flag) + else if (m_keyPress & KEY_RIGHT && bAirStart) { if (m_blupiVitesse.x < 12) { @@ -1412,20 +1445,20 @@ void CDecor::BlupiStep() MoveObjectPollution(); - if ( !flag && m_blupiTransport == -1) + if ( !bAirStart && m_blupiTransport == -1) { rect.left = m_blupiPos.x + 20; rect.right = m_blupiPos.x + 22; rect.top = m_blupiPos.y + 60 - 2; rect.bottom = m_blupiPos.y + 60; - flag2 = !DecorDetect(rect); + bIsOpen = !DecorDetect(rect); rect.left = m_blupiPos.x + 60 - 22; rect.right = m_blupiPos.x + 60 - 20; rect.top = m_blupiPos.y + 60 - 2; rect.bottom = m_blupiPos.y + 60; - flag3 = !DecorDetect(rect); - if (!flag2 && !flag3) + bIsOpen2 = !DecorDetect(rect); + if (!bIsOpen && !bIsOpen2) { tinyPoint.x = m_blupiPos.x; tinyPoint.y = m_blupiPos.y - BLUPIFLOOR; @@ -1441,7 +1474,7 @@ void CDecor::BlupiStep() } if (m_blupiBalloon && m_blupiFocus) { - if (m_keyPress & KEY_JUMP) + if (m_keyPress & (KEY_JUMP | KEY_UP)) { if (m_blupiVitesse.y > -5 && m_time % 6 == 0) { @@ -1509,7 +1542,7 @@ void CDecor::BlupiStep() } if (m_blupiEcrase && m_blupiFocus) { - if (flag) + if (bAirStart) { if (m_blupiVitesse.y < 2) { @@ -1521,7 +1554,7 @@ void CDecor::BlupiStep() m_blupiVitesse.y = 0; } end.y += (int)m_blupiVitesse.y; - if (flag) + if (bAirStart) { num3 = 7; } @@ -1575,7 +1608,7 @@ void CDecor::BlupiStep() } } } - if (m_blupiVitesse.x == 0 && !flag) + if (m_blupiVitesse.x == 0 && !bAirStart) { StopBlupi(); } @@ -1592,11 +1625,11 @@ void CDecor::BlupiStep() rect.right -= 40; rect.top = end.y + 60 - 2; rect.bottom = end.y + 60 - 1; - bool flag8 = !DecorDetect(rect); + bIsOpen = !DecorDetect(rect); rect.left += 40; rect.right += 40; - bool flag9 = !DecorDetect(rect); - if (flag) + bIsOpen2 = !DecorDetect(rect); + if (bAirStart) { if (m_blupiVitesse.y < 50) { @@ -1622,12 +1655,12 @@ void CDecor::BlupiStep() if (m_blupiVitesse.y >= 0 && num != -1) { m_blupiTransport = num; - flag2 = FALSE; + bAirStart = FALSE; PlaySound(3, end); end.y = m_moveObject[num].posCurrent.y - 64 + BLUPIOFFY; } } - if (flag8 && !flag9) + if (bIsOpen && !bIsOpen2) { int num13 = -20; if (m_blupiVitesse.x > num13) @@ -1635,7 +1668,7 @@ void CDecor::BlupiStep() m_blupiVitesse.x -= 1; } } - else if (!flag8 && flag9) + else if (!bIsOpen && bIsOpen2) { int num14 = 20; if (m_blupiVitesse.x < num14) @@ -1682,7 +1715,7 @@ void CDecor::BlupiStep() } end.x += (int)m_blupiVitesse.x; MoveObjectPollution(); - if ( !flag && m_blupiTransport == -1) + if ( !bLastBlupiAir && m_blupiTransport == -1) { tinyPoint.x = m_blupiPos.x; tinyPoint.y = m_blupiPos.y - BLUPIFLOOR; @@ -1701,7 +1734,7 @@ void CDecor::BlupiStep() { StopBlupi(); } - if ((m_keyPress & KEY_FIRE) != 0 && m_blupiTimeFire == 0 && m_blupiAction != ACTION_TURN) + if (m_keyPress & KEY_FIRE && m_blupiTimeFire == 0 && m_blupiAction != ACTION_TURN) { if (m_blupiBullet == 0) { @@ -1738,7 +1771,7 @@ void CDecor::BlupiStep() StopBlupi(); } //m_blupiMotorHigh = (m_blupiAction != 1); - if (flag) + if (bAirStart) { if (m_blupiVitesse.y < 50) { @@ -1764,7 +1797,7 @@ void CDecor::BlupiStep() if (m_blupiVitesse.y >= 0 && num != -1) { m_blupiTransport = num; - flag = FALSE; + bAirStart = FALSE; PlaySound(3, end); end.y = m_moveObject[num].posCurrent.y - 64 + BLUPIOFFY; } @@ -1808,7 +1841,7 @@ void CDecor::BlupiStep() } end.x += (int)m_blupiVitesse.x; MoveObjectPollution(); - if ( !flag && m_blupiTransport == -1) + if ( m_keyPress & KEY_DOWN && !bAirStart && m_blupiTransport == -1) { tinyPoint.x = m_blupiPos.x; @@ -1866,7 +1899,7 @@ void CDecor::BlupiStep() m_blupiVitesse.x = 0; } end.x += (int)m_blupiVitesse.x; - if ( !flag && !m_blupiAir && m_blupiTransport == -1 && m_blupiVitesse.x < 8) + if ( m_keyPress & KEY_DOWN && !bAirStart && !m_blupiAir && m_blupiTransport == -1 && m_blupiVitesse.x < 8) { m_blupiSkate = FALSE; @@ -1908,17 +1941,19 @@ void CDecor::BlupiStep() { if (m_blupiTransport == -1) { - if ((m_keyPress & KEY_JUMP) != 0) + if (m_keyPress & (KEY_JUMP | KEY_UP)) { if (m_blupiVitesse.y > -5) { m_blupiVitesse.y -= 1; } } - else if (m_blupiVitesse.y < 5) + else if (m_keyPress & KEY_DOWN) { - m_blupiVitesse.y += 1; - + if (m_blupiVitesse.y < 5) + { + m_blupiVitesse.y += 1; + } } else { @@ -2025,7 +2060,7 @@ void CDecor::BlupiStep() { if (m_blupiTransport == -1) { - if (m_keyPress & KEY_JUMP) + if (m_keyPress & (KEY_JUMP | KEY_UP)) { if (m_blupiVitesse.y > -5) { @@ -2151,7 +2186,16 @@ void CDecor::BlupiStep() PlaySound(35, end); } } - if ( !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiTank && !m_blupiJeep && !m_blupiSkate /*&& !flag4*/ && m_blupiTransport == -1 && m_blupiFocus) + if ( !m_blupiHelico && + !m_blupiOver && + !m_blupiBalloon && + !m_blupiEcrase && + !m_blupiTank && + !m_blupiJeep && + !m_blupiSkate && + !bAirStart && + m_blupiTransport == -1 && + m_blupiFocus) { if (m_blupiDynamite > 0) { @@ -2160,13 +2204,13 @@ void CDecor::BlupiStep() rect.right = end.x + 20; rect.top = end.y + 60 - 2; rect.bottom = end.y + 60; - flag2 = !DecorDetect(rect); + bIsOpen = !DecorDetect(rect); rect.left = end.x + 60 - 20; rect.right = end.x + 60 - 18; rect.top = end.y + 60 - 2; rect.bottom = end.y + 60; - flag3 = !DecorDetect(rect); - if (!flag2 && !flag3 && ObjectStart(end, 56, 0) != -1) + bIsOpen2 = !DecorDetect(rect); + if (!bIsOpen && !bIsOpen2 && ObjectStart(end, 56, 0) != -1) { m_blupiAction = 87; m_blupiPhase = 0; @@ -2184,14 +2228,14 @@ void CDecor::BlupiStep() rect.right = end.x + 20; rect.top = end.y + 60 - 2; rect.bottom = end.y + 60; - flag2 = !DecorDetect(rect); + bIsOpen = !DecorDetect(rect); rect.left = end.x + 60 - 20; rect.right = end.x + 60 - 18; rect.top = end.y + 60 - 2; rect.bottom = end.y + 60; - flag3 = !DecorDetect(rect); + bIsOpen2 = !DecorDetect(rect); num = MoveChargeDetect(end); - if (num == -1 && !flag2 && !flag3 && ObjectStart(end, 200, 0) != -1) + if (num == -1 && !bIsOpen && !bIsOpen2 && ObjectStart(end, 200, 0) != -1) { m_blupiAction = 46; m_blupiPhase = 0; @@ -2211,7 +2255,7 @@ void CDecor::BlupiStep() rect = BlupiRect(m_blupiPos); tinyPoint4 = end; TestPath(rect, m_blupiPos, &end); - if (flag && m_blupiPos.x == end.x && m_blupiPos.x != tinyPoint4.x) + if (bLastBlupiAir && m_blupiPos.x == end.x && m_blupiPos.x != tinyPoint4.x) { end.y = tinyPoint4.y; TestPath(rect, m_blupiPos, &end); @@ -2245,7 +2289,7 @@ void CDecor::BlupiStep() { if (m_blupiTransport != -1) { - AscenseurVertigo(m_blupiTransport, &flag2, &flag3); + AscenseurVertigo(m_blupiTransport, &bIsOpen, &bIsOpen2); } else { @@ -2253,14 +2297,14 @@ void CDecor::BlupiStep() rect.right = end.x + 26; rect.top = end.y + 60 - 2; rect.bottom = end.y + 60; - flag2 = !DecorDetect(rect); + bIsOpen = !DecorDetect(rect); rect.left = end.x + 60 - 26; rect.right = end.x + 60 - 24; rect.top = end.y + 60 - 2; rect.bottom = end.y + 60; - flag3 = !DecorDetect(rect); + bIsOpen2 = !DecorDetect(rect); } - if (m_blupiDir == DIR_LEFT && flag2 && !flag3) + if (m_blupiDir == DIR_LEFT && bIsOpen && !bIsOpen2) { if (m_blupiHelico || m_blupiOver || AscenseurShift(m_blupiTransport)) { @@ -2274,7 +2318,7 @@ void CDecor::BlupiStep() m_blupiPhase = 0; } } - if (m_blupiDir == DIR_RIGHT && !flag2 && flag3) + if (m_blupiDir == DIR_RIGHT && !bIsOpen && bIsOpen2) { if (m_blupiHelico || m_blupiOver || AscenseurShift(m_blupiTransport)) { @@ -2288,7 +2332,7 @@ void CDecor::BlupiStep() m_blupiPhase = 0; } } - if (m_blupiAction != ACTION_VERTIGO && m_blupiAction != ACTION_ADVANCE && m_blupiAction != ACTION_RECEDE && (flag2 || flag3)) + if (m_blupiAction != ACTION_VERTIGO && m_blupiAction != ACTION_ADVANCE && m_blupiAction != ACTION_RECEDE && (bIsOpen || bIsOpen2)) { if (!m_blupiHelico && !m_blupiOver) { @@ -2302,7 +2346,7 @@ void CDecor::BlupiStep() { if (m_blupiTransport != -1) { - AscenseurVertigo(m_blupiTransport, &flag2, &flag3); + AscenseurVertigo(m_blupiTransport, &bIsOpen, &bIsOpen2); } else { @@ -2310,19 +2354,19 @@ void CDecor::BlupiStep() rect.right = end.x + 18; rect.top = end.y + 60 - 2; rect.bottom = end.y + 60; - flag2 = !DecorDetect(rect); + bIsOpen = !DecorDetect(rect); rect.left = end.x + 60 - 18; rect.right = end.x + 60 - 2; rect.top = end.y + 60 - 2; rect.bottom = end.y + 60; - flag3 = !DecorDetect(rect); + bIsOpen2 = !DecorDetect(rect); } - if (flag2 && !flag3) + if (bIsOpen && !bIsOpen2) { m_blupiAction = 10; m_blupiPhase = 0; } - if (flag3 && !flag2) + if (!bIsOpen && bIsOpen2) { m_blupiAction = 10; m_blupiPhase = 0; @@ -2332,7 +2376,7 @@ void CDecor::BlupiStep() { if (m_blupiTransport != -1) { - AscenseurVertigo(m_blupiTransport, &flag2, &flag3); + AscenseurVertigo(m_blupiTransport, &bIsOpen, &bIsOpen2); } else { @@ -2340,19 +2384,19 @@ void CDecor::BlupiStep() rect.right = end.x + 18; rect.top = end.y + 60 - 2; rect.bottom = end.y + 60; - flag2 = !DecorDetect(rect); + bIsOpen = !DecorDetect(rect); rect.left = end.x + 60 - 18; rect.right = end.x + 60 - 2; rect.top = end.y + 60 - 2; rect.bottom = end.y + 60; - flag3 = !DecorDetect(rect); + bIsOpen2 = !DecorDetect(rect); } - if (flag2 && !flag3) + if (bIsOpen && !bIsOpen2) { m_blupiAction = 10; m_blupiPhase = 0; } - if (flag3 && !flag2) + if (!bIsOpen && bIsOpen2) { m_blupiAction = 10; m_blupiPhase = 0; @@ -2362,7 +2406,7 @@ void CDecor::BlupiStep() { if (m_blupiTransport != -1) { - AscenseurVertigo(m_blupiTransport, &flag2, &flag3); + AscenseurVertigo(m_blupiTransport, &bIsOpen, &bIsOpen2); } else { @@ -2370,19 +2414,19 @@ void CDecor::BlupiStep() rect.right = end.x + 19; rect.top = end.y + 60 - 2; rect.bottom = end.y + 60; - flag2 = !DecorDetect(rect); + bIsOpen = !DecorDetect(rect); rect.left = end.x + 60 - 19; rect.right = end.x + 60 - 12; rect.top = end.y + 60 - 2; rect.bottom = end.y + 60; - flag3 = !DecorDetect(rect); + bIsOpen2 = !DecorDetect(rect); } - if (flag2 && !flag3) + if (bIsOpen && !bIsOpen2) { m_blupiAction = 10; m_blupiPhase = 0; } - if (flag3 && !flag2) + if (!bIsOpen && bIsOpen2) { m_blupiAction = 10; m_blupiPhase = 0; @@ -3147,7 +3191,7 @@ void CDecor::BlupiStep() m_blupiJumpAie = FALSE; m_blupiFocus = FALSE; m_blupiRestart = TRUE; - if (flag) + if (bAirStart) { m_blupiAir = TRUE; } @@ -3188,7 +3232,7 @@ void CDecor::BlupiStep() m_blupiJumpAie = FALSE; m_blupiFocus = FALSE; m_blupiRestart = TRUE; - if (flag) + if (bAirStart) { m_blupiAir = TRUE; } @@ -3667,8 +3711,9 @@ void CDecor::BlupiStep() m_term = m_mission / 10 * 10; } } - if (m_blupiAction == 30 && m_blupiPhase == 30) + if (m_blupiAction == ACTION_BYE && m_blupiPhase == 30) { + ; num = IsWorld(m_blupiPos); if (num != -1) { @@ -3698,7 +3743,7 @@ void CDecor::BlupiStep() { StopSound(47); } - if (m_blupiFocus && !m_blupiAir && (!m_blupiHelico || BlupiIsGround()) && (!m_blupiOver || BlupiIsGround()) && !m_blupiBalloon && !m_blupiEcrase && !m_blupiShield && !m_blupiHide && !flag2 && !flag3 && m_blupiTransport == -1 && !IsLave(m_blupiPos) && !IsPiege(m_blupiPos) && !IsGoutte(m_blupiPos, TRUE) && !IsScie(m_blupiPos) && !IsBridge(m_blupiPos, tinyPoint) && IsTeleporte(m_blupiPos) == -1 && !IsBlitz(m_blupiPos, TRUE) && !IsTemp(m_blupiPos) && !IsBalleTraj(m_blupiPos) && !IsMoveTraj(m_blupiPos)) + if (m_blupiFocus && !m_blupiAir && (!m_blupiHelico || BlupiIsGround()) && (!m_blupiOver || BlupiIsGround()) && !m_blupiBalloon && !m_blupiEcrase && !m_blupiShield && !m_blupiHide && !bIsOpen && !bIsOpen2 && m_blupiTransport == -1 && !IsLave(m_blupiPos) && !IsPiege(m_blupiPos) && !IsGoutte(m_blupiPos, TRUE) && !IsScie(m_blupiPos) && !IsBridge(m_blupiPos, tinyPoint) && IsTeleporte(m_blupiPos) == -1 && !IsBlitz(m_blupiPos, TRUE) && !IsTemp(m_blupiPos) && !IsBalleTraj(m_blupiPos) && !IsMoveTraj(m_blupiPos)) { if (m_blupiFifoNb > 0) { @@ -3762,6 +3807,15 @@ void CDecor::BlupiStep() VoyageStep(); m_lastKeyPress = m_keyPress; + + // DEBUG v + sprintf(m_notifText[0], "blupiAction %d", m_blupiAction); + sprintf(m_notifText[1], "blupiPhase %d", m_blupiPhase); + sprintf(m_notifText[2], "blupiPos { %d, %d }", m_blupiPos.x, m_blupiPos.y); + sprintf(m_notifText[3], "blupiVitesse { %d, %d }", m_blupiVitesse.x, m_blupiVitesse.y); + sprintf(m_notifText[4], "time %d", m_time); + m_notifTime = 200; + // DEBUG ^ } diff --git a/src/decio.cpp b/src/decio.cpp index 43609f2..f851fa9 100644 --- a/src/decio.cpp +++ b/src/decio.cpp @@ -9,11 +9,11 @@ void CDecor::GetMissionPath(char* str, int user, int mission, BOOL bUser) { if (bUser != 0) { - sprintf(str, "data\%.3d-%.3d.blp", user, mission); + sprintf(str, "data\\%.3d-%.3d.blp", user, mission); AddUserPath(str); return; } - sprintf(str, "data\world%.3d.blp", mission); + sprintf(str, "data\\world%.3d.blp", mission); AddUserPath(str); return; } @@ -113,71 +113,86 @@ BOOL CDecor::Read(int gamer, int mission, BOOL bUser) GetMissionPath(filename, gamer, mission, bUser); file = fopen(filename, "rb"); - if (file == NULL) goto error; + if (file == NULL) { + OutputDebug("CDecor::Read error in fopen\n"); + OutputDebug(filename); + goto error; + } pBuffer = (DescFile*)malloc(sizeof(DescFile)); - if (pBuffer == NULL) goto error; + if (pBuffer == NULL) { + OutputDebug("CDecor::Read error in malloc\n"); + goto error; + } nb = fread(pBuffer, sizeof(DescFile), 1, file); - if (nb < 1) goto error; + if (nb < 1) { + OutputDebug("CDecor::Read error in fread\n"); + goto error; + } - majRev = pBuffer->majRev; - minRev = pBuffer->minRev; - m_posDecor = pBuffer->posDecor; - m_dimDecor = pBuffer->dimDecor; - m_music = pBuffer->music; - m_region = pBuffer->region; - if (0 < majRev && minRev > 2) - { - strcpy(m_missionTitle,pBuffer->name); - } - startDir = m_blupiStartDir; - blupiDir = pBuffer->blupiDir; - startPos = m_blupiStartPos; - blupiPos = pBuffer->blupiPos; + majRev = pBuffer->majRev; + minRev = pBuffer->minRev; + m_posDecor = pBuffer->posDecor; + m_dimDecor = pBuffer->dimDecor; + m_music = pBuffer->music; + m_region = pBuffer->region; + if (majRev >= 1 && minRev >= 3) + { + strcpy(m_missionTitle,pBuffer->name); + } + startDir = m_blupiStartDir; + blupiDir = pBuffer->blupiDir; + startPos = m_blupiStartPos; + blupiPos = pBuffer->blupiPos; - for (i = 0; i < 4; i++) - { - m_blupiStartPos[i] = pBuffer->blupiPos[i]; - } + for (i = 0; i < 4; i++) + { + m_blupiStartPos[i] = pBuffer->blupiPos[i]; + } - for (i = 0; i < 4; i++) - { - m_blupiStartDir[i] = pBuffer->blupiDir[i]; - } + for (i = 0; i < 4; i++) + { + m_blupiStartDir[i] = pBuffer->blupiDir[i]; + } - nb = fread(m_decor, sizeof(Cellule), MAXCELX * MAXCELY / 4, file); - if (nb < MAXCELX * MAXCELY / 4) goto error; + nb = fread(m_decor, sizeof(Cellule), MAXCELX * MAXCELY, file); + if (nb < MAXCELX * MAXCELY) goto error; - for (x = 0; x < MAXCELX / 2; x++) + for (x = 0; x < MAXCELX / 2; x++) + { + for (y = 0; y < MAXCELY / 2; y++) + { + if (m_decor[x][y].icon >= 48 && + m_decor[x][y].icon <= 67) { - for (y = 0; y < MAXCELY / 2; y++) - { - if (m_decor[x][y].icon >= 48 && - m_decor[x][y].icon <= 67) - { - m_decor[x][y].icon -= 128 - 17; - } - } + m_decor[x][y].icon -= 128 - 17; } + } + } - if (majRev == 1 && minRev <= 1) - { - memset(m_moveObject, 0, sizeof(MoveObject)); - nb = fread(m_moveObject, sizeof(MoveObject), MAXMOVEOBJECT / 2, file); - if (nb < MAXMOVEOBJECT / 2) goto error; - } - else - { - nb = fread(m_moveObject, sizeof(MoveObject), MAXMOVEOBJECT, file); - if (nb < MAXMOVEOBJECT) goto error; - } + if (majRev == 1 && minRev >= 1) + { + nb = fread(m_bigDecor, sizeof(Cellule), MAXCELX * MAXCELY, file); + if (nb < MAXCELX * MAXCELY) goto error; + } - free(pBuffer); - fclose(file); - return TRUE; + memset(m_moveObject, 0, sizeof(MoveObject) * MAXMOVEOBJECT); + if (majRev == 1 && minRev >= 2) + { + nb = fread(m_moveObject, sizeof(MoveObject), MAXMOVEOBJECT, file); + if (nb < MAXMOVEOBJECT) goto error; + } + else + { + nb = fread(m_moveObject, sizeof(MoveObject), MAXMOVEOBJECT / 2, file); + if (nb < MAXMOVEOBJECT / 2) goto error; + } + + free(pBuffer); + fclose(file); + return TRUE; error: - if (pBuffer != NULL) free(pBuffer); if (file != NULL) fclose(file); diff --git a/src/decmove.cpp b/src/decmove.cpp index 7cd19b0..01e98cd 100644 --- a/src/decmove.cpp +++ b/src/decmove.cpp @@ -2222,7 +2222,7 @@ void CDecor::MoveObjectSort() { if (m_moveObject[i].type != 0) { - MoveObjectCopy(m_moveObject[num++], m_moveObject[i]); + MoveObjectCopy(&m_moveObject[num++], &m_moveObject[i]); } } for (int i = num; i < MAXMOVEOBJECT; i++) @@ -2241,9 +2241,9 @@ void CDecor::MoveObjectSort() { if (SortGetType(m_moveObject[i].type) > SortGetType(m_moveObject[i + 1].type)) { - MoveObjectCopy(src, m_moveObject[i]); - MoveObjectCopy(m_moveObject[i], m_moveObject[i + 1]); - MoveObjectCopy(m_moveObject[i + 1], src); + MoveObjectCopy(&src, &m_moveObject[i]); + MoveObjectCopy(&m_moveObject[i], &m_moveObject[i + 1]); + MoveObjectCopy(&m_moveObject[i + 1], &src); flag = TRUE; } } @@ -2274,9 +2274,9 @@ void CDecor::MoveObjectPriority(int i) { return; } - MoveObjectCopy(src, m_moveObject[i]); - MoveObjectCopy(m_moveObject[i], m_moveObject[j]); - MoveObjectCopy(m_moveObject[j], src); + 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(); diff --git a/src/decor.cpp b/src/decor.cpp index b8451ab..f8258d5 100644 --- a/src/decor.cpp +++ b/src/decor.cpp @@ -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 = { 450, 196 }; + m_moveObject[1].posStart = { 322, 196 }; m_moveObject[1].posEnd = m_moveObject[1].posStart; m_moveObject[1].posCurrent = m_moveObject[1].posStart; m_moveObject[1].phase = 0; @@ -155,9 +155,15 @@ void CDecor::InitDecor() m_moveObject[1].time = 0; m_moveObject[1].channel = CHELEMENT; m_moveObject[1].icon = 29; - //TODO: iterate setting blupi fifo positions - m_blupiStartPos[0] = { 66, 192 + BLUPIOFFY }; - m_blupiStartDir[0] = DIR_RIGHT; + for (int i = 0; i < MAXFIFOPOS; i++) + { + m_blupiFifoPos[i] = { 0, 0 }; + } + for (int i = 0; i < MAXNETPLAYER; i++) + { + m_blupiStartPos[i] = { 194, 192 + BLUPIOFFY }; + m_blupiStartDir[i] = DIR_RIGHT; + } m_blupiAction = ACTION_STOP; m_blupiPhase = 0; m_blupiIcon = 0; @@ -370,35 +376,32 @@ void CDecor::MoveStep() NotifStep(); } - if (m_phase == WM_PHASE_BUILD) { - if (m_keyPress & KEY_RIGHT) { + if (m_phase == WM_PHASE_BUILD) + { + if (m_keyPress & KEY_RIGHT) + { m_posDecor.x += 50; - int max = (m_dimDecor.x != 0) ? (MAXCELX * DIMOBJX - LXIMAGE) : 0; - if (m_posDecor.x > max) { - m_posDecor.x = max; - } + int limit = (m_dimDecor.x != 0) ? (MAXCELX * DIMOBJX - LXIMAGE) : 0; + if (m_posDecor.x > limit) m_posDecor.x = limit; m_posCelHili.x = -1; } - if (m_keyPress & KEY_LEFT) { + if (m_keyPress & KEY_LEFT) + { m_posDecor.x -= 50; - if (m_posDecor.x < 0) { - m_posDecor.x = 0; - } + if (m_posDecor.x < 0) m_posDecor.x = 0; m_posCelHili.x = -1; } - if (m_keyPress & KEY_DOWN) { + if (m_keyPress & KEY_DOWN) + { m_posDecor.y += 50; - int max = (m_dimDecor.y > 0) ? (MAXCELY * DIMOBJY - LYIMAGE) : 0; - if (m_posDecor.y > max) { - m_posDecor.y = max; - } + int limit = (m_dimDecor.y > 0) ? (MAXCELY * DIMOBJY - LYIMAGE) : 0; + if (m_posDecor.y > limit) m_posDecor.y = limit; m_posCelHili.x = -1; } - if (m_keyPress & KEY_UP) { + if (m_keyPress & KEY_UP) + { m_posDecor.y -= 50; - if (m_posDecor.y < 0) { - m_posDecor.y = 0; - } + if (m_posDecor.y < 0) m_posDecor.y = 0; m_posCelHili.x = -1; } } @@ -499,7 +502,7 @@ void CDecor::Build(RECT rect) if (m_phase == WM_PHASE_BUILD) { - // ... + // draw blupi start positions... } if (m_bMulti && m_phase != WM_PHASE_BUILD) @@ -568,24 +571,24 @@ void CDecor::Build(RECT rect) m_pPixmap->QuickIcon(GetBlupiChannelStandard(), m_blupiIcon, tinyPoint); } - for (int num3 = MAXMOVEOBJECT - 1; num3 >= 0; num3--) + for (int i = 0; i < MAXMOVEOBJECT; i++) { - if (m_moveObject[num3].type != 0 && m_moveObject[num3].posCurrent.x >= posDecor.x - 64 && m_moveObject[num3].posCurrent.y >= posDecor.y - 64 && m_moveObject[num3].posCurrent.x <= posDecor.x + LXIMAGE && m_moveObject[num3].posCurrent.y <= posDecor.y + LYIMAGE && (m_moveObject[num3].type < 8 || m_moveObject[num3].type > 11) && (m_moveObject[num3].type < 90 || m_moveObject[num3].type > 95) && (m_moveObject[num3].type < 98 || m_moveObject[num3].type > 100) && m_moveObject[num3].type != 53 && m_moveObject[num3].type != 1 && m_moveObject[num3].type != 47 && m_moveObject[num3].type != 48) + 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) { - tinyPoint.x = m_moveObject[num3].posCurrent.x - posDecor.x; - tinyPoint.y = m_moveObject[num3].posCurrent.y - posDecor.y; - if (m_moveObject[num3].type == TYPE_BULLDOZER || m_moveObject[num3].type == TYPE_BLUPIHELICO || m_moveObject[num3].type == TYPE_BLUPITANK) + tinyPoint.x = m_moveObject[i].posCurrent.x - posDecor.x; + tinyPoint.y = m_moveObject[i].posCurrent.y - posDecor.y; + if (m_moveObject[i].type == TYPE_BULLDOZER || m_moveObject[i].type == TYPE_BLUPIHELICO || m_moveObject[i].type == TYPE_BLUPITANK) { tinyPoint.x += 2; tinyPoint.y += BLUPIOFFY; } - if (m_moveObject[num3].type == 54) + if (m_moveObject[i].type == 54) { tinyPoint.y += BLUPIOFFY; } // get the winphone opacity stuff out of here - m_pPixmap->QuickIcon(m_moveObject[num3].channel, m_moveObject[num3].icon, tinyPoint); - if (m_moveObject[num3].type == 30) + 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++) { @@ -596,7 +599,7 @@ void CDecor::Build(RECT rect) m_pPixmap->QuickIcon(10, rank, pos2); } } - if (m_bDrawSecret && m_moveObject[num3].type == 12 && m_moveObject[num3].icon != 32 && m_moveObject[num3].icon != 33 && m_moveObject[num3].icon != 34) + if (m_bDrawSecret && m_moveObject[i].type == 12 && m_moveObject[i].icon != 32 && m_moveObject[i].icon != 33 && m_moveObject[i].icon != 34) { m_pPixmap->QuickIcon(1, 214, tinyPoint); } @@ -827,10 +830,12 @@ void CDecor::DrawInfo() if (m_phase == WM_PHASE_PLAY || m_phase == WM_PHASE_PLAYTEST) { - for (int i = 4; i != 0; i--) { - if (m_notifText[i] != '\0') { - DrawText(m_pPixmap, { 10, 10 }, m_notifText[i], 0); + pos = { 10, 10 }; + for (int i = 0; i < MAXNOTIF; i++) { + if (m_notifText[i][0] != '\0') { + DrawText(m_pPixmap, pos, m_notifText[i], FONTWHITE); } + pos.y += DIMTEXTY; } if (m_nbVies > 0) { @@ -1556,12 +1561,49 @@ BOOL CDecor::DrawMap(BOOL bPlay, int team) return FALSE; } -BOOL CDecor::SearchWorld(int world, POINT *blupi, int *dir) +BOOL CDecor::SearchWorld(int world, POINT *cel, POINT *newBlupiPos) { + for (int x = 0; x < MAXCELX; x++) + { + for (int y = 0; y < MAXCELY; y++) + { + int icon = m_decor[x][y].icon; + if (icon >= Object::Level_1 && icon <= Object::Level_8) + { + if (world == icon - Object::Level_1 + 1) + { + if (x > 1 && m_decor[x + 1][y].icon == Object::DoorLevel) + { + *cel = { x - 1, y }; + *newBlupiPos = { (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 }; + 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 }; + 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 }; + return TRUE; + } + } + } + } + } return FALSE; } -BOOL CDecor::SearchDoor(int n, POINT *cel, POINT *blupi) +BOOL CDecor::SearchDoor(int n, POINT *cel) { for (int i = 0; i < 100; i++) { @@ -1574,32 +1616,24 @@ BOOL CDecor::SearchDoor(int n, POINT *cel, POINT *blupi) { cel->x = i - 1; cel->y = j; - blupi->x = (i - 2) * 64 + 2; - blupi->y = j * 64 + BLUPIOFFY; return TRUE; } if (i > 1 && m_decor[i - 2, j]->icon == 182) { cel->x = i - 2; cel->y = j; - blupi->x = (i - 3) * 64 + 2; - blupi->y = j * 64 + BLUPIOFFY; return TRUE; } if (i < 99 && m_decor[i + 1, j]->icon == 182) { cel->x = i + 1; cel->y = j; - blupi->x = (i + 2) * 64 + 2; - blupi->y = j * 64 + BLUPIOFFY; return TRUE; } if (i < 98 && m_decor[i + 2, j]->icon == 182) { cel->x = i + 2; cel->y = j; - blupi->x = (i + 3) * 64 + 2; - blupi->y = j * 64 + BLUPIOFFY; return TRUE; } } @@ -1610,7 +1644,84 @@ BOOL CDecor::SearchDoor(int n, POINT *cel, POINT *blupi) void CDecor::AdaptDoors(BOOL bPrivate, int mission) { + POINT cel; + int index; + int icon; + POINT newPosBlupi; + m_bPrivate = bPrivate; + m_mission = mission; + if (bPrivate == FALSE) + { + if (mission == 1) + { + for (int i = 0; i < 20; ++i) + { + if (SearchDoor(i, &cel)) + { + if (!m_doors[180 + i] || m_bCheatDoors) + { + m_decor[cel.x][cel.y].icon = -1; + index = MoveObjectFree(); + m_moveObject[index].type = TYPE_DOOR; + m_moveObject[index].stepAdvance = 50; + m_moveObject[index].stepRecede = 1; + m_moveObject[index].timeStopStart = 0; + m_moveObject[index].timeStopEnd = 0; + m_moveObject[index].posStart.x = cel.x * DIMOBJX; + m_moveObject[index].posStart.y = cel.y * DIMOBJY; + m_moveObject[index].posEnd.x = cel.x * DIMOBJX; + m_moveObject[index].posEnd.y = cel.y * DIMOBJY - DIMOBJY; + m_moveObject[index].posCurrent.x = m_moveObject[index].posStart.x; + m_moveObject[index].posCurrent.y = m_moveObject[index].posStart.y; + m_moveObject[index].step = STEP_STOPSTART; + m_moveObject[index].time = 0; + m_moveObject[index].phase = 0; + m_moveObject[index].channel = CHOBJECT; + m_moveObject[index].icon = 0xb7; + PlaySound(SOUND_DOOR, m_moveObject[index].posStart, FALSE); + } + } + } + for (int x = 0; x < MAXCELX; x++) + { + for (int y = 0; y < MAXCELY; y++) + { + int icon = m_decor[x][y].icon; + if (icon >= Object::World_1 && icon <= Object::World_8 && (!m_doors[icon - Object::World_1 + 1] || m_bCheatDoors)) + { + m_decor[x][y].icon += 8; + } + if (icon == Object::World_9 && (!m_doors[189] || m_bCheatDoors)) + { + m_decor[x][y].icon = Object::WorldDone_9; + } + if (icon >= Object::World_10 && icon <= Object::World_14 && (!m_doors[icon - Object::World_10 + 1] || m_bCheatDoors)) + { + m_decor[x][y].icon += 5; + } + } + } + } + else if (mission % 10 == 0) + { + for (int i = 0; i < 10; ++i) + { + if (SearchWorld(i, &cel, &newPosBlupi)) + { + if (!m_doors[mission + i] || m_bCheatDoors) + { + OpenDoor(cel); + for (int j = 0; j < MAXNETPLAYER; j++) + { + m_blupiStartPos[i] = newPosBlupi; + m_blupiStartDir[i] = (m_blupiStartPos[i].x < cel.x * DIMOBJX) ? DIR_RIGHT : DIR_LEFT; + } + } + } + } + } + } } void CDecor::OpenDoorsTresor() diff --git a/src/decor.h b/src/decor.h index 4a2ce1e..9e6fb43 100644 --- a/src/decor.h +++ b/src/decor.h @@ -9,11 +9,6 @@ ///////////////////////////////////////////////////////////////////////////// -#define MAXNETMESSAGE 20 -#define MAXMOVEOBJECT 200 -#define MAXNOTIF 4 -#define MAXNETPLAYER 4 - #define MAXQUART 441 #define SCROLL_SPEED 8 #define SCROLL_MARGX 80 @@ -147,7 +142,7 @@ typedef struct int blupiTimeOuf; int blupiActionOuf; int blupiFifoNb; - POINT blupiFifoPos[10]; + POINT blupiFifoPos[MAXFIFOPOS]; BOOL blupiInvert; BOOL blupiBalloon; BOOL blupiOver; @@ -407,8 +402,8 @@ public: BOOL CurrentRead(int gamer, int mission, BOOL *pbMission, BOOL *pbPrivate); BOOL CurrentWrite(int gamer, int mission, char* param3); - BOOL SearchWorld(int world, POINT *blupi, int *dir); - BOOL SearchDoor(int n, POINT *cel, POINT *blupi); + BOOL SearchWorld(int world, POINT *cel, POINT *newBlupiPos); + BOOL SearchDoor(int n, POINT *cel); void AdaptDoors(BOOL bPrivate, int mission); void OpenDoorsTresor(); void OpenDoor(POINT cel); @@ -419,7 +414,7 @@ public: BOOL DeleteMission(int user, int mission, BOOL bUser); inline BOOL IsValidCel(POINT cel); - inline void MoveObjectCopy(MoveObject src, MoveObject dest); + inline void MoveObjectCopy(MoveObject *src, MoveObject *dest); inline void StopVehicleSound(); inline BOOL IsDeadAction(int action); inline void StopBlupi(BOOL bFocus = FALSE); @@ -528,7 +523,7 @@ protected: int m_netMessageIndex1; int m_netMessageIndex2; int m_netMessageIndex3; - char m_notifText[4][100]; + char m_notifText[MAXNOTIF][100]; int m_notifTime; CJauge m_jauges[2]; int m_blupiLevel; @@ -580,9 +575,9 @@ inline BOOL CDecor::IsValidCel(POINT cel) return cel.x >= 0 && cel.x < MAXCELX && cel.y >= 0 && cel.y < MAXCELY; } -inline void CDecor::MoveObjectCopy(MoveObject src, MoveObject dest) +inline void CDecor::MoveObjectCopy(MoveObject *src, MoveObject *dest) { - memcpy(&dest, &src, sizeof(dest)); + memcpy(dest, src, sizeof(dest)); } inline void CDecor::StopVehicleSound() @@ -607,7 +602,7 @@ inline void CDecor::StopBlupi(BOOL bSetFocus) inline BOOL CDecor::IsBlupiVehicle() { - return m_blupiHelico || m_blupiOver || m_blupiJeep || m_blupiTank || m_blupiSkate; + return IsBlupiMotorVehicle() || m_blupiSkate; } inline BOOL CDecor::IsBlupiMotorVehicle() diff --git a/src/dectables.h b/src/dectables.h index e1d8368..3a6d3db 100644 --- a/src/dectables.h +++ b/src/dectables.h @@ -23,13 +23,12 @@ 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[]{ 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[]{ 58, 58, 57, 57, 58, 58, 59, 59 }; 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 @@ -37,19 +36,17 @@ extern int table_bulldozer_turn2l[] 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[]{ 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[]{ 79, 79, 78, 78, 79, 79, 80, 80 }; 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, @@ -59,7 +56,6 @@ extern int table_poisson_turn2l[] 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, @@ -67,29 +63,28 @@ extern int table_poisson_turn2r[] 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[]{ 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[]{ 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[]{ 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[]{ 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[]{ 195, 196, 197, 198, 197, 196 }; -extern int table_guepe_right[]{ 6, 199, 200, 201, 202, 201, 200 }; +extern int table_guepe_right[]{ 199, 200, 201, 202, 201, 200 }; 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[]{ 203, 204, 205, 206, 207 }; -extern int table_creature_left[]{ 8, 247, 248, 249, 250, 251, 250, 249, 248 }; +extern int table_creature_left[]{ 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[]{ 247, 248, 249, 250, 251, 250, 249, 248 }; 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, @@ -108,13 +103,12 @@ extern int table_creature_turn2[] 244, 244 }; -extern int table_blupih_left[]{ 8, 66, 67, 68, 67, 66, 69, 70, 69 }; +extern int table_blupih_left[]{ 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[]{ 61, 62, 63, 62, 61, 64, 65, 64 }; 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 @@ -122,19 +116,17 @@ extern int table_blupih_turn2l[] 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[]{ 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[]{ 238, 238, 237, 237, 238, 238, 239, 239 }; 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 @@ -142,7 +134,6 @@ extern int table_blupit_turn2l[] 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 @@ -150,7 +141,6 @@ extern int table_blupit_turn2r[] 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, @@ -159,32 +149,28 @@ extern int table_explo1[] 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, 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[]{ 12, 13, 14, 15, 7, 8, 9, 10, 11 }; 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[]{ 54, 55, 56, 57, 58, 59 }; 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, @@ -200,27 +186,24 @@ extern int table_explo7[] -1, 61, -1, -1, -1, 60, -1, -1 }; -extern int table_explo8[]{ 5, 7, 8, 9, 10, 11 }; +extern int table_explo8[]{ 7, 8, 9, 10, 11 }; -extern int table_sploutch1[]{ 10, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99 }; +extern int table_sploutch1[]{ 90, 91, 92, 93, 94, 95, 96, 97, 98, 99 }; extern int table_sploutch2[] { - 13, -1, -1, -1, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99 }; 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, 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, @@ -230,7 +213,6 @@ extern int table_tentacule[] 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, @@ -249,57 +231,51 @@ extern int table_bridge[] 367, 367, 366, 366, 365, 365, 364 }; -extern int table_pollution[]{ 8, 179, 180, 181, 182, 183, 184, 185, 186 }; +extern int table_pollution[]{ 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[]{ 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[]{ 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[]{ 187, 188, 189, 190, 191, 192, 193, 194 }; -extern int table_plouf[]{ 7, 99, 100, 101, 102, 101, 100, 99 }; +extern int table_plouf[]{ 99, 100, 101, 102, 101, 100, 99 }; -extern int table_tiplouf[]{ 3, 244, 99, 244 }; +extern int table_tiplouf[]{ 244, 99, 244 }; 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, 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[]{ 256, 258, 260, 262, 264 }; extern int table_cle[] { - 12, 122, 123, 124, 125, 126, 127, 128, 127, 126, 125, 124, 123 }; extern int table_cle1[] { - 12, 209, 210, 211, 212, 213, 214, 215, 214, 213, 212, 211, 210 }; extern int table_cle2[] { - 12, 220, 221, 222, 221, 220, 219, 218, 217, 216, 217, 218, 219 }; extern int table_cle3[] { - 12, 229, 228, 227, 226, 225, 224, 223, 224, 225, 226, 227, 228 }; @@ -341,7 +317,6 @@ extern int table_decor_action[] 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, @@ -356,7 +331,6 @@ extern int table_dynamitef[] 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, @@ -365,7 +339,6 @@ extern int table_skate[] 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 @@ -373,7 +346,6 @@ extern int table_glu[] 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, @@ -385,7 +357,6 @@ extern int table_clear[] 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, @@ -397,9 +368,9 @@ extern int table_electro[] 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[]{ 311, 312, 313, 314, 315, 316 }; -extern int table_chenillei[]{ 6, 316, 315, 314, 313, 312, 311 }; +extern int table_chenillei[]{ 316, 315, 314, 313, 312, 311 }; extern int table_adapt_decor[] { @@ -422,7 +393,6 @@ extern int table_adapt_decor[] 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, @@ -431,14 +401,12 @@ extern int table_adapt_fromage[] extern int table_shield[] { - 16, 144, 145, 146, 147, 148, 149, 150, 151, 266, 267, 268, 269, 270, 271, 272, 273 }; extern int table_shield_blupi[] { - 16, 144, 145, 146, 147, 148, 149, 150, 151, 266, 267, 268, 269, 270, 271, 272, 273 }; @@ -447,55 +415,49 @@ extern int table_power[]{ 8, 136, 137, 138, 139, 140, 141, 142, 143 }; extern int table_invert[] { - 20, 187, 187, 187, 188, 189, 190, 191, 192, 193, 194, 187, 187, 187, 194, 193, 192, 191, 190, 189, 188 }; -extern int table_charge[]{ 6, 238, 239, 240, 241, 242, 243 }; +extern int table_charge[]{ 238, 239, 240, 241, 242, 243 }; -extern int table_magicloop[]{ 5, 152, 153, 154, 155, 156 }; +extern int table_magicloop[]{ 152, 153, 154, 155, 156 }; extern int table_magictrack[] { - 24, 152, 153, 154, 155, 156, 152, 153, 154, 155, 156, 157, 158, 159, 160, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166 }; -extern int table_shieldloop[]{ 5, 274, 275, 276, 277, 278 }; +extern int table_shieldloop[]{ 274, 275, 276, 277, 278 }; extern int table_shieldtrack[] { - 20, 274, 275, 276, 277, 278, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288 }; -extern int table_drinkeffect[]{ 5, 274, 275, 276, 277, 278 }; +extern int table_drinkeffect[]{ 274, 275, 276, 277, 278 }; -extern int table_drinkoffset[]{ 3, 0, 7, 22 }; +extern int table_drinkoffset[]{ 0, 7, 22 }; extern int table_tresortrack[] { - 11, 166, 165, 164, 163, 162, 161, 162, 163, 164, 165, 166 }; extern int table_decor_piege1[] { - 16, 374, 374, 373, 347, 373, 374, 374, 374, 373, 347, 347, 373, 374, 374, 374, 374 }; -extern int table_decor_piege2[]{ 4, 374, 373, 347, 373 }; +extern int table_decor_piege2[]{ 374, 373, 347, 373 }; extern int table_decor_goutte[] { - 48, 410, 409, 410, -1, -1, -1, -1, -1, -1, 410, 409, 408, 409, 410, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 410, 409, 408, 407, 406, 405, @@ -503,80 +465,86 @@ extern int table_decor_goutte[] -1, 410, 409, 410, -1, -1, -1, -1 }; -extern int table_decor_ecraseur[]{ 10, 317, 317, 318, 319, 320, 321, 322, 323, 323, 323 }; +extern int table_decor_ecraseur[]{ 317, 317, 318, 319, 320, 321, 322, 323, 323, 323 }; -extern int table_decor_scie[]{ 6, 378, 379, 380, 381, 382, 383 }; +extern int table_decor_scie[]{ 378, 379, 380, 381, 382, 383 }; extern int table_decor_temp[] { - 20, 328, 328, 327, 327, 326, 326, 325, 325, 324, 324, 325, 325, 326, 326, 327, 329, 328, 328, -1, -1 }; -extern int table_decor_eau1[]{ 6, 92, 93, 94, 95, 94, 93 }; +extern int table_decor_eau1[]{ 92, 93, 94, 95, 94, 93 }; -extern int table_decor_eau2[]{ 6, 91, 96, 97, 98, 97, 96 }; +extern int table_decor_eau2[]{ 91, 96, 97, 98, 97, 96 }; -extern int table_decor_ventillod[]{ 3, 129, 130, 131 }; +extern int table_decor_ventillod[]{ 129, 130, 131 }; -extern int table_decor_ventilloh[]{ 3, 132, 133, 134 }; +extern int table_decor_ventilloh[]{ 132, 133, 134 }; -extern int table_decor_ventillob[]{ 3, 135, 136, 137 }; +extern int table_decor_ventillob[]{ 135, 136, 137 }; -extern int table_decor_ventd[]{ 4, 114, 115, 116, 117 }; +extern int table_decor_ventd[]{ 114, 115, 116, 117 }; -extern int table_decor_venth[]{ 4, 118, 119, 120, 121 }; +extern int table_decor_venth[]{ 118, 119, 120, 121 }; -extern int table_decor_ventb[]{ 4, 122, 123, 124, 125 }; +extern int table_decor_ventb[]{ 122, 123, 124, 125 }; extern int table_marine[] { 0, 2, 5, 8, 3, 0 }; -extern int table_36418[]{ 14, 10, 2, 3, 4, 5, 6, 7, 8, 9, 1, 11, 12, 13, 14 }; -extern int table_36458[]{ 10, 19, 20, 21, 23, 24, 25, 26, 27, 28, 29 }; -extern int table_36488[]{ 4, 15, 16, 17, 18 }; -extern int table_364a0[]{ 2, 73, 22 }; -extern int table_364b0[]{ 7, 78, 79, 80, 81, 82, 83, 84 }; -extern int table_364d0[]{ 4, 87, 88, 89, 90 }; -extern int table_364e8[]{ 2, 85, 86 }; -extern int table_364f8[]{ 5, 396, 388, 389, 390, 391 }; -extern int table_36510[]{ 3, 398, 399, 400 }; -extern int table_36520[]{ 3, 87, 88, 89 }; -extern int table_36530[]{ 1, 0x99 }; -extern int table_36538[]{ 2, 0x9a, 0x9b }; -extern int table_36548[]{ 1, 0xb9 }; -extern int table_36550[]{ 7, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f }; -extern int table_36570[]{ 12, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xe6, 0xe7, 0xe9, 0xea }; -extern int table_365a8[]{ 8, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe8 }; -extern int table_365d0[]{ 1, 0x9d }; -extern int table_365d8[]{ 5, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f }; -extern int table_365f0[]{ 7, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0xc0 }; -extern int table_36610[]{ 5, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5 }; -extern int table_decor_lave[]{ 8, 68, 69, 70, 71, 72, 71, 70, 69 }; -extern int table_36630[]{ 2, 0x5b, 0x5c }; -extern int table_decor_ventillog[]{ 3, 126, 127, 128 }; -extern int table_decor_ventg[]{ 4, 110, 111, 112, 113 }; -extern int table_36670[]{ 11, 0x4c, 0x4d, 0xc7, 0xc6, 0xc8, 0xc9, 0xeb, 0xec, 0x177, 0x178, 0x179 }; -extern int table_366a0[]{ 3, 0x193, 0x191, 0x192 }; -extern int table_366b0[]{ 3, 20, 21, 22 }; -extern int table_366c0[]{ 4, 16, 17, 18, 19 }; -extern int table_366d8[]{ 3, 23, 24, 25 }; -extern int table_366e8[]{ 2, 0x1a, 0x1b }; -extern int table_366f8[]{ 4, 0x1c, 0x1d, 0x1e, 0x1f }; -extern int table_36710[]{ 12, 0x2d, 0x2e, 0x2f, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c}; -extern int table_36748[]{ 4, 0x42, 0x43, 0x44, 0x45 }; +extern int table_36418[]{ 10, 2, 3, 4, 5, 6, 7, 8, 9, 1, 11, 12, 13, 14 }; +extern int table_36458[]{ 19, 20, 21, 23, 24, 25, 26, 27, 28, 29 }; +extern int table_36488[]{ 15, 16, 17, 18 }; +extern int table_364a0[]{ 73, 22 }; +extern int table_364b0[]{ 78, 79, 80, 81, 82, 83, 84 }; +extern int table_364d0[]{ 87, 88, 89, 90 }; +extern int table_364e8[]{ 85, 86 }; +extern int table_364f8[]{ 396, 388, 389, 390, 391 }; +extern int table_36510[]{ 398, 399, 400 }; +extern int table_36520[]{ 87, 88, 89 }; +extern int table_36530[]{ 0x99 }; +extern int table_36538[]{ 0x9a, 0x9b }; +extern int table_36548[]{ 0xb9 }; +extern int table_36550[]{ 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f }; +extern int table_36570[]{ 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xe6, 0xe7, 0xe9, 0xea }; +extern int table_365a8[]{ 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe8 }; +extern int table_365d0[]{ 0x9d }; +extern int table_365d8[]{ 0x8b, 0x8c, 0x8d, 0x8e, 0x8f }; +extern int table_365f0[]{ 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0xc0 }; +extern int table_36610[]{ 0xc1, 0xc2, 0xc3, 0xc4, 0xc5 }; +extern int table_decor_lave[]{ 68, 69, 70, 71, 72, 71, 70, 69 }; +extern int table_36630[]{ 0x5b, 0x5c }; +extern int table_decor_ventillog[]{ 126, 127, 128 }; +extern int table_decor_ventg[]{ 110, 111, 112, 113 }; +extern int table_36670[]{ 0x4c, 0x4d, 0xc7, 0xc6, 0xc8, 0xc9, 0xeb, 0xec, 0x177, 0x178, 0x179 }; +extern int table_366a0[]{ 0x193, 0x191, 0x192 }; +extern int table_366b0[]{ 20, 21, 22 }; +extern int table_366c0[]{ 16, 17, 18, 19 }; +extern int table_366d8[]{ 23, 24, 25 }; +extern int table_366e8[]{ 0x1a, 0x1b }; +extern int table_366f8[]{ 0x1c, 0x1d, 0x1e, 0x1f }; +extern int table_36710[]{ 0x2d, 0x2e, 0x2f, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c}; +extern int table_36748[]{ 0x42, 0x43, 0x44, 0x45 }; +extern int table_blupi[]{ + 5, 0, 6, 0, 7, 0, 7, 0, 6, 0, 5, 0, 4, 0, 2, 0, 0, 0, -2, 0, -4, 0, -5, 0, -6, 0, -7, 0, -7, 0, -6, 0, -5, 0, -4, 0, -2, 0, 0, 0, 2, 0, 4, 0, 5, 0, 6, 0, 7, 0, 7, 0, 6, 0, 5, 0, 4, 0, 2, 0, 0, 0, -2, 0, -4, 0, -5, 0, -6, 0, -7, 0, -7, 0, -6, 0, -5, 0, -4, 0, -2, 0, 0, 0, 2, 0, 4, 0, 5, 0, 6, 0, 7, 0, 7, 0, 6, 0, 5, 0, 4, 0, 2, 0, 0, 0, -2, 0, -4, 0, -5, 0, -6, 0, -7, 0, -7, 0, -6, 0, -5, 0, -4, 0, -2, 0, 0, 0, 2, 0, 4, 0, 5, 0, 6, 0, 7, 0, 7, 0, 6, 0, 5, 0, 4, 0, 2, 0, 0, 0, -2, 0, -4, 0, -5, 0, -6, 0, -7, 0, -7, 0, -6, 0, -5, 0, -4, 0, -2, 0, -1, 0, 0, 0, 14, 10, 2, 3, 4, 5, 6, 7, 8, 9, 1, 11, 12, 13, 14, 0, 10, 19, 20, 21, 23, 24, 25, 26, 27, 28, 29, 0, 4, 15, 16, 17, 18, 0, 2, 73, 22, 0, 7, 78, 79, 80, 81, 82, 83, 84, 4, 87, 88, 89, 90, 0, 2, 85, 86, 0, 5, 396, 388, 389, 390, 391, 3, 398, 399, 400, 3, 87, 88, 89, 1, 153, 2, 154, 155, 0, 1, 185, 7, 41, 42, 43, 44, 45, 46, 47, 12, 215, 216, 217, 218, 219, 220, 221, 222, 230, 231, 233, 234, 0, 8, 223, 224, 225, 226, 227, 228, 229, 232, 0, 1, 157, 5, 139, 140, 141, 142, 143, 7, 186, 187, 188, 189, 190, 191, 192, 5, 193, 194, 195, 196, 197, 1, 68, 2, 91, 92, 0, 4, 126, 129, 132, 135, 0, 4, 110, 114, 118, 122, 0, 11, 76, 77, 199, 198, 200, 201, 235, 236, 375, 376, 377, 3, 403, 401, 402, 3, 20, 21, 22, 4, 16, 17, 18, 19, 0, 3, 23, 24, 25, 2, 26, 27, 0, 4, 28, 29, 30, 31, 0, 12, 45, 46, 47, 36, 37, 38, 39, 40, 41, 42, 43, 44, 0, 4, 66, 67, 68, 69, 0, 23, 158, 159, 160, 161, 162, 163, 164, 165, 309, 411, 412, 413, 414, 415, 174, 175, 176, 177, 178, 179, 180, 181, 184, 2, 182, 183, 0, 3, 334, 335, 336, 20, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 0, 2, 378, 384, 0, 15, 29, 10, 2, 3, 4, 5, 6, 7, 8, 9, 1, 11, 12, 13, 14, 6, 19, 20, 21, 23, 24, 28, 0, 4, 15, 16, 17, 18, 0, 7, 78, 79, 80, 81, 82, 83, 84, 4, 87, 88, 89, 90, 0, 3, 153, 74, 75, 7, 41, 42, 43, 44, 45, 46, 47, 8, 215, 216, 217, 218, 219, 220, 230, 231, 0, 5, 226, 227, 228, 229, 232, 4, 157, 109, 108, 107, 0, 1, 338, 4, 261, 262, 263, 283, 0, 3, 251, 252, 253, 2, 387, 397, 0, 1, 340, 1, 361, 5, 139, 140, 141, 142, 143, 7, 186, 187, 188, 189, 190, 191, 192, 3, 32, 33, 34, 10, 2, 4, 79, 84, 143, 219, 230, 246, 341, 396, 0, 4, 330, 331, 332, 333, 0, 35, 18, 0, 276, 276, 277, 277, 278, 278, 279, 279, 280, 280, 281, 281, 282, 282, 283, 283, 284, 284, 1, 330, 0, 0, 0, 0, 0, 0, 23, 23, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 23, 23, 23, 23, 23, 0, 0, 0, 0, 0, 0, 0, 0, 23, 23, 23, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 23, 23, 23, 23, 0, 0, 0, 23, 23, 23, 0, 0, 0, 0, 0, 0, 133, 133, 0, 0, 0, 133, 133, 0, 0, 0, 0, 0, 0, 0, 133, 133, 0, 0, 0, 0, 23, 23, 23, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 23, 0, 0, 0, 0, 0, 23, 23, 23, 0, 0, 0, 135, 135, 136, 136, 137, 137, 137, 137, 137, 137, 137, 137, 138, 138, 137, 137, 137, 138, 138, 137, 137, 137, 138, 138, 137, 137, 137, 138, 138, 137, 137, 137, 137, 137, 137, 136, 136, 135, 135, 135, 0, 0, 0, 0, 0, 23, 23, 23, 0, 0, 133, 133, 0, 0, 0, 23, 23, 23, 23, 0, 0, 0, 0, 0, 0, 0, 23, 23, 0, 0, 0, 0, 0, 0, 0, 0, 133, 133, 0, 0, 0, 0, 0, 23, 23, 23, 23, 0, 0, 0, 135, 135, 136, 136, 137, 137, 137, 137, 137, 137, 137, 137, 138, 138, 137, 137, 137, 138, 138, 137, 137, 137, 138, 138, 137, 137, 137, 138, 138, 137, 137, 137, 138, 138, 137, 137, 137, 138, 138, 137, 137, 137, 138, 138, 137, 137, 137, 138, 138, 137, 137, 137, 138, 138, 137, 137, 137, 138, 138, 137, 137, 137, 138, 138, 137, 137, 137, 138, 138, 137, 137, 137, 137, 137, 137, 136, 136, 135, 135, 135, 0, 0, 0, 0, 0, 23, 23, 23, 0, 0, 133, 133, 0, 0, 0, 23, 23, 23, 23, 0, 0, 0, 0, 0, 0, 0, 23, 23, 0, 0, 0, 0, 0, 0, 0, 0, 133, 133, 0, 0, 0, 0, 0, 23, 23, 23, 23, 0, 0, 0, 2, 6, 0, 5, 6, 7, 8, 9, 10, 60, 3, 0, 19, 18, 19, 3, 6, 0, 1, 1, 2, 2, 3, 3, 4, 3, 0, 17, 18, 19, 5, 5, 4, 169, 26, 170, 170, 27, 59, 6, 0, 3, 3, 2, 2, 1, 1, 61, 5, 0, 34, 35, 34, 34, 33, 62, 2, 0, 35, 34, 6, 3, 2, 33, 34, 35, 7, 1, 0, 44, 8, 8, 0, 0, 169, 26, 170, 27, 171, 28, 172, 9, 6, 0, 5, 6, 7, 8, 9, 10, 10, 6, 0, 5, 6, 7, 8, 9, 10, 13, 6, 0, 41, 41, 42, 42, 43, 43, 11, 70, 0, 40, 40, 40, 40, 41, 41, 41, 41, 40, 40, 40, 40, 40, 40, 40, 41, 41, 41, 40, 40, 40, 40, 40, 40, 40, 41, 41, 41, 40, 40, 42, 42, 42, 43, 43, 43, 44, 44, 44, 45, 45, 45, 46, 46, 47, 47, 46, 46, 47, 47, 46, 46, 47, 47, 46, 46, 47, 47, 46, 46, 47, 47, 46, 46, 47, 47, 46, 46, 47, 47, 75, 1, 0, -1, 76, 70, 0, 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, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 77, 110, 0, 324, 325, 324, 325, 324, 325, 324, 325, 324, 325, 324, 325, 324, 325, 324, 325, 324, 325, 324, 325, 324, 324, 325, 325, 326, 326, 327, 327, 328, 328, 329, 329, 330, 330, 331, 331, 332, 332, 333, 333, 334, 334, 333, 333, 332, 332, 331, 331, 330, 330, 329, 329, 329, 330, 330, 330, 331, 331, 331, 332, 332, 332, 333, 333, 333, 334, 334, 334, 333, 333, 333, 332, 332, 332, 331, 331, 331, 330, 330, 330, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 78, 1, 0, -1, 79, 1, 0, -1, 80, 1, 0, -1, 81, 1, 0, -1, 14, 6, 0, 49, 50, 51, 52, 53, 54, 29, 6, 0, 126, 125, 124, 123, 122, 121, 28, 6, 0, 122, 122, 122, 125, 125, 125, 15, 1, 0, 61, 16, 8, 0, 61, 62, 63, 62, 61, 64, 65, 64, 17, 10, 0, 71, 71, 72, 72, 73, 73, 74, 74, 75, 75, 67, 1, 0, 315, 68, 12, 0, 296, 297, 298, 299, 300, 301, 302, 301, 300, 299, 298, 297, 69, 7, 0, 296, 310, 311, 312, 313, 314, 303, 18, 10, 0, 76, 76, 76, 76, 76, 76, 77, 77, 77, 77, 19, 14, 0, 76, 76, 77, 77, 78, 78, 79, 79, 80, 80, 81, 81, 39, 39, 20, 10, 0, 88, 88, 89, 89, 90, 90, 91, 91, 92, 92, 21, 12, 0, 93, 93, 94, 94, 95, 95, 96, 96, 97, 97, 98, 98, 22, 12, 0, 93, 93, 94, 94, 95, 95, 96, 96, 97, 97, 98, 98, 23, 10, 0, 105, 105, 106, 106, 107, 107, 108, 108, 109, 109, 24, 90, 0, 93, 96, 98, 94, 95, 93, 95, 98, 93, 94, 96, 96, 94, 94, 98, 98, 93, 93, 97, 97, 94, 94, 94, 96, 96, 96, 93, 93, 93, 93, 94, 94, 94, 94, 94, 97, 97, 97, 97, 97, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 79, 79, 76, 76, 76, 76, 79, 79, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 25, 8, 0, 111, 111, 110, 110, 111, 111, 112, 112, 26, 8, 0, 111, 111, 110, 110, 111, 111, 112, 112, 27, 7, 0, 112, 113, 114, 115, 116, 117, 118, 30, 12, 0, 25, 25, 29, 29, 46, 46, 47, 47, 46, 46, 29, 29, 31, 328, 0, 156, 156, 156, 156, 157, 157, 157, 157, 158, 158, 158, 158, 157, 157, 157, 157, 156, 156, 156, 156, 157, 157, 157, 157, 158, 158, 158, 158, 157, 157, 157, 157, 156, 156, 156, 156, 157, 157, 157, 157, 158, 158, 158, 158, 157, 157, 157, 157, 156, 156, 156, 156, 157, 157, 157, 157, 158, 158, 158, 158, 157, 157, 157, 157, 156, 156, 156, 156, 157, 157, 157, 157, 158, 158, 158, 158, 157, 157, 157, 157, 156, 156, 156, 156, 157, 157, 157, 157, 158, 158, 158, 158, 157, 157, 157, 157, 156, 156, 156, 156, 157, 157, 157, 157, 158, 158, 158, 158, 157, 157, 157, 157, 144, 144, 143, 143, 151, 151, 162, 162, 163, 163, 164, 164, 163, 163, 162, 162, 163, 163, 164, 164, 163, 163, 162, 162, 163, 163, 164, 164, 163, 163, 162, 162, 163, 163, 164, 164, 163, 163, 162, 162, 151, 151, 143, 143, 144, 144, 157, 157, 156, 156, 156, 156, 157, 157, 157, 157, 158, 158, 158, 158, 157, 157, 157, 157, 156, 156, 156, 156, 157, 157, 157, 157, 158, 158, 158, 158, 157, 157, 157, 157, 156, 156, 156, 156, 157, 157, 157, 157, 158, 158, 158, 158, 157, 157, 157, 157, 156, 156, 156, 156, 157, 157, 157, 157, 158, 158, 158, 158, 157, 157, 157, 157, 144, 144, 143, 143, 151, 151, 162, 162, 163, 163, 164, 164, 163, 163, 162, 162, 163, 163, 164, 164, 163, 163, 162, 162, 163, 163, 164, 164, 163, 163, 162, 162, 163, 163, 164, 164, 163, 163, 162, 162, 151, 151, 143, 143, 151, 151, 162, 162, 163, 163, 164, 164, 163, 163, 162, 162, 163, 163, 164, 164, 163, 163, 162, 162, 163, 163, 164, 164, 163, 163, 162, 162, 163, 163, 164, 164, 163, 163, 162, 162, 163, 163, 164, 164, 163, 163, 162, 162, 163, 163, 164, 164, 163, 163, 162, 162, 151, 151, 143, 143, 144, 144, 157, 157, 32, 12, 0, 144, 144, 145, 145, 146, 146, 145, 145, 144, 144, 143, 143, 33, 10, 0, 151, 151, 152, 152, 153, 153, 154, 154, 155, 155, 34, 10, 0, 157, 157, 165, 165, 165, 165, 166, 166, 166, 166, 36, 32, 0, 135, 177, 177, 178, 178, 179, 179, 180, 180, 179, 179, 178, 178, 179, 179, 180, 180, 179, 179, 178, 178, 179, 179, 180, 180, 179, 179, 178, 178, 177, 177, 135, 37, 140, 0, 182, 182, 182, 182, 208, 208, 208, 208, 208, 182, 182, 182, 182, 182, 182, 208, 208, 208, 208, 208, 194, 194, 194, 182, 182, 182, 182, 208, 208, 208, 208, 208, 182, 182, 182, 182, 182, 182, 208, 208, 208, 208, 182, 182, 182, 182, 182, 182, 182, 182, 194, 195, 196, 197, 198, 198, 197, 197, 196, 196, 197, 197, 198, 198, 197, 197, 196, 195, 194, 182, 182, 182, 208, 208, 208, 208, 208, 208, 182, 182, 182, 182, 182, 208, 208, 208, 208, 208, 182, 182, 194, 195, 196, 197, 198, 198, 197, 197, 196, 196, 197, 197, 198, 198, 197, 197, 196, 196, 197, 197, 198, 198, 197, 197, 196, 195, 194, 182, 182, 182, 182, 182, 182, 182, 208, 208, 208, 208, 208, 208, 210, 210, 211, 211, 211, 211, 211, 211, 210, 210, 38, 96, 0, 182, 183, 184, 185, 186, 187, 182, 183, 184, 185, 186, 187, 182, 183, 184, 185, 186, 187, 182, 182, 182, 182, 182, 182, 182, 183, 184, 185, 186, 187, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 183, 184, 185, 186, 187, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 183, 184, 185, 186, 187, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 39, 7, 0, 194, 195, 196, 197, 198, 199, 200, 40, 3, 0, 210, 211, 212, 41, 8, 0, 213, 213, 214, 214, 215, 215, 214, 214, 42, 20, 0, 17, 17, 18, 18, 19, 19, 1, 1, 215, 215, 214, 214, 213, 213, 212, 212, 211, 211, 210, 210, 43, 20, 0, 210, 210, 211, 211, 212, 212, 213, 213, 214, 214, 215, 215, 1, 1, 19, 19, 18, 18, 17, 17, 44, 29, 0, 1, 1, 222, 222, 222, 222, 223, 223, 224, 224, 225, 225, 225, 225, 225, 224, 223, 222, 222, 222, 223, 223, 224, 224, 225, 225, 225, 1, 1, 45, 29, 0, 1, 1, 222, 222, 222, 222, 223, 223, 224, 224, 225, 225, 225, 225, 225, 224, 223, 222, 222, 222, 223, 223, 224, 224, 225, 225, 225, 1, 1, 46, 32, 0, 1, 1, 227, 227, 228, 228, 229, 229, 228, 228, 227, 227, 226, 226, 227, 227, 228, 228, 229, 229, 228, 228, 227, 227, 226, 226, 227, 227, 228, 228, 1, 1, 47, 34, 0, 135, 135, 136, 136, 137, 137, 231, 231, 231, 231, 230, 230, 231, 231, 231, 231, 230, 230, 231, 231, 231, 231, 230, 230, 231, 231, 231, 231, 137, 137, 136, 136, 135, 135, 48, 40, 0, 0, 0, 135, 135, 136, 136, 137, 137, 232, 233, 232, 233, 232, 233, 232, 233, 232, 233, 232, 233, 232, 233, 232, 233, 232, 233, 232, 233, 232, 233, 232, 233, 137, 137, 136, 136, 135, 135, 0, 0, 65, 44, 0, 1, 1, 288, 288, 289, 289, 290, 290, 290, 289, 288, 288, 289, 289, 290, 290, 290, 289, 288, 288, 289, 289, 290, 290, 290, 289, 288, 288, 289, 289, 290, 290, 290, 289, 288, 288, 289, 289, 290, 290, 290, 289, 1, 1, 49, 36, 0, 1, 1, 234, 234, 235, 235, 236, 236, 235, 235, 234, 234, 235, 235, 236, 236, 235, 235, 234, 234, 235, 235, 236, 236, 235, 235, 234, 234, 235, 235, 236, 236, 235, 235, 1, 1, 50, 64, 0, 238, 238, 239, 239, 240, 240, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 240, 240, 241, 241, 240, 240, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 240, 240, 241, 241, 240, 240, 241, 241, 241, 241, 241, 241, 241, 241, 240, 240, 239, 239, 238, 238, 238, 238, 238, 238, 237, 237, 238, 238, 237, 237, 51, 8, 0, 238, 238, 237, 237, 238, 238, 239, 239, 52, 12, 0, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 53, 6, 0, 251, 251, 238, 238, 238, 238, 54, 25, 0, 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, 55, 4, 0, 253, 253, 254, 254, 56, 64, 0, 1, 3, 270, 268, 1, 3, 270, 268, 1, 3, 270, 268, 1, 3, 270, 268, 1, 3, 270, 268, 1, 3, 270, 268, 1, 3, 270, 268, 1, 3, 270, 268, 1, 2, 3, 4, 270, 269, 268, 0, 1, 2, 3, 4, 270, 269, 268, 0, 1, 1, 2, 2, 3, 3, 4, 4, 270, 270 +}; -extern int table_ressort[] // i dont really care to look this up right now so heres some bs +extern int table_mirror[]{ + 4, 3, 2, 1, 0, 11, 12, 13, 14, 15, 16, 5, 6, 7, 8, 9, 10, 20, 21, 22, 17, 18, 19, 24, 23, 25, 30, 31, 32, 29, 26, 27, 28, 36, 37, 38, 33, 34, 35, 40, 39, 41, 42, 43, 45, 44, 46, 47, 48, 55, 56, 57, 58, 59, 60, 49, 50, 51, 52, 53, 54, 66, 67, 68, 69, 70, 61, 62, 63, 64, 65, 75, 74, 73, 72, 71, 82, 83, 84, 85, 86, 87, 76, 77, 78, 79, 80, 81, 92, 91, 90, 89, 88, 99, 100, 101, 102, 103, 104, 93, 94, 95, 96, 97, 98, 109, 108, 107, 106, 105, 120, 119, 118, 117, 116, 115, 114, 113, 112, 111, 110, 127, 128, 129, 130, 131, 132, 121, 122, 123, 124, 125, 126, 134, 133, 139, 140, 141, 142, 135, 136, 137, 138, 147, 148, 149, 150, 143, 144, 145, 146, 155, 154, 153, 152, 151, 159, 160, 161, 156, 157, 158, 162, 163, 164, 167, 168, 165, 166, 173, 174, 175, 176, 169, 170, 171, 172, 181, 180, 179, 178, 177, 188, 189, 190, 191, 192, 193, 182, 183, 184, 185, 186, 187, 201, 202, 203, 204, 205, 206, 207, 194, 195, 196, 197, 198, 199, 200, 209, 208, 216, 217, 218, 219, 220, 221, 210, 211, 212, 213, 214, 215, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 250, 249, 248, 247, 246, 245, 244, 243, 242, 241, 240, 239, 238, 237, 252, 251, 255, 256, 253, 254, 257, 258, 259, 260, 261, 262, 285, 286, 287, 266, 267, 270, 269, 268, 271, 272, 273, 275, 274, 276, 277, 278, 279, 280, 281, 282, 283, 284, 263, 264, 265, 288, 289, 290, 291, 292, 293, 294, 295, 303, 304, 305, 306, 307, 308, 309, 296, 297, 298, 299, 300, 301, 302, 314, 313, 312, 311, 310, 316, 315, 323, 322, 321, 320, 319, 318, 317, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334 +}; + +extern int table_ressort[] { - 8,1,2,3,4,5,5,6,7,7 + 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd4, 0xd3, 0xd2 }; \ No newline at end of file diff --git a/src/def.h b/src/def.h index 6da8df9..5976bd9 100644 --- a/src/def.h +++ b/src/def.h @@ -22,6 +22,11 @@ #define _LEGACY FALSE // if TRUE, keep broken/quirky legacy code #define MAXGAMER 8 +#define MAXNETPLAYER 4 +#define MAXNETMESSAGE 20 +#define MAXMOVEOBJECT 200 +#define MAXNOTIF 5 +#define MAXFIFOPOS 10 #define LXIMAGE 640 // dimensions de la fenêtre de jeu #define LYIMAGE 480 @@ -71,7 +76,8 @@ enum { CHBLUPI1, CHBLUPI2, CHBLUPI3, - CHTEMP + CHTEMP, + CHMAX = CHTEMP }; enum { @@ -900,22 +906,22 @@ namespace Object { RockTriRight_2, RockSquare_17, GrassSquare_2, - Course_1, - Course_2, - Course_3, // 160 - Course_4, - Course_5, - Course_6, - Course_7, - Course_8, - CourseDone_1, - CourseDone_2, - CourseDone_3, - CourseDone_4, - CourseDone_5, - CourseDone_6, - CourseDone_7, - CourseDone_8, + World_1, + World_2, + World_3, // 160 + World_4, + World_5, + World_6, + World_7, + World_8, + WorldDone_1, + WorldDone_2, + WorldDone_3, + WorldDone_4, + WorldDone_5, + WorldDone_6, + WorldDone_7, + WorldDone_8, Level_1, Level_2, Level_3, // 176 @@ -926,7 +932,7 @@ namespace Object { Level_8, DoorLevel, DoorCourse, - CourseBack, + WorldBack, RockSecret, Facade_1, Facade_2, @@ -1051,8 +1057,8 @@ namespace Object { Lightning_2, Lightning_3, Lightning_4, - Course_9, - CourseDone_9, + World_9, + WorldDone_9, Conveyor_1, Conveyor_2, Conveyor_3, @@ -1153,16 +1159,16 @@ namespace Object { SlimeTrapCeiling_5, SlimeTrapCeiling_6, SlimeTrapCeiling_7, - Course_10, - Course_11, - Course_12, - Course_13, - Course_14, - CourseDone_10, // 414 - CourseDone_11, - CourseDone_12, - CourseDone_13, - CourseDone_14, + World_10, + World_11, + World_12, + World_13, + World_14, + WorldDone_10, // 414 + WorldDone_11, + WorldDone_12, + WorldDone_13, + WorldDone_14, DoorTreasure_1, DoorTreasure_2, DoorTreasure_3, diff --git a/src/event.cpp b/src/event.cpp index e3b421a..eee71f5 100644 --- a/src/event.cpp +++ b/src/event.cpp @@ -1767,7 +1767,6 @@ CEvent::CEvent() { int i; - m_somethingJoystick = 0; m_bFullScreen = TRUE; m_mouseType = MOUSETYPEGRA; @@ -2530,38 +2529,14 @@ 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 }); - */ + char str[50]; + sprintf(str, "m_rankCheat %d (%s)", m_rankCheat, m_rankCheat != -1 ? cheat_code[m_rankCheat] : "..."); + DrawTextLeft(m_pPixmap, { 200, 0 }, str, FONTWHITE); + sprintf(str, "m_posCheat %d", m_posCheat); + DrawTextLeft(m_pPixmap, { 200, 20 }, str, FONTWHITE); + /////////////// 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); @@ -3075,7 +3050,7 @@ BOOL CEvent::TreatEventBase(UINT message, WPARAM wParam, LPARAM lParam) if (m_rankCheat != -1) { c = cheat_code[m_rankCheat][m_posCheat]; - if (m_posCheat != 0 && m_rankCheat == 1) c++; + if (m_posCheat != 0 && m_rankCheat == 0) c++; if ((char)wParam == c) { m_posCheat++; @@ -3375,7 +3350,7 @@ BOOL CEvent::TreatEventBase(UINT message, WPARAM wParam, LPARAM lParam) } - if (m_phase != WM_PHASE_PLAY && m_phase != WM_PHASE_PLAYTEST) + if (m_phase != WM_PHASE_PLAY && m_phase != WM_PHASE_PLAYTEST && m_phase != WM_PHASE_BUILD) { return FALSE; } @@ -3535,7 +3510,7 @@ BOOL CEvent::TreatEventBase(UINT message, WPARAM wParam, LPARAM lParam) case WM_PHASE_DOPLAY: m_bPrivate = FALSE; m_mission = 1; - if (CheckCDForWorld1()) + if (CheckWorld1()) { return ChangePhase(WM_PHASE_PLAY); } @@ -4110,12 +4085,9 @@ BOOL CEvent::IsMulti() int CEvent::GetWorldGroup() { - int mission; - m_mission = mission; - if (m_mission % 10 != 0 && m_mission != 99) { - m_mission = (mission / 10) * 10; + m_mission = (m_mission / 10) * 10; return -(m_mission >> 31); } m_mission = 1; @@ -4379,7 +4351,7 @@ BOOL CEvent::ChangePhase(UINT phase) m_phase = phase; m_index = SearchPhase(phase); - if (table[m_index].bUnk && !CheckCDForWorld1()) + if (table[m_index].bUnk && !CheckWorld1()) { m_tryInsertCount = 40; m_tryPhase = m_phase; @@ -5721,10 +5693,24 @@ BOOL CEvent::ClearGamer(int gamer) return TRUE; } -BOOL CEvent::CheckCDForWorld1() +BOOL CEvent::CheckWorld1() { - // TODO +#if _CD + FILE* file; + char buf[260]; + + strcpy(buf, "data\\world001.blp"); + AddCDPath(buf); + file = fopen(buf, "rb"); + if (file) + { + fclose(file); + return TRUE; + } + return FALSE; +#else return TRUE; +#endif } int CEvent::GameSave(int save) diff --git a/src/event.h b/src/event.h index 60974ff..87ebad3 100644 --- a/src/event.h +++ b/src/event.h @@ -190,7 +190,7 @@ protected: int GameSave(int save); void DrawMap(); - BOOL CheckCDForWorld1(); + BOOL CheckWorld1(); void NetAdjustLobbyButtons(); BOOL CopyMission(char *srcFileName, char *dstFileName); diff --git a/src/misc.cpp b/src/misc.cpp index a7444b9..5f62b96 100644 --- a/src/misc.cpp +++ b/src/misc.cpp @@ -1,16 +1,12 @@ // Misc.cpp // - #include #include #include #include #include "def.h" -#pragma warning (disable : 4996) - - // Global Variables HINSTANCE g_hInstance; @@ -120,19 +116,6 @@ void GetCurrentDir(char *pName, int lg) } } -int Speed(double speed, int max) -{ - if (speed > 0.0) - { - return max((int)(speed * (double)max), 1); - } - if (speed < 0.0) - { - return min((int)(speed * (double)max), -1); - } - return 0; -} - void AddCDPath(char *pFilename) { char temp[MAX_PATH]; @@ -167,12 +150,12 @@ void AddCDPath(char *pFilename) strcat(temp, pFilename); } #endif - strcpy(pFilename, temp); } void AddUserPath(char *pFilename) { +#if _CD || _LEGACY char temp[MAX_PATH]; char* pText; int pos; @@ -183,12 +166,12 @@ void AddUserPath(char *pFilename) - strcpy(temp, "c:\\Speedy_Blupi\\"); + strcpy(temp, "c:\\Speedy Blupi\\"); att.nLength = sizeof(SECURITY_ATTRIBUTES); att.lpSecurityDescriptor = NULL; att.bInheritHandle = FALSE; - CreateDirectoryA(temp, &att); + CreateDirectory(temp, &att); pText = strstr(pFilename, "\\"); if ( pText != NULL ) @@ -206,6 +189,7 @@ void AddUserPath(char *pFilename) } strcpy(pFilename, temp); +#endif } void TraceErrorDD(HRESULT hErr, const char *sFile, int nLine) diff --git a/src/misc.h b/src/misc.h index 978a4c2..6cbce86 100644 --- a/src/misc.h +++ b/src/misc.h @@ -20,4 +20,4 @@ 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); \ No newline at end of file diff --git a/src/network.cpp b/src/network.cpp index fcd63bb..41025b5 100644 --- a/src/network.cpp +++ b/src/network.cpp @@ -6,6 +6,7 @@ #include "dplay.h" #include "misc.h" #include "network.h" +#include "def.h" // a0f94abe-11c3-d111-be62-0040f6944838 #define APP_GUID { 0xbe4af9a0, 0xc311, 0x11d1, { 0xbe, 0x62, 0x00, 0x40, 0xf6, 0x94, 0x48, 0x38 } }; @@ -202,7 +203,7 @@ BOOL CNetwork::CreateSession(char* pSessionName, char* pPlayerName) desc.lpszSessionNameA = pSessionName; desc.dwSize = sizeof(desc); desc.dwFlags = DPSESSION_KEEPALIVE | DPSESSION_MIGRATEHOST; - desc.dwMaxPlayers = MAXPLAYERS; + desc.dwMaxPlayers = MAXNETPLAYER; hr = m_pDP->Open(&desc, DPOPEN_CREATE); if (hr != DP_OK) @@ -262,7 +263,7 @@ BOOL CNetwork::Receive(LPVOID pDest, DWORD dwDataSize, LPDWORD lpdwPlayer) ZeroMemory(pDest, dwDataSize); *lpdwPlayer = -1; - for (int i = 0; i < MAXPLAYERS; i++) + for (int i = 0; i < MAXNETPLAYER; i++) { if (m_players[i].bIsPresent && from == i) { diff --git a/src/network.h b/src/network.h index 7d62056..925be72 100644 --- a/src/network.h +++ b/src/network.h @@ -7,7 +7,6 @@ ///////////////////////////////////////////////////////////////////////////// #define MAXSESSION 100 -#define MAXPLAYERS 4 typedef struct { diff --git a/src/pixmap.cpp b/src/pixmap.cpp index caadbe1..bc8f1ad 100644 --- a/src/pixmap.cpp +++ b/src/pixmap.cpp @@ -311,6 +311,8 @@ void CPixmap::QuickIcon(int channel, int rank, POINT pos) int num; RECT rect; + if ((unsigned)channel > CHMAX) return; + if (channel == CHOBJECT) { if (table_icon_object[0] <= rank) return; @@ -1275,12 +1277,12 @@ BOOL CPixmap::DrawIcon(int chDst, int channel, int rank, POINT pos, nby = m_totalDim[channel].y / m_iconDim[channel].y; if (rank < 0 || rank >= nbx * nby) return FALSE; - } - rect.left = (rank%nbx)*m_iconDim[channel].x; - rect.top = (rank/nbx)*m_iconDim[channel].y; - rect.right = rect.left + m_iconDim[channel].x; - rect.bottom = rect.top + m_iconDim[channel].y; + rect.left = (rank%nbx)*m_iconDim[channel].x; + rect.top = (rank / nbx)*m_iconDim[channel].y; + rect.right = rect.left + m_iconDim[channel].x; + rect.bottom = rect.top + m_iconDim[channel].y; + } oldColor1 = m_colorSurface[2*channel+0]; oldColor2 = m_colorSurface[2*channel+1]; diff --git a/src/sound.cpp b/src/sound.cpp index 95f388a..37fee3c 100644 --- a/src/sound.cpp +++ b/src/sound.cpp @@ -8,13 +8,8 @@ #include "def.h" #include "resource.h" -using namespace std; - - ///////////////////////////////////////////////////////////////////////////// - - // The following macro are used for proper error handling for DirectSound. #define TRY_DS(exp) { { HRESULT rval = exp; if (rval != DS_OK) { TraceErrorDS(rval, __FILE__, __LINE__); return FALSE; } } } diff --git a/util/extract_tableblupi.py b/util/extract_tableblupi.py new file mode 100644 index 0000000..74906c0 --- /dev/null +++ b/util/extract_tableblupi.py @@ -0,0 +1,15 @@ +# JUMMY WAS HERE +# extract table_blupi from speedy blupi 2.2 english ver + +import sys +import io + +offset = 0x34560 +out = [] + +with io.open('BLUPI.exe', 'rb') as f: + data = f.read() + for i in range(2842): + out.append (int.from_bytes(data[offset + i * 4 : offset + i * 4 + 4], byteorder='little', signed=True)) +with io.open('out.h', 'wb') as f2: + f2.write(bytearray(', '.join(map(str,out)), 'ascii')) diff --git a/util/extract_tablemirror.py b/util/extract_tablemirror.py new file mode 100644 index 0000000..7495192 --- /dev/null +++ b/util/extract_tablemirror.py @@ -0,0 +1,15 @@ +# JUMMY WAS HERE +# extract table_mirror from speedy blupi 2.2 english ver + +import sys +import io + +offset = 0x37ac8 +out = [] + +with io.open('BLUPI.exe', 'rb') as f: + data = f.read() + for i in range(335): + out.append (int.from_bytes(data[offset + i * 4 : offset + i * 4 + 4], byteorder='little', signed=True)) +with io.open('out.h', 'wb') as f2: + f2.write(bytearray(', '.join(map(str,out)), 'ascii'))