mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-01-31 04:25:40 +00:00
63af859618
Also greatly improved the shader post processing performance and added component dimming support.
36 lines
774 B
C++
36 lines
774 B
C++
// SPDX-License-Identifier: MIT
|
|
//
|
|
// EmulationStation Desktop Edition
|
|
// LambdaAnimation.h
|
|
//
|
|
// Custom animations, expressed as lambdas.
|
|
//
|
|
|
|
#ifndef ES_CORE_ANIMATIONS_LAMBDA_ANIMATION_H
|
|
#define ES_CORE_ANIMATIONS_LAMBDA_ANIMATION_H
|
|
|
|
#include "animations/Animation.h"
|
|
|
|
#include <functional>
|
|
|
|
class LambdaAnimation : public Animation
|
|
{
|
|
public:
|
|
LambdaAnimation(const std::function<void(float t)>& func, int duration)
|
|
: mFunction {func}
|
|
, mDuration {duration}
|
|
{
|
|
}
|
|
|
|
virtual ~LambdaAnimation() = default;
|
|
|
|
int getDuration() const override { return mDuration; }
|
|
void apply(float t) override { mFunction(t); }
|
|
|
|
private:
|
|
std::function<void(float t)> mFunction;
|
|
int mDuration;
|
|
};
|
|
|
|
#endif // ES_CORE_ANIMATIONS_LAMBDA_ANIMATION_H
|