--- ray/src/rt/glass.c 1996/06/06 10:23:28 2.9 +++ ray/src/rt/glass.c 2004/03/30 16:13:01 2.15 @@ -1,18 +1,15 @@ -/* Copyright (c) 1991 Regents of the University of California */ - #ifndef lint -static char SCCSid[] = "$SunId$ LBL"; +static const char RCSid[] = "$Id: glass.c,v 2.15 2004/03/30 16:13:01 schorsch Exp $"; #endif - /* * glass.c - simpler shading function for thin glass surfaces. - * - * 11/14/86 */ -#include "ray.h" +#include "copyright.h" +#include "ray.h" #include "otypes.h" +#include "rtotypes.h" /* * This definition of glass provides for a quick calculation @@ -44,9 +41,11 @@ static char SCCSid[] = "$SunId$ LBL"; #define RINDEX 1.52 /* refractive index of glass */ -m_glass(m, r) /* color a ray which hit a thin glass surface */ -OBJREC *m; -register RAY *r; +extern int +m_glass( /* color a ray which hit a thin glass surface */ + OBJREC *m, + register RAY *r +) { COLOR mcolor; double pdot; @@ -69,15 +68,16 @@ register RAY *r; setcolor(mcolor, m->oargs.farg[0], m->oargs.farg[1], m->oargs.farg[2]); + /* get modifiers */ + raytexture(r, m->omod); if (r->rod < 0.0) /* reorient if necessary */ flipsurface(r); mirtest = transtest = 0; mirdist = transdist = r->rot; - /* get modifiers */ - raytexture(r, m->omod); - if (hastexture = DOT(r->pert,r->pert) > FTINY*FTINY) + /* perturb normal */ + if ( (hastexture = (DOT(r->pert,r->pert) > FTINY*FTINY)) ) { pdot = raynormal(pnorm, r); - else { + } else { VCOPY(pnorm, r->ron); pdot = r->rod; }