[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [40162] trunk/blender/source/blender: use vector size and const args where possible (no functional change)
Campbell Barton
ideasman42 at gmail.com
Mon Sep 12 15:00:24 CEST 2011
Revision: 40162
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=40162
Author: campbellbarton
Date: 2011-09-12 13:00:24 +0000 (Mon, 12 Sep 2011)
Log Message:
-----------
use vector size and const args where possible (no functional change)
Modified Paths:
--------------
trunk/blender/source/blender/blenkernel/BKE_material.h
trunk/blender/source/blender/blenkernel/intern/material.c
trunk/blender/source/blender/blenlib/BLI_math_matrix.h
trunk/blender/source/blender/blenlib/intern/math_matrix.c
trunk/blender/source/blender/render/extern/include/RE_render_ext.h
trunk/blender/source/blender/render/intern/include/pixelshading.h
trunk/blender/source/blender/render/intern/include/shadbuf.h
trunk/blender/source/blender/render/intern/include/shading.h
trunk/blender/source/blender/render/intern/include/texture.h
trunk/blender/source/blender/render/intern/include/volumetric.h
trunk/blender/source/blender/render/intern/source/imagetexture.c
trunk/blender/source/blender/render/intern/source/pixelshading.c
trunk/blender/source/blender/render/intern/source/render_texture.c
trunk/blender/source/blender/render/intern/source/shadbuf.c
trunk/blender/source/blender/render/intern/source/volumetric.c
Modified: trunk/blender/source/blender/blenkernel/BKE_material.h
===================================================================
--- trunk/blender/source/blender/blenkernel/BKE_material.h 2011-09-12 11:59:13 UTC (rev 40161)
+++ trunk/blender/source/blender/blenkernel/BKE_material.h 2011-09-12 13:00:24 UTC (rev 40162)
@@ -89,7 +89,7 @@
int material_in_material(struct Material *parmat, struct Material *mat);
-void ramp_blend(int type, float *r, float *g, float *b, float fac, float *col);
+void ramp_blend(int type, float *r, float *g, float *b, float fac, const float col[3]);
/* copy/paste */
void clear_matcopybuf(void);
Modified: trunk/blender/source/blender/blenkernel/intern/material.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/material.c 2011-09-12 11:59:13 UTC (rev 40161)
+++ trunk/blender/source/blender/blenkernel/intern/material.c 2011-09-12 13:00:24 UTC (rev 40162)
@@ -1122,7 +1122,7 @@
/* r g b = current value, col = new value, fac==0 is no change */
/* if g==NULL, it only does r channel */
-void ramp_blend(int type, float *r, float *g, float *b, float fac, float *col)
+void ramp_blend(int type, float *r, float *g, float *b, float fac, const float col[3])
{
float tmp, facm= 1.0f-fac;
Modified: trunk/blender/source/blender/blenlib/BLI_math_matrix.h
===================================================================
--- trunk/blender/source/blender/blenlib/BLI_math_matrix.h 2011-09-12 11:59:13 UTC (rev 40161)
+++ trunk/blender/source/blender/blenlib/BLI_math_matrix.h 2011-09-12 13:00:24 UTC (rev 40162)
@@ -83,7 +83,7 @@
float M5[4][4], float M6[4][4], float M7[4][4], float M8[4][4]);
void mul_m4_v3(float M[4][4], float r[3]);
-void mul_v3_m4v3(float r[3], float M[4][4], float v[3]);
+void mul_v3_m4v3(float r[3], float M[4][4], const float v[3]);
void mul_mat3_m4_v3(float M[4][4], float r[3]);
void mul_m4_v4(float M[4][4], float r[4]);
void mul_v4_m4v4(float r[4], float M[4][4], float v[4]);
Modified: trunk/blender/source/blender/blenlib/intern/math_matrix.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/math_matrix.c 2011-09-12 11:59:13 UTC (rev 40161)
+++ trunk/blender/source/blender/blenlib/intern/math_matrix.c 2011-09-12 13:00:24 UTC (rev 40162)
@@ -306,7 +306,7 @@
}
}
-void mul_m4_v3(float mat[][4], float *vec)
+void mul_m4_v3(float mat[][4], float vec[3])
{
float x,y;
@@ -317,7 +317,7 @@
vec[2]=x*mat[0][2] + y*mat[1][2] + mat[2][2]*vec[2] + mat[3][2];
}
-void mul_v3_m4v3(float *in, float mat[][4], float *vec)
+void mul_v3_m4v3(float in[3], float mat[][4], const float vec[3])
{
float x,y;
@@ -329,7 +329,7 @@
}
/* same as mul_m4_v3() but doesnt apply translation component */
-void mul_mat3_m4_v3(float mat[][4], float *vec)
+void mul_mat3_m4_v3(float mat[][4], float vec[3])
{
float x,y;
@@ -384,7 +384,7 @@
copy_v3_v3(r, tmp);
}
-void mul_transposed_m3_v3(float mat[][3], float *vec)
+void mul_transposed_m3_v3(float mat[][3], float vec[3])
{
float x,y;
@@ -422,7 +422,7 @@
m[i][j] *= f;
}
-void mul_m3_v3_double(float mat[][3], double *vec)
+void mul_m3_v3_double(float mat[][3], double vec[3])
{
double x,y;
@@ -979,14 +979,14 @@
copy_m4_m3(mat, tmat);
}
-void mat3_to_size(float *size, float mat[][3])
+void mat3_to_size(float size[3], float mat[][3])
{
size[0]= len_v3(mat[0]);
size[1]= len_v3(mat[1]);
size[2]= len_v3(mat[2]);
}
-void mat4_to_size(float *size, float mat[][4])
+void mat4_to_size(float size[3], float mat[][4])
{
size[0]= len_v3(mat[0]);
size[1]= len_v3(mat[1]);
Modified: trunk/blender/source/blender/render/extern/include/RE_render_ext.h
===================================================================
--- trunk/blender/source/blender/render/extern/include/RE_render_ext.h 2011-09-12 11:59:13 UTC (rev 40161)
+++ trunk/blender/source/blender/render/extern/include/RE_render_ext.h 2011-09-12 13:00:24 UTC (rev 40162)
@@ -55,10 +55,10 @@
//void RE_zbufferall_radio(struct RadView *vw, struct RNode **rg_elem, int rg_totelem, struct Render *re);
/* particle.c, effect.c, editmesh_modes.c and brush.c, returns 1 if rgb, 0 otherwise */
-int externtex(struct MTex *mtex, float *vec, float *tin, float *tr, float *tg, float *tb, float *ta, const int thread);
+int externtex(struct MTex *mtex, const float vec[3], float *tin, float *tr, float *tg, float *tb, float *ta, const int thread);
/* particle.c */
-void texture_rgb_blend(float *in, float *tex, float *out, float fact, float facg, int blendtype);
+void texture_rgb_blend(float in[3], const float tex[3], const float out[3], float fact, float facg, int blendtype);
float texture_value_blend(float tex, float out, float fact, float facg, int blendtype);
/* node_composite.c */
Modified: trunk/blender/source/blender/render/intern/include/pixelshading.h
===================================================================
--- trunk/blender/source/blender/render/intern/include/pixelshading.h 2011-09-12 11:59:13 UTC (rev 40161)
+++ trunk/blender/source/blender/render/intern/include/pixelshading.h 2011-09-12 13:00:24 UTC (rev 40162)
@@ -58,10 +58,10 @@
/**
* Render the sky at pixel (x, y).
*/
-void shadeSkyPixel(float *collector, float fx, float fy, short thread);
-void shadeSkyView(float *colf, float *rco, float *view, float *dxyview, short thread);
+void shadeSkyPixel(float collector[4], float fx, float fy, short thread);
+void shadeSkyView(float col_r[3], const float rco[3], const float view[3], const float dxyview[2], short thread);
void shadeAtmPixel(struct SunSky *sunsky, float *collector, float fx, float fy, float distance);
-void shadeSunView(float *colf, float *view);
+void shadeSunView(float col_r[3], const float view[3]);
/* ------------------------------------------------------------------------- */
#endif
Modified: trunk/blender/source/blender/render/intern/include/shadbuf.h
===================================================================
--- trunk/blender/source/blender/render/intern/include/shadbuf.h 2011-09-12 11:59:13 UTC (rev 40161)
+++ trunk/blender/source/blender/render/intern/include/shadbuf.h 2011-09-12 13:00:24 UTC (rev 40162)
@@ -59,13 +59,13 @@
* @param inp The inproduct between viewvector and ?
*
*/
-float testshadowbuf(struct Render *re, struct ShadBuf *shb, float *rco, float *dxco, float *dyco, float inp, float mat_bias);
+float testshadowbuf(struct Render *re, struct ShadBuf *shb, const float rco[3], const float dxco[3], const float dyco[3], float inp, float mat_bias);
/**
* Determines the shadow factor for lamp <lar>, between <p1>
* and <p2>. (Which CS?)
*/
-float shadow_halo(LampRen *lar, float *p1, float *p2);
+float shadow_halo(LampRen *lar, const float p1[3], const float p2[3]);
/**
* Irregular shadowbuffer
Modified: trunk/blender/source/blender/render/intern/include/shading.h
===================================================================
--- trunk/blender/source/blender/render/intern/include/shading.h 2011-09-12 11:59:13 UTC (rev 40161)
+++ trunk/blender/source/blender/render/intern/include/shading.h 2011-09-12 13:00:24 UTC (rev 40162)
@@ -96,7 +96,7 @@
void environment_lighting_apply(struct ShadeInput *shi, struct ShadeResult *shr);
ListBase *get_lights(struct ShadeInput *shi);
-float lamp_get_visibility(struct LampRen *lar, float *co, float *lv, float *dist);
+float lamp_get_visibility(struct LampRen *lar, const float co[3], float *lv, float *dist);
void lamp_get_shadow(struct LampRen *lar, ShadeInput *shi, float inp, float *shadfac, int do_real);
float fresnel_fac(float *view, float *vn, float fresnel, float fac);
Modified: trunk/blender/source/blender/render/intern/include/texture.h
===================================================================
--- trunk/blender/source/blender/render/intern/include/texture.h 2011-09-12 11:59:13 UTC (rev 40161)
+++ trunk/blender/source/blender/render/intern/include/texture.h 2011-09-12 13:00:24 UTC (rev 40162)
@@ -64,11 +64,11 @@
/* texture.h */
-void do_halo_tex(struct HaloRen *har, float xn, float yn, float *colf);
-void do_sky_tex(float *rco, float *lo, float *dxyview, float *hor, float *zen, float *blend, int skyflag, short thread);
+void do_halo_tex(struct HaloRen *har, float xn, float yn, float col_r[4]);
+void do_sky_tex(const float rco[3], float lo[3], const float dxyview[2], float hor[3], float zen[3], float *blend, int skyflag, short thread);
void do_material_tex(struct ShadeInput *shi);
-void do_lamp_tex(LampRen *la, float *lavec, struct ShadeInput *shi, float *colf, int effect);
-void do_volume_tex(struct ShadeInput *shi, float *xyz, int mapto_flag, float *col, float *val);
+void do_lamp_tex(LampRen *la, const float lavec[3], struct ShadeInput *shi, float col_r[3], int effect);
+void do_volume_tex(struct ShadeInput *shi, const float xyz[3], int mapto_flag, float col[3], float *val);
void init_render_textures(Render *re);
void end_render_textures(Render *re);
@@ -77,8 +77,8 @@
/* imagetexture.h */
-int imagewraposa(struct Tex *tex, struct Image *ima, struct ImBuf *ibuf, float *texvec, float *dxt, float *dyt, struct TexResult *texres);
-int imagewrap(struct Tex *tex, struct Image *ima, struct ImBuf *ibuf, float *texvec, struct TexResult *texres);
+int imagewraposa(struct Tex *tex, struct Image *ima, struct ImBuf *ibuf, const float texvec[3], const float dxt[3], const float dyt[3], struct TexResult *texres);
+int imagewrap(struct Tex *tex, struct Image *ima, struct ImBuf *ibuf, const float texvec[3], struct TexResult *texres);
void image_sample(struct Image *ima, float fx, float fy, float dx, float dy, float *result);
#endif /* TEXTURE_EXT_H */
Modified: trunk/blender/source/blender/render/intern/include/volumetric.h
===================================================================
--- trunk/blender/source/blender/render/intern/include/volumetric.h 2011-09-12 11:59:13 UTC (rev 40161)
+++ trunk/blender/source/blender/render/intern/include/volumetric.h 2011-09-12 13:00:24 UTC (rev 40162)
@@ -35,8 +35,8 @@
struct ShadeInput;
struct ShadeResult;
-float vol_get_density(struct ShadeInput *shi, float *co);
-void vol_get_scattering(ShadeInput *shi, float *scatter_col, float *co_, float *view);
+float vol_get_density(struct ShadeInput *shi, const float co[3]);
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list