| 1 |
– |
/* Copyright (c) 1990 Regents of the University of California */ |
| 2 |
– |
|
| 1 |
|
#ifndef lint |
| 2 |
< |
static char SCCSid[] = "$SunId$ LBL"; |
| 2 |
> |
static const char RCSid[] = "$Id$"; |
| 3 |
|
#endif |
| 6 |
– |
|
| 4 |
|
/* |
| 5 |
|
* Convert Architrion file to Radiance |
| 6 |
|
* |
| 9 |
|
|
| 10 |
|
#include <stdio.h> |
| 11 |
|
|
| 12 |
+ |
#include <stdlib.h> |
| 13 |
+ |
|
| 14 |
|
#include "trans.h" |
| 15 |
|
|
| 16 |
|
#define DEFMAPFILE "/usr/local/lib/ray/lib/arch.map" |
| 347 |
|
if (bp->nopenings > 0) { |
| 348 |
|
for (i = 0; i < bp->nopenings; i++) |
| 349 |
|
doneid(&bp->opening[i].frame); |
| 350 |
< |
free((char *)bp->opening); |
| 350 |
> |
free((void *)bp->opening); |
| 351 |
|
} |
| 352 |
|
doneid(&bp->refid); |
| 353 |
|
} |
| 425 |
|
/* check for repeats */ |
| 426 |
|
rept = 0; nrepts = 0; |
| 427 |
|
for (i = 0; i < nm; i++) { |
| 428 |
< |
if (ml[i] == sm) { |
| 428 |
> |
if (ml[i] == sm || !strcmp(ml[i], VOIDID)) { |
| 429 |
|
rept |= 1<<i; |
| 430 |
|
nrepts++; |
| 431 |
+ |
continue; |
| 432 |
|
} |
| 433 |
|
for (j = 0; j < i; j++) |
| 434 |
< |
if (ml[j] == ml[i]) { |
| 434 |
> |
if (!(rept & 1<<j) && ml[j] == ml[i]) { |
| 435 |
|
rept |= 1<<j; |
| 436 |
|
nrepts++; |
| 437 |
|
} |
| 438 |
|
} |
| 439 |
|
/* print antimatter and modlist */ |
| 440 |
< |
fprintf(fp, "\nvoid antimatter %s\n", openmod); |
| 440 |
> |
fprintf(fp, "\n%s antimatter %s\n", VOIDID, openmod); |
| 441 |
|
fprintf(fp, "%d %s", 1+nm-nrepts, sm); |
| 442 |
|
for (i = 0; i < nm; i++) |
| 443 |
|
if (!(rept & 1<<i)) |
| 463 |
|
newp.h[i] = p->h[i]; |
| 464 |
|
} |
| 465 |
|
/* spread reference and opposite */ |
| 466 |
< |
if (p->x[1] > p->x[0]) { |
| 466 |
> |
if (p->x[2] > p->x[0]) { |
| 467 |
|
newp.x[0] -= 2; |
| 468 |
< |
newp.x[1] += 2; |
| 468 |
> |
newp.x[1] -= 2; |
| 469 |
|
newp.x[2] += 2; |
| 470 |
< |
newp.x[3] -= 2; |
| 471 |
< |
} else if (p->x[0] > p->x[1]) { |
| 470 |
> |
newp.x[3] += 2; |
| 471 |
> |
} else if (p->x[0] > p->x[2]) { |
| 472 |
|
newp.x[0] += 2; |
| 473 |
< |
newp.x[1] -= 2; |
| 473 |
> |
newp.x[1] += 2; |
| 474 |
|
newp.x[2] -= 2; |
| 475 |
< |
newp.x[3] += 2; |
| 475 |
> |
newp.x[3] -= 2; |
| 476 |
|
} |
| 477 |
< |
if (p->y[1] > p->y[0]) { |
| 477 |
> |
if (p->y[2] > p->y[0]) { |
| 478 |
|
newp.y[0] -= 2; |
| 479 |
< |
newp.y[1] += 2; |
| 479 |
> |
newp.y[1] -= 2; |
| 480 |
|
newp.y[2] += 2; |
| 481 |
< |
newp.y[3] -= 2; |
| 482 |
< |
} else if (p->y[0] > p->y[1]) { |
| 481 |
> |
newp.y[3] += 2; |
| 482 |
> |
} else if (p->y[0] > p->y[2]) { |
| 483 |
|
newp.y[0] += 2; |
| 484 |
< |
newp.y[1] -= 2; |
| 484 |
> |
newp.y[1] += 2; |
| 485 |
|
newp.y[2] -= 2; |
| 486 |
< |
newp.y[3] += 2; |
| 486 |
> |
newp.y[3] -= 2; |
| 487 |
|
} |
| 488 |
|
/* put out faces */ |
| 489 |
|
sprintf(buf, "op%d", ++nopens); |
| 705 |
|
} |
| 706 |
|
|
| 707 |
|
|
| 708 |
+ |
void |
| 709 |
|
eputs(s) |
| 710 |
|
char *s; |
| 711 |
|
{ |
| 713 |
|
} |
| 714 |
|
|
| 715 |
|
|
| 716 |
+ |
void |
| 717 |
|
quit(code) |
| 718 |
|
int code; |
| 719 |
|
{ |