Browse Source

Merge pull request #25426 from volzhs/twice-get_singleton

Remove unnecessary call VS::get_singleton() twice
Rémi Verschelde 6 years ago
parent
commit
20aec40757
1 changed files with 3 additions and 3 deletions
  1. 3 3
      editor/plugins/editor_preview_plugins.cpp

+ 3 - 3
editor/plugins/editor_preview_plugins.cpp

@@ -334,7 +334,7 @@ Ref<Texture> EditorMaterialPreviewPlugin::generate(const RES &p_from, const Size
 			OS::get_singleton()->delay_usec(10);
 			OS::get_singleton()->delay_usec(10);
 		}
 		}
 
 
-		Ref<Image> img = VS::get_singleton()->VS::get_singleton()->texture_get_data(viewport_texture);
+		Ref<Image> img = VS::get_singleton()->texture_get_data(viewport_texture);
 		VS::get_singleton()->mesh_surface_set_material(sphere, 0, RID());
 		VS::get_singleton()->mesh_surface_set_material(sphere, 0, RID());
 
 
 		ERR_FAIL_COND_V(!img.is_valid(), Ref<ImageTexture>());
 		ERR_FAIL_COND_V(!img.is_valid(), Ref<ImageTexture>());
@@ -734,7 +734,7 @@ Ref<Texture> EditorMeshPreviewPlugin::generate(const RES &p_from, const Size2 p_
 		OS::get_singleton()->delay_usec(10);
 		OS::get_singleton()->delay_usec(10);
 	}
 	}
 
 
-	Ref<Image> img = VS::get_singleton()->VS::get_singleton()->texture_get_data(viewport_texture);
+	Ref<Image> img = VS::get_singleton()->texture_get_data(viewport_texture);
 	ERR_FAIL_COND_V(img.is_null(), Ref<ImageTexture>());
 	ERR_FAIL_COND_V(img.is_null(), Ref<ImageTexture>());
 
 
 	VS::get_singleton()->instance_set_base(mesh_instance, RID());
 	VS::get_singleton()->instance_set_base(mesh_instance, RID());
@@ -854,7 +854,7 @@ Ref<Texture> EditorFontPreviewPlugin::generate_from_path(const String &p_path, c
 		OS::get_singleton()->delay_usec(10);
 		OS::get_singleton()->delay_usec(10);
 	}
 	}
 
 
-	Ref<Image> img = VS::get_singleton()->VS::get_singleton()->texture_get_data(viewport_texture);
+	Ref<Image> img = VS::get_singleton()->texture_get_data(viewport_texture);
 	ERR_FAIL_COND_V(img.is_null(), Ref<ImageTexture>());
 	ERR_FAIL_COND_V(img.is_null(), Ref<ImageTexture>());
 
 
 	img->convert(Image::FORMAT_RGBA8);
 	img->convert(Image::FORMAT_RGBA8);