diff options
author | hurikhan <m4r10.5ch14ck@gmail.com> | 2015-01-12 11:30:19 +0800 |
---|---|---|
committer | hurikhan <m4r10.5ch14ck@gmail.com> | 2015-01-12 11:30:19 +0800 |
commit | 6b6c5260488d21c399d389d11e676cce0eba3379 (patch) | |
tree | e0b322c1c293b448e200b40872e9cfdeff1c9230 /servers/visual/visual_server_raster.cpp | |
parent | c464cd44609e24974cba1cd25315b1e1e1fc8942 (diff) | |
parent | f3dc51fc69ec3a16c6b2a6834ff0a6d933b1ddca (diff) |
Merge branch 'master' into x11-window-management
Diffstat (limited to 'servers/visual/visual_server_raster.cpp')
-rw-r--r-- | servers/visual/visual_server_raster.cpp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/servers/visual/visual_server_raster.cpp b/servers/visual/visual_server_raster.cpp index 78094ee2aa..7e915be3d5 100644 --- a/servers/visual/visual_server_raster.cpp +++ b/servers/visual/visual_server_raster.cpp @@ -3699,6 +3699,42 @@ void VisualServerRaster::canvas_item_set_z(RID p_item, int p_z) { } +void VisualServerRaster::canvas_item_set_shader(RID p_item, RID p_shader) { + + VS_CHANGED; + CanvasItem *canvas_item = canvas_item_owner.get( p_item ); + ERR_FAIL_COND(!canvas_item); + canvas_item->shader=p_shader; +} + +RID VisualServerRaster::canvas_item_get_shader(RID p_item) const{ + + CanvasItem *canvas_item = canvas_item_owner.get( p_item ); + ERR_FAIL_COND_V(!canvas_item,RID()); + return canvas_item->shader; + +} + +void VisualServerRaster::canvas_item_set_shader_param(RID p_canvas_item, const StringName& p_param, const Variant& p_value){ + + VS_CHANGED; + CanvasItem *canvas_item = canvas_item_owner.get( p_canvas_item ); + ERR_FAIL_COND(!canvas_item); + if (p_value.get_type()==Variant::NIL) + canvas_item->shader_param.erase(p_param); + else + canvas_item->shader_param[p_param]=p_value; + +} +Variant VisualServerRaster::canvas_item_get_shader_param(RID p_canvas_item, const StringName& p_param) const{ + + CanvasItem *canvas_item = canvas_item_owner.get( p_canvas_item ); + ERR_FAIL_COND_V(!canvas_item,Variant()); + ERR_FAIL_COND_V(!canvas_item->shader_param.has(p_param),Variant()); + + return canvas_item->shader_param[p_param]; +} + void VisualServerRaster::canvas_item_set_sort_children_by_y(RID p_item, bool p_enable) { |