From 6fc8a74886a30f89562bb542ef3b24cc64b3208a Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 17 Jun 2018 17:05:51 +0200 Subject: Cleanup: trailing space for blenkernel --- source/blender/blenkernel/intern/texture.c | 110 ++++++++++++++--------------- 1 file changed, 55 insertions(+), 55 deletions(-) (limited to 'source/blender/blenkernel/intern/texture.c') diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c index 250408642bb..a0399c74be1 100644 --- a/source/blender/blenkernel/intern/texture.c +++ b/source/blender/blenkernel/intern/texture.c @@ -78,9 +78,9 @@ TexMapping *BKE_texture_mapping_add(int type) { TexMapping *texmap = MEM_callocN(sizeof(TexMapping), "TexMapping"); - + BKE_texture_mapping_default(texmap, type); - + return texmap; } @@ -134,7 +134,7 @@ void BKE_texture_mapping_init(TexMapping *texmap) if (fabsf(size[2]) < 1e-5f) size[2] = signf(size[2]) * 1e-5f; } - + size_to_mat4(smat, texmap->size); /* rotation */ @@ -175,9 +175,9 @@ void BKE_texture_mapping_init(TexMapping *texmap) ColorMapping *BKE_texture_colormapping_add(void) { ColorMapping *colormap = MEM_callocN(sizeof(ColorMapping), "ColorMapping"); - + BKE_texture_colormapping_default(colormap); - + return colormap; } @@ -229,7 +229,7 @@ void BKE_texture_free(Tex *tex) BKE_texture_ocean_free(tex->ot); tex->ot = NULL; } - + BKE_icon_id_delete((ID *)tex); BKE_previewimg_free(&tex->preview); } @@ -297,30 +297,30 @@ void BKE_texture_default(Tex *tex) tex->pd->radius = 0.3f; tex->pd->falloff_type = TEX_PD_FALLOFF_STD; } - + if (tex->vd) { tex->vd->resol[0] = tex->vd->resol[1] = tex->vd->resol[2] = 0; tex->vd->interp_type = TEX_VD_LINEAR; tex->vd->file_format = TEX_VD_SMOKE; } - + if (tex->ot) { tex->ot->output = TEX_OCN_DISPLACEMENT; tex->ot->object = NULL; } - + tex->iuser.fie_ima = 2; tex->iuser.ok = 1; tex->iuser.frames = 100; tex->iuser.sfra = 1; - + tex->preview = NULL; } void BKE_texture_type_set(Tex *tex, int type) { switch (type) { - + case TEX_VOXELDATA: if (tex->vd == NULL) tex->vd = BKE_texture_voxeldata_add(); @@ -338,7 +338,7 @@ void BKE_texture_type_set(Tex *tex, int type) tex->ot = BKE_texture_ocean_add(); break; } - + tex->type = type; } @@ -349,9 +349,9 @@ Tex *BKE_texture_add(Main *bmain, const char *name) Tex *tex; tex = BKE_libblock_alloc(bmain, ID_TE, name, 0); - + BKE_texture_default(tex); - + return tex; } @@ -431,11 +431,11 @@ void BKE_texture_mtex_default(MTex *mtex) MTex *BKE_texture_mtex_add(void) { MTex *mtex; - + mtex = MEM_callocN(sizeof(MTex), "BKE_texture_mtex_add"); - + BKE_texture_mtex_default(mtex); - + return mtex; } @@ -450,7 +450,7 @@ MTex *BKE_texture_mtex_add_id(ID *id, int slot) if (mtex_ar == NULL) { return NULL; } - + if (slot == -1) { /* find first free */ int i; @@ -556,11 +556,11 @@ Tex *BKE_texture_localize(Tex *tex) * ... Once f*** nodes are fully converted to that too :( */ Tex *texn; - + texn = BKE_libblock_copy_nolib(&tex->id, false); - + /* image texture: BKE_texture_free also doesn't decrease */ - + if (texn->coba) texn->coba = MEM_dupallocN(texn->coba); if (texn->env) { texn->env = BKE_texture_envmap_copy(texn->env, LIB_ID_CREATE_NO_USER_REFCOUNT); @@ -575,13 +575,13 @@ Tex *BKE_texture_localize(Tex *tex) if (texn->ot) { texn->ot = BKE_texture_ocean_copy(tex->ot, LIB_ID_CREATE_NO_USER_REFCOUNT); } - + texn->preview = NULL; - + if (tex->nodetree) { texn->nodetree = ntreeLocalize(tex->nodetree); } - + return texn; } @@ -597,10 +597,10 @@ Tex *give_current_object_texture(Object *ob) { Material *ma, *node_ma; Tex *tex = NULL; - + if (ob == NULL) return NULL; if (ob->totcol == 0 && !(ob->type == OB_LAMP)) return NULL; - + if (ob->type == OB_LAMP) { tex = give_current_lamp_texture(ob->data); } @@ -612,7 +612,7 @@ Tex *give_current_object_texture(Object *ob) tex = give_current_material_texture(ma); } - + return tex; } @@ -641,7 +641,7 @@ void set_current_lamp_texture(Lamp *la, Tex *newtex) la->mtex[act] = BKE_texture_mtex_add(); la->mtex[act]->texco = TEXCO_GLOB; } - + la->mtex[act]->tex = newtex; id_us_plus(&newtex->id); } @@ -690,7 +690,7 @@ bNode *give_current_material_texture_node(Material *ma) { if (ma && ma->use_nodes && ma->nodetree) return nodeGetActiveID(ma->nodetree, ID_TE); - + return NULL; } @@ -699,7 +699,7 @@ Tex *give_current_material_texture(Material *ma) MTex *mtex = NULL; Tex *tex = NULL; bNode *node; - + if (ma && ma->use_nodes && ma->nodetree) { /* first check texture, then material, this works together * with a hack that clears the active ID flag for textures on @@ -716,7 +716,7 @@ Tex *give_current_material_texture(Material *ma) mtex = ma->mtex[(int)(ma->texact)]; if (mtex) tex = mtex->tex; } - + return tex; } @@ -812,7 +812,7 @@ void set_current_material_texture(Material *ma, Tex *newtex) ma->mtex[act]->texco = TEXCO_ORCO; } } - + ma->mtex[act]->tex = newtex; id_us_plus(&newtex->id); } @@ -841,12 +841,12 @@ Tex *give_current_world_texture(World *world) { MTex *mtex = NULL; Tex *tex = NULL; - + if (!world) return NULL; - + mtex = world->mtex[(int)(world->texact)]; if (mtex) tex = mtex->tex; - + return tex; } @@ -862,7 +862,7 @@ void set_current_world_texture(World *wo, Tex *newtex) wo->mtex[act] = BKE_texture_mtex_add(); wo->mtex[act]->texco = TEXCO_VIEW; } - + wo->mtex[act]->tex = newtex; id_us_plus(&newtex->id); } @@ -892,12 +892,12 @@ Tex *give_current_particle_texture(ParticleSettings *part) { MTex *mtex = NULL; Tex *tex = NULL; - + if (!part) return NULL; - + mtex = part->mtex[(int)(part->texact)]; if (mtex) tex = mtex->tex; - + return tex; } @@ -914,7 +914,7 @@ void set_current_particle_texture(ParticleSettings *part, Tex *newtex) part->mtex[act]->texco = TEXCO_ORCO; part->mtex[act]->blendtype = MTEX_MUL; } - + part->mtex[act]->tex = newtex; id_us_plus(&newtex->id); } @@ -929,7 +929,7 @@ void set_current_particle_texture(ParticleSettings *part, Tex *newtex) EnvMap *BKE_texture_envmap_add(void) { EnvMap *env; - + env = MEM_callocN(sizeof(EnvMap), "envmap"); env->type = ENV_CUBE; env->stype = ENV_ANIM; @@ -937,9 +937,9 @@ EnvMap *BKE_texture_envmap_add(void) env->clipend = 100.0; env->cuberes = 512; env->viewscale = 0.5; - + return env; -} +} /* ------------------------------------------------------------------------- */ @@ -947,7 +947,7 @@ EnvMap *BKE_texture_envmap_copy(const EnvMap *env, const int flag) { EnvMap *envn; int a; - + envn = MEM_dupallocN(env); envn->ok = 0; for (a = 0; a < 6; a++) { @@ -965,7 +965,7 @@ EnvMap *BKE_texture_envmap_copy(const EnvMap *env, const int flag) void BKE_texture_envmap_free_data(EnvMap *env) { unsigned int part; - + for (part = 0; part < 6; part++) { if (env->cube[part]) IMB_freeImBuf(env->cube[part]); @@ -978,10 +978,10 @@ void BKE_texture_envmap_free_data(EnvMap *env) void BKE_texture_envmap_free(EnvMap *env) { - + BKE_texture_envmap_free_data(env); MEM_freeN(env); - + } /* ------------------------------------------------------------------------- */ @@ -1018,7 +1018,7 @@ PointDensity *BKE_texture_pointdensity_add(void) PointDensity *pd = MEM_callocN(sizeof(PointDensity), "pointdensity"); BKE_texture_pointdensity_init_data(pd); return pd; -} +} PointDensity *BKE_texture_pointdensity_copy(const PointDensity *pd, const int UNUSED(flag)) { @@ -1068,13 +1068,13 @@ void BKE_texture_voxeldata_free_data(VoxelData *vd) } } - + void BKE_texture_voxeldata_free(VoxelData *vd) { BKE_texture_voxeldata_free_data(vd); MEM_freeN(vd); } - + VoxelData *BKE_texture_voxeldata_add(void) { VoxelData *vd; @@ -1089,10 +1089,10 @@ VoxelData *BKE_texture_voxeldata_add(void) vd->object = NULL; vd->cachedframe = -1; vd->ok = 0; - + return vd; } - + VoxelData *BKE_texture_voxeldata_copy(VoxelData *vd) { VoxelData *vdn; @@ -1108,18 +1108,18 @@ VoxelData *BKE_texture_voxeldata_copy(VoxelData *vd) OceanTex *BKE_texture_ocean_add(void) { OceanTex *ot; - + ot = MEM_callocN(sizeof(struct OceanTex), "ocean texture"); ot->output = TEX_OCN_DISPLACEMENT; ot->object = NULL; - + return ot; } OceanTex *BKE_texture_ocean_copy(const OceanTex *ot, const int UNUSED(flag)) { OceanTex *otn = MEM_dupallocN(ot); - + return otn; } -- cgit v1.2.3