117 |
|
/* run rad and get views */ |
118 |
|
runrad(argc-i, argv+i); |
119 |
|
/* check view */ |
120 |
< |
if (viewsel != NULL && (currentview = findvw(viewsel)) < 0) { |
121 |
< |
fprintf(stderr, "%s: no such view\n", viewsel); |
122 |
< |
quit(1); |
123 |
< |
} |
120 |
> |
if (viewsel != NULL) |
121 |
> |
if (viewsel[0] == '-') { |
122 |
> |
char *ve = viewsel; |
123 |
> |
if (!sscanview(&thisview, viewsel) || |
124 |
> |
(ve = setview(&thisview)) != NULL) { |
125 |
> |
fprintf(stderr, "%s: bad view: %s\n", |
126 |
> |
progname, ve); |
127 |
> |
quit(1); |
128 |
> |
} |
129 |
> |
currentview = -1; |
130 |
> |
} else if ((currentview = findvw(viewsel)) < 0) { |
131 |
> |
fprintf(stderr, "%s: no such view: %s\n", |
132 |
> |
progname, viewsel); |
133 |
> |
quit(1); |
134 |
> |
} |
135 |
|
/* open GL */ |
136 |
|
dev_open(radfile = argv[i]); |
137 |
|
/* load octree or scene files */ |
141 |
|
} else |
142 |
|
displist = rgl_filelist(nscenef, scene); |
143 |
|
/* set initial view */ |
144 |
< |
dev_view(vwl[currentview].v); |
144 |
> |
dev_view(currentview < 0 ? &thisview : vwl[currentview].v); |
145 |
|
/* input/render loop */ |
146 |
|
while (dev_input(vwintvl)) |
147 |
|
; |
148 |
|
/* all done */ |
149 |
|
quit(0); |
150 |
|
userr: |
151 |
< |
fprintf(stderr, "Usage: %s [-w][-c #secs][-v view] rfile [VAR=value]..\n", |
151 |
> |
fprintf(stderr, "Usage: %s [-w][-b][-v view] rfile [VAR=value]..\n", |
152 |
|
argv[0]); |
153 |
|
quit(1); |
154 |
|
} |
216 |
|
expval = atof(cp); |
217 |
|
if (*cp == '-' | *cp == '+') |
218 |
|
expval = pow(2., expval); |
219 |
+ |
expval *= 0.5; /* compensate for local shading */ |
220 |
|
} |
221 |
|
/* look for materials */ |
222 |
|
while ((cp = scan4var(buf, sizeof(buf), "materials", fp)) != NULL) { |
397 |
|
DisplayHeight(ourdisplay, ourscreen); |
398 |
|
/* map the window */ |
399 |
|
XMapWindow(ourdisplay, gwind); |
400 |
+ |
do |
401 |
+ |
dev_input(0); /* get resize event */ |
402 |
+ |
while (hres == 0 & vres == 0); |
403 |
|
rgl_checkerr("initializing GLX"); |
404 |
|
} |
405 |
|
|
572 |
|
int rootx, rooty, wx, wy; |
573 |
|
unsigned int statemask; |
574 |
|
|
575 |
< |
copylastv("moving"); |
575 |
> |
copylastv( movorb ? (movdir ? "left/right" : "up/down") : |
576 |
> |
(movdir ? "fore/back" : "rotate") ); |
577 |
|
XNoOp(ourdisplay); |
578 |
|
|
579 |
|
while (!XCheckMaskEvent(ourdisplay, |