mirror of https://github.com/AxioDL/metaforce.git
CIntElement: Simplify CIEKeyframeEmitter's GetMaxValue()
We can just use std::max_element here to collapse the loop into an assignment.
This commit is contained in:
parent
af0c2c41e3
commit
3407a59ad7
|
@ -1,5 +1,7 @@
|
||||||
#include "Runtime/Particle/CIntElement.hpp"
|
#include "Runtime/Particle/CIntElement.hpp"
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
#include "Runtime/CRandom16.hpp"
|
#include "Runtime/CRandom16.hpp"
|
||||||
#include "Runtime/Particle/CElementGen.hpp"
|
#include "Runtime/Particle/CElementGen.hpp"
|
||||||
#include "Runtime/Particle/CGenDescription.hpp"
|
#include "Runtime/Particle/CGenDescription.hpp"
|
||||||
|
@ -52,11 +54,7 @@ bool CIEKeyframeEmitter::GetValue(int frame, int& valOut) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
int CIEKeyframeEmitter::GetMaxValue() const {
|
int CIEKeyframeEmitter::GetMaxValue() const {
|
||||||
int maxVal = INT_MIN;
|
return *std::max_element(x18_keys.cbegin(), x18_keys.cend());
|
||||||
for (int k : x18_keys)
|
|
||||||
if (k > maxVal)
|
|
||||||
maxVal = k;
|
|
||||||
return maxVal;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CIEDeath::GetValue(int frame, int& valOut) const {
|
bool CIEDeath::GetValue(int frame, int& valOut) const {
|
||||||
|
|
Loading…
Reference in New Issue