瀏覽代碼

Merge pull request #7491 from BastiaanOlij/tools-no-fixes

Few small fixes so tools=no and target=release compiles
Rémi Verschelde 8 年之前
父節點
當前提交
0507f87de9
共有 4 個文件被更改,包括 13 次插入5 次删除
  1. 3 3
      core/rid.h
  2. 4 0
      scene/3d/baked_light_instance.cpp
  3. 4 0
      scene/3d/gi_probe.cpp
  4. 2 2
      scene/resources/packed_scene.cpp

+ 3 - 3
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;
 
 	}
 #

+ 4 - 0
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
 
 }
 

+ 4 - 0
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
 
 }
 

+ 2 - 2
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