summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/chunk.hpp1
-rw-r--r--src/hole-cut.cpp1
-rw-r--r--src/hole-cut.hpp22
-rw-r--r--src/hole.hpp15
-rw-r--r--test/hole.cpp1
5 files changed, 25 insertions, 15 deletions
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 <type_traits>
#include <array>
#include <Corrade/Containers/Array.h>
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 <mg/Functions.h>
#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 <mg/Vector2.h>
+#include <Magnum/DimensionTraits.h>
+
+namespace floormat {
+
+template<typename T>
+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<rect, 8> 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<typename T>
-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<rect, 8> array;
- uint8_t size = 0;
- bool found = false;
-};
-
} // namespace floormat
diff --git a/test/hole.cpp b/test/hole.cpp
index 7ccc86c3..ade06a9c 100644
--- a/test/hole.cpp
+++ b/test/hole.cpp
@@ -1,5 +1,6 @@
#include "app.hpp"
#include "src/hole.hpp"
+#include "src/hole-cut.hpp"
namespace floormat {
namespace {