The last of the blenkernel files with translated comments

This commit is contained in:
2003-04-26 13:07:59 +00:00
parent 76fe6daa15
commit 1458560f6d
9 changed files with 155 additions and 181 deletions

View File

@@ -1,13 +1,11 @@
/* mball.c MIXED MODEL
*
* mei 95
/* mball.c
*
*
* MetaBalls are created from a single Object (with a name without number in it),
* here the DispList and BoundBox also is located.
* All objects with the same name (but with a number in it) are added to this.
*
* METABALLS ontstaan vanuit een Object (naam zonder nr), hier zit de DispList en boundbox,
* alle objecten met zelfde naam (en een nr) worden hieraan toegevoegd.
*
* De texture coordinaten zitten als loos element in de displist.
* texture coordinates are patched within the displist
*
* $Id$
*
@@ -90,7 +88,7 @@ void unlink_mball(MetaBall *mb)
}
/* niet mball zelf vrijgeven */
/* do not free mball itself */
void free_mball(MetaBall *mb)
{
@@ -141,10 +139,10 @@ void make_local_mball(MetaBall *mb)
Object *ob;
MetaBall *mbn;
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(mb->id.lib==0) return;
@@ -248,7 +246,7 @@ void make_orco_mball(Object *ob)
float loc[3], size[3];
int a;
/* size en loc restoren */
/* restore size and loc */
bb= ob->bb;
loc[0]= (bb->vec[0][0]+bb->vec[4][0])/2.0f;
size[0]= bb->vec[4][0]-loc[0];
@@ -300,7 +298,7 @@ Object *find_basis_mball(Object *basis)
/* ******************** ARITH ************************* */
/* DANKBAAR GEBRUIK GEMAAKT VAN (EN COMPLEET VERANDERD) :
/* BASED AT CODE (but mostly rewritten) :
* C code from the article
* "An Implicit Surface Polygonizer"
* by Jules Bloomenthal, jbloom@beauty.gmu.edu
@@ -551,7 +549,7 @@ void accum_mballfaces(int i1, int i2, int i3, int i4)
cur= indices+4*curindex;
/* voorkomen dat nulcodes voorkomen */
/* prevent zero codes for faces indices */
if(i3==0) {
if(i4) {
i3= i4;
@@ -585,18 +583,17 @@ struct pgn_elements {
void *new_pgn_element(int size)
{
/* gedurende het polygonizeren worden duizenden elementen aangemaakt en
* nooit (tussendoor) vrijgegeven. Alleen op eind is vrijgeven nodig.
/* during polygonize 1000s of elements are allocated
* and never freed inbetween. Freeing only done at the end.
*/
int blocksize= 16384;
static int offs= 0; /* het huidige vrije adres */
static int offs= 0; /* the current free address */
static struct pgn_elements *cur= 0;
static ListBase lb= {0, 0};
void *adr;
if(size>10000 || size==0) {
printf("incorrect use of new_pgn_element\n");
/* exit(0); */
}
else if(size== -1) {
cur= lb.first;
@@ -740,9 +737,6 @@ void docube(CUBE *cube, PROCESS *p)
* and add new cube to cube stack */
void testface(int i, int j, int k, CUBE* old, int bit, int c1, int c2, int c3, int c4, PROCESS *p)
/* CUBE *old; */
/* PROCESS *p; */
/* int i, j, k, bit, c1, c2, c3, c4; */
{
CUBE newc;
CUBES *oldcubes = p->cubes;
@@ -794,14 +788,12 @@ void testface(int i, int j, int k, CUBE* old, int bit, int c1, int c2, int c3, i
set (and cache) its function value */
CORNER *setcorner (PROCESS* p, int i, int j, int k)
/* int i, j, k; */
/* PROCESS *p; */
{
/* for speed, do corner value caching here */
CORNER *c;
int index;
/* bestaat corner al? */
/* does corner exist? */
index = HASH(i, j, k);
c = p->corners[index];
@@ -865,7 +857,6 @@ int nextcwedge (int edge, int face)
/* otherface: return face adjoining edge that is not the given face */
int otherface (int edge, int face)
/* int edge, face; */
{
int other = leftface[edge];
return face == other? rightface[edge] : other;
@@ -946,8 +937,6 @@ void BKE_freecubetable(void)
* return 1 if already set; otherwise, set and return 0 */
int setcenter(CENTERLIST *table[], int i, int j, int k)
/* CENTERLIST *table[]; */
/* int i, j, k; */
{
int index;
CENTERLIST *newc, *l, *q;
@@ -977,8 +966,6 @@ void setedge (EDGELIST *table[],
int k1, int i2,
int j2, int k2,
int vid)
/* EDGELIST *table[]; */
/* int i1, j1, k1, i2, j2, k2, vid; */
{
unsigned int index;
EDGELIST *newe;
@@ -1013,8 +1000,6 @@ void setedge (EDGELIST *table[],
int getedge (EDGELIST *table[],
int i1, int j1, int k1,
int i2, int j2, int k2)
/* EDGELIST *table[]; */
/* int i1, j1, k1, i2, j2, k2; */
{
EDGELIST *q;
@@ -1051,8 +1036,6 @@ int getedge (EDGELIST *table[],
/* addtovertices: add v to sequence of vertices */
void addtovertices (VERTICES *vertices, VERTEX v)
/* VERTICES *vertices; */
/* VERTEX v; */
{
if (vertices->count == vertices->max) {
int i;
@@ -1071,8 +1054,6 @@ void addtovertices (VERTICES *vertices, VERTEX v)
/* vnormal: compute unit length surface normal at point */
void vnormal (MB_POINT *point, PROCESS *p, MB_POINT *v)
/* MB_POINT *point, *v; */
/* PROCESS *p; */
{
float delta= 0.2f*p->delta;
float f = p->function(point->x, point->y, point->z);
@@ -1124,8 +1105,6 @@ void vnormal (MB_POINT *point, PROCESS *p, MB_POINT *v)
int vertid (CORNER *c1, CORNER *c2, PROCESS *p)
/* CORNER *c1, *c2; */
/* PROCESS *p; */
{
VERTEX v;
MB_POINT a, b;
@@ -1226,14 +1205,14 @@ void polygonize(PROCESS *mbproc)
converge(&in, &out, -1.0, mbproc->function, &mbproc->start);
/* NEW1: zorg voor correcte uitgangspositie */
/* NEW1: make sure correct starting position */
i= (int)floor(mbproc->start.x/mbproc->size );
j= (int)floor(mbproc->start.y/mbproc->size );
k= (int)floor(mbproc->start.z/mbproc->size );
mbproc->start.x= mbproc->start.y= mbproc->start.z= 0.0;
/* dit gaat niet altijd goed: soms wordt een bal niet gevonden. waarom? */
/* but it doesn't always work, sometimes it doesn't see a ball, but why? (ton) */
/* test if cube has been found before */
if( setcenter(mbproc->centers, i, j, k)==0 ) {
@@ -1368,7 +1347,7 @@ float init_meta(Object *ob) /* return totsize */
splitIDname(ob->id.name+2, obname, &obnr);
/* hoofdarray maken */
/* make main array */
next_object(0, 0, 0);
while(next_object(1, &base, &bob)) {
@@ -1395,7 +1374,7 @@ float init_meta(Object *ob) /* return totsize */
ml= editelems.first;
else ml= mb->elems.first;
/* mat is de matrix om van deze mball in de basis-mbal te komen */
/* mat is the matrix to transform from mball into the basis-mbal */
mat= new_pgn_element(4*4*sizeof(float));
Mat4MulMat4(mat, bob->obmat, obinv);
@@ -1407,7 +1386,7 @@ float init_meta(Object *ob) /* return totsize */
while(ml && totelem<MB_MAXELEM) {
a= totelem;
/* kopie maken i.v.m. duplicates */
/* make a copy because of duplicates */
mainb[a]= new_pgn_element(sizeof(MetaElem));
*(mainb[a])= *ml;
@@ -1424,7 +1403,7 @@ float init_meta(Object *ob) /* return totsize */
}
}
/* totsize (= 'manhattan' straal) berekenen */
/* totsize (= 'manhattan' radius) */
totsize= 0.0;
for(a=0; a<totelem; a++) {
@@ -1491,13 +1470,13 @@ void metaball_polygonize(Object *ob)
return;
}
/* width is afmeting per polygoniseerkubus */
/* width is size per polygonize cube */
if(R.flag & R_RENDERING) width= mb->rendersize;
else {
width= mb->wiresize;
if(G.moving && mb->flag==MB_UPDATE_HALFRES) width*= 2;
}
/* nr_cubes is voor de veiligheid, minmaal de totsize */
/* nr_cubes is just for safety, minimum is totsize */
nr_cubes= (int)(0.5+totsize/width);
/* init process */

View File

@@ -1,7 +1,6 @@
/* mesh.c MIXED MODEL
*
* jan/maart 95
/* mesh.c
*
*
*
* $Id$
@@ -100,7 +99,7 @@ int update_realtime_texture(TFace *tface, double time)
if(ima->tpageflag & IMA_TWINANIM) {
if(ima->twend >= ima->xrep*ima->yrep) ima->twend= ima->xrep*ima->yrep-1;
/* check: zit de bindcode niet het array? Vrijgeven. (nog doen) */
/* check: is the bindcode not in the array? Then free. (still to do) */
diff = (float)(time-ima->lastupdate);
@@ -156,7 +155,7 @@ void unlink_mesh(Mesh *me)
}
/* niet mesh zelf vrijgeven */
/* do not free mesh itself */
void free_mesh(Mesh *me)
{
@@ -276,7 +275,7 @@ void make_local_tface(Mesh *me)
tface= me->tface;
while(a--) {
/* speciaal geval: ima altijd meteen lokaal */
/* special case: ima always local immediately */
if(tface->tpage) {
ima= tface->tpage;
if(ima->id.lib) {
@@ -295,11 +294,11 @@ void make_local_mesh(Mesh *me)
Object *ob;
Mesh *men;
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(me->id.lib==0) return;
if(me->id.us==1) {
@@ -501,7 +500,7 @@ void make_orco_mesh(Mesh *me)
orco[1]= (fp[1]-me->loc[1])/me->size[1];
orco[2]= (fp[2]-me->loc[2])/me->size[2];
/* mvert alleen ophogen als totvert <= kb->totelem */
/* only increase mvert when totvert <= kb->totelem */
if(a<kb->totelem) fp+=3;
}
}
@@ -517,7 +516,7 @@ void make_orco_mesh(Mesh *me)
orco[1]= (mvert->co[1]-me->loc[1])/me->size[1];
orco[2]= (mvert->co[2]-me->loc[2])/me->size[2];
/* mvert alleen ophogen als totvert <= me->totvert */
/* only increase mvert when totvert <= me->totvert */
if(a<me->totvert) mvert++;
}
}
@@ -560,7 +559,7 @@ void test_index_mface(MFace *mface, int nr)
nr--;
}
/* voorkom dat een nul op de verkeerde plek staat */
/* prevent a zero at wrong index location */
if(nr==2) {
if(mface->v2==0) SWAP(int, mface->v1, mface->v2);
}
@@ -608,7 +607,7 @@ void test_index_mface(MFace *mface, int nr)
void test_index_mface()
but it fixes texture coordinates as well.
but it fixes texture coordinates as well.
*/
#define UVCOPY(t, s) memcpy(t, s, 2 * sizeof(float));
@@ -637,7 +636,7 @@ void test_index_face(MFace *mface, TFace *tface, int nr)
nr--;
}
/* voorkom dat een nul op de verkeerde plek staat */
/* prevent a zero at wrong index location */
if(nr==2) {
if(mface->v2==0) SWAP(int, mface->v1, mface->v2);
}
@@ -854,14 +853,14 @@ void nurbs_to_mesh(Object *ob)
cu= ob->data;
if(ob->type==OB_CURVE) {
/* regel: dl->type INDEX3 altijd vooraan in lijst */
/* rule: dl->type INDEX3 always as first in list */
dl= cu->disp.first;
if(dl->type!=DL_INDEX3) {
curve_to_filledpoly(ob->data, &cu->disp);
}
}
/* tellen */
/* count */
dl= cu->disp.first;
while(dl) {
if(dl->type==DL_SEGM) {
@@ -890,7 +889,7 @@ void nurbs_to_mesh(Object *ob)
return;
}
/* mesh maken */
/* make mesh */
me= add_mesh();
me->totvert= totvert;
me->totface= totvlak;
@@ -903,7 +902,7 @@ void nurbs_to_mesh(Object *ob)
mvert=me->mvert= MEM_callocN(me->totvert*sizeof(MVert), "cumesh1");
mface=me->mface= MEM_callocN(me->totface*sizeof(MFace), "cumesh2");
/* verts en vlakken */
/* verts and faces */
vertcount= 0;
dl= cu->disp.first;
@@ -1000,9 +999,9 @@ void nurbs_to_mesh(Object *ob)
if( (dl->flag & 2)==0 && a==dl->parts-1) break;
if(dl->flag & 1) { /* p2 -> p1 -> */
if(dl->flag & 1) { /* p2 -> p1 -> */
p1= startvert+ dl->nr*a; /* p4 -> p3 -> */
p2= p1+ dl->nr-1; /* -----> volgende rij */
p2= p1+ dl->nr-1; /* -----> next row */
p3= p1+ dl->nr;
p4= p2+ dl->nr;
b= 0;
@@ -1049,7 +1048,7 @@ void nurbs_to_mesh(Object *ob)
tex_space_mesh(me);
/* andere users */
/* other users */
ob1= G.main->object.first;
while(ob1) {
if(ob1->data==cu) {

View File

@@ -1,6 +1,5 @@
/* object.c MIXED MODEL
*
* jan 95
/* object.c
*
*
* $Id$
*
@@ -105,7 +104,7 @@
/* Local function protos */
static void solve_parenting (Object *ob, Object *par, float slowmat[][4], int simul);
float originmat[3][3]; /* na where_is_object(), kan her en der gebruikt worden */
float originmat[3][3]; /* after where_is_object(), can be used in other functions (bad!) */
Object workob;
void clear_workob(void)
@@ -146,12 +145,12 @@ void update_base_layer(Object *ob)
}
}
/* niet object zelf vrijgeven */
/* do not free object itself */
void free_object(Object *ob)
{
int a;
/* specifieke data loskoppelen */
/* disconnect specific data */
if(ob->data) {
ID *id= ob->data;
id->us--;
@@ -212,7 +211,7 @@ void unlink_object(Object *ob)
unlink_controllers(&ob->controllers);
unlink_actuators(&ob->actuators);
/* alle objecten aflopen: parents en bevels */
/* check all objects: parents en bevels */
obt= G.main->object.first;
while(obt) {
if(obt->id.lib==0) {
@@ -247,13 +246,13 @@ void unlink_object(Object *ob)
obt= obt->id.next;
}
/* materialen */
/* materials */
mat= G.main->mat.first;
while(mat) {
for(a=0; a<8; a++) {
if(mat->mtex[a] && ob==mat->mtex[a]->object) {
/* eigenlijk testen op lib */
/* actually, test for lib here... to do */
mat->mtex[a]->object= 0;
}
}
@@ -289,7 +288,7 @@ void unlink_object(Object *ob)
wrld= wrld->id.next;
}
/* scene's */
/* scenes */
sce= G.main->scene.first;
while(sce) {
if(sce->id.lib==0) {
@@ -382,11 +381,11 @@ void make_local_camera(Camera *cam)
Object *ob;
Camera *camn;
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(cam->id.lib==0) return;
if(cam->id.us==1) {
@@ -482,11 +481,11 @@ void make_local_lamp(Lamp *la)
Object *ob;
Lamp *lan;
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(la->id.lib==0) return;
if(la->id.us==1) {
@@ -601,8 +600,8 @@ static char *get_obdata_defname(int type)
}
}
/* algemene add: in G.scene, met layer uit area en default naam */
/* maakt alle minimaal nodige datablokken aan, zonder vertices etc. */
/* general add: to G.scene, with layer from area and default name */
/* creates minimum required data, but without vertices etc. */
Object *add_object(int type)
{
Object *ob;
@@ -649,7 +648,7 @@ Object *add_object(int type)
ob->dupon= 1; ob->dupoff= 0;
ob->dupsta= 1; ob->dupend= 100;
/* Gameengine defaults*/
/* Game engine defaults*/
ob->mass= ob->inertia= 1.0f;
ob->formfactor= 0.4f;
ob->damping= 0.04f;
@@ -727,7 +726,7 @@ Object *copy_object(Object *ob)
if (actcon)
obn->activecon = actcon;
/* usernummers ophogen */
/* increase user numbers */
id_us_plus((ID *)obn->data);
id_us_plus((ID *)obn->ipo);
id_us_plus((ID *)obn->action);
@@ -757,11 +756,11 @@ void make_local_object(Object *ob)
Scene *sce;
Base *base;
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(ob->id.lib==0) return;
if(ob->id.us==1) {
@@ -817,7 +816,7 @@ void make_local_object(Object *ob)
/* *************** CALC ****************** */
/* er zit ook een tijdberekening in de drawobject() */
/* there is also a timing calculation in drawobject() */
float bluroffs= 0.0;
int no_speed_curve= 0;
@@ -835,11 +834,11 @@ void disable_speed_curve(int val)
float bsystem_time(Object *ob, Object *par, float cfra, float ofs)
{
/* geeft float terug ( zie ook frame_to_float in ipo.c) */
/* returns float ( see frame_to_float in ipo.c) */
if(no_speed_curve==0) if(ob && ob->ipo) cfra= calc_ipo_time(ob->ipo, cfra);
/* tweede field */
/* 2nd field */
if(R.flag & R_SEC_FIELD) {
if(R.r.mode & R_FIELDSTILL); else cfra+= .5;
}
@@ -930,7 +929,7 @@ void ob_parcurve(Object *ob, Object *par, float mat[][4])
if(cu->path==0 || cu->path->data==0) calc_curvepath(par);
if(cu->path==0) return;
/* uitzondering afvangen: curve paden die als duplicator worden gebruikt */
/* catch exceptions: curve paths used as a duplicator */
if(enable_cu_speed) {
ctime= bsystem_time(ob, par, (float)G.scene->r.cfra, 0.0);
@@ -999,7 +998,7 @@ void ob_parlimb(Object *ob, Object *par, float mat[][4])
float ang=0.0;
int cur=0;
/* in lokale ob space */
/* in local ob space */
Mat4One(mat);
ika= par->data;
@@ -1058,7 +1057,7 @@ void give_parvert(Object *par, int nr, float *vec)
if(me->totvert) {
if(nr >= me->totvert) nr= 0;
/* is er deform */
/* is there a deform */
dl= find_displist(&par->disp, DL_VERTS);
if(dl) {
fp= dl->verts+3*nr;
@@ -1128,7 +1127,7 @@ void ob_parvert3(Object *ob, Object *par, float mat[][4])
{
float cmat[3][3], v1[3], v2[3], v3[3], q[4];
/* in lokale ob space */
/* in local ob space */
Mat4One(mat);
if ELEM3(par->type, OB_MESH, OB_SURF, OB_CURVE) {
@@ -1182,8 +1181,8 @@ void where_is_object_time(Object *ob, float ctime)
int a;
int pop;
/* nieuwe versie: correcte parent+vertexparent en track+parent */
/* deze berekent alleen de directe relatie met de parent en track */
/* new version: correct parent+vertexparent and track+parent */
/* this one only calculates direct attached parent and track */
/* hij is sneller, maar moet wel de timeoffs in de gaten houden */
if(ob==0) return;
@@ -1364,7 +1363,7 @@ void solve_tracking (Object *ob, float targetmat[][4])
QuatToMat3(quat, totmat);
if(ob->parent && (ob->transflag & OB_POWERTRACK)) {
/* 'tijdelijk' : parent info wissen */
/* 'temporal' : clear parent info */
object_to_mat4(ob, tmat);
tmat[0][3]= ob->obmat[0][3];
tmat[1][3]= ob->obmat[1][3];
@@ -1383,7 +1382,7 @@ void solve_tracking (Object *ob, float targetmat[][4])
void where_is_object(Object *ob)
{
/* deze zijn gememcopied */
/* these have been mem copied */
if(ob->flag & OB_FROMDUPLI) return;
where_is_object_time(ob, (float)G.scene->r.cfra);
@@ -1391,6 +1390,7 @@ void where_is_object(Object *ob)
void where_is_object_simul(Object *ob)
/* was written for the old game engine (until 2.04) */
/* It seems that this function is only called
for a lamp that is the child of another object */
{
@@ -1401,11 +1401,9 @@ for a lamp that is the child of another object */
float fac1, fac2;
int a;
/* nieuwe versie: correcte parent+vertexparent en track+parent */
/* deze berekent alleen de directe relatie met de parent en track */
/* GEEN TIMEOFFS */
/* NO TIMEOFFS */
/* geen ipo! (ivm dloc en realtime-ipos) */
/* no ipo! (because of dloc and realtime-ipos) */
ipo= ob->ipo;
ob->ipo= NULL;
@@ -1435,7 +1433,7 @@ for a lamp that is the child of another object */
solve_constraints(ob, TARGET_OBJECT, NULL, G.scene->r.cfra);
/* LET OP!!! */
/* WATCH IT!!! */
ob->ipo= ipo;
}
@@ -1569,7 +1567,7 @@ void what_does_parent1(Object *par, int partype, int par1, int par2, int par3)
Mat4One(workob.parentinv);
workob.parent= par;
if(par)
workob.track= par->track; /* LET OP: NIET ECHT NETJES */
workob.track= par->track; /* WATCH IT: THATS NOT NICE CODE */
workob.partype= partype;
workob.par1= par1;
workob.par2= par2;

View File

@@ -1,7 +1,5 @@
/* scene.c MIXED MODEL
*
* jan 95
/* scene.c
*
*
* $Id$
@@ -103,7 +101,7 @@ void free_avicodecdata(AviCodecData *acd)
}
}
/* niet scene zelf vrijgeven */
/* do not free scene itself */
void free_scene(Scene *sce)
{
Base *base;
@@ -113,7 +111,7 @@ void free_scene(Scene *sce)
base->object->id.us--;
base= base->next;
}
/* pas op: niet objects vrijgeven! */
/* do not free objects! */
BLI_freelistN(&sce->base);
free_editing(sce->ed);
@@ -185,15 +183,14 @@ int object_in_scene(Object *ob, Scene *sce)
void sort_baselist(Scene *sce)
{
/* alles in volgorde van parent en track */
/* in order of parent and track */
ListBase tempbase, noparentbase, notyetbase;
Base *base, *test=NULL;
Object *par;
int doit, domore= 0, lastdomore=1;
/* volgorde gelijk houden als er niets veranderd is! */
/* hier waren problemen met campos array's: volgorde camera's is van belang */
/* keep same order when nothing has changed! */
while(domore!=lastdomore) {
@@ -347,7 +344,7 @@ void set_scene_bg(Scene *sce)
G.scene= sce;
/* objecten deselecteren (voor dataselect) */
/* deselect objects (for dataselect) */
ob= G.main->object.first;
while(ob) {
ob->flag &= ~(SELECT|OB_FROMGROUP);
@@ -365,10 +362,10 @@ void set_scene_bg(Scene *sce)
group= group->id.next;
}
/* baselijst sorteren */
/* sort baselist */
sort_baselist(sce);
/* layers en flags uit bases naar objecten kopieeren */
/* copy layers and flags from bases to objects */
base= G.scene->base.first;
while(base) {
@@ -378,7 +375,7 @@ void set_scene_bg(Scene *sce)
flag= base->object->flag & OB_FROMGROUP;
base->flag |= flag;
base->object->ctime= -1234567.0; /* forceer ipo */
base->object->ctime= -1234567.0; /* force ipo to be calculated later */
base= base->next;
}
@@ -431,7 +428,7 @@ int next_object(int val, Base **base, Object **ob)
/* de eerste base */
/* the first base */
if(fase==F_START) {
*base= G.scene->base.first;
if(*base) {
@@ -439,7 +436,7 @@ int next_object(int val, Base **base, Object **ob)
fase= F_SCENE;
}
else {
/* uitzondering: een lege scene */
/* exception: empty scene */
if(G.scene->set && G.scene->set->base.first) {
*base= G.scene->set->base.first;
*ob= (*base)->object;
@@ -453,7 +450,7 @@ int next_object(int val, Base **base, Object **ob)
if(*base) *ob= (*base)->object;
else {
if(fase==F_SCENE) {
/* de scene is klaar, we gaan door met de set */
/* scene is finished, now do the set */
if(G.scene->set && G.scene->set->base.first) {
*base= G.scene->set->base.first;
*ob= (*base)->object;
@@ -474,7 +471,7 @@ int next_object(int val, Base **base, Object **ob)
}
}
/* dupli's afhandelen */
/* handle dupli's */
if(dupob) {
*ob= dupob;

View File

@@ -1,5 +1,5 @@
/* screen.c dec/jan 93/94 GRAPHICS
/* screen.c
*
* $Id$
*

View File

@@ -1,5 +1,5 @@
/* subsurf.c MIXED MODEL
/* subsurf.c
*
* jun 2001
*

View File

@@ -1,4 +1,6 @@
/**
/* text.c
*
*
* $Id$
*
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****

View File

@@ -1,4 +1,6 @@
/**
/* texture.c
*
*
* $Id$
*
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
@@ -87,7 +89,7 @@ extern int Talpha;
/* ------------------------------------------------------------------------- */
/* Alle support voor plugin textures: */
/* All support for plugin textures: */
int test_dlerr(const char *name, const char *symbol)
{
char *err;
@@ -200,7 +202,7 @@ void free_plugin_tex(PluginTex *pit)
{
if(pit==0) return;
/* geen PIL_dynlib_close: dezelfde plugin kan meerdere keren geopend zijn: 1 handle */
/* no PIL_dynlib_close: same plugin can be opened multiple times, 1 handle */
MEM_freeN(pit);
}
@@ -251,18 +253,18 @@ int do_colorband(ColorBand *coba)
cbd1= coba->data;
if(Tin <= cbd1->pos) { /* helemaal links */
if(Tin <= cbd1->pos) { /* ultimate left */
Tr= cbd1->r;
Tg= cbd1->g;
Tb= cbd1->b;
Ta= cbd1->a;
}
else {
/* we zoeken de eerste pos > Tin */
/* we're looking for first pos > Tin */
for(a=0; a<coba->tot; a++, cbd1++) if(cbd1->pos >= Tin) break;
if(a==coba->tot) { /* helemaal rechts */
if(a==coba->tot) { /* ultimate right */
cbd1--;
Tr= cbd1->r;
Tg= cbd1->g;
@@ -274,7 +276,7 @@ int do_colorband(ColorBand *coba)
fac= (Tin-cbd1->pos)/(cbd2->pos-cbd1->pos);
if(coba->ipotype==2) {
/* ipo van r naar l: 3 2 1 0 */
/* ipo from right to left: 3 2 1 0 */
if(a>=coba->tot-1) cbd0= cbd1;
else cbd0= cbd1+1;
@@ -432,15 +434,15 @@ void make_local_texture(Tex *tex)
World *wrld;
Lamp *la;
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(tex->id.lib==0) return;
/* speciaal geval: ima altijd meteen lokaal */
/* special case: ima always local immediately */
if(tex->ima) {
tex->ima->id.lib= 0;
tex->ima->id.flag= LIB_LOCAL;
@@ -575,7 +577,7 @@ void init_render_texture(Tex *tex)
/* is also used as signal */
tex->nor= 0;
/* imap testen */
/* imap test */
if(tex->frames && tex->ima && tex->ima->name) { /* frames */
strcpy(name, tex->ima->name);
@@ -589,7 +591,7 @@ void init_render_texture(Tex *tex)
}
}
else {
/* voor patch field-ima rendering */
/* for patch field-ima rendering */
tex->ima->lastframe= imanr;
BLI_stringdec(name, head, tail, &numlen);
@@ -989,7 +991,7 @@ int plugintex(Tex *tex, float *texvec, float *dxt, float *dyt)
return rgbnor;
}
/* *************** PROJEKTIES ******************* */
/* *************** PROJECTIONS ******************* */
void tubemap(float x, float y, float z, float *adr1, float *adr2)
{
@@ -1012,7 +1014,7 @@ void spheremap(float x, float y, float z, float *adr1, float *adr2)
len= sqrt(x*x+y*y+z*z);
if(len>0.0) {
if(x==0.0 && y==0.0) *adr1= 0.0; /* anders domain error */
if(x==0.0 && y==0.0) *adr1= 0.0; /* othwise domain error */
else *adr1 = (1.0 - atan2(x,y)/M_PI )/2.0;
z/=len;
@@ -1184,7 +1186,7 @@ void do_2d_mapping(MTex *mtex, float *t, float *dxt, float *dyt)
dyt[1]/= 2.0;
}
else if ELEM(wrap, MTEX_TUBE, MTEX_SPHERE) {
/* uitzondering: de naad achter (y<0.0) */
/* exception: the seam behind (y<0.0) */
ok= 1;
if(t[1]<=0.0) {
fx= t[0]+dxt[0];
@@ -1237,7 +1239,7 @@ void do_2d_mapping(MTex *mtex, float *t, float *dxt, float *dyt)
dyt[1]/= 2.0;
}
/* als area dan dxt[] en dyt[] opnieuw berekenen */
/* if area, then reacalculate dxt[] and dyt[] */
if(areaflag) {
fx= area[0];
fy= area[1];
@@ -1337,8 +1339,8 @@ void do_material_tex()
facm, factt, facmm, facmul = 0.0, stencilTin=1.0;
float texvec[3], dxt[3], dyt[3], tempvec[3], norvec[3];
int tex_nr, rgbnor= 0;
/* hier flag testen of er wel tex is */
/* here: test flag if there's a tex (todo) */
mat_col=mat_colspec=mat_colmir=mat_ref=mat_spec=mat_har=mat_emit=mat_alpha= R.mat;
@@ -1352,7 +1354,7 @@ void do_material_tex()
tex= mtex->tex;
if(tex==0) continue;
/* welke coords */
/* which coords */
if(mtex->texco==TEXCO_ORCO) {
co= R.lo; dx= O.dxlo; dy= O.dylo;
}
@@ -1375,7 +1377,7 @@ void do_material_tex()
}
}
else {
/* als object niet bestaat geen orco's gebruiken (zijn niet geinitialiseerd */
/* if object doesn't exist, do not use orcos (not initialized) */
co= R.co;
dx= O.dxco; dy= O.dyco;
}
@@ -1405,7 +1407,7 @@ void do_material_tex()
if(tex->type==TEX_IMAGE) {
/* nieuw: eerst coords verwisselen, dan map, dan trans/scale */
/* new: first swap coords, then map, then trans/scale */
/* placement */
if(mtex->projx) texvec[0]= co[mtex->projx-1];
@@ -1436,7 +1438,7 @@ void do_material_tex()
do_2d_mapping(mtex, texvec, dxt, dyt);
/* translate en scale */
/* translate and scale */
texvec[0]= mtex->size[0]*(texvec[0]-0.5) +mtex->ofs[0]+0.5;
texvec[1]= mtex->size[1]*(texvec[1]-0.5) +mtex->ofs[1]+0.5;
if(R.osatex) {
@@ -1622,7 +1624,7 @@ void do_material_tex()
Normalise(R.vn);
/* hierdoor wordt de bump aan de volgende texture doorgegeven */
/* this makes sure the bump is passed on to the next texture */
R.orn[0]= R.vn[0];
R.orn[1]= -R.vn[1];
R.orn[2]= R.vn[2];
@@ -1777,7 +1779,7 @@ void do_halo_tex(HaloRen *har, float xn, float yn, float *colf)
rgb= multitex(mtex->tex, texvec, dxt, dyt);
/* texture uitgang */
/* texture output */
if(rgb && (mtex->texflag & MTEX_RGBTOINT)) {
Tin= (0.35*Tr+0.45*Tg+0.2*Tb);
rgb= 0;
@@ -1857,12 +1859,12 @@ void do_sky_tex()
float tempvec[3], texvec[3], dxt[3], dyt[3];
int tex_nr, rgb= 0, ok;
/* hier flag testen of er wel tex is */
/* todo: add flag to test if there's a tex */
wrld_hor= wrld_zen= G.scene->world;
/* The 6 here is rather arbitrary, it seems. */
/* The 6 here is the max amount of channels for a world */
for(tex_nr=0; tex_nr<6; tex_nr++) {
if(R.wrld.mtex[tex_nr]) {
mtex= R.wrld.mtex[tex_nr];
@@ -1870,7 +1872,7 @@ void do_sky_tex()
if(mtex->tex==0) continue;
/* if(mtex->mapto==0) continue; */
/* welke coords */
/* which coords */
co= R.lo;
/* Grab the mapping settings for this texture */
@@ -1898,7 +1900,7 @@ void do_sky_tex()
rgb= multitex(mtex->tex, texvec, dxt, dyt);
/* texture uitgang */
/* texture output */
if(rgb && (mtex->texflag & MTEX_RGBTOINT)) {
Tin= (0.35*Tr+0.45*Tg+0.2*Tb);
rgb= 0;
@@ -1989,7 +1991,7 @@ void do_sky_tex()
wrld_zen= &R.wrld;
}
else {
/* anders blijft zenRGB hangen */
/* otherwise zenRGB undefined */
R.wrld.zenr= wrld_zen->zenr;
R.wrld.zeng= wrld_zen->zeng;
R.wrld.zenb= wrld_zen->zenb;
@@ -2031,8 +2033,6 @@ void do_lamp_tex(LampRen *la, float *lavec)
float texvec[3], dxt[3], dyt[3], tempvec[3];
int tex_nr, rgb= 0;
/* hier flag testen of er wel tex is */
la_col= la->org;
tex_nr= 0;
@@ -2045,7 +2045,7 @@ void do_lamp_tex(LampRen *la, float *lavec)
tex= mtex->tex;
if(tex==0) continue;
/* welke coords */
/* which coords */
if(mtex->texco==TEXCO_OBJECT) {
ob= mtex->object;
if(ob) {
@@ -2127,7 +2127,7 @@ void do_lamp_tex(LampRen *la, float *lavec)
do_2d_mapping(mtex, texvec, dxt, dyt);
if(mtex->mapto & MAP_NORM) {
/* de pointer bepaalt of er gebumpt wordt */
/* the pointer defines if bump happens */
tex->nor= R.vn;
if(mtex->maptoneg & MAP_NORM) tex->norfac= -mtex->norfac;
else tex->norfac= mtex->norfac;
@@ -2139,7 +2139,7 @@ void do_lamp_tex(LampRen *la, float *lavec)
/* texture uitgang */
/* texture output */
if(rgb && (mtex->texflag & MTEX_RGBTOINT)) {
Tin= (0.35*Tr+0.45*Tg+0.2*Tb);
rgb= 0;
@@ -2243,7 +2243,7 @@ void externtex(MTex *mtex, float *vec)
do_2d_mapping(mtex, texvec, dxt, dyt);
if(mtex->mapto & MAP_NORM) {
/* de pointer bepaalt of er gebumpt wordt */
/* the pointer defines if there's bump */
tex->nor= R.vn;
if(mtex->maptoneg & MAP_NORM) tex->norfac= -mtex->norfac;
else tex->norfac= mtex->norfac;

View File

@@ -1,7 +1,6 @@
/* world.c MIX MODEL
/* world.c
*
* april 95
*
* $Id$
*
@@ -121,11 +120,11 @@ void make_local_world(World *wrld)
Scene *sce;
World *wrldn;
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(wrld->id.lib==0) return;
if(wrld->id.us==1) {
@@ -192,7 +191,7 @@ void init_render_world()
if(G.scene->camera && G.scene->camera->type==OB_CAMERA) {
Camera *cam= G.scene->camera->data;
if(cam->type==CAM_ORTHO) {
/* dit is maar ongeveer */
/* this is an estimation */
R.wrld.miststa+= (float)fabs(R.viewmat[3][2]);
}
}