| 9 |
|
#include "standard.h" |
| 10 |
|
#include "view.h" |
| 11 |
|
|
| 12 |
< |
extern int putf(), putd(), puta(); |
| 12 |
> |
typedef void putfunc(FVECT ro, FVECT rd); |
| 13 |
> |
static putfunc puta; |
| 14 |
> |
static putfunc putf; |
| 15 |
> |
static putfunc putd; |
| 16 |
> |
static void pix2rays(FILE *fp); |
| 17 |
> |
static void putrays(void); |
| 18 |
|
|
| 19 |
< |
int (*putr)() = puta; |
| 19 |
> |
static putfunc *putr = puta; |
| 20 |
|
|
| 21 |
|
VIEW vw = STDVIEW; |
| 22 |
|
|
| 31 |
|
char *progname; |
| 32 |
|
|
| 33 |
|
|
| 34 |
< |
main(argc, argv) |
| 35 |
< |
int argc; |
| 36 |
< |
char *argv[]; |
| 34 |
> |
int |
| 35 |
> |
main( |
| 36 |
> |
int argc, |
| 37 |
> |
char *argv[] |
| 38 |
> |
) |
| 39 |
|
{ |
| 40 |
|
char *err; |
| 41 |
|
int rval, getdim = 0; |
| 147 |
|
} |
| 148 |
|
|
| 149 |
|
|
| 150 |
< |
pix2rays(FILE *fp) |
| 150 |
> |
static void |
| 151 |
> |
pix2rays( |
| 152 |
> |
FILE *fp |
| 153 |
> |
) |
| 154 |
|
{ |
| 155 |
|
static FVECT rorg, rdir; |
| 156 |
|
float zval; |
| 160 |
|
register int i; |
| 161 |
|
|
| 162 |
|
while (fscanf(fp, "%lf %lf", &px, &py) == 2) { |
| 163 |
+ |
px += .5; py += .5; |
| 164 |
|
if (px < 0 || px >= rs.xr || |
| 165 |
|
py < 0 || py >= rs.yr) { |
| 166 |
|
fprintf(stderr, |
| 201 |
|
} |
| 202 |
|
|
| 203 |
|
|
| 204 |
< |
putrays() |
| 204 |
> |
static void |
| 205 |
> |
putrays(void) |
| 206 |
|
{ |
| 207 |
|
static RREAL loc[2]; |
| 208 |
|
static FVECT rorg, rdir; |
| 209 |
< |
float *zbuf; |
| 209 |
> |
float *zbuf = NULL; |
| 210 |
|
int sc; |
| 211 |
|
double d; |
| 212 |
|
register int si, i; |
| 249 |
|
} |
| 250 |
|
|
| 251 |
|
|
| 252 |
< |
puta(ro, rd) /* put out ray in ASCII format */ |
| 253 |
< |
FVECT ro, rd; |
| 252 |
> |
static void |
| 253 |
> |
puta( /* put out ray in ASCII format */ |
| 254 |
> |
FVECT ro, |
| 255 |
> |
FVECT rd |
| 256 |
> |
) |
| 257 |
|
{ |
| 258 |
|
printf("%.5e %.5e %.5e %.5e %.5e %.5e\n", |
| 259 |
|
ro[0], ro[1], ro[2], |
| 261 |
|
} |
| 262 |
|
|
| 263 |
|
|
| 264 |
< |
putf(ro, rd) /* put out ray in float format */ |
| 265 |
< |
FVECT ro, rd; |
| 264 |
> |
static void |
| 265 |
> |
putf( /* put out ray in float format */ |
| 266 |
> |
FVECT ro, |
| 267 |
> |
FVECT rd |
| 268 |
> |
) |
| 269 |
|
{ |
| 270 |
|
float v[6]; |
| 271 |
|
|
| 275 |
|
} |
| 276 |
|
|
| 277 |
|
|
| 278 |
< |
putd(ro, rd) /* put out ray in double format */ |
| 279 |
< |
FVECT ro, rd; |
| 278 |
> |
static void |
| 279 |
> |
putd( /* put out ray in double format */ |
| 280 |
> |
FVECT ro, |
| 281 |
> |
FVECT rd |
| 282 |
> |
) |
| 283 |
|
{ |
| 284 |
|
double v[6]; |
| 285 |
|
|