From 8cd1cacb897f1d2040dd2a5331538d200c25f972 Mon Sep 17 00:00:00 2001 From: Mathieu Schroeter Date: Mon, 21 Aug 2017 22:08:25 +0200 Subject: [PATCH] Rename windows types to something else --- src/action.cxx | 2 +- src/action.h | 2 +- src/blupi.cxx | 10 +- src/blupi.h | 6 +- src/button.cxx | 22 ++-- src/button.h | 18 +-- src/decblupi.cxx | 96 ++++++++-------- src/decio.cxx | 24 ++-- src/decmap.cxx | 26 ++--- src/decmove.cxx | 20 ++-- src/decor.cxx | 100 ++++++++--------- src/decor.h | 282 +++++++++++++++++++++++------------------------ src/decstat.cxx | 14 +-- src/event.cxx | 56 +++++----- src/event.h | 44 ++++---- src/fix.cxx | 28 ++--- src/fog.cxx | 2 +- src/menu.cxx | 16 +-- src/menu.h | 16 +-- src/misc.cxx | 4 +- src/misc.h | 2 +- src/movie.cxx | 4 +- src/movie.h | 4 +- src/obstacle.cxx | 105 +++++++++--------- src/path.cxx | 10 +- src/pixmap.cxx | 48 ++++---- src/pixmap.h | 42 +++---- src/progress.cxx | 6 +- src/progress.h | 8 +- src/sound.cxx | 2 +- src/sound.h | 2 +- src/text.cxx | 14 +-- src/text.h | 10 +- 33 files changed, 522 insertions(+), 523 deletions(-) diff --git a/src/action.cxx b/src/action.cxx index 84eb580..be6b7ae 100644 --- a/src/action.cxx +++ b/src/action.cxx @@ -2733,7 +2733,7 @@ static const DescAction action_table[] = bool Action ( Sint16 action, Sint16 direct, Sint16 & phase, Sint16 & step, Sint16 & channel, - Sint16 & icon, POINT & pos, Sint16 & posZ, Sounds & sound) + Sint16 & icon, Point & pos, Sint16 & posZ, Sounds & sound) { const auto * pTable = action_table; Sint16 nbIcon, nbPhase, nbMove, nbSound, i; diff --git a/src/action.h b/src/action.h index 96d1123..81113f0 100644 --- a/src/action.h +++ b/src/action.h @@ -25,7 +25,7 @@ extern bool Action ( Sint16 action, Sint16 direct, Sint16 & phase, Sint16 & step, Sint16 & channel, - Sint16 & icon, POINT & pos, Sint16 & posZ, Sounds & sound); + Sint16 & icon, Point & pos, Sint16 & posZ, Sounds & sound); bool Rotate (Sint16 & icon, Sint16 direct); Sint32 GetIconDirect (Sint16 icon); Sint32 GetAmplitude (Sint16 action); diff --git a/src/blupi.cxx b/src/blupi.cxx index f2caa66..62173f5 100644 --- a/src/blupi.cxx +++ b/src/blupi.cxx @@ -166,9 +166,9 @@ ReadConfig () static void UpdateFrame (void) { - RECT clip, rcRect; + Rect clip, rcRect; Uint32 phase; - POINT posMouse; + Point posMouse; Sint32 i, term, speed; posMouse = g_pEvent->GetLastMousePos (); @@ -300,7 +300,7 @@ FinishObjects (void) static void HandleEvent (const SDL_Event & event) { - POINT totalDim, iconDim; + Point totalDim, iconDim; if (!g_pause && g_pEvent != nullptr && g_pEvent->TreatEvent (event)) return; @@ -605,8 +605,8 @@ DoInit (int argc, char * argv[], bool & exit) if (exit) return rc; - POINT totalDim, iconDim; - RECT rcRect; + Point totalDim, iconDim; + Rect rcRect; bool bOK; bOK = ReadConfig (); // lit le fichier config.json diff --git a/src/blupi.h b/src/blupi.h index c159f5f..9dd4a03 100644 --- a/src/blupi.h +++ b/src/blupi.h @@ -31,19 +31,19 @@ extern bool g_bFullScreen; extern bool g_restoreBugs; extern bool g_enableRecorder; -struct POINT { +struct Point { Sint32 x; Sint32 y; }; -struct RECT { +struct Rect { Sint32 left; Sint32 top; Sint32 right; Sint32 bottom; }; -typedef Uint32 COLORREF; +typedef Uint32 ColorRef; #if defined(_WIN64) typedef unsigned __int64 WPARAM; diff --git a/src/button.cxx b/src/button.cxx index 8a38630..1ae2e48 100644 --- a/src/button.cxx +++ b/src/button.cxx @@ -56,10 +56,10 @@ CButton::~CButton () bool CButton::Create ( - CPixmap * pPixmap, CSound * pSound, POINT pos, Sint32 type, Sint32 * pMenu, + CPixmap * pPixmap, CSound * pSound, Point pos, Sint32 type, Sint32 * pMenu, Sint32 nbMenu, const char ** pToolTips, Sint32 region, Uint32 message) { - POINT iconDim; + Point iconDim; Sint32 i, icon; static Sint32 ttypes[] = { @@ -146,8 +146,8 @@ void CButton::Draw () { Sint32 i; - POINT pos; - RECT rect; + Point pos; + Rect rect; if (m_bHide) // bouton caché ? { @@ -240,7 +240,7 @@ CButton::SetHide (bool bHide) bool CButton::TreatEvent (const SDL_Event & event) { - POINT pos; + Point pos; if (m_bHide || !m_bEnable) return false; @@ -289,7 +289,7 @@ CButton::TreatEvent (const SDL_Event & event) // Indique si la souris est sur ce bouton. bool -CButton::MouseOnButton (POINT pos) +CButton::MouseOnButton (Point pos) { return Detect (pos); } @@ -298,7 +298,7 @@ CButton::MouseOnButton (POINT pos) // de la position de la souris. const char * -CButton::GetToolTips (POINT pos) +CButton::GetToolTips (Point pos) { Sint32 width = m_dim.x; Sint32 rank; @@ -334,7 +334,7 @@ CButton::GetToolTips (POINT pos) // Détecte si la souris est dans le bouton. bool -CButton::Detect (POINT pos) +CButton::Detect (Point pos) { Sint32 width = m_dim.x; @@ -355,7 +355,7 @@ CButton::Detect (POINT pos) // Bouton de la souris pressé. bool -CButton::MouseDown (POINT pos) +CButton::MouseDown (Point pos) { if (!Detect (pos)) return false; @@ -372,7 +372,7 @@ CButton::MouseDown (POINT pos) // Souris déplacés. bool -CButton::MouseMove (POINT pos) +CButton::MouseMove (Point pos) { bool bDetect; Sint32 iState, iMenu; @@ -415,7 +415,7 @@ CButton::MouseMove (POINT pos) // Bouton de la souris relâché. bool -CButton::MouseUp (POINT pos) +CButton::MouseUp (Point pos) { bool bDetect; diff --git a/src/button.h b/src/button.h index 9f9302b..21fbc1d 100644 --- a/src/button.h +++ b/src/button.h @@ -35,7 +35,7 @@ public: ~CButton (); bool Create ( - CPixmap * pPixmap, CSound * pSound, POINT pos, Sint32 type, Sint32 * pMenu, + CPixmap * pPixmap, CSound * pSound, Point pos, Sint32 type, Sint32 * pMenu, Sint32 nbMenu, const char ** pToolTips, Sint32 region, Uint32 message); void Draw (); @@ -52,15 +52,15 @@ public: void SetHide (bool bHide); bool TreatEvent (const SDL_Event & event); - bool MouseOnButton (POINT pos); + bool MouseOnButton (Point pos); - const char * GetToolTips (POINT pos); + const char * GetToolTips (Point pos); protected: - bool Detect (POINT pos); - bool MouseDown (POINT pos); - bool MouseMove (POINT pos); - bool MouseUp (POINT pos); + bool Detect (Point pos); + bool MouseDown (Point pos); + bool MouseMove (Point pos); + bool MouseUp (Point pos); protected: CPixmap * m_pPixmap; @@ -71,8 +71,8 @@ protected: bool m_bEnable; // true si bouton actif bool m_bHide; // true si bouton caché Uint32 m_message; // message envoyé si bouton actionné - POINT m_pos; // coin sup/gauche - POINT m_dim; // dimensions + Point m_pos; // coin sup/gauche + Point m_dim; // dimensions Sint32 m_state; // 0=relâché, 1=pressé, +2=survollé Sint32 m_mouseState; // 0=relâché, 1=pressé, +2=survollé Sint32 m_iconMenu[20]; // icônes du sous-menu diff --git a/src/decblupi.cxx b/src/decblupi.cxx index 74458de..d28a7be 100644 --- a/src/decblupi.cxx +++ b/src/decblupi.cxx @@ -58,7 +58,7 @@ CDecor::BlupiFlush () Sint32 CDecor::BlupiCreate ( - POINT cel, Sint32 action, Sint32 direct, Sint32 perso, Sint32 energy) + Point cel, Sint32 action, Sint32 direct, Sint32 perso, Sint32 energy) { Sint32 rank; @@ -161,7 +161,7 @@ CDecor::BlupiCreate ( // Si perso >= 0, supprime seulement ce personnage. bool -CDecor::BlupiDelete (POINT cel, Sint32 perso) +CDecor::BlupiDelete (Point cel, Sint32 perso) { Sint32 rank; @@ -216,7 +216,7 @@ CDecor::BlupiDelete (Sint32 rank) // type=1 -> électro void -CDecor::BlupiKill (Sint32 exRank, POINT cel, Sint32 type) +CDecor::BlupiKill (Sint32 exRank, Point cel, Sint32 type) { Sint32 rank, action, x, y, icon; @@ -426,7 +426,7 @@ CDecor::BlupiAdaptIcon (Sint32 rank) // à ce blupi (rank), si nécessaire. void -CDecor::BlupiSound (Sint32 rank, Sounds sound, POINT pos, bool bStop) +CDecor::BlupiSound (Sint32 rank, Sounds sound, Point pos, bool bStop) { Sounds newSound; @@ -487,7 +487,7 @@ static const struct { void CDecor::BlupiInitAction (Sint32 rank, Sint32 action, Sint32 direct) { - POINT pos; + Point pos; Sint32 rand; for (size_t i = 0; i < countof (tableSound); ++i) @@ -791,7 +791,7 @@ CDecor::ListFlush (Sint32 rank) // Retourne le paramètre associé à une action. Sint32 -CDecor::ListGetParam (Sint32 rank, Buttons button, POINT cel) +CDecor::ListGetParam (Sint32 rank, Buttons button, Point cel) { Sint32 icon; @@ -816,7 +816,7 @@ CDecor::ListGetParam (Sint32 rank, Buttons button, POINT cel) // Ajoute une action dans la liste. bool -CDecor::ListPut (Sint32 rank, Buttons button, POINT cel, POINT cMem) +CDecor::ListPut (Sint32 rank, Buttons button, Point cel, Point cMem) { Sint32 i, last; @@ -883,7 +883,7 @@ CDecor::ListRemove (Sint32 rank) Sint32 CDecor::ListSearch ( - Sint32 rank, Buttons button, POINT cel, const char *& textForButton) + Sint32 rank, Buttons button, Point cel, const char *& textForButton) { Sint32 i, j, param, nb; @@ -989,11 +989,11 @@ CDecor::ListSearch ( bool CDecor::RepeatAdjust ( - Sint32 rank, Sint32 button, POINT & cel, POINT & cMem, Sint32 param, + Sint32 rank, Sint32 button, Point & cel, Point & cMem, Sint32 param, Sint32 list) { Sint32 i, channel, icon, icon1, icon2, flags; - POINT test; + Point test; static Sint32 table_object[] = { BUTTON_ABAT, @@ -1172,7 +1172,7 @@ ok: // Démarre une action. void -CDecor::GoalStart (Sint32 rank, Sint32 action, POINT cel) +CDecor::GoalStart (Sint32 rank, Sint32 action, Point cel) { m_blupi[rank].goalHili = cel; m_blupi[rank].goalAction = action; @@ -1274,7 +1274,7 @@ term: void CDecor::GoalInitPassCel (Sint32 rank) { - POINT cel; + Point cel; Sint32 channel, icon; cel.x = (m_blupi[rank].goalCel.x / 2) * 2; @@ -1353,7 +1353,7 @@ CDecor::GoalNextOp (Sint32 rank, Sint16 * pTable) Sint32 total, step, delai, first, last, first2, last2, flag, i; Sint32 param; Buttons button; - POINT pos, cel, cMem, destCel; + Point pos, cel, cMem, destCel; bool bOK, bError = true; pos = ConvCelToPos (m_blupi[rank].cel); @@ -2170,7 +2170,7 @@ CDecor::GoalUnwork (Sint32 rank) void CDecor::GoalStop (Sint32 rank, bool bError, bool bSound) { - POINT pos; + Point pos; static Sounds table_sound_term[] = { SOUND_TERM1, SOUND_TERM2, SOUND_TERM3, @@ -2234,7 +2234,7 @@ CDecor::GoalStop (Sint32 rank, bool bError, bool bSound) // n'importe quel blupi. bool -CDecor::BlupiIsGoalUsed (POINT cel) +CDecor::BlupiIsGoalUsed (Point cel) { Sint32 rank; @@ -2252,10 +2252,10 @@ CDecor::BlupiIsGoalUsed (POINT cel) // Démarre ou stoppe un rayon entre deux tours. void -CDecor::BlupiStartStopRayon (Sint32 rank, POINT startCel, POINT endCel) +CDecor::BlupiStartStopRayon (Sint32 rank, Point startCel, Point endCel) { Sint32 i, icon, icon2; - POINT cel, cel2, vector, pos; + Point cel, cel2, vector, pos; if ( m_blupi[rank].perso == 1 || // araignée ? @@ -2329,7 +2329,7 @@ CDecor::BlupiRotate (Sint32 rank) { Sint32 aDirect, sDirect, ip, in, sens = 0; bool bOK; - POINT pos; + Point pos; aDirect = m_blupi[rank].aDirect; sDirect = m_blupi[rank].sDirect; @@ -2453,7 +2453,7 @@ bool CDecor::BlupiNextAction (Sint32 rank) { bool bOK; - POINT pos, iCel; + Point pos, iCel; Sint32 a, min; Sounds sound; @@ -2679,7 +2679,7 @@ void CDecor::BlupiNextGoal (Sint32 rank) { Sint32 direct, action, channel, icon, min, lg, fRank, i; - POINT pos, cel, vector; + Point pos, cel, vector; if (!m_blupi[rank].bExist) return; @@ -3186,7 +3186,7 @@ void CDecor::BlupiDestCel (Sint32 rank) { Sint32 a; - POINT vector; + Point vector; m_blupi[rank].destCel = m_blupi[rank].cel; @@ -3252,9 +3252,9 @@ CDecor::BlupiStep (bool bFirst) // pour les sélections (pas exact). void -CDecor::BlupiGetRect (Sint32 rank, RECT & rect) +CDecor::BlupiGetRect (Sint32 rank, Rect & rect) { - POINT pos; + Point pos; pos = ConvCelToPos (m_blupi[rank].cel); pos.x += m_blupi[rank].pos.x; @@ -3269,10 +3269,10 @@ CDecor::BlupiGetRect (Sint32 rank, RECT & rect) // Retourne le blupi visé par la souris. Sint32 -CDecor::GetTargetBlupi (POINT pos) +CDecor::GetTargetBlupi (Point pos) { Sint32 rank, found, prof; - POINT test, rel, cel; + Point test, rel, cel; cel = ConvPosToCel (pos); @@ -3389,7 +3389,7 @@ CDecor::InitOutlineRect () // Sélectionne un blupi lorsque le bouton est pressé. void -CDecor::BlupiHiliDown (POINT pos, bool bAdd) +CDecor::BlupiHiliDown (Point pos, bool bAdd) { if (MapMove (pos)) return; @@ -3408,7 +3408,7 @@ CDecor::BlupiHiliDown (POINT pos, bool bAdd) // Sélectionne un blupi lorsque la souris est déplacée. void -CDecor::BlupiHiliMove (POINT pos) +CDecor::BlupiHiliMove (Point pos) { if (m_bHiliRect) // rectangle de sélection existe ? { @@ -3421,12 +3421,12 @@ CDecor::BlupiHiliMove (POINT pos) // Retourne false si la sélection n'a pas changé ! void -CDecor::BlupiHiliUp (POINT pos) +CDecor::BlupiHiliUp (Point pos) { Sint32 rank, r, nb; Sounds sound; bool bEnerve = false; - POINT c1, c2; + Point c1, c2; static Sounds table_sound_ok[] = { SOUND_OK1, SOUND_OK2, SOUND_OK3, SOUND_OK4, SOUND_OK5, SOUND_OK6, @@ -3548,10 +3548,10 @@ CDecor::BlupiHiliUp (POINT pos) void CDecor::BlupiDrawHili () { - POINT c1, c2, cc; - POINT p1, p2, p3, p4; - POINT start, pos; - RECT rect; + Point c1, c2, cc; + Point p1, p2, p3, p4; + Point start, pos; + Rect rect; Sint32 shift; if (!m_bHiliRect) @@ -3699,11 +3699,11 @@ CDecor::BlupiDrawHili () // avec le bouton de droite. Buttons -CDecor::GetDefButton (POINT cel) +CDecor::GetDefButton (Point cel) { Buttons button; Sint32 rank, channel, icon; - POINT iCel; + Point iCel; iCel = cel; cel.x = (cel.x / 2) * 2; @@ -3799,9 +3799,9 @@ CDecor::GetDefButton (POINT cel) // Indique un but visé à Sint32 terme, pour un blupi donné. bool -CDecor::BlupiGoal (Sint32 rank, Buttons button, POINT cel, POINT cMem) +CDecor::BlupiGoal (Sint32 rank, Buttons button, Point cel, Point cMem) { - POINT goalHili, goalHili2, goal, test; + Point goalHili, goalHili2, goal, test; Sint32 i, action, channel, icon, error, direct, step; bool bRepeat = false; @@ -4063,9 +4063,9 @@ CDecor::BlupiGoal (Sint32 rank, Buttons button, POINT cel, POINT cMem) // sélectionnés. void -CDecor::BlupiGoal (POINT cel, Buttons button) +CDecor::BlupiGoal (Point cel, Buttons button) { - POINT bPos, avg; + Point bPos, avg; Sint32 rank, nb, nbHili; static Sounds table_sound_go[] = { @@ -4143,7 +4143,7 @@ CDecor::BlupiGoal (POINT cel, Buttons button) // (personnage invisible). bool -CDecor::IsTracksHere (POINT cel, bool bSkipInMove) +CDecor::IsTracksHere (Point cel, bool bSkipInMove) { Sint32 rank; @@ -4183,7 +4183,7 @@ CDecor::IsTracksHere (POINT cel, bool bSkipInMove) // Le blupi donné dans exRank est ignoré ! bool -CDecor::IsBlupiHereEx (POINT cel1, POINT cel2, Sint32 exRank, bool bSkipInMove) +CDecor::IsBlupiHereEx (Point cel1, Point cel2, Sint32 exRank, bool bSkipInMove) { Sint32 rank; @@ -4228,7 +4228,7 @@ CDecor::IsBlupiHereEx (POINT cel1, POINT cel2, Sint32 exRank, bool bSkipInMove) // Le blupi donné dans exRank est ignoré ! bool -CDecor::IsBlupiHereEx (POINT cel, Sint32 exRank, bool bSkipInMove) +CDecor::IsBlupiHereEx (Point cel, Sint32 exRank, bool bSkipInMove) { Sint32 rank; @@ -4265,7 +4265,7 @@ CDecor::IsBlupiHereEx (POINT cel, Sint32 exRank, bool bSkipInMove) // Indique si une cellule est occupée par un blupi. bool -CDecor::IsBlupiHere (POINT cel, bool bSkipInMove) +CDecor::IsBlupiHere (Point cel, bool bSkipInMove) { return IsBlupiHereEx (cel, -1, bSkipInMove); } @@ -4274,9 +4274,9 @@ CDecor::IsBlupiHere (POINT cel, bool bSkipInMove) // est déjà occupée par un blupi. bool -CDecor::IsBlupiHere (POINT cel, Sint32 direct, bool bSkipInMove) +CDecor::IsBlupiHere (Point cel, Sint32 direct, bool bSkipInMove) { - POINT vector; + Point vector; vector = GetVector (direct); @@ -4336,12 +4336,12 @@ CDecor::IsWorkBlupi (Sint32 rank) void CDecor::BlupiGetButtons ( - POINT pos, Sint32 & nb, Buttons * pButtons, Errors * pErrors, + Point pos, Sint32 & nb, Buttons * pButtons, Errors * pErrors, std::unordered_map & texts, Sint32 & perso) { Buttons * pB = pButtons; Errors * pE = pErrors; - POINT cel, cel2; + Point cel, cel2; Sint32 i, rank, channel, icon; Errors error; Buttons button; @@ -4557,7 +4557,7 @@ Sint32 CDecor::IsTerminated () { Sint32 nb, count, out; - POINT pos; + Point pos; pos.x = LXIMAGE / 2; pos.y = LYIMAGE / 2; diff --git a/src/decio.cxx b/src/decio.cxx index 371843f..be1d4a0 100644 --- a/src/decio.cxx +++ b/src/decio.cxx @@ -32,7 +32,7 @@ typedef struct { Sint32 nbMove; Sint32 lgMove; Sint16 reserve1[100]; - POINT celCoin; + Point celCoin; Sint16 world; Sint32 time; char buttonExist[MAXBUTTON]; @@ -41,7 +41,7 @@ typedef struct { Sint16 region; Sint32 totalTime; Sint16 skill; - POINT memoPos[4]; + Point memoPos[4]; Sint16 reserve2[29]; } DescFile; @@ -53,18 +53,18 @@ typedef struct { Sint16 goalAction; // action (Sint32 terme) Sint16 goalPhase; // phase (Sint32 terme) - POINT goalCel; // cellule visée (Sint32 terme) - POINT passCel; // cellule tranversante + Point goalCel; // cellule visée (Sint32 terme) + Point passCel; // cellule tranversante Sint16 energy; // énergie restante - POINT cel; // cellule actuelle - POINT destCel; // cellule destination + Point cel; // cellule actuelle + Point destCel; // cellule destination Sint16 action; // action en cours Sint16 aDirect; // direction actuelle Sint16 sDirect; // direction souhaitée - POINT pos; // position relative à partir de la cellule + Point pos; // position relative à partir de la cellule Sint16 posZ; // déplacement z Sint16 channel; Sint16 lastIcon; @@ -76,13 +76,13 @@ typedef struct { Sint32 nbUsed; // nb de points déjà visités char nextRankUsed; - POINT posUsed[MAXUSED]; + Point posUsed[MAXUSED]; char rankUsed[MAXUSED]; Sint16 takeChannel; // objet transporté Sint16 takeIcon; - POINT fix; // point fixe (cultive, pont) + Point fix; // point fixe (cultive, pont) Sint16 jaugePhase; Sint16 jaugeMax; @@ -92,7 +92,7 @@ typedef struct { Sint16 nLoop; // nb de boucles pour GOAL_OTHERLOOP Sint16 cLoop; // boucle en cours Sint16 vIcon; // icône variable - POINT goalHili; // but visé + Point goalHili; // but visé Sint16 bMalade; // true -> blupi malade Sint16 bCache; // true -> caché (pas dessiné) Sint16 vehicule; // véhicule utilisé par blupi, voir (**) @@ -170,7 +170,7 @@ CDecor::Write (Sint32 rank, bool bUser, Sint32 world, Sint32 time, Sint32 total) if (nb < MAXMOVE) goto error; - nb = fwrite (m_lastDrapeau, sizeof (POINT), MAXLASTDRAPEAU, file); + nb = fwrite (m_lastDrapeau, sizeof (Point), MAXLASTDRAPEAU, file); if (nb < MAXLASTDRAPEAU) goto error; @@ -306,7 +306,7 @@ CDecor::Read ( if (nb < MAXMOVE) goto error; - nb = fread (m_lastDrapeau, sizeof (POINT), MAXLASTDRAPEAU, file); + nb = fread (m_lastDrapeau, sizeof (Point), MAXLASTDRAPEAU, file); if (nb < MAXLASTDRAPEAU) InitDrapeau (); diff --git a/src/decmap.cxx b/src/decmap.cxx index e5fdc43..28147a3 100644 --- a/src/decmap.cxx +++ b/src/decmap.cxx @@ -109,10 +109,10 @@ CDecor::MapInitColors () // COnversion d'un cellule en point dans la carte. -POINT -CDecor::ConvCelToMap (POINT cel) +Point +CDecor::ConvCelToMap (Point cel) { - POINT pos; + Point pos; pos.x = (cel.x - m_celCoin.x) - (cel.y - m_celCoin.y); pos.y = ((cel.x - m_celCoin.x) + (cel.y - m_celCoin.y)) / 2; @@ -125,10 +125,10 @@ CDecor::ConvCelToMap (POINT cel) // Conversion d'un point dans la carte en cellule. -POINT -CDecor::ConvMapToCel (POINT pos) +Point +CDecor::ConvMapToCel (Point pos) { - POINT cel; + Point cel; pos.x -= ((DIMMAPX - MAPCADREX) / 4) * 2; pos.y -= ((DIMMAPY - MAPCADREY) / 4) * 2; @@ -145,9 +145,9 @@ CDecor::ConvMapToCel (POINT pos) // Déplace le décor suite à un clic dans la carte. bool -CDecor::MapMove (POINT pos) +CDecor::MapMove (Point pos) { - POINT cel; + Point cel; if ( pos.x >= POSMAPX && pos.x < POSMAPX + DIMMAPX && pos.y >= POSMAPY && @@ -425,9 +425,9 @@ static char color_fire[4] = { // (sol, objets et brouillard). void -CDecor::MapPutCel (POINT pos) +CDecor::MapPutCel (Point pos) { - POINT cel, fogCel; + Point cel, fogCel; Sint32 icon, i; char * pColors; @@ -500,17 +500,17 @@ color: bool CDecor::GenerateMap () { - POINT pos, cel; + Point pos, cel; Sint32 dx, rank, i; auto DrawMap = [&]() -> bool { if (!m_SurfaceMap) return true; - POINT dim = {DIMMAPX, DIMMAPY}; + Point dim = {DIMMAPX, DIMMAPY}; m_pPixmap->Cache (CHMAP, m_SurfaceMap, dim); - POINT pos = {POSMAPX, POSMAPY}; + Point pos = {POSMAPX, POSMAPY}; m_pPixmap->DrawIcon (-1, CHMAP, 0, pos); return true; diff --git a/src/decmove.cxx b/src/decmove.cxx index 98eaef1..228f7fd 100644 --- a/src/decmove.cxx +++ b/src/decmove.cxx @@ -908,7 +908,7 @@ CDecor::MoveFixInit () */ bool CDecor::MoveCreate ( - POINT cel, Sint32 rankBlupi, bool bFloor, Sint32 channel, Sint32 icon, + Point cel, Sint32 rankBlupi, bool bFloor, Sint32 channel, Sint32 icon, Sint32 maskChannel, Sint32 maskIcon, Sint32 total, Sint32 delai, Sint32 stepY, bool bMisc, bool bNotIfExist) { @@ -964,7 +964,7 @@ create: // Ajoute un mouvement. bool -CDecor::MoveAddMoves (POINT cel, Sint32 rankMoves) +CDecor::MoveAddMoves (Point cel, Sint32 rankMoves) { Sint32 rank; @@ -987,7 +987,7 @@ CDecor::MoveAddMoves (POINT cel, Sint32 rankMoves) // Ajoute un mouvement. bool -CDecor::MoveAddIcons (POINT cel, Sint32 rankIcons, bool bContinue) +CDecor::MoveAddIcons (Point cel, Sint32 rankIcons, bool bContinue) { Sint32 rank; @@ -1018,7 +1018,7 @@ CDecor::MoveAddIcons (POINT cel, Sint32 rankIcons, bool bContinue) * \returns true if possible. */ bool -CDecor::MoveStartFire (POINT cel) +CDecor::MoveStartFire (Point cel) { Sint32 channel, icon; @@ -1073,7 +1073,7 @@ CDecor::MoveStartFire (POINT cel) // Démarre le feu si c'est possible par proximité. void -CDecor::MoveProxiFire (POINT cel) +CDecor::MoveProxiFire (Point cel) { Sint32 cx, cy, xx, yy, x, y, channel, icon; @@ -1143,7 +1143,7 @@ void CDecor::MoveFire (Sint32 rank) { Sint32 x, y, icon, newIcon; - POINT pos; + Point pos; x = (m_move[rank].cel.x / 2) * 2; y = (m_move[rank].cel.y / 2) * 2; @@ -1334,7 +1334,7 @@ CDecor::MoveStep (bool bFirst) // Termine un mouvement pour une cellule donnée. void -CDecor::MoveFinish (POINT cel) +CDecor::MoveFinish (Point cel) { Sint32 rank; @@ -1375,7 +1375,7 @@ CDecor::MoveFinish (Sint32 rankBlupi) // Vérifie si une cellule est déjà utilisée. bool -CDecor::MoveIsUsed (POINT cel) +CDecor::MoveIsUsed (Point cel) { Sint32 rank; @@ -1393,7 +1393,7 @@ CDecor::MoveIsUsed (POINT cel) // Retourne l'objet en construction à un endroit donné. bool -CDecor::MoveGetObject (POINT cel, Sint32 & channel, Sint32 & icon) +CDecor::MoveGetObject (Point cel, Sint32 & channel, Sint32 & icon) { Sint32 rank; @@ -1415,7 +1415,7 @@ CDecor::MoveGetObject (POINT cel, Sint32 & channel, Sint32 & icon) // Modifie un objet en construction à un endroit donné. bool -CDecor::MovePutObject (POINT cel, Sint32 channel, Sint32 icon) +CDecor::MovePutObject (Point cel, Sint32 channel, Sint32 icon) { Sint32 rank; diff --git a/src/decor.cxx b/src/decor.cxx index 39705d0..431ca5b 100644 --- a/src/decor.cxx +++ b/src/decor.cxx @@ -35,10 +35,10 @@ #define TEXTDELAY 10 // délai avant apparition tooltips -POINT +Point GetCel (Sint32 x, Sint32 y) { - POINT cel; + Point cel; cel.x = x; cel.y = y; @@ -46,8 +46,8 @@ GetCel (Sint32 x, Sint32 y) return cel; } -POINT -GetCel (POINT cel, Sint32 x, Sint32 y) +Point +GetCel (Point cel, Sint32 x, Sint32 y) { cel.x += x; cel.y += y; @@ -61,7 +61,7 @@ GetCel (POINT cel, Sint32 x, Sint32 y) // jusque dans les bords ! bool -IsValid (POINT cel) +IsValid (Point cel) { if (cel.x < 2 || cel.x >= MAXCELX - 2 || cel.y < 2 || cel.y >= MAXCELX - 2) return false; @@ -70,10 +70,10 @@ IsValid (POINT cel) // Retourne un vecteur orienté dans une direction donnée. -POINT +Point GetVector (Sint32 direct) { - POINT vector; + Point vector; vector.x = 0; vector.y = 0; @@ -236,7 +236,7 @@ CDecor::ResetHili () bool CDecor::LoadImages () { - POINT totalDim, iconDim; + Point totalDim, iconDim; char filename[50]; if (m_region == m_lastRegion) @@ -374,7 +374,7 @@ CDecor::FlipOutline () // Initialise un sol dans une cellule. bool -CDecor::PutFloor (POINT cel, Sint32 channel, Sint32 icon) +CDecor::PutFloor (Point cel, Sint32 channel, Sint32 icon) { if (cel.x < 0 || cel.x >= MAXCELX || cel.y < 0 || cel.y >= MAXCELY) return false; @@ -392,7 +392,7 @@ CDecor::PutFloor (POINT cel, Sint32 channel, Sint32 icon) // Initialise un objet dans une cellule. bool -CDecor::PutObject (POINT cel, Sint32 channel, Sint32 icon) +CDecor::PutObject (Point cel, Sint32 channel, Sint32 icon) { if (cel.x < 0 || cel.x >= MAXCELX || cel.y < 0 || cel.y >= MAXCELY) return false; @@ -411,7 +411,7 @@ CDecor::PutObject (POINT cel, Sint32 channel, Sint32 icon) // Retourne un sol dans une cellule. bool -CDecor::GetFloor (POINT cel, Sint32 & channel, Sint32 & icon) +CDecor::GetFloor (Point cel, Sint32 & channel, Sint32 & icon) { if (cel.x < 0 || cel.x >= MAXCELX || cel.y < 0 || cel.y >= MAXCELY) return false; @@ -425,7 +425,7 @@ CDecor::GetFloor (POINT cel, Sint32 & channel, Sint32 & icon) // Retourne une objet dans une cellule. bool -CDecor::GetObject (POINT cel, Sint32 & channel, Sint32 & icon) +CDecor::GetObject (Point cel, Sint32 & channel, Sint32 & icon) { if (cel.x < 0 || cel.x >= MAXCELX || cel.y < 0 || cel.y >= MAXCELY) return false; @@ -439,7 +439,7 @@ CDecor::GetObject (POINT cel, Sint32 & channel, Sint32 & icon) // Modifie le feu pour une cellule. bool -CDecor::SetFire (POINT cel, bool bFire) +CDecor::SetFire (Point cel, bool bFire) { if (cel.x < 0 || cel.x >= MAXCELX || cel.y < 0 || cel.y >= MAXCELY) return false; @@ -452,7 +452,7 @@ CDecor::SetFire (POINT cel, bool bFire) // Modifie l'offset pour le shift. void -CDecor::SetShiftOffset (POINT offset) +CDecor::SetShiftOffset (Point offset) { m_shiftOffset = offset; m_bGroundRedraw = true; @@ -460,10 +460,10 @@ CDecor::SetShiftOffset (POINT offset) // Convertit la position d'une cellule en coordonnée graphique. -POINT -CDecor::ConvCelToPos (POINT cel) +Point +CDecor::ConvCelToPos (Point cel) { - POINT pos; + Point pos; pos.x = ((cel.x - m_celCoin.x) - (cel.y - m_celCoin.y)) * (DIMCELX / 2); pos.y = ((cel.x - m_celCoin.x) + (cel.y - m_celCoin.y)) * (DIMCELY / 2); @@ -476,10 +476,10 @@ CDecor::ConvCelToPos (POINT cel) // Convertit une coordonnée graphique en cellule. -POINT -CDecor::ConvPosToCel (POINT pos, bool bMap) +Point +CDecor::ConvPosToCel (Point pos, bool bMap) { - POINT cel; + Point cel; if ( bMap && pos.x >= POSMAPX && pos.x < POSMAPX + DIMMAPX && pos.y >= POSMAPY && @@ -508,10 +508,10 @@ CDecor::ConvPosToCel (POINT pos, bool bMap) // Convertit une coordonnée graphique en grande cellule (2x2). -POINT -CDecor::ConvPosToCel2 (POINT pos) +Point +CDecor::ConvPosToCel2 (Point pos) { - POINT cel; + Point cel; pos.x -= POSDRAWX + DIMCELX / 2; pos.y -= POSDRAWY; @@ -554,7 +554,7 @@ void CDecor::BuildPutBlupi () { Sint32 x, y, dx, dy, xMin, yMin, rank, clipLeft; - POINT pos; + Point pos; for (rank = 0; rank < MAXBLUPI; rank++) { @@ -671,7 +671,7 @@ CDecor::BuildPutBlupi () // Dessine une cellule du décor contenant un sol animé. void -CDecor::BuildMoveFloor (Sint32 x, Sint32 y, POINT pos, Sint32 rank) +CDecor::BuildMoveFloor (Sint32 x, Sint32 y, Point pos, Sint32 rank) { Sint32 icon, nb; Sint16 * pTable; @@ -710,7 +710,7 @@ CDecor::BuildMoveFloor (Sint32 x, Sint32 y, POINT pos, Sint32 rank) // Dessine une cellule du décor contenant un objet animé. void -CDecor::BuildMoveObject (Sint32 x, Sint32 y, POINT pos, Sint32 rank) +CDecor::BuildMoveObject (Sint32 x, Sint32 y, Point pos, Sint32 rank) { Sint32 hBuild, offset, startY, endY; Sint32 channel, icon, nb; @@ -732,7 +732,7 @@ CDecor::BuildMoveObject (Sint32 x, Sint32 y, POINT pos, Sint32 rank) // Dessine un chiffre par-dessus if (m_move[rank].icon >= MOVEICONNB && m_move[rank].icon <= MOVEICONNB + 100) { - POINT textPos; + Point textPos; char string[20]; m_pPixmap->DrawIcon ( @@ -820,7 +820,7 @@ CDecor::BuildMoveObject (Sint32 x, Sint32 y, POINT pos, Sint32 rank) // Déplace l'objet transporté par blupi. void -BuildMoveTransport (Sint32 icon, POINT & pos) +BuildMoveTransport (Sint32 icon, Point & pos) { pos.x -= DIMCELX / 2; pos.y -= 96; @@ -917,11 +917,11 @@ BuildMoveTransport (Sint32 icon, POINT & pos) // Construit tous les sols fixes dans CHGROUND. void -CDecor::BuildGround (RECT clip) +CDecor::BuildGround (Rect clip) { //? OutputDebug("BuildGround\n"); Sint32 x, y, i, j, nbx, nby, width, height, channel, icon; - POINT iCel, mCel, iPos, mPos, cPos, pos; + Point iCel, mCel, iPos, mPos, cPos, pos; width = clip.right - clip.left; height = clip.bottom - clip.top; @@ -1042,11 +1042,11 @@ CDecor::BuildGround (RECT clip) // Construit le décor dans un pixmap. void -CDecor::Build (RECT clip, POINT posMouse) +CDecor::Build (Rect clip, Point posMouse) { Sint32 x, y, i, j, nbx, nby, width, height, rank, icon, channel, n; - POINT iCel, mCel, cel, iPos, mPos, cPos, pos, tPos; - RECT oldClip, clipRect; + Point iCel, mCel, cel, iPos, mPos, cPos, pos, tPos; + Rect oldClip, clipRect; static Sint32 table_eau[6] = {70, 68, 14, 69, 14, 68}; static Sint32 table_random_x[10] = {2, 5, 1, 9, 4, 0, 6, 3, 8, 7}; @@ -1608,8 +1608,8 @@ CDecor::CountFloor (Sint32 channel, Sint32 icon) Errors CDecor::CelOkForAction ( - POINT cel, Sint32 action, Sint32 rank, Sint32 icons[4][4], - POINT & celOutline1, POINT & celOutline2) + Point cel, Sint32 action, Sint32 rank, Sint32 icons[4][4], + Point & celOutline1, Point & celOutline2) { Sint32 x, y, i, j, channel, icon, nb, start, direct; Errors error = Errors::NONE; @@ -1617,7 +1617,7 @@ CDecor::CelOkForAction ( bool bTransport = false; bool bVehicule = false; bool bVehiculeA = false; - POINT vector; + Point vector; for (x = 0; x < 4; x++) { @@ -2078,7 +2078,7 @@ CDecor::CelOkForAction ( if (action == EV_ACTION_BRIDGEE) { - POINT test; + Point test; if (cel.x % 2 != 1 || cel.y % 2 != 1) { @@ -2451,7 +2451,7 @@ CDecor::CelOkForAction ( if (action == EV_ACTION_BOATE) { - POINT test; + Point test; if (cel.x % 2 != 1 || cel.y % 2 != 1) { @@ -2746,10 +2746,10 @@ CDecor::CelOkForAction ( // Le rang du blupi qui effectuera le travail est donnée dans rank. Errors -CDecor::CelOkForAction (POINT cel, Sint32 action, Sint32 rank) +CDecor::CelOkForAction (Point cel, Sint32 action, Sint32 rank) { Sint32 icons[4][4]; - POINT celOutline1, celOutline2; + Point celOutline1, celOutline2; return CelOkForAction (cel, action, rank, icons, celOutline1, celOutline2); } @@ -2789,10 +2789,10 @@ CDecor::GetHiliRankBlupi (Sint32 nb) // 2 construction d'une cellule 2x2 void -CDecor::CelHili (POINT pos, Sint32 action) +CDecor::CelHili (Point pos, Sint32 action) { Sint32 x, y, i, channel, icon, rank, nb; - POINT cel; + Point cel; for (x = 0; x < 4; x++) { @@ -2893,9 +2893,9 @@ CDecor::CelHili (POINT pos, Sint32 action) // Marque la cellule visée par la souris pour un bouton donné. void -CDecor::CelHiliButton (POINT cel, Sint32 button) +CDecor::CelHiliButton (Point cel, Sint32 button) { - POINT celOutline1, celOutline2; + Point celOutline1, celOutline2; CelOkForAction ( cel, table_actions[button], m_rankBlupiHili, m_iconHili, celOutline1, @@ -2928,7 +2928,7 @@ void CDecor::CelHiliRepeat (Sint32 list) { Sint32 rank, button, x, y, i; - POINT cel; + Point cel; for (x = 0; x < 4; x++) { @@ -2981,7 +2981,7 @@ CDecor::CelHiliRepeat (Sint32 list) // l'objet ou au blupi visé par la souris. const char * -CDecor::GetResHili (POINT posMouse) +CDecor::GetResHili (Point posMouse) { Sint32 icon; @@ -3261,7 +3261,7 @@ CDecor::HideTooltips (bool bHide) // Modifie l'origine supérieure/gauche du décor. void -CDecor::SetCoin (POINT coin, bool bCenter) +CDecor::SetCoin (Point coin, bool bCenter) { if (bCenter) { @@ -3284,13 +3284,13 @@ CDecor::SetCoin (POINT coin, bool bCenter) m_textLastPos.x = -1; // tooltips plus lavable ! } -POINT +Point CDecor::GetCoin () { return m_celCoin; } -POINT +Point CDecor::GetHome () { return m_celHome; @@ -3301,7 +3301,7 @@ CDecor::GetHome () void CDecor::MemoPos (Sint32 rank, bool bRecord) { - POINT pos; + Point pos; pos.x = LXIMAGE / 2; pos.y = LYIMAGE / 2; diff --git a/src/decor.h b/src/decor.h index af021af..e0fc5b5 100644 --- a/src/decor.h +++ b/src/decor.h @@ -65,18 +65,18 @@ typedef struct { Sint16 goalAction; // action (Sint32 terme) Sint16 goalPhase; // phase (Sint32 terme) - POINT goalCel; // cellule visée (Sint32 terme) - POINT passCel; // cellule tranversante + Point goalCel; // cellule visée (Sint32 terme) + Point passCel; // cellule tranversante Sint16 energy; // énergie restante - POINT cel; // cellule actuelle - POINT destCel; // cellule destination + Point cel; // cellule actuelle + Point destCel; // cellule destination Sint16 action; // action en cours Sint16 aDirect; // direction actuelle Sint16 sDirect; // direction souhaitée - POINT pos; // position relative à partir de la cellule + Point pos; // position relative à partir de la cellule Sint16 posZ; // déplacement z Sint16 channel; Sint16 lastIcon; @@ -88,13 +88,13 @@ typedef struct { Sint32 nbUsed; // nb de points déjà visités char nextRankUsed; - POINT posUsed[MAXUSED]; + Point posUsed[MAXUSED]; char rankUsed[MAXUSED]; Sint16 takeChannel; // objet transporté Sint16 takeIcon; - POINT fix; // point fixe (cultive, pont) + Point fix; // point fixe (cultive, pont) Sint16 jaugePhase; Sint16 jaugeMax; @@ -104,7 +104,7 @@ typedef struct { Sint16 nLoop; // nb de boucles pour GOAL_OTHERLOOP Sint16 cLoop; // boucle en cours Sint16 vIcon; // icône variable - POINT goalHili; // but visé + Point goalHili; // but visé Sint16 bMalade; // true -> blupi malade Sint16 bCache; // true -> caché (pas dessiné) Sint16 vehicule; // véhicule utilisé par blupi, voir (**) @@ -114,7 +114,7 @@ typedef struct { char clicDelay; char reserve2[2]; Sint16 listButton[MAXLIST]; - POINT listCel[MAXLIST]; + Point listCel[MAXLIST]; Sint16 listParam[MAXLIST]; Sint16 repeatLevelHope; Sint16 repeatLevel; @@ -145,7 +145,7 @@ typedef struct { typedef struct { Sint32 bExist; // true -> utilisé - POINT cel; // cellule du décor + Point cel; // cellule du décor Sint16 rankBlupi; // blupi travaillant ici Sint32 bFloor; // true -> floor, false -> object @@ -174,110 +174,110 @@ public: ~CDecor (); // Arrange.cpp - void ArrangeFloor (POINT cel); - void ArrangeMur (POINT cel, Sint32 & icon, Sint32 index); - void ArrangeBuild (POINT cel, Sint32 & channel, Sint32 & icon); - void ArrangeObject (POINT cel); + void ArrangeFloor (Point cel); + void ArrangeMur (Point cel, Sint32 & icon, Sint32 index); + void ArrangeBuild (Point cel, Sint32 & channel, Sint32 & icon); + void ArrangeObject (Point cel); - bool ArrangeFillTestFloor (POINT cel1, POINT cel2); - bool ArrangeFillTest (POINT pos); - void ArrangeFillPut (POINT pos, Sint32 channel, Sint32 icon); - void ArrangeFillSearch (POINT pos); - void ArrangeFill (POINT pos, Sint32 channel, Sint32 icon, bool bFloor); + bool ArrangeFillTestFloor (Point cel1, Point cel2); + bool ArrangeFillTest (Point pos); + void ArrangeFillPut (Point pos, Sint32 channel, Sint32 icon); + void ArrangeFillSearch (Point pos); + void ArrangeFill (Point pos, Sint32 channel, Sint32 icon, bool bFloor); void ArrangeBlupi (); // Obstacle.cpp - void SearchFloor (Sint32 rank, Sint32 icon, POINT cel, Sint32 * pBits); - void SearchObject (Sint32 rank, Sint32 icon, POINT cel, Sint32 * pBits); - void AjustFloor (Sint32 rank, Sint32 icon, POINT cel, Sint32 * pBits); - void AjustObject (Sint32 rank, Sint32 icon, POINT cel, Sint32 * pBits); - bool IsFreeDirect (POINT cel, Sint32 direct, Sint32 rank); - bool IsFreeCelObstacle (POINT cel); - bool IsFreeCelFloor (POINT cel, Sint32 rank); - bool IsFreeCelGo (POINT cel, Sint32 rank); - bool IsFreeCelHili (POINT cel, Sint32 rank); - bool IsFreeCel (POINT cel, Sint32 rank); - bool IsFreeCelDepose (POINT cel, Sint32 rank); + void SearchFloor (Sint32 rank, Sint32 icon, Point cel, Sint32 * pBits); + void SearchObject (Sint32 rank, Sint32 icon, Point cel, Sint32 * pBits); + void AjustFloor (Sint32 rank, Sint32 icon, Point cel, Sint32 * pBits); + void AjustObject (Sint32 rank, Sint32 icon, Point cel, Sint32 * pBits); + bool IsFreeDirect (Point cel, Sint32 direct, Sint32 rank); + bool IsFreeCelObstacle (Point cel); + bool IsFreeCelFloor (Point cel, Sint32 rank); + bool IsFreeCelGo (Point cel, Sint32 rank); + bool IsFreeCelHili (Point cel, Sint32 rank); + bool IsFreeCel (Point cel, Sint32 rank); + bool IsFreeCelDepose (Point cel, Sint32 rank); bool - IsFreeCelEmbarque (POINT cel, Sint32 rank, Sint32 & action, POINT & limit); + IsFreeCelEmbarque (Point cel, Sint32 rank, Sint32 & action, Point & limit); bool - IsFreeCelDebarque (POINT cel, Sint32 rank, Sint32 & action, POINT & limit); - bool IsFreeJump (POINT cel, Sint32 direct, Sint32 rank, Sint32 & action); - bool IsFreeGlisse (POINT cel, Sint32 direct, Sint32 rank, Sint32 & action); - Sint32 DirectSearch (POINT cel, POINT goal); + IsFreeCelDebarque (Point cel, Sint32 rank, Sint32 & action, Point & limit); + bool IsFreeJump (Point cel, Sint32 direct, Sint32 rank, Sint32 & action); + bool IsFreeGlisse (Point cel, Sint32 direct, Sint32 rank, Sint32 & action); + Sint32 DirectSearch (Point cel, Point goal); void FlushUsed (Sint32 rank); - void AddUsedPos (Sint32 rank, POINT pos); - bool IsUsedPos (Sint32 rank, POINT pos); + void AddUsedPos (Sint32 rank, Point pos); + bool IsUsedPos (Sint32 rank, Point pos); bool SearchBestBase ( - Sint32 rank, Sint32 & action, POINT & newCel, Sint32 & direct); + Sint32 rank, Sint32 & action, Point & newCel, Sint32 & direct); bool SearchBestPass (Sint32 rank, Sint32 & action); - bool IsWorkableObject (POINT cel, Sint32 rank); + bool IsWorkableObject (Point cel, Sint32 rank); bool SearchOtherObject ( - Sint32 rank, POINT initCel, Sint32 action, Sint32 distMax, Sint32 channel, + Sint32 rank, Point initCel, Sint32 action, Sint32 distMax, Sint32 channel, Sint32 firstIcon1, Sint32 lastIcon1, Sint32 firstIcon2, Sint32 lastIcon2, - POINT & foundCel, Sint32 & foundIcon); + Point & foundCel, Sint32 & foundIcon); bool SearchOtherDrapeau ( - Sint32 rank, POINT initCel, Sint32 distMax, POINT & foundCel, + Sint32 rank, Point initCel, Sint32 distMax, Point & foundCel, Sint32 & foundIcon); bool SearchOtherBateau ( - Sint32 rank, POINT initCel, Sint32 distMax, POINT & foundCel, + Sint32 rank, Point initCel, Sint32 distMax, Point & foundCel, Sint32 & foundIcon); bool IsSpiderObject (Sint32 icon); bool SearchSpiderObject ( - Sint32 rank, POINT initCel, Sint32 distMax, POINT & foundCel, + Sint32 rank, Point initCel, Sint32 distMax, Point & foundCel, Sint32 & foundIcon); bool IsTracksObject (Sint32 icon); bool SearchTracksObject ( - Sint32 rank, POINT initCel, Sint32 distMax, POINT & foundCel, + Sint32 rank, Point initCel, Sint32 distMax, Point & foundCel, Sint32 & foundIcon); bool IsRobotObject (Sint32 icon); bool SearchRobotObject ( - Sint32 rank, POINT initCel, Sint32 distMax, POINT & foundCel, + Sint32 rank, Point initCel, Sint32 distMax, Point & foundCel, Sint32 & foundIcon, Sint32 & foundAction); bool IsBombeObject (Sint32 icon); bool SearchBombeObject ( - Sint32 rank, POINT initCel, Sint32 distMax, POINT & foundCel, + Sint32 rank, Point initCel, Sint32 distMax, Point & foundCel, Sint32 & foundIcon); bool SearchElectroObject ( - Sint32 rank, POINT initCel, Sint32 distMax, POINT & foundCel, + Sint32 rank, Point initCel, Sint32 distMax, Point & foundCel, Sint32 & foundIcon); - bool IsUsineBuild (Sint32 rank, POINT cel); - bool IsUsineFree (Sint32 rank, POINT cel); - bool IsFireCel (POINT cel); - bool IsVirusCel (POINT cel); - Errors IsBuildPont (POINT & cel, Sint32 & iconBuild); - bool IsBuildBateau (POINT cel, Sint32 & direct); + bool IsUsineBuild (Sint32 rank, Point cel); + bool IsUsineFree (Sint32 rank, Point cel); + bool IsFireCel (Point cel); + bool IsVirusCel (Point cel); + Errors IsBuildPont (Point & cel, Sint32 & iconBuild); + bool IsBuildBateau (Point cel, Sint32 & direct); void InitDrapeau (); - void AddDrapeau (POINT cel); - void SubDrapeau (POINT cel); - bool TestDrapeau (POINT cel); + void AddDrapeau (Point cel); + void SubDrapeau (Point cel); + bool TestDrapeau (Point cel); // DecBlupi.cpp void BlupiFlush (); Sint32 BlupiCreate ( - POINT cel, Sint32 action, Sint32 direct, Sint32 perso, Sint32 energy); - bool BlupiDelete (POINT cel, Sint32 perso = -1); + Point cel, Sint32 action, Sint32 direct, Sint32 perso, Sint32 energy); + bool BlupiDelete (Point cel, Sint32 perso = -1); void BlupiDelete (Sint32 rank); - void BlupiKill (Sint32 exRank, POINT cel, Sint32 type); + void BlupiKill (Sint32 exRank, Point cel, Sint32 type); bool BlupiIfExist (Sint32 rank); void BlupiCheat (Sint32 cheat); void BlupiActualise (Sint32 rank); void BlupiAdaptIcon (Sint32 rank); void BlupiPushFog (Sint32 rank); - void BlupiSound (Sint32 rank, Sounds sound, POINT pos, bool bStop = false); + void BlupiSound (Sint32 rank, Sounds sound, Point pos, bool bStop = false); void BlupiInitAction (Sint32 rank, Sint32 action, Sint32 direct = -1); void BlupiChangeAction (Sint32 rank, Sint32 action, Sint32 direct = -1); void ListFlush (Sint32 rank); - Sint32 ListGetParam (Sint32 rank, Buttons button, POINT cel); - bool ListPut (Sint32 rank, Buttons button, POINT cel, POINT cMem); + Sint32 ListGetParam (Sint32 rank, Buttons button, Point cel); + bool ListPut (Sint32 rank, Buttons button, Point cel, Point cMem); void ListRemove (Sint32 rank); Sint32 ListSearch ( - Sint32 rank, Buttons button, POINT cel, const char *& textForButton); + Sint32 rank, Buttons button, Point cel, const char *& textForButton); bool RepeatAdjust ( - Sint32 rank, Sint32 button, POINT & cel, POINT & cMem, Sint32 param, + Sint32 rank, Sint32 button, Point & cel, Point & cMem, Sint32 param, Sint32 list); - void GoalStart (Sint32 rank, Sint32 action, POINT cel); + void GoalStart (Sint32 rank, Sint32 action, Point cel); bool GoalNextPhase (Sint32 rank); void SetTotalTime (Sint32 total); Sint32 GetTotalTime (); @@ -287,35 +287,35 @@ public: bool GoalNextOp (Sint32 rank, Sint16 * pTable); void GoalUnwork (Sint32 rank); void GoalStop (Sint32 rank, bool bError = false, bool bSound = true); - bool BlupiIsGoalUsed (POINT cel); - void BlupiStartStopRayon (Sint32 rank, POINT startCel, POINT endCel); + bool BlupiIsGoalUsed (Point cel); + void BlupiStartStopRayon (Sint32 rank, Point startCel, Point endCel); bool BlupiRotate (Sint32 rank); bool BlupiNextAction (Sint32 rank); void BlupiNextGoal (Sint32 rank); void BlupiStep (bool bFirst); - void BlupiGetRect (Sint32 rank, RECT & rect); - Sint32 GetTargetBlupi (POINT pos); + void BlupiGetRect (Sint32 rank, Rect & rect); + Sint32 GetTargetBlupi (Point pos); void BlupiDeselect (); void BlupiDeselect (Sint32 rank); void BlupiSetArrow (Sint32 rank, bool bArrow); void InitOutlineRect (); - void BlupiHiliDown (POINT pos, bool bAdd = false); - void BlupiHiliMove (POINT pos); - void BlupiHiliUp (POINT pos); + void BlupiHiliDown (Point pos, bool bAdd = false); + void BlupiHiliMove (Point pos); + void BlupiHiliUp (Point pos); void BlupiDrawHili (); - Buttons GetDefButton (POINT cel); - bool BlupiGoal (Sint32 rank, Buttons button, POINT cel, POINT cMem); - void BlupiGoal (POINT cel, Buttons button); + Buttons GetDefButton (Point cel); + bool BlupiGoal (Sint32 rank, Buttons button, Point cel, Point cMem); + void BlupiGoal (Point cel, Buttons button); void BlupiDestCel (Sint32 rank); - bool IsTracksHere (POINT cel, bool bSkipInMove); - bool IsBlupiHereEx (POINT cel1, POINT cel2, Sint32 exRank, bool bSkipInMove); - bool IsBlupiHereEx (POINT cel, Sint32 exRank, bool bSkipInMove); - bool IsBlupiHere (POINT cel, bool bSkipInMove); - bool IsBlupiHere (POINT cel, Sint32 direct, bool bSkipInMove); + bool IsTracksHere (Point cel, bool bSkipInMove); + bool IsBlupiHereEx (Point cel1, Point cel2, Sint32 exRank, bool bSkipInMove); + bool IsBlupiHereEx (Point cel, Sint32 exRank, bool bSkipInMove); + bool IsBlupiHere (Point cel, bool bSkipInMove); + bool IsBlupiHere (Point cel, Sint32 direct, bool bSkipInMove); void GetLevelJauge (Sint32 * pLevels, Sint32 * pTypes); bool IsWorkBlupi (Sint32 rank); void BlupiGetButtons ( - POINT pos, Sint32 & nb, Buttons * pButtons, Errors * pErrors, + Point pos, Sint32 & nb, Buttons * pButtons, Errors * pErrors, std::unordered_map & texts, Sint32 & perso); void TerminatedInit (); Sint32 IsTerminated (); @@ -326,20 +326,20 @@ public: Sint32 MoveMaxFire (); void MoveFixInit (); bool MoveCreate ( - POINT cel, Sint32 rankBlupi, bool bFloor, Sint32 channel, Sint32 icon, + Point cel, Sint32 rankBlupi, bool bFloor, Sint32 channel, Sint32 icon, Sint32 maskChannel, Sint32 maskIcon, Sint32 total, Sint32 delai, Sint32 stepY, bool bMisc = false, bool bNotIfExist = false); - bool MoveAddMoves (POINT cel, Sint32 rankMoves); - bool MoveAddIcons (POINT cel, Sint32 rankIcons, bool bContinue = false); - bool MoveStartFire (POINT cel); - void MoveProxiFire (POINT cel); + bool MoveAddMoves (Point cel, Sint32 rankMoves); + bool MoveAddIcons (Point cel, Sint32 rankIcons, bool bContinue = false); + bool MoveStartFire (Point cel); + void MoveProxiFire (Point cel); void MoveFire (Sint32 rank); void MoveStep (bool bFirst); - void MoveFinish (POINT cel); + void MoveFinish (Point cel); void MoveFinish (Sint32 rankBlupi); - bool MoveIsUsed (POINT cel); - bool MoveGetObject (POINT cel, Sint32 & channel, Sint32 & icon); - bool MovePutObject (POINT cel, Sint32 channel, Sint32 icon); + bool MoveIsUsed (Point cel); + bool MoveGetObject (Point cel, Sint32 & channel, Sint32 & icon); + bool MovePutObject (Point cel, Sint32 channel, Sint32 icon); // DecIO.cpp bool Write (Sint32 rank, bool bUser, Sint32 world, Sint32 time, Sint32 total); @@ -351,10 +351,10 @@ public: // DecMap.cpp void MapInitColors (); - POINT ConvCelToMap (POINT cel); - POINT ConvMapToCel (POINT pos); - bool MapMove (POINT pos); - void MapPutCel (POINT pos); + Point ConvCelToMap (Point cel); + Point ConvMapToCel (Point pos); + bool MapMove (Point pos); + void MapPutCel (Point pos); bool GenerateMap (); // DecStat.cpp @@ -364,27 +364,27 @@ public: Sint32 StatisticGetFire (); void StatisticDraw (); void GenerateStatictic (); - bool StatisticDown (POINT pos); - bool StatisticMove (POINT pos); - bool StatisticUp (POINT pos); - Sint32 StatisticDetect (POINT pos); + bool StatisticDown (Point pos); + bool StatisticMove (Point pos); + bool StatisticUp (Point pos); + Sint32 StatisticDetect (Point pos); // Chemin.cpp void CheminMemPos (Sint32 exRank); - bool CheminTestPos (POINT pos, Sint32 & rank); + bool CheminTestPos (Point pos, Sint32 & rank); Sint32 CheminARebours (Sint32 rank); void CheminFillTerrain (Sint32 rank); bool CheminTestDirection ( Sint32 rank, Sint32 pos, Sint32 dir, Sint32 & next, Sint32 & ampli, Sint32 & cout, Sint32 & action); bool CheminCherche (Sint32 rank, Sint32 & action); - bool IsCheminFree (Sint32 rank, POINT dest, Sint32 button); + bool IsCheminFree (Sint32 rank, Point dest, Sint32 button); // Decor.cpp - void SetShiftOffset (POINT offset); - POINT ConvCelToPos (POINT cel); - POINT ConvPosToCel (POINT pos, bool bMap = false); - POINT ConvPosToCel2 (POINT pos); + void SetShiftOffset (Point offset); + Point ConvCelToPos (Point cel); + Point ConvPosToCel (Point pos, bool bMap = false); + Point ConvPosToCel2 (Point pos); void Create (CSound * pSound, CPixmap * pPixmap); void Init (Sint32 channel, Sint32 icon); @@ -400,15 +400,15 @@ public: bool GetSuper (); void SetSuper (bool bSuper); void FlipOutline (); - bool PutFloor (POINT cel, Sint32 channel, Sint32 icon); - bool PutObject (POINT cel, Sint32 channel, Sint32 icon); - bool GetFloor (POINT cel, Sint32 & channel, Sint32 & icon); - bool GetObject (POINT cel, Sint32 & channel, Sint32 & icon); - bool SetFire (POINT cel, bool bFire); + bool PutFloor (Point cel, Sint32 channel, Sint32 icon); + bool PutObject (Point cel, Sint32 channel, Sint32 icon); + bool GetFloor (Point cel, Sint32 & channel, Sint32 & icon); + bool GetObject (Point cel, Sint32 & channel, Sint32 & icon); + bool SetFire (Point cel, bool bFire); - void SetCoin (POINT coin, bool bCenter = false); - POINT GetCoin (); - POINT GetHome (); + void SetCoin (Point coin, bool bCenter = false); + Point GetCoin (); + Point GetHome (); void MemoPos (Sint32 rank, bool bRecord); void SetTime (Sint32 time); @@ -431,22 +431,22 @@ public: char * GetButtonExist (); void BuildPutBlupi (); - void BuildMoveFloor (Sint32 x, Sint32 y, POINT pos, Sint32 rank); - void BuildMoveObject (Sint32 x, Sint32 y, POINT pos, Sint32 rank); - void BuildGround (RECT clip); - void Build (RECT clip, POINT posMouse); + void BuildMoveFloor (Sint32 x, Sint32 y, Point pos, Sint32 rank); + void BuildMoveObject (Sint32 x, Sint32 y, Point pos, Sint32 rank); + void BuildGround (Rect clip); + void Build (Rect clip, Point posMouse); void NextPhase (Sint32 mode); Sint32 CountFloor (Sint32 channel, Sint32 icon); Errors CelOkForAction ( - POINT cel, Sint32 action, Sint32 rank, Sint32 icons[4][4], - POINT & celOutline1, POINT & celOutline2); - Errors CelOkForAction (POINT cel, Sint32 action, Sint32 rank); + Point cel, Sint32 action, Sint32 rank, Sint32 icons[4][4], + Point & celOutline1, Point & celOutline2); + Errors CelOkForAction (Point cel, Sint32 action, Sint32 rank); Sint32 GetHiliRankBlupi (Sint32 nb); - void CelHili (POINT pos, Sint32 action); - void CelHiliButton (POINT cel, Sint32 button); + void CelHili (Point pos, Sint32 action); + void CelHiliButton (Point cel, Sint32 button); void CelHiliRepeat (Sint32 list); - const char * GetResHili (POINT posMouse); + const char * GetResHili (Point posMouse); void HideTooltips (bool bHide); void UndoOpen (); @@ -456,7 +456,7 @@ public: bool IsUndo (); protected: - bool GetSeeBits (POINT cel, char * pBits, Sint32 index); + bool GetSeeBits (Point cel, char * pBits, Sint32 index); Sint32 GetSeeIcon (char * pBits, Sint32 index); protected: @@ -467,17 +467,17 @@ protected: Sint16 m_rankBlupi[MAXCELX][MAXCELY]; Blupi m_blupi[MAXBLUPI]; Move m_move[MAXMOVE]; - POINT m_celCoin; // cellule sup/gauche - POINT m_celHome; // pour touche Home - POINT m_celHili; - POINT m_celOutline1; - POINT m_celOutline2; - POINT m_shiftOffset; + Point m_celCoin; // cellule sup/gauche + Point m_celHome; // pour touche Home + Point m_celHili; + Point m_celOutline1; + Point m_celOutline2; + Point m_shiftOffset; Sint32 m_iconHili[4][4]; Sint32 m_rankHili; // rang du blupi visé bool m_bHiliRect; - POINT m_p1Hili; // coins rectangle de sélection - POINT m_p2Hili; + Point m_p1Hili; // coins rectangle de sélection + Point m_p2Hili; Sint32 m_shiftHili; Sint32 m_nbBlupiHili; // nb de blupi sélectionnés Sint32 m_rankBlupiHili; // rang blupi sélectionné @@ -491,7 +491,7 @@ protected: Sint32 m_timeFlipOutline; // temps quand basculer mode outline Sint32 m_totalTime; // temps total passé sur une partie Sint32 m_phase; // phase pour la carte - POINT m_celArrow; // cellule avec flèche + Point m_celArrow; // cellule avec flèche bool m_bOutline; bool m_bGroundRedraw; char m_buttonExist[MAXBUTTON]; @@ -524,19 +524,19 @@ protected: Sint32 m_region; // numéro région (*) Sint32 m_lastRegion; // numéro dernière région Sint32 m_blupiHere; - POINT m_lastDrapeau[MAXLASTDRAPEAU]; + Point m_lastDrapeau[MAXLASTDRAPEAU]; bool m_bHideTooltips; // true -> menu présent char m_text[50]; - POINT m_textLastPos; + Point m_textLastPos; Sint32 m_textCount; Sint32 m_skill; bool m_bInfo; Sint32 m_infoHeight; - POINT m_memoPos[4]; + Point m_memoPos[4]; Uint8 m_cheminWork[MAXCELX * MAXCELY]; Sint32 m_cheminNbPos; - POINT m_cheminPos[MAXBLUPI * 2]; + Point m_cheminPos[MAXBLUPI * 2]; Sint32 m_cheminRank[MAXBLUPI * 2]; bool m_bFillFloor; @@ -557,10 +557,10 @@ protected: ///////////////////////////////////////////////////////////////////////////// -POINT GetCel (Sint32 x, Sint32 y); -POINT GetCel (POINT cel, Sint32 x, Sint32 y); -bool IsValid (POINT cel); -POINT GetVector (Sint32 direct); +Point GetCel (Sint32 x, Sint32 y); +Point GetCel (Point cel, Sint32 x, Sint32 y); +bool IsValid (Point cel); +Point GetVector (Sint32 direct); extern Sint32 table_multi_goal[]; extern const Sint16 table_actions[]; diff --git a/src/decstat.cxx b/src/decstat.cxx index f5b6572..5ed69da 100644 --- a/src/decstat.cxx +++ b/src/decstat.cxx @@ -643,8 +643,8 @@ CDecor::StatisticGetFire () void CDecor::StatisticDraw () { - POINT pos; - RECT rect; + Point pos; + Rect rect; Sint32 rank, icon, nb; Statistic * pStatistic; char text[50]; @@ -779,10 +779,10 @@ CDecor::GenerateStatictic () // Bouton pressé dans les statistiques. bool -CDecor::StatisticDown (POINT pos) +CDecor::StatisticDown (Point pos) { Sint32 hili, rank, x, y, show, icon; - POINT cel; + Point cel; Statistic * pStatistic; StatisticUpdate (); @@ -964,7 +964,7 @@ select: // Souris déplacée dans les statistiques. bool -CDecor::StatisticMove (POINT pos) +CDecor::StatisticMove (Point pos) { Sint32 rank; @@ -979,7 +979,7 @@ CDecor::StatisticMove (POINT pos) // Bouton relâché dans les statistiques. bool -CDecor::StatisticUp (POINT pos) +CDecor::StatisticUp (Point pos) { return false; } @@ -987,7 +987,7 @@ CDecor::StatisticUp (POINT pos) // Détecte dans quelle statistique est la souris. Sint32 -CDecor::StatisticDetect (POINT pos) +CDecor::StatisticDetect (Point pos) { Sint32 rank; diff --git a/src/event.cxx b/src/event.cxx index bd96eab..8ef5fc9 100644 --- a/src/event.cxx +++ b/src/event.cxx @@ -1605,10 +1605,10 @@ CEvent::~CEvent () // Retourne la position de la souris. -POINT +Point CEvent::GetMousePos () { - POINT pos; + Point pos; Sint32 x, y; SDL_GetMouseState (&x, &y); @@ -1697,7 +1697,7 @@ void CEvent::Create ( CPixmap * pPixmap, CDecor * pDecor, CSound * pSound, CMovie * pMovie) { - POINT pos; + Point pos; m_pPixmap = pPixmap; m_pDecor = pDecor; @@ -1836,7 +1836,7 @@ bool CEvent::CreateButtons () { Sint32 i = 0, message; - POINT pos; + Point pos; if (m_index < 0) return false; @@ -1901,7 +1901,7 @@ CEvent::SetUpdateVersion (const std::string & version) void CEvent::DrawTextCenter (const char * text, Sint32 x, Sint32 y, Sint32 font) { - POINT pos; + Point pos; pos.x = x; pos.y = y; ::DrawTextCenter (m_pPixmap, pos, text, font); @@ -1918,8 +1918,8 @@ CEvent::DrawButtons () Sint32 world, time, lg, button, volume, pente, icon; char res[100]; char text[100]; - POINT pos; - RECT rect; + Point pos; + Rect rect; bool bEnable; if ( @@ -2573,7 +2573,7 @@ CEvent::DrawButtons () // Retourne le lutin à utiliser à une position donnée. MouseSprites -CEvent::MousePosToSprite (POINT pos) +CEvent::MousePosToSprite (Point pos) { MouseSprites sprite; bool bUp = false, bDown = false, bLeft = false, bRight = false; @@ -2645,7 +2645,7 @@ CEvent::MousePosToSprite (POINT pos) // Gère le lutin de la souris. void -CEvent::MouseSprite (POINT pos) +CEvent::MouseSprite (Point pos) { m_mouseSprite = MousePosToSprite (pos); m_pPixmap->ChangeSprite (m_mouseSprite); @@ -2691,9 +2691,9 @@ CEvent::HideMouse (bool bHide) // Traite les événements pour tous les boutons. bool -CEvent::EventButtons (const SDL_Event & event, POINT pos) +CEvent::EventButtons (const SDL_Event & event, Point pos) { - POINT test; + Point test; Sint32 lg; Sounds sound; @@ -2852,7 +2852,7 @@ CEvent::EventButtons (const SDL_Event & event, POINT pos) // Indique si la souris est sur un bouton. bool -CEvent::MouseOnButton (POINT pos) +CEvent::MouseOnButton (Point pos) { Sint32 i; @@ -2947,7 +2947,7 @@ bool CEvent::ChangePhase (Uint32 phase) { Sint32 index, world, time, total, music, i, max; - POINT totalDim, iconDim; + Point totalDim, iconDim; std::string filename; char * pButtonExist; bool bEnable, bHide; @@ -3335,7 +3335,7 @@ CEvent::MovieToStart () void CEvent::DecorShift (Sint32 dx, Sint32 dy) { - POINT coin; + Point coin; if (m_phase != EV_PHASE_PLAY && m_phase != EV_PHASE_BUILD) return; @@ -3355,7 +3355,7 @@ void CEvent::DecorAutoShift () { Sint32 max; - POINT offset; + Point offset; m_bShift = false; @@ -3469,13 +3469,13 @@ CEvent::IsShift () // Modifie le décor lorsque le bouton de la souris est pressé. bool -CEvent::PlayDown (POINT pos, const SDL_Event & event) +CEvent::PlayDown (Point pos, const SDL_Event & event) { bool bDecor = false; bool bMap = false; Sint32 rank, h; Buttons button; - POINT cel; + Point cel; m_pDecor->BlupiSetArrow (0, false); // enlève toutes les flèches @@ -3542,7 +3542,7 @@ CEvent::PlayDown (POINT pos, const SDL_Event & event) // Modifie le décor lorsque la souris est déplacée. bool -CEvent::PlayMove (POINT pos) +CEvent::PlayMove (Point pos) { if (m_bMenu) { @@ -3573,7 +3573,7 @@ CEvent::PlayMove (POINT pos) // Modifie le décor lorsque le bouton de la souris est relâché. bool -CEvent::PlayUp (POINT pos) +CEvent::PlayUp (Point pos) { static Sounds table_sound_boing[] = { SOUND_BOING1, SOUND_BOING2, SOUND_BOING3, @@ -3859,7 +3859,7 @@ CEvent::ChangeButtons (Sint32 message) // Met un sol si nécessaire sous un objet. void -CEvent::BuildFloor (POINT cel, Sint32 insIcon) +CEvent::BuildFloor (Point cel, Sint32 insIcon) { Sint32 iFloor, channel, icon; @@ -3913,7 +3913,7 @@ CEvent::BuildFloor (POINT cel, Sint32 insIcon) // Enlève si nécessaire un objet sur l'eau. void -CEvent::BuildWater (POINT cel, Sint32 insIcon) +CEvent::BuildWater (Point cel, Sint32 insIcon) { Sint32 channel, icon; @@ -3966,9 +3966,9 @@ static Sint32 tableHome[] = { // Modifie le décor lorsque le bouton de la souris est pressé. bool -CEvent::BuildDown (POINT pos, Uint16 mod, bool bMix) +CEvent::BuildDown (Point pos, Uint16 mod, bool bMix) { - POINT cel; + Point cel; Sint32 menu, channel, icon; if (bMix && m_pDecor->MapMove (pos)) @@ -4126,7 +4126,7 @@ CEvent::BuildDown (POINT pos, Uint16 mod, bool bMix) // Modifie le décor lorsque la souris est déplacée. bool -CEvent::BuildMove (POINT pos, Uint16 mod, const SDL_Event & event) +CEvent::BuildMove (Point pos, Uint16 mod, const SDL_Event & event) { if (event.motion.state & SDL_BUTTON (SDL_BUTTON_LEFT)) // bouton souris pressé // ? @@ -4145,7 +4145,7 @@ CEvent::BuildMove (POINT pos, Uint16 mod, const SDL_Event & event) bool CEvent::StartMovie (const std::string & pFilename) { - RECT rect; + Rect rect; if (!m_pMovie->GetEnable ()) return false; @@ -4829,7 +4829,7 @@ CEvent::DemoStep () if (message == EV_MOUSEMOVE || event.type == SDL_MOUSEMOTION) { - POINT pos; + Point pos; if (m_pDemoBuffer) pos = ConvLongToPos (lParam); @@ -4907,7 +4907,7 @@ CEvent::DemoRecEvent (const SDL_Event & event) // Retourne la dernière position de la souris. -POINT +Point CEvent::GetLastMousePos () { return m_oldMousePos; @@ -4940,7 +4940,7 @@ CEvent::TreatEvent (const SDL_Event & event) bool CEvent::TreatEventBase (const SDL_Event & event) { - POINT pos; + Point pos; Sint32 i; Sounds sound; char c; diff --git a/src/event.h b/src/event.h index e802feb..cf6a750 100644 --- a/src/event.h +++ b/src/event.h @@ -88,7 +88,7 @@ public: CEvent (); ~CEvent (); - POINT GetMousePos (); + Point GetMousePos (); void Create (CPixmap * pPixmap, CDecor * pDecor, CSound * pSound, CMovie * pMovie); void SetFullScreen (bool bFullScreen); @@ -112,11 +112,11 @@ public: void SetMenu (Sint32 button, Sint32 menu); bool DrawButtons (); - MouseSprites MousePosToSprite (POINT pos); - void MouseSprite (POINT pos); + MouseSprites MousePosToSprite (Point pos); + void MouseSprite (Point pos); void WaitMouse (bool bWait); void HideMouse (bool bHide); - POINT GetLastMousePos (); + Point GetLastMousePos (); bool TreatEvent (const SDL_Event & event); bool TreatEventBase (const SDL_Event & event); @@ -146,24 +146,24 @@ public: protected: void DrawTextCenter (const char * text, Sint32 x, Sint32 y, Sint32 font = 0); bool CreateButtons (); - bool EventButtons (const SDL_Event & event, POINT pos); - bool MouseOnButton (POINT pos); + bool EventButtons (const SDL_Event & event, Point pos); + bool MouseOnButton (Point pos); Sint32 SearchPhase (Uint32 phase); void DecorShift (Sint32 dx, Sint32 dy); - bool PlayDown (POINT pos, const SDL_Event & event); - bool PlayMove (POINT pos); - bool PlayUp (POINT pos); + bool PlayDown (Point pos, const SDL_Event & event); + bool PlayMove (Point pos); + bool PlayUp (Point pos); void SetLanguage (); void SetWindowSize (Uint8 prevScale, Uint8 newScale); void ChangeButtons (Sint32 message); - void BuildFloor (POINT cel, Sint32 insIcon); - void BuildWater (POINT cel, Sint32 insIcon); - bool BuildDown (POINT pos, Uint16 mod, bool bMix = true); - bool BuildMove (POINT pos, Uint16 mod, const SDL_Event & event); + void BuildFloor (Point cel, Sint32 insIcon); + void BuildWater (Point cel, Sint32 insIcon); + bool BuildDown (Point pos, Uint16 mod, bool bMix = true); + bool BuildMove (Point pos, Uint16 mod, const SDL_Event & event); void PrivateLibelle (); bool ReadLibelle (Sint32 world, bool bSchool, bool bHelp); @@ -208,19 +208,19 @@ protected: CJauge m_jauges[2]; CMenu m_menu; bool m_bMenu; - POINT m_menuPos; + Point m_menuPos; Sint32 m_menuNb; Buttons m_menuButtons[MAXBUTTON]; Errors m_menuErrors[MAXBUTTON]; std::unordered_map m_menuTexts; Sint32 m_menuPerso; - POINT m_menuCel; - POINT m_oldMousePos; + Point m_menuCel; + Point m_oldMousePos; bool m_bMouseDown; bool m_bHili; Sint32 m_fileWorld[10]; Sint32 m_fileTime[10]; - POINT m_posToolTips; + Point m_posToolTips; char m_textToolTips[50]; MouseSprites m_mouseSprite; bool m_bFillMouse; @@ -237,13 +237,13 @@ protected: bool m_bPause; bool m_bShift; Sint32 m_shiftPhase; - POINT m_shiftVector; - POINT m_shiftOffset; + Point m_shiftVector; + Point m_shiftOffset; char m_libelle[1000]; Sint32 m_tryPhase; Sint32 m_tryInsertCount; - POINT m_posInfoButton; - POINT m_posHelpButton; + Point m_posInfoButton; + Point m_posHelpButton; bool m_bHiliInfoButton; bool m_bHiliHelpButton; bool m_bInfoHelp; @@ -257,7 +257,7 @@ protected: size_t m_demoEnd; Sint32 m_demoNumber; Uint16 m_keymod; - POINT m_debugPos; + Point m_debugPos; Sint32 m_introTime; Sint32 m_updateBlinking; std::string m_updateVersion; diff --git a/src/fix.cxx b/src/fix.cxx index 2f71186..69b8613 100644 --- a/src/fix.cxx +++ b/src/fix.cxx @@ -69,7 +69,7 @@ static const char tableDark[13 * 4] = // Retourne les bits contenant de l'eau. bool -CDecor::GetSeeBits (POINT cel, char * pBits, Sint32 index) +CDecor::GetSeeBits (Point cel, char * pBits, Sint32 index) { Sint32 icon; @@ -208,9 +208,9 @@ CDecor::GetSeeIcon (char * pBits, Sint32 index) // Arrange le sol après une modification. void -CDecor::ArrangeFloor (POINT cel) +CDecor::ArrangeFloor (Point cel) { - POINT test; + Point test; Sint32 max, index, icon; char here[4], bits[4], init[4]; bool bModif = false; @@ -424,7 +424,7 @@ static const Sint16 tableMurDir[4 * 2] = // index=2 si barrière (106..112) void -CDecor::ArrangeMur (POINT cel, Sint32 & icon, Sint32 index) +CDecor::ArrangeMur (Point cel, Sint32 & icon, Sint32 index) { Sint32 i, x, y, channel; Sint32 first, last, matiere; @@ -494,7 +494,7 @@ CDecor::ArrangeMur (POINT cel, Sint32 & icon, Sint32 index) // Arrange les objets avant une construction. void -CDecor::ArrangeBuild (POINT cel, Sint32 & channel, Sint32 & icon) +CDecor::ArrangeBuild (Point cel, Sint32 & channel, Sint32 & icon) { Sint32 index, i, x, y; Sint32 first, last, matiere; @@ -570,12 +570,12 @@ CDecor::ArrangeBuild (POINT cel, Sint32 & channel, Sint32 & icon) // Arrange les objets après une modification. void -CDecor::ArrangeObject (POINT cel) +CDecor::ArrangeObject (Point cel) { Sint32 channel, icon; Sint32 first, last; Sint32 index, i, j, k, x, y; - POINT vector, test, pos; + Point vector, test, pos; bool bTour; for (index = 0; index < 3; index++) @@ -705,9 +705,9 @@ CDecor::ArrangeObject (POINT cel) // Test s'il faut remplir le sol ici. bool -CDecor::ArrangeFillTestFloor (POINT cel1, POINT cel2) +CDecor::ArrangeFillTestFloor (Point cel1, Point cel2) { - POINT cel; + Point cel; Sint32 icon1, icon2; icon1 = m_fillSearchIcon; @@ -760,9 +760,9 @@ CDecor::ArrangeFillTestFloor (POINT cel1, POINT cel2) // Test s'il faut remplir ici. bool -CDecor::ArrangeFillTest (POINT pos) +CDecor::ArrangeFillTest (Point pos) { - POINT cel1, cel2; + Point cel1, cel2; if (m_pFillMap[(pos.x / 2) + (pos.y / 2) * (MAXCELX / 2)] == 1) return false; @@ -800,7 +800,7 @@ CDecor::ArrangeFillTest (POINT pos) // Modifie le décor lors d'un remplissage. void -CDecor::ArrangeFillPut (POINT pos, Sint32 channel, Sint32 icon) +CDecor::ArrangeFillPut (Point pos, Sint32 channel, Sint32 icon) { if (m_bFillFloor) { @@ -823,7 +823,7 @@ CDecor::ArrangeFillPut (POINT pos, Sint32 channel, Sint32 icon) // Rempli un sol à partir d'une position donnée. void -CDecor::ArrangeFillSearch (POINT pos) +CDecor::ArrangeFillSearch (Point pos) { Sint32 startX, endX; @@ -897,7 +897,7 @@ CDecor::ArrangeFillSearch (POINT pos) // Rempli un sol à partir d'une position donnée. void -CDecor::ArrangeFill (POINT pos, Sint32 channel, Sint32 icon, bool bFloor) +CDecor::ArrangeFill (Point pos, Sint32 channel, Sint32 icon, bool bFloor) { m_bFillFloor = bFloor; diff --git a/src/fog.cxx b/src/fog.cxx index 03e18c8..f4d3ba2 100644 --- a/src/fog.cxx +++ b/src/fog.cxx @@ -115,7 +115,7 @@ void CDecor::BlupiPushFog (Sint32 rank) { Sint32 x, y, i; - POINT cel; + Point cel; char cBits[4]; char nBits[4]; diff --git a/src/menu.cxx b/src/menu.cxx index 1c2b6aa..7b966c8 100644 --- a/src/menu.cxx +++ b/src/menu.cxx @@ -156,7 +156,7 @@ CMenu::~CMenu () bool CMenu::Create ( - CPixmap * pPixmap, CSound * pSound, CEvent * pEvent, POINT pos, Sint32 nb, + CPixmap * pPixmap, CSound * pSound, CEvent * pEvent, Point pos, Sint32 nb, Buttons * pButtons, Errors * pErrors, std::unordered_map & texts, Sint32 perso) { @@ -241,8 +241,8 @@ void CMenu::Draw () { Sint32 i, state, icon; - POINT pos; - RECT oldClip, clipRect; + Point pos; + Rect oldClip, clipRect; char text[50]; char * pText; @@ -399,7 +399,7 @@ CMenu::IsExist () bool CMenu::TreatEvent (const SDL_Event & event) { - POINT pos; + Point pos; if (m_nbButtons == 0) return false; @@ -446,7 +446,7 @@ CMenu::TreatEvent (const SDL_Event & event) // Détecte dans quel bouton est la souris. Sint32 -CMenu::Detect (POINT pos) +CMenu::Detect (Point pos) { Sint32 rank; @@ -466,7 +466,7 @@ CMenu::Detect (POINT pos) // Bouton de la souris pressé. bool -CMenu::MouseDown (POINT pos) +CMenu::MouseDown (Point pos) { return false; } @@ -474,7 +474,7 @@ CMenu::MouseDown (POINT pos) // Souris déplacés. bool -CMenu::MouseMove (POINT pos) +CMenu::MouseMove (Point pos) { m_selRank = Detect (pos); @@ -493,7 +493,7 @@ CMenu::MouseMove (POINT pos) // Bouton de la souris relâché. bool -CMenu::MouseUp (POINT pos) +CMenu::MouseUp (Point pos) { m_selRank = Detect (pos); diff --git a/src/menu.h b/src/menu.h index a09fb36..d3f728c 100644 --- a/src/menu.h +++ b/src/menu.h @@ -33,7 +33,7 @@ public: ~CMenu (); bool Create ( - CPixmap * pPixmap, CSound * pSound, CEvent * pEvent, POINT pos, Sint32 nb, + CPixmap * pPixmap, CSound * pSound, CEvent * pEvent, Point pos, Sint32 nb, Buttons * pButtons, Errors * pErrors, std::unordered_map & texts, Sint32 perso); void Update ( @@ -50,20 +50,20 @@ public: bool TreatEvent (const SDL_Event & event); protected: - Sint32 Detect (POINT pos); - bool MouseDown (POINT pos); - bool MouseMove (POINT pos); - bool MouseUp (POINT pos); + Sint32 Detect (Point pos); + bool MouseDown (Point pos); + bool MouseMove (Point pos); + bool MouseUp (Point pos); protected: CPixmap * m_pPixmap; CDecor * m_pDecor; CSound * m_pSound; CEvent * m_pEvent; - POINT m_pos; // coin sup/gauche - POINT m_dim; // dimensions + Point m_pos; // coin sup/gauche + Point m_dim; // dimensions Sint32 m_nbButtons; - POINT m_nbCel; + Point m_nbCel; Sint32 m_perso; Sint32 m_buttons[MAXBUTTON]; Errors m_errors[MAXBUTTON]; diff --git a/src/misc.cxx b/src/misc.cxx index c3160fc..0d67ed2 100644 --- a/src/misc.cxx +++ b/src/misc.cxx @@ -47,10 +47,10 @@ OutputDebug (const char * pMessage) // Conversion de la position de la souris. -POINT +Point ConvLongToPos (LPARAM lParam) { - POINT pos; + Point pos; pos.x = LOWORD (lParam); // horizontal position of cursor pos.y = HIWORD (lParam); // vertical position of cursor diff --git a/src/misc.h b/src/misc.h index 329e894..312a824 100644 --- a/src/misc.h +++ b/src/misc.h @@ -28,7 +28,7 @@ extern void OutputDebug (const char * pMessage); -extern POINT ConvLongToPos (LPARAM lParam); +extern Point ConvLongToPos (LPARAM lParam); extern void InitRandom (); extern Sint32 Random (Sint32 min, Sint32 max); diff --git a/src/movie.cxx b/src/movie.cxx index 85de8a6..d4c7feb 100644 --- a/src/movie.cxx +++ b/src/movie.cxx @@ -90,7 +90,7 @@ CMovie::fileCloseMovie () // Sets on success. bool -CMovie::fileOpenMovie (RECT rect, const std::string & pFilename) +CMovie::fileOpenMovie (Rect rect, const std::string & pFilename) { const auto path = GetBaseDir () + pFilename; @@ -207,7 +207,7 @@ CMovie::IsExist (const std::string & pFilename) // Montre un film avi. bool -CMovie::Play (RECT rect, const std::string & pFilename) +CMovie::Play (Rect rect, const std::string & pFilename) { if (!m_bEnable) return false; diff --git a/src/movie.h b/src/movie.h index 66f45e9..d10b410 100644 --- a/src/movie.h +++ b/src/movie.h @@ -38,7 +38,7 @@ public: bool Create (); bool GetEnable (); bool IsExist (const std::string & pFilename); - bool Play (RECT rect, const std::string & pFilename); + bool Play (Rect rect, const std::string & pFilename); void Stop (); void Pause (); void Resume (); @@ -46,7 +46,7 @@ public: protected: void playMovie (); - bool fileOpenMovie (RECT rect, const std::string & pFilename); + bool fileOpenMovie (Rect rect, const std::string & pFilename); void fileCloseMovie (); void termAVI (); bool initAVI (); diff --git a/src/obstacle.cxx b/src/obstacle.cxx index d6eed7e..5ac5f3c 100644 --- a/src/obstacle.cxx +++ b/src/obstacle.cxx @@ -1286,7 +1286,7 @@ static char tableObstacleObject[] = // forme d'un tableau de 3x3. void -CDecor::SearchFloor (Sint32 rank, Sint32 icon, POINT cel, Sint32 * pBits) +CDecor::SearchFloor (Sint32 rank, Sint32 icon, Point cel, Sint32 * pBits) { char * pTable; Sint32 first, last; @@ -1336,7 +1336,7 @@ CDecor::SearchFloor (Sint32 rank, Sint32 icon, POINT cel, Sint32 * pBits) // forme d'un tableau de 3x3. void -CDecor::SearchObject (Sint32 rank, Sint32 icon, POINT cel, Sint32 * pBits) +CDecor::SearchObject (Sint32 rank, Sint32 icon, Point cel, Sint32 * pBits) { char * pTable; Sint32 dx, dy, x, y, i; @@ -1371,7 +1371,7 @@ CDecor::SearchObject (Sint32 rank, Sint32 icon, POINT cel, Sint32 * pBits) // Ajuste un sol en fonction du personnage. void -CDecor::AjustFloor (Sint32 rank, Sint32 icon, POINT cel, Sint32 * pBits) +CDecor::AjustFloor (Sint32 rank, Sint32 icon, Point cel, Sint32 * pBits) { Sint32 i; @@ -1433,7 +1433,7 @@ lock: // Ajuste un obstacle en fonction du personnage. void -CDecor::AjustObject (Sint32 rank, Sint32 icon, POINT cel, Sint32 * pBits) +CDecor::AjustObject (Sint32 rank, Sint32 icon, Point cel, Sint32 * pBits) { Sint32 i; @@ -1596,11 +1596,11 @@ Copy33To99 (Sint32 * pSrc33, Sint32 * pDst99, Sint32 dx, Sint32 dy) // Indique s'il est possible d'avancer dans une direction donnée. bool -CDecor::IsFreeDirect (POINT cel, Sint32 direct, Sint32 rank) +CDecor::IsFreeDirect (Point cel, Sint32 direct, Sint32 rank) { Sint32 icon, workBlupi; Sint32 bits[3 * 3], obstacles[9 * 9]; - POINT test, vector; + Point test, vector; vector = GetVector (direct); @@ -1679,7 +1679,7 @@ CDecor::IsFreeDirect (POINT cel, Sint32 direct, Sint32 rank) // si blupi est devant un objet. bool -CDecor::IsFreeCelObstacle (POINT cel) +CDecor::IsFreeCelObstacle (Point cel) { Sint32 icon; Sint32 bits[9]; @@ -1709,7 +1709,7 @@ CDecor::IsFreeCelObstacle (POINT cel) // Retourne true si blupi peut y aller ! bool -CDecor::IsFreeCelFloor (POINT cel, Sint32 rank) +CDecor::IsFreeCelFloor (Point cel, Sint32 rank) { Sint32 icon; Sint32 bits[9]; @@ -1734,10 +1734,10 @@ CDecor::IsFreeCelFloor (POINT cel, Sint32 rank) // débarquer en bateau ou monter dans sa jeep. bool -CDecor::IsFreeCelGo (POINT cel, Sint32 rank) +CDecor::IsFreeCelGo (Point cel, Sint32 rank) { bool bOK; - POINT limit; + Point limit; Sint32 action, channel, icon; if (rank == -1) @@ -1799,10 +1799,10 @@ CDecor::IsFreeCelGo (POINT cel, Sint32 rank) // à cet endroit. bool -CDecor::IsFreeCelHili (POINT cel, Sint32 rank) +CDecor::IsFreeCelHili (Point cel, Sint32 rank) { bool bOK; - POINT limit; + Point limit; Sint32 workBlupi, channel, icon, action; if (IsValid (cel)) @@ -1847,7 +1847,7 @@ CDecor::IsFreeCelHili (POINT cel, Sint32 rank) // Est utilisé pour savoir si blupi peut venir ici. bool -CDecor::IsFreeCel (POINT cel, Sint32 rank) +CDecor::IsFreeCel (Point cel, Sint32 rank) { Sint32 icon, workBlupi; Sint32 bits[9]; @@ -1886,7 +1886,7 @@ CDecor::IsFreeCel (POINT cel, Sint32 rank) // Indique si blupi peut déposer un objet ici. bool -CDecor::IsFreeCelDepose (POINT cel, Sint32 rank) +CDecor::IsFreeCelDepose (Point cel, Sint32 rank) { Sint32 icon; @@ -1912,7 +1912,7 @@ CDecor::IsFreeCelDepose (POINT cel, Sint32 rank) bool CDecor::IsFreeCelEmbarque ( - POINT cel, Sint32 rank, Sint32 & action, POINT & limit) + Point cel, Sint32 rank, Sint32 & action, Point & limit) { bool bOK; Sint32 channel, icon; @@ -1994,7 +1994,7 @@ CDecor::IsFreeCelEmbarque ( bool CDecor::IsFreeCelDebarque ( - POINT cel, Sint32 rank, Sint32 & action, POINT & limit) + Point cel, Sint32 rank, Sint32 & action, Point & limit) { bool bOK; Sint32 channel1, icon1; @@ -2064,9 +2064,9 @@ CDecor::IsFreeCelDebarque ( // Indique s'il est possible de sauter dans une direction. bool -CDecor::IsFreeJump (POINT cel, Sint32 direct, Sint32 rank, Sint32 & action) +CDecor::IsFreeJump (Point cel, Sint32 direct, Sint32 rank, Sint32 & action) { - POINT depart, vector; + Point depart, vector; Sint32 i, icon; Sint32 bits[3 * 3]; @@ -2126,7 +2126,7 @@ CDecor::IsFreeJump (POINT cel, Sint32 direct, Sint32 rank, Sint32 & action) // Indique s'il est possible de glisser dans une direction. bool -CDecor::IsFreeGlisse (POINT cel, Sint32 direct, Sint32 rank, Sint32 & action) +CDecor::IsFreeGlisse (Point cel, Sint32 direct, Sint32 rank, Sint32 & action) { Sint32 channel, icon; @@ -2149,9 +2149,9 @@ CDecor::IsFreeGlisse (POINT cel, Sint32 direct, Sint32 rank, Sint32 & action) // Retourne -1 si on est déjà sur le but. Sint32 -CDecor::DirectSearch (POINT cel, POINT goal) +CDecor::DirectSearch (Point cel, Point goal) { - POINT dir; + Point dir; Sint32 direct, tan; dir.x = goal.x - cel.x; @@ -2260,7 +2260,7 @@ CDecor::FlushUsed (Sint32 rank) // Ajoute une position déjà été essayée. void -CDecor::AddUsedPos (Sint32 rank, POINT pos) +CDecor::AddUsedPos (Sint32 rank, Point pos) { Sint32 i, j, old; @@ -2313,7 +2313,7 @@ CDecor::AddUsedPos (Sint32 rank, POINT pos) // Cherche si une position a déjà été essayée. bool -CDecor::IsUsedPos (Sint32 rank, POINT pos) +CDecor::IsUsedPos (Sint32 rank, Point pos) { Sint32 i; @@ -2332,11 +2332,11 @@ CDecor::IsUsedPos (Sint32 rank, POINT pos) bool CDecor::SearchBestBase ( - Sint32 rank, Sint32 & action, POINT & newCel, Sint32 & direct) + Sint32 rank, Sint32 & action, Point & newCel, Sint32 & direct) { Sint32 searchDirect[8] = {0, 1, 7, 2, 6, 5, 3, 4}; Sint32 tryDirect, workBlupi, i, a; - POINT cel, vector; + Point cel, vector; bool bFree; cel = m_blupi[rank].cel; @@ -2429,7 +2429,7 @@ CDecor::SearchBestPass (Sint32 rank, Sint32 & action) { Blupi iBlupi; Sint32 i, j, direct; - POINT iCel, lCel = {0}, cel; + Point iCel, lCel = {0}, cel; if ( m_blupi[rank].perso == 0 || // blupi ? @@ -2535,7 +2535,7 @@ CDecor::SearchBestPass (Sint32 rank, Sint32 & action) // pas y avoir un autre blupi que soi-même. bool -CDecor::IsWorkableObject (POINT cel, Sint32 rank) +CDecor::IsWorkableObject (Point cel, Sint32 rank) { if ( !IsFreeCelFloor (GetCel (cel, 0, 0), -1) || @@ -2564,14 +2564,14 @@ CDecor::IsWorkableObject (POINT cel, Sint32 rank) bool CDecor::SearchOtherObject ( - Sint32 rank, POINT initCel, Sint32 action, Sint32 distMax, Sint32 channel, + Sint32 rank, Point initCel, Sint32 action, Sint32 distMax, Sint32 channel, Sint32 firstIcon1, Sint32 lastIcon1, Sint32 firstIcon2, Sint32 lastIcon2, - POINT & foundCel, Sint32 & foundIcon) + Point & foundCel, Sint32 & foundIcon) { Sint32 startx, starty, endx, endy; Sint32 x, y, xx = 0, yy = 0; Sint32 dist, min = distMax; - POINT cel; + Point cel; bool bOK; if ( @@ -2683,13 +2683,13 @@ CDecor::SearchOtherObject ( bool CDecor::SearchOtherDrapeau ( - Sint32 rank, POINT initCel, Sint32 distMax, POINT & foundCel, + Sint32 rank, Point initCel, Sint32 distMax, Point & foundCel, Sint32 & foundIcon) { Sint32 startx, starty, endx, endy, icon; Sint32 x, y; Sint32 dist, min = distMax; - POINT cel; + Point cel; startx = ((initCel.x - distMax / 2) / 2) * 2; endx = ((initCel.x + distMax / 2) / 2) * 2; @@ -2746,7 +2746,7 @@ CDecor::SearchOtherDrapeau ( bool CDecor::SearchOtherBateau ( - Sint32 rank, POINT initCel, Sint32 distMax, POINT & foundCel, + Sint32 rank, Point initCel, Sint32 distMax, Point & foundCel, Sint32 & foundIcon) { Sint32 startx, starty, endx, endy; @@ -2805,13 +2805,13 @@ CDecor::IsSpiderObject (Sint32 icon) bool CDecor::SearchSpiderObject ( - Sint32 rank, POINT initCel, Sint32 distMax, POINT & foundCel, + Sint32 rank, Point initCel, Sint32 distMax, Point & foundCel, Sint32 & foundIcon) { Sint32 startx, starty, endx, endy; Sint32 x, y; Sint32 dist, min = distMax; - POINT cel; + Point cel; startx = ((initCel.x - distMax / 2) / 2) * 2; endx = ((initCel.x + distMax / 2) / 2) * 2; @@ -2887,13 +2887,12 @@ CDecor::IsTracksObject (Sint32 icon) bool CDecor::SearchTracksObject ( - Sint32 rank, POINT initCel, Sint32 distMax, POINT & foundCel, + Sint32 rank, Point initCel, Sint32 distMax, Point & foundCel, Sint32 & foundIcon) { Sint32 startx, starty, endx, endy, icon; Sint32 x, y; Sint32 dist, min = distMax; - //? POINT cel; startx = ((initCel.x - distMax / 2) / 2) * 2; endx = ((initCel.x + distMax / 2) / 2) * 2; @@ -2986,7 +2985,7 @@ CDecor::IsRobotObject (Sint32 icon) bool CDecor::SearchRobotObject ( - Sint32 rank, POINT initCel, Sint32 distMax, POINT & foundCel, + Sint32 rank, Point initCel, Sint32 distMax, Point & foundCel, Sint32 & foundIcon, Sint32 & foundAction) { Sint32 startx, starty, endx, endy; @@ -3282,7 +3281,7 @@ CDecor::SearchRobotObject ( // Teste si un emplacement est ok pour bâtir une usine. bool -CDecor::IsUsineBuild (Sint32 rank, POINT cel) +CDecor::IsUsineBuild (Sint32 rank, Point cel) { Sint32 icon, channel; Sint32 x, y; @@ -3311,7 +3310,7 @@ CDecor::IsUsineBuild (Sint32 rank, POINT cel) // pour l'ennemi qui sera construit). bool -CDecor::IsUsineFree (Sint32 rank, POINT cel) +CDecor::IsUsineFree (Sint32 rank, Point cel) { Sint32 channel, icon; @@ -3353,13 +3352,13 @@ CDecor::IsBombeObject (Sint32 icon) bool CDecor::SearchBombeObject ( - Sint32 rank, POINT initCel, Sint32 distMax, POINT & foundCel, + Sint32 rank, Point initCel, Sint32 distMax, Point & foundCel, Sint32 & foundIcon) { Sint32 startx, starty, endx, endy; Sint32 x, y; Sint32 dist, min = distMax; - POINT cel; + Point cel; startx = ((initCel.x - distMax / 2) / 2) * 2; endx = ((initCel.x + distMax / 2) / 2) * 2; @@ -3414,13 +3413,13 @@ CDecor::SearchBombeObject ( bool CDecor::SearchElectroObject ( - Sint32 rank, POINT initCel, Sint32 distMax, POINT & foundCel, + Sint32 rank, Point initCel, Sint32 distMax, Point & foundCel, Sint32 & foundIcon) { Sint32 startx, starty, endx, endy; Sint32 x, y, i, d, dd, r; Sint32 dist, min = distMax; - POINT cel; + Point cel; startx = ((initCel.x - 10 / 2) / 2) * 2; endx = ((initCel.x + 10 / 2) / 2) * 2; @@ -3523,10 +3522,10 @@ CDecor::SearchElectroObject ( // Si oui, retourne true. bool -CDecor::IsFireCel (POINT cel) +CDecor::IsFireCel (Point cel) { Sint32 x, y; - POINT test; + Point test; cel.x = (cel.x / 2) * 2; cel.y = (cel.y / 2) * 2; @@ -3555,7 +3554,7 @@ CDecor::IsFireCel (POINT cel) // Si oui, retourne true. bool -CDecor::IsVirusCel (POINT cel) +CDecor::IsVirusCel (Point cel) { Sint32 rank; @@ -3578,9 +3577,9 @@ CDecor::IsVirusCel (POINT cel) // Retourne 0 si c'est possible, ou une erreur autrement ! Errors -CDecor::IsBuildPont (POINT & cel, Sint32 & iconBuild) +CDecor::IsBuildPont (Point & cel, Sint32 & iconBuild) { - POINT vector, test; + Point vector, test; Sint32 i, channel, icon, p1, p2, p3, r1, r2, nb, rest; Errors error = Errors::MISC; @@ -3704,7 +3703,7 @@ CDecor::IsBuildPont (POINT & cel, Sint32 & iconBuild) // d'une cellule donnée (cel). bool -CDecor::IsBuildBateau (POINT cel, Sint32 & direct) +CDecor::IsBuildBateau (Point cel, Sint32 & direct) { Sint32 fChannel, fIcon; Sint32 oChannel, oIcon; @@ -3770,7 +3769,7 @@ CDecor::InitDrapeau () // Mémorise une cellule visitée (ne contenant pas de fer). void -CDecor::AddDrapeau (POINT cel) +CDecor::AddDrapeau (Point cel) { Sint32 i; @@ -3786,7 +3785,7 @@ CDecor::AddDrapeau (POINT cel) // Supprime une cellule visitée (ne contenant pas de fer). void -CDecor::SubDrapeau (POINT cel) +CDecor::SubDrapeau (Point cel) { Sint32 i; @@ -3803,7 +3802,7 @@ CDecor::SubDrapeau (POINT cel) // Teste si une cellule a déjà été visitée. bool -CDecor::TestDrapeau (POINT cel) +CDecor::TestDrapeau (Point cel) { Sint32 i; diff --git a/src/path.cxx b/src/path.cxx index 653bdbd..8b35317 100644 --- a/src/path.cxx +++ b/src/path.cxx @@ -59,7 +59,7 @@ CDecor::CheminMemPos (Sint32 exRank) // Teste si une positiion est occupée par un blupi. bool -CDecor::CheminTestPos (POINT pos, Sint32 & rank) +CDecor::CheminTestPos (Point pos, Sint32 & rank) { Sint32 i; @@ -83,7 +83,7 @@ Sint32 CDecor::CheminARebours (Sint32 rank) { Sint32 pos, rebours, last, dir, set; - POINT v; + Point v; pos = m_blupi[rank].goalCel.y * MAXCELX + m_blupi[rank].goalCel.x; @@ -205,7 +205,7 @@ CDecor::CheminTestDirection ( Sint32 rank, Sint32 pos, Sint32 dir, Sint32 & next, Sint32 & ampli, Sint32 & cout, Sint32 & action) { - POINT cel, vector, newCel; + Point cel, vector, newCel; bool bFree; Sint32 tryDirect, workBlupi, rankHere; @@ -333,10 +333,10 @@ CDecor::CheminCherche (Sint32 rank, Sint32 & action) // Teste s'il est possible de se rendre à un endroit donné. bool -CDecor::IsCheminFree (Sint32 rank, POINT dest, Sint32 button) +CDecor::IsCheminFree (Sint32 rank, Point dest, Sint32 button) { Sint32 action, sDirect; - POINT goalCel, passCel, limit; + Point goalCel, passCel, limit; bool bOK; if (button == BUTTON_STOP) diff --git a/src/pixmap.cxx b/src/pixmap.cxx index 29ab02d..8d0f2d7 100644 --- a/src/pixmap.cxx +++ b/src/pixmap.cxx @@ -89,7 +89,7 @@ CPixmap::~CPixmap () // Retourne false en cas d'erreur. bool -CPixmap::Create (POINT dim) +CPixmap::Create (Point dim) { m_dim = dim; @@ -104,7 +104,7 @@ CPixmap::Create (POINT dim) // Rempli une zone rectangulaire avec une couleur uniforme. void -CPixmap::Fill (RECT rect, COLORREF color) +CPixmap::Fill (Rect rect, ColorRef color) { // � faire si n�cessaire ... } @@ -113,7 +113,7 @@ CPixmap::Fill (RECT rect, COLORREF color) // Les modes sont 0=transparent, 1=opaque. Sint32 -CPixmap::BltFast (Sint32 chDst, size_t channel, POINT dst, RECT rcRect) +CPixmap::BltFast (Sint32 chDst, size_t channel, Point dst, Rect rcRect) { Sint32 res, limit; @@ -177,7 +177,7 @@ CPixmap::BltFast (Sint32 chDst, size_t channel, POINT dst, RECT rcRect) Sint32 CPixmap::BltFast ( - SDL_Texture * lpSDL, size_t channel, POINT dst, RECT rcRect, + SDL_Texture * lpSDL, size_t channel, Point dst, Rect rcRect, SDL_BlendMode mode) { Sint32 res; @@ -232,7 +232,7 @@ CPixmap::ReloadTargetTextures () bool CPixmap::Cache ( - size_t channel, const std::string & pFilename, POINT totalDim, POINT iconDim) + size_t channel, const std::string & pFilename, Point totalDim, Point iconDim) { std::string file = GetBaseDir () + pFilename; SDL_Surface * surface = IMG_Load (file.c_str ()); @@ -291,9 +291,9 @@ CPixmap::Cache ( // Cache une image globale. bool -CPixmap::Cache (size_t channel, const std::string & pFilename, POINT totalDim) +CPixmap::Cache (size_t channel, const std::string & pFilename, Point totalDim) { - POINT iconDim; + Point iconDim; iconDim.x = 0; iconDim.y = 0; @@ -304,7 +304,7 @@ CPixmap::Cache (size_t channel, const std::string & pFilename, POINT totalDim) // Cache une image provenant d'un bitmap. bool -CPixmap::Cache (size_t channel, SDL_Surface * surface, POINT totalDim) +CPixmap::Cache (size_t channel, SDL_Surface * surface, Point totalDim) { // Create the offscreen surface, by loading our bitmap. if ( @@ -327,14 +327,14 @@ CPixmap::Cache (size_t channel, SDL_Surface * surface, POINT totalDim) // Modifie la r�gion de clipping. void -CPixmap::SetClipping (RECT clip) +CPixmap::SetClipping (Rect clip) { m_clipRect = clip; } // Retourne la r�gion de clipping. -RECT +Rect CPixmap::GetClipping () { return m_clipRect; @@ -343,7 +343,7 @@ CPixmap::GetClipping () // Teste si un point fait partie d'une ic�ne. bool -CPixmap::IsIconPixel (size_t channel, Sint32 rank, POINT pos) +CPixmap::IsIconPixel (size_t channel, Sint32 rank, Point pos) { Sint32 nbx, nby; @@ -382,10 +382,10 @@ CPixmap::IsIconPixel (size_t channel, Sint32 rank, POINT pos) bool CPixmap::DrawIcon ( - Sint32 chDst, size_t channel, Sint32 rank, POINT pos, bool bMask) + Sint32 chDst, size_t channel, Sint32 rank, Point pos, bool bMask) { Sint32 nbx, nby; - RECT rect; + Rect rect; auto texInfo = m_SDLTextureInfo.find (channel); if (channel != CHMAP && texInfo == m_SDLTextureInfo.end ()) @@ -420,10 +420,10 @@ CPixmap::DrawIcon ( bool CPixmap::DrawIconDemi ( - Sint32 chDst, size_t channel, Sint32 rank, POINT pos, bool bMask) + Sint32 chDst, size_t channel, Sint32 rank, Point pos, bool bMask) { Sint32 nbx, nby; - RECT rect; + Rect rect; auto texInfo = m_SDLTextureInfo.find (channel); if (texInfo == m_SDLTextureInfo.end ()) @@ -452,11 +452,11 @@ CPixmap::DrawIconDemi ( bool CPixmap::DrawIconPart ( - Sint32 chDst, size_t channel, Sint32 rank, POINT pos, Sint32 startY, + Sint32 chDst, size_t channel, Sint32 rank, Point pos, Sint32 startY, Sint32 endY, bool bMask) { Sint32 nbx, nby; - RECT rect; + Rect rect; auto texInfo = m_SDLTextureInfo.find (channel); if (texInfo == m_SDLTextureInfo.end ()) @@ -486,7 +486,7 @@ CPixmap::DrawIconPart ( bool CPixmap::DrawPart ( - Sint32 chDst, size_t channel, POINT dest, RECT rect, bool bMask) + Sint32 chDst, size_t channel, Point dest, Rect rect, bool bMask) { if (m_SDLTextureInfo.find (channel) == m_SDLTextureInfo.end ()) return false; @@ -497,9 +497,9 @@ CPixmap::DrawPart ( // Dessine une partie d'image rectangulaire. bool -CPixmap::DrawImage (Sint32 chDst, size_t channel, RECT rect) +CPixmap::DrawImage (Sint32 chDst, size_t channel, Rect rect) { - POINT dst; + Point dst; Sint32 res; if (m_SDLTextureInfo.find (channel) == m_SDLTextureInfo.end ()) @@ -527,8 +527,8 @@ CPixmap::BuildIconMask ( Sint32 rankDst) { Sint32 nbx, nby; - POINT posDst, posDstMask; - RECT rect, rectMask; + Point posDst, posDstMask; + Rect rect, rectMask; Sint32 res; auto texInfo = m_SDLTextureInfo.find (channel); @@ -636,11 +636,11 @@ CPixmap::MouseShow (bool bShow) // Retourne le rectangle correspondant au sprite // de la souris dans CHBLUPI. -RECT +Rect CPixmap::MouseRectSprite () { Sint32 rank, nbx; - RECT rcRect; + Rect rcRect; rank = 348; if (m_mouseSprite == SPRITE_ARROW) diff --git a/src/pixmap.h b/src/pixmap.h index a18cd9d..283f566 100644 --- a/src/pixmap.h +++ b/src/pixmap.h @@ -34,8 +34,8 @@ struct TextureInfo { SDL_Texture * texture; bool target; // can be used as a render target std::string file; - POINT dimTotal; - POINT dimIcon; + Point dimTotal; + Point dimIcon; TextureInfo () : texMask (nullptr) @@ -53,30 +53,30 @@ public: CPixmap (); ~CPixmap (); - bool Create (POINT dim); - void Fill (RECT rect, COLORREF color); + bool Create (Point dim); + void Fill (Rect rect, ColorRef color); bool ReloadTargetTextures (); bool Cache ( - size_t channel, const std::string & pFilename, POINT totalDim, - POINT iconDim); - bool Cache (size_t channel, const std::string & pFilename, POINT totalDim); - bool Cache (size_t channel, SDL_Surface * surface, POINT totalDim); - void SetClipping (RECT clip); - RECT GetClipping (); + size_t channel, const std::string & pFilename, Point totalDim, + Point iconDim); + bool Cache (size_t channel, const std::string & pFilename, Point totalDim); + bool Cache (size_t channel, SDL_Surface * surface, Point totalDim); + void SetClipping (Rect clip); + Rect GetClipping (); - bool IsIconPixel (size_t channel, Sint32 rank, POINT pos); + bool IsIconPixel (size_t channel, Sint32 rank, Point pos); bool DrawIcon ( - Sint32 chDst, size_t channel, Sint32 rank, POINT pos, bool bMask = false); + Sint32 chDst, size_t channel, Sint32 rank, Point pos, bool bMask = false); bool DrawIconDemi ( - Sint32 chDst, size_t channel, Sint32 rank, POINT pos, bool bMask = false); + Sint32 chDst, size_t channel, Sint32 rank, Point pos, bool bMask = false); bool DrawIconPart ( - Sint32 chDst, size_t channel, Sint32 rank, POINT pos, Sint32 startY, + Sint32 chDst, size_t channel, Sint32 rank, Point pos, Sint32 startY, Sint32 endY, bool bMask = false); bool DrawPart ( - Sint32 chDst, size_t channel, POINT dest, RECT rect, bool bMask = false); - bool DrawImage (Sint32 chDst, size_t channel, RECT rect); + Sint32 chDst, size_t channel, Point dest, Rect rect, bool bMask = false); + bool DrawImage (Sint32 chDst, size_t channel, Rect rect); bool BuildIconMask ( size_t channelMask, Sint32 rankMask, size_t channel, Sint32 rankSrc, @@ -90,20 +90,20 @@ public: void ChangeSprite (MouseSprites sprite); protected: - Sint32 BltFast (Sint32 chDst, size_t channel, POINT dst, RECT rcRect); + Sint32 BltFast (Sint32 chDst, size_t channel, Point dst, Rect rcRect); Sint32 BltFast ( - SDL_Texture * lpSDL, size_t channel, POINT dst, RECT rcRect, + SDL_Texture * lpSDL, size_t channel, Point dst, Rect rcRect, SDL_BlendMode = SDL_BLENDMODE_BLEND); - RECT MouseRectSprite (); + Rect MouseRectSprite (); SDL_Point GetCursorHotSpot (MouseSprites sprite); SDL_Rect GetCursorRect (MouseSprites sprite); protected: bool m_bDebug; bool m_bPalette; - POINT m_dim; // dimensions totales - RECT m_clipRect; // rectangle de clipping + Point m_dim; // dimensions totales + Rect m_clipRect; // rectangle de clipping MouseSprites m_mouseSprite; bool m_bBackDisplayed; diff --git a/src/progress.cxx b/src/progress.cxx index fd5c2c8..b464b7d 100644 --- a/src/progress.cxx +++ b/src/progress.cxx @@ -44,7 +44,7 @@ CJauge::~CJauge () // Crée un nouveau bouton. bool -CJauge::Create (CPixmap * pPixmap, CSound * pSound, POINT pos, Sint32 type) +CJauge::Create (CPixmap * pPixmap, CSound * pSound, Point pos, Sint32 type) { m_pPixmap = pPixmap; m_pSound = pSound; @@ -64,7 +64,7 @@ void CJauge::Draw () { Sint32 part; - RECT rect; + Rect rect; if (m_bHide) // bouton caché ? { @@ -127,7 +127,7 @@ CJauge::SetHide (bool bHide) m_bHide = bHide; } -POINT +Point CJauge::GetPos () { return m_pos; diff --git a/src/progress.h b/src/progress.h index 538ddd7..478fc2e 100644 --- a/src/progress.h +++ b/src/progress.h @@ -30,7 +30,7 @@ public: CJauge (); ~CJauge (); - bool Create (CPixmap * pPixmap, CSound * pSound, POINT pos, Sint32 type); + bool Create (CPixmap * pPixmap, CSound * pSound, Point pos, Sint32 type); void Draw (); void SetLevel (Sint32 level); @@ -39,15 +39,15 @@ public: bool GetHide (); void SetHide (bool bHide); - POINT GetPos (); + Point GetPos (); protected: CPixmap * m_pPixmap; CDecor * m_pDecor; CSound * m_pSound; bool m_bHide; // true si bouton caché - POINT m_pos; // coin sup/gauche - POINT m_dim; // dimensions + Point m_pos; // coin sup/gauche + Point m_dim; // dimensions Sint32 m_type; Sint32 m_level; }; diff --git a/src/sound.cxx b/src/sound.cxx index 99c96aa..676545e 100644 --- a/src/sound.cxx +++ b/src/sound.cxx @@ -251,7 +251,7 @@ CSound::Play (Sint32 channel, Sint32 volume, Uint8 panLeft, Uint8 panRight) // �ventuellement stopper le dernier son en cours ! bool -CSound::PlayImage (Sounds channel, POINT pos, Sint32 rank) +CSound::PlayImage (Sounds channel, Point pos, Sint32 rank) { Sint32 volumex, volumey, volume; Sounds stopCh; diff --git a/src/sound.h b/src/sound.h index 4bbd9cc..e238b2a 100644 --- a/src/sound.h +++ b/src/sound.h @@ -54,7 +54,7 @@ public: bool Play ( Sint32 channel, Sint32 volume = 0, Uint8 panLeft = 255, Uint8 panRight = 255); - bool PlayImage (Sounds channel, POINT pos, Sint32 rank = -1); + bool PlayImage (Sounds channel, Point pos, Sint32 rank = -1); bool PlayMusic (const std::string & lpszMIDIFilename); bool RestartMusic (); void SuspendMusic (); diff --git a/src/text.cxx b/src/text.cxx index b0098f7..b98a7cc 100644 --- a/src/text.cxx +++ b/src/text.cxx @@ -108,7 +108,7 @@ GetCharWidth (const char *& c, Sint32 font) * \param[in] font - The font style (little or normal). */ void -DrawText (CPixmap * pPixmap, POINT pos, const char * pText, Sint32 font) +DrawText (CPixmap * pPixmap, Point pos, const char * pText, Sint32 font) { Sint32 rank; @@ -133,7 +133,7 @@ DrawText (CPixmap * pPixmap, POINT pos, const char * pText, Sint32 font) void DrawTextPente ( - CPixmap * pPixmap, POINT pos, const char * pText, Sint32 pente, Sint32 font) + CPixmap * pPixmap, Point pos, const char * pText, Sint32 pente, Sint32 font) { Sint32 rank, lg, rel, start; @@ -160,7 +160,7 @@ DrawTextPente ( void DrawTextRect ( - CPixmap * pPixmap, POINT pos, char * pText, Sint32 pente, Sint32 font, + CPixmap * pPixmap, Point pos, char * pText, Sint32 pente, Sint32 font, Sint32 part) { char text[100]; @@ -216,12 +216,12 @@ DrawTextRect ( // contenir plusieurs lignes séparées par des '\n'. void -DrawTextCenter (CPixmap * pPixmap, POINT pos, const char * pText, Sint32 font) +DrawTextCenter (CPixmap * pPixmap, Point pos, const char * pText, Sint32 font) { char text[100]; char * pDest; Sint32 itl; - POINT start; + Point start; if (font == FONTLITTLE) itl = DIMLITTLEY; @@ -337,12 +337,12 @@ GetBignumInfo (Sint32 num, Sint32 & start, Sint32 & lg) // Affiche un grand nombre. void -DrawBignum (CPixmap * pPixmap, POINT pos, Sint32 num) +DrawBignum (CPixmap * pPixmap, Point pos, Sint32 num) { char string[10]; Sint32 i = 0; Sint32 start, lg; - RECT rect; + Rect rect; snprintf (string, sizeof (string), "%d", num); diff --git a/src/text.h b/src/text.h index 9e67400..199de55 100644 --- a/src/text.h +++ b/src/text.h @@ -28,20 +28,20 @@ // clang-format on void -DrawText (CPixmap * pPixmap, POINT pos, const char * pText, Sint32 font = 0); +DrawText (CPixmap * pPixmap, Point pos, const char * pText, Sint32 font = 0); void DrawTextPente ( - CPixmap * pPixmap, POINT pos, const char * pText, Sint32 pente, + CPixmap * pPixmap, Point pos, const char * pText, Sint32 pente, Sint32 font = 0); void DrawTextRect ( - CPixmap * pPixmap, POINT pos, char * pText, Sint32 pente, Sint32 font = 0, + CPixmap * pPixmap, Point pos, char * pText, Sint32 pente, Sint32 font = 0, Sint32 part = -1); void DrawTextCenter ( - CPixmap * pPixmap, POINT pos, const char * pText, Sint32 font = 0); + CPixmap * pPixmap, Point pos, const char * pText, Sint32 font = 0); Sint32 GetTextHeight (char * pText, Sint32 font = 0, Sint32 part = -1); Sint32 GetTextWidth (const char * pText, Sint32 font = 0); -void DrawBignum (CPixmap * pPixmap, POINT pos, Sint32 num); +void DrawBignum (CPixmap * pPixmap, Point pos, Sint32 num); Sint32 GetBignumWidth (Sint32 num);