diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2024-07-16 18:57:51 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2024-07-16 18:57:51 +0200 |
commit | c3258606e206f91e89c2451c6afb6fb4fd96a11f (patch) | |
tree | bf4cd788396f8c8ac8987c55d27ad8a92e4acbd8 | |
parent | d71c3ca30ea79d6a54446be8c5a9da169d7ccd1e (diff) |
wa
40 files changed, 52 insertions, 38 deletions
diff --git a/bench/loader.cpp b/bench/loader.cpp index 0cd08699..00008d00 100644 --- a/bench/loader.cpp +++ b/bench/loader.cpp @@ -3,7 +3,6 @@ #include "loader/wall-cell.hpp" #include "serialize/json-helper.hpp" #include "serialize/anim.hpp" -#include "compat/borrowed-ptr.inl" #include <Corrade/Containers/ArrayView.h> #include <Corrade/Containers/StringIterable.h> #include <benchmark/benchmark.h> diff --git a/editor/app.cpp b/editor/app.cpp index b5d6b7a1..44afd635 100644 --- a/editor/app.cpp +++ b/editor/app.cpp @@ -1,7 +1,6 @@ #include "app.hpp" #include "compat/assert.hpp" #include "compat/sysexits.hpp" -#include "compat/borrowed-ptr.inl" #include "editor.hpp" #include "src/anim-atlas.hpp" #include "src/critter.hpp" diff --git a/editor/camera.cpp b/editor/camera.cpp index 5fe28bc7..89147946 100644 --- a/editor/camera.cpp +++ b/editor/camera.cpp @@ -10,7 +10,7 @@ #include "src/camera-offset.hpp" #include "src/timer.hpp" #include "compat/enum-bitset.hpp" -#include "compat/borrowed-ptr.inl" +#include "compat/borrowed-ptr.hpp" #include <bit> #include <Magnum/Math/Functions.h> diff --git a/editor/draw.cpp b/editor/draw.cpp index d781c5a9..f5a906d2 100644 --- a/editor/draw.cpp +++ b/editor/draw.cpp @@ -1,5 +1,4 @@ #include "app.hpp" -#include "compat/borrowed-ptr.inl" #include "src/tile-constants.hpp" #include "floormat/main.hpp" #include "floormat/draw-bounds.hpp" diff --git a/editor/imgui-editors.cpp b/editor/imgui-editors.cpp index a36e7c00..4e331bcf 100644 --- a/editor/imgui-editors.cpp +++ b/editor/imgui-editors.cpp @@ -2,7 +2,6 @@ #include "src/tile-constants.hpp" #include "compat/array-size.hpp" #include "compat/format.hpp" -#include "compat/borrowed-ptr.inl" #include "imgui-raii.hpp" #include "ground-editor.hpp" #include "wall-editor.hpp" diff --git a/editor/imgui.cpp b/editor/imgui.cpp index 5e5acf90..2923c3ea 100644 --- a/editor/imgui.cpp +++ b/editor/imgui.cpp @@ -1,7 +1,6 @@ #include "app.hpp" #include "src/tile-constants.hpp" #include "compat/format.hpp" -#include "compat/borrowed-ptr.inl" #include "editor.hpp" #include "ground-editor.hpp" #include "wall-editor.hpp" diff --git a/editor/scenery-editor.cpp b/editor/scenery-editor.cpp index 0ba04028..778a0275 100644 --- a/editor/scenery-editor.cpp +++ b/editor/scenery-editor.cpp @@ -8,8 +8,6 @@ #include "src/scenery.hpp" #include "compat/borrowed-ptr.inl" -#include <Magnum/Math/Range.h> - namespace floormat { using rotation_t = std::underlying_type_t<enum rotation>; diff --git a/editor/tests/path-test.cpp b/editor/tests/path-test.cpp index 4b82af68..4a0f42df 100644 --- a/editor/tests/path-test.cpp +++ b/editor/tests/path-test.cpp @@ -2,7 +2,6 @@ #include "../app.hpp" #include "compat/array-size.hpp" #include "compat/vector-wrapper.hpp" -#include "compat/borrowed-ptr.inl" #include "floormat/main.hpp" #include "src/search-astar.hpp" #include "src/search-result.hpp" diff --git a/editor/tests/walk-test.cpp b/editor/tests/walk-test.cpp index f04fc869..997546cd 100644 --- a/editor/tests/walk-test.cpp +++ b/editor/tests/walk-test.cpp @@ -7,7 +7,6 @@ #include "floormat/main.hpp" #include "../imgui-raii.hpp" #include "src/search-astar.hpp" -#include "compat/borrowed-ptr.inl" #include <mg/Functions.h> namespace floormat::tests { diff --git a/editor/vobj-editor.cpp b/editor/vobj-editor.cpp index d4497fda..cab9c0e1 100644 --- a/editor/vobj-editor.cpp +++ b/editor/vobj-editor.cpp @@ -5,8 +5,7 @@ #include "loader/loader.hpp" #include "loader/vobj-cell.hpp" #include "app.hpp" -#include <array> -#include <utility> +#include "compat/borrowed-ptr.inl" #include <Corrade/Containers/StringView.h> namespace floormat { diff --git a/loader/anim-atlas.cpp b/loader/anim-atlas.cpp index cfbe7245..eef5f647 100644 --- a/loader/anim-atlas.cpp +++ b/loader/anim-atlas.cpp @@ -2,7 +2,7 @@ #include "atlas-loader.inl" #include "anim-cell.hpp" #include "anim-traits.hpp" -#include "compat/borrowed-ptr.inl" +#include "compat/borrowed-ptr.hpp" namespace floormat::loader_detail { diff --git a/loader/anim-traits.cpp b/loader/anim-traits.cpp index 09da71e8..8a701979 100644 --- a/loader/anim-traits.cpp +++ b/loader/anim-traits.cpp @@ -7,7 +7,6 @@ #include "serialize/json-helper.hpp" #include "serialize/anim.hpp" #include "compat/exception.hpp" -#include "compat/borrowed-ptr.inl" #include <cr/StringView.h> #include <cr/GrowableArray.h> #include <cr/StridedArrayView.h> diff --git a/loader/ground-atlas.cpp b/loader/ground-atlas.cpp index 4b3495a0..fc756395 100644 --- a/loader/ground-atlas.cpp +++ b/loader/ground-atlas.cpp @@ -2,7 +2,7 @@ #include "atlas-loader.inl" #include "ground-traits.hpp" #include "ground-cell.hpp" -#include "compat/borrowed-ptr.inl" +#include "compat/borrowed-ptr.hpp" #include <Magnum/Math/Vector2.h> namespace floormat::loader_detail { diff --git a/loader/ground-cell.cpp b/loader/ground-cell.cpp index 33696cd6..21982bd0 100644 --- a/loader/ground-cell.cpp +++ b/loader/ground-cell.cpp @@ -4,7 +4,6 @@ //#include "serialize/corrade-string.hpp" #include "serialize/ground-atlas.hpp" #include "serialize/corrade-array.hpp" -#include "compat/borrowed-ptr.inl" #include <cr/Array.h> namespace floormat { diff --git a/loader/ground-traits.cpp b/loader/ground-traits.cpp index 3061ef4c..611d4265 100644 --- a/loader/ground-traits.cpp +++ b/loader/ground-traits.cpp @@ -5,7 +5,6 @@ #include "src/tile-defs.hpp" #include "src/ground-atlas.hpp" #include "compat/assert.hpp" -#include "compat/borrowed-ptr.inl" #include <cr/Optional.h> #include <Corrade/Containers/StringView.h> #include <Corrade/Containers/Pointer.h> diff --git a/loader/impl.cpp b/loader/impl.cpp index 86bd76d5..ce5ad1a8 100644 --- a/loader/impl.cpp +++ b/loader/impl.cpp @@ -1,6 +1,5 @@ #include "impl.hpp" #include "compat/assert.hpp" -#include "compat/borrowed-ptr.inl" #include "ground-traits.hpp" #include "ground-cell.hpp" #include "wall-traits.hpp" @@ -9,7 +8,6 @@ #include "anim-cell.hpp" #include "scenery-traits.hpp" #include "scenery-cell.hpp" -// todo scenery_traits #include "vobj-cell.hpp" #include "atlas-loader.hpp" #include "atlas-loader-storage.hpp" diff --git a/loader/vobj.cpp b/loader/vobj.cpp index 789854a4..ebc35b16 100644 --- a/loader/vobj.cpp +++ b/loader/vobj.cpp @@ -4,7 +4,6 @@ #include "src/anim-atlas.hpp" #include "src/anim.hpp" #include "compat/exception.hpp" -#include "compat/borrowed-ptr.inl" #include "loader/vobj-cell.hpp" #include <Corrade/Containers/ArrayViewStl.h> #include <Corrade/Containers/StridedArrayView.h> diff --git a/loader/wall-atlas.cpp b/loader/wall-atlas.cpp index dbf71c47..b8db913f 100644 --- a/loader/wall-atlas.cpp +++ b/loader/wall-atlas.cpp @@ -3,7 +3,6 @@ #include "loader/wall-cell.hpp" #include "loader/wall-traits.hpp" #include "loader/atlas-loader.inl" -#include "compat/borrowed-ptr.inl" #include <Corrade/Containers/Array.h> #include <Corrade/Containers/StringIterable.h> #include <Magnum/Trade/ImageData.h> diff --git a/loader/wall-cell.cpp b/loader/wall-cell.cpp index a385163b..eff497af 100644 --- a/loader/wall-cell.cpp +++ b/loader/wall-cell.cpp @@ -1,6 +1,6 @@ #include "wall-cell.hpp" #include "compat/exception.hpp" -#include "compat/borrowed-ptr.inl" +#include "compat/borrowed-ptr.hpp" #include "serialize/json-helper.hpp" #include "serialize/corrade-string.hpp" #include "serialize/corrade-array.hpp" diff --git a/loader/wall-traits.cpp b/loader/wall-traits.cpp index e5cd7f40..7a50d105 100644 --- a/loader/wall-traits.cpp +++ b/loader/wall-traits.cpp @@ -6,7 +6,6 @@ #include "src/wall-atlas.hpp" #include "compat/array-size.hpp" #include "compat/exception.hpp" -#include "compat/borrowed-ptr.inl" #include <cr/StringView.h> #include <cr/Optional.h> #include <mg/ImageData.h> diff --git a/serialize/ground-atlas.cpp b/serialize/ground-atlas.cpp index 49bcf7b9..8849bfac 100644 --- a/serialize/ground-atlas.cpp +++ b/serialize/ground-atlas.cpp @@ -1,6 +1,5 @@ #include "ground-atlas.hpp" #include "compat/exception.hpp" -#include "compat/borrowed-ptr.inl" #include "src/ground-atlas.hpp" #include "src/ground-def.hpp" #include "loader/loader.hpp" diff --git a/serialize/old-savegame.cpp b/serialize/old-savegame.cpp index 8e4998b0..265d037d 100644 --- a/serialize/old-savegame.cpp +++ b/serialize/old-savegame.cpp @@ -1,5 +1,4 @@ #include "binary-reader.inl" -#include "compat/limits.hpp" #include "src/world.hpp" #include "src/scenery.hpp" #include "src/critter.hpp" @@ -9,11 +8,13 @@ #include "src/ground-atlas.hpp" #include "src/anim-atlas.hpp" #include "src/chunk-scenery.hpp" -#include "compat/strerror.hpp" #include "src/tile.hpp" #include "src/pass-mode.hpp" #include "src/rotation.hpp" #include "src/object-type.hpp" +#include "compat/limits.hpp" +#include "compat/strerror.hpp" +#include "compat/borrowed-ptr.inl" #include <bit> #include <cerrno> #include <cstring> diff --git a/serialize/scenery.cpp b/serialize/scenery.cpp index e278d408..edcd57c7 100644 --- a/serialize/scenery.cpp +++ b/serialize/scenery.cpp @@ -1,7 +1,6 @@ #include "scenery.hpp" #include "compat/overloaded.hpp" #include "compat/exception.hpp" -#include "compat/borrowed-ptr.inl" #include "src/anim-atlas.hpp" #include "compat/assert.hpp" #include "loader/loader.hpp" diff --git a/serialize/tile.cpp b/serialize/tile.cpp index 1cbf8d1b..2da29c42 100644 --- a/serialize/tile.cpp +++ b/serialize/tile.cpp @@ -1,6 +1,5 @@ #include "tile.hpp" #include "ground-atlas.hpp" -#include "compat/borrowed-ptr.inl" #include "src/tile.hpp" #include "src/global-coords.hpp" #include "src/ground-atlas.hpp" diff --git a/shaders/lightmap.cpp b/shaders/lightmap.cpp index 01a8beb7..69702624 100644 --- a/shaders/lightmap.cpp +++ b/shaders/lightmap.cpp @@ -1,6 +1,5 @@ #include "shaders/lightmap.hpp" #include "compat/assert.hpp" -#include "compat/borrowed-ptr.inl" #include "src/tile-defs.hpp" #include "src/chunk.hpp" #include "src/tile-bbox.hpp" diff --git a/src/anim-atlas.cpp b/src/anim-atlas.cpp index cff16798..43ba69b2 100644 --- a/src/anim-atlas.cpp +++ b/src/anim-atlas.cpp @@ -3,6 +3,7 @@ #include "compat/assert.hpp" #include "compat/array-size.hpp" #include "compat/exception.hpp" +#include "compat/borrowed-ptr.inl" #include <Corrade/Containers/BitArrayView.h> #include <Corrade/Containers/StridedArrayView.h> #include <Magnum/Math/Color.h> @@ -10,6 +11,9 @@ namespace floormat { +template class bptr<anim_atlas>; +template class bptr<const anim_atlas>; + static constexpr const char name_array[][3] = { "n", "ne", "e", "se", "s", "sw", "w", "nw", }; static constexpr inline auto rot_count = size_t(rotation_COUNT); diff --git a/src/chunk-render.cpp b/src/chunk-render.cpp index 421d98d2..529d4f64 100644 --- a/src/chunk-render.cpp +++ b/src/chunk-render.cpp @@ -3,7 +3,7 @@ #include "ground-atlas.hpp" #include "quads.hpp" #include "shaders/shader.hpp" -#include "compat/borrowed-ptr.inl" +#include "compat/borrowed-ptr.hpp" #include <algorithm> #include <Corrade/Containers/Array.h> #include <Corrade/Containers/ArrayViewStl.h> diff --git a/src/chunk-walls.cpp b/src/chunk-walls.cpp index b3ed0d8c..fb4b6560 100644 --- a/src/chunk-walls.cpp +++ b/src/chunk-walls.cpp @@ -3,7 +3,6 @@ #include "quads.hpp" #include "wall-atlas.hpp" #include "shaders/shader.hpp" -#include "compat/borrowed-ptr.inl" #include <Corrade/Containers/ArrayViewStl.h> #include <Corrade/Containers/Pair.h> #include <Corrade/Containers/Optional.h> diff --git a/src/critter.cpp b/src/critter.cpp index b107394d..07c8f0cc 100644 --- a/src/critter.cpp +++ b/src/critter.cpp @@ -20,6 +20,9 @@ namespace floormat { +template class bptr<critter>; +template class bptr<const critter>; + namespace { constexpr auto m_auto_mask = critter::move_u { .bits {.AUTO = true} }; diff --git a/src/ground-atlas.cpp b/src/ground-atlas.cpp index f78d53be..aae04ae9 100644 --- a/src/ground-atlas.cpp +++ b/src/ground-atlas.cpp @@ -1,8 +1,9 @@ #include "ground-atlas.hpp" #include "quads.hpp" #include "compat/assert.hpp" -#include "tile-image.hpp" #include "compat/exception.hpp" +#include "compat/borrowed-ptr.inl" +#include "tile-image.hpp" #include "loader/loader.hpp" #include <limits> #include <Magnum/Math/Color.h> @@ -11,6 +12,9 @@ namespace floormat { +template class bptr<ground_atlas>; +template class bptr<const ground_atlas>; + using namespace floormat::Quads; ground_atlas::ground_atlas(ground_def info, const ImageView2D& image) : diff --git a/src/hole.cpp b/src/hole.cpp index ad29c752..1bb8bb99 100644 --- a/src/hole.cpp +++ b/src/hole.cpp @@ -6,8 +6,13 @@ #include "tile-constants.hpp" #include "world.hpp" #include "compat/non-const.hpp" +#include "compat/borrowed-ptr.inl" namespace floormat { + +template class bptr<hole>; +template class bptr<const hole>; + namespace { void mark_chunk_modifiedʹ(chunk& c) diff --git a/src/light.cpp b/src/light.cpp index 2c5d1a4f..a4c86726 100644 --- a/src/light.cpp +++ b/src/light.cpp @@ -1,13 +1,15 @@ #include "light.hpp" -#include "nanosecond.hpp" #include "tile-constants.hpp" #include "shaders/shader.hpp" #include "loader/loader.hpp" #include "loader/vobj-cell.hpp" -#include <cmath> +#include "compat/borrowed-ptr.inl" namespace floormat { +template class bptr<light>; +template class bptr<const light>; + light_proto::light_proto() { atlas = loader.vobj("light"_s).atlas; diff --git a/src/object.cpp b/src/object.cpp index 7e686aa9..449a0fcb 100644 --- a/src/object.cpp +++ b/src/object.cpp @@ -21,6 +21,9 @@ namespace floormat { +template class bptr<object>; +template class bptr<const object>; + namespace { // todo rewrite using bitwise ops. try this instead: x = 31; int((x+64+32)/64), (x + 64 + 32)%64 - 1 diff --git a/src/scenery.cpp b/src/scenery.cpp index 4903afac..e2092ffa 100644 --- a/src/scenery.cpp +++ b/src/scenery.cpp @@ -2,6 +2,7 @@ #include "scenery-proto.hpp" #include "compat/assert.hpp" #include "compat/exception.hpp" +#include "compat/borrowed-ptr.inl" #include "tile-constants.hpp" #include "anim-atlas.hpp" #include "rotation.inl" @@ -11,6 +12,13 @@ namespace floormat { +template class bptr<generic_scenery>; +template class bptr<const generic_scenery>; +template class bptr<scenery>; +template class bptr<const scenery>; +template class bptr<door_scenery>; +template class bptr<const door_scenery>; + // --- scenery --- enum object_type scenery::type() const noexcept { return object_type::scenery; } // NOLINT(*-convert-*-to-static) diff --git a/src/tile-image.cpp b/src/tile-image.cpp index 20ab4098..2d4f0874 100644 --- a/src/tile-image.cpp +++ b/src/tile-image.cpp @@ -1,5 +1,4 @@ #include "tile-image.hpp" -#include "compat/borrowed-ptr.inl" namespace floormat { diff --git a/src/tile.cpp b/src/tile.cpp index 216783f7..663436be 100644 --- a/src/tile.cpp +++ b/src/tile.cpp @@ -1,7 +1,6 @@ #include "tile.hpp" #include "tile-constants.hpp" #include "chunk.hpp" -#include "compat/borrowed-ptr.inl" namespace floormat { diff --git a/src/wall-atlas.cpp b/src/wall-atlas.cpp index 991e1b45..e6c5cb6d 100644 --- a/src/wall-atlas.cpp +++ b/src/wall-atlas.cpp @@ -2,11 +2,18 @@ #include "tile-constants.hpp" #include "compat/array-size.hpp" #include "compat/exception.hpp" -#include <utility> +#include "compat/borrowed-ptr.inl" #include <Corrade/Containers/StridedArrayView.h> #include <Magnum/ImageView.h> #include <Magnum/GL/TextureFormat.h> +namespace floormat { + +template class bptr<wall_atlas>; +template class bptr<const wall_atlas>; + +} // namespace floormat + namespace floormat::Wall { uint8_t direction_index_from_name(StringView s) noexcept(false) diff --git a/src/world.hpp b/src/world.hpp index a0c2723a..a643de3b 100644 --- a/src/world.hpp +++ b/src/world.hpp @@ -1,7 +1,7 @@ #pragma once #include "compat/safe-ptr.hpp" #include "compat/base-of.hpp" -#include "compat/borrowed-ptr.inl" +#include "compat/borrowed-ptr.hpp" #include "chunk.hpp" #include "global-coords.hpp" #include "object-type.hpp" diff --git a/test/rtree.cpp b/test/rtree.cpp index 16e89659..bc8d9e22 100644 --- a/test/rtree.cpp +++ b/test/rtree.cpp @@ -4,6 +4,7 @@ #include "src/RTree.hpp" #include "src/nanosecond.inl" #include "loader/loader.hpp" +#include "compat/borrowed-ptr.inl" namespace floormat { diff --git a/test/save.cpp b/test/save.cpp index e30a02fb..04c9810c 100644 --- a/test/save.cpp +++ b/test/save.cpp @@ -10,6 +10,7 @@ #include "src/nanosecond.inl" #include "loader/loader.hpp" #include "loader/scenery-cell.hpp" +#include "compat/borrowed-ptr.inl" #include <Corrade/Utility/Path.h> namespace floormat { |