damageRing: move to hyprland impl

A small wlroots utility we were still using.
This commit is contained in:
Vaxry 2024-06-19 18:25:20 +02:00
parent 65f04f265c
commit def5fcb212
6 changed files with 111 additions and 38 deletions

View file

@ -0,0 +1,22 @@
#pragma once
#include "./math/Math.hpp"
#include <array>
constexpr static int DAMAGE_RING_PREVIOUS_LEN = 2;
class CDamageRing {
public:
void setSize(const Vector2D& size_);
bool damage(const CRegion& rg);
void damageEntire();
void rotate();
CRegion getBufferDamage(int age);
bool hasChanged();
private:
Vector2D size;
CRegion current;
std::array<CRegion, DAMAGE_RING_PREVIOUS_LEN> previous;
size_t previousIdx = 0;
};