From 74a123a9fdf72fa4a2d0322de011d10b69898191 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 28 Jul 2024 08:43:26 +0200 Subject: move out from hole.hpp to hole-cut.hpp Now the latter doesn't require including . --- src/chunk.hpp | 1 + src/hole-cut.cpp | 1 + src/hole-cut.hpp | 22 ++++++++++++++++++++++ src/hole.hpp | 15 --------------- 4 files changed, 24 insertions(+), 15 deletions(-) create mode 100644 src/hole-cut.hpp (limited to 'src') diff --git a/src/chunk.hpp b/src/chunk.hpp index 65730d42..3d3bbe5a 100644 --- a/src/chunk.hpp +++ b/src/chunk.hpp @@ -6,6 +6,7 @@ #include "global-coords.hpp" #include "wall-defs.hpp" #include "search-pred.hpp" +#include "hole-cut.hpp" #include #include #include diff --git a/src/hole-cut.cpp b/src/hole-cut.cpp index 1ecf96ce..e159383f 100644 --- a/src/hole-cut.cpp +++ b/src/hole-cut.cpp @@ -2,6 +2,7 @@ #include "compat/array-size.hpp" #include "compat/iota.hpp" #include "compat/map.hpp" +#include "hole-cut.hpp" //#include #ifdef __GNUG__ diff --git a/src/hole-cut.hpp b/src/hole-cut.hpp new file mode 100644 index 00000000..52eeaf71 --- /dev/null +++ b/src/hole-cut.hpp @@ -0,0 +1,22 @@ +#pragma once +#include +#include + +namespace floormat { + +template +struct CutResult +{ + using Vec2 = VectorTypeFor<2, T>; + struct bbox { Vec2 position; Vector2ub bbox_size; }; + struct rect { Vec2 min, max; }; + + static CutResult cut(bbox input, bbox hole); + static CutResult cut(Vec2 r0, Vec2 r1, Vec2 h0, Vec2 h1); + + std::array array; + uint8_t size = 0; + bool found = false; +}; + +} // namespace floormat diff --git a/src/hole.hpp b/src/hole.hpp index 35fd29d9..927c2b61 100644 --- a/src/hole.hpp +++ b/src/hole.hpp @@ -57,19 +57,4 @@ private: void maybe_mark_neighbor_chunks_modified() override; }; -template -struct CutResult -{ - using Vec2 = VectorTypeFor<2, T>; - struct bbox { Vec2 position; Vector2ub bbox_size; }; - struct rect { Vec2 min, max; }; - - static CutResult cut(bbox input, bbox hole); - static CutResult cut(Vec2 r0, Vec2 r1, Vec2 h0, Vec2 h1); - - std::array array; - uint8_t size = 0; - bool found = false; -}; - } // namespace floormat -- cgit v1.2.3