11 |
|
#include <X11/extensions/SGIStereo.h> |
12 |
|
#endif |
13 |
|
#include <ctype.h> |
14 |
+ |
#include <string.h> |
15 |
|
#include <time.h> |
16 |
|
|
17 |
|
#include "radogl.h" |
138 |
|
/* run rad and get views */ |
139 |
|
runrad(argc-i, argv+i); |
140 |
|
/* check view */ |
141 |
< |
if (viewsel != NULL) |
141 |
> |
if (viewsel != NULL) { |
142 |
|
if (viewsel[0] == '-') { |
143 |
|
char *ve = viewsel; |
144 |
|
if (!sscanview(&thisview, viewsel) || |
153 |
|
progname, viewsel); |
154 |
|
quit(1); |
155 |
|
} |
156 |
+ |
} |
157 |
|
/* open GL */ |
158 |
|
dev_open(radfile = argv[i]); |
159 |
|
/* load octree or scene files */ |
275 |
|
do |
276 |
|
if (isview(buf)) { |
277 |
|
vwl[nvv].v = (VIEW *)bmalloc(sizeof(VIEW)); |
278 |
< |
copystruct(vwl[nvv].v, &stdview); |
278 |
> |
*(vwl[nvv].v) = stdview; |
279 |
|
sscanview(vwl[nvv].v, buf); |
280 |
|
if ((cp = setview(vwl[nvv++].v)) != NULL) { |
281 |
|
fprintf(stderr, "%s: bad view %d - %s\n", |
506 |
|
no_render--; |
507 |
|
} |
508 |
|
} |
509 |
< |
copystruct(&thisview, nv); |
509 |
> |
thisview = *nv; |
510 |
|
setglpersp(&thisview); |
511 |
|
render(); |
512 |
|
return(1); |
585 |
|
VIEW nv; |
586 |
|
FVECT odir, v1, wp; |
587 |
|
double d; |
586 |
– |
register int li; |
588 |
|
/* start with old view */ |
589 |
< |
copystruct(&nv, &thisview); |
589 |
> |
nv = thisview; |
590 |
|
/* change view direction */ |
591 |
|
if ((d = viewray(v1, odir, &thisview, |
592 |
|
(dx+.5)/hres, (dy+.5)/vres)) < -FTINY) |
750 |
|
case 'l': /* retrieve last (premouse) view */ |
751 |
|
if (lastview.type) { |
752 |
|
VIEW vtmp; |
753 |
< |
copystruct(&vtmp, &thisview); |
753 |
> |
vtmp = thisview; |
754 |
|
dev_view(&lastview); |
755 |
< |
copystruct(&lastview, &vtmp); |
755 |
> |
lastview = vtmp; |
756 |
|
} else |
757 |
|
XBell(ourdisplay, 0); |
758 |
|
break; |
831 |
|
{ |
832 |
|
FILE *fp; |
833 |
|
/* check if already in there */ |
834 |
< |
if (!bcmp(&thisview, vwl[currentview].v, sizeof(VIEW))) { |
834 |
> |
if (!memcmp(&thisview, vwl[currentview].v, sizeof(VIEW))) { |
835 |
|
error(COMMAND, "view already in standard list"); |
836 |
|
return; |
837 |
|
} |
852 |
|
if (currentview >= MAXVIEW) |
853 |
|
error(INTERNAL, "too many views in appendview"); |
854 |
|
vwl[currentview].v = (VIEW *)bmalloc(sizeof(VIEW)); |
855 |
< |
copystruct(vwl[currentview].v, &thisview); |
855 |
> |
*(vwl[currentview].v) = thisview; |
856 |
|
if (nm != NULL) |
857 |
|
vwl[currentview].nam = savqstr(nm); |
858 |
|
} |
866 |
|
if (cause == lastvc) |
867 |
|
return; /* only record one view per cause */ |
868 |
|
lastvc = cause; |
869 |
< |
copystruct(&lastview, &thisview); |
869 |
> |
lastview = thisview; |
870 |
|
} |
871 |
|
|
872 |
|
|