summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-10-06 11:00:37 +0200
committerStanislaw Halik <sthalik@misaki.pl>2023-10-06 11:00:37 +0200
commita1fc32ebc9507965a241e5d177d5f9d9693b3e1d (patch)
tree580edb25eeb9bb7f13fff6a47e516efa1ee84f54
parent39295e50d6523cb00ac3f598d18c1e9bbdf42dcd (diff)
a
-rw-r--r--floormat/main.hpp2
-rw-r--r--main/main-impl.cpp3
-rw-r--r--main/main-impl.hpp5
-rw-r--r--src/path-search.hpp6
4 files changed, 11 insertions, 5 deletions
diff --git a/floormat/main.hpp b/floormat/main.hpp
index 55b398d2..89d833d3 100644
--- a/floormat/main.hpp
+++ b/floormat/main.hpp
@@ -22,6 +22,7 @@ struct floor_mesh;
struct wall_mesh;
struct anim_mesh;
struct texture_unit_cache;
+class path_search;
struct floormat_main
{
@@ -79,6 +80,7 @@ struct floormat_main
bool is_rendering_vobjs() const;
virtual struct texture_unit_cache& texture_unit_cache() = 0;
+ virtual path_search& search() = 0;
[[nodiscard]] static floormat_main* create(floormat_app& app, fm_settings&& options);
[[maybe_unused]] static void debug_break();
diff --git a/main/main-impl.cpp b/main/main-impl.cpp
index de9fb45b..69cda22c 100644
--- a/main/main-impl.cpp
+++ b/main/main-impl.cpp
@@ -65,4 +65,7 @@ uint32_t main_impl::cursor() const noexcept
return (uint32_t)static_cast<App*>(const_cast<main_impl*>(this))->cursor();
}
+struct texture_unit_cache& main_impl::texture_unit_cache() { return _tuc; }
+path_search& main_impl::search() { return _search; }
+
} // namespace floormat
diff --git a/main/main-impl.hpp b/main/main-impl.hpp
index 6e416549..a1550f01 100644
--- a/main/main-impl.hpp
+++ b/main/main-impl.hpp
@@ -9,6 +9,7 @@
#include "shaders/shader.hpp"
#include "shaders/lightmap.hpp"
#include "main/clickable.hpp"
+#include "src/path-search.hpp"
#include <vector>
#include <Corrade/Containers/String.h>
#include <Magnum/Timeline.h>
@@ -95,7 +96,8 @@ struct main_impl final : Platform::Sdl2Application, floormat_main
void set_cursor(uint32_t cursor) noexcept override;
uint32_t cursor() const noexcept override;
- struct texture_unit_cache& texture_unit_cache() override { return _tuc; }
+ struct texture_unit_cache& texture_unit_cache() override;
+ path_search& search() override;
private:
struct texture_unit_cache _tuc;
@@ -114,6 +116,7 @@ private:
#ifdef FM_USE_DEPTH32
Framebuffer framebuffer;
#endif
+ path_search _search;
struct {
float value = 0;
diff --git a/src/path-search.hpp b/src/path-search.hpp
index 775cb618..4b6e8a01 100644
--- a/src/path-search.hpp
+++ b/src/path-search.hpp
@@ -5,16 +5,14 @@
#include "rotation.hpp"
#include "world.hpp"
#include "compat/function2.fwd.hpp"
+#include <memory>
#include <array>
+#include <vector>
#include <bitset>
-#include <memory>
#include <Corrade/Containers/Array.h>
-#include <Corrade/Containers/BitArray.h>
-#include <Corrade/Containers/StridedDimensions.h>
#include <Magnum/Math/Vector2.h>
#include <Magnum/DimensionTraits.h>
-
namespace Corrade::Containers {
template<typename T> class Optional;
template<typename T, typename U> class Pair;