1 |
– |
/* Copyright (c) 1995 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 Radiance scene description to MGF |
6 |
|
*/ |
19 |
|
int o_plastic(), o_metal(), o_glass(), o_dielectric(), |
20 |
|
o_mirror(), o_trans(), o_light(); |
21 |
|
|
25 |
– |
extern int free(); |
26 |
– |
|
22 |
|
LUTAB rmats = LU_SINIT(free,NULL); /* defined material table */ |
23 |
|
|
24 |
|
LUTAB rdispatch = LU_SINIT(NULL,NULL); /* function dispatch table */ |
421 |
|
char *mod, *typ, *id; |
422 |
|
FUNARGS *fa; |
423 |
|
{ |
424 |
< |
char entbuf[2048]; |
424 |
> |
char entbuf[2048], *linestart; |
425 |
|
register char *cp; |
426 |
|
register int i; |
427 |
|
|
429 |
|
return(-1); |
430 |
|
setmat(mod); |
431 |
|
setobj(id); |
432 |
< |
cp = entbuf; |
432 |
> |
cp = linestart = entbuf; |
433 |
|
*cp++ = 'f'; |
434 |
|
for (i = 0; i < fa->nfargs; i += 3) { |
435 |
|
*cp++ = ' '; |
436 |
+ |
if (cp - linestart > 72) { |
437 |
+ |
*cp++ = '\\'; *cp++ = '\n'; |
438 |
+ |
linestart = cp; |
439 |
+ |
*cp++ = ' '; *cp++ = ' '; |
440 |
+ |
} |
441 |
|
getvertid(cp, fa->farg + i); |
442 |
|
while (*cp) |
443 |
|
cp++; |