summaryrefslogtreecommitdiff
path: root/servers
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2014-12-21 11:42:44 -0300
committerJuan Linietsky <reduzio@gmail.com>2014-12-21 11:42:44 -0300
commitf7f197c40941ffaf03fcddeb20536dec8074ca00 (patch)
tree7a69483162bb873813f6152176b815d189af4edd /servers
parent9783f6fc969947fdbf666950ab3da21ac462c57e (diff)
-ability to set default textures in shader (needed for visual shader editing)
-work in progress new graph system (will replace current one) -crash fix in s3m loader (out of bounds acess) -fixed vbox overriding of separation (fixes empty line between section tabs)
Diffstat (limited to 'servers')
-rw-r--r--servers/visual/rasterizer.h4
-rw-r--r--servers/visual/rasterizer_dummy.cpp10
-rw-r--r--servers/visual/rasterizer_dummy.h4
-rw-r--r--servers/visual/visual_server_raster.cpp10
-rw-r--r--servers/visual/visual_server_raster.h4
-rw-r--r--servers/visual/visual_server_wrap_mt.h4
-rw-r--r--servers/visual_server.h4
7 files changed, 40 insertions, 0 deletions
diff --git a/servers/visual/rasterizer.h b/servers/visual/rasterizer.h
index 55625a2218..8731095425 100644
--- a/servers/visual/rasterizer.h
+++ b/servers/visual/rasterizer.h
@@ -187,6 +187,7 @@ public:
virtual bool texture_has_alpha(RID p_texture) const=0;
virtual void texture_set_size_override(RID p_texture,int p_width, int p_height)=0;
+
virtual void texture_set_reload_hook(RID p_texture,ObjectID p_owner,const StringName& p_function) const=0;
/* SHADER API */
@@ -203,6 +204,9 @@ public:
virtual void shader_get_param_list(RID p_shader, List<PropertyInfo> *p_param_list) const=0;
+ virtual void shader_set_default_texture_param(RID p_shader, const StringName& p_name, RID p_texture)=0;
+ virtual RID shader_get_default_texture_param(RID p_shader, const StringName& p_name) const=0;
+
/* COMMON MATERIAL API */
virtual RID material_create()=0;
diff --git a/servers/visual/rasterizer_dummy.cpp b/servers/visual/rasterizer_dummy.cpp
index a671821e25..a399960014 100644
--- a/servers/visual/rasterizer_dummy.cpp
+++ b/servers/visual/rasterizer_dummy.cpp
@@ -221,6 +221,16 @@ void RasterizerDummy::shader_get_param_list(RID p_shader, List<PropertyInfo> *p_
}
+
+void RasterizerDummy::shader_set_default_texture_param(RID p_shader, const StringName& p_name, RID p_texture) {
+
+}
+
+RID RasterizerDummy::shader_get_default_texture_param(RID p_shader, const StringName& p_name) const {
+
+ return RID();
+}
+
/* COMMON MATERIAL API */
diff --git a/servers/visual/rasterizer_dummy.h b/servers/visual/rasterizer_dummy.h
index 44bca423a4..d879fcafeb 100644
--- a/servers/visual/rasterizer_dummy.h
+++ b/servers/visual/rasterizer_dummy.h
@@ -429,6 +429,10 @@ public:
virtual void shader_get_param_list(RID p_shader, List<PropertyInfo> *p_param_list) const;
+
+ virtual void shader_set_default_texture_param(RID p_shader, const StringName& p_name, RID p_texture);
+ virtual RID shader_get_default_texture_param(RID p_shader, const StringName& p_name) const;
+
/* COMMON MATERIAL API */
virtual RID material_create();
diff --git a/servers/visual/visual_server_raster.cpp b/servers/visual/visual_server_raster.cpp
index af50b9b592..7cfa6dbb32 100644
--- a/servers/visual/visual_server_raster.cpp
+++ b/servers/visual/visual_server_raster.cpp
@@ -157,6 +157,16 @@ void VisualServerRaster::shader_get_param_list(RID p_shader, List<PropertyInfo>
}
+void VisualServerRaster::shader_set_default_texture_param(RID p_shader, const StringName& p_name, RID p_texture) {
+
+ rasterizer->shader_set_default_texture_param(p_shader,p_name,p_texture);
+}
+
+RID VisualServerRaster::shader_get_default_texture_param(RID p_shader, const StringName& p_name) const{
+
+ return rasterizer->shader_get_default_texture_param(p_shader,p_name);
+}
+
/* Material */
diff --git a/servers/visual/visual_server_raster.h b/servers/visual/visual_server_raster.h
index 3064f9ceb0..ce52077550 100644
--- a/servers/visual/visual_server_raster.h
+++ b/servers/visual/visual_server_raster.h
@@ -756,6 +756,10 @@ public:
virtual void shader_get_param_list(RID p_shader, List<PropertyInfo> *p_param_list) const;
+ virtual void shader_set_default_texture_param(RID p_shader, const StringName& p_name, RID p_texture);
+ virtual RID shader_get_default_texture_param(RID p_shader, const StringName& p_name) const;
+
+
/* COMMON MATERIAL API */
virtual RID material_create();
diff --git a/servers/visual/visual_server_wrap_mt.h b/servers/visual/visual_server_wrap_mt.h
index a4653b1013..7d2b8a3767 100644
--- a/servers/visual/visual_server_wrap_mt.h
+++ b/servers/visual/visual_server_wrap_mt.h
@@ -653,6 +653,10 @@ public:
FUNC1RC(String,shader_get_light_code,RID);
FUNC2SC(shader_get_param_list,RID,List<PropertyInfo>*);
+ FUNC3(shader_set_default_texture_param,RID,const StringName&,RID);
+ FUNC2RC(RID,shader_get_default_texture_param,RID,const StringName&);
+
+
/*virtual void shader_get_param_list(RID p_shader, List<PropertyInfo> *p_param_list) {
if (Thread::get_caller_ID()!=server_thread) {
command_queue.push_and_sync( visual_server, &VisualServer::shader_get_param_list,p_shader,p_param_list);
diff --git a/servers/visual_server.h b/servers/visual_server.h
index ed04b0d09c..4336a91407 100644
--- a/servers/visual_server.h
+++ b/servers/visual_server.h
@@ -140,6 +140,7 @@ public:
SHADER_POST_PROCESS,
};
+
virtual RID shader_create(ShaderMode p_mode=SHADER_MATERIAL)=0;
virtual void shader_set_mode(RID p_shader,ShaderMode p_mode)=0;
@@ -151,6 +152,9 @@ public:
virtual String shader_get_light_code(RID p_shader) const=0;
virtual void shader_get_param_list(RID p_shader, List<PropertyInfo> *p_param_list) const=0;
+ virtual void shader_set_default_texture_param(RID p_shader, const StringName& p_name, RID p_texture)=0;
+ virtual RID shader_get_default_texture_param(RID p_shader, const StringName& p_name) const=0;
+
/* COMMON MATERIAL API */