[Bf-blender-cvs] [8a183aa] master: Cleanup: use BKE_texture_ prefix

Campbell Barton noreply at git.blender.org
Sat Mar 28 17:19:34 CET 2015


Commit: 8a183aa26bc34fe441ba1ad3e5f2c307ed54f6b7
Author: Campbell Barton
Date:   Sun Mar 29 03:16:55 2015 +1100
Branches: master
https://developer.blender.org/rB8a183aa26bc34fe441ba1ad3e5f2c307ed54f6b7

Cleanup: use BKE_texture_ prefix

===================================================================

M	source/blender/blenkernel/BKE_texture.h
M	source/blender/blenkernel/intern/brush.c
M	source/blender/blenkernel/intern/texture.c
M	source/blender/blenloader/intern/versioning_250.c
M	source/blender/blenloader/intern/versioning_260.c
M	source/blender/editors/render/render_preview.c
M	source/blender/editors/render/render_shading.c
M	source/blender/editors/sculpt_paint/paint_image_proj.c
M	source/blender/makesrna/intern/rna_main_api.c
M	source/blender/makesrna/intern/rna_material.c
M	source/blender/makesrna/intern/rna_nodetree.c
M	source/blender/makesrna/intern/rna_texture.c
M	source/blender/makesrna/intern/rna_texture_api.c
M	source/blender/nodes/composite/nodes/node_composite_mapValue.c
M	source/blender/nodes/shader/nodes/node_shader_mapping.c
M	source/blender/nodes/shader/nodes/node_shader_tex_brick.c
M	source/blender/nodes/shader/nodes/node_shader_tex_checker.c
M	source/blender/nodes/shader/nodes/node_shader_tex_environment.c
M	source/blender/nodes/shader/nodes/node_shader_tex_gradient.c
M	source/blender/nodes/shader/nodes/node_shader_tex_image.c
M	source/blender/nodes/shader/nodes/node_shader_tex_magic.c
M	source/blender/nodes/shader/nodes/node_shader_tex_musgrave.c
M	source/blender/nodes/shader/nodes/node_shader_tex_noise.c
M	source/blender/nodes/shader/nodes/node_shader_tex_sky.c
M	source/blender/nodes/shader/nodes/node_shader_tex_voronoi.c
M	source/blender/nodes/shader/nodes/node_shader_tex_wave.c
M	source/blender/nodes/texture/nodes/node_texture_proc.c
M	source/blender/render/intern/source/envmap.c
M	source/blender/render/intern/source/render_texture.c

===================================================================

diff --git a/source/blender/blenkernel/BKE_texture.h b/source/blender/blenkernel/BKE_texture.h
index 03ddbb7..ad48593 100644
--- a/source/blender/blenkernel/BKE_texture.h
+++ b/source/blender/blenkernel/BKE_texture.h
@@ -61,8 +61,6 @@ struct World;
 #define MAXCOLORBAND 32
 
 
-void BKE_texture_free(struct Tex *t); 
-
 void init_colorband(struct ColorBand *coba, bool rangetype);
 struct ColorBand *add_colorband(bool rangetype);
 bool do_colorband(const struct ColorBand *coba, float in, float out[4]);
@@ -71,15 +69,17 @@ struct CBData *colorband_element_add(struct ColorBand *coba, float position);
 int colorband_element_remove(struct ColorBand *coba, int index);
 void colorband_update_sort(struct ColorBand *coba);
 
-void default_tex(struct Tex *tex);
-struct Tex *add_texture(struct Main *bmain, const char *name);
-void tex_set_type(struct Tex *tex, int type);
-void default_mtex(struct MTex *mtex);
-struct MTex *add_mtex(void);
-struct MTex *add_mtex_id(struct ID *id, int slot);
-struct Tex *BKE_texture_copy(struct Tex *tex);
-struct Tex *localize_texture(struct Tex *tex);
-void BKE_texture_make_local(struct Tex *tex);
+void         BKE_texture_free(struct Tex *tex);
+void         BKE_texture_default(struct Tex *tex);
+struct Tex  *BKE_texture_copy(struct Tex *tex);
+struct Tex  *BKE_texture_add(struct Main *bmain, const char *name);
+struct Tex  *BKE_texture_localize(struct Tex *tex);
+void         BKE_texture_make_local(struct Tex *tex);
+void         BKE_texture_type_set(struct Tex *tex, int type);
+
+void         BKE_texture_mtex_default(struct MTex *mtex);
+struct MTex *BKE_texture_mtex_add(void);
+struct MTex *BKE_texture_mtex_add_id(struct ID *id, int slot);
 /* UNUSED */
 // void autotexname(struct Tex *tex);
 
@@ -105,32 +105,32 @@ void set_current_particle_texture(struct ParticleSettings *part, struct Tex *tex
 
 bool has_current_material_texture(struct Material *ma);
 
-struct TexMapping *add_tex_mapping(int type);
-void default_tex_mapping(struct TexMapping *texmap, int type);
-void init_tex_mapping(struct TexMapping *texmap);
+struct TexMapping *BKE_texture_mapping_add(int type);
+void               BKE_texture_mapping_default(struct TexMapping *texmap, int type);
+void               BKE_texture_mapping_init(struct TexMapping *texmap);
+
+struct ColorMapping *BKE_texture_colormapping_add(void);
+void                 BKE_texture_colormapping_default(struct ColorMapping *colormap);
 
-struct ColorMapping *add_color_mapping(void);
-void default_color_mapping(struct ColorMapping *colormap);
+void           BKE_texture_envmap_free_data(struct EnvMap *env);
+void           BKE_texture_envmap_free(struct EnvMap *env);
+struct EnvMap *BKE_texture_envmap_add(void);
+struct EnvMap *BKE_texture_envmap_copy(struct EnvMap *env);
 
-void    BKE_free_envmapdata(struct EnvMap *env);
-void    BKE_free_envmap(struct EnvMap *env);
-struct EnvMap *BKE_add_envmap(void);
-struct EnvMap *BKE_copy_envmap(struct EnvMap *env);
+void                 BKE_texture_pointdensity_free_data(struct PointDensity *pd);
+void                 BKE_texture_pointdensity_free(struct PointDensity *pd);
+struct PointDensity *BKE_texture_pointdensity_add(void);
+struct PointDensity *BKE_texture_pointdensity_copy(struct PointDensity *pd);
 
-void    BKE_free_pointdensitydata(struct PointDensity *pd);
-void    BKE_free_pointdensity(struct PointDensity *pd);
-struct PointDensity *BKE_add_pointdensity(void);
-struct PointDensity *BKE_copy_pointdensity(struct PointDensity *pd);
+void              BKE_texture_voxeldata_free_data(struct VoxelData *vd);
+void              BKE_texture_voxeldata_free(struct VoxelData *vd);
+struct VoxelData *BKE_texture_voxeldata_add(void);
+struct VoxelData *BKE_texture_voxeldata_copy(struct VoxelData *vd);
 
-void BKE_free_voxeldatadata(struct VoxelData *vd);
-void BKE_free_voxeldata(struct VoxelData *vd);
-struct VoxelData *BKE_add_voxeldata(void);
-struct VoxelData *BKE_copy_voxeldata(struct VoxelData *vd);
+void             BKE_texture_ocean_free(struct OceanTex *ot);
+struct OceanTex *BKE_texture_ocean_add(void);
+struct OceanTex *BKE_texture_ocean_copy(struct OceanTex *ot);
 
-void BKE_free_oceantex(struct OceanTex *ot);
-struct OceanTex *BKE_add_oceantex(void);
-struct OceanTex *BKE_copy_oceantex(struct OceanTex *ot);
-	
 bool    BKE_texture_dependsOnTime(const struct Tex *texture);
 bool    BKE_texture_is_image_user(const struct Tex *tex);
 
diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c
index 10d7792..661bf6e 100644
--- a/source/blender/blenkernel/intern/brush.c
+++ b/source/blender/blenkernel/intern/brush.c
@@ -103,8 +103,8 @@ static void brush_defaults(Brush *brush)
 	brush->jitter = 0.0f;
 
 	/* BRUSH TEXTURE SETTINGS */
-	default_mtex(&brush->mtex);
-	default_mtex(&brush->mask_mtex);
+	BKE_texture_mtex_default(&brush->mtex);
+	BKE_texture_mtex_default(&brush->mask_mtex);
 
 	brush->texture_sample_bias = 0; /* value to added to texture samples */
 	brush->texture_overlay_alpha = 33;
@@ -469,7 +469,7 @@ int BKE_brush_texture_set_nr(Brush *brush, int nr)
 	idtest = (ID *)BLI_findlink(&G.main->tex, nr - 1);
 	if (idtest == NULL) { /* new tex */
 		if (id) idtest = (ID *)BKE_texture_copy((Tex *)id);
-		else idtest = (ID *)add_texture(G.main, "Tex");
+		else idtest = (ID *)BKE_texture_add(G.main, "Tex");
 		idtest->us--;
 	}
 	if (idtest != id) {
diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c
index 07b1e9e..7e7bcac 100644
--- a/source/blender/blenkernel/intern/texture.c
+++ b/source/blender/blenkernel/intern/texture.c
@@ -73,16 +73,16 @@
 
 /* ****************** Mapping ******************* */
 
-TexMapping *add_tex_mapping(int type)
+TexMapping *BKE_texture_mapping_add(int type)
 {
 	TexMapping *texmap = MEM_callocN(sizeof(TexMapping), "TexMapping");
 	
-	default_tex_mapping(texmap, type);
+	BKE_texture_mapping_default(texmap, type);
 	
 	return texmap;
 }
 
-void default_tex_mapping(TexMapping *texmap, int type)
+void BKE_texture_mapping_default(TexMapping *texmap, int type)
 {
 	memset(texmap, 0, sizeof(TexMapping));
 
@@ -97,7 +97,7 @@ void default_tex_mapping(TexMapping *texmap, int type)
 	texmap->type = type;
 }
 
-void init_tex_mapping(TexMapping *texmap)
+void BKE_texture_mapping_init(TexMapping *texmap)
 {
 	float smat[4][4], rmat[4][4], tmat[4][4], proj[4][4], size[3];
 
@@ -170,16 +170,16 @@ void init_tex_mapping(TexMapping *texmap)
 	}
 }
 
-ColorMapping *add_color_mapping(void)
+ColorMapping *BKE_texture_colormapping_add(void)
 {
 	ColorMapping *colormap = MEM_callocN(sizeof(ColorMapping), "ColorMapping");
 	
-	default_color_mapping(colormap);
+	BKE_texture_colormapping_default(colormap);
 	
 	return colormap;
 }
 
-void default_color_mapping(ColorMapping *colormap)
+void BKE_texture_colormapping_default(ColorMapping *colormap)
 {
 	memset(colormap, 0, sizeof(ColorMapping));
 
@@ -560,10 +560,10 @@ int colorband_element_remove(struct ColorBand *coba, int index)
 void BKE_texture_free(Tex *tex)
 {
 	if (tex->coba) MEM_freeN(tex->coba);
-	if (tex->env) BKE_free_envmap(tex->env);
-	if (tex->pd) BKE_free_pointdensity(tex->pd);
-	if (tex->vd) BKE_free_voxeldata(tex->vd);
-	if (tex->ot) BKE_free_oceantex(tex->ot);
+	if (tex->env) BKE_texture_envmap_free(tex->env);
+	if (tex->pd) BKE_texture_pointdensity_free(tex->pd);
+	if (tex->vd) BKE_texture_voxeldata_free(tex->vd);
+	if (tex->ot) BKE_texture_ocean_free(tex->ot);
 	BKE_free_animdata((struct ID *)tex);
 	
 	BKE_previewimg_free(&tex->preview);
@@ -578,7 +578,7 @@ void BKE_texture_free(Tex *tex)
 
 /* ------------------------------------------------------------------------- */
 
-void default_tex(Tex *tex)
+void BKE_texture_default(Tex *tex)
 {
 	tex->type = TEX_IMAGE;
 	tex->ima = NULL;
@@ -657,25 +657,25 @@ void default_tex(Tex *tex)
 	tex->preview = NULL;
 }
 
-void tex_set_type(Tex *tex, int type)
+void BKE_texture_type_set(Tex *tex, int type)
 {
 	switch (type) {
 			
 		case TEX_VOXELDATA:
 			if (tex->vd == NULL)
-				tex->vd = BKE_add_voxeldata();
+				tex->vd = BKE_texture_voxeldata_add();
 			break;
 		case TEX_POINTDENSITY:
 			if (tex->pd == NULL)
-				tex->pd = BKE_add_pointdensity();
+				tex->pd = BKE_texture_pointdensity_add();
 			break;
 		case TEX_ENVMAP:
 			if (tex->env == NULL)
-				tex->env = BKE_add_envmap();
+				tex->env = BKE_texture_envmap_add();
 			break;
 		case TEX_OCEAN:
 			if (tex->ot == NULL)
-				tex->ot = BKE_add_oceantex();
+				tex->ot = BKE_texture_ocean_add();
 			break;
 	}
 	
@@ -684,20 +684,20 @@ void tex_set_type(Tex *tex, int type)
 
 /* ------------------------------------------------------------------------- */
 
-Tex *add_texture(Main *bmain, const char *name)
+Tex *BKE_texture_add(Main *bmain, const char *name)
 {
 	Tex *tex;
 
 	tex = BKE_libblock_alloc(bmain, ID_TE, name);
 	
-	default_tex(tex);
+	BKE_texture_default(tex);
 	
 	return tex;
 }
 
 /* ------------------------------------------------------------------------- */
 
-void default_mtex(MTex *mtex)
+void BKE_texture_mtex_default(MTex *mtex)
 {
 	mtex->texco = TEXCO_UV;
 	mtex->mapto = MAP_COL;
@@ -767,19 +767,19 @@ void default_mtex(MTex *mtex)
 
 /* ------------------------------------------------------------------------- */
 
-MTex *add_mtex(void)
+MTex *BKE_texture_mtex_add(void)
 {
 	MTex *mtex;
 	
-	mtex = MEM_callocN(sizeof(MTex), "add_mtex");
+	mtex = MEM_callocN(sizeof(MTex), "BKE_texture_mtex_add");
 	
-	default_mtex(mtex);
+	BKE_texture_mtex_default(mtex);
 	
 	return mtex;
 }
 
 /* slot -1 for first free ID */
-MTex *add_mtex_id(ID *id, int slot)
+MTex *BKE_texture_mtex_add_id(ID *id, int slot)
 {
 	MTex **mtex_ar;
 	short act;
@@ -820,7 +820,7 @@ MTex *add_mtex_id(ID *id, int slot)
 		((Material *)id)->septex &= ~(1 << slot);
 	}
 
-	mtex_ar[slot] = add_mtex();
+	mtex_ar[slot] = BKE_texture_mtex_add();
 
 	return mtex_ar[slot];
 }
@@ -840,10 +840,10 @@ Tex *BKE_texture_copy(Tex *tex)
 	}
 	
 	if (texn->coba) texn->coba = MEM_dupallocN(texn->coba);
-	if (texn->env) texn->env = BKE_copy_envmap(texn->env);
-	if (texn->pd) texn->pd = BKE_copy_pointdensity(texn->pd);
+	if (texn->env) texn->env = BKE_texture_envmap_copy(texn->env);
+	if (texn->pd) texn->pd = BKE_texture_p

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list