--- ray/src/gen/xform.c 1992/09/21 12:15:44 2.6 +++ ray/src/gen/xform.c 1995/10/27 08:56:18 2.9 @@ -1,4 +1,4 @@ -/* Copyright (c) 1992 Regents of the University of California */ +/* Copyright (c) 1995 Regents of the University of California */ #ifndef lint static char SCCSid[] = "$SunId$ LBL"; @@ -173,6 +173,7 @@ xform(name, fin) /* transform stream by tot.xfm */ char *name; register FILE *fin; { + int nobjs = 0; register int c; while ((c = getc(fin)) != EOF) { @@ -188,11 +189,16 @@ register FILE *fin; } else if (c == '!') { /* command */ ungetc(c, fin); xfcomm(name, fin); + nobjs++; } else { /* object */ ungetc(c, fin); xfobject(name, fin); + nobjs++; } } + if (nobjs == 0) + fprintf(stderr, "%s: (%s): warning - empty file\n", + progname, name); } @@ -401,7 +407,6 @@ FILE *fin; m_dielectric(fin) /* transform arguments for dielectric */ FILE *fin; { - double pow(); FUNARGS fa; if (readfargs(&fa, fin) != 1) @@ -422,7 +427,6 @@ FILE *fin; m_interface(fin) /* transform arguments for interface */ FILE *fin; { - double pow(); FUNARGS fa; if (readfargs(&fa, fin) != 1) @@ -638,20 +642,6 @@ FILE *fin; initotypes() /* initialize ofun[] array */ { - extern int o_source(); - extern int o_sphere(); - extern int o_face(); - extern int o_cone(); - extern int o_cylinder(); - extern int o_ring(); - extern int m_glow(); - extern int m_spot(); - extern int m_dielectric(); - extern int m_interface(); - extern int text(); - extern int alias(); - extern int passargs(); - extern int addxform(); register int i; if (ofun[OBJ_SOURCE].funp == o_source) @@ -683,6 +673,7 @@ initotypes() /* initialize ofun[] array */ ofun[MIX_TEXT].funp = text; ofun[ALIAS].funp = alias; /* surface inverses */ + tinvers[OBJ_FACE] = OBJ_FACE; tinvers[OBJ_SOURCE] = OBJ_SOURCE; tinvers[OBJ_CONE] = OBJ_CUP; tinvers[OBJ_CUP] = OBJ_CONE;