Fixed an issue that UpdateDivider is ignored if DynamicVariables=1 is set.

This commit is contained in:
spx 2010-11-13 19:45:50 +00:00
parent 2c6272e1f4
commit 35d0eeea11
2 changed files with 14 additions and 3 deletions

View File

@ -276,6 +276,8 @@ void CMeter::ReadConfig(const WCHAR* section)
parser.SetStyleTemplate(style);
}
UINT oldUpdateDivider = m_UpdateDivider;
std::wstring oldStyleX = m_StyleX;
std::wstring oldStyleY = m_StyleY;
std::wstring oldStyleHidden = m_StyleHidden;
@ -410,7 +412,6 @@ void CMeter::ReadConfig(const WCHAR* section)
m_MeasureName = parser.ReadString(section, L"MeasureName", L"");
m_UpdateDivider = parser.ReadInt(section, L"UpdateDivider", 1);
m_UpdateCounter = m_UpdateDivider;
m_AntiAlias = 0!=parser.ReadInt(section, L"AntiAlias", 0);
m_DynamicVariables = 0!=parser.ReadInt(section, L"DynamicVariables", 0);
@ -427,6 +428,12 @@ void CMeter::ReadConfig(const WCHAR* section)
std::wstring group = parser.ReadString(section, L"Group", L"");
InitializeGroup(group);
if (!m_Initialized ||
oldUpdateDivider != m_UpdateDivider)
{
m_UpdateCounter = m_UpdateDivider;
}
/* Are these necessary?
if (m_W == 0 || m_H == 0)
{

View File

@ -2443,6 +2443,7 @@ void CMeterWindow::Update(bool nodraw)
// Update the meters
bool bActiveTransition = false;
bool bUpdate = false;
std::list<CMeter*>::const_iterator j = m_Meters.begin();
for( ; j != m_Meters.end(); ++j)
{
@ -2453,7 +2454,10 @@ void CMeterWindow::Update(bool nodraw)
(*j)->ReadConfig((*j)->GetName());
m_Parser.ClearStyleTemplate();
}
(*j)->Update();
if ((*j)->Update())
{
bUpdate = true;
}
}
catch (CError& error)
{
@ -2480,7 +2484,7 @@ void CMeterWindow::Update(bool nodraw)
}
}
if (!nodraw)
if (!nodraw && (m_Refreshing || bUpdate))
{
if (m_DynamicWindowSize)
{