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.18 by gwlarson, Mon Aug 10 18:37:06 1998 UTC vs.
Revision 2.24 by greg, Thu Feb 12 18:55:50 2004 UTC

# Line 1 | Line 1
1 /* Copyright (c) 1998 Silicon Graphics, Inc. */
2
1   #ifndef lint
2 < static char SCCSid[] = "$SunId$ SGI";
2 > static const char       RCSid[] = "$Id$";
3   #endif
6
4   /*
5   *  text.c - functions for text patterns and mixtures.
6   */
7  
8 + #include "copyright.h"
9 +
10   #include  "ray.h"
11  
12 + #include  "paths.h"
13 +
14   #include  "otypes.h"
15  
16   #include  "font.h"
# Line 77 | Line 78 | typedef struct {
78          TLINE  tl;                      /* line list */
79   }  TEXT;
80  
80 extern char  *getlibpath();
81
82 extern char  *fgetword();
83
81   TEXT  *gettext();
82  
83   TLINE  *tlalloc();
# Line 139 | Line 136 | TLINE *
136   tlalloc(s)                      /* allocate and assign text line */
137   char  *s;
138   {
142        extern char  *strcpy();
139          register int  siz;
140          register TLINE  *tl;
141  
# Line 159 | Line 155 | register OBJREC  *tm;
155   {
156   #define  R      (tm->oargs.farg+3)
157   #define  D      (tm->oargs.farg+6)
162        extern char  *strcpy();
158          FVECT  DxR;
159          double  d;
160          FILE  *fp;
# Line 180 | Line 175 | register OBJREC  *tm;
175          fcross(DxR, D, R);
176          fcross(t->right, DxR, D);
177          d = DOT(t->right,t->right);
178 <        if (d <= FTINY*FTINY)
178 >        if (d <= FTINY*FTINY*FTINY*FTINY)
179                  objerror(tm, USER, "illegal motion vector");
180          d = DOT(D,D)/d;
181          for (i = 0; i < 3; i++)
# Line 203 | Line 198 | register OBJREC  *tm;
198                  tlp = tlp->next;
199          } else {                                /* text file */
200                  if ((s = getpath(tm->oargs.sarg[tndx(tm)],
201 <                                getlibpath(), R_OK)) == NULL) {
201 >                                getrlibpath(), R_OK)) == NULL) {
202                          sprintf(errmsg, "cannot find text file \"%s\"",
203                                          tm->oargs.sarg[tndx(tm)]);
204                          error(USER, errmsg);
# Line 258 | Line 253 | OBJREC  *m;
253                  return;
254          while ((tlp = tp->tl.next) != NULL) {
255                  tp->tl.next = tlp->next;
256 <                free((char *)tlp->spc);
257 <                free((char *)tlp);
256 >                free((void *)tlp->spc);
257 >                free((void *)tlp);
258          }
259 <        free((char *)tp);
259 >        freefont(tp->f);        /* release font reference */
260 >        free((void *)tp);
261          m->os = NULL;
262   }
263  
# Line 331 | Line 327 | register GLYPH  *gl;
327                                          /* positive x axis cross test */
328          while (n--) {
329                  if ((p0[1]<<1 > ylb) ^ (p1[1]<<1 > ylb)) {
330 <                        tv = p0[0]<<1 > xlb | (p1[0]<<1 > xlb) << 1;
330 >                        tv = (p0[0]<<1 > xlb) | ((p1[0]<<1 > xlb) << 1);
331                          if (tv == 03)
332                                  ncross++;
333                          else if (tv)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines