From 8a183aa26bc34fe441ba1ad3e5f2c307ed54f6b7 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 29 Mar 2015 03:16:55 +1100 Subject: Cleanup: use BKE_texture_ prefix --- source/blender/blenkernel/BKE_texture.h | 64 ++++++------ source/blender/blenkernel/intern/brush.c | 6 +- source/blender/blenkernel/intern/texture.c | 110 ++++++++++----------- source/blender/blenloader/intern/versioning_250.c | 4 +- source/blender/blenloader/intern/versioning_260.c | 2 +- source/blender/editors/render/render_preview.c | 2 +- source/blender/editors/render/render_shading.c | 6 +- .../editors/sculpt_paint/paint_image_proj.c | 4 +- source/blender/makesrna/intern/rna_main_api.c | 4 +- source/blender/makesrna/intern/rna_material.c | 4 +- source/blender/makesrna/intern/rna_nodetree.c | 2 +- source/blender/makesrna/intern/rna_texture.c | 6 +- source/blender/makesrna/intern/rna_texture_api.c | 2 +- .../composite/nodes/node_composite_mapValue.c | 2 +- .../nodes/shader/nodes/node_shader_mapping.c | 2 +- .../nodes/shader/nodes/node_shader_tex_brick.c | 4 +- .../nodes/shader/nodes/node_shader_tex_checker.c | 4 +- .../shader/nodes/node_shader_tex_environment.c | 4 +- .../nodes/shader/nodes/node_shader_tex_gradient.c | 4 +- .../nodes/shader/nodes/node_shader_tex_image.c | 4 +- .../nodes/shader/nodes/node_shader_tex_magic.c | 4 +- .../nodes/shader/nodes/node_shader_tex_musgrave.c | 4 +- .../nodes/shader/nodes/node_shader_tex_noise.c | 4 +- .../nodes/shader/nodes/node_shader_tex_sky.c | 4 +- .../nodes/shader/nodes/node_shader_tex_voronoi.c | 4 +- .../nodes/shader/nodes/node_shader_tex_wave.c | 4 +- .../nodes/texture/nodes/node_texture_proc.c | 2 +- source/blender/render/intern/source/envmap.c | 10 +- .../blender/render/intern/source/render_texture.c | 6 +- 29 files changed, 141 insertions(+), 141 deletions(-) (limited to 'source/blender') diff --git a/source/blender/blenkernel/BKE_texture.h b/source/blender/blenkernel/BKE_texture.h index 03ddbb706d7..ad485931ee3 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 10d77921515..661bf6e7d76 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 07b1e9e30ac..7e7bcace30d 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_pointdensity_copy(texn->pd); if (texn->vd) texn->vd = MEM_dupallocN(texn->vd); - if (texn->ot) texn->ot = BKE_copy_oceantex(texn->ot); + if (texn->ot) texn->ot = BKE_texture_ocean_copy(texn->ot); if (tex->preview) texn->preview = BKE_previewimg_copy(tex->preview); if (tex->nodetree) { @@ -861,7 +861,7 @@ Tex *BKE_texture_copy(Tex *tex) } /* texture copy without adding to main dbase */ -Tex *localize_texture(Tex *tex) +Tex *BKE_texture_localize(Tex *tex) { Tex *texn; @@ -871,17 +871,17 @@ Tex *localize_texture(Tex *tex) if (texn->coba) texn->coba = MEM_dupallocN(texn->coba); if (texn->env) { - texn->env = BKE_copy_envmap(texn->env); + texn->env = BKE_texture_envmap_copy(texn->env); id_us_min(&texn->env->ima->id); } - if (texn->pd) texn->pd = BKE_copy_pointdensity(texn->pd); + if (texn->pd) texn->pd = BKE_texture_pointdensity_copy(texn->pd); if (texn->vd) { texn->vd = MEM_dupallocN(texn->vd); if (texn->vd->dataset) texn->vd->dataset = MEM_dupallocN(texn->vd->dataset); } if (texn->ot) { - texn->ot = BKE_copy_oceantex(tex->ot); + texn->ot = BKE_texture_ocean_copy(tex->ot); } texn->preview = NULL; @@ -1132,7 +1132,7 @@ void set_current_lamp_texture(Lamp *la, Tex *newtex) if (newtex) { if (!la->mtex[act]) { - la->mtex[act] = add_mtex(); + la->mtex[act] = BKE_texture_mtex_add(); la->mtex[act]->texco = TEXCO_GLOB; } @@ -1167,7 +1167,7 @@ void set_current_linestyle_texture(FreestyleLineStyle *linestyle, Tex *newtex) if (newtex) { if (!linestyle->mtex[act]) { - linestyle->mtex[act] = add_mtex(); + linestyle->mtex[act] = BKE_texture_mtex_add(); linestyle->mtex[act]->texco = TEXCO_STROKE; } @@ -1296,7 +1296,7 @@ void set_current_material_texture(Material *ma, Tex *newtex) if (newtex) { if (!ma->mtex[act]) { - ma->mtex[act] = add_mtex(); + ma->mtex[act] = BKE_texture_mtex_add(); /* Reset this slot's ON/OFF toggle, for materials, when slot was empty. */ ma->septex &= ~(1 << act); } @@ -1347,7 +1347,7 @@ void set_current_world_texture(World *wo, Tex *newtex) if (newtex) { if (!wo->mtex[act]) { - wo->mtex[act] = add_mtex(); + wo->mtex[act] = BKE_texture_mtex_add(); wo->mtex[act]->texco = TEXCO_VIEW; } @@ -1398,7 +1398,7 @@ void set_current_particle_texture(ParticleSettings *part, Tex *newtex) if (newtex) { if (!part->mtex[act]) { - part->mtex[act] = add_mtex(); + part->mtex[act] = BKE_texture_mtex_add(); part->mtex[act]->texco = TEXCO_ORCO; part->mtex[act]->blendtype = MTEX_MUL; } @@ -1414,7 +1414,7 @@ void set_current_particle_texture(ParticleSettings *part, Tex *newtex) /* ------------------------------------------------------------------------- */ -EnvMap *BKE_add_envmap(void) +EnvMap *BKE_texture_envmap_add(void) { EnvMap *env; @@ -1431,7 +1431,7 @@ EnvMap *BKE_add_envmap(void) /* ------------------------------------------------------------------------- */ -EnvMap *BKE_copy_envmap(EnvMap *env) +EnvMap *BKE_texture_envmap_copy(EnvMap *env) { EnvMap *envn; int a; @@ -1446,7 +1446,7 @@ EnvMap *BKE_copy_envmap(EnvMap *env) /* ------------------------------------------------------------------------- */ -void BKE_free_envmapdata(EnvMap *env) +void BKE_texture_envmap_free_data(EnvMap *env) { unsigned int part; @@ -1460,17 +1460,17 @@ void BKE_free_envmapdata(EnvMap *env) /* ------------------------------------------------------------------------- */ -void BKE_free_envmap(EnvMap *env) +void BKE_texture_envmap_free(EnvMap *env) { - BKE_free_envmapdata(env); + BKE_texture_envmap_free_data(env); MEM_freeN(env); } /* ------------------------------------------------------------------------- */ -PointDensity *BKE_add_pointdensity(void) +PointDensity *BKE_texture_pointdensity_add(void) { PointDensity *pd; @@ -1502,7 +1502,7 @@ PointDensity *BKE_add_pointdensity(void) return pd; } -PointDensity *BKE_copy_pointdensity(PointDensity *pd) +PointDensity *BKE_texture_pointdensity_copy(PointDensity *pd) { PointDensity *pdn; @@ -1514,7 +1514,7 @@ PointDensity *BKE_copy_pointdensity(PointDensity *pd) return pdn; } -void BKE_free_pointdensitydata(PointDensity *pd) +void BKE_texture_pointdensity_free_data(PointDensity *pd) { if (pd->point_tree) { BLI_bvhtree_free(pd->point_tree); @@ -1532,15 +1532,15 @@ void BKE_free_pointdensitydata(PointDensity *pd) curvemapping_free(pd->falloff_curve); /* can be NULL */ } -void BKE_free_pointdensity(PointDensity *pd) +void BKE_texture_pointdensity_free(PointDensity *pd) { - BKE_free_pointdensitydata(pd); + BKE_texture_pointdensity_free_data(pd); MEM_freeN(pd); } /* ------------------------------------------------------------------------- */ -void BKE_free_voxeldatadata(VoxelData *vd) +void BKE_texture_voxeldata_free_data(VoxelData *vd) { if (vd->dataset) { MEM_freeN(vd->dataset); @@ -1549,13 +1549,13 @@ void BKE_free_voxeldatadata(VoxelData *vd) } -void BKE_free_voxeldata(VoxelData *vd) +void BKE_texture_voxeldata_free(VoxelData *vd) { - BKE_free_voxeldatadata(vd); + BKE_texture_voxeldata_free_data(vd); MEM_freeN(vd); } -VoxelData *BKE_add_voxeldata(void) +VoxelData *BKE_texture_voxeldata_add(void) { VoxelData *vd; @@ -1573,7 +1573,7 @@ VoxelData *BKE_add_voxeldata(void) return vd; } -VoxelData *BKE_copy_voxeldata(VoxelData *vd) +VoxelData *BKE_texture_voxeldata_copy(VoxelData *vd) { VoxelData *vdn; @@ -1585,7 +1585,7 @@ VoxelData *BKE_copy_voxeldata(VoxelData *vd) /* ------------------------------------------------------------------------- */ -OceanTex *BKE_add_oceantex(void) +OceanTex *BKE_texture_ocean_add(void) { OceanTex *ot; @@ -1596,14 +1596,14 @@ OceanTex *BKE_add_oceantex(void) return ot; } -OceanTex *BKE_copy_oceantex(struct OceanTex *ot) +OceanTex *BKE_texture_ocean_copy(struct OceanTex *ot) { OceanTex *otn = MEM_dupallocN(ot); return otn; } -void BKE_free_oceantex(struct OceanTex *ot) +void BKE_texture_ocean_free(struct OceanTex *ot) { MEM_freeN(ot); } diff --git a/source/blender/blenloader/intern/versioning_250.c b/source/blender/blenloader/intern/versioning_250.c index 2094aeb1485..274fc474ade 100644 --- a/source/blender/blenloader/intern/versioning_250.c +++ b/source/blender/blenloader/intern/versioning_250.c @@ -1652,8 +1652,8 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main) /* brush texture changes */ for (brush = main->brush.first; brush; brush = brush->id.next) { - default_mtex(&brush->mtex); - default_mtex(&brush->mask_mtex); + BKE_texture_mtex_default(&brush->mtex); + BKE_texture_mtex_default(&brush->mask_mtex); } for (ma = main->mat.first; ma; ma = ma->id.next) { diff --git a/source/blender/blenloader/intern/versioning_260.c b/source/blender/blenloader/intern/versioning_260.c index 10526a191d2..734dc33ea24 100644 --- a/source/blender/blenloader/intern/versioning_260.c +++ b/source/blender/blenloader/intern/versioning_260.c @@ -2096,7 +2096,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main) if (!MAIN_VERSION_ATLEAST(main, 266, 4)) { Brush *brush; for (brush = main->brush.first; brush; brush = brush->id.next) { - default_mtex(&brush->mask_mtex); + BKE_texture_mtex_default(&brush->mask_mtex); if (brush->ob_mode & OB_MODE_TEXTURE_PAINT) { brush->spacing /= 2; diff --git a/source/blender/editors/render/render_preview.c b/source/blender/editors/render/render_preview.c index 99edaff759e..9dbd2e88563 100644 --- a/source/blender/editors/render/render_preview.c +++ b/source/blender/editors/render/render_preview.c @@ -423,7 +423,7 @@ static Scene *preview_prepare_scene(Scene *scene, ID *id, int id_type, ShaderPre Tex *tex = NULL, *origtex = (Tex *)id; if (origtex) { - tex = localize_texture(origtex); + tex = BKE_texture_localize(origtex); sp->texcopy = tex; BLI_addtail(&pr_main->tex, tex); } diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c index 75b8b8cebde..cf712a653e6 100644 --- a/source/blender/editors/render/render_shading.c +++ b/source/blender/editors/render/render_shading.c @@ -450,7 +450,7 @@ static int new_texture_exec(bContext *C, wmOperator *UNUSED(op)) tex = BKE_texture_copy(tex); } else { - tex = add_texture(bmain, DATA_("Texture")); + tex = BKE_texture_add(bmain, DATA_("Texture")); } /* hook into UI */ @@ -1492,7 +1492,7 @@ static int envmap_clear_exec(bContext *C, wmOperator *UNUSED(op)) { Tex *tex = CTX_data_pointer_get_type(C, "texture", &RNA_Texture).data; - BKE_free_envmapdata(tex->env); + BKE_texture_envmap_free_data(tex->env); WM_event_add_notifier(C, NC_TEXTURE | NA_EDITED, tex); @@ -1535,7 +1535,7 @@ static int envmap_clear_all_exec(bContext *C, wmOperator *UNUSED(op)) for (tex = bmain->tex.first; tex; tex = tex->id.next) if (tex->env) - BKE_free_envmapdata(tex->env); + BKE_texture_envmap_free_data(tex->env); WM_event_add_notifier(C, NC_TEXTURE | NA_EDITED, tex); diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c index 805c271f2d1..f853fd91491 100644 --- a/source/blender/editors/sculpt_paint/paint_image_proj.c +++ b/source/blender/editors/sculpt_paint/paint_image_proj.c @@ -5487,7 +5487,7 @@ static bool proj_paint_add_slot(bContext *C, wmOperator *op) ntreeUpdateTree(CTX_data_main(C), ntree); } else { - MTex *mtex = add_mtex_id(&ma->id, -1); + MTex *mtex = BKE_texture_mtex_add_id(&ma->id, -1); /* successful creation of mtex layer, now create set */ if (mtex) { @@ -5506,7 +5506,7 @@ static bool proj_paint_add_slot(bContext *C, wmOperator *op) } } - mtex->tex = add_texture(bmain, DATA_(layer_type_items[type_id].name)); + mtex->tex = BKE_texture_add(bmain, DATA_(layer_type_items[type_id].name)); mtex->mapto = type; if (mtex->tex) { diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c index ed28b0b1255..1d232720fc5 100644 --- a/source/blender/makesrna/intern/rna_main_api.c +++ b/source/blender/makesrna/intern/rna_main_api.c @@ -461,8 +461,8 @@ static void rna_Main_fonts_remove(Main *bmain, ReportList *reports, PointerRNA * static Tex *rna_Main_textures_new(Main *bmain, const char *name, int type) { - Tex *tex = add_texture(bmain, name); - tex_set_type(tex, type); + Tex *tex = BKE_texture_add(bmain, name); + BKE_texture_type_set(tex, type); id_us_min(&tex->id); return tex; } diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c index 7a06b647ae3..874e861f75f 100644 --- a/source/blender/makesrna/intern/rna_material.c +++ b/source/blender/makesrna/intern/rna_material.c @@ -377,7 +377,7 @@ static EnumPropertyItem *rna_Material_texture_coordinates_itemf(bContext *UNUSED MTex *rna_mtex_texture_slots_add(ID *self_id, struct bContext *C, ReportList *reports) { - MTex *mtex = add_mtex_id(self_id, -1); + MTex *mtex = BKE_texture_mtex_add_id(self_id, -1); if (mtex == NULL) { BKE_reportf(reports, RPT_ERROR, "Maximum number of textures added %d", MAX_MTEX); return NULL; @@ -398,7 +398,7 @@ MTex *rna_mtex_texture_slots_create(ID *self_id, struct bContext *C, ReportList return NULL; } - mtex = add_mtex_id(self_id, index); + mtex = BKE_texture_mtex_add_id(self_id, index); /* for redraw only */ WM_event_add_notifier(C, NC_TEXTURE, CTX_data_scene(C)); diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index eb2cb9e9312..90ee9e1d7d9 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -2701,7 +2701,7 @@ static void rna_Image_Node_update_id(Main *UNUSED(bmain), Scene *UNUSED(scene), static void rna_Mapping_Node_update(Main *bmain, Scene *scene, PointerRNA *ptr) { bNode *node = ptr->data; - init_tex_mapping(node->storage); + BKE_texture_mapping_init(node->storage); rna_Node_update(bmain, scene, ptr); } diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c index c1882e7767d..726744782ed 100644 --- a/source/blender/makesrna/intern/rna_texture.c +++ b/source/blender/makesrna/intern/rna_texture.c @@ -181,7 +181,7 @@ static void rna_Texture_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *pt static void rna_Texture_mapping_update(Main *bmain, Scene *scene, PointerRNA *ptr) { TexMapping *texmap = ptr->data; - init_tex_mapping(texmap); + BKE_texture_mapping_init(texmap); rna_Texture_update(bmain, scene, ptr); } @@ -222,7 +222,7 @@ static void rna_Texture_type_set(PointerRNA *ptr, int value) { Tex *tex = (Tex *)ptr->data; - tex_set_type(tex, value); + BKE_texture_type_set(tex, value); } void rna_TextureSlot_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) @@ -445,7 +445,7 @@ static void rna_Envmap_update_generic(Main *bmain, Scene *scene, PointerRNA *ptr Tex *tex = ptr->id.data; if (tex->env) { ED_preview_kill_jobs(bmain->wm.first, bmain); - BKE_free_envmapdata(tex->env); + BKE_texture_envmap_free_data(tex->env); } rna_Texture_update(bmain, scene, ptr); } diff --git a/source/blender/makesrna/intern/rna_texture_api.c b/source/blender/makesrna/intern/rna_texture_api.c index acf8333d6dc..a27ba6ea06d 100644 --- a/source/blender/makesrna/intern/rna_texture_api.c +++ b/source/blender/makesrna/intern/rna_texture_api.c @@ -60,7 +60,7 @@ static void clear_envmap(struct EnvMap *env, bContext *C) Main *bmain = CTX_data_main(C); Tex *tex; - BKE_free_envmapdata(env); + BKE_texture_envmap_free_data(env); for (tex = bmain->tex.first; tex; tex = tex->id.next) if (tex->env == env) { diff --git a/source/blender/nodes/composite/nodes/node_composite_mapValue.c b/source/blender/nodes/composite/nodes/node_composite_mapValue.c index 22d16e93879..35096d57a4e 100644 --- a/source/blender/nodes/composite/nodes/node_composite_mapValue.c +++ b/source/blender/nodes/composite/nodes/node_composite_mapValue.c @@ -44,7 +44,7 @@ static bNodeSocketTemplate cmp_node_map_value_out[] = { static void node_composit_init_map_value(bNodeTree *UNUSED(ntree), bNode *node) { - node->storage = add_tex_mapping(TEXMAP_TYPE_POINT); + node->storage = BKE_texture_mapping_add(TEXMAP_TYPE_POINT); } void register_node_type_cmp_map_value(void) diff --git a/source/blender/nodes/shader/nodes/node_shader_mapping.c b/source/blender/nodes/shader/nodes/node_shader_mapping.c index cff4a039602..2af6e19565b 100644 --- a/source/blender/nodes/shader/nodes/node_shader_mapping.c +++ b/source/blender/nodes/shader/nodes/node_shader_mapping.c @@ -71,7 +71,7 @@ static void node_shader_exec_mapping(void *UNUSED(data), int UNUSED(thread), bNo static void node_shader_init_mapping(bNodeTree *UNUSED(ntree), bNode *node) { - node->storage = add_tex_mapping(TEXMAP_TYPE_POINT); + node->storage = BKE_texture_mapping_add(TEXMAP_TYPE_POINT); } static int gpu_shader_mapping(GPUMaterial *mat, bNode *node, bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *out) diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_brick.c b/source/blender/nodes/shader/nodes/node_shader_tex_brick.c index f75f6a654d1..569eaf5ff9b 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_brick.c +++ b/source/blender/nodes/shader/nodes/node_shader_tex_brick.c @@ -51,8 +51,8 @@ static bNodeSocketTemplate sh_node_tex_brick_out[] = { static void node_shader_init_tex_brick(bNodeTree *UNUSED(ntree), bNode *node) { NodeTexBrick *tex = MEM_callocN(sizeof(NodeTexBrick), "NodeTexBrick"); - default_tex_mapping(&tex->base.tex_mapping, TEXMAP_TYPE_POINT); - default_color_mapping(&tex->base.color_mapping); + BKE_texture_mapping_default(&tex->base.tex_mapping, TEXMAP_TYPE_POINT); + BKE_texture_colormapping_default(&tex->base.color_mapping); tex->offset = 0.5f; tex->squash = 1.0f; diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_checker.c b/source/blender/nodes/shader/nodes/node_shader_tex_checker.c index 30e51c7cb7d..b7498df1706 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_checker.c +++ b/source/blender/nodes/shader/nodes/node_shader_tex_checker.c @@ -46,8 +46,8 @@ static bNodeSocketTemplate sh_node_tex_checker_out[] = { static void node_shader_init_tex_checker(bNodeTree *UNUSED(ntree), bNode *node) { NodeTexChecker *tex = MEM_callocN(sizeof(NodeTexChecker), "NodeTexChecker"); - default_tex_mapping(&tex->base.tex_mapping, TEXMAP_TYPE_POINT); - default_color_mapping(&tex->base.color_mapping); + BKE_texture_mapping_default(&tex->base.tex_mapping, TEXMAP_TYPE_POINT); + BKE_texture_colormapping_default(&tex->base.color_mapping); node->storage = tex; } diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_environment.c b/source/blender/nodes/shader/nodes/node_shader_tex_environment.c index 8d6a77455bb..2b43667a009 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_environment.c +++ b/source/blender/nodes/shader/nodes/node_shader_tex_environment.c @@ -42,8 +42,8 @@ static bNodeSocketTemplate sh_node_tex_environment_out[] = { static void node_shader_init_tex_environment(bNodeTree *UNUSED(ntree), bNode *node) { NodeTexEnvironment *tex = MEM_callocN(sizeof(NodeTexEnvironment), "NodeTexEnvironment"); - default_tex_mapping(&tex->base.tex_mapping, TEXMAP_TYPE_POINT); - default_color_mapping(&tex->base.color_mapping); + BKE_texture_mapping_default(&tex->base.tex_mapping, TEXMAP_TYPE_POINT); + BKE_texture_colormapping_default(&tex->base.color_mapping); tex->color_space = SHD_COLORSPACE_COLOR; tex->projection = SHD_PROJ_EQUIRECTANGULAR; tex->iuser.frames = 1; diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_gradient.c b/source/blender/nodes/shader/nodes/node_shader_tex_gradient.c index e11591ab5ce..24916e8f013 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_gradient.c +++ b/source/blender/nodes/shader/nodes/node_shader_tex_gradient.c @@ -43,8 +43,8 @@ static bNodeSocketTemplate sh_node_tex_gradient_out[] = { static void node_shader_init_tex_gradient(bNodeTree *UNUSED(ntree), bNode *node) { NodeTexGradient *tex = MEM_callocN(sizeof(NodeTexGradient), "NodeTexGradient"); - default_tex_mapping(&tex->base.tex_mapping, TEXMAP_TYPE_POINT); - default_color_mapping(&tex->base.color_mapping); + BKE_texture_mapping_default(&tex->base.tex_mapping, TEXMAP_TYPE_POINT); + BKE_texture_colormapping_default(&tex->base.color_mapping); tex->gradient_type = SHD_BLEND_LINEAR; node->storage = tex; diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_image.c b/source/blender/nodes/shader/nodes/node_shader_tex_image.c index 62db5b70891..f87e792399b 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_image.c +++ b/source/blender/nodes/shader/nodes/node_shader_tex_image.c @@ -43,8 +43,8 @@ static bNodeSocketTemplate sh_node_tex_image_out[] = { static void node_shader_init_tex_image(bNodeTree *UNUSED(ntree), bNode *node) { NodeTexImage *tex = MEM_callocN(sizeof(NodeTexImage), "NodeTexImage"); - default_tex_mapping(&tex->base.tex_mapping, TEXMAP_TYPE_POINT); - default_color_mapping(&tex->base.color_mapping); + BKE_texture_mapping_default(&tex->base.tex_mapping, TEXMAP_TYPE_POINT); + BKE_texture_colormapping_default(&tex->base.color_mapping); tex->color_space = SHD_COLORSPACE_COLOR; tex->iuser.frames = 1; tex->iuser.sfra = 1; diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_magic.c b/source/blender/nodes/shader/nodes/node_shader_tex_magic.c index de2daeb8ee1..80904e376bc 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_magic.c +++ b/source/blender/nodes/shader/nodes/node_shader_tex_magic.c @@ -45,8 +45,8 @@ static bNodeSocketTemplate sh_node_tex_magic_out[] = { static void node_shader_init_tex_magic(bNodeTree *UNUSED(ntree), bNode *node) { NodeTexMagic *tex = MEM_callocN(sizeof(NodeTexMagic), "NodeTexMagic"); - default_tex_mapping(&tex->base.tex_mapping, TEXMAP_TYPE_POINT); - default_color_mapping(&tex->base.color_mapping); + BKE_texture_mapping_default(&tex->base.tex_mapping, TEXMAP_TYPE_POINT); + BKE_texture_colormapping_default(&tex->base.color_mapping); tex->depth = 2; node->storage = tex; diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_musgrave.c b/source/blender/nodes/shader/nodes/node_shader_tex_musgrave.c index 75566773ea2..825ba7eb3c1 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_musgrave.c +++ b/source/blender/nodes/shader/nodes/node_shader_tex_musgrave.c @@ -49,8 +49,8 @@ static bNodeSocketTemplate sh_node_tex_musgrave_out[] = { static void node_shader_init_tex_musgrave(bNodeTree *UNUSED(ntree), bNode *node) { NodeTexMusgrave *tex = MEM_callocN(sizeof(NodeTexMusgrave), "NodeTexMusgrave"); - default_tex_mapping(&tex->base.tex_mapping, TEXMAP_TYPE_POINT); - default_color_mapping(&tex->base.color_mapping); + BKE_texture_mapping_default(&tex->base.tex_mapping, TEXMAP_TYPE_POINT); + BKE_texture_colormapping_default(&tex->base.color_mapping); tex->musgrave_type = SHD_MUSGRAVE_FBM; node->storage = tex; diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_noise.c b/source/blender/nodes/shader/nodes/node_shader_tex_noise.c index 601a31dff00..d806140694e 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_noise.c +++ b/source/blender/nodes/shader/nodes/node_shader_tex_noise.c @@ -46,8 +46,8 @@ static bNodeSocketTemplate sh_node_tex_noise_out[] = { static void node_shader_init_tex_noise(bNodeTree *UNUSED(ntree), bNode *node) { NodeTexNoise *tex = MEM_callocN(sizeof(NodeTexNoise), "NodeTexNoise"); - default_tex_mapping(&tex->base.tex_mapping, TEXMAP_TYPE_POINT); - default_color_mapping(&tex->base.color_mapping); + BKE_texture_mapping_default(&tex->base.tex_mapping, TEXMAP_TYPE_POINT); + BKE_texture_colormapping_default(&tex->base.color_mapping); node->storage = tex; } diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_sky.c b/source/blender/nodes/shader/nodes/node_shader_tex_sky.c index 51cca0df851..495c78ca929 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_sky.c +++ b/source/blender/nodes/shader/nodes/node_shader_tex_sky.c @@ -42,8 +42,8 @@ static bNodeSocketTemplate sh_node_tex_sky_out[] = { static void node_shader_init_tex_sky(bNodeTree *UNUSED(ntree), bNode *node) { NodeTexSky *tex = MEM_callocN(sizeof(NodeTexSky), "NodeTexSky"); - default_tex_mapping(&tex->base.tex_mapping, TEXMAP_TYPE_POINT); - default_color_mapping(&tex->base.color_mapping); + BKE_texture_mapping_default(&tex->base.tex_mapping, TEXMAP_TYPE_POINT); + BKE_texture_colormapping_default(&tex->base.color_mapping); tex->sun_direction[0] = 0.0f; tex->sun_direction[1] = 0.0f; tex->sun_direction[2] = 1.0f; diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_voronoi.c b/source/blender/nodes/shader/nodes/node_shader_tex_voronoi.c index 5eba5f3f59d..88596a4a72f 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_voronoi.c +++ b/source/blender/nodes/shader/nodes/node_shader_tex_voronoi.c @@ -44,8 +44,8 @@ static bNodeSocketTemplate sh_node_tex_voronoi_out[] = { static void node_shader_init_tex_voronoi(bNodeTree *UNUSED(ntree), bNode *node) { NodeTexVoronoi *tex = MEM_callocN(sizeof(NodeTexVoronoi), "NodeTexVoronoi"); - default_tex_mapping(&tex->base.tex_mapping, TEXMAP_TYPE_POINT); - default_color_mapping(&tex->base.color_mapping); + BKE_texture_mapping_default(&tex->base.tex_mapping, TEXMAP_TYPE_POINT); + BKE_texture_colormapping_default(&tex->base.color_mapping); tex->coloring = SHD_VORONOI_INTENSITY; node->storage = tex; diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_wave.c b/source/blender/nodes/shader/nodes/node_shader_tex_wave.c index ef79aac0d32..100510641e8 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_wave.c +++ b/source/blender/nodes/shader/nodes/node_shader_tex_wave.c @@ -47,8 +47,8 @@ static bNodeSocketTemplate sh_node_tex_wave_out[] = { static void node_shader_init_tex_wave(bNodeTree *UNUSED(ntree), bNode *node) { NodeTexWave *tex = MEM_callocN(sizeof(NodeTexWave), "NodeTexWave"); - default_tex_mapping(&tex->base.tex_mapping, TEXMAP_TYPE_POINT); - default_color_mapping(&tex->base.color_mapping); + BKE_texture_mapping_default(&tex->base.tex_mapping, TEXMAP_TYPE_POINT); + BKE_texture_colormapping_default(&tex->base.color_mapping); tex->wave_type = SHD_WAVE_BANDS; node->storage = tex; diff --git a/source/blender/nodes/texture/nodes/node_texture_proc.c b/source/blender/nodes/texture/nodes/node_texture_proc.c index b49ec1fd503..0be5f875a23 100644 --- a/source/blender/nodes/texture/nodes/node_texture_proc.c +++ b/source/blender/nodes/texture/nodes/node_texture_proc.c @@ -286,7 +286,7 @@ static void init(bNodeTree *UNUSED(ntree), bNode *node) Tex *tex = MEM_callocN(sizeof(Tex), "Tex"); node->storage = tex; - default_tex(tex); + BKE_texture_default(tex); tex->type = node->type - TEX_NODE_PROC; if (tex->type == TEX_WOOD) diff --git a/source/blender/render/intern/source/envmap.c b/source/blender/render/intern/source/envmap.c index f0268836104..0698f849073 100644 --- a/source/blender/render/intern/source/envmap.c +++ b/source/blender/render/intern/source/envmap.c @@ -70,7 +70,7 @@ static void envmap_split_ima(EnvMap *env, ImBuf *ibuf) BLI_lock_thread(LOCK_IMAGE); if (env->cube[1] == NULL) { - BKE_free_envmapdata(env); + BKE_texture_envmap_free_data(env); dx = ibuf->y; dx /= 2; @@ -511,7 +511,7 @@ static void render_envmap(Render *re, EnvMap *env) } - if (re->test_break(re->tbh)) BKE_free_envmapdata(env); + if (re->test_break(re->tbh)) BKE_texture_envmap_free_data(env); else { if (envre->r.mode & R_OSA) env->ok = ENV_OSA; else env->ok = ENV_NORMAL; @@ -572,13 +572,13 @@ void make_envmaps(Render *re) if (env->ok) { /* free when OSA, and old one isn't OSA */ if ((re->r.mode & R_OSA) && env->ok == ENV_NORMAL) - BKE_free_envmapdata(env); + BKE_texture_envmap_free_data(env); /* free when size larger */ else if (env->lastsize < re->r.size) - BKE_free_envmapdata(env); + BKE_texture_envmap_free_data(env); /* free when env is in recalcmode */ else if (env->recalc) - BKE_free_envmapdata(env); + BKE_texture_envmap_free_data(env); } if (env->ok == 0 && depth == 0) env->recalc = 1; diff --git a/source/blender/render/intern/source/render_texture.c b/source/blender/render/intern/source/render_texture.c index 531c31848a6..df4553978a3 100644 --- a/source/blender/render/intern/source/render_texture.c +++ b/source/blender/render/intern/source/render_texture.c @@ -116,7 +116,7 @@ static void init_render_texture(Render *re, Tex *tex) if (G.is_rendering && re) { if (re->r.mode & R_ENVMAP) if (tex->env->stype==ENV_ANIM) - BKE_free_envmapdata(tex->env); + BKE_texture_envmap_free_data(tex->env); } } } @@ -3493,7 +3493,7 @@ void render_realtime_texture(ShadeInput *shi, Image *ima) if (firsttime) { for (a=0; atex = localize_texture(cur_tex); + tex= mtex->tex = BKE_texture_localize(cur_tex); /* update texture anims */ BKE_animsys_evaluate_animdata(scene, &tex->id, tex->adt, BKE_scene_frame_get(scene), ADT_RECALC_ANIM); -- cgit v1.2.3