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

Initialize all members in the constructors

This commit is contained in:
Mathieu Schroeter 2017-02-23 19:57:41 +01:00
parent 10ba73ea0a
commit b4aec1fb46
6 changed files with 32 additions and 7 deletions

View File

@ -24,6 +24,10 @@ CButton::CButton()
m_selMenu = 0;
m_bMouseDown = false;
m_message = static_cast<Uint32> (-1);
m_pPixmap = nullptr;
m_pDecor = nullptr;
m_pSound = nullptr;
m_toolTips = nullptr;
}
CButton::~CButton () {}

View File

@ -1494,6 +1494,19 @@ CEvent::CEvent()
m_demoTime = 0;
m_keymod = 0;
m_posHelpButton = {-1, -1};
m_pPixmap = nullptr;
m_pDecor = nullptr;
m_pSound = nullptr;
m_pMovie = nullptr;
m_bMenu = false;
m_bHili = false;
m_demoIndex = 0;
m_demoEnd = 0;
m_bHiliInfoButton = false;
m_bHiliHelpButton = false;
memset (m_textToolTips, 0, sizeof (m_textToolTips));
memset (m_libelle, 0, sizeof (m_libelle));
for (i = 0 ; i < MAXBUTTON ; i++)
m_lastFloor[i] = 0;
@ -5290,4 +5303,3 @@ void CEvent::PushUserEvent (Sint32 code)
SDL_PushEvent (&event);
}

View File

@ -11,8 +11,11 @@
CJauge::CJauge()
{
m_type = 0;
m_bHide = true;
m_type = 0;
m_bHide = true;
m_pPixmap = nullptr;
m_pDecor = nullptr;
m_pSound = nullptr;
}
CJauge::~CJauge()
@ -105,4 +108,3 @@ POINT CJauge::GetPos()
{
return m_pos;
}

View File

@ -127,7 +127,10 @@ static const char *GetErr (Sint32 rank)
CMenu::CMenu()
{
m_nbButtons = 0;
m_selRank = -1;
m_selRank = -1;
m_pPixmap = nullptr;
m_pDecor = nullptr;
m_pSound = nullptr;
}
// Destructeur.
@ -503,5 +506,3 @@ void CMenu::Message()
if (m_selRank != -1)
CEvent::PushUserEvent (WM_BUTTON0 + m_selRank);
}

View File

@ -145,6 +145,8 @@ CMovie::CMovie()
m_videoTex = nullptr;
pinfo = nullptr;
memset (m_audiobuf, 0, sizeof (m_audiobuf));
m_ret = 0;
}

View File

@ -36,6 +36,10 @@ CPixmap::CPixmap()
m_mouseSprite = SPRITE_WAIT;
m_bBackDisplayed = false;
m_lpSDLBlupi = nullptr;
memset (m_filename, 0, sizeof (m_filename));
for (i = 0; i < MAXCURSORS; i++)
m_lpSDLCursors[i] = nullptr;