summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/anim-atlas.cpp4
-rw-r--r--src/chunk-render.cpp2
-rw-r--r--src/chunk-walls.cpp1
-rw-r--r--src/critter.cpp3
-rw-r--r--src/ground-atlas.cpp6
-rw-r--r--src/hole.cpp5
-rw-r--r--src/light.cpp6
-rw-r--r--src/object.cpp3
-rw-r--r--src/scenery.cpp8
-rw-r--r--src/tile-image.cpp1
-rw-r--r--src/tile.cpp1
-rw-r--r--src/wall-atlas.cpp9
-rw-r--r--src/world.hpp2
13 files changed, 42 insertions, 9 deletions
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"