--- ray/src/cv/rad2mgf.c 1998/09/04 09:09:58 2.14 +++ ray/src/cv/rad2mgf.c 2003/02/22 02:07:23 2.16 @@ -1,9 +1,6 @@ -/* Copyright (c) 1995 Regents of the University of California */ - #ifndef lint -static char SCCSid[] = "$SunId$ LBL"; +static const char RCSid[] = "$Id: rad2mgf.c,v 2.16 2003/02/22 02:07:23 greg Exp $"; #endif - /* * Convert Radiance scene description to MGF */ @@ -22,8 +19,6 @@ int o_instance(), o_illum(); int o_plastic(), o_metal(), o_glass(), o_dielectric(), o_mirror(), o_trans(), o_light(); -extern int free(); - LUTAB rmats = LU_SINIT(free,NULL); /* defined material table */ LUTAB rdispatch = LU_SINIT(NULL,NULL); /* function dispatch table */ @@ -426,7 +421,7 @@ o_face(mod, typ, id, fa) /* print out a polygon */ char *mod, *typ, *id; FUNARGS *fa; { - char entbuf[2048]; + char entbuf[2048], *linestart; register char *cp; register int i; @@ -434,10 +429,15 @@ FUNARGS *fa; return(-1); setmat(mod); setobj(id); - cp = entbuf; + cp = linestart = entbuf; *cp++ = 'f'; for (i = 0; i < fa->nfargs; i += 3) { *cp++ = ' '; + if (cp - linestart > 72) { + *cp++ = '\\'; *cp++ = '\n'; + linestart = cp; + *cp++ = ' '; *cp++ = ' '; + } getvertid(cp, fa->farg + i); while (*cp) cp++;