--- ray/src/cv/rad2mgf.c 1995/04/13 15:33:48 2.11 +++ ray/src/cv/rad2mgf.c 1998/09/04 09:09:58 2.14 @@ -1,4 +1,4 @@ -/* Copyright (c) 1994 Regents of the University of California */ +/* Copyright (c) 1995 Regents of the University of California */ #ifndef lint static char SCCSid[] = "$SunId$ LBL"; @@ -8,16 +8,13 @@ static char SCCSid[] = "$SunId$ LBL"; * Convert Radiance scene description to MGF */ -#include -#include +#include "standard.h" +#include #include -#include "fvect.h" #include "object.h" #include "color.h" #include "lookup.h" -#define PI 3.14159265358979323846 - #define C_1SIDEDTHICK 0.005 int o_face(), o_cone(), o_sphere(), o_ring(), o_cylinder(); @@ -25,8 +22,7 @@ int o_instance(), o_illum(); int o_plastic(), o_metal(), o_glass(), o_dielectric(), o_mirror(), o_trans(), o_light(); -extern void free(); -extern char *malloc(); +extern int free(); LUTAB rmats = LU_SINIT(free,NULL); /* defined material table */ @@ -263,8 +259,16 @@ char *id; if (end == NULL) end = cp; /* copy to current object */ - for (cp = id, cp2 = curobj; cp < end; *cp2++ = *cp++) + cp2 = curobj; + if (!isalpha(*id)) { /* start with letter */ + diff = *cp2 != 'O'; + *cp2++ = 'O'; + } + for (cp = id; cp < end; *cp2++ = *cp++) { + if (*cp < '!' | *cp > '~') /* limit to visible chars */ + *cp = '?'; diff += *cp != *cp2; + } if (!diff && !*cp2) return; *cp2 = '\0'; @@ -422,7 +426,7 @@ o_face(mod, typ, id, fa) /* print out a polygon */ char *mod, *typ, *id; FUNARGS *fa; { - char entbuf[512]; + char entbuf[2048]; register char *cp; register int i;