--- ray/src/gen/mkillum2.c 2003/06/26 00:58:09 2.10 +++ ray/src/gen/mkillum2.c 2003/11/16 10:29:38 2.12 @@ -1,21 +1,35 @@ #ifndef lint -static const char RCSid[] = "$Id: mkillum2.c,v 2.10 2003/06/26 00:58:09 schorsch Exp $"; +static const char RCSid[] = "$Id: mkillum2.c,v 2.12 2003/11/16 10:29:38 schorsch Exp $"; #endif /* * Routines to do the actual calculation for mkillum */ +#include + #include "mkillum.h" #include "face.h" #include "cone.h" #include "random.h" +//void o_default(OBJREC *ob, struct illum_args *il, struct rtproc *rt, char *nm); +void o_face(OBJREC *ob, struct illum_args *il, struct rtproc *rt, char *nm); +void o_sphere(OBJREC *ob, struct illum_args *il, struct rtproc *rt, char *nm); +void o_ring(OBJREC *ob, struct illum_args *il, struct rtproc *rt, char *nm); +void raysamp(float res[3], FVECT org, FVECT dir, struct rtproc *rt); +void rayflush(struct rtproc *rt); +void mkaxes(FVECT u, FVECT v, FVECT n); +void rounddir(FVECT dv, double alt, double azi); +void flatdir(FVECT dv, double alt, double azi); -o_default(ob, il, rt, nm) /* default illum action */ -OBJREC *ob; -struct illum_args *il; -struct rtproc *rt; -char *nm; + +int /* XXX type conflict with otypes.h */ +o_default( /* default illum action */ + OBJREC *ob, + struct illum_args *il, + struct rtproc *rt, + char *nm +) { sprintf(errmsg, "(%s): cannot make illum for %s \"%s\"", nm, ofun[ob->otype].funame, ob->oname); @@ -24,11 +38,13 @@ char *nm; } -o_face(ob, il, rt, nm) /* make an illum face */ -OBJREC *ob; -struct illum_args *il; -struct rtproc *rt; -char *nm; +void +o_face( /* make an illum face */ + OBJREC *ob, + struct illum_args *il, + struct rtproc *rt, + char *nm +) { #define MAXMISS (5*n*il->nsamps) int dim[3]; @@ -136,11 +152,13 @@ char *nm; } -o_sphere(ob, il, rt, nm) /* make an illum sphere */ -register OBJREC *ob; -struct illum_args *il; -struct rtproc *rt; -char *nm; +void +o_sphere( /* make an illum sphere */ + register OBJREC *ob, + struct illum_args *il, + struct rtproc *rt, + char *nm +) { int dim[3]; int n, nalt, nazi; @@ -205,11 +223,13 @@ char *nm; } -o_ring(ob, il, rt, nm) /* make an illum ring */ -OBJREC *ob; -struct illum_args *il; -struct rtproc *rt; -char *nm; +void +o_ring( /* make an illum ring */ + OBJREC *ob, + struct illum_args *il, + struct rtproc *rt, + char *nm +) { int dim[3]; int n, nalt, nazi; @@ -274,10 +294,13 @@ char *nm; } -raysamp(res, org, dir, rt) /* compute a ray sample */ -float res[3]; -FVECT org, dir; -register struct rtproc *rt; +void +raysamp( /* compute a ray sample */ + float res[3], + FVECT org, + FVECT dir, + register struct rtproc *rt +) { register float *fp; @@ -290,14 +313,16 @@ register struct rtproc *rt; } -rayflush(rt) /* flush buffered rays */ -register struct rtproc *rt; +void +rayflush( /* flush buffered rays */ + register struct rtproc *rt +) { register int i; if (rt->nrays <= 0) return; - bzero(rt->buf+6*rt->nrays, 6*sizeof(float)); + memset(rt->buf+6*rt->nrays, '\0', 6*sizeof(float)); errno = 0; if ( process(&(rt->pd), (char *)rt->buf, (char *)rt->buf, 3*sizeof(float)*(rt->nrays+1), @@ -314,8 +339,12 @@ register struct rtproc *rt; } -mkaxes(u, v, n) /* compute u and v to go with n */ -FVECT u, v, n; +void +mkaxes( /* compute u and v to go with n */ + FVECT u, + FVECT v, + FVECT n +) { register int i; @@ -330,9 +359,12 @@ FVECT u, v, n; } -rounddir(dv, alt, azi) /* compute uniform spherical direction */ -register FVECT dv; -double alt, azi; +void +rounddir( /* compute uniform spherical direction */ + register FVECT dv, + double alt, + double azi +) { double d1, d2; @@ -344,9 +376,12 @@ double alt, azi; } -flatdir(dv, alt, azi) /* compute uniform hemispherical direction */ -register FVECT dv; -double alt, azi; +void +flatdir( /* compute uniform hemispherical direction */ + register FVECT dv, + double alt, + double azi +) { double d1, d2;