| 8 |
|
* Convert Radiance scene description to MGF |
| 9 |
|
*/ |
| 10 |
|
|
| 11 |
< |
#include <stdio.h> |
| 12 |
< |
#include <math.h> |
| 11 |
> |
#include "standard.h" |
| 12 |
|
#include <ctype.h> |
| 13 |
|
#include <string.h> |
| 15 |
– |
#include "fvect.h" |
| 14 |
|
#include "object.h" |
| 15 |
|
#include "color.h" |
| 16 |
|
#include "lookup.h" |
| 17 |
|
|
| 20 |
– |
#define PI 3.14159265358979323846 |
| 21 |
– |
|
| 18 |
|
#define C_1SIDEDTHICK 0.005 |
| 19 |
|
|
| 20 |
|
int o_face(), o_cone(), o_sphere(), o_ring(), o_cylinder(); |
| 22 |
|
int o_plastic(), o_metal(), o_glass(), o_dielectric(), |
| 23 |
|
o_mirror(), o_trans(), o_light(); |
| 24 |
|
|
| 25 |
< |
extern void free(); |
| 30 |
< |
extern char *malloc(); |
| 25 |
> |
extern int free(); |
| 26 |
|
|
| 27 |
|
LUTAB rmats = LU_SINIT(free,NULL); /* defined material table */ |
| 28 |
|
|
| 426 |
|
char *mod, *typ, *id; |
| 427 |
|
FUNARGS *fa; |
| 428 |
|
{ |
| 429 |
< |
char entbuf[2048]; |
| 429 |
> |
char entbuf[2048], *linestart; |
| 430 |
|
register char *cp; |
| 431 |
|
register int i; |
| 432 |
|
|
| 434 |
|
return(-1); |
| 435 |
|
setmat(mod); |
| 436 |
|
setobj(id); |
| 437 |
< |
cp = entbuf; |
| 437 |
> |
cp = linestart = entbuf; |
| 438 |
|
*cp++ = 'f'; |
| 439 |
|
for (i = 0; i < fa->nfargs; i += 3) { |
| 440 |
|
*cp++ = ' '; |
| 441 |
+ |
if (cp - linestart > 72) { |
| 442 |
+ |
*cp++ = '\\'; *cp++ = '\n'; |
| 443 |
+ |
linestart = cp; |
| 444 |
+ |
*cp++ = ' '; *cp++ = ' '; |
| 445 |
+ |
} |
| 446 |
|
getvertid(cp, fa->farg + i); |
| 447 |
|
while (*cp) |
| 448 |
|
cp++; |