1
0
mirror of https://github.com/blupi-games/planetblupi synced 2024-12-30 10:15:36 +01:00

Cosmetic: rename coin to corner

This commit is contained in:
Mathieu Schroeter 2017-10-28 18:37:06 +02:00
parent dfc729739c
commit 0a17d2d92e
7 changed files with 38 additions and 38 deletions

View File

@ -2013,7 +2013,7 @@ CDecor::GoalNextOp (Sint32 rank, Sint16 * pTable)
m_blupi[rank].cel = cel; m_blupi[rank].cel = cel;
BlupiPushFog (rank); BlupiPushFog (rank);
if (m_blupi[rank].bHili) if (m_blupi[rank].bHili)
SetCoin (cel, true); SetCorner (cel, true);
return true; return true;
} }

View File

@ -136,7 +136,7 @@ CDecor::Write (Sint32 rank, bool bUser, Sint32 world, Sint32 time, Sint32 total)
pBuffer->majRev = 1; pBuffer->majRev = 1;
pBuffer->minRev = 5; pBuffer->minRev = 5;
pBuffer->celCoin = m_celCoin; pBuffer->celCoin = m_celCorner;
pBuffer->world = world; pBuffer->world = world;
pBuffer->time = time; pBuffer->time = time;
pBuffer->totalTime = total; pBuffer->totalTime = total;
@ -255,7 +255,7 @@ CDecor::Read (
goto error; goto error;
} }
SetCoin (pBuffer->celCoin); SetCorner (pBuffer->celCoin);
if (bUser) if (bUser)
{ {
world = pBuffer->world; world = pBuffer->world;
@ -511,7 +511,7 @@ CDecor::Flush ()
m_celHome.x = 90; m_celHome.x = 90;
m_celHome.y = 98; m_celHome.y = 98;
SetCoin (m_celHome); SetCorner (m_celHome);
InitAfterBuild (); InitAfterBuild ();
LoadImages (); LoadImages ();
} }

View File

@ -114,8 +114,8 @@ CDecor::ConvCelToMap (Point cel)
{ {
Point pos; Point pos;
pos.x = (cel.x - m_celCoin.x) - (cel.y - m_celCoin.y); pos.x = (cel.x - m_celCorner.x) - (cel.y - m_celCorner.y);
pos.y = ((cel.x - m_celCoin.x) + (cel.y - m_celCoin.y)) / 2; pos.y = ((cel.x - m_celCorner.x) + (cel.y - m_celCorner.y)) / 2;
pos.x += (DIMMAPX - MAPCADREX) / 2; pos.x += (DIMMAPX - MAPCADREX) / 2;
pos.y += (DIMMAPY - MAPCADREY) / 2; pos.y += (DIMMAPY - MAPCADREY) / 2;
@ -136,8 +136,8 @@ CDecor::ConvMapToCel (Point pos)
cel.x = pos.y + pos.x / 2; cel.x = pos.y + pos.x / 2;
cel.y = pos.y - pos.x / 2; cel.y = pos.y - pos.x / 2;
cel.x += m_celCoin.x; cel.x += m_celCorner.x;
cel.y += m_celCoin.y; cel.y += m_celCorner.y;
return cel; return cel;
} }
@ -158,7 +158,7 @@ CDecor::MapMove (Point pos)
cel = ConvMapToCel (pos); cel = ConvMapToCel (pos);
cel.x = cel.x - 10; cel.x = cel.x - 10;
cel.y = cel.y; cel.y = cel.y;
SetCoin (cel); SetCorner (cel);
NextPhase (0); // faudra refaire la carte tout de suite NextPhase (0); // faudra refaire la carte tout de suite
return true; return true;
} }
@ -560,7 +560,7 @@ CDecor::GenerateMap ()
} }
// Dessine le cadre. // Dessine le cadre.
cel = m_celCoin; cel = m_celCorner;
pos = ConvCelToMap (cel); pos = ConvCelToMap (cel);
for (i = pos.x; i < pos.x + MAPCADREX; i++) for (i = pos.x; i < pos.x + MAPCADREX; i++)

View File

@ -119,8 +119,8 @@ CDecor::CDecor ()
m_pSound = nullptr; m_pSound = nullptr;
m_pUndoDecor = nullptr; m_pUndoDecor = nullptr;
m_celCoin.x = 90; m_celCorner.x = 90;
m_celCoin.y = 98; m_celCorner.y = 98;
m_celHili.x = -1; m_celHili.x = -1;
m_celOutline1.x = -1; m_celOutline1.x = -1;
@ -465,8 +465,8 @@ CDecor::ConvCelToPos (Point cel)
{ {
Point pos; Point pos;
pos.x = ((cel.x - m_celCoin.x) - (cel.y - m_celCoin.y)) * (DIMCELX / 2); pos.x = ((cel.x - m_celCorner.x) - (cel.y - m_celCorner.y)) * (DIMCELX / 2);
pos.y = ((cel.x - m_celCoin.x) + (cel.y - m_celCoin.y)) * (DIMCELY / 2); pos.y = ((cel.x - m_celCorner.x) + (cel.y - m_celCorner.y)) * (DIMCELY / 2);
pos.x += POSDRAWX + m_shiftOffset.x; pos.x += POSDRAWX + m_shiftOffset.x;
pos.y += POSDRAWY + m_shiftOffset.y; pos.y += POSDRAWY + m_shiftOffset.y;
@ -500,8 +500,8 @@ CDecor::ConvPosToCel (Point pos, bool bMap)
cel.y -= (DIMCELX * DIMCELY); cel.y -= (DIMCELX * DIMCELY);
cel.y /= (DIMCELX * DIMCELY); cel.y /= (DIMCELX * DIMCELY);
cel.x += m_celCoin.x; cel.x += m_celCorner.x;
cel.y += m_celCoin.y; cel.y += m_celCorner.y;
return cel; return cel;
} }
@ -516,19 +516,19 @@ CDecor::ConvPosToCel2 (Point pos)
pos.x -= POSDRAWX + DIMCELX / 2; pos.x -= POSDRAWX + DIMCELX / 2;
pos.y -= POSDRAWY; pos.y -= POSDRAWY;
if (m_celCoin.x % 2 != 0 && m_celCoin.y % 2 == 0) if (m_celCorner.x % 2 != 0 && m_celCorner.y % 2 == 0)
{ {
pos.x += DIMCELX / 2; pos.x += DIMCELX / 2;
pos.y += DIMCELY / 2; pos.y += DIMCELY / 2;
} }
if (m_celCoin.x % 2 == 0 && m_celCoin.y % 2 != 0) if (m_celCorner.x % 2 == 0 && m_celCorner.y % 2 != 0)
{ {
pos.x -= DIMCELX / 2; pos.x -= DIMCELX / 2;
pos.y += DIMCELY / 2; pos.y += DIMCELY / 2;
} }
if (m_celCoin.x % 2 != 0 && m_celCoin.y % 2 != 0) if (m_celCorner.x % 2 != 0 && m_celCorner.y % 2 != 0)
pos.y += DIMCELY; pos.y += DIMCELY;
cel.x = cel.x =
@ -539,8 +539,8 @@ CDecor::ConvPosToCel2 (Point pos)
cel.y -= (DIMCELX * 2 * DIMCELY * 2); cel.y -= (DIMCELX * 2 * DIMCELY * 2);
cel.y /= (DIMCELX * 2 * DIMCELY * 2); cel.y /= (DIMCELX * 2 * DIMCELY * 2);
cel.x = (cel.x * 2 + m_celCoin.x) / 2 * 2; cel.x = (cel.x * 2 + m_celCorner.x) / 2 * 2;
cel.y = (cel.y * 2 + m_celCoin.y) / 2 * 2; cel.y = (cel.y * 2 + m_celCorner.y) / 2 * 2;
return cel; return cel;
} }
@ -3261,7 +3261,7 @@ CDecor::HideTooltips (bool bHide)
// Modifie l'origine supérieure/gauche du décor. // Modifie l'origine supérieure/gauche du décor.
void void
CDecor::SetCoin (Point coin, bool bCenter) CDecor::SetCorner (Point coin, bool bCenter)
{ {
if (bCenter) if (bCenter)
{ {
@ -3278,16 +3278,16 @@ CDecor::SetCoin (Point coin, bool bCenter)
if (coin.y > MAXCELY - 4) if (coin.y > MAXCELY - 4)
coin.y = MAXCELY - 4; coin.y = MAXCELY - 4;
m_celCoin = coin; m_celCorner = coin;
m_bGroundRedraw = true; // faudra redessiner les sols m_bGroundRedraw = true; // faudra redessiner les sols
m_celHili.x = -1; m_celHili.x = -1;
m_textLastPos.x = -1; // tooltips plus lavable ! m_textLastPos.x = -1; // tooltips plus lavable !
} }
Point Point
CDecor::GetCoin () CDecor::GetCorner ()
{ {
return m_celCoin; return m_celCorner;
} }
Point Point
@ -3312,7 +3312,7 @@ CDecor::MemoPos (Sint32 rank, bool bRecord)
if (bRecord) if (bRecord)
{ {
m_pSound->PlayImage (SOUND_CLOSE, pos); m_pSound->PlayImage (SOUND_CLOSE, pos);
m_memoPos[rank] = m_celCoin; m_memoPos[rank] = m_celCorner;
} }
else else
{ {
@ -3321,7 +3321,7 @@ CDecor::MemoPos (Sint32 rank, bool bRecord)
else else
{ {
m_pSound->PlayImage (SOUND_GOAL, pos); m_pSound->PlayImage (SOUND_GOAL, pos);
SetCoin (m_memoPos[rank], false); SetCorner (m_memoPos[rank], false);
} }
} }
} }

View File

@ -406,8 +406,8 @@ public:
bool GetObject (Point cel, Sint32 & channel, Sint32 & icon); bool GetObject (Point cel, Sint32 & channel, Sint32 & icon);
bool SetFire (Point cel, bool bFire); bool SetFire (Point cel, bool bFire);
void SetCoin (Point coin, bool bCenter = false); void SetCorner (Point coin, bool bCenter = false);
Point GetCoin (); Point GetCorner ();
Point GetHome (); Point GetHome ();
void MemoPos (Sint32 rank, bool bRecord); void MemoPos (Sint32 rank, bool bRecord);
@ -467,7 +467,7 @@ protected:
Sint16 m_rankBlupi[MAXCELX][MAXCELY]; Sint16 m_rankBlupi[MAXCELX][MAXCELY];
Blupi m_blupi[MAXBLUPI]; Blupi m_blupi[MAXBLUPI];
Move m_move[MAXMOVE]; Move m_move[MAXMOVE];
Point m_celCoin; // cellule sup/gauche Point m_celCorner; // cellule sup/gauche
Point m_celHome; // pour touche Home Point m_celHome; // pour touche Home
Point m_celHili; Point m_celHili;
Point m_celOutline1; Point m_celOutline1;

View File

@ -974,7 +974,7 @@ CDecor::StatisticDown (Point pos)
return false; return false;
select: select:
SetCoin (cel, true); SetCorner (cel, true);
NextPhase (0); // faudra refaire la carte tout de suite NextPhase (0); // faudra refaire la carte tout de suite
return true; return true;
} }

View File

@ -3463,17 +3463,17 @@ CEvent::MovieToStart ()
void void
CEvent::DecorShift (Sint32 dx, Sint32 dy) CEvent::DecorShift (Sint32 dx, Sint32 dy)
{ {
Point coin; Point corner;
if (m_phase != EV_PHASE_PLAY && m_phase != EV_PHASE_BUILD) if (m_phase != EV_PHASE_PLAY && m_phase != EV_PHASE_BUILD)
return; return;
coin = m_pDecor->GetCoin (); corner = m_pDecor->GetCorner ();
coin.x += dx; corner.x += dx;
coin.y += dy; corner.y += dy;
m_pDecor->SetCoin (coin); m_pDecor->SetCorner (corner);
} }
/** /**
@ -3649,7 +3649,7 @@ CEvent::PlayDown (Point pos, const SDL_Event & event)
if (bMap) if (bMap)
{ {
m_pDecor->SetCoin (cel, true); m_pDecor->SetCorner (cel, true);
m_pDecor->NextPhase (0); // faudra refaire la carte tout de suite m_pDecor->NextPhase (0); // faudra refaire la carte tout de suite
return true; return true;
} }
@ -5368,7 +5368,7 @@ CEvent::TreatEventBase (const SDL_Event & event)
} }
case SDLK_HOME: case SDLK_HOME:
pos = m_pDecor->GetHome (); pos = m_pDecor->GetHome ();
m_pDecor->SetCoin (pos); m_pDecor->SetCorner (pos);
return true; return true;
case SDLK_SPACE: case SDLK_SPACE:
if (m_bRunMovie) if (m_bRunMovie)