You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-06 12:20:30 +00:00
Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks
This commit is contained in:
@@ -35,9 +35,7 @@
|
||||
#include "scene/resources/particles_material.h"
|
||||
|
||||
void MaterialEditor::_notification(int p_what) {
|
||||
|
||||
if (p_what == NOTIFICATION_READY) {
|
||||
|
||||
//get_scene()->connect("node_removed",this,"_node_removed");
|
||||
|
||||
if (first_enter) {
|
||||
@@ -58,7 +56,6 @@ void MaterialEditor::_notification(int p_what) {
|
||||
}
|
||||
|
||||
if (p_what == NOTIFICATION_DRAW) {
|
||||
|
||||
Ref<Texture> checkerboard = get_icon("Checkerboard", "EditorIcons");
|
||||
Size2 size = get_size();
|
||||
|
||||
@@ -67,20 +64,17 @@ void MaterialEditor::_notification(int p_what) {
|
||||
}
|
||||
|
||||
void MaterialEditor::edit(Ref<Material> p_material, const Ref<Environment> &p_env) {
|
||||
|
||||
material = p_material;
|
||||
camera->set_environment(p_env);
|
||||
if (!material.is_null()) {
|
||||
sphere_instance->set_material_override(material);
|
||||
box_instance->set_material_override(material);
|
||||
} else {
|
||||
|
||||
hide();
|
||||
}
|
||||
}
|
||||
|
||||
void MaterialEditor::_button_pressed(Node *p_button) {
|
||||
|
||||
if (p_button == light_1_switch) {
|
||||
light1->set_visible(!light_1_switch->is_pressed());
|
||||
}
|
||||
@@ -107,12 +101,10 @@ void MaterialEditor::_button_pressed(Node *p_button) {
|
||||
}
|
||||
|
||||
void MaterialEditor::_bind_methods() {
|
||||
|
||||
ClassDB::bind_method(D_METHOD("_button_pressed"), &MaterialEditor::_button_pressed);
|
||||
}
|
||||
|
||||
MaterialEditor::MaterialEditor() {
|
||||
|
||||
vc = memnew(ViewportContainer);
|
||||
vc->set_stretch(true);
|
||||
add_child(vc);
|
||||
@@ -210,7 +202,6 @@ MaterialEditor::MaterialEditor() {
|
||||
///////////////////////
|
||||
|
||||
bool EditorInspectorPluginMaterial::can_handle(Object *p_object) {
|
||||
|
||||
Material *material = Object::cast_to<Material>(p_object);
|
||||
if (!material)
|
||||
return false;
|
||||
@@ -219,7 +210,6 @@ bool EditorInspectorPluginMaterial::can_handle(Object *p_object) {
|
||||
}
|
||||
|
||||
void EditorInspectorPluginMaterial::parse_begin(Object *p_object) {
|
||||
|
||||
Material *material = Object::cast_to<Material>(p_object);
|
||||
if (!material) {
|
||||
return;
|
||||
@@ -239,23 +229,19 @@ EditorInspectorPluginMaterial::EditorInspectorPluginMaterial() {
|
||||
}
|
||||
|
||||
MaterialEditorPlugin::MaterialEditorPlugin(EditorNode *p_node) {
|
||||
|
||||
Ref<EditorInspectorPluginMaterial> plugin;
|
||||
plugin.instance();
|
||||
add_inspector_plugin(plugin);
|
||||
}
|
||||
|
||||
String SpatialMaterialConversionPlugin::converts_to() const {
|
||||
|
||||
return "ShaderMaterial";
|
||||
}
|
||||
bool SpatialMaterialConversionPlugin::handles(const Ref<Resource> &p_resource) const {
|
||||
|
||||
Ref<SpatialMaterial> mat = p_resource;
|
||||
return mat.is_valid();
|
||||
}
|
||||
Ref<Resource> SpatialMaterialConversionPlugin::convert(const Ref<Resource> &p_resource) const {
|
||||
|
||||
Ref<SpatialMaterial> mat = p_resource;
|
||||
ERR_FAIL_COND_V(!mat.is_valid(), Ref<Resource>());
|
||||
|
||||
@@ -275,7 +261,6 @@ Ref<Resource> SpatialMaterialConversionPlugin::convert(const Ref<Resource> &p_re
|
||||
VS::get_singleton()->shader_get_param_list(mat->get_shader_rid(), ¶ms);
|
||||
|
||||
for (List<PropertyInfo>::Element *E = params.front(); E; E = E->next()) {
|
||||
|
||||
// Texture parameter has to be treated specially since SpatialMaterial saved it
|
||||
// as RID but ShaderMaterial needs Texture itself
|
||||
Ref<Texture> texture = mat->get_texture_by_name(E->get().name);
|
||||
@@ -292,16 +277,13 @@ Ref<Resource> SpatialMaterialConversionPlugin::convert(const Ref<Resource> &p_re
|
||||
}
|
||||
|
||||
String ParticlesMaterialConversionPlugin::converts_to() const {
|
||||
|
||||
return "ShaderMaterial";
|
||||
}
|
||||
bool ParticlesMaterialConversionPlugin::handles(const Ref<Resource> &p_resource) const {
|
||||
|
||||
Ref<ParticlesMaterial> mat = p_resource;
|
||||
return mat.is_valid();
|
||||
}
|
||||
Ref<Resource> ParticlesMaterialConversionPlugin::convert(const Ref<Resource> &p_resource) const {
|
||||
|
||||
Ref<ParticlesMaterial> mat = p_resource;
|
||||
ERR_FAIL_COND_V(!mat.is_valid(), Ref<Resource>());
|
||||
|
||||
@@ -330,16 +312,13 @@ Ref<Resource> ParticlesMaterialConversionPlugin::convert(const Ref<Resource> &p_
|
||||
}
|
||||
|
||||
String CanvasItemMaterialConversionPlugin::converts_to() const {
|
||||
|
||||
return "ShaderMaterial";
|
||||
}
|
||||
bool CanvasItemMaterialConversionPlugin::handles(const Ref<Resource> &p_resource) const {
|
||||
|
||||
Ref<CanvasItemMaterial> mat = p_resource;
|
||||
return mat.is_valid();
|
||||
}
|
||||
Ref<Resource> CanvasItemMaterialConversionPlugin::convert(const Ref<Resource> &p_resource) const {
|
||||
|
||||
Ref<CanvasItemMaterial> mat = p_resource;
|
||||
ERR_FAIL_COND_V(!mat.is_valid(), Ref<Resource>());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user