From 14428f6d4918eef32b73dd9bc2bc8a7900b24124 Mon Sep 17 00:00:00 2001 From: Mathieu Schroeter Date: Sat, 11 Feb 2017 18:58:56 +0100 Subject: [PATCH] Fix all warnings --- src/button.cpp | 3 ++- src/decmap.cpp | 4 ---- src/decor.cpp | 1 - src/def.h | 23 ++++++++++++----------- src/event.h | 2 +- src/menu.cpp | 5 ----- src/pixmap.cpp | 29 ++--------------------------- 7 files changed, 17 insertions(+), 50 deletions(-) diff --git a/src/button.cpp b/src/button.cpp index 345f6aa..a60bbba 100644 --- a/src/button.cpp +++ b/src/button.cpp @@ -30,6 +30,7 @@ CButton::CButton() m_bMouseDown = false; m_bMinimizeRedraw = false; m_bRedraw = false; + m_message = static_cast (-1); } // Destructeur. @@ -428,7 +429,7 @@ bool CButton::MouseUp(POINT pos) if ( !bDetect ) return false; - if ( m_message != -1 ) + if ( m_message != static_cast (-1) ) { CEvent::PushUserEvent (m_message); } diff --git a/src/decmap.cpp b/src/decmap.cpp index 4204863..90af714 100644 --- a/src/decmap.cpp +++ b/src/decmap.cpp @@ -33,10 +33,6 @@ // Bitmap de la carte. static Uint32 g_map32_bits[DIMMAPY][DIMMAPX]; -static bool g_bPalette; - - - // Initialise les couleurs pour la carte. diff --git a/src/decor.cpp b/src/decor.cpp index 72aa2a9..581aeca 100644 --- a/src/decor.cpp +++ b/src/decor.cpp @@ -3013,7 +3013,6 @@ void CDecor::CelHiliRepeat(int list) const char *CDecor::GetResHili(POINT posMouse) { int icon; - const char *res = nullptr; // Les valeurs `corner == true` correspondent aux objets placés // au coin inf/droit de la cellule. diff --git a/src/def.h b/src/def.h index 2bb32d1..8cb51ed 100644 --- a/src/def.h +++ b/src/def.h @@ -79,17 +79,18 @@ #define DIRECT_N (6*16) // nord #define DIRECT_NE (7*16) // nord-est -// NO -// O | N -// \ | / -// \ | / -// \|/ -// SO -------o------- NE -// /|\ -// / | \ -// / | \ -// S | E -// (y) SE (x) +/* NO + * O | N + * \ | / + * \ | / + * \|/ + * SO -------o------- NE + * /|\ + * / | \ + * / | \ + * S | E + * (y) SE (x) + */ // Actions : diff --git a/src/event.h b/src/event.h index 57ed4d3..c8ea970 100644 --- a/src/event.h +++ b/src/event.h @@ -152,7 +152,7 @@ protected: int m_mission; int m_private; int m_maxMission; - int m_phase; + unsigned int m_phase; int m_index; bool m_bSchool; bool m_bPrivate; diff --git a/src/menu.cpp b/src/menu.cpp index 286d58c..c57c302 100644 --- a/src/menu.cpp +++ b/src/menu.cpp @@ -215,8 +215,6 @@ void CMenu::Draw() int i, state, icon; POINT pos; RECT oldClip, clipRect; - bool bLeft = true; - bool bRight = true; char text[50]; char* pText; @@ -229,9 +227,6 @@ void CMenu::Draw() clipRect.bottom = POSDRAWY+DIMDRAWY; m_pPixmap->SetClipping(clipRect); - if ( m_pos.x-150 < POSDRAWX ) bLeft = false; - if ( m_pos.x+m_dim.x+150 > POSDRAWX+DIMDRAWX ) bRight = false; - for ( i=0 ; i= MAXIMAGE ) return false; if ( channel != CHMAP && m_lpSDLTexture[channel] == nullptr ) return false; @@ -352,9 +351,6 @@ bool CPixmap::DrawIcon(int chDst, int channel, int rank, POINT pos, bool bMask) rect.right = rect.left + m_iconDim[channel].x; rect.bottom = rect.top + m_iconDim[channel].y; - oldColor1 = m_colorSurface[2*channel+0]; - oldColor2 = m_colorSurface[2*channel+1]; - return !BltFast (chDst, channel, pos, rect); } @@ -372,7 +368,6 @@ bool CPixmap::DrawIconDemi(int chDst, int channel, int rank, POINT pos, bool bMa { int nbx, nby; RECT rect; - COLORREF oldColor1, oldColor2; if ( channel < 0 || channel >= MAXIMAGE ) return false; if (m_lpSDLTexture[channel] == nullptr ) return false; @@ -392,9 +387,6 @@ bool CPixmap::DrawIconDemi(int chDst, int channel, int rank, POINT pos, bool bMa rect.right = rect.left + m_iconDim[channel].x; rect.bottom = rect.top +(m_iconDim[channel].y/2); - oldColor1 = m_colorSurface[2*channel+0]; - oldColor2 = m_colorSurface[2*channel+1]; - return !BltFast (chDst, channel, pos, rect); } @@ -405,7 +397,6 @@ bool CPixmap::DrawIconPart(int chDst, int channel, int rank, POINT pos, { int nbx, nby; RECT rect; - COLORREF oldColor1, oldColor2; if ( channel < 0 || channel >= MAXIMAGE ) return false; if (m_lpSDLTexture[channel] == nullptr ) return false; @@ -426,9 +417,6 @@ bool CPixmap::DrawIconPart(int chDst, int channel, int rank, POINT pos, pos.y += startY; rect.top += startY; - oldColor1 = m_colorSurface[2*channel+0]; - oldColor2 = m_colorSurface[2*channel+1]; - return !BltFast (chDst, channel, pos, rect); } @@ -436,14 +424,9 @@ bool CPixmap::DrawIconPart(int chDst, int channel, int rank, POINT pos, bool CPixmap::DrawPart(int chDst, int channel, POINT dest, RECT rect, bool bMask) { - COLORREF oldColor1, oldColor2; - if ( channel < 0 || channel >= MAXIMAGE ) return false; if (m_lpSDLTexture[channel] == nullptr ) return false; - oldColor1 = m_colorSurface[2*channel+0]; - oldColor2 = m_colorSurface[2*channel+1]; - return !BltFast (chDst, channel, dest, rect); } @@ -529,15 +512,7 @@ bool CPixmap::BuildIconMask(int channelMask, int rankMask, bool CPixmap::Display() { - RECT MapRect; - m_bBackDisplayed = true; - - MapRect.left = 0; - MapRect.top = 0; - MapRect.right = m_dim.x; - MapRect.bottom = m_dim.y; - SDL_RenderPresent (g_renderer); return true; }