diff options
| author | Stanislaw Halik <sthalik@misaki.pl> | 2024-08-12 12:14:04 +0200 |
|---|---|---|
| committer | Stanislaw Halik <sthalik@misaki.pl> | 2024-09-20 16:08:43 +0200 |
| commit | 995e52435698c5b4bd3f429023915e2628d4ad97 (patch) | |
| tree | 5fb707a11bd13be142e9169c3e93c4402e340e46 /src | |
| parent | ce73ff2c30c90be7be37482e26509243f4bcee5d (diff) | |
src/hole: add unsigned integral value support
Diffstat (limited to 'src')
| -rw-r--r-- | src/hole-cut.cpp | 5 | ||||
| -rw-r--r-- | src/hole-cut.hpp | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/hole-cut.cpp b/src/hole-cut.cpp index 0b6d1bd1..70f4ad34 100644 --- a/src/hole-cut.cpp +++ b/src/hole-cut.cpp @@ -213,12 +213,13 @@ template<typename T> Cr<T> CutResult<T>::cutʹ(Vec2 r0, Vec2 r1, Vec2 h0, Vec2 h return cut_rectangleʹ<T>(r0, r1, h0, h1, s); } -template<typename T> Cr<T> CutResult<T>::cut(bbox input, bbox hole) { return cut_rectangle<T>(input, hole); } +template<typename T> Cr<T> CutResult<T>::cut(bbox input, bbox hole) requires std::is_signed_v<T> { return cut_rectangle<T>(input, hole); } template<typename T> Cr<T> CutResult<T>::cut(Vec2 r0, Vec2 r1, Vec2 h0, Vec2 h1) { return cut_rectangle<T>(r0, r1, h0, h1); } template<typename T> bool CutResult<T>::found() const { return s != (uint8_t)-1; } -template struct CutResult<Int>; +template struct CutResult<uint32_t>; +template struct CutResult<int32_t>; template struct CutResult<float>; } // namespace floormat diff --git a/src/hole-cut.hpp b/src/hole-cut.hpp index 6f4d5876..4ec5c168 100644 --- a/src/hole-cut.hpp +++ b/src/hole-cut.hpp @@ -12,7 +12,7 @@ struct CutResult struct bbox { Vec2 position; Vector2ub bbox_size; }; struct rect { Vec2 min, max; }; - static CutResult cut(bbox input, bbox hole); + static CutResult cut(bbox input, bbox hole) requires std::is_signed_v<T>; static CutResult cut(Vec2 r0, Vec2 r1, Vec2 h0, Vec2 h1); static CutResult cutʹ(Vec2 r0, Vec2 r1, Vec2 h0, Vec2 h1, uint8_t s); |
