summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2024-02-28 18:29:02 +0100
committerStanislaw Halik <sthalik@misaki.pl>2024-02-28 20:13:32 +0100
commit78a3eec9be053a1f82cf2e6235bbaa4deb4a1335 (patch)
tree4539ba47695bc7b5fd974e2508067cb2fd168636 /src
parent75508e3c03f659080df7db2211fb5a80cc1afeee (diff)
switch to using unqualified calls to {move,forward,swap}
Diffstat (limited to 'src')
-rw-r--r--src/anim-atlas.cpp4
-rw-r--r--src/chunk-render.cpp2
-rw-r--r--src/chunk-scenery.cpp2
-rw-r--r--src/emplacer.hpp3
-rw-r--r--src/ground-atlas.cpp2
-rw-r--r--src/object.cpp2
-rw-r--r--src/search-result.cpp14
-rw-r--r--src/wall-atlas.cpp6
-rw-r--r--src/world.cpp10
-rw-r--r--src/world.hpp7
10 files changed, 25 insertions, 27 deletions
diff --git a/src/anim-atlas.cpp b/src/anim-atlas.cpp
index 353ebb34..b798ffcc 100644
--- a/src/anim-atlas.cpp
+++ b/src/anim-atlas.cpp
@@ -37,8 +37,8 @@ decltype(anim_atlas::_group_indices) anim_atlas::make_group_indices(const anim_d
anim_atlas::anim_atlas() noexcept = default;
anim_atlas::anim_atlas(String name, const ImageView2D& image, anim_def info) :
- _name{std::move(name)}, _bitmask{make_bitmask(image)},
- _info{std::move(info)}, _group_indices{make_group_indices(_info)}
+ _name{move(name)}, _bitmask{make_bitmask(image)},
+ _info{move(info)}, _group_indices{make_group_indices(_info)}
{
fm_soft_assert(!_info.groups.isEmpty());
diff --git a/src/chunk-render.cpp b/src/chunk-render.cpp
index efcacb88..a2e1032a 100644
--- a/src/chunk-render.cpp
+++ b/src/chunk-render.cpp
@@ -80,7 +80,7 @@ auto chunk::ensure_ground_mesh() noexcept -> ground_mesh_tuple
mesh.addVertexBuffer(GL::Buffer{vertex_view}, 0, tile_shader::Position{}, tile_shader::TextureCoordinates{}, tile_shader::Depth{})
.setIndexBuffer(GL::Buffer{vert_index_view}, 0, GL::MeshIndexType::UnsignedShort)
.setCount(int32_t(6 * count));
- ground_mesh = Utility::move(mesh);
+ ground_mesh = move(mesh);
return { ground_mesh, _ground->indexes, count };
}
diff --git a/src/chunk-scenery.cpp b/src/chunk-scenery.cpp
index 2d950854..e32f13b9 100644
--- a/src/chunk-scenery.cpp
+++ b/src/chunk-scenery.cpp
@@ -178,7 +178,7 @@ auto chunk::ensure_scenery_mesh(scenery_scratch_buffers buffers) noexcept -> sce
mesh.addVertexBuffer(GL::Buffer{vert_view}, 0, tile_shader::Position{}, tile_shader::TextureCoordinates{}, tile_shader::Depth{})
.setIndexBuffer(GL::Buffer{index_view}, 0, GL::MeshIndexType::UnsignedShort)
.setCount(int32_t(6 * count));
- scenery_mesh = Utility::move(mesh);
+ scenery_mesh = move(mesh);
}
const auto size = _objects.size();
diff --git a/src/emplacer.hpp b/src/emplacer.hpp
index d132bd7b..4a7f6bdb 100644
--- a/src/emplacer.hpp
+++ b/src/emplacer.hpp
@@ -1,6 +1,5 @@
#pragma once
#include <type_traits>
-#include <Corrade/Utility/Move.h>
namespace floormat {
@@ -10,7 +9,7 @@ class emplacer {
using type = std::decay_t<decltype(std::declval<F>()())>;
public:
- explicit constexpr emplacer(F&& fun) noexcept : fun{Utility::forward<F>(fun)} {}
+ explicit constexpr emplacer(F&& fun) noexcept : fun{forward<F>(fun)} {}
constexpr operator type() const noexcept { return fun(); }
};
diff --git a/src/ground-atlas.cpp b/src/ground-atlas.cpp
index d39ecadc..726ec557 100644
--- a/src/ground-atlas.cpp
+++ b/src/ground-atlas.cpp
@@ -14,7 +14,7 @@ namespace floormat {
using namespace floormat::Quads;
ground_atlas::ground_atlas(ground_def info, const ImageView2D& image) :
- _def{std::move(info)}, _path{make_path(_def.name)},
+ _def{move(info)}, _path{make_path(_def.name)},
_texcoords{make_texcoords_array(Vector2ui(image.size()), _def.size)},
_pixel_size{image.size()}
{
diff --git a/src/object.cpp b/src/object.cpp
index 307a2155..550f8a6b 100644
--- a/src/object.cpp
+++ b/src/object.cpp
@@ -258,7 +258,7 @@ void object::move_to(size_t& i, Vector2i delta, rotation new_r)
const_cast<rotation&>(r) = new_r;
const_cast<class chunk*&>(c) = &c2;
i = (size_t)std::distance(es.cbegin(), it);
- arrayInsert(es, i, std::move(e_));
+ arrayInsert(es, i, move(e_));
}
}
diff --git a/src/search-result.cpp b/src/search-result.cpp
index 31f3887c..71cb9793 100644
--- a/src/search-result.cpp
+++ b/src/search-result.cpp
@@ -21,11 +21,11 @@ path_search_result::path_search_result()
{
if (_pool)
{
- auto ptr = std::move(_pool);
+ auto ptr = move(_pool);
fm_debug_assert(ptr->vec.empty());
- auto next = std::move(ptr->_next);
- _node = std::move(ptr);
- _pool = std::move(next);
+ auto next = move(ptr->_next);
+ _node = move(ptr);
+ _pool = move(next);
}
else
{
@@ -39,8 +39,8 @@ path_search_result::~path_search_result() noexcept
if (_node && _node->vec.capacity() > 0) [[likely]]
{
_node->vec.clear();
- _node->_next = std::move(_pool);
- _pool = std::move(_node);
+ _node->_next = move(_pool);
+ _pool = move(_node);
}
}
@@ -49,7 +49,7 @@ path_search_result::path_search_result(const path_search_result& x) noexcept
fm_debug_assert(x._node);
auto self = path_search_result{};
self._node->vec = x._node->vec;
- _node = std::move(self._node);
+ _node = move(self._node);
_cost = x._cost;
}
diff --git a/src/wall-atlas.cpp b/src/wall-atlas.cpp
index 9ea81fe5..1d043db0 100644
--- a/src/wall-atlas.cpp
+++ b/src/wall-atlas.cpp
@@ -102,9 +102,9 @@ Vector2ui wall_atlas::expected_size(unsigned depth, Group_ group)
}
wall_atlas::wall_atlas(wall_atlas_def def, String path, const ImageView2D& img)
- : _dir_array{std::move(def.direction_array)},
- _frame_array{std::move(def.frames)},
- _info{std::move(def.header)}, _path{std::move(path)},
+ : _dir_array{move(def.direction_array)},
+ _frame_array{move(def.frames)},
+ _info{move(def.header)}, _path{move(path)},
_image_size{get_image_size(img)},
_direction_map{def.direction_map}
{
diff --git a/src/world.cpp b/src/world.cpp
index a28db7d3..ef0de7ae 100644
--- a/src/world.cpp
+++ b/src/world.cpp
@@ -3,7 +3,7 @@
#include "object.hpp"
#include "compat/int-hash.hpp"
#include "compat/exception.hpp"
-#include <Corrade/Containers/GrowableArray.h>
+#include <cr/GrowableArray.h>
#include <tsl/robin_map.h>
using namespace floormat;
@@ -32,7 +32,7 @@ world::world(std::unordered_map<chunk_coords_, chunk>&& chunks) :
world{std::max(initial_capacity, size_t(1/max_load_factor * 2 * chunks.size()))}
{
for (auto&& [coord, c] : chunks)
- operator[](coord) = std::move(c);
+ operator[](coord) = move(c);
}
world& world::operator=(world&& w) noexcept
@@ -42,10 +42,10 @@ world& world::operator=(world&& w) noexcept
fm_assert(!_teardown);
fm_assert(w._unique_id);
_last_chunk = {};
- _chunks = std::move(w._chunks);
- _objects = std::move(w._objects);
+ _chunks = move(w._chunks);
+ _objects = move(w._objects);
w._objects = {};
- _unique_id = std::move(w._unique_id);
+ _unique_id = move(w._unique_id);
fm_debug_assert(_unique_id);
fm_debug_assert(w._unique_id == nullptr);
_object_counter = w._object_counter;
diff --git a/src/world.hpp b/src/world.hpp
index 8880fec0..19a31a46 100644
--- a/src/world.hpp
+++ b/src/world.hpp
@@ -6,7 +6,6 @@
#include "loader/policy.hpp"
#include <memory>
#include <unordered_map>
-#include <Corrade/Utility/Move.h>
namespace floormat {
@@ -78,7 +77,7 @@ public:
}
std::shared_ptr<T> make_object(object_id id, global_coords pos, Xs&&... xs)
{
- auto ret = std::shared_ptr<T>(new T{id, operator[](pos.chunk3()), Utility::forward<Xs>(xs)...});
+ auto ret = std::shared_ptr<T>(new T{id, operator[](pos.chunk3()), forward<Xs>(xs)...});
do_make_object(static_pointer_cast<object>(ret), pos, sorted);
return ret;
}
@@ -86,7 +85,7 @@ public:
template<typename T, typename... Xs> std::shared_ptr<object> make_unconnected_object(Xs&&... xs)
{
- return std::shared_ptr<T>(new T{0, operator[](chunk_coords_{}), {}, Utility::forward<Xs>(xs)...});
+ return std::shared_ptr<T>(new T{0, operator[](chunk_coords_{}), {}, forward<Xs>(xs)...});
}
template<typename T = object> std::shared_ptr<T> find_object(object_id id);
@@ -120,7 +119,7 @@ std::shared_ptr<T> world::find_object(object_id id)
{
if (!(ptr->type() == object_type_<T>::value)) [[unlikely]]
throw_on_wrong_object_type(id, ptr->type(), object_type_<T>::value);
- return static_pointer_cast<T>(Utility::move(ptr));
+ return static_pointer_cast<T>(move(ptr));
}
}