diff options
author | Juan Linietsky <reduzio@gmail.com> | 2016-10-10 18:31:01 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2016-10-10 18:31:01 -0300 |
commit | 1527cf8c0d17891dd0ebf99d484f83daa46eba3c (patch) | |
tree | a9a0fc5a00f8f57a973f2861d051b76f99642114 /scene/gui | |
parent | 850eaf7ed796d2f2d9a35c6bc4ba9a4e69f5ca1d (diff) |
2D Shaders are working again using the new syntax, though all is buggy in general
Diffstat (limited to 'scene/gui')
-rw-r--r-- | scene/gui/color_picker.cpp | 37 | ||||
-rw-r--r-- | scene/gui/color_picker.h | 2 |
2 files changed, 0 insertions, 39 deletions
diff --git a/scene/gui/color_picker.cpp b/scene/gui/color_picker.cpp index 27bdb581e1..3d9c07ac86 100644 --- a/scene/gui/color_picker.cpp +++ b/scene/gui/color_picker.cpp @@ -34,31 +34,12 @@ #include "os/input.h" #include "os/keyboard.h" -void update_material(Ref<CanvasItemMaterial>mat,const Color& p_color,float h,float s,float v) { - if (!mat.is_valid()) - return; - Ref<Shader> sdr = mat->get_shader(); - if (!sdr.is_valid()) - return; - - mat->set_shader_param("R",p_color.r); - mat->set_shader_param("G",p_color.g); - mat->set_shader_param("B",p_color.b); - mat->set_shader_param("H",h); - mat->set_shader_param("S",s); - mat->set_shader_param("V",v); - mat->set_shader_param("A",p_color.a); -} void ColorPicker::_notification(int p_what) { switch(p_what) { case NOTIFICATION_THEME_CHANGED: { - uv_material->set_shader(get_shader("uv_editor")); - w_material->set_shader(get_shader("w_editor")); - update_material(uv_material,color,h,s,v); - update_material(w_material,color,h,s,v); uv_edit->set_texture(get_icon("color_main")); w_edit->set_texture(get_icon("color_hue")); sample->set_texture(get_icon("color_sample")); @@ -68,8 +49,6 @@ void ColorPicker::_notification(int p_what) { case NOTIFICATION_ENTER_TREE: { btn_pick->set_icon(get_icon("screen_picker", "ColorPicker")); - update_material(uv_material, color,h,s,v); - update_material(w_material, color,h,s,v); uv_edit->get_child(0)->cast_to<Control>()->update(); w_edit->get_child(0)->cast_to<Control>()->update(); @@ -113,8 +92,6 @@ void ColorPicker::set_color(const Color& p_color) { if (!is_inside_tree()) return; - update_material(uv_material, color,h,s,v); - update_material(w_material, color,h,s,v); uv_edit->get_child(0)->cast_to<Control>()->update(); w_edit->get_child(0)->cast_to<Control>()->update(); @@ -509,7 +486,6 @@ ColorPicker::ColorPicker() : uv_edit->add_child(c); c->set_area_as_parent_rect(); c->set_stop_mouse(false); - c->set_material(memnew ( CanvasItemMaterial )); Vector<Variant> args=Vector<Variant>(); args.push_back(0); args.push_back(c); @@ -525,7 +501,6 @@ ColorPicker::ColorPicker() : w_edit->add_child(c); c->set_area_as_parent_rect(); c->set_stop_mouse(false); - c->set_material(memnew ( CanvasItemMaterial )); args.clear(); args.push_back(1); args.push_back(c); @@ -593,18 +568,6 @@ ColorPicker::ColorPicker() : //_update_color(); updating=false; - uv_material.instance(); - Ref<Shader> s_uv = get_shader("uv_editor"); - uv_material->set_shader(s_uv); - - w_material.instance(); - - Ref<Shader> s_w = get_shader("w_editor"); - w_material->set_shader(s_w); - - uv_edit->set_material(uv_material); - w_edit->set_material(w_material); - set_color(Color(1,1,1)); diff --git a/scene/gui/color_picker.h b/scene/gui/color_picker.h index 5e2cc57274..b742454361 100644 --- a/scene/gui/color_picker.h +++ b/scene/gui/color_picker.h @@ -57,8 +57,6 @@ private: List<Color> presets; ToolButton *btn_pick; CheckButton *btn_mode; - Ref<CanvasItemMaterial> uv_material; - Ref<CanvasItemMaterial> w_material; HSlider *scroll[4]; SpinBox *values[4]; Label *labels[4]; |