diff --git a/source/blender/blenkernel/intern/exotic.c b/source/blender/blenkernel/intern/exotic.c index 6aead73a6d2..a0979892c07 100644 --- a/source/blender/blenkernel/intern/exotic.c +++ b/source/blender/blenkernel/intern/exotic.c @@ -1,4 +1,4 @@ -/* exotic.c mei 95 MIXED MODEL +/* exotic.c * * $Id$ * @@ -174,7 +174,7 @@ static void read_videoscape_mesh(char *str) vd+=3; } - /* de vlakken en kleuren tellen */ + /* count faces and colors */ for(a=0; a<32; a++) color[a]= 0; totcol= 0; end= 1; @@ -211,7 +211,7 @@ static void read_videoscape_mesh(char *str) return; } - /* nieuw object */ + /* new object */ ob= add_object(OB_MESH); me= ob->data; me->totvert= verts; @@ -220,7 +220,7 @@ static void read_videoscape_mesh(char *str) me->mvert= MEM_callocN(me->totvert*sizeof(MVert), "mverts"); if(me->totface) me->mface= MEM_callocN(me->totface*sizeof(MFace), "mface"); - /* kleuren */ + /* colors */ if(totcol) { ob->mat= MEM_callocN(sizeof(void *)*totcol, "ob->mat"); me->mat= MEM_callocN(sizeof(void *)*totcol, "me->mat"); @@ -229,7 +229,7 @@ static void read_videoscape_mesh(char *str) ob->actcol= 1; } - /* materialen */ + /* materials */ for(a=0; amat.first; while(ma) { @@ -393,7 +393,7 @@ static void read_radiogour(char *str) colv++; } - /* de vlakken tellen */ + /* count faces */ end= 1; while(end>0) { end= fscanf(fp,"%d", &poly); @@ -420,7 +420,7 @@ static void read_radiogour(char *str) return; } - /* nieuw object */ + /* new object */ ob= add_object(OB_MESH); me= ob->data; me->totvert= verts; @@ -501,7 +501,7 @@ static void read_radiogour(char *str) } } - /* mcol is per vlak 4 kleuren */ + /* mcol is 4 colors per face */ me->mcol= MEM_mallocN(4*sizeof(int)*me->totface, "mcol"); colf= (unsigned int *)me->mcol; @@ -736,7 +736,7 @@ static int iv_colornumber(struct IvNode *iv) int a; char *cp; - /* terugzoeken naar laatste materiaal */ + /* search back to last material */ while(iv) { if( strcmp(iv->nodename, "Material")==0) { fp= iv->data[0]; @@ -787,7 +787,7 @@ static int iv_colornumber(struct IvNode *iv) static int iv_finddata(struct IvNode *iv, char *field, int fieldnr) { - /* zoek naar "field", tel lengte data en maak datablok. return skipdata */ + /* search for "field", count data size and make datablock. return skipdata */ float *fp; int len, stackcount, skipdata=0; char *cpa, terminator, str[64]; @@ -802,7 +802,7 @@ static int iv_finddata(struct IvNode *iv, char *field, int fieldnr) if( strncmp(cpa, field, len)==0 ) { iv->fieldname[fieldnr]= cpa; - /* lezen tot aan eerste karakter */ + /* read until first character */ cpa+= len; skipdata+= len; *cpa= 0; @@ -876,7 +876,7 @@ static int iv_finddata(struct IvNode *iv, char *field, int fieldnr) static void read_iv_index(float *data, float *baseadr, float *index, int nr, int coordtype) { - /* in data schrijven: baseadr met offset index (aantal nr)*/ + /* write in data: baseadr with offset index (and number nr) */ float *fp; int ofs; @@ -917,7 +917,7 @@ static void read_inventor(char *str, struct ListBase *listb) iv_data_stack= MEM_mallocN(sizeof(float)*IV_MAXSTACK, "ivstack"); - /* eerste preprocess: commentar eruit */ + /* preprocess: remove comments */ md= maindata+20; count= 20; while(countnext; if( strncmp(iv->nodename, "Indexed", 7)==0) { - /* terugzoeken: zelfde naam? */ + /* seek back: same name? */ ivp= iv->prev; while(ivp) { @@ -1058,7 +1058,7 @@ static void read_inventor(char *str, struct ListBase *listb) } if(ivp) { - /* iv bij ivp voegen */ + /* add iv to ivp */ tot= iv->datalen[0] + ivp->datalen[0]; if(tot) { @@ -1081,7 +1081,7 @@ static void read_inventor(char *str, struct ListBase *listb) } - /* Nodes omzetten naar DispLists */ + /* convert Nodes to DispLists */ iv= ivbase.first; while(iv) { @@ -1093,7 +1093,7 @@ static void read_inventor(char *str, struct ListBase *listb) colnr= iv_colornumber(iv); - /* terugzoeken naar data */ + /* seek back to data */ ivp= iv; while(ivp->prev) { ivp= ivp->prev; @@ -1108,7 +1108,7 @@ static void read_inventor(char *str, struct ListBase *listb) } if(ivp) { - /* tel het aantal lijnen */ + /* count the nr of lines */ tot= 0; index= iv->data[0]; lll = iv->datalen[0]-1; @@ -1117,7 +1117,7 @@ static void read_inventor(char *str, struct ListBase *listb) index++; } - tot*= 2; /* aantal vertices */ + tot*= 2; /* nr of vertices */ dl= MEM_callocN(sizeof(struct DispList)+tot*3*sizeof(float), "leesInventor1"); BLI_addtail(listb, dl); dl->type= DL_SEGM; @@ -1140,7 +1140,7 @@ static void read_inventor(char *str, struct ListBase *listb) colnr= iv_colornumber(iv); - /* terugzoeken naar data */ + /* seek back to data */ ivp= iv; while(ivp->prev) { ivp= ivp->prev; @@ -1155,19 +1155,19 @@ static void read_inventor(char *str, struct ListBase *listb) } if(ivp) { - /* tel het aantal driehoeken */ + /* count triangles */ tot= 0; index= iv->data[0]; polytype= (int) index[0]; for(a=0; adatalen[0]; a++) { - if(index[0]== polytype) tot++; /* een soort? */ + if(index[0]== polytype) tot++; /* one kind? */ index++; } - tot*= polytype; /* aantal vertices */ + tot*= polytype; /* nr of vertices */ dl= MEM_callocN(sizeof(struct DispList)+tot*3*sizeof(float), "leesInventor4"); BLI_addtail(listb, dl); dl->type= DL_POLY; @@ -1204,7 +1204,7 @@ static void read_inventor(char *str, struct ListBase *listb) colnr= iv_colornumber(iv); - /* terugzoeken naar data */ + /* seek back to data */ ivp= iv; while(ivp->prev) { ivp= ivp->prev; @@ -1219,11 +1219,11 @@ static void read_inventor(char *str, struct ListBase *listb) } if(ivp) { - /* tel het aantal driehoeken */ + /* count triangles */ tot= 0; face= 0; - index= iv->data[0]; /* afmeting strip */ + index= iv->data[0]; /* strip size */ for(a=0; adatalen[0]; a++) { tot+= (int) index[0]; @@ -1242,7 +1242,7 @@ static void read_inventor(char *str, struct ListBase *listb) BLI_addtail(listb, dl); dl->col= colnr; - index= iv->data[0]; /* afmeting strip */ + index= iv->data[0]; /* strip size */ fp= ivp->data[0]; /* vertices */ data= dl->verts; idata= dl->index; @@ -1276,7 +1276,7 @@ static void read_inventor(char *str, struct ListBase *listb) colnr= iv_colornumber(iv); - /* terugzoeken naar data */ + /* seek back to data */ ivp= iv; while(ivp->prev) { ivp= ivp->prev; @@ -1291,7 +1291,7 @@ static void read_inventor(char *str, struct ListBase *listb) } if(ivp) { - /* tel het aantal driehoeken */ + /* count triangles */ face= 0; index= iv->data[0]; lll = iv->datalen[0]-2; @@ -1300,7 +1300,7 @@ static void read_inventor(char *str, struct ListBase *listb) index++; } - /* aantal vertices */ + /*number of vertices */ tot= ivp->datalen[0]/coordtype; if(tot) { @@ -1332,7 +1332,7 @@ static void read_inventor(char *str, struct ListBase *listb) if(index[0]!= -1 && index[1]!= -1 && index[2]!= -1) { - /* deze truuk is om poly's met meer dan 3 vertices correct te vullen */ + /* this trick is to fill poly's with more than 3 vertices correctly */ if(first) { nr= (int) index[0]; first= 0; @@ -1354,7 +1354,7 @@ static void read_inventor(char *str, struct ListBase *listb) colnr= iv_colornumber(iv); - /* terugzoeken naar data */ + /* seek back to data */ ivp= iv; while(ivp->prev) { ivp= ivp->prev; @@ -1369,7 +1369,7 @@ static void read_inventor(char *str, struct ListBase *listb) } if(ivp) { - /* tel het aantal driehoeken */ + /* count triangles */ face= 0; index= iv->data[0]; lll=iv->datalen[0]-2; @@ -1378,7 +1378,7 @@ static void read_inventor(char *str, struct ListBase *listb) index++; } - /* aantal vertices */ + /* nr of vertices */ tot= ivp->datalen[0]/coordtype; dl= MEM_callocN(sizeof(struct DispList), "leesInventor6"); @@ -1421,7 +1421,7 @@ static void read_inventor(char *str, struct ListBase *listb) colnr= iv_colornumber(iv); - /* terugzoeken naar data */ + /* seek back to data */ ivp= iv; while(ivp->prev) { ivp= ivp->prev; @@ -1458,7 +1458,7 @@ static void read_inventor(char *str, struct ListBase *listb) colnr= iv_colornumber(iv); - /* terugzoeken naar data */ + /* sek back to data */ ivp= iv; while(ivp->prev) { ivp= ivp->prev; @@ -1516,7 +1516,7 @@ static void read_inventor(char *str, struct ListBase *listb) bp++; } - /* iv->datalen[2] / [3] is aantal knots */ + /* iv->datalen[2] / [3] is number of knots */ nu->orderu= iv->datalen[2] - nu->pntsu; nu->orderv= iv->datalen[3] - nu->pntsv; @@ -1550,7 +1550,7 @@ static void read_inventor(char *str, struct ListBase *listb) iv= iv->next; } - /* vrijgeven */ + /* free */ iv= ivbase.first; while(iv) { for(a=0; atype==DL_SEGM && dl->nr>2) { data= (float *)(dl+1); @@ -1599,10 +1599,10 @@ static void displist_to_mesh(DispList *dlfirst) } } - /* kleuren */ + /* colors */ if(dl->col > totcol) totcol= dl->col; - /* afmeting en tellen */ + /* size and count */ if(dl->type==DL_SURF) { a= dl->nr; b= dl->parts; @@ -1698,7 +1698,7 @@ static void displist_to_mesh(DispList *dlfirst) me= ob->data; - /* kleuren */ + /* colors */ if(totcol) { ob->mat= MEM_callocN(sizeof(void *)*totcol, "ob->mat"); me->mat= MEM_callocN(sizeof(void *)*totcol, "me->mat"); @@ -1707,7 +1707,7 @@ static void displist_to_mesh(DispList *dlfirst) ob->actcol= 1; } - /* materialen */ + /* materials */ for(a=0; amat.first; while(ma) { @@ -1923,7 +1923,7 @@ static void displist_to_objects(ListBase *lbase) ListBase tempbase; int maxaantal, curcol, totvert=0, vert; - /* eerst dit: is nu nog actief */ + /* irst this: is still active */ if(ivsurf) { where_is_object(ivsurf); docentre_new(); @@ -1935,16 +1935,16 @@ static void displist_to_objects(ListBase *lbase) /* PATCH 1: polyfill */ if(dl->type==DL_POLY && dl->nr>4) { - /* oplossing: bij elkaar in aparte listbase zetten */ + /* solution: put them together in separate listbase */ ; } - /* PATCH 2: poly's van 2 punten */ + /* PATCH 2: poly's of 2 points */ if(dl->type==DL_POLY && dl->nr==2) dl->type= DL_SEGM; dl= next; } - /* vertices tellen */ + /* count vertices */ dl= lbase->first; while(dl) { @@ -1972,7 +1972,7 @@ static void displist_to_objects(ListBase *lbase) if(totvert>maxaantal) { - /* probeer kleuren bij elkaar te zetten */ + /* try to put colors together */ curcol= 0; tempbase.first= tempbase.last= 0; @@ -1989,7 +1989,7 @@ static void displist_to_objects(ListBase *lbase) dl= next; } - /* in tempbase zitten alle kleuren 'curcol' */ + /* in tempbase are all 'curcol' */ totvert= 0; dl= first= tempbase.first; while(dl) { @@ -2273,7 +2273,7 @@ void write_videoscape(char *str) } - /* weggooien als nog hogere nummers bestaan */ + /* remove when higher numbers exist */ while(remove(str)==0) { val = BLI_stringdec(str, head, tail, &numlen); diff --git a/source/blender/blenkernel/intern/font.c b/source/blender/blenkernel/intern/font.c index 4cbc45ff401..5ea20224fb7 100644 --- a/source/blender/blenkernel/intern/font.c +++ b/source/blender/blenkernel/intern/font.c @@ -1,7 +1,5 @@ -/* font.c MIXED MODEL - * - * maart 95 +/* font.c * * * $Id$ @@ -75,11 +73,6 @@ #include "BKE_curve.h" #include "BKE_displist.h" -/* Nieuwe opzet voor vectorfont: - * - * geen PDrawfont meer, alles meteen naar Nurb en BezTriple - * - */ struct chartrans { float xof, yof; @@ -224,7 +217,7 @@ static void buildchar(Curve *cu, unsigned char ascii, float ofsx, float ofsy, fl vfd= vfont_get_data(cu->vfont); if (!vfd) return; - /* maak een kopie op afstand ofsx, ofsy met shear*/ + /* make a copy at distance ofsx,ofsy with shear*/ fsize= cu->fsize; shear= cu->shear; si= (float)sin(rot); @@ -316,8 +309,8 @@ struct chartrans *text_to_curve(Object *ob, int mode) short cnr=0, lnr=0; char ascii, *mem; - /* opmerking: berekeningen altijd tot en met de '\0' van de string omdat - de cursor op die plek moet kunnen staan */ + /* renark: do calculations including the trailing '\0' of a string + because the cursor can be at that location */ if(ob->type!=OB_FONT) return 0; @@ -330,7 +323,7 @@ struct chartrans *text_to_curve(Object *ob, int mode) vfd= vfont_get_data(vfont); if (!vfd) return 0; - /* aantal regels tellen */ + /* count number of lines */ mem= cu->str; slen = strlen(mem); cu->lines= 1; @@ -339,7 +332,7 @@ struct chartrans *text_to_curve(Object *ob, int mode) if(ascii== '\n' || ascii== '\r') cu->lines++; } - /* bereken ofset en rotatie van iedere letter */ + /* calc offset and rotation of each char */ ct = chartransdata = (struct chartrans*)MEM_callocN((slen+1)* sizeof(struct chartrans),"buildtext"); linedata= MEM_mallocN(sizeof(float)*cu->lines,"buildtext2"); @@ -358,7 +351,7 @@ struct chartrans *text_to_curve(Object *ob, int mode) ct->linenr= lnr; ct->charnr= cnr; - /* alleen lege regels mogen kleiner dan 1 zijn */ + /* only empty lines are allowed smaller than 1 */ if( linedist<1.0) { if(istr[i+1]=='\r' || cu->str[i+1]=='\n')) yof-= linedist; else yof-= 1.0; @@ -393,7 +386,7 @@ struct chartrans *text_to_curve(Object *ob, int mode) ct++; } - /* met alle fontsettings plekken letters berekenen */ + /* with fontsettings calc locations of characters */ if(cu->spacemode!=CU_LEFT && lnr>1) { ct= chartransdata; @@ -444,14 +437,14 @@ struct chartrans *text_to_curve(Object *ob, int mode) if(maxyyof) maxy= ct->yof; } - /* we zetten de x-coordinaat exact op de curve, de y wordt geroteerd */ + /* we put the x-coordinaat exact at the curve, the y is rotated */ - /* de lengte correctie */ + /* length correction */ distfac= sizefac*cucu->path->totdist/(maxx-minx); timeofs= 0.0; if(distfac > 1.0) { - /* pad langer dan tekst: spacemode doet mee */ + /* path longer than text: spacemode involves */ distfac= 1.0f/distfac; if(cu->spacemode==CU_RIGHT) { @@ -467,20 +460,20 @@ struct chartrans *text_to_curve(Object *ob, int mode) distfac/= (maxx-minx); - timeofs+= distfac*cu->xof; /* niet cyclic */ + timeofs+= distfac*cu->xof; /* not cyclic */ ct= chartransdata; for (i=0; i<=slen; i++, ct++) { - /* roteren rond centrum letter */ + /* rotate around centre character */ ascii = cu->str[i]; - dtime= distfac*0.35f*vfd->width[ascii]; /* Waarom is 0.5 te groot? */ - dtime= distfac*0.0f*vfd->width[ascii]; /* Waarom is 0.5 te groot? */ + dtime= distfac*0.35f*vfd->width[ascii]; /* why not 0.5? */ + dtime= distfac*0.0f*vfd->width[ascii]; /* why not 0.5? */ ctime= timeofs + distfac*( ct->xof - minx); CLAMP(ctime, 0.0, 1.0); - - /* de goede plek EN de goede rotatie apart berekenen */ + + /* calc the right loc AND the right rot separately */ where_on_path(cu->textoncurve, ctime, vec, tvec); where_on_path(cu->textoncurve, ctime+dtime, tvec, rotvec); @@ -503,8 +496,8 @@ struct chartrans *text_to_curve(Object *ob, int mode) if(mode==FO_CURSUP || mode==FO_CURSDOWN) { - /* 2: curs omhoog - 3: curs omlaag */ + /* 2: curs up + 3: curs down */ ct= chartransdata+cu->pos; if(mode==FO_CURSUP && ct->linenr==0); @@ -513,7 +506,7 @@ struct chartrans *text_to_curve(Object *ob, int mode) if(mode==FO_CURSUP) lnr= ct->linenr-1; else lnr= ct->linenr+1; cnr= ct->charnr; - /* zoek karakter met lnr en cnr */ + /* seek for char with lnr en cnr */ cu->pos= 0; ct= chartransdata; for (i= 0; ipos; si= (float)sin(ct->rot); @@ -551,7 +544,7 @@ struct chartrans *text_to_curve(Object *ob, int mode) } if(mode==0) { - /* nurbdata maken */ + /* make nurbdata */ freeNurblist(&cu->nurb); @@ -611,7 +604,7 @@ void font_duplilist(Object *par) Mat4CpyMat4(pmat, par->obmat); - /* in par staat een familienaam, deze gebruiken om objecten te vinden */ + /* in par the family name is stored, use this to find the other objects */ chartransdata= text_to_curve(par, FO_DUPLI); if(chartransdata==0) return; @@ -643,8 +636,8 @@ void font_duplilist(Object *par) newob= MEM_mallocN(sizeof(Object), "newobj dupli"); memcpy(newob, ob, sizeof(Object)); newob->flag |= OB_FROMDUPLI; - newob->id.newid= (ID *)par; /* duplicator bewaren */ - newob->totcol= par->totcol; /* voor give_current_material */ + newob->id.newid= (ID *)par; /* keep duplicator */ + newob->totcol= par->totcol; /* for give_current_material */ Mat4CpyMat4(newob->obmat, par->obmat); VECCOPY(newob->obmat[3], vec); diff --git a/source/blender/blenkernel/intern/ika.c b/source/blender/blenkernel/intern/ika.c index fefc8595b0c..32903590043 100644 --- a/source/blender/blenkernel/intern/ika.c +++ b/source/blender/blenkernel/intern/ika.c @@ -1,7 +1,5 @@ -/* ika.c MIXED MODEL - * - * april 96 +/* ika.c * * * $Id$ @@ -67,12 +65,11 @@ void unlink_ika(Ika *ika) { - /* loskoppelen: */ } -/* niet Ika zelf vrijgeven */ +/* do not free Ika itself */ void free_ika(Ika *ika) { @@ -117,8 +114,8 @@ void make_local_ika(Ika *ika) Ika *ikan; int local=0, lib=0; - /* - zijn er alleen lib users: niet doen - * - zijn er alleen locale users: flag zetten + /* - only lib users: dont do + * - only local users: set flag * - mixed: copy */ @@ -183,13 +180,13 @@ int count_limbs(Object *ob) /* ************************************************** */ -/* aan hand van eff[] de len en alpha */ +/* using eff[ ] and len and alpha */ void calc_limb(Limb *li) { Limb *prev= li; float vec[2], alpha= 0.0; - /* alpha van 'parents' */ + /* alpha from 'parents' */ while( (prev=prev->prev) ) { alpha+= prev->alpha; } @@ -208,7 +205,7 @@ void calc_limb(Limb *li) } -/* aan hand van len en alpha worden de eindpunten berekend */ +/* using len and alpha the endpoints are calculated */ void calc_ika(Ika *ika, Limb *li) { float alpha=0.0, co, si; @@ -256,7 +253,7 @@ void init_defstate_ika(Object *ob) ika->toty= 0.0; li= ika->limbbase.first; - calc_ika(ika, 0); /* correcte eindpunten */ + calc_ika(ika, 0); /* correct endpoints */ while(li) { li->alphao= li->alpha; @@ -300,7 +297,7 @@ void rotate_ika(Object *ob, Ika *ika) Limb *li; float len2, da, n1[2], n2[2]; - /* terug roteren */ + /* rotate back */ euler_rot(ob->rot, -ika->toty, 'y'); ika->toty= 0.0; @@ -322,7 +319,7 @@ void rotate_ika(Object *ob, Ika *ika) da= (n2[0])/(len2); if(n1[0]<0.0) da= -da; - /* als de x comp bijna nul is kan dit gebeuren */ + /* when the x component is almost zero, this can happen */ if(da<=-1.0+TOLER || da>=1.0) ; else { @@ -340,7 +337,7 @@ void rotate_ika_xy(Object *ob, Ika *ika) Limb *li; float ang, da, n1[3], n2[3], axis[3], quat[4]; - /* terug roteren */ + /* rotate back */ euler_rot(ob->rot, -ika->toty, 'y'); euler_rot(ob->rot, -ika->totx, 'x'); @@ -400,7 +397,7 @@ void itterate_ika(Object *ob) if((ika->flag & IK_GRABEFF)==0) return; disable_where_script(1); - /* memory: grote tijdsprongen afvangen */ + /* memory: handle large steps in time */ it= abs(ika->lastfra - G.scene->r.cfra); ika->lastfra= G.scene->r.cfra; if(it>10) { @@ -412,13 +409,12 @@ void itterate_ika(Object *ob) li= ika->limbbase.first; while(li) { li->alpha= (1.0f-ika->mem)*li->alpha + ika->mem*li->alphao; - if(li->fac==1.0f) li->fac= 0.05f; /* oude files: kan weg in juni 96 */ li= li->next; } } calc_ika(ika, 0); - /* effector heeft parent? */ + /* effector has parent? */ if(ika->parent) { if(ika->partype==PAROBJECT) { @@ -436,7 +432,7 @@ void itterate_ika(Object *ob) } - /* y-as goed draaien */ + /* rotate y-as correctly */ if(ika->flag & IK_XYCONSTRAINT) rotate_ika_xy(ob, ika); else @@ -448,7 +444,7 @@ void itterate_ika(Object *ob) where_is_object(ob); Mat4Invert(ob->imat, ob->obmat); VecMat4MulVecfl(ika->effn, ob->imat, ika->effg); - /* forward: dan gaan ook de eerste limbs */ + /* forward orfer: to do the first limbs as well */ li= ika->limbbase.first; while(li) { @@ -470,7 +466,7 @@ void itterate_ika(Object *ob) itterate_limb(ika, li); - /* zet je calc_ika() buiten deze lus: lange kettingen instabiel */ + /* when you put calc_ika() outside this loop: long chains get instable */ calc_ika(ika, li); li= li->prev; diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index f87e9751708..5ee1efe9e3e 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -1,6 +1,4 @@ -/* image.c MIX MODEL - * - * maart 95 +/* image.c * * $Id$ * @@ -99,8 +97,8 @@ int imaprepeat, imapextend; /* * - * Talpha==TRUE betekent: lees alpha uit plaatje. Dit betekent niet dat Ta - * niet gebruikt moet worden, hier kan info over rand van image in staan! + * Talpha==TRUE means: read alpha from image. This does not mean that Ta + * should not be used, here info can be stored about outside edge of an image! * */ @@ -152,7 +150,7 @@ Image *add_image(char *name) if(file== -1) return 0; close(file); - /* eerst zoeken naar eenzelfde ima */ + /* first search an identical image */ ima= G.main->image.first; while(ima) { strcpy(strtest, ima->name); @@ -197,7 +195,7 @@ void free_unused_animimages() } -/* *********** LEZEN EN SCHRIJVEN ************** */ +/* *********** READ AND WRITE ************** */ void makepicstring(char *string, int frame) { @@ -213,7 +211,7 @@ void makepicstring(char *string, int frame) len= strlen(string); - /* kan ook: sprintf(num, "%04d", frame); */ + /* can also: sprintf(num, "%04d", frame); */ i=4-sprintf(num,"%d",frame); for(;i>0;i--){ @@ -246,7 +244,7 @@ void makepicstring(char *string, int frame) } -/* ******** IMAGWRAPPING INIT ************* */ +/* ******** IMAGE WRAPPING INIT ************* */ void converttopremul(struct ImBuf *ibuf) { @@ -254,7 +252,7 @@ void converttopremul(struct ImBuf *ibuf) char *cp; if(ibuf==0) return; - if(ibuf->depth==24) { /* alpha op 255 zetten */ + if(ibuf->depth==24) { /* put alpha at 255 */ cp= (char *)(ibuf->rect); for(y=0; yy; y++) { @@ -328,7 +326,7 @@ int calcimanr(int cfra, Tex *tex) { int imanr, len, a, fra, dur; - /* hier (+fie_ima/2-1) zorgt ervoor dat correct wordt gedeeld */ + /* here (+fie_ima/2-1) makes sure that division happens correctly */ if(tex->frames==0) return 1; @@ -347,18 +345,18 @@ int calcimanr(int cfra, Tex *tex) if(cfra<1) cfra= 1; else if(cfra>len) cfra= len; - /* omzetten current frame naar current field */ + /* convert current frame to current field */ cfra= 2*(cfra); if(R.flag & R_SEC_FIELD) cfra++; - /* transformeren naar images space */ + /* transform to images space */ imanr= (cfra+tex->fie_ima-2)/tex->fie_ima; if(imanr>tex->frames) imanr= tex->frames; imanr+= tex->offset; - /* zijn er plaatjes die langer duren? */ + /* are there images that last longer? */ for(a=0; a<4; a++) { if(tex->fradur[a][0]) { @@ -409,7 +407,7 @@ void de_interlace_ng(struct ImBuf *ibuf) /* neogeo fields */ ibuf->flags |= IB_fields; if (ibuf->rect) { - /* kopieen aanmaken */ + /* make copies */ tbuf1 = IMB_allocImBuf(ibuf->x, (short)(ibuf->y >> 1), (unsigned char)32, (int)IB_rect, (unsigned char)0); tbuf2 = IMB_allocImBuf(ibuf->x, (short)(ibuf->y >> 1), (unsigned char)32, (int)IB_rect, (unsigned char)0); @@ -437,7 +435,7 @@ void de_interlace_st(struct ImBuf *ibuf) /* standard fields */ ibuf->flags |= IB_fields; if (ibuf->rect) { - /* kopieen aanmaken */ + /* make copies */ tbuf1 = IMB_allocImBuf(ibuf->x, (short)(ibuf->y >> 1), (unsigned char)32, IB_rect, 0); tbuf2 = IMB_allocImBuf(ibuf->x, (short)(ibuf->y >> 1), (unsigned char)32, IB_rect, 0); @@ -512,7 +510,7 @@ void ima_ibuf_is_nul(Tex *tex) if(fra<0) fra= 0; ima->ibuf = IMB_anim_absolute(ima->anim, fra); - /* patch ivm textbutton met naam ima (B_NAMEIMA) */ + /* patch for textbutton with name ima (B_NAMEIMA) */ if(ima->ibuf) { strcpy(ima->ibuf->name, ima->name); if (tex->imaflag & TEX_FIELDS) de_interlacefunc(ima->ibuf); @@ -536,7 +534,7 @@ void ima_ibuf_is_nul(Tex *tex) if(ima->ibuf) { - /* stringcodes ook in ibuf. ibuf->name wordt als 'undo' gebruikt (buttons.c) */ + /* stringcodes also in ibuf. ibuf->name is used as 'undo' (buttons.c) */ strcpy(ima->ibuf->name, ima->name); if(ima->ibuf->cmap) { @@ -544,7 +542,7 @@ void ima_ibuf_is_nul(Tex *tex) if(tex->imaflag & TEX_ANIM5) { if(tex->imaflag & TEX_MORKPATCH) { - /**** PATCH OM KLEUR 2 GOED TE KUNNEN ZETTEN MORKRAMIA */ + /**** PATCH TO SET COLOR 2 RIGHT (neogeo..) */ if(ima->ibuf->maxcol > 4) { cp= (char *)(ima->ibuf->cmap+2); cp[0]= 0x80; @@ -672,7 +670,7 @@ int imagewrap(Tex *tex, float *texvec) Tb = ((float)rect[2])/255.0f; if(tex->nor) { - /* bump: drie samples nemen */ + /* bump: take three samples */ val1= Tr+Tg+Tb; if(xx-1) { @@ -688,7 +686,7 @@ int imagewrap(Tex *tex, float *texvec) } else val3= val1; - /* niet x en y verwisselen! */ + /* do not mix up x and y here! */ tex->nor[0]= (val1-val2); tex->nor[1]= (val1-val3); } @@ -889,13 +887,13 @@ float clipy_rctf(rctf *rf, float y1, float y2) } void boxsampleclip(struct ImBuf *ibuf, rctf *rf, float *rcol, - float *gcol, float *bcol, float *acol) /* return kleur 0.0-1.0 */ + float *gcol, float *bcol, float *acol) /* return color 0.0-1.0 */ /* struct ImBuf *ibuf; */ /* rctf *rf; */ /* float *rcol, *gcol, *bcol, *acol; */ { - /* sample box, is reeds geclipt en minx enz zijn op ibuf size gezet. - * Vergroot uit met antialiased edges van de pixels */ + /* sample box, is clipped already, and minx etc. have been set at ibuf size. + Enlarge with antialiased edges of the pixels */ float muly,mulx,div; int ofs; @@ -919,7 +917,7 @@ void boxsampleclip(struct ImBuf *ibuf, rctf *rf, float *rcol, *rcol= ((float)rect[0])/255.0f; *gcol= ((float)rect[1])/255.0f; *bcol= ((float)rect[2])/255.0f; - /* alpha is globaal, reeds gezet in functie imagewraposa() */ + /* alpha is global, has been set in function imagewraposa() */ if(Talpha) { *acol= ((float)rect[3])/255.0f; } @@ -986,15 +984,15 @@ void boxsampleclip(struct ImBuf *ibuf, rctf *rf, float *rcol, void boxsample(struct ImBuf *ibuf, float minx, float miny, float maxx, float maxy, - float *rcol, float *gcol, float *bcol, float *acol) /* return kleur 0.0-1.0 */ + float *rcol, float *gcol, float *bcol, float *acol) /* return color 0.0-1.0 */ /* struct ImBuf *ibuf; */ /* float minx, miny, maxx, maxy; */ /* float *rcol, *gcol, *bcol, *acol; */ { - /* Sample box, doet clip. minx enz lopen van 0.0 - 1.0 . - * Vergroot uit met antialiased edges van de pixels. - * Als global imaprepeat is gezet, worden - * de weggeclipte stukken ook gesampled. + /* Sample box, performs clip. minx etc are in range 0.0 - 1.0 . + * Enlarge with antialiased edges of pixels. + * If global variable 'imaprepeat' has been set, the + * clipped-away parts are sampled as well. */ rctf *rf, stack[8]; float opp, tot, r, g, b, a, alphaclip= 1.0; @@ -1056,7 +1054,7 @@ void boxsample(struct ImBuf *ibuf, if(Talpha==0) *acol= 1.0; if(alphaclip!=1.0) { - /* this is for laer investigation, premul or not? */ + /* this is for laetr investigation, premul or not? */ /* *rcol*= alphaclip; */ /* *gcol*= alphaclip; */ /* *bcol*= alphaclip; */ @@ -1067,14 +1065,14 @@ void boxsample(struct ImBuf *ibuf, void filtersample(struct ImBuf *ibuf, float fx, float fy, float *rcol, float *gcol, float *bcol, float *acol) - /* return kleur 0.0-1.0 */ + /* return color 0.0-1.0 */ /* struct ImBuf *ibuf; */ /* fx en fy tussen 0.0 en 1.0 */ /* float fx, fy; */ /* float *rcol, *gcol, *bcol, *acol; */ { - /* met weighted filter 3x3 - * de linker of rechter kolom is altijd 0 - * en de bovenste of onderste rij is altijd 0 + /* with weighted filter 3x3 + * left or right collumn is always 0 + * upper or lower row is awlays 0 */ int fac, fac1, fac2, fracx, fracy, filt[4]; @@ -1108,7 +1106,7 @@ void filtersample(struct ImBuf *ibuf, } if(fracy<128) { - /* geval linksonder */ + /* case left-under */ fac1= 128+fracy; fac2= 128-fracy; @@ -1123,7 +1121,7 @@ void filtersample(struct ImBuf *ibuf, } } else { - /* geval linksboven */ + /* case left-upper */ fac2= 384-fracy; fac1= fracy-128; @@ -1147,7 +1145,7 @@ void filtersample(struct ImBuf *ibuf, } else { if(fracy<128) { - /* geval rechtsonder */ + /* case right-under */ fac1= 128+fracy; fac2= 128-fracy; @@ -1162,7 +1160,7 @@ void filtersample(struct ImBuf *ibuf, } } else { - /* geval rechtsboven */ + /* case right-upper */ fac2= 384-fracy; fac1= fracy-128; @@ -1198,7 +1196,7 @@ void filtersample(struct ImBuf *ibuf, r+= filt[fac]*rowcol[0]; g+= filt[fac]*rowcol[1]; b+= filt[fac]*rowcol[2]; - if(Talpha) a+= filt[fac]*rowcol[3]; /* alpha is globaal */ + if(Talpha) a+= filt[fac]*rowcol[3]; /* alpha is global */ } *rcol= ((float)r)/16777216.0f; *gcol= ((float)g)/16777216.0f; @@ -1267,25 +1265,25 @@ int imagewraposa(Tex *tex, float *texvec, float *dxt, float *dyt) if(ibuf->flags & IB_fields) { if(R.r.mode & R_FIELDS) { /* field render */ - if(R.flag & R_SEC_FIELD) { /* correctie voor tweede field */ + if(R.flag & R_SEC_FIELD) { /* correction for 2nd field */ /* fac1= 0.5/( (float)ibuf->y ); */ /* fy-= fac1; */ } - else { /* eerste field */ + else { /* first field */ fac1= 0.5f/( (float)ibuf->y ); fy+= fac1; } } } - /* pixel coordinaten */ + /* pixel coordinates */ minx= MIN3(dxt[0],dyt[0],dxt[0]+dyt[0] ); maxx= MAX3(dxt[0],dyt[0],dxt[0]+dyt[0] ); miny= MIN3(dxt[1],dyt[1],dxt[1]+dyt[1] ); maxy= MAX3(dxt[1],dyt[1],dxt[1]+dyt[1] ); - /* tex_sharper afgeschaft */ + /* tex_sharper has been removed */ minx= tex->filtersize*(maxx-minx)/2.0f; miny= tex->filtersize*(maxy-miny)/2.0f; @@ -1293,14 +1291,14 @@ int imagewraposa(Tex *tex, float *texvec, float *dxt, float *dyt) if(tex->imaflag & TEX_IMAROT) SWAP(float, minx, miny); if(minx>0.25) minx= 0.25; - else if(minx<0.00001f) minx= 0.00001f; /* zijvlakken van eenheidskubus */ + else if(minx<0.00001f) minx= 0.00001f; /* side faces of unit-cube */ if(miny>0.25) miny= 0.25; else if(miny<0.00001f) miny= 0.00001f; - /* repeat en clip */ + /* repeat and clip */ - /* let op: imaprepeat is globale waarde (zie boxsample) */ + /* watch it: imaprepeat is global value (see boxsample) */ imaprepeat= (tex->extend==TEX_REPEAT); imapextend= (tex->extend==TEX_EXTEND); @@ -1337,7 +1335,7 @@ int imagewraposa(Tex *tex, float *texvec, float *dxt, float *dyt) } } - /* keuze: */ + /* choice: */ if(tex->imaflag & TEX_MIPMAP) { dx= minx; @@ -1353,18 +1351,18 @@ int imagewraposa(Tex *tex, float *texvec, float *dxt, float *dyt) if(maxd < pixsize) break; previbuf= ibuf; ibuf= ima->mipmap[curmap]; - pixsize= 1.0f / (float)MIN2(ibuf->x, ibuf->y); /* hier stond 1.0 */ + pixsize= 1.0f / (float)MIN2(ibuf->x, ibuf->y); /* this used to be 1.0 */ curmap++; } if(previbuf!=ibuf || (tex->imaflag & TEX_INTERPOL)) { - /* minmaal 1 pixel sampelen */ + /* sample at least 1 pixel */ if (minx < 0.5f / ima->ibuf->x) minx = 0.5f / ima->ibuf->x; if (miny < 0.5f / ima->ibuf->y) miny = 0.5f / ima->ibuf->y; } if(tex->nor) { - /* beetje extra filter */ + /* a bit extra filter */ minx*= 1.35f; miny*= 1.35f; @@ -1375,11 +1373,11 @@ int imagewraposa(Tex *tex, float *texvec, float *dxt, float *dyt) boxsample(ibuf, fx-2.0f*minx, fy-miny, fx+minx, fy+2.0f*miny, &fac1, &fac2, &fac3, &fac4); val3= fac1+fac2+fac3; - if(previbuf!=ibuf) { /* interpoleren */ + if(previbuf!=ibuf) { /* interpolate */ boxsample(previbuf, fx-2.0f*minx, fy-2.0f*miny, fx+minx, fy+miny, &fac1, &fac2, &fac3, &fac4); - /* rgb berekenen */ + /* calc rgb */ dx= 2.0f*(pixsize-maxd)/pixsize; if(dx>=1.0f) { Ta= fac4; Tb= fac3; @@ -1400,7 +1398,7 @@ int imagewraposa(Tex *tex, float *texvec, float *dxt, float *dyt) val3= dy*val3+ dx*(fac1+fac2+fac3); } - /* niet x en y verwisselen! */ + /* don't switch x or y! */ tex->nor[0]= (val1-val2); tex->nor[1]= (val1-val3); @@ -1413,7 +1411,7 @@ int imagewraposa(Tex *tex, float *texvec, float *dxt, float *dyt) boxsample(ibuf, minx, miny, maxx, maxy, &Tr, &Tg, &Tb, &Ta); - if(previbuf!=ibuf) { /* interpoleren */ + if(previbuf!=ibuf) { /* interpolate */ boxsample(previbuf, minx, miny, maxx, maxy, &fac1, &fac2, &fac3, &fac4); fx= 2.0f*(pixsize-maxd)/pixsize; @@ -1433,14 +1431,14 @@ int imagewraposa(Tex *tex, float *texvec, float *dxt, float *dyt) } else { if((tex->imaflag & TEX_INTERPOL)) { - /* minmaal 1 pixel sampelen */ + /* sample 1 pixel minimum */ if (minx < 0.5f / ima->ibuf->x) minx = 0.5f / ima->ibuf->x; if (miny < 0.5f / ima->ibuf->y) miny = 0.5f / ima->ibuf->y; } if(tex->nor) { - /* beetje extra filter */ + /* a bit extra filter */ minx*= 1.35f; miny*= 1.35f; @@ -1453,7 +1451,7 @@ int imagewraposa(Tex *tex, float *texvec, float *dxt, float *dyt) boxsample(ibuf, fx-2.0f*minx, fy-miny, fx+miny, fy+2.0f*miny, &fac1, &fac2, &fac3, &fac4); val3= fac1+fac2+fac3; - /* niet x en y verwisselen! */ + /* don't switch x or y! */ tex->nor[0]= (val1-val2); tex->nor[1]= (val1-val3); diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c index b2abda296b6..e828f6e887a 100644 --- a/source/blender/blenkernel/intern/ipo.c +++ b/source/blender/blenkernel/intern/ipo.c @@ -1,6 +1,4 @@ -/* ipo.c MIXED MODEL - * - * jan 95 +/* ipo.c * * $Id$ * @@ -77,9 +75,10 @@ #define SMALL -1.0e-10 -/* Dit array is ervoor zodat defines zoals OB_LOC_X niet persee 0 hoeft te zijn. - Ook voor toekomstige backward compatibility. - Zo kan met een for-next lus alles worden afgelopen */ +/* This array concept was meant to make sure that defines such as OB_LOC_X + don't have to be enumerated, also for backward compatibility, future changes, + and to enable it all can be accessed with a for-next loop. +*/ int co_ar[CO_TOTIPO]= { CO_ENFORCE @@ -158,7 +157,7 @@ int snd_ar[SND_TOTIPO]= { -float frame_to_float(int cfra) /* zie ook bsystem_time in object.c */ +float frame_to_float(int cfra) /* see also bsystem_time in object.c */ { extern float bluroffs; /* object.c */ float ctime; @@ -173,7 +172,7 @@ float frame_to_float(int cfra) /* zie ook bsystem_time in object.c */ return ctime; } -/* niet ipo zelf vrijgeven */ +/* do not free ipo itself */ void free_ipo(Ipo *ipo) { IpoCurve *icu; @@ -222,9 +221,9 @@ void make_local_obipo(Ipo *ipo) Ipo *ipon; int local=0, lib=0; - /* - zijn er alleen lib users: niet doen - * - zijn er alleen locale users: flag zetten - * - mixed: copy + /* - only lib users: do nothing + * - only local users: set flag + * - mixed: make copy */ ob= G.main->object.first; @@ -265,12 +264,12 @@ void make_local_matipo(Ipo *ipo) Material *ma; Ipo *ipon; int local=0, lib=0; - - /* - zijn er alleen lib users: niet doen - * - zijn er alleen locale users: flag zetten - * - mixed: copy - */ + /* - only lib users: do nothing + * - only local users: set flag + * - mixed: make copy + */ + ma= G.main->mat.first; while(ma) { if(ma->ipo==ipo) { @@ -309,12 +308,12 @@ void make_local_keyipo(Ipo *ipo) Key *key; Ipo *ipon; int local=0, lib=0; - - /* - zijn er alleen lib users: niet doen - * - zijn er alleen locale users: flag zetten - * - mixed: copy - */ + /* - only lib users: do nothing + * - only local users: set flag + * - mixed: make copy + */ + key= G.main->key.first; while(key) { if(key->ipo==ipo) { @@ -384,7 +383,7 @@ void calchandles_ipocurve(IpoCurve *icu) if(bezt->vec[0][0]>bezt->vec[1][0]) bezt->vec[0][0]= bezt->vec[1][0]; if(bezt->vec[2][0]vec[1][0]) bezt->vec[2][0]= bezt->vec[1][0]; - calchandleNurb(bezt, prev, next, 1); /* 1==speciale autohandle */ + calchandleNurb(bezt, prev, next, 1); /* 1==special autohandle */ prev= bezt; if(a==1) { @@ -392,7 +391,7 @@ void calchandles_ipocurve(IpoCurve *icu) } else next++; - /* voor automatische ease in en out */ + /* for automatic ease in and out */ if(bezt->h1==HD_AUTO && bezt->h2==HD_AUTO) { if(a==0 || a==icu->totvert-1) { if(icu->extrap==IPO_HORIZ) { @@ -407,14 +406,14 @@ void calchandles_ipocurve(IpoCurve *icu) void testhandles_ipocurve(IpoCurve *icu) { - /* Te gebruiken als er iets aan de handles is veranderd. - * Loopt alle BezTriples af met de volgende regels: - * FASE 1: types veranderen? - * Autocalchandles: worden ligned als NOT(000 || 111) - * Vectorhandles worden 'niets' als (selected en andere niet) - * FASE 2: handles herberekenen - */ - BezTriple *bezt; + /* use when something has changed with handles. + it treats all BezTriples with the following rules: + PHASE 1: do types have to be altered? + Auto handles: become aligned when selection status is NOT(000 || 111) + Vector handles: become 'nothing' when (one half selected AND other not) + PHASE 2: recalculate handles + */ + BezTriple *bezt; int flag, a; bezt= icu->bezt; @@ -508,8 +507,9 @@ int test_time_ipocurve(IpoCurve *icu) void correct_bezpart(float *v1, float *v2, float *v3, float *v4) { - /* de totale lengte van de handles mag niet langer zijn - * dan de horizontale afstand tussen de punten (v1-v4) + /* the total length of the handles is not allowed to be more + * than the horizontal distance between (v1-v4) + * this to prevent curve loops */ float h1[2], h2[2], len1, len2, len, fac; @@ -680,7 +680,7 @@ float eval_icu(IpoCurve *icu, float ipotime) } } - /* uiteinden? */ + /* endpoints? */ if(prevbezt->vec[1][0]>=ipotime) { if( (icu->extrap & IPO_DIR) && icu->ipo!=IPO_CONST) { @@ -1531,13 +1531,13 @@ void do_ob_ipo(Object *ob) if(ob->ipo==0) return; - /* hier NIET ob->ctime zetten: bijv bij parent in onzichtb. layer */ + /* do not set ob->ctime here: for example when parent in invisible layer */ ctime= bsystem_time(ob, 0, (float) G.scene->r.cfra, 0.0); calc_ipo(ob->ipo, ctime); - /* Patch: de localview onthouden */ + /* Patch: remember localview */ lay= ob->lay & 0xFF000000; execute_ipo((ID *)ob, ob->ipo); @@ -1547,7 +1547,7 @@ void do_ob_ipo(Object *ob) if(strcmp(G.scene->id.name+2, ob->id.name+6)==0) { G.scene->lay= ob->lay; copy_view3d_lock(0); - /* hier geen REDRAW: gaat rondzingen! */ + /* no redraw here! creates too many calls */ } } } @@ -1556,19 +1556,19 @@ void do_seq_ipo(Sequence *seq) { float ctime, div; - /* seq_ipo gaat iets anders: beide fields direkt berekenen */ + /* seq_ipo has an exception: calc both fields immediately */ if(seq->ipo) { ctime= frame_to_float(G.scene->r.cfra - seq->startdisp); div= (seq->enddisp - seq->startdisp)/100.0f; if(div==0) return; - /* tweede field */ + /* 2nd field */ calc_ipo(seq->ipo, (ctime+0.5f)/div); execute_ipo((ID *)seq, seq->ipo); seq->facf1= seq->facf0; - /* eerste field */ + /* 1st field */ calc_ipo(seq->ipo, ctime/div); execute_ipo((ID *)seq, seq->ipo); @@ -1623,7 +1623,7 @@ void do_all_ipos() do_constraint_channels(&base->object->constraints, &base->object->constraintChannels, ctime); if(base->object->ipo) { - /* per object ipo ook de calc_ipo doen: ivm mogelijke timeoffs */ + /* do per object ipo the calc_ipo: because of possible timeoffs */ do_ob_ipo(base->object); if(base->object->type==OB_MBALL) where_is_object(base->object); } @@ -1665,11 +1665,11 @@ void do_all_ipos() snd= snd->id.next; } - /* voor het geval dat... LET OP: 2x */ + /*just in case of... WATCH IT: 2x */ base= G.scene->base.first; while(base) { - /* alleen layer updaten als ipo */ + /* only update layer when an ipo */ if( has_ipo_code(base->object->ipo, OB_LAY) ) { base->lay= base->object->lay; } @@ -1677,12 +1677,12 @@ void do_all_ipos() base= base->next; } - /* voor het geval dat...*/ + /* just in case...*/ if(G.scene->set) { base= G.scene->set->base.first; while(base) { - /* alleen layer updaten als ipo */ + /* only update layer when an ipo */ if( has_ipo_code(base->object->ipo, OB_LAY) ) { base->lay= base->object->lay; } @@ -1744,7 +1744,7 @@ void add_to_cfra_elem(ListBase *lb, BezTriple *bezt) while(ce) { if( ce->cfra==bezt->vec[1][0] ) { - /* doen ivm dubbele keys */ + /* do because of double keys */ if(bezt->f2 & 1) ce->sel= bezt->f2; return; } @@ -1809,7 +1809,7 @@ void make_cfra_list(Ipo *ipo, ListBase *elems) } } if(ipo->showkey==0) { - /* alle keys deselecteren */ + /* deselect all keys */ ce= elems->first; while(ce) { ce->sel= 0; diff --git a/source/blender/blenkernel/intern/key.c b/source/blender/blenkernel/intern/key.c index 0c19b33e3ac..b371fb498ae 100644 --- a/source/blender/blenkernel/intern/key.c +++ b/source/blender/blenkernel/intern/key.c @@ -1,7 +1,5 @@ -/* key.c MIXED MODEL - * - * mei 95 +/* key.c * * * $Id$ @@ -101,7 +99,7 @@ void free_key(Key *key) /* from misc_util: flip the bytes from x */ /* #define GS(x) (((unsigned char *)(x))[0] << 8 | ((unsigned char *)(x))[1]) */ -Key *add_key(ID *id) /* algemeen */ +Key *add_key(ID *id) /* common function */ { Key *key; char *el; @@ -171,12 +169,12 @@ Key *copy_key(Key *key) void make_local_key(Key *key) { - - /* - zijn er alleen lib users: niet doen - * - zijn er alleen locale users: flag zetten - * - mixed: copy - */ - if(key==0) return; + + /* - only lib users: do nothing + * - only local users: set flag + * - mixed: make copy + */ + if(key==0) return; key->id.lib= 0; new_id(0, (ID *)key, 0); @@ -278,7 +276,7 @@ void set_afgeleide_four_ipo(float d, float *data, int type) int setkeys(float fac, ListBase *lb, KeyBlock *k[], float *t, int cycl) { - /* return 1 betekent k[2] is de positie, 0 is interpoleren */ + /* return 1 means k[2] is the position, return 0 means interpolate */ KeyBlock *k1, *firstkey; float d, dpos, ofs=0, lastpos, temp, fval[4]; short bsplinetype; @@ -298,7 +296,7 @@ int setkeys(float fac, ListBase *lb, KeyBlock *k[], float *t, int cycl) if(k1->next==0) return 1; - if(cycl) { /* voorsorteren */ + if(cycl) { /* pre-sort */ k[2]= k1->next; k[3]= k[2]->next; if(k[3]==0) k[3]=k1; @@ -320,8 +318,7 @@ int setkeys(float fac, ListBase *lb, KeyBlock *k[], float *t, int cycl) if(facnext; t[2]= k[2]->pos; k[3]= k[2]->next; @@ -330,7 +327,7 @@ int setkeys(float fac, ListBase *lb, KeyBlock *k[], float *t, int cycl) k1= k[3]; } - while( t[2]next==0) { if(cycl) { k1= firstkey; @@ -357,17 +354,17 @@ int setkeys(float fac, ListBase *lb, KeyBlock *k[], float *t, int cycl) if(cycl==0) { - if(bsplinetype==0) { /* B spline gaat niet door de punten */ - if(fac<=t[1]) { /* fac voor 1e key */ + if(bsplinetype==0) { /* B spline doesn't go through the control points */ + if(fac<=t[1]) { /* fac for 1st key */ t[2]= t[1]; k[2]= k[1]; return 1; } - if(fac>=t[2] ) { /* fac na 2e key */ + if(fac>=t[2] ) { /* fac after 2nd key */ return 1; } } - else if(fac>t[2]) { /* laatste key */ + else if(fac>t[2]) { /* last key */ fac= t[2]; k[3]= k[2]; t[3]= t[2]; @@ -377,12 +374,12 @@ int setkeys(float fac, ListBase *lb, KeyBlock *k[], float *t, int cycl) d= t[2]-t[1]; if(d==0.0) { if(bsplinetype==0) { - return 1; /* beide keys gelijk */ + return 1; /* both keys equal */ } } else d= (fac-t[1])/d; - /* interpolatie */ + /* interpolation */ set_four_ipo(d, t, k[1]->type); @@ -450,7 +447,7 @@ void cp_key(int start, int end, int tot, char *poin, Key *key, KeyBlock *k, int else return; } - /* deze uitzondering is om slurphing mogelijk te maken */ + /* this exception is needed for slurphing */ if(start!=0) { poin+= poinsize*start; @@ -473,7 +470,7 @@ void cp_key(int start, int end, int tot, char *poin, Key *key, KeyBlock *k, int elemstr[2]= 0; } - /* alleen in dit stuk, hierboven niet! */ + /* just do it here, not above! */ elemsize= key->elemsize; if(mode==KEY_BEZTRIPLE) elemsize*= 3; @@ -509,7 +506,7 @@ void cp_key(int start, int end, int tot, char *poin, Key *key, KeyBlock *k, int cp+= 2; ofsp++; } - /* gaan we moeilijk doen */ + /* are we going to be nasty? */ if(flagflo) { ktot+= kd; while(ktot>=1.0) { @@ -537,7 +534,7 @@ void cp_cu_key(Curve *cu, KeyBlock *kb, int start, int end) step= nu->pntsu*nu->pntsv; - /* uitzondering omdat keys graag met volledige blokken werken */ + /* exception because keys prefer to work with complete blocks */ poin= (char *)nu->bp->vec; poin -= a*sizeof(BPoint); @@ -604,12 +601,12 @@ void do_rel_key(int start, int end, int tot, char *basispoin, Key *key, float ct if(end>tot) end= tot; - /* in geval beztriple */ - elemstr[0]= 1; /* aantal ipofloats */ + /* in case of beztriple */ + elemstr[0]= 1; /* nr of ipofloats */ elemstr[1]= IPO_BEZTRIPLE; elemstr[2]= 0; - /* alleen in dit stuk, hierboven niet! */ + /* just here, not above! */ elemsize= key->elemsize; if(mode==KEY_BEZTRIPLE) elemsize*= 3; @@ -653,7 +650,7 @@ void do_rel_key(int start, int end, int tot, char *basispoin, Key *key, float ct ofsp= ofs; - while( cp[0] ) { /* cp[0]==aantal */ + while( cp[0] ) { /* cp[0]==amount */ switch(cp[1]) { case IPO_FLOAT: @@ -724,7 +721,7 @@ void do_key(int start, int end, int tot, char *poin, Key *key, KeyBlock **k, flo k3= k[2]->data; k4= k[3]->data; - /* testen op meer of minder punten (per key!) */ + /* test for more or less points (per key!) */ if(tot != k[0]->totelem) { k1tot= 0.0; flagflo |= 1; @@ -758,7 +755,7 @@ void do_key(int start, int end, int tot, char *poin, Key *key, KeyBlock **k, flo else flagdo -= 8; } - /* deze uitzondering is om slurphing mogelijk te maken */ + /* this exception needed for slurphing */ if(start!=0) { poin+= poinsize*start; @@ -810,12 +807,12 @@ void do_key(int start, int end, int tot, char *poin, Key *key, KeyBlock **k, flo } - /* in geval beztriple */ - elemstr[0]= 1; /* aantal ipofloats */ + /* in case of beztriple */ + elemstr[0]= 1; /* nr of ipofloats */ elemstr[1]= IPO_BEZTRIPLE; elemstr[2]= 0; - /* alleen in dit stuk, hierboven niet! */ + /* only here, not above! */ elemsize= key->elemsize; if(mode==KEY_BEZTRIPLE) elemsize*= 3; @@ -826,7 +823,7 @@ void do_key(int start, int end, int tot, char *poin, Key *key, KeyBlock **k, flo ofsp= ofs; - while( cp[0] ) { /* cp[0]==aantal */ + while( cp[0] ) { /* cp[0]==amount */ switch(cp[1]) { case IPO_FLOAT: @@ -852,7 +849,7 @@ void do_key(int start, int end, int tot, char *poin, Key *key, KeyBlock **k, flo cp+= 2; ofsp++; } - /* gaan we moeilijk doen: als keys van lengte verschillen */ + /* lets do it the difficult way: when keys have a different size */ if(flagdo & 1) { if(flagflo & 1) { k1tot+= k1d; @@ -918,7 +915,7 @@ void do_mesh_key(Mesh *me) if(me->totvert>100 && slurph_opt) { step= me->totvert/50; delta*= step; - /* in do_key en cp_key wordt a>tot afgevangen */ + /* in do_key and cp_key the case a>tot is handled */ } cfra= G.scene->r.cfra; @@ -987,7 +984,7 @@ void do_cu_key(Curve *cu, KeyBlock **k, float *t) step= nu->pntsu*nu->pntsv; - /* uitzondering omdat keys graag met volledige blokken werken */ + /* exception because keys prefer to work with complete blocks */ poin= (char *)nu->bp->vec; poin -= a*sizeof(BPoint); @@ -1022,7 +1019,7 @@ void do_rel_cu_key(Curve *cu, float ctime) step= nu->pntsu*nu->pntsv; - /* uitzondering omdat keys graag met volledige blokken werken */ + /* exception because keys prefer to work with complete blocks */ poin= (char *)nu->bp->vec; poin -= a*sizeof(BPoint); @@ -1063,7 +1060,7 @@ void do_curve_key(Curve *cu) if(tot>100 && slurph_opt) { step= tot/50; delta*= step; - /* in do_key en cp_key wordt a>tot afgevangen */ + /* in do_key and cp_key the case a>tot has been handled */ } cfra= G.scene->r.cfra; diff --git a/source/blender/blenkernel/intern/lattice.c b/source/blender/blenkernel/intern/lattice.c index 8c84ac0cca8..ecf88a623b9 100644 --- a/source/blender/blenkernel/intern/lattice.c +++ b/source/blender/blenkernel/intern/lattice.c @@ -1,6 +1,7 @@ /** - * lattice.c MIXED MODEL - * june 2001 ton + * lattice.c + * + * * $Id$ * * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** @@ -120,10 +121,10 @@ Lattice *add_lattice() lt->typeu= lt->typev= lt->typew= KEY_BSPLINE; - /* tijdelijk */ + /* temporally */ lt->def= MEM_callocN(sizeof(BPoint), "lattvert"); - resizelattice(lt); /* maakt een regelmatige lattice */ + resizelattice(lt); /* creates a uniform lattice */ return lt; } @@ -154,10 +155,10 @@ void make_local_lattice(Lattice *lt) Object *ob; Lattice *ltn; int local=0, lib=0; - - /* - zijn er alleen lib users: niet doen - * - zijn er alleen locale users: flag zetten - * - mixed: copy + + /* - only lib users: do nothing + * - only local users: set flag + * - mixed: make copy */ if(lt->id.lib==0) return; @@ -223,7 +224,7 @@ void calc_lat_fudu(int flag, int res, float *fu, float *du) void init_latt_deform(Object *oblatt, Object *ob) { - /* we maken een array met alle verschillen */ + /* we make an array with all differences */ BPoint *bp; float *fp, imat[4][4]; float vec[3], fu, fv, fw, du=0.0, dv=0.0, dw=0.0; @@ -238,27 +239,27 @@ void init_latt_deform(Object *oblatt, Object *ob) if(ob) where_is_object(ob); - /* bijv bij particle systeem: ob==0 */ + /* for example with a particle system: ob==0 */ if(ob==0) { - /* in deformspace, matrix berekenen */ + /* in deformspace, calc matrix */ Mat4Invert(latmat, oblatt->obmat); - /* terug: in deform array verwerken */ + /* back: put in deform array */ Mat4Invert(imat, latmat); } else { - /* in deformspace, matrix berekenen */ + /* in deformspace, calc matrix */ Mat4Invert(imat, oblatt->obmat); Mat4MulMat4(latmat, ob->obmat, imat); - /* terug: in deform array verwerken */ + /* back: put in deform array */ Mat4Invert(imat, latmat); } calc_lat_fudu(deformLatt->flag, deformLatt->pntsu, &fu, &du); calc_lat_fudu(deformLatt->flag, deformLatt->pntsv, &fv, &dv); calc_lat_fudu(deformLatt->flag, deformLatt->pntsw, &fw, &dw); - /* we berekenen hier steeds de u v w lattice coordinaten, weinig reden ze te onthouden */ + /* we keep calculating the u v w lattice coordinates, not enough reason to store that */ vec[2]= fw; for(w=0; wpntsw; w++) { @@ -288,9 +289,9 @@ void calc_latt_deform(float *co) if(latticedata==0) return; - lt= deformLatt; /* kortere notatie! */ + lt= deformLatt; /* just for shorter notation! */ - /* co is in lokale coords, met latmat behandelen */ + /* co is in local coords, treat with latmat */ VECCOPY(vec, co); Mat4MulVecfl(latmat, vec); @@ -393,7 +394,7 @@ int object_deform(Object *ob) if(ob->parent==0) return 0; - /* altijd proberen in deze fie de hele deform te doen: apply! */ + /* always try to do the entire deform in this function: apply! */ if(ob->parent->type==OB_LATTICE) { diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index 74cc09a1b8b..c2e94e09bd1 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -1,10 +1,8 @@ -/* library.c aug 94 MIXED MODEL +/* library.c * - * jan 95 - * - * afhandeling ID's en libraries - * allocceren en vrijgeven alle library data + * Contains management of ID's and libraries + * allocate and free of all library data * * $Id$ * @@ -109,7 +107,7 @@ #define MAX_IDPUP 30 /* was 24 */ #define MAX_LIBARRAY 100 /* was 30 */ -/* ************* ALGEMEEN ************************ */ +/* ************* general ************************ */ void id_lib_extern(ID *id) { @@ -192,7 +190,7 @@ ListBase *wich_libbase(Main *mainlib, short type) int set_listbasepointers(Main *main, ListBase **lb) { - /* BACKWARDS! let op volgorde van vrijgeven! (mesh<->mat) */ + /* BACKWARDS! also watch order of free-ing! (mesh<->mat) */ lb[0]= &(main->ipo); lb[1]= &(main->key); @@ -232,13 +230,13 @@ int set_listbasepointers(Main *main, ListBase **lb) return 25; } -/* *********** ALLOC EN FREE ***************** +/* *********** ALLOC AND FREE ***************** free_libblock(ListBase *lb, ID *id ) - lijstbasis en datablok geven, alleen ID wordt uitgelezen + provide a list-basis and datablock, but only ID is read void *alloc_libblock(ListBase *lb, type, name) - hangt in lijst en geeft nieuw ID + inserts in list and returns a new ID ***************************** */ @@ -337,7 +335,7 @@ void *alloc_libblock(ListBase *lb, short type, char *name) id->us= 1; *( (short *)id->name )= type; new_id(lb, id, name); - /* alfabetisch opnieuw invoegen: zit in new_id */ + /* alphabetic insterion: is in new_id */ } return id; } @@ -391,7 +389,7 @@ void free_libblock(ListBase *lb, void *idv) { ID *id= idv; - switch( GS(id->name) ) { /* GetShort uit util.h */ + switch( GS(id->name) ) { /* GetShort from util.h */ case ID_SCE: free_scene((Scene *)id); break; @@ -432,8 +430,6 @@ void free_libblock(ListBase *lb, void *idv) free_lamp((Lamp *)id); break; case ID_CA: -/* free_camera(id); */ - /* cast wasn't here before... spooky... */ free_camera((Camera*) id); break; case ID_IP: @@ -498,7 +494,7 @@ void free_libblock_us(ListBase *lb, void *idv) /* test users */ void free_main(Main *mainvar) { - /* ook aanroepen bij file inlezen, erase all, etc */ + /* also call when reading a file, erase all, etc */ ListBase *lbarray[MAX_LIBARRAY]; int a; @@ -518,7 +514,7 @@ void free_main(Main *mainvar) /* ***************** ID ************************ */ // only used in exotic.c -ID *find_id(char *type, char *name) /* type: "OB" of "MA" etc */ +ID *find_id(char *type, char *name) /* type: "OB" or "MA" etc */ { ID *id; ListBase *lb; @@ -693,7 +689,7 @@ static void sort_alpha_id(ListBase *lb, ID *id) { ID *idtest; - /* alfabetisch opnieuw invoegen */ + /* insert alphabetically */ if(lb->first!=lb->last) { BLI_remlink(lb, id); @@ -705,7 +701,7 @@ static void sort_alpha_id(ListBase *lb, ID *id) } idtest= idtest->next; } - /* als laatste */ + /* as last */ if(idtest==0) { BLI_addtail(lb, id); } @@ -714,15 +710,15 @@ static void sort_alpha_id(ListBase *lb, ID *id) } int new_id(ListBase *lb, ID *id, char *tname) -/* alleen locale blokken: externe en indirekte hebben al een unieke ID */ -/* return 1: nieuwe naam gemaakt */ +/* only for local blocks: external en indirect blocks already have a unique ID */ +/* return 1: created a new name */ { ID *idtest; int nr= 0, nrtest, maxtest=32, a; char aname[32], *name, left[24], leftest[24], in_use[32]; - /* - naam splitsen - * - zoeken + /* - split name + * - search */ if(id->lib) return 0; @@ -738,14 +734,14 @@ int new_id(ListBase *lb, ID *id, char *tname) if(lb==0) lb= wich_libbase(G.main, GS(id->name)); - /* eerste fase: bestaat de id al? */ + /* phase 1: id already exists? */ idtest= lb->first; while(idtest) { if(id!=idtest && idtest->lib==0) { - /* niet alphabetic testen! */ - /* optim */ + /* do not test alphabetic! */ + /* optimized */ if( idtest->name[2] == name[0] ) { if(strcmp(name, idtest->name+2)==0) break; } @@ -798,7 +794,7 @@ int new_id(ListBase *lb, ID *id, char *tname) left[16]= 0; return (new_id(lb, id, left)); } - /* this format specifier is fucked... */ + /* this format specifier is from hell... */ sprintf(id->name+2, "%s.%0.3d", left, nr); } @@ -839,14 +835,15 @@ void all_local(void) id->newid= 0; id->flag &= ~(LIB_EXTERN|LIB_INDIRECT|LIB_NEW); - idn= id->next; /* id wordt mogelijk opnieuw ingevoegd */ + idn= id->next; /* id is possibly being inserted again */ if(id->lib) { id->lib= 0; - new_id(lbarray[a], id, 0); /* new_id doet dit alleen bij dubbele namen */ + new_id(lbarray[a], id, 0); /* new_id only does it with double names */ sort_alpha_id(lbarray[a], id); } else { - /* patch: testen of de zaak wel alphabetisch is */ + /* patch: check for alphabetic ordering */ + /* has been removed... why!? (ton) */ /* if(idn) { if(strcasecmp(id->name, idn->name)>0) { @@ -867,7 +864,7 @@ void all_local(void) id= idn; } - /* patch2: zorgen dat de zaak wel alphabetisch is */ + /* patch2: make it aphabetically */ while( (id=tempbase.first) ) { BLI_remlink(&tempbase, id); BLI_addtail(lbarray[a], id); @@ -879,7 +876,7 @@ void all_local(void) void test_idbutton(char *name) { - /* vanuit buttons: als naam al bestaat: new_id aanroepen */ + /* called from buttons: when name already exists: call new_id */ ListBase *lb; ID *idtest; @@ -887,7 +884,7 @@ void test_idbutton(char *name) lb= wich_libbase(G.main, GS(name-2) ); if(lb==0) return; - /* zoek welke id */ + /* search for id */ idtest= lb->first; while(idtest) { if( strcmp(idtest->name+2, name)==0) break; diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c index d39983c2f17..3639b64e63c 100644 --- a/source/blender/blenkernel/intern/material.c +++ b/source/blender/blenkernel/intern/material.c @@ -1,7 +1,6 @@ -/* material.c MIX MODEL - * - * maart 95 +/* material.c + * * * $Id$ * @@ -140,11 +139,11 @@ void make_local_material(Material *ma) MetaBall *mb; Material *man; int a, local=0, lib=0; - - /* - zijn er alleen lib users: niet doen - * - zijn er alleen locale users: flag zetten - * - mixed: copy - */ + + /* - only lib users: do nothing + * - only local users: set flag + * - mixed: make copy + */ if(ma->id.lib==0) return; if(ma->id.us==1) { @@ -344,10 +343,10 @@ Material *give_current_material(Object *ob, int act) if(act>ob->totcol) act= ob->totcol; else if(act==0) act= 1; - if( BTST(ob->colbits, act-1) ) { /* aan object */ + if( BTST(ob->colbits, act-1) ) { /* in object */ ma= ob->mat[act-1]; } - else { /* aan data */ + else { /* in data */ matarar= give_matarar(ob); if(matarar && *matarar) ma= (*matarar)[act-1]; @@ -385,7 +384,7 @@ ID *material_from(Object *ob, int act) void test_object_materials(ID *id) { - /* ob mat-array evenlang maken als obdata mat-array */ + /* make the ob mat-array same size as 'ob->data' mat-array */ Object *ob; Mesh *me; Curve *cu; @@ -472,14 +471,14 @@ void assign_material(Object *ob, Material *ma, int act) ob->totcol= act; } - /* doe 't */ + /* do it */ - if( BTST(ob->colbits, act-1) ) { /* aan object */ + if( BTST(ob->colbits, act-1) ) { /* in object */ mao= ob->mat[act-1]; if(mao) mao->id.us--; ob->mat[act-1]= ma; } - else { /* aan data */ + else { /* in data */ mao= (*matarar)[act-1]; if(mao) mao->id.us--; (*matarar)[act-1]= ma; @@ -524,7 +523,7 @@ void init_render_material(Material *ma) ma->ren= MEM_mallocN(sizeof(Material), "initrendermaterial"); memcpy(ma->ren, ma, sizeof(Material)); - /* alle texcoflags van mtex adden */ + /* add all texcoflags from mtex */ ma= ma->ren; ma->texco= 0; ma->mapto= 0; @@ -540,7 +539,7 @@ void init_render_material(Material *ma) /* mtex->projz= PROJ_Z; */ /* mtex->mapping= MTEX_FLAT; */ } - /* hier niet testen op mtex->object en mtex->texco op TEXCO_ORCO zetten: mtex is linked! */ + /* do not test for mtex->object and set mtex->texco at TEXCO_ORCO: mtex is linked! */ ma->texco |= mtex->texco; ma->mapto |= mtex->mapto; @@ -677,16 +676,16 @@ void delete_material_index() ob= ((G.scene->basact)? (G.scene->basact->object) : 0) ; if(ob==0 || ob->totcol==0) return; - /* neem als uitgangspunt de mesh/curve/mball, verwijder 1 index, EN bij alle ob's - * die ook zelfde ob->data hebben + /* take a mesh/curve/mball as starting point, remove 1 index, + * AND with all objects that share the ob->data * - * Daarna ook indexen in mesh/curve/mball wijzigen!!! + * after that check indices in mesh/curve/mball!!! */ totcolp= give_totcolp(ob); matarar= give_matarar(ob); - /* we deleten de actcol */ + /* we delete the actcol */ if(ob->totcol) { mao= (*matarar)[ob->actcol-1]; if(mao) mao->id.us--; @@ -708,7 +707,7 @@ void delete_material_index() if(obt->data==ob->data) { - /* LET OP: actcol hier niet van ob of van obt pakken (kan nul worden) */ + /* WATCH IT: do not use actcol from ob or from obt (can become zero) */ mao= obt->mat[actcol-1]; if(mao) mao->id.us--; @@ -726,7 +725,7 @@ void delete_material_index() allqueue(REDRAWBUTSMAT, 0); - /* indexen van mesh goedzetten */ + /* check indices from mesh */ if(ob->type==OB_MESH) { me= get_mesh(ob);