From bf990b0822c1b5a09f9584ed7c2b83edecabf375 Mon Sep 17 00:00:00 2001 From: BastiaanOlij Date: Tue, 10 Jan 2017 21:08:40 +1100 Subject: [PATCH] Few small fixes so tools=no and target=release compiles --- core/rid.h | 6 +++--- scene/3d/baked_light_instance.cpp | 4 ++++ scene/3d/gi_probe.cpp | 4 ++++ scene/resources/packed_scene.cpp | 4 ++-- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/core/rid.h b/core/rid.h index 466e9229684..8dc535c9c1c 100644 --- a/core/rid.h +++ b/core/rid.h @@ -113,15 +113,15 @@ protected: #ifndef DEBUG_ENABLED - _FORCE_INLINE_ bool _is_owner(RID& p_rid) const { + _FORCE_INLINE_ bool _is_owner(const RID& p_rid) const { - return this==p_rid._owner; + return this==p_rid._data->_owner; } _FORCE_INLINE_ void _remove_owner(RID& p_rid) { - return p_rid._owner=NULL; + p_rid._data->_owner=NULL; } # diff --git a/scene/3d/baked_light_instance.cpp b/scene/3d/baked_light_instance.cpp index f85dfea80e7..19be12ed917 100644 --- a/scene/3d/baked_light_instance.cpp +++ b/scene/3d/baked_light_instance.cpp @@ -1695,12 +1695,16 @@ void BakedLight::create_debug_mesh(DebugMode p_mode) { MultiMeshInstance *mmi = memnew( MultiMeshInstance ); mmi->set_multimesh(mm); add_child(mmi); +#ifdef TOOLS_ENABLED if (get_tree()->get_edited_scene_root()==this){ mmi->set_owner(this); } else { mmi->set_owner(get_owner()); } +#else + mmi->set_owner(get_owner()); +#endif } diff --git a/scene/3d/gi_probe.cpp b/scene/3d/gi_probe.cpp index 5b51273d0e6..438be13394e 100644 --- a/scene/3d/gi_probe.cpp +++ b/scene/3d/gi_probe.cpp @@ -1314,12 +1314,16 @@ void GIProbe::_create_debug_mesh(Baker *p_baker) { MultiMeshInstance *mmi = memnew( MultiMeshInstance ); mmi->set_multimesh(mm); add_child(mmi); +#ifdef TOOLS_ENABLED if (get_tree()->get_edited_scene_root()==this){ mmi->set_owner(this); } else { mmi->set_owner(get_owner()); } +#else + mmi->set_owner(get_owner()); +#endif } diff --git a/scene/resources/packed_scene.cpp b/scene/resources/packed_scene.cpp index b0161f6898c..625cc6a596f 100644 --- a/scene/resources/packed_scene.cpp +++ b/scene/resources/packed_scene.cpp @@ -1777,9 +1777,9 @@ bool PackedScene::can_instance() const { Node *PackedScene::instance(GenEditState p_edit_state) const { #ifndef TOOLS_ENABLED - if (p_gen_edit_state) { + if (p_edit_state!=GEN_EDIT_STATE_DISABLED) { ERR_EXPLAIN("Edit state is only for editors, does not work without tools compiled"); - ERR_FAIL_COND_V(p_gen_edit_state,NULL); + ERR_FAIL_COND_V(p_edit_state!=GEN_EDIT_STATE_DISABLED,NULL); } #endif