--- ray/src/rt/text.c 1995/05/25 15:13:43 2.14 +++ ray/src/rt/text.c 1998/08/10 18:37:06 2.18 @@ -1,13 +1,11 @@ -/* Copyright (c) 1992 Regents of the University of California */ +/* Copyright (c) 1998 Silicon Graphics, Inc. */ #ifndef lint -static char SCCSid[] = "$SunId$ LBL"; +static char SCCSid[] = "$SunId$ SGI"; #endif /* * text.c - functions for text patterns and mixtures. - * - * 11/12/86 */ #include "ray.h" @@ -45,8 +43,10 @@ static char SCCSid[] = "$SunId$ LBL"; * [spacing] * * Colortext is identical, except colors are given rather than - * brightnesses. Mixtext has foreground and background modifiers: + * brightnesses. * + * Mixtext has foreground and background modifiers: + * * modifier mixtext id * 4+ foremod backmod fontfile text.. * 0 @@ -86,7 +86,7 @@ TEXT *gettext(); TLINE *tlalloc(); -text(m, r) +do_text(m, r) register OBJREC *m; RAY *r; { @@ -105,7 +105,7 @@ RAY *r; char *modname = m->oargs.sarg[foreground ? 0 : 1]; if (!strcmp(modname, VOIDID)) omod = OVOID; - else if ((omod = modifier(modname)) == OVOID) { + else if ((omod = lastmod(objndx(m), modname)) == OVOID) { sprintf(errmsg, "undefined modifier \"%s\"", modname); objerror(m, USER, errmsg); } @@ -114,8 +114,7 @@ RAY *r; objerror(m, USER, "inappropriate modifier"); return(1); } - } - if (m->otype == PAT_BTEXT) { + } else if (m->otype == PAT_BTEXT) { if (foreground) scalecolor(r->pcol, m->oargs.farg[9]); else @@ -180,7 +179,10 @@ register OBJREC *tm; /* compute vectors */ fcross(DxR, D, R); fcross(t->right, DxR, D); - d = DOT(D,D)/DOT(t->right,t->right); + d = DOT(t->right,t->right); + if (d <= FTINY*FTINY) + objerror(tm, USER, "illegal motion vector"); + d = DOT(D,D)/d; for (i = 0; i < 3; i++) t->right[i] *= d; fcross(t->down, R, DxR);