1 |
< |
/* Copyright (c) 1997 Silicon Graphics, Inc. */ |
1 |
> |
/* Copyright (c) 1998 Silicon Graphics, Inc. */ |
2 |
|
|
3 |
|
#ifndef lint |
4 |
|
static char SCCSid[] = "$SunId$ SGI"; |
34 |
|
p->ra[i].r[1][0] = sl[2] * 256.; |
35 |
|
p->ra[i].r[1][1] = sl[3] * 256.; |
36 |
|
d = hdray(ro, rd, hdlist[p->hd], gc, p->ra[i].r); |
37 |
+ |
if (!vdef(OBSTRUCTIONS)) |
38 |
+ |
d *= frandom(); /* random offset */ |
39 |
|
if (p->offset != NULL) { |
40 |
< |
VSUM(ro, ro, rd, d); /* exterior only */ |
40 |
> |
VSUM(ro, ro, rd, d); /* advance ray */ |
41 |
|
p->offset[i] = d; |
42 |
|
} |
43 |
|
VCOPY(rod, ro); |
74 |
|
/* already closed? */ |
75 |
|
if (!nprocs) |
76 |
|
return; |
75 |
– |
wputs("closing rtrace process...\n"); |
77 |
|
/* flush beam queue */ |
78 |
|
done_packets(flush_queue()); |
79 |
|
/* sync holodeck */ |
81 |
|
/* close rtrace */ |
82 |
|
if ((status = end_rtrace())) |
83 |
|
error(WARNING, "bad exit status from rtrace"); |
84 |
< |
if (vdef(REPORT)) /* report time */ |
84 |
> |
if (vdef(REPORT)) { /* report time */ |
85 |
> |
eputs("rtrace process closed\n"); |
86 |
|
report(0); |
87 |
+ |
} |
88 |
|
return(status); /* return status */ |
89 |
|
} |
90 |
|
|
95 |
|
|
96 |
|
if (nprocs > 0) /* already running? */ |
97 |
|
return; |
95 |
– |
wputs("restarting rtrace process...\n"); |
98 |
|
starttime = time(NULL); /* reset start time and counts */ |
99 |
|
npacksdone = nraysdone = 0L; |
100 |
|
if (vdef(TIME)) /* reset end time */ |
106 |
|
} |
107 |
|
if (start_rtrace() < 1) /* start rtrace */ |
108 |
|
error(WARNING, "cannot restart rtrace"); |
109 |
< |
else if (vdef(REPORT)) |
109 |
> |
else if (vdef(REPORT)) { |
110 |
> |
eputs("rtrace process restarted\n"); |
111 |
|
report(0); |
112 |
+ |
} |
113 |
|
} |
114 |
|
|
115 |
|
|
116 |
|
getradfile() /* run rad and get needed variables */ |
117 |
|
{ |
118 |
< |
static short mvar[] = {OCTREE,-1}; |
118 |
> |
static short mvar[] = {OCTREE,EYESEP,-1}; |
119 |
|
static char tf1[] = TEMPLATE; |
120 |
|
char tf2[64]; |
121 |
|
char combuf[256]; |
124 |
|
register char *cp; |
125 |
|
/* check if rad file specified */ |
126 |
|
if (!vdef(RIF)) |
127 |
< |
return; |
127 |
> |
return(0); |
128 |
|
/* create rad command */ |
129 |
|
mktemp(tf1); |
130 |
|
sprintf(tf2, "%s.rif", tf1); |
150 |
|
if (system(combuf)) { |
151 |
|
unlink(tf2); /* clean up */ |
152 |
|
unlink(tf1); |
153 |
< |
error(SYSTEM, "cannot execute rad command"); |
153 |
> |
error(WARNING, "error executing rad command"); |
154 |
> |
return(-1); |
155 |
|
} |
156 |
|
if (pippt == NULL) { |
157 |
|
loadvars(tf2); /* load variables */ |
159 |
|
} |
160 |
|
rtargc += wordfile(rtargv+rtargc, tf1); /* get rtrace options */ |
161 |
|
unlink(tf1); /* clean up */ |
162 |
+ |
return(1); |
163 |
|
} |
164 |
|
|
165 |
|
|