ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/text.c
(Generate patch)

Comparing ray/src/rt/text.c (file contents):
Revision 2.14 by greg, Thu May 25 15:13:43 1995 UTC vs.
Revision 2.21 by greg, Tue Feb 25 02:47:23 2003 UTC

# Line 1 | Line 1
1 /* Copyright (c) 1992 Regents of the University of California */
2
1   #ifndef lint
2 < static char SCCSid[] = "$SunId$ LBL";
2 > static const char       RCSid[] = "$Id$";
3   #endif
6
4   /*
5   *  text.c - functions for text patterns and mixtures.
9 *
10 *     11/12/86
6   */
7  
8 + #include "copyright.h"
9 +
10   #include  "ray.h"
11  
12   #include  "otypes.h"
# Line 45 | Line 42 | static char SCCSid[] = "$SunId$ LBL";
42   *              [spacing]
43   *
44   *  Colortext is identical, except colors are given rather than
45 < *  brightnesses.  Mixtext has foreground and background modifiers:
45 > *  brightnesses.
46   *
47 + *  Mixtext has foreground and background modifiers:
48 + *
49   *      modifier mixtext id
50   *      4+ foremod backmod fontfile text..
51   *      0
# Line 77 | Line 76 | typedef struct {
76          TLINE  tl;                      /* line list */
77   }  TEXT;
78  
80 extern char  *getlibpath();
81
82 extern char  *fgetword();
83
79   TEXT  *gettext();
80  
81   TLINE  *tlalloc();
82  
83  
84 < text(m, r)
84 > do_text(m, r)
85   register OBJREC  *m;
86   RAY  *r;
87   {
# Line 105 | Line 100 | RAY  *r;
100                  char  *modname = m->oargs.sarg[foreground ? 0 : 1];
101                  if (!strcmp(modname, VOIDID))
102                          omod = OVOID;
103 <                else if ((omod = modifier(modname)) == OVOID) {
103 >                else if ((omod = lastmod(objndx(m), modname)) == OVOID) {
104                          sprintf(errmsg, "undefined modifier \"%s\"", modname);
105                          objerror(m, USER, errmsg);
106                  }
# Line 114 | Line 109 | RAY  *r;
109                                  objerror(m, USER, "inappropriate modifier");
110                          return(1);
111                  }
112 <        }
118 <        if (m->otype == PAT_BTEXT) {
112 >        } else if (m->otype == PAT_BTEXT) {
113                  if (foreground)
114                          scalecolor(r->pcol, m->oargs.farg[9]);
115                  else
# Line 140 | Line 134 | TLINE *
134   tlalloc(s)                      /* allocate and assign text line */
135   char  *s;
136   {
143        extern char  *strcpy();
137          register int  siz;
138          register TLINE  *tl;
139  
# Line 160 | Line 153 | register OBJREC  *tm;
153   {
154   #define  R      (tm->oargs.farg+3)
155   #define  D      (tm->oargs.farg+6)
163        extern char  *strcpy();
156          FVECT  DxR;
157          double  d;
158          FILE  *fp;
# Line 180 | Line 172 | register OBJREC  *tm;
172                                                  /* compute vectors */
173          fcross(DxR, D, R);
174          fcross(t->right, DxR, D);
175 <        d = DOT(D,D)/DOT(t->right,t->right);
175 >        d = DOT(t->right,t->right);
176 >        if (d <= FTINY*FTINY*FTINY*FTINY)
177 >                objerror(tm, USER, "illegal motion vector");
178 >        d = DOT(D,D)/d;
179          for (i = 0; i < 3; i++)
180                  t->right[i] *= d;
181          fcross(t->down, R, DxR);
# Line 256 | Line 251 | OBJREC  *m;
251                  return;
252          while ((tlp = tp->tl.next) != NULL) {
253                  tp->tl.next = tlp->next;
254 <                free((char *)tlp->spc);
255 <                free((char *)tlp);
254 >                free((void *)tlp->spc);
255 >                free((void *)tlp);
256          }
257 <        free((char *)tp);
257 >        freefont(tp->f);        /* release font reference */
258 >        free((void *)tp);
259          m->os = NULL;
260   }
261  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines