Unify drawing of layers and interactions into "drawables".
This commit is contained in:
@@ -2,31 +2,16 @@
|
||||
|
||||
|
||||
#include "utils.hpp"
|
||||
#include "Drawable.hpp"
|
||||
|
||||
namespace fmri
|
||||
{
|
||||
class Animation
|
||||
class Animation : public Drawable
|
||||
{
|
||||
public:
|
||||
virtual ~Animation() = default;
|
||||
|
||||
virtual void draw(float step) = 0;
|
||||
|
||||
private:
|
||||
static float getAlpha();
|
||||
|
||||
protected:
|
||||
template<typename It>
|
||||
void patchTransparancy(It begin, It end)
|
||||
{
|
||||
if constexpr (std::tuple_size<Color>::value >= 4) {
|
||||
const auto alpha = getAlpha();
|
||||
for (; begin != end; ++begin) {
|
||||
Color &color = *begin;
|
||||
color[3] = alpha;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
float getAlpha() override;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user