mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
PerfMon.dll: Fixed issues with MaxValue
This commit is contained in:
parent
10da9bea0e
commit
56679f0922
@ -183,6 +183,8 @@ void CMeasurePlugin::ReadConfig(CConfigParser& parser, const WCHAR* section)
|
||||
// Remove current directory from DLL search path
|
||||
SetDllDirectory(L"");
|
||||
|
||||
double maxValue;
|
||||
|
||||
if (IsNewApi())
|
||||
{
|
||||
m_PluginData = (void*)id;
|
||||
@ -192,7 +194,7 @@ void CMeasurePlugin::ReadConfig(CConfigParser& parser, const WCHAR* section)
|
||||
((NEWINITIALIZE)initializeFunc)(&m_PluginData, this);
|
||||
}
|
||||
|
||||
((NEWRELOAD)m_ReloadFunc)(m_PluginData, this, &m_MaxValue);
|
||||
((NEWRELOAD)m_ReloadFunc)(m_PluginData, this, &maxValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -204,24 +206,24 @@ void CMeasurePlugin::ReadConfig(CConfigParser& parser, const WCHAR* section)
|
||||
m_Update2 = true;
|
||||
}
|
||||
|
||||
double oldMaxValue = m_MaxValue;
|
||||
|
||||
if (initializeFunc)
|
||||
{
|
||||
m_MaxValue = ((INITIALIZE)initializeFunc)(m_Plugin, parser.GetFilename().c_str(), section, m_ID);
|
||||
}
|
||||
|
||||
const std::wstring& szMaxValue = parser.ReadString(section, L"MaxValue", L"");
|
||||
if (!szMaxValue.empty())
|
||||
{
|
||||
m_MaxValue = oldMaxValue;
|
||||
maxValue = ((INITIALIZE)initializeFunc)(m_Plugin, parser.GetFilename().c_str(), section, m_ID);
|
||||
}
|
||||
}
|
||||
|
||||
if (m_MaxValue == 0.0)
|
||||
const std::wstring& szMaxValue = parser.ReadString(section, L"MaxValue", L"");
|
||||
if (szMaxValue.empty())
|
||||
{
|
||||
m_MaxValue = 1.0;
|
||||
m_LogMaxValue = true;
|
||||
if (maxValue == 0.0)
|
||||
{
|
||||
m_MaxValue = 1.0;
|
||||
m_LogMaxValue = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_MaxValue = maxValue;
|
||||
}
|
||||
}
|
||||
|
||||
// Reset to default
|
||||
|
@ -90,9 +90,8 @@ PLUGIN_EXPORT void Reload(void* data, void* rm, double* maxValue)
|
||||
{
|
||||
measure->oldValue = 0;
|
||||
measure->firstTime = true;
|
||||
*maxValue = 0.0;
|
||||
}
|
||||
|
||||
*maxValue = 0.0;
|
||||
}
|
||||
|
||||
PLUGIN_EXPORT double Update(void* data)
|
||||
|
Loading…
Reference in New Issue
Block a user