From 995e52435698c5b4bd3f429023915e2628d4ad97 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 12 Aug 2024 12:14:04 +0200 Subject: src/hole: add unsigned integral value support --- src/hole-cut.cpp | 5 +++-- src/hole-cut.hpp | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src') 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 Cr CutResult::cutʹ(Vec2 r0, Vec2 r1, Vec2 h0, Vec2 h return cut_rectangleʹ(r0, r1, h0, h1, s); } -template Cr CutResult::cut(bbox input, bbox hole) { return cut_rectangle(input, hole); } +template Cr CutResult::cut(bbox input, bbox hole) requires std::is_signed_v { return cut_rectangle(input, hole); } template Cr CutResult::cut(Vec2 r0, Vec2 r1, Vec2 h0, Vec2 h1) { return cut_rectangle(r0, r1, h0, h1); } template bool CutResult::found() const { return s != (uint8_t)-1; } -template struct CutResult; +template struct CutResult; +template struct CutResult; template struct CutResult; } // 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; 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); -- cgit v1.2.3