mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Fixed: MattKing's change to RANDOM to fix issue where it was only random once.
This commit is contained in:
parent
ed07f986fc
commit
2dbf79c6e6
@ -25,6 +25,7 @@
|
|||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
hqStrMap* CMeasureCalc::c_VarMap = NULL;
|
hqStrMap* CMeasureCalc::c_VarMap = NULL;
|
||||||
|
bool CMeasureCalc::c_RandSeeded = false;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** CMeasureCalc
|
** CMeasureCalc
|
||||||
@ -34,10 +35,15 @@ hqStrMap* CMeasureCalc::c_VarMap = NULL;
|
|||||||
*/
|
*/
|
||||||
CMeasureCalc::CMeasureCalc(CMeterWindow* meterWindow) : CMeasure(meterWindow)
|
CMeasureCalc::CMeasureCalc(CMeterWindow* meterWindow) : CMeasure(meterWindow)
|
||||||
{
|
{
|
||||||
m_Parser = MathParser_Create(NULL);
|
if(!c_RandSeeded)
|
||||||
srand((unsigned)time(0));
|
{
|
||||||
rand();
|
c_RandSeeded = true;
|
||||||
|
srand((unsigned)time(0));
|
||||||
|
}
|
||||||
|
|
||||||
|
m_Parser = MathParser_Create(NULL);
|
||||||
|
|
||||||
|
rand();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -147,6 +153,7 @@ void CMeasureCalc::RandomFormulaReplace()
|
|||||||
while(loc > -1)
|
while(loc > -1)
|
||||||
{
|
{
|
||||||
int range = (m_HighBound - m_LowBound);
|
int range = (m_HighBound - m_LowBound);
|
||||||
|
srand((unsigned) rand());
|
||||||
int randNumber = m_LowBound + (range * rand()/(RAND_MAX + 1.0));
|
int randNumber = m_LowBound + (range * rand()/(RAND_MAX + 1.0));
|
||||||
|
|
||||||
std::wstring randomNumberString= (L"");
|
std::wstring randomNumberString= (L"");
|
||||||
|
@ -40,6 +40,7 @@ private:
|
|||||||
hqMathParser* m_Parser;
|
hqMathParser* m_Parser;
|
||||||
|
|
||||||
static hqStrMap* c_VarMap;
|
static hqStrMap* c_VarMap;
|
||||||
|
static bool c_RandSeeded;
|
||||||
|
|
||||||
int m_UpdateRandom;
|
int m_UpdateRandom;
|
||||||
int m_LowBound;
|
int m_LowBound;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user