27 |
|
#define MAXSCENE 127 /* maximum number of scene files */ |
28 |
|
#endif |
29 |
|
|
30 |
< |
#define ZOOMPCT 9 /* percent to zoom at a time */ |
30 |
> |
#define ZOOMPCT 9 /* percent to zoom for +/- */ |
31 |
> |
#define WZOOMPCT 3 /* percent to zoom for mouse wheel */ |
32 |
|
|
33 |
|
#define MOVPCT 4 /* percent distance to move /frame */ |
34 |
|
#define MOVDIR(b) ((b)==Button1 ? 1 : (b)==Button2 ? 0 : -1) |
76 |
|
int nscenef = 0; /* number of scene files */ |
77 |
|
char *octree; /* octree name (NULL if unnec.) */ |
78 |
|
|
79 |
< |
SUBPROC rtpd; /* rtrace process descriptors */ |
79 |
> |
SUBPROC rtpd = SP_INACTIVE; /* rtrace process descriptors */ |
80 |
|
|
81 |
|
int silent = 0; /* run rad silently? */ |
82 |
|
int backvis = 1; /* back faces visible? */ |
211 |
|
if (ourdisplay != NULL) |
212 |
|
dev_close(); |
213 |
|
/* if (rtpd.pid > 0) { */ |
214 |
< |
if (rtpd.running) { |
214 |
> |
if (rtpd.flags & PF_RUNNING) { |
215 |
|
if (close_process(&rtpd) > 0) |
216 |
|
wputs("bad exit status from rtrace\n"); |
217 |
|
/* rtpd.pid = 0; */ |
585 |
|
case KeyPress: |
586 |
|
return(getkey(levptr(XKeyPressedEvent))); |
587 |
|
case ButtonPress: |
588 |
< |
getmove(levptr(XButtonPressedEvent)); |
588 |
> |
switch (levptr(XButtonPressedEvent)->button) { |
589 |
> |
case Button4: /* wheel up */ |
590 |
> |
zoomview(100+WZOOMPCT, levptr(XButtonPressedEvent)->x, |
591 |
> |
vres-1-levptr(XButtonPressedEvent)->y); |
592 |
> |
break; |
593 |
> |
case Button5: /* wheel down */ |
594 |
> |
zoomview(100-WZOOMPCT, levptr(XButtonPressedEvent)->x, |
595 |
> |
vres-1-levptr(XButtonPressedEvent)->y); |
596 |
> |
break; |
597 |
> |
default: |
598 |
> |
getmove(levptr(XButtonPressedEvent)); |
599 |
> |
break; |
600 |
> |
} |
601 |
|
break; |
602 |
|
} |
603 |
|
return(1); |
741 |
|
float fbuf[6]; |
742 |
|
/* check to see if rtrace is running */ |
743 |
|
/* if (rtpd.pid <= 0) */ |
744 |
< |
if (!rtpd.running) |
744 |
> |
if (!(rtpd.flags & PF_RUNNING)) |
745 |
|
return(0); |
746 |
|
/* assign origin */ |
747 |
|
fbuf[0] = org[0]; fbuf[1] = org[1]; fbuf[2] = org[2]; |
749 |
|
if (md <= FTINY) md = FHUGE; |
750 |
|
fbuf[3] = dir[0]*md; fbuf[4] = dir[1]*md; fbuf[5] = dir[2]*md; |
751 |
|
/* trace that ray */ |
752 |
< |
if (process(&rtpd, (char *)fbuf, (char *)fbuf, |
752 |
> |
if (process(&rtpd, fbuf, fbuf, |
753 |
|
4*sizeof(float), 6*sizeof(float)) != 4*sizeof(float)) |
754 |
|
error(INTERNAL, "error getting data back from rtrace process"); |
755 |
|
if (fbuf[3] >= .99*FHUGE) |
840 |
|
case 'V': /* append view to rad file */ |
841 |
|
appendview(NULL, &thisview); |
842 |
|
break; |
843 |
+ |
case 'Q': |
844 |
|
case 'q': /* quit the program */ |
845 |
|
return(0); |
846 |
|
default: |