From 1d89c8b51913070178677e371a3d90500353fb09 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 17 May 2023 17:59:45 +0200 Subject: wip --- editor/vobj-editor.cpp | 5 +++-- editor/vobj-editor.hpp | 8 +++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/editor/vobj-editor.cpp b/editor/vobj-editor.cpp index 533f797a..8687e107 100644 --- a/editor/vobj-editor.cpp +++ b/editor/vobj-editor.cpp @@ -29,12 +29,13 @@ struct light_factory final : vobj_factory constexpr auto NAME = "light"_s; static const vobj_info& ret = loader.vobj(NAME); fm_debug_assert(ret.name == NAME); + fm_debug_assert(ret.atlas != nullptr); return ret; } std::shared_ptr make(world& w, object_id id, global_coords pos) const override { - auto ret = w.make_entity(id, pos, light_proto{}); + auto ret = w.make_entity(id, {pos.chunk(), pos.local(), 0}, light_proto{}); return ret; } }; @@ -60,7 +61,7 @@ const vobj_factory* vobj_editor::get_factory(entity_type type) if (!ptr) { fm_warn_once("invalid vobj type '%zu'", idx); - return {}; + return nullptr; } else return ptr; diff --git a/editor/vobj-editor.hpp b/editor/vobj-editor.hpp index 3ebf7bd8..573f00e3 100644 --- a/editor/vobj-editor.hpp +++ b/editor/vobj-editor.hpp @@ -17,7 +17,7 @@ struct entity; struct anim_atlas; struct vobj_info; -#ifdef __clang__ +#if defined __clang__ || defined __CLION_IDE__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wweak-vtables" #endif @@ -25,7 +25,7 @@ struct vobj_info; struct vobj_factory { constexpr vobj_factory() = default; - virtual constexpr ~vobj_factory() noexcept = default; + virtual constexpr ~vobj_factory() noexcept; virtual const vobj_info& info() const = 0; virtual entity_type type() const = 0; virtual std::shared_ptr make(world& w, object_id id, global_coords pos) const = 0; @@ -35,7 +35,9 @@ struct vobj_factory std::shared_ptr atlas() const; }; -#ifdef __clang__ +constexpr vobj_factory::~vobj_factory() noexcept {}; // NOLINT workaround gcc 12 bug #93413 + +#if defined __clang__ || defined __CLION_IDE__ #pragma clang diagnostic pop #endif -- cgit v1.2.3