66 |
|
int currentview = 0; /* current view number */ |
67 |
|
VIEW thisview = STDVIEW; /* displayed view */ |
68 |
|
VIEW lastview; /* last recorded view */ |
69 |
– |
char *lastvc = NULL; /* cause of last view change */ |
69 |
|
|
70 |
|
char *progname; /* global argv[0] */ |
71 |
|
char *radfile; /* rad input file */ |
79 |
|
|
80 |
|
int displist; /* our scene display list */ |
81 |
|
|
82 |
+ |
int in_dev_view = 0; /* currently in dev_view() */ |
83 |
+ |
|
84 |
|
extern char *fgets(), *fgetline(), *atos(), *scan4var(); |
85 |
|
extern int nowarn; /* turn warnings off? */ |
86 |
|
extern time_t time(); |
420 |
|
} |
421 |
|
if (hres != 0 & vres != 0) { |
422 |
|
wa = (vres*pheight)/(hres*pwidth); |
423 |
< |
va = viewaspect(&thisview); |
423 |
> |
va = viewaspect(nv); |
424 |
|
if (va > wa+.05) { |
425 |
|
newvres = (pwidth/pheight)*va*newhres + .5; |
426 |
|
if (newvres > maxvres) { |
435 |
|
} |
436 |
|
} |
437 |
|
if (newhres != hres | newvres != vres) { |
438 |
+ |
in_dev_view++; |
439 |
|
XResizeWindow(ourdisplay, gwind, newhres, newvres); |
440 |
|
do |
441 |
|
dev_input(0); /* get resize event */ |
442 |
|
while (newhres != hres | newvres != vres); |
443 |
+ |
in_dev_view--; |
444 |
|
} |
445 |
|
} |
446 |
|
copystruct(&thisview, nv); |
612 |
|
{ |
613 |
|
double d, xmin, xmax, ymin, ymax, zmin, zmax; |
614 |
|
|
615 |
< |
zmin = 0.05; |
616 |
< |
zmax = 5000.; |
615 |
> |
zmin = 0.1; |
616 |
> |
zmax = 1000.; |
617 |
|
if (thisview.vfore > FTINY) |
618 |
|
zmin = thisview.vfore; |
619 |
|
if (thisview.vaft > FTINY) |
657 |
|
headlocked = 0; |
658 |
|
break; |
659 |
|
case 'l': /* retrieve last (premouse) view */ |
660 |
< |
if (lastvc != NULL) { |
660 |
> |
if (lastview.type) { |
661 |
|
VIEW vtmp; |
662 |
|
copystruct(&vtmp, &thisview); |
663 |
|
dev_view(&lastview); |
731 |
|
vwnum = 0; |
732 |
|
if (vwnum == currentview) |
733 |
|
return; |
734 |
+ |
/* copylastv("change view"); */ |
735 |
|
dev_view(vwl[currentview=vwnum].v); |
736 |
|
} |
737 |
|
|
772 |
|
copylastv(cause) /* copy last view position */ |
773 |
|
char *cause; |
774 |
|
{ |
775 |
+ |
static char *lastvc; |
776 |
+ |
|
777 |
|
if (cause == lastvc) |
778 |
|
return; /* only record one view per cause */ |
779 |
|
lastvc = cause; |
804 |
|
glViewport(0, 0, hres=ersz->width, vres=ersz->height); |
805 |
|
if (hres > maxhres) maxhres = hres; |
806 |
|
if (vres > maxvres) maxvres = vres; |
807 |
+ |
if (in_dev_view) |
808 |
+ |
return; |
809 |
|
wa = (vres*pheight)/(hres*pwidth); |
810 |
|
va = viewaspect(&thisview); |
811 |
|
if (va > wa+.05) { |