mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-28 21:07:59 +03:00
fix threading issue when dispatching frame dependent data
This commit is contained in:
parent
c7449dc272
commit
acc209c294
6 changed files with 34 additions and 34 deletions
|
@ -87,6 +87,7 @@ namespace fx
|
|||
mValueLabel->setCaption(std::to_string(mValue));
|
||||
|
||||
float range = 0.f;
|
||||
float min = 0.f;
|
||||
|
||||
if (auto uniform = mUniform.lock())
|
||||
{
|
||||
|
@ -94,6 +95,7 @@ namespace fx
|
|||
{
|
||||
uniform->template setValue<UType>(mValue);
|
||||
range = uniform->template getMax<UType>() - uniform->template getMin<UType>();
|
||||
min = uniform->template getMin<UType>();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -101,10 +103,11 @@ namespace fx
|
|||
uvalue[mIndex] = mValue;
|
||||
uniform->template setValue<UType>(uvalue);
|
||||
range = uniform->template getMax<UType>()[mIndex] - uniform->template getMin<UType>()[mIndex];
|
||||
min = uniform->template getMin<UType>()[mIndex];
|
||||
}
|
||||
}
|
||||
|
||||
float fill = (range == 0.f) ? 1.f : mValue / range;
|
||||
float fill = (range == 0.f) ? 1.f : (mValue - min) / range;
|
||||
mFill->setRealSize(fill, 1.0);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue