From 66afddb3e8db03a675e744f74b07acc4db8f2aa1 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sun, 11 Jan 2015 11:43:31 -0300 Subject: -Initial (untested) implementation of 2D shaders. Probably broken, will be fixed later. -fixed issue of opacity not working --- scene/resources/shader.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'scene/resources/shader.h') diff --git a/scene/resources/shader.h b/scene/resources/shader.h index 8c15ca43d4..4a380d455b 100644 --- a/scene/resources/shader.h +++ b/scene/resources/shader.h @@ -80,6 +80,16 @@ public: Ref get_default_texture_param(const StringName& p_param) const; void get_default_texture_param_list(List* r_textures) const; + _FORCE_INLINE_ StringName remap_param(const StringName& p_param) const { + if (params_cache_dirty) + get_param_list(NULL); + + const Map::Element *E=params_cache.find(p_param); + if (E) + return E->get(); + return StringName(); + } + virtual RID get_rid() const; Shader(Mode p_mode); @@ -98,6 +108,15 @@ public: MaterialShader() : Shader(MODE_MATERIAL) {}; }; +class CanvasItemShader : public Shader { + + OBJ_TYPE(CanvasItemShader,Shader); + +public: + + CanvasItemShader() : Shader(MODE_CANVAS_ITEM) {}; +}; + class ResourceFormatLoaderShader : public ResourceFormatLoader { -- cgit v1.2.3