From 8dd4143614ffa1a309f07f0b1a19921955f9c3f5 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 12 Mar 2019 13:43:31 +0300 Subject: MirandaG15: warning fixes + massive code cleaning --- plugins/MirandaG15/src/CScreensaverScreen.cpp | 40 ++++++++++++--------------- 1 file changed, 17 insertions(+), 23 deletions(-) (limited to 'plugins/MirandaG15/src/CScreensaverScreen.cpp') diff --git a/plugins/MirandaG15/src/CScreensaverScreen.cpp b/plugins/MirandaG15/src/CScreensaverScreen.cpp index 0ba40da901..492274a2cc 100644 --- a/plugins/MirandaG15/src/CScreensaverScreen.cpp +++ b/plugins/MirandaG15/src/CScreensaverScreen.cpp @@ -5,8 +5,7 @@ //************************************************************************ // Constructor //************************************************************************ -CScreensaverScreen::CScreensaverScreen() : m_dwActivation(0), - m_dwDuration(0), m_iPosition(0) +CScreensaverScreen::CScreensaverScreen() { } @@ -22,7 +21,7 @@ CScreensaverScreen::~CScreensaverScreen() //************************************************************************ bool CScreensaverScreen::Initialize() { - if(!CScreen::Initialize()) + if (!CScreen::Initialize()) return false; m_Label.Initialize(); @@ -34,24 +33,21 @@ bool CScreensaverScreen::Initialize() m_Label.SetFontFaceName(L"Microsoft Sans Serif"); m_Label.SetFontPointSize(10); m_Label.SetFontWeight(FW_BOLD); - + m_Label2.SetAlignment(DT_CENTER); m_Label2.SetWordWrap(TRUE); m_Label2.SetText(L""); m_Label2.SetFontFaceName(L"Microsoft Sans Serif"); m_Label2.SetFontPointSize(8); - m_Label.SetOrigin(0,0); - m_Label.SetSize(GetWidth(),20); + m_Label.SetOrigin(0, 0); + m_Label.SetSize(GetWidth(), 20); - m_Label2.SetOrigin(0,23); - m_Label2.SetSize(GetWidth(),20); - - + m_Label2.SetOrigin(0, 23); + m_Label2.SetSize(GetWidth(), 20); AddObject(&m_Label); AddObject(&m_Label2); - return true; } @@ -60,7 +56,7 @@ bool CScreensaverScreen::Initialize() //************************************************************************ bool CScreensaverScreen::Shutdown() { - if(!CScreen::Shutdown()) + if (!CScreen::Shutdown()) return false; return true; @@ -71,19 +67,17 @@ bool CScreensaverScreen::Shutdown() //************************************************************************ bool CScreensaverScreen::Update() { - if(!CScreen::Update()) + if (!CScreen::Update()) return false; DWORD dwTimeElapsed = GetTickCount() - m_dwActivation; int iOldPosition = m_iPosition; - if(dwTimeElapsed > m_dwDuration) - { + if (dwTimeElapsed > m_dwDuration) { m_dwDuration = 4000; m_Label.SetText(L""); m_Label2.SetText(L""); - switch(m_iPosition) - { + switch (m_iPosition) { case 0: m_Label.SetFontPointSize(8); m_Label.SetText(L"MirandaG15"); @@ -97,7 +91,7 @@ bool CScreensaverScreen::Update() m_dwDuration = 1800; m_iPosition = -1; break; - + default: CAppletManager::GetInstance()->ActivateEventScreen(); return true; @@ -105,10 +99,10 @@ bool CScreensaverScreen::Update() m_iPosition++; CAppletManager::GetInstance()->StartTransition(TRANSITION_MORPH); } - - if(m_iPosition != iOldPosition) + + if (m_iPosition != iOldPosition) m_dwActivation = GetTickCount(); - + return true; } @@ -119,7 +113,7 @@ void CScreensaverScreen::Reset() { m_dwDuration = 0; m_iPosition = 0; - + m_Label.SetFontPointSize(10); m_Label.SetText(L""); @@ -134,7 +128,7 @@ void CScreensaverScreen::Reset() //************************************************************************ bool CScreensaverScreen::Draw(CLCDGfx *pGfx) { - if(!CScreen::Draw(pGfx)) + if (!CScreen::Draw(pGfx)) return false; return true; -- cgit v1.2.3