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

Fix all warnings

This commit is contained in:
Mathieu Schroeter 2017-02-11 18:58:56 +01:00
parent edcd2c36cb
commit 14428f6d49
7 changed files with 17 additions and 50 deletions

View File

@ -30,6 +30,7 @@ CButton::CButton()
m_bMouseDown = false; m_bMouseDown = false;
m_bMinimizeRedraw = false; m_bMinimizeRedraw = false;
m_bRedraw = false; m_bRedraw = false;
m_message = static_cast<unsigned int> (-1);
} }
// Destructeur. // Destructeur.
@ -428,7 +429,7 @@ bool CButton::MouseUp(POINT pos)
if ( !bDetect ) return false; if ( !bDetect ) return false;
if ( m_message != -1 ) if ( m_message != static_cast<unsigned int> (-1) )
{ {
CEvent::PushUserEvent (m_message); CEvent::PushUserEvent (m_message);
} }

View File

@ -33,10 +33,6 @@
// Bitmap de la carte. // Bitmap de la carte.
static Uint32 g_map32_bits[DIMMAPY][DIMMAPX]; static Uint32 g_map32_bits[DIMMAPY][DIMMAPX];
static bool g_bPalette;
// Initialise les couleurs pour la carte. // Initialise les couleurs pour la carte.

View File

@ -3013,7 +3013,6 @@ void CDecor::CelHiliRepeat(int list)
const char *CDecor::GetResHili(POINT posMouse) const char *CDecor::GetResHili(POINT posMouse)
{ {
int icon; int icon;
const char *res = nullptr;
// Les valeurs `corner == true` correspondent aux objets placés // Les valeurs `corner == true` correspondent aux objets placés
// au coin inf/droit de la cellule. // au coin inf/droit de la cellule.

View File

@ -79,17 +79,18 @@
#define DIRECT_N (6*16) // nord #define DIRECT_N (6*16) // nord
#define DIRECT_NE (7*16) // nord-est #define DIRECT_NE (7*16) // nord-est
// NO /* NO
// O | N * O | N
// \ | / * \ | /
// \ | / * \ | /
// \|/ * \|/
// SO -------o------- NE * SO -------o------- NE
// /|\ * /|\
// / | \ * / | \
// / | \ * / | \
// S | E * S | E
// (y) SE (x) * (y) SE (x)
*/
// Actions : // Actions :

View File

@ -152,7 +152,7 @@ protected:
int m_mission; int m_mission;
int m_private; int m_private;
int m_maxMission; int m_maxMission;
int m_phase; unsigned int m_phase;
int m_index; int m_index;
bool m_bSchool; bool m_bSchool;
bool m_bPrivate; bool m_bPrivate;

View File

@ -215,8 +215,6 @@ void CMenu::Draw()
int i, state, icon; int i, state, icon;
POINT pos; POINT pos;
RECT oldClip, clipRect; RECT oldClip, clipRect;
bool bLeft = true;
bool bRight = true;
char text[50]; char text[50];
char* pText; char* pText;
@ -229,9 +227,6 @@ void CMenu::Draw()
clipRect.bottom = POSDRAWY+DIMDRAWY; clipRect.bottom = POSDRAWY+DIMDRAWY;
m_pPixmap->SetClipping(clipRect); 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<m_nbButtons ; i++ ) for ( i=0 ; i<m_nbButtons ; i++ )
{ {
pos.x = m_pos.x+((i/m_nbCel.y)*(DIMBUTTONX+MARGMENU)); pos.x = m_pos.x+((i/m_nbCel.y)*(DIMBUTTONX+MARGMENU));

View File

@ -268,8 +268,8 @@ bool CPixmap::Cache(int channel, SDL_Surface *surface, POINT totalDim)
m_lpSDLTexture[channel] = SDL_CreateTextureFromSurface (g_renderer, surface); m_lpSDLTexture[channel] = SDL_CreateTextureFromSurface (g_renderer, surface);
if (m_lpSDLTexture[channel] == nullptr ) if (!m_lpSDLTexture[channel])
return false; return false;
m_totalDim[channel] = totalDim; m_totalDim[channel] = totalDim;
m_iconDim[channel] = totalDim; m_iconDim[channel] = totalDim;
@ -334,7 +334,6 @@ bool CPixmap::DrawIcon(int chDst, int channel, int rank, POINT pos, bool bMask)
{ {
int nbx, nby; int nbx, nby;
RECT rect; RECT rect;
COLORREF oldColor1, oldColor2;
if ( channel < 0 || channel >= MAXIMAGE ) return false; if ( channel < 0 || channel >= MAXIMAGE ) return false;
if ( channel != CHMAP && m_lpSDLTexture[channel] == nullptr ) 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.right = rect.left + m_iconDim[channel].x;
rect.bottom = rect.top + m_iconDim[channel].y; 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); 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; int nbx, nby;
RECT rect; RECT rect;
COLORREF oldColor1, oldColor2;
if ( channel < 0 || channel >= MAXIMAGE ) return false; if ( channel < 0 || channel >= MAXIMAGE ) return false;
if (m_lpSDLTexture[channel] == nullptr ) 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.right = rect.left + m_iconDim[channel].x;
rect.bottom = rect.top +(m_iconDim[channel].y/2); 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); return !BltFast (chDst, channel, pos, rect);
} }
@ -405,7 +397,6 @@ bool CPixmap::DrawIconPart(int chDst, int channel, int rank, POINT pos,
{ {
int nbx, nby; int nbx, nby;
RECT rect; RECT rect;
COLORREF oldColor1, oldColor2;
if ( channel < 0 || channel >= MAXIMAGE ) return false; if ( channel < 0 || channel >= MAXIMAGE ) return false;
if (m_lpSDLTexture[channel] == nullptr ) 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; pos.y += startY;
rect.top += startY; rect.top += startY;
oldColor1 = m_colorSurface[2*channel+0];
oldColor2 = m_colorSurface[2*channel+1];
return !BltFast (chDst, channel, pos, rect); 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) bool CPixmap::DrawPart(int chDst, int channel, POINT dest, RECT rect, bool bMask)
{ {
COLORREF oldColor1, oldColor2;
if ( channel < 0 || channel >= MAXIMAGE ) return false; if ( channel < 0 || channel >= MAXIMAGE ) return false;
if (m_lpSDLTexture[channel] == nullptr ) 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); return !BltFast (chDst, channel, dest, rect);
} }
@ -529,15 +512,7 @@ bool CPixmap::BuildIconMask(int channelMask, int rankMask,
bool CPixmap::Display() bool CPixmap::Display()
{ {
RECT MapRect;
m_bBackDisplayed = true; m_bBackDisplayed = true;
MapRect.left = 0;
MapRect.top = 0;
MapRect.right = m_dim.x;
MapRect.bottom = m_dim.y;
SDL_RenderPresent (g_renderer); SDL_RenderPresent (g_renderer);
return true; return true;
} }