[Bf-committers] Texture.c patch for hard coded values

Hmetalcowgirl hmetalcowgirl at cowgirl.exenex.com
Tue Mar 8 12:17:47 CET 2005


Hey,

I'll look into it when i get back home.

--Emilie

--------- Original Message --------
From: bf-blender developers <bf-committers at projects.blender.org>
To: bf-blender developers <bf-committers at projects.blender.org>
Subject: Re: [Bf-committers] Texture.c patch for hard coded values
Date: 08/03/05 13:53

>
> In reply to Emilie McDavid (hmetalcowgirl at cowgirl.exenex.com):
>
> &gt; Hey guys,
> &gt;
> &gt;    This is a simple patch, I just changed the hard coded return
values
> &gt; for textures to defines as listed in DNA_texture_type.h. Desoto will
> &gt; probably commit, but if you want to get it before he does, here it
is.
> &gt; No hurry.
>
> While I haven't totally looked at this a couple of places you did this
change:
> -               rv += 2;
> +               rv=TEX_NOR;
>
> which I'm guessing is wrong.
>
> Kent
>
> &gt; Index: source/blender/render/intern/source/texture.c
> &gt; ===================================================================
> &gt; RCS file:
/cvsroot/bf-blender/blender/source/blender/render/intern/source/texture.c,v
> &gt; retrieving revision 1.40
> &gt; diff -u -r1.40 texture.c
> &gt; --- source/blender/render/intern/source/texture.c	7 Mar 2005 12:41:23
-0000	1.40
> &gt; +++ source/blender/render/intern/source/texture.c	7 Mar 2005 22:04:49
-0000
> &gt; @@ -88,7 +88,7 @@
> &gt;
> &gt;  	/* here (+fie_ima/2-1) makes sure that division happens correctly
*/
> &gt;
> &gt; -	if(tex-&gt;frames==0) return 1;
> &gt; +	if(tex-&gt;frames==0) return TEX_RGB;
> &gt;
> &gt;  	cfra= cfra-tex-&gt;sfra+1;
> &gt;
> &gt; @@ -313,7 +313,7 @@
> &gt;
> &gt;  	BRICONT;
> &gt;
> &gt; -	return 0;
> &gt; +	return TEX_INT;
> &gt;  }
> &gt;
> &gt;  /*
------------------------------------------------------------------------- */
> &gt; @@ -323,7 +323,7 @@
> &gt;
> &gt;  static int clouds(Tex *tex, float *texvec, TexResult *texres)
> &gt;  {
> &gt; -	int rv=0;	/* return value, int:0, col:1, nor:2, everything:3 */
> &gt; +	int rv=TEX_INT;	/* return value, int:0, col:1, nor:2, everything:3
*/
> &gt;
> &gt;  	texres-&gt;tin = BLI_gTurbulence(tex-&gt;noisesize, texvec[0],
texvec[1], texvec[2], tex-&gt;noisedepth,
(tex-&gt;noisetype!=TEX_NOISESOFT), tex-&gt;noisebasis);
> &gt;
> &gt; @@ -334,7 +334,7 @@
> &gt;  		texres-&gt;nor[2] = BLI_gTurbulence(tex-&gt;noisesize, texvec[0],
texvec[1], texvec[2] + tex-&gt;nabla, tex-&gt;noisedepth, 
(tex-&gt;noisetype!=TEX_NOISESOFT), tex-&gt;noisebasis);
> &gt;
> &gt;  		tex_normal_derivate(tex, texres);
> &gt; -		rv += 2;
> &gt; +		rv=TEX_NOR;
> &gt;  	}
> &gt;
> &gt;  	if (tex-&gt;stype==1) {
> &gt; @@ -428,7 +428,7 @@
> &gt;  		texres-&gt;nor[2] = wood_int(tex, texvec[0], texvec[1], texvec[2]
+ tex-&gt;nabla);
> &gt;
> &gt;  		tex_normal_derivate(tex, texres);
> &gt; -		rv = TEX_NOR;
> &gt; +		rv=TEX_NOR;
> &gt;  	}
> &gt;
> &gt;  	BRICONT;
> &gt; @@ -481,7 +481,7 @@
> &gt;
> &gt;  		tex_normal_derivate(tex, texres);
> &gt;
> &gt; -		rv = TEX_NOR;
> &gt; +		rv=TEX_NOR;
> &gt;  	}
> &gt;
> &gt;  	BRICONT;
> &gt; @@ -561,7 +561,7 @@
> &gt;  	BRICONTRGB;
> &gt;  	texres-&gt;ta= 1.0;
> &gt;
> &gt; -	return 1;
> &gt; +	return TEX_RGB;
> &gt;  }
> &gt;
> &gt;  /*
------------------------------------------------------------------------- */
> &gt; @@ -571,7 +571,7 @@
> &gt;  {
> &gt;  	float b2, ofs;
> &gt;
> &gt; -	if(texres-&gt;nor == NULL) return 0;
> &gt; +	if(texres-&gt;nor == NULL) return TEX_INT;
> &gt;
> &gt;  	ofs= tex-&gt;turbul/200.0;
> &gt;
> &gt; @@ -589,7 +589,7 @@
> &gt;  		texres-&gt;nor[2]= -texres-&gt;nor[2];
> &gt;  	}
> &gt;
> &gt; -	return 2;
> &gt; +	return TEX_NOR;
> &gt;  }
> &gt;
> &gt;  /*
------------------------------------------------------------------------- */
> &gt; @@ -597,7 +597,7 @@
> &gt;
> &gt;  static float mg_mFractalOrfBmTex(Tex *tex, float *texvec, TexResult
*texres)
> &gt;  {
> &gt; -	int rv=0;	/* return value, int:0, col:1, nor:2, everything:3 */
> &gt; +	int rv=TEX_INT;	/* return value, int:0, col:1, nor:2, everything:3
*/
> &gt;  	float (*mgravefunc)(float, float, float, float, float, float, int);
> &gt;
> &gt;  	if (tex-&gt;stype==TEX_MFRACTAL)
> &gt; @@ -616,7 +616,7 @@
> &gt;  		texres-&gt;nor[2] = tex-&gt;ns_outscale*mgravefunc(texvec[0],
texvec[1], texvec[2] + offs, tex-&gt;mg_H, tex-&gt;mg_lacunarity,
tex-&gt;mg_octaves, tex-&gt;noisebasis);
> &gt;
> &gt;  		tex_normal_derivate(tex, texres);
> &gt; -		rv += 2;
> &gt; +		rv=TEX_NOR;
> &gt;  	}
> &gt;
> &gt;  	BRICONT;
> &gt; @@ -627,7 +627,7 @@
> &gt;
> &gt;  static float mg_ridgedOrHybridMFTex(Tex *tex, float *texvec,
TexResult *texres)
> &gt;  {
> &gt; -	int rv=0;	/* return value, int:0, col:1, nor:2, everything:3 */
> &gt; +	int rv=TEX_INT;	/* return value, int:0, col:1, nor:2, everything:3
*/
> &gt;  	float (*mgravefunc)(float, float, float, float, float, float,
float, float, int);
> &gt;
> &gt;  	if (tex-&gt;stype==TEX_RIDGEDMF)
> &gt; @@ -646,7 +646,7 @@
> &gt;  		texres-&gt;nor[2] = tex-&gt;ns_outscale*mgravefunc(texvec[0],
texvec[1], texvec[2] + offs, tex-&gt;mg_H, tex-&gt;mg_lacunarity,
tex-&gt;mg_octaves, tex-&gt;mg_offset, tex-&gt;mg_gain, tex-&gt;noisebasis);
> &gt;
> &gt;  		tex_normal_derivate(tex, texres);
> &gt; -		rv += 2;
> &gt; +		rv=TEX_NOR;
> &gt;  	}
> &gt;
> &gt;  	BRICONT;
> &gt; @@ -658,7 +658,7 @@
> &gt;
> &gt;  static float mg_HTerrainTex(Tex *tex, float *texvec, TexResult
*texres)
> &gt;  {
> &gt; -	int rv=0;	/* return value, int:0, col:1, nor:2, everything:3 */
> &gt; +	int rv=TEX_INT;	/* return value, int:0, col:1, nor:2, everything:3
*/
> &gt;
> &gt;  	texres-&gt;tin = tex-&gt;ns_outscale*mg_HeteroTerrain(texvec[0],
texvec[1], texvec[2], tex-&gt;mg_H, tex-&gt;mg_lacunarity,
tex-&gt;mg_octaves, tex-&gt;mg_offset, tex-&gt;noisebasis);
> &gt;
> &gt; @@ -671,7 +671,7 @@
> &gt;  		texres-&gt;nor[2] =
tex-&gt;ns_outscale*mg_HeteroTerrain(texvec[0], texvec[1], texvec[2] + offs,
tex-&gt;mg_H, tex-&gt;mg_lacunarity, tex-&gt;mg_octaves, tex-&gt;mg_offset,
tex-&gt;noisebasis);
> &gt;
> &gt;  		tex_normal_derivate(tex, texres);
> &gt; -		rv += 2;
> &gt; +		rv=TEX_NOR;
> &gt;  	}
> &gt;
> &gt;  	BRICONT;
> &gt; @@ -683,7 +683,7 @@
> &gt;
> &gt;  static float mg_distNoiseTex(Tex *tex, float *texvec, TexResult
*texres)
> &gt;  {
> &gt; -	int rv=0;	/* return value, int:0, col:1, nor:2, everything:3 */
> &gt; +	int rv=TEX_INT;	/* return value, int:0, col:1, nor:2, everything:3
*/
> &gt;
> &gt;  	texres-&gt;tin = mg_VLNoise(texvec[0], texvec[1], texvec[2],
tex-&gt;dist_amount, tex-&gt;noisebasis, tex-&gt;noisebasis2);
> &gt;
> &gt; @@ -696,7 +696,7 @@
> &gt;  		texres-&gt;nor[2] = mg_VLNoise(texvec[0], texvec[1], texvec[2] +
offs, tex-&gt;dist_amount, tex-&gt;noisebasis, tex-&gt;noisebasis2);
> &gt;
> &gt;  		tex_normal_derivate(tex, texres);
> &gt; -		rv += 2;
> &gt; +		rv=TEX_NOR;
> &gt;  	}
> &gt;
> &gt;  	BRICONT;
> &gt; @@ -712,7 +712,7 @@
> &gt;
> &gt;  static float voronoiTex(Tex *tex, float *texvec, TexResult *texres)
> &gt;  {
> &gt; -	int rv=0;	/* return value, int:0, col:1, nor:2, everything:3 */
> &gt; +	int rv=TEX_INT;	/* return value, int:0, col:1, nor:2, everything:3
*/
> &gt;  	float da[4], pa[12];	/* distance and point coordinate arrays of 4
nearest neighbours */
> &gt;  	float aw1 = fabs(tex-&gt;vn_w1);
> &gt;  	float aw2 = fabs(tex-&gt;vn_w2);
> &gt; @@ -769,7 +769,7 @@
> &gt;  		texres-&gt;nor[2] = sc * fabs(tex-&gt;vn_w1*da[0] +
tex-&gt;vn_w2*da[1] + tex-&gt;vn_w3*da[2] + tex-&gt;vn_w4*da[3]);
> &gt;
> &gt;  		tex_normal_derivate(tex, texres);
> &gt; -		rv += 2;
> &gt; +		rv=TEX_NOR;
> &gt;  	}
> &gt;
> &gt;  	if (tex-&gt;vn_coltype) {
> &gt; @@ -805,7 +805,7 @@
> &gt;  	texres-&gt;tin= ((float)val)/div;;
> &gt;
> &gt;  	BRICONT;
> &gt; -	return 0;
> &gt; +	return TEX_INT;
> &gt;  }
> &gt;
> &gt;  /*
------------------------------------------------------------------------- */
>
> &gt; _______________________________________________
> &gt; Bf-committers mailing list
> &gt; Bf-committers at projects.blender.org
> &gt; http://projects.blender.org/mailman/listinfo/bf-committers
>
>
> --
> mein at cs.umn.edu
> http://www.cs.umn.edu/~mein
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at projects.blender.org
> http://projects.blender.org/mailman/listinfo/bf-committers
>
>
>
>
>

________________________________________________
This message has been sent via webmail.
Please forward unsolicited email (spam) to...
abuse at hostonce.com



More information about the Bf-committers mailing list