Commit ff940612 authored by Lioncache's avatar Lioncache

CIntElement: Make use of std::clamp within CIEClamp's overrides

Same behavior, less code.
parent 3407a59a
......@@ -72,26 +72,17 @@ bool CIEClamp::GetValue(int frame, int& valOut) const {
x4_min->GetValue(frame, a);
x8_max->GetValue(frame, b);
xc_val->GetValue(frame, valOut);
if (valOut > b)
valOut = b;
if (valOut < a)
valOut = a;
valOut = std::clamp(valOut, a, b);
return false;
}
int CIEClamp::GetMaxValue() const {
const int a = x4_min->GetMaxValue();
const int b = x8_max->GetMaxValue();
int valOut = xc_val->GetMaxValue();
if (valOut > b) {
valOut = b;
}
if (valOut < a) {
valOut = a;
}
const int valOut = xc_val->GetMaxValue();
return valOut;
return std::clamp(valOut, a, b);
}
bool CIETimeChain::GetValue(int frame, int& valOut) const {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment