~ubuntu-branches/ubuntu/trusty/blender/trusty

« back to all changes in this revision

Viewing changes to source/blender/nodes/texture/nodes/node_texture_texture.c

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2013-03-06 12:08:47 UTC
  • mfrom: (1.5.1) (14.1.8 experimental)
  • Revision ID: package-import@ubuntu.com-20130306120847-frjfaryb2zrotwcg
Tags: 2.66a-1ubuntu1
* Resynchronize with Debian (LP: #1076930, #1089256, #1052743, #999024,
  #1122888, #1147084)
* debian/control:
  - Lower build-depends on libavcodec-dev since we're not
    doing the libav9 transition in Ubuntu yet

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
 
36
36
#include "RE_shader_ext.h"
37
37
 
38
 
static bNodeSocketTemplate inputs[]= {
39
 
        { SOCK_RGBA, 1, "Color1", 1.0f, 1.0f, 1.0f, 1.0f },
40
 
        { SOCK_RGBA, 1, "Color2", 0.0f, 0.0f, 0.0f, 1.0f },
 
38
static bNodeSocketTemplate inputs[] = {
 
39
        { SOCK_RGBA, 1, N_("Color1"), 1.0f, 1.0f, 1.0f, 1.0f },
 
40
        { SOCK_RGBA, 1, N_("Color2"), 0.0f, 0.0f, 0.0f, 1.0f },
41
41
        { -1, 0, "" }
42
42
};
43
43
 
44
 
static bNodeSocketTemplate outputs[]= {
45
 
        { SOCK_RGBA, 0, "Color" },
 
44
static bNodeSocketTemplate outputs[] = {
 
45
        { SOCK_RGBA, 0, N_("Color") },
46
46
        { -1, 0, "" }
47
47
};
48
48
 
49
49
static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread)
50
50
{
51
51
        Tex *nodetex = (Tex *)node->id;
52
 
        static float red[] = {1,0,0,1};
53
 
        static float white[] = {1,1,1,1};
 
52
        static float red[] = {1, 0, 0, 1};
 
53
        static float white[] = {1, 1, 1, 1};
54
54
        float co[3], dxt[3], dyt[3];
55
55
        
56
56
        copy_v3_v3(co, p->co);
65
65
        
66
66
        if (node->custom2 || node->need_exec==0) {
67
67
                /* this node refers to its own texture tree! */
68
 
                copy_v4_v4(out, (fabs(co[0] - co[1]) < .01) ? white : red );
 
68
                copy_v4_v4(out, (fabsf(co[0] - co[1]) < 0.01f) ? white : red);
69
69
        }
70
70
        else if (nodetex) {
71
71
                TexResult texres;
72
72
                int textype;
73
 
                float nor[] = {0,0,0};
 
73
                float nor[] = {0, 0, 0};
74
74
                float col1[4], col2[4];
75
75
                
76
76
                tex_input_rgba(col1, in[0], p, thread);
78
78
                
79
79
                texres.nor = nor;
80
80
                textype = multitex_nodes(nodetex, co, dxt, dyt, p->osatex,
81
 
                        &texres, thread, 0, p->shi, p->mtex);
 
81
                        &texres, thread, 0, p->shi, p->mtex, NULL);
82
82
                
83
83
                if (textype & TEX_RGB) {
84
84
                        copy_v4_v4(out, &texres.tr);