diff options
Diffstat (limited to 'source/blender/blenkernel/intern/texture.c')
-rw-r--r-- | source/blender/blenkernel/intern/texture.c | 47 |
1 files changed, 26 insertions, 21 deletions
diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c index c9cae91da6f..234078f66ae 100644 --- a/source/blender/blenkernel/intern/texture.c +++ b/source/blender/blenkernel/intern/texture.c @@ -62,7 +62,6 @@ #include "BKE_plugin_types.h" -#include "BKE_bad_level_calls.h" #include "BKE_utildefines.h" #include "BKE_global.h" @@ -74,9 +73,9 @@ #include "BKE_texture.h" #include "BKE_key.h" #include "BKE_icons.h" -#include "BKE_ipo.h" #include "BKE_brush.h" #include "BKE_node.h" +#include "BKE_animsys.h" /* ------------------------------------------------------------------------- */ @@ -178,8 +177,8 @@ PluginTex *add_plugin_tex(char *str) open_plugin_tex(pit); if(pit->doit==0) { - if(pit->handle==0) error("no plugin: %s", str); - else error("in plugin: %s", str); + if(pit->handle==0); //XXX error("no plugin: %s", str); + else ; //XXX error("in plugin: %s", str); MEM_freeN(pit); return NULL; } @@ -439,12 +438,15 @@ void default_tex(Tex *tex) VarStruct *varstr; int a; + tex->type= TEX_CLOUDS; tex->stype= 0; tex->flag= TEX_CHECKER_ODD; - tex->imaflag= TEX_INTERPOL+TEX_MIPMAP+TEX_USEALPHA; + tex->imaflag= TEX_INTERPOL|TEX_MIPMAP|TEX_USEALPHA; tex->extend= TEX_REPEAT; tex->cropxmin= tex->cropymin= 0.0; tex->cropxmax= tex->cropymax= 1.0; + tex->texfilter = TXF_EWA; + tex->afmax = 8; tex->xrepeat= tex->yrepeat= 1; tex->fie_ima= 2; tex->sfra= 1; @@ -493,10 +495,9 @@ void default_tex(Tex *tex) } if (tex->vd) { - tex->vd->resolX=50; + tex->vd->resol[0] = tex->vd->resol[1] = tex->vd->resol[2] = 0; tex->vd->interp_type=0; } - pit = tex->plugin; if (pit) { varstr= pit->varstr; @@ -545,7 +546,7 @@ void default_mtex(MTex *mtex) mtex->size[1]= 1.0; mtex->size[2]= 1.0; mtex->tex= 0; - mtex->texflag= 0; + mtex->texflag= MTEX_NEW_BUMP; mtex->colormodel= 0; mtex->r= 1.0; mtex->g= 0.0; @@ -554,7 +555,7 @@ void default_mtex(MTex *mtex) mtex->def_var= 1.0; mtex->blendtype= MTEX_BLEND; mtex->colfac= 1.0; - mtex->norfac= 0.5; + mtex->norfac= 1.0; mtex->varfac= 1.0; mtex->dispfac=0.2; mtex->normapspace= MTEX_NSPACE_TANGENT; @@ -584,7 +585,9 @@ Tex *copy_texture(Tex *tex) if(texn->type==TEX_IMAGE) id_us_plus((ID *)texn->ima); else texn->ima= 0; +#if 0 // XXX old animation system id_us_plus((ID *)texn->ipo); +#endif // XXX old animation system if(texn->plugin) { texn->plugin= MEM_dupallocN(texn->plugin); @@ -593,8 +596,6 @@ Tex *copy_texture(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->vd) texn->vd=BKE_copy_voxeldata(texn->vd); if(tex->preview) texn->preview = BKE_previewimg_copy(tex->preview); @@ -748,7 +749,9 @@ void make_local_texture(Tex *tex) void autotexname(Tex *tex) { -/* extern char texstr[20][12]; *//* buttons.c, already in bad lev calls*/ + char texstr[20][12]= {"None" , "Clouds" , "Wood", "Marble", "Magic" , "Blend", + "Stucci", "Noise" , "Image", "Plugin", "EnvMap" , "Musgrave", + "Voronoi", "DistNoise", "Point Density", "Voxel Data", "", "", "", ""}; Image *ima; char di[FILE_MAXDIR], fi[FILE_MAXFILE]; @@ -796,7 +799,7 @@ Tex *give_current_texture(Object *ob, int act) if(act>ob->totcol) act= ob->totcol; else if(act==0) act= 1; - if( BTST(ob->colbits, act-1) ) { /* in object */ + if(ob->matbits[act-1]) { /* in object */ ma= ob->mat[act-1]; } else { /* in data */ @@ -828,14 +831,14 @@ Tex *give_current_texture(Object *ob, int act) return tex; } -Tex *give_current_world_texture(void) +Tex *give_current_world_texture(Scene *scene) { MTex *mtex = 0; Tex *tex = 0; - if(!(G.scene->world)) return 0; + if(!(scene->world)) return 0; - mtex= G.scene->world->mtex[(int)(G.scene->world->texact)]; + mtex= scene->world->mtex[(int)(scene->world->texact)]; if(mtex) tex= mtex->tex; return tex; @@ -974,9 +977,7 @@ struct VoxelData *BKE_add_voxeldata(void) vd= MEM_callocN(sizeof(struct VoxelData), "voxeldata"); vd->dataset = NULL; - vd->resolX = 1; - vd->resolY = 1; - vd->resolZ = 1; + vd->resol[0] = vd->resol[1] = vd->resol[2] = 1; vd->interp_type= TEX_VD_NEARESTNEIGHBOR; vd->int_multiplier = 1.0; @@ -1000,13 +1001,17 @@ int BKE_texture_dependsOnTime(const struct Tex *texture) if(texture->plugin) { // assume all plugins depend on time return 1; - } else if( texture->ima && + } + else if( texture->ima && ELEM(texture->ima->source, IMA_SRC_SEQUENCE, IMA_SRC_MOVIE)) { return 1; - } else if(texture->ipo) { + } +#if 0 // XXX old animation system + else if(texture->ipo) { // assume any ipo means the texture is animated return 1; } +#endif // XXX old animation system return 0; } |