summaryrefslogtreecommitdiffstats
path: root/game/shared/world/voxel.cc
diff options
context:
space:
mode:
Diffstat (limited to 'game/shared/world/voxel.cc')
-rw-r--r--game/shared/world/voxel.cc54
1 files changed, 14 insertions, 40 deletions
diff --git a/game/shared/world/voxel.cc b/game/shared/world/voxel.cc
index 1cd1504..21fe62c 100644
--- a/game/shared/world/voxel.cc
+++ b/game/shared/world/voxel.cc
@@ -55,7 +55,7 @@ void world::Voxel::set_face_cache(VoxelFace face, std::size_t offset, std::size_
m_cached_face_planes[face] = plane;
}
-std::uint64_t world::Voxel::calculate_checksum(std::uint64_t combine) const
+std::uint64_t world::Voxel::get_checksum(std::uint64_t combine) const
{
combine = math::crc64(m_name.data(), m_name.size(), combine);
combine += static_cast<std::uint64_t>(m_shape);
@@ -68,102 +68,76 @@ world::VoxelBuilder::VoxelBuilder(std::string_view name)
set_name(name);
}
-world::VoxelBuilder& world::VoxelBuilder::set_on_place(VoxelOnPlaceFunc func) noexcept
+void world::VoxelBuilder::set_on_place(VoxelOnPlaceFunc func) noexcept
{
m_on_place = std::move(func);
-
- return *this;
}
-world::VoxelBuilder& world::VoxelBuilder::set_on_remove(VoxelOnRemoveFunc func) noexcept
+void world::VoxelBuilder::set_on_remove(VoxelOnRemoveFunc func) noexcept
{
m_on_remove = std::move(func);
-
- return *this;
}
-world::VoxelBuilder& world::VoxelBuilder::set_on_tick(VoxelOnTickFunc func) noexcept
+void world::VoxelBuilder::set_on_tick(VoxelOnTickFunc func) noexcept
{
m_on_tick = std::move(func);
-
- return *this;
}
-world::VoxelBuilder& world::VoxelBuilder::set_name(std::string_view name) noexcept
+void world::VoxelBuilder::set_name(std::string_view name) noexcept
{
assert(name.size());
m_name = name;
-
- return *this;
}
-world::VoxelBuilder& world::VoxelBuilder::set_render_mode(VoxelRender mode) noexcept
+void world::VoxelBuilder::set_render_mode(VoxelRender mode) noexcept
{
m_render_mode = mode;
-
- return *this;
}
-world::VoxelBuilder& world::VoxelBuilder::set_shape(VoxelShape shape) noexcept
+void world::VoxelBuilder::set_shape(VoxelShape shape) noexcept
{
m_shape = shape;
-
- return *this;
}
-world::VoxelBuilder& world::VoxelBuilder::set_animated(bool animated) noexcept
+void world::VoxelBuilder::set_animated(bool animated) noexcept
{
m_animated = animated;
-
- return *this;
}
-world::VoxelBuilder& world::VoxelBuilder::set_touch_type(VoxelTouch type) noexcept
+void world::VoxelBuilder::set_touch_type(VoxelTouch type) noexcept
{
m_touch_type = type;
-
- return *this;
}
-world::VoxelBuilder& world::VoxelBuilder::set_touch_values(const glm::fvec3& values) noexcept
+void world::VoxelBuilder::set_touch_values(const glm::fvec3& values) noexcept
{
m_touch_values = values;
-
- return *this;
}
-world::VoxelBuilder& world::VoxelBuilder::set_surface_material(VoxelMaterial material) noexcept
+void world::VoxelBuilder::set_surface_material(VoxelMaterial material) noexcept
{
m_surface_material = material;
-
- return *this;
}
-world::VoxelBuilder& world::VoxelBuilder::set_collision(const math::AABBf& box) noexcept
+void world::VoxelBuilder::set_collision(const math::AABBf& box) noexcept
{
m_collision = box;
-
- return *this;
}
-world::VoxelBuilder& world::VoxelBuilder::add_default_texture(std::string_view path)
+void world::VoxelBuilder::add_default_texture(std::string_view path)
{
assert(path.size());
m_default_textures.emplace_back(path);
-
- return *this;
}
-world::VoxelBuilder& world::VoxelBuilder::add_face_texture(VoxelFace face, std::string_view path)
+void world::VoxelBuilder::add_face_texture(VoxelFace face, std::string_view path)
{
assert(face < m_face_textures.size());
assert(path.size());
m_face_textures[face].emplace_back(path);
-
- return *this;
}
std::unique_ptr<world::Voxel> world::VoxelBuilder::build(voxel_id id) const