Merged the particles-2010 branch with node improvements into trunk.
[blender-staging.git] / source / blender / nodes / composite / nodes / node_composite_colorSpill.c
similarity index 93%
rename from source/blender/nodes/intern/CMP_nodes/CMP_colorSpill.c
rename to source/blender/nodes/composite/nodes/node_composite_colorSpill.c
index 905d97709c3a6f05d4807eb0e0510dad08c4c3df..18b6d806c82a02b146e5d21af24520d9512f8ffe 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id$
+ * $Id: CMP_colorSpill.c 36593 2011-05-10 11:19:26Z lukastoenne $
  *
  * ***** BEGIN GPL LICENSE BLOCK *****
  *
  * ***** END GPL LICENSE BLOCK *****
  */
 
-/** \file blender/nodes/intern/CMP_nodes/CMP_colorSpill.c
+/** \file blender/nodes/composite/nodes/node_composite_colorSpill.c
  *  \ingroup cmpnodes
  */
 
 
 
-#include "../CMP_util.h"
+#include "node_composite_util.h"
 
 #define avg(a,b) ((a+b)/2)
 
 /* ******************* Color Spill Supression ********************************* */
-static bNodeSocketType cmp_node_color_spill_in[]={
-       {SOCK_RGBA,1,"Image", 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f},
-       {SOCK_VALUE, 1, "Fac",  1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f},
+static bNodeSocketTemplate cmp_node_color_spill_in[]={
+       {SOCK_RGBA,1,"Image", 0.8f, 0.8f, 0.8f, 1.0f},
+       {SOCK_FLOAT, 1, "Fac",  1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_FACTOR},
        {-1,0,""}
 };
 
-static bNodeSocketType cmp_node_color_spill_out[]={
-       {SOCK_RGBA,0,"Image", 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f},
+static bNodeSocketTemplate cmp_node_color_spill_out[]={
+       {SOCK_RGBA,0,"Image"},
        {-1,0,""}
 };
 
@@ -315,7 +315,7 @@ static void node_composit_exec_color_spill(void *UNUSED(data), bNode *node, bNod
        free_compbuf(spillmap);
 }
 
-static void node_composit_init_color_spill(bNode *node)
+static void node_composit_init_color_spill(bNodeTree *UNUSED(ntree), bNode* node, bNodeTemplate *UNUSED(ntemp))
 {
        NodeColorspill *ncs= MEM_callocN(sizeof(NodeColorspill), "node colorspill");
        node->storage=ncs;
@@ -330,8 +330,8 @@ void register_node_type_cmp_color_spill(ListBase *lb)
 {
        static bNodeType ntype;
        
-       node_type_base(&ntype, CMP_NODE_COLOR_SPILL, "Color Spill", NODE_CLASS_MATTE, NODE_OPTIONS,
-                                  cmp_node_color_spill_in, cmp_node_color_spill_out);
+       node_type_base(&ntype, CMP_NODE_COLOR_SPILL, "Color Spill", NODE_CLASS_MATTE, NODE_OPTIONS);
+       node_type_socket_templates(&ntype, cmp_node_color_spill_in, cmp_node_color_spill_out);
        node_type_size(&ntype, 140, 80, 200);
        node_type_init(&ntype, node_composit_init_color_spill);
        node_type_storage(&ntype, "NodeColorspill", node_free_standard_storage, node_copy_standard_storage);