diff --git a/headers/enduro2d/high/components/behaviour.hpp b/headers/enduro2d/high/components/behaviour.hpp index a01a179c..645dfa53 100644 --- a/headers/enduro2d/high/components/behaviour.hpp +++ b/headers/enduro2d/high/components/behaviour.hpp @@ -79,11 +79,12 @@ namespace e2d::behaviours behaviour.meta(), std::forward(args)...); if ( !r.valid() ) { + sol::error err = r; the().error("BEHAVIOUR: Behaviour method error:\n" "--> Method: %0\n" "--> Error: %1", method, - sol::error(r).what()); + err.what()); return call_result::failed; } diff --git a/headers/enduro2d/high/gobject.hpp b/headers/enduro2d/high/gobject.hpp index 43f85461..f747726a 100644 --- a/headers/enduro2d/high/gobject.hpp +++ b/headers/enduro2d/high/gobject.hpp @@ -13,6 +13,23 @@ namespace e2d class gobject final { public: class state; + class destroying_state_ilist_tag; + using destroying_states = intrusive_list< + state, + destroying_state_ilist_tag>; + public: + class state + : private noncopyable + , public ref_counter + , public intrusive_list_hook { + public: + virtual ~state() noexcept {} + virtual void destroy() noexcept = 0; + virtual bool destroyed() const noexcept = 0; + virtual bool invalided() const noexcept = 0; + virtual ecs::entity raw_entity() noexcept = 0; + virtual ecs::const_entity raw_entity() const noexcept = 0; + }; using state_iptr = intrusive_ptr; const state_iptr& internal_state() const noexcept; public: @@ -102,24 +119,6 @@ namespace e2d namespace e2d { - class gobject_destroying_state_ilist_tag; - using gobject_destroying_states = intrusive_list< - gobject::state, - gobject_destroying_state_ilist_tag>; - - class gobject::state - : private noncopyable - , public ref_counter - , public intrusive_list_hook { - public: - virtual ~state() noexcept {} - virtual void destroy() noexcept = 0; - virtual bool destroyed() const noexcept = 0; - virtual bool invalided() const noexcept = 0; - virtual ecs::entity raw_entity() noexcept = 0; - virtual ecs::const_entity raw_entity() const noexcept = 0; - }; - template < typename T > gcomponent gobject::component() noexcept { return gcomponent(*this); diff --git a/headers/enduro2d/high/world.hpp b/headers/enduro2d/high/world.hpp index 291b1190..46c91fd9 100644 --- a/headers/enduro2d/high/world.hpp +++ b/headers/enduro2d/high/world.hpp @@ -35,6 +35,6 @@ namespace e2d void finalize_instances() noexcept; private: ecs::registry registry_; - gobject_destroying_states destroying_states_; + gobject::destroying_states destroying_states_; }; } diff --git a/sources/enduro2d/core/audio_impl/audio_bass.cpp b/sources/enduro2d/core/audio_impl/audio_bass.cpp index 0445559c..4ee56c93 100644 --- a/sources/enduro2d/core/audio_impl/audio_bass.cpp +++ b/sources/enduro2d/core/audio_impl/audio_bass.cpp @@ -158,7 +158,7 @@ namespace e2d TRUE, sound_data.data(), 0, - sound_data.size(), + math::numeric_cast(sound_data.size()), max_sound_channels, BASS_SAMPLE_OVER_POS); diff --git a/sources/enduro2d/high/components/behaviour.cpp b/sources/enduro2d/high/components/behaviour.cpp index 95f8143a..34cccbb4 100644 --- a/sources/enduro2d/high/components/behaviour.cpp +++ b/sources/enduro2d/high/components/behaviour.cpp @@ -40,9 +40,10 @@ namespace e2d sol::protected_function_result meta = script->content().call(); if ( !meta.valid() ) { + sol::error err = meta; the().error("BEHAVIOUR: Behaviour script error:\n" "--> Error: %0", - sol::error(meta).what()); + err.what()); return false; } diff --git a/sources/enduro2d/high/luasol.cpp b/sources/enduro2d/high/luasol.cpp index a5fd3007..969b30c7 100644 --- a/sources/enduro2d/high/luasol.cpp +++ b/sources/enduro2d/high/luasol.cpp @@ -40,9 +40,10 @@ namespace e2d src.size()); if ( !result.valid() ) { + sol::error err = result; the().error("LUASOL: Failed to load script buffer:\n" "--> Info: %0", - sol::error(result).what()); + err.what()); return std::nullopt; }