ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/util/eplus_adduvf.c
(Generate patch)

Comparing ray/src/util/eplus_adduvf.c (file contents):
Revision 2.18 by schorsch, Sun Mar 6 01:13:18 2016 UTC vs.
Revision 2.21 by greg, Mon Jan 20 17:53:40 2020 UTC

# Line 8 | Line 8 | static const char RCSid[] = "$Id$";
8   */
9  
10   #include <stdlib.h>
11 + #include <ctype.h>
12   #include "platform.h"
13   #include "rtio.h"
14   #include "rtmath.h"
# Line 40 | Line 41 | const char     ADD_HEADER[] =
41   #define NAME_FLD        1                       /* name field always first? */
42  
43   #define SS_BASE_FLD     4                       /* subsurface base surface */
44 < #define SS_VERT_FLD     10                      /* subsurface vertex count */
44 > #define SS_VERT_FLD     9                       /* subsurface vertex count */
45  
46   typedef struct {
47          const char      *pname;                 /* object type name */
# Line 204 | Line 205 | get_vlist(IDF_OBJECT *param, const char *zname)
205                  }
206                  res = idf_getfield(param, surf_type[i].vert_fld);
207          }
208 <        if (!res->val[0]) {                     /* hack for missing #vert */
208 >        if (!res->val[0] || tolower(res->val[0]) == 'a') {  /* autocalculate */
209                  IDF_FIELD       *fptr;
210                  if (next_fbp >= fld_buf+sizeof(fld_buf))
211                          next_fbp = fld_buf;
# Line 709 | Line 710 | main(int argc, char *argv[])
710                  fputs("'\n", stderr);
711                  return(1);
712          }
713 +                                                /* check version (warning) */
714 +        if ((pptr = idf_getobject(our_idf, "Version")) != NULL &&
715 +                        pptr->flist != NULL && pptr->flist->val[0] != '9') {
716 +                fputs(progname, stderr);
717 +                fputs(": warning - written for IDF version 9.x, not ",
718 +                                stderr);
719 +                fputs(pptr->flist->val, stderr);
720 +                fputc('\n', stderr);
721 +        }
722                                                  /* remove existing UVFs */
723          if ((pptr = idf_getobject(our_idf, UVF_PNAME)) != NULL) {
724                  IDF_OBJECT      *pnext;
# Line 717 | Line 727 | main(int argc, char *argv[])
727                  do {
728                          pnext = pptr->pnext;
729                          idf_delobject(our_idf, pptr);
730 <                } while (pnext != NULL);
730 >                } while ((pptr = pnext) != NULL);
731          }
732                                                  /* add to header */
733          if (our_idf->hrem == NULL ||

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines