1
0
mirror of https://github.com/jummy0/sb2-decomp synced 2025-03-15 04:24:48 +01:00
This commit is contained in:
jummy 2024-06-25 13:59:01 -05:00
parent d8f7122e5d
commit c8ba32ada8
3 changed files with 465 additions and 169 deletions

585
decor.cpp
View File

@ -35,13 +35,12 @@
#define TEXTDELAY 10 // tooltip popup delay
// Constructor
// Possibly incomplete
CDecor::CDecor()
{
int i;
// unknown_library_function_2bd90(m_jauges, sizeof(CJauge), 2, CJauge::CJauge);
// FUN_2bd90(m_jauges, sizeof(CJauge), 2, CJauge::CJauge);
m_hWnd = NULL;
m_pSound = NULL;
m_pPixmap = NULL;
@ -68,7 +67,7 @@ CDecor::CDecor()
CDecor::~CDecor()
{
// unknown_library_function_2be30(m_jauges, sizeof(CJauge), 2, OutputDebug);
// FUN_2be30(m_jauges, sizeof(CJauge), 2, OutputDebug);
}
void CDecor::Create(HWND hWnd, CSound* pSound, CPixmap* pPixmap, CNetwork* pNetwork)
@ -88,15 +87,12 @@ void CDecor::Create(HWND hWnd, CSound* pSound, CPixmap* pPixmap, CNetwork* pNetw
m_bCarStationary = FALSE;
InitDecor();
pos.x = 169;
pos.y = 450;
m_jauges[0].Create(m_hWnd, m_pPixmap, m_pSound, pos, 1, FALSE);
m_jauges[0].Create(m_hWnd, m_pPixmap, m_pSound, { 169, 450 }, 1, FALSE);
m_jauges[0].SetHide(TRUE);
pos.x += DIMJAUGEX + 2;
m_jauges[1].Create(m_hWnd, m_pPixmap, m_pSound, pos, 3, FALSE);
m_jauges[1].Create(m_hWnd, m_pPixmap, m_pSound, { 171, 450 }, 3, FALSE);
m_jauges[1].SetHide(TRUE);
FUN_15fa0();
FlushNotificationMessages();
NetMessageIndexFlush();
NotifFlush();
}
// The only seemingly sane function.
@ -109,13 +105,11 @@ BOOL CDecor::LoadImages()
if (m_lastRegion == m_region) return TRUE;
m_lastRegion = m_region;
totalDim.x = LXIMAGE;
totalDim.y = LYIMAGE;
iconDim.x = 0;
iconDim.y = 0;
totalDim = { LXIMAGE, LYIMAGE };
iconDim = { 0, 0 };
sprintf(filename, "decor%.3d.blp", m_region);
return m_pPixmap->Cache1(CHBACK, filename, totalDim, iconDim, 0);
return m_pPixmap->BackgroundCache(CHBACK, filename, totalDim, iconDim, 0);
}
void CDecor::InitGamer()
@ -130,20 +124,18 @@ void CDecor::InitGamer()
void CDecor::InitDecor()
{
m_posDecor.x = 0;
m_posDecor.y = 0;
m_dimDecor.x = 100;
m_dimDecor.y = 100;
m_posDecor = { 0, 0 };
m_dimDecor = { 100, 100 };
m_music = 1;
m_region = 2;
m_missionTitle[0] = '\0';
m_decorAction = 0;
for (int i = 0; i < MAXCELY; i++)
for (int y = 0; y < MAXCELY; y++)
{
for (int j = 0; j < MAXCELX; j++)
for (int x = 0; x < MAXCELX; x++)
{
m_decor[i][j].icon = -1;
m_bigDecor[i][j].icon = -1;
m_decor[y][x].icon = -1;
m_bigDecor[y][x].icon = -1;
}
}
m_decor[3][4].icon = 40;
@ -160,8 +152,7 @@ void CDecor::InitDecor()
m_moveObject[0].stepRecede = 1;
m_moveObject[0].timeStopStart = 0;
m_moveObject[0].timeStopEnd = 0;
m_moveObject[0].posStart.x = 258;
m_moveObject[0].posStart.y = 196;
m_moveObject[0].posStart = { 258, 196 };
m_moveObject[0].posEnd = m_moveObject[0].posStart;
m_moveObject[0].posCurrent = m_moveObject[0].posStart;
m_moveObject[0].phase = 0;
@ -174,8 +165,7 @@ void CDecor::InitDecor()
m_moveObject[1].stepAdvance = 1;
m_moveObject[1].timeStopStart = 0;
m_moveObject[1].timeStopEnd = 0;
m_moveObject[1].posStart.x = 450;
m_moveObject[1].posStart.y = 196;
m_moveObject[1].posStart = { 450, 196 };
m_moveObject[1].posEnd = m_moveObject[1].posStart;
m_moveObject[1].posCurrent = m_moveObject[1].posStart;
m_moveObject[1].phase = 0;
@ -184,13 +174,12 @@ void CDecor::InitDecor()
m_moveObject[1].channel = CHELEMENT;
m_moveObject[1].icon = 29;
//TODO: iterate setting blupi fifo positions
m_blupiStartPos.x = 66;
m_blupiStartPos.y = 192 + BLUPIOFFY;
m_blupiStartDir = DIR_RIGHT;
m_blupiStartPos[0] = { 66, 192 + BLUPIOFFY };
m_blupiStartDir[0] = DIR_RIGHT;
m_blupiAction = ACTION_STOP;
m_blupiPhase = 0;
m_blupiIcon = 0;
m_blupiChannel = 2;
m_blupiChannel = CHBLUPI;
m_blupiFocus = TRUE;
m_blupiAir = FALSE;
m_blupiHelico = FALSE;
@ -213,8 +202,7 @@ void CDecor::InitDecor()
m_blupiActionOuf = 0;
m_blupiTimeNoAsc = 0;
m_blupiTimeMockery = 0;
m_blupiVitesse.x = 0;
m_blupiVitesse.y = 0;
m_blupiVitesse = { 0, 0 };
m_blupiValidPos = m_blupiStartPos;
m_blupiEnergyUnused = 100;
m_blupiFront = FALSE;
@ -250,20 +238,19 @@ void CDecor::PlayPrepare(BOOL bTest)
{
m_nbVies = 3;
}
if (!m_bMulti) {
m_blupiPos = m_blupiStartPos;
m_blupiDir = m_blupiStartDir;
if (m_bMulti)
{
m_nbVies = 10;
m_blupiPos = m_blupiStartPos[m_team];
m_blupiDir = m_blupiStartDir[m_team];
}
else
{
/* todo: set depending on team
m_nbVies = 10;
m_blupiPos = m_blupiStartPos;
m_blupiDir = m_blupiStartDir;
*/
m_blupiPos = m_blupiStartPos[0];
m_blupiDir = m_blupiStartDir[0];
}
if (m_blupiDir == DIR_LEFT)
{
m_blupiIcon = 4;
@ -272,6 +259,7 @@ void CDecor::PlayPrepare(BOOL bTest)
{
m_blupiIcon = 0;
}
m_blupiAction = ACTION_STOP;
m_blupiPhase = 0;
m_blupiFocus = TRUE;
@ -313,6 +301,7 @@ void CDecor::PlayPrepare(BOOL bTest)
m_moveObject[i].step = STEP_STOPSTART;
m_moveObject[i].phase = 0;
m_moveObject[i].time = 0;
if (m_moveObject[i].type == TYPE_TRESOR ||
m_moveObject[i].type == TYPE_EGG ||
m_moveObject[i].type == TYPE_SHIELD ||
@ -325,11 +314,13 @@ void CDecor::PlayPrepare(BOOL bTest)
{
m_moveObject[i].phase = rand() % 23;
}
if (m_moveObject[i].type == TYPE_BALLE)
{
m_moveObject[i].type = 0;
}
if ((m_bMulti != FALSE) &&
if ((m_bMulti) &&
(m_moveObject[i].type == TYPE_CAISSE) ||
(m_moveObject[i].type == TYPE_GOAL) ||
(m_moveObject[i].type == TYPE_CLE) ||
@ -343,8 +334,7 @@ void CDecor::PlayPrepare(BOOL bTest)
MoveObjectSort();
UpdateCaisse();
m_scrollPoint = m_blupiPos;
m_scrollAdd.x = 0;
m_scrollAdd.y = 0;
m_scrollAdd = { 0, 0 };
m_blupiPosHelico.x = -1;
m_nbLinkCaisse = 0;
m_bHelicopterFlying = FALSE;
@ -356,8 +346,8 @@ void CDecor::PlayPrepare(BOOL bTest)
m_blupiValidPos = m_blupiPos;
m_blupiFifoNb = 0;
m_blupiTimeFire = 0;
FUN_15580();
FlushNotificationMessages();
NetDataFlush();
NotifFlush();
m_voyageIcon = -1;
m_jauges[0].SetHide(TRUE);
m_jauges[1].SetHide(TRUE);
@ -384,10 +374,10 @@ void CDecor::BuildPrepare()
}
m_voyageIcon = -1;
m_selectedCelPos.x = -1;
// field cc20 = -1
m_CC20 = -1;
m_time = 0;
m_bPause = FALSE;
FUN_15580();
NetDataFlush();
}
int CDecor::IsTerminated()
@ -398,10 +388,11 @@ int CDecor::IsTerminated()
void CDecor::MoveStep()
{
MoveObjectStep();
if (m_phase == WM_PHASE_PLAY || m_phase == WM_PHASE_PLAYTEST) {
BlupiStep();
FUN_15d50();
FUN_161a0();
NotifStep();
}
if (m_phase == WM_PHASE_BUILD) {
@ -464,35 +455,46 @@ int CDecor::GetIconPerso()
BOOL CDecor::BlitzActif(int celx, int cely)
{
POINT pos;
pos.x = celx * DIMOBJX;
pos.y = cely * DIMOBJY;
if (m_phase == WM_PHASE_BUILD) {
//TODO: rewrite this like a human
int foo = m_time >> 31;
return 1 - (((m_time ^ foo) - foo & 1 ^ foo) == foo);
}
POINT pos;
pos = { celx * DIMOBJX, cely * DIMOBJY };
//TODO: rewrite from ghidra. winphone code is too different
int num = m_time % 100;
if (m_decor[celx][cely - 1].icon == 304 && (num == 0 || num == 7 || num == 18 || num == 25 || num == 33 || num == 44) && cely > 0)
if (m_blupiPos.x >= pos.x - 80 && m_blupiPos.x <= pos.x + 80 &&
m_blupiPos.y >= pos.y - 500 && m_blupiPos.y <= pos.y + 500)
{
PlaySound(SOUND_BLITZ, pos, 0);
if (m_time % 100 < 70 && cely > 0 && m_decor[celx][cely - 1].icon == 0x130)
{
PlaySound(SOUND_BLITZ, pos, 0);
}
for (int i = 0; table_blitz[i] != -1; i++)
{
if (m_time % 100 == i) return TRUE;
}
}
return num % 2 == 0 && num < 50;
return FALSE;
}
/*
void CDecor::Build(RECT rect)
{
POINT posDecor = DecorNextAction();
POINT pos;
pos.x = posDecor.x * 2 / 3 % LXIMAGE;
pos.y = posDecor.y * 2;
int num = 1;
POINT tinyPoint;
tinyPoint.x = 0;
RECT clipRect;
rect.left = pos.x % LXIMAGE;
rect.right = LXIMAGE;
RECT lastClip;
clipRect = m_pPixmap->GetClipping();
lastClip = m_pPixmap->GetClipping();
m_pPixmap->SetClipping(rect);
POINT posDecor = DecorNextAction();
POINT pos = { posDecor.x * 2 / 3 % LXIMAGE, posDecor.y * 2 };
//TODO: more^
for (int i = 0; i < 3; i++)
@ -510,24 +512,388 @@ void CDecor::Build(RECT rect)
tinyPoint.x += LXIMAGE - pos.x;
pos.x = 0;
}
if (tinyPoint.x > LXIMAGE)
tinyPoint.x = - posDecor.x % 64 - 64;
for (int i = posDecor.x / 64 - 1; i < posDecor.x / 64 + LXIMAGE / 64 + 3; i++) {
tinyPoint.y = - posDecor.y % 64 + 2 - 64;
for (int j = posDecor.y / 64 - 1; j < posDecor.y / 64 + LYIMAGE / 64 + 2; j++)
{
break;
}
tinyPoint.x = m_drawBounds.left - posDecor.x % 64 - 64;
for (int i = posDecor.x / 64 - 1; i < posDecor.x / 64 + (m_drawBounds.right - m_drawBounds.left) / 64 + 3; i++) {
tinyPoint.y = m_drawBounds.top - posDecor.y % 64 + 2 - 64;
for (int j = posDecor.y / 64 - 1; j < posDecor.y / 64 + (m_drawBounds.bottom - m_drawBounds.top) / 64 + 2; j++)
if (i >= 0 && i < 100 && j >= 0 && j < 100)
{
if (i >= 0 && i < 100 && j >= 0 && j < 100)
int num2 = m_bigDecor[i][j].icon;
int channel = 9;
if (num2 != -1)
{
int num2 = m_bigDecor[i][j].icon;
pos = tinyPoint;
if (num2 == 203)
{
num2 = table_marine[m_time / 3 % 11];
channel = 1;
}
if (num2 >= 66 && num2 <= 68)
{
pos.y -= 13;
}
if (num2 >= 87 && num2 <= 89)
{
pos.y -= 2;
}
m_pPixmap->QuickIcon(channel, num2, pos);
}
}
tinyPoint.y += 64;
}
tinyPoint.x += 64;
}
tinyPoint.x = - posDecor.x % 64;
for (int i = posDecor.x / 64; i < posDecor.x / 64 + LXIMAGE / 64 + 2; i++)
{
tinyPoint.y = - posDecor.y % 64;
for (int j = posDecor.y / 64; j < posDecor.y / 64 + LYIMAGE / 64 + 2; j++)
{
if (i >= 0 && i < 100 && j >= 0 && j < 100 && m_decor[i][j].icon != -1)
{
int num2 = m_decor[i][j].icon;
if (num2 == 384 || num2 == 385)
{
m_pPixmap->QuickIcon(CHOBJECT, num2, tinyPoint);
}
}
tinyPoint.y += 64;
}
tinyPoint.x += 64;
}
if (m_phase == WM_PHASE_BUILD)
{
// ...
}
if (m_bMulti && m_phase != WM_PHASE_BUILD)
{
// ...
}
m_blupiSec = 0;
if (!m_blupiFront && m_phase != WM_PHASE_BUILD)
{
tinyPoint.x = m_blupiPos.x - posDecor.x;
tinyPoint.y = m_blupiPos.y - posDecor.y;
if (m_blupiJeep)
{
tinyPoint.y += m_blupiOffsetY;
}
if (m_blupiShield)
{
m_blupiSec = SEC_SHIELD;
if (m_blupiTimeShield > 25 || m_time % 4 < 2)
{
int num2 = table_shield_blupi[m_time / 2 % 16];
tinyPoint.y -= 2;
m_pPixmap->QuickIcon(CHELEMENT, num2, tinyPoint);
tinyPoint.y += 2;
num2 = table_shieldloop[m_time / 2 % 5];
m_pPixmap->QuickIcon(CHELEMENT, num2, tinyPoint);
}
}
else if (m_blupiPower)
{
m_blupiSec = SEC_POWER;
if (m_blupiTimeShield > 25 || m_time % 4 < 2)
{
int num2 = table_magicloop[m_time / 2 % 5];
m_pPixmap->QuickIcon(CHELEMENT, num2, tinyPoint);
}
}
else if (m_blupiCloud)
{
m_blupiSec = SEC_CLOUD;
if (m_blupiTimeShield > 25 || m_time % 4 < 2)
{
for (int k = 0; k < 3; k++)
{
int num2 = 48 + (m_time + k) % 6;
pos.x = tinyPoint.x - 34;
pos.y = tinyPoint.y - 34;
m_pPixmap->QuickIcon(CHEXPLO, num2, pos);
}
}
}
else if (m_blupiHide)
{
m_blupiSec = SEC_HIDE;
if (m_blupiTimeShield > 25 || m_time % 4 < 2)
{
m_pPixmap->DrawIcon(CHTEMP, CHOBJECT, 0xF5, { 0, 0 }, 0, TRUE);
}
else
{
m_pPixmap->DrawIcon(CHTEMP, GetBlupiChannelStandard(), m_blupiIcon, pos, 1, FALSE);
m_pPixmap->DrawIcon(CHTEMP, CHOBJECT, 0xED, { 0, 0 }, 0, TRUE);
}
}
m_pPixmap->QuickIcon(GetBlupiChannelStandard(), m_blupiIcon, tinyPoint);
}
for (int num3 = MAXMOVEOBJECT - 1; num3 >= 0; num3--)
{
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 + m_drawBounds.Width && m_moveObject[num3].posCurrent.Y <= posDecor.Y + m_drawBounds.Height && (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)
{
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 += 2;
tinyPoint.y += BLUPIOFFY;
}
if (m_moveObject[num3].type == 54)
{
tinyPoint.y += BLUPIOFFY;
}
double opacity = 1.0;
if (m_moveObject[num3].type == 58)
{
opacity = (double)(20 - m_moveObject[num3].phase) * 0.3 / 20.0;
}
m_pPixmap->QuickIcon(m_moveObject[num3].channel, m_moveObject[num3].icon, tinyPoint, opacity, 0.0);
if (m_moveObject[num3].type == 30)
{
for (int l = 0; l < table_drinkoffset.Length; l++)
{
int num4 = (m_time + Tables.table_drinkoffset[l]) % 50;
int rank = Tables.table_drinkeffect[num4 % 5];
POINT tinyPoint2 = { tinyPoint.x + 2, tinyPoint.y - num4 * 3 };
POINT pos2 = tinyPoint2;
double opacity2 = (50.0 - (double)num4) / 50.0;
m_pPixmap->QuickIcon(10, rank, pos2, opacity2, 0.0);
}
}
if (m_bDrawSecret && m_moveObject[num3].type == 12 && m_moveObject[num3].icon != 32 && m_moveObject[num3].icon != 33 && m_moveObject[num3].icon != 34)
{
m_pPixmap->QuickIcon(1, 214, tinyPoint);
}
}
}
tinyPoint.X = m_drawBounds.Left - posDecor.X % 64;
for (int i = posDecor.X / 64; i < posDecor.X / 64 + m_drawBounds.Width / 64 + 2; i++)
{
tinyPoint.Y = m_drawBounds.Top - posDecor.Y % 64;
for (int j = posDecor.Y / 64; j < posDecor.Y / 64 + m_drawBounds.Height / 64 + 2; j++)
{
if (i >= 0 && i < 100 && j >= 0 && j < 100 && m_decor[i, j].icon != -1)
{
int num2 = m_decor[i, j].icon;
pos.X = tinyPoint.X;
pos.Y = tinyPoint.Y;
if ((num2 >= 107 && num2 <= 109) || num2 == 157)
{
pos.Y -= 7;
}
if (num2 == 211)
{
num2 = Tables.table_ressort[(m_time / 2 + i * 7) % 8];
}
if (num2 == 214 && !m_bDrawSecret)
{
num2 = -1;
}
if (num2 == 364)
{
pos.Y -= 2;
}
switch (num2)
{
default:
m_pixmap.QuickIcon(1, num2, pos);
break;
case 68:
case 91:
case 92:
case 110:
case 111:
case 112:
case 113:
case 114:
case 115:
case 116:
case 117:
case 118:
case 119:
case 120:
case 121:
case 122:
case 123:
case 124:
case 125:
case 126:
case 127:
case 128:
case 129:
case 130:
case 131:
case 132:
case 133:
case 134:
case 135:
case 136:
case 137:
case 305:
case 317:
case 324:
case 373:
case 378:
case 384:
case 385:
case 404:
case 410:
break;
}
}
tinyPoint.Y += 64;
}
tinyPoint.X += 64;
}
for (int num3 = 0; num3 < MAXMOVEOBJECT; num3++)
{
if ((m_moveObject[num3].type == 1 || m_moveObject[num3].type == 47 || m_moveObject[num3].type == 48) && m_moveObject[num3].posCurrent.X >= posDecor.X - 64 && m_moveObject[num3].posCurrent.Y >= posDecor.Y - 64 && m_moveObject[num3].posCurrent.X <= posDecor.X + m_drawBounds.Width && m_moveObject[num3].posCurrent.Y <= posDecor.Y + m_drawBounds.Height)
{
tinyPoint.X = m_drawBounds.Left + m_moveObject[num3].posCurrent.X - posDecor.X;
tinyPoint.Y = m_drawBounds.Top + m_moveObject[num3].posCurrent.Y - posDecor.Y;
m_pixmap.QuickIcon(m_moveObject[num3].channel, m_moveObject[num3].icon, tinyPoint);
}
}
tinyPoint.X = m_drawBounds.Left - posDecor.X % 64;
for (int i = posDecor.X / 64; i < posDecor.X / 64 + m_drawBounds.Width / 64 + 2; i++)
{
tinyPoint.Y = m_drawBounds.Top - posDecor.Y % 64;
for (int j = posDecor.Y / 64; j < posDecor.Y / 64 + m_drawBounds.Height / 64 + 2; j++)
{
if (i >= 0 && i < 100 && j >= 0 && j < 100 && m_decor[i, j].icon != -1)
{
int num2 = m_decor[i, j].icon;
pos = tinyPoint;
if (num2 == 68)
{
num2 = Tables.table_decor_lave[(i * 13 + j * 7 + m_time / 2) % 8];
m_pixmap.QuickIcon(1, num2, pos);
}
if (num2 == 373)
{
num2 = ((!m_blupiFocus) ? Tables.table_decor_piege2[(i * 13 + j * 7 + m_time / 2) % 4] : Tables.table_decor_piege1[(i * 13 + j * 7 + m_time / 4) % 16]);
m_pixmap.QuickIcon(1, num2, pos);
}
if (num2 == 404 || num2 == 410)
{
num2 = Tables.table_decor_goutte[(i * 13 + j * 7 + m_time / 2) % 48];
pos.Y -= 9;
m_pixmap.QuickIcon(1, num2, pos);
if (num2 >= 404 && num2 <= 407)
{
m_decor[i, j].icon = 404;
}
else
{
m_decor[i, j].icon = 410;
}
}
if (num2 == 317)
{
num2 = Tables.table_decor_ecraseur[m_time / 3 % 10];
m_pixmap.QuickIcon(1, num2, pos);
}
if (num2 == 378)
{
num2 = Tables.table_decor_scie[(i * 13 + j * 7 + m_time / 1) % 6];
m_pixmap.QuickIcon(1, num2, pos);
}
if (num2 == 324)
{
num2 = Tables.table_decor_temp[m_time / 4 % 20];
m_pixmap.QuickIcon(1, num2, pos);
}
if (num2 == 92)
{
num2 = Tables.table_decor_eau1[(i * 13 + j * 7 + m_time / 3) % 6];
m_pixmap.QuickIcon(1, num2, pos);
}
if (num2 == 91)
{
int num5 = 3 + (i * 17 + j * 13) % 3;
num2 = Tables.table_decor_eau2[(i * 11 + j * 7 + m_time / num5) % 6];
m_pixmap.QuickIcon(1, num2, pos);
}
if (num2 == 305 && BlitzActif(i, j))
{
num2 = m_random.Next(305, 308);
m_pixmap.QuickIcon(1, num2, pos);
}
if (num2 == 110)
{
num2 = Tables.table_decor_ventg[m_time / 1 % 4];
m_pixmap.QuickIcon(1, num2, pos);
}
if (num2 == 114)
{
num2 = Tables.table_decor_ventd[m_time / 1 % 4];
m_pixmap.QuickIcon(1, num2, pos);
}
if (num2 == 118)
{
num2 = Tables.table_decor_venth[m_time / 1 % 4];
m_pixmap.QuickIcon(1, num2, pos);
}
if (num2 == 122)
{
num2 = Tables.table_decor_ventb[m_time / 1 % 4];
m_pixmap.QuickIcon(1, num2, pos);
}
if (num2 == 126)
{
num2 = Tables.table_decor_ventillog[m_time / 2 % 3];
m_pixmap.QuickIcon(1, num2, pos);
}
if (num2 == 129)
{
num2 = Tables.table_decor_ventillod[m_time / 2 % 3];
m_pixmap.QuickIcon(1, num2, pos);
}
if (num2 == 132)
{
num2 = Tables.table_decor_ventilloh[m_time / 2 % 3];
m_pixmap.QuickIcon(1, num2, pos);
}
if (num2 == 135)
{
num2 = Tables.table_decor_ventillob[m_time / 2 % 3];
m_pixmap.QuickIcon(1, num2, pos);
}
}
tinyPoint.Y += 64;
}
tinyPoint.X += 64;
}
ByeByeDraw(posDecor);
for (int num3 = 0; num3 < MAXMOVEOBJECT; num3++)
{
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 + m_drawBounds.Width && m_moveObject[num3].posCurrent.Y <= posDecor.Y + m_drawBounds.Height && ((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))
{
tinyPoint.X = m_drawBounds.Left + m_moveObject[num3].posCurrent.X - posDecor.X;
tinyPoint.Y = m_drawBounds.Top + m_moveObject[num3].posCurrent.Y - posDecor.Y;
m_pixmap.QuickIcon(m_moveObject[num3].channel, m_moveObject[num3].icon, tinyPoint);
}
}
if (m_blupiFront)
{
tinyPoint.X = m_drawBounds.Left + m_blupiPos.X - posDecor.X;
tinyPoint.Y = m_drawBounds.Top + m_blupiPos.Y - posDecor.Y;
m_pixmap.QuickIcon(m_blupiChannel, m_blupiIcon, tinyPoint);
}
DrawInfo();
VoyageDraw();
m_time++;
}
*/
// i have gone completely insane
void CDecor::Build(RECT rect)
@ -685,7 +1051,7 @@ void CDecor::Build(RECT rect)
} while (rect.left != 0);
}
if (m_phase == WM_PHASE_BUILD) {
L_38 = &m_D43C;
L_38 = &m_jaugeSomething4;
rect.left = 3;
pint8 = &m_D42C;
do {
@ -1489,62 +1855,6 @@ BOOL CDecor::AddLinkCaisse(int rank)
}
BOOL CDecor::LoadImages()
{
char filename[52];
POINT totalDim, iconDim;
if (m_region == m_lastRegion) return TRUE;
m_lastRegion == m_region;
totalDim.x = DIMCELX * 2 * 16;
totalDim.y = DIMCELY * 2 * 6;
iconDim.x = DIMCELX * 2;
iconDim.y = DIMCELY * 2;
sprintf(filename, "image\\decor%.3d.blp", m_region);
if (!m_pPixmap->Cache(CHFLOOR, filename, totalDim, iconDim, FALSE))
return FALSE;
return TRUE;
}
int CDecor::SetBlupiChannel()
{
if (m_bMulti = 0 ||
m_blupiChannel == CHBLUPI ||
m_team > 0); {
return m_team + 10;
}
return m_blupiChannel;
}
int CDecor::GetBlupiChannel()
{
int m_blupiChannel = CHBLUPI;
if ( m_bMulti != 0 ||
m_team > 0);{
return m_team + 10;
}
return CHBLUPI;
}
int CDecor::GetIconPerso()
{
if (m_bMulti) {
return m_team + ICON_BUTTON_PERSONALBOMBICON;
}
return ICON_BUTTON_PERSONALBOMBICON;
}
void CDecor::SetTime(int time)
{
m_time = time;
@ -1555,11 +1865,6 @@ int CDecor::GetTime()
return m_time;
}
int CDecor::GetTargetLevel(int mission)
{
m_targetMission = mission;
}
int CDecor::GetRegion()
{
return m_region;
@ -7232,7 +7537,7 @@ void CDecor::DoorsLost()
m_nbVies = 3;
}
void CDecor::GetBlupiInfo(BOOL bHelico, BOOL bJeep, BOOL bSkate, BOOL bNage)
void CDecor::GetBlupiInfo(BOOL &bHelico, BOOL &bJeep, BOOL &bSkate, BOOL &bNage)
{
bHelico = m_blupiHelico;
bJeep = (m_blupiJeep | m_blupiTank);

47
decor.h
View File

@ -177,24 +177,22 @@ public:
BOOL ObjectStart(POINT pos, int type, int speed, int _foo);
BOOL ObjectDelete(POINT pos, int type, int _foo);
void ModifDecor(POINT pos, int icon, BOOL _foo);
void FUN_15500(short channel, POINT pos);
void FUN_15540(short channel);
void FUN_15580();
void NetPlaySound(short channel, POINT pos);
void NetStopSound(short channel);
void NetDataFlush();
void FUN_155e0(byte _foo, short _bar);
void FUN_15610();
void FUN_15c90(int _foo);
void FUN_15610();
void FUN_15c90(int _foo);
void TreatNetData();
void DoNetSmooth(int player);
void FUN_15d50();
void FUN_15da0(int rank, short phase);
void FUN_15ec0(POINT pos, int *_foo);
void FUN_15fa0();
//BOOL FUN_15fc0(SoundEvent *event);
//BOOL FUN_16020(SoundEvent *event);
void FlushNotificationMessages();
void FUN_160b0();
void PushNotificationMessage(char *str);
void FUN_161a0();
void NetPlayerCollide(POINT pos, int &result);
void NetMessageIndexFlush();
BOOL NetMessagePush(NetMessage *message);
BOOL NetMessagePop(NetMessage *message);
void NotifFlush();
void NotifPop();
void NotifPush(char *str);
void NotifStep();
void MoveObjectStep();
void MoveObjectStepLine(int i);
void* MoveObjectStepIcon(int i);
@ -337,20 +335,13 @@ protected:
int m_blupiActionOuf;
int m_blupiFifoNb;
POINT m_blupiFifoPos[10];
POINT m_blupiStartPos;
int m_D418;
int m_D41C;
int m_D420;
int m_D424;
int m_blupiStartDir;
POINT m_blupiStartPos[4];
int m_blupiStartDir[4];
int m_D42C;
int m_D430;
int m_D434;
int m_D438;
int m_D43C;
int m_jaugeSomething1;
int m_jaugeSomething2;
int m_jaugeSomething3;
int m_jaugeSomething4;
BOOL m_bMulti;
int m_team;
int m_netPacketsSent;

View File

@ -37,7 +37,7 @@ public:
BOOL SavePalette();
BOOL RestorePalette();
int SearchColor(int red, int green, int blue);
BOOL Cache1(int channel, char *pFilename, POINT totalDim, POINT iconDim, BOOL bUsePalette);
BOOL BackgroundCache(int channel, char *pFilename, POINT totalDim, POINT iconDim, BOOL bUsePalette);
BOOL Cache2(int channel, char *pFilename, POINT totalDim, POINT iconDim, BOOL bUsePalette);
void Flush(int channel);
void SetTransparent(int channel, COLORREF color);