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

Comparing ray/src/util/rad.c (file contents):
Revision 2.120 by greg, Sun Aug 2 01:32:15 2015 UTC vs.
Revision 2.126 by greg, Tue Feb 26 23:31:11 2019 UTC

# Line 17 | Line 17 | static const char      RCSid[] = "$Id$";
17   #include "paths.h"
18   #include "vars.h"
19  
20 < #ifdef _WIN32
20 > #if defined(_WIN32) || defined(_WIN64)
21    #define DELCMD "del"
22    #define RENAMECMD "rename"
23   #else
# Line 556 | Line 556 | oconv(void)                            /* run oconv and mkillum if necessary *
556                  return;
557                                                  /* make octree0 */
558          if ((oct0date < scenedate) | (oct0date < illumdate)) {
559 <                if (touchonly && oct0date)
560 <                        touch(oct0name);
561 <                else {                          /* build command */
559 >                if (touchonly && (oct0date || oct1date)) {
560 >                        if (oct0date)
561 >                                touch(oct0name);
562 >                } else {                        /* build command */
563                          if (octreedate)
564                                  sprintf(combuf, "%s%s -i %s %s > %s", c_oconv,
565                                          ocopts, vval(OCTREE),
# Line 583 | Line 584 | oconv(void)                            /* run oconv and mkillum if necessary *
584                          oct0date = octreedate;
585                  if (oct0date < illumdate)       /* ditto */
586                          oct0date = illumdate;
587 <                }
587 >        }
588          if (touchonly && oct1date)
589                  touch(oct1name);
590          else {
# Line 752 | Line 753 | mkpmapopts(                            /* get mkpmap options */
753   {
754          /* BEWARE:  This may be called via setdefaults(), so no assumptions */
755  
756 <        *mo = '\0';
756 >        if (nprocs > 1)
757 >                sprintf(mo, " -n %d", nprocs);
758 >        else
759 >                *mo = '\0';
760          if (!vdef(MKPMAP))
761                  return;
762          if (vval(MKPMAP)[0] != '-') {
# Line 806 | Line 810 | renderopts(                    /* set rendering options */
810   {
811          char    pmapf[256], *bw;
812  
813 +        if (vdef(PGMAP)) {
814 +                *op = '\0';
815 +                bw = sskip2(vval(PGMAP), 2);
816 +                atos(pmapf, sizeof(pmapf), vval(PGMAP));
817 +                op = addarg(addarg(op, "-ap"), pmapf);
818 +                if (atoi(bw) > 0) op = addarg(op, bw);
819 +        }
820          switch(vscale(QUALITY)) {
821          case LOW:
822                  lowqopts(op, po);
# Line 817 | Line 828 | renderopts(                    /* set rendering options */
828                  hiqopts(op, po);
829                  break;
830          }
820        if (vdef(PGMAP)) {
821                bw = sskip2(vval(PGMAP), 2);
822                atos(pmapf, sizeof(pmapf), vval(PGMAP));
823                op = addarg(addarg(op, "-ap"), pmapf);
824                if (atoi(bw) > 0) op = addarg(op, bw);
825        }
831          if (vdef(PCMAP)) {
832                  bw = sskip2(vval(PCMAP), 2);
833                  atos(pmapf, sizeof(pmapf), vval(PCMAP));
# Line 1073 | Line 1078 | hiqopts(                               /* high quality rendering options */
1078   }
1079  
1080  
1081 < #ifdef _WIN32
1081 > #if defined(_WIN32) || defined(_WIN64)
1082   static void
1083   setenv(                 /* set an environment variable */
1084          char    *vname,
# Line 1120 | Line 1125 | xferopts(                              /* transfer options if indicated */
1125                          syserr(vval(OPTFILE));
1126                  sprintf(ro, " @%s", vval(OPTFILE));
1127          }
1128 < #ifdef _WIN32
1128 > #if defined(_WIN32) || defined(_WIN64)
1129          else if (n > 50) {
1130                  setenv("ROPT", ro+1);
1131                  strcpy(ro, " $ROPT");
# Line 1298 | Line 1303 | specview(                              /* get proper view spec from vs */
1303          if (cp == viewopts)             /* append any additional options */
1304                  vs++;           /* skip prefixed space if unneeded */
1305          strcpy(cp, vs);
1306 < #ifdef _WIN32
1306 > #if defined(_WIN32) || defined(_WIN64)
1307          if (strlen(viewopts) > 40) {
1308                  setenv("VIEW", viewopts);
1309                  return("$VIEW");
# Line 1344 | Line 1349 | getview(                               /* get view n, or NULL if none */
1349          }
1350   numview:
1351          mv = nvalue(VIEWS, n);          /* use view n */
1352 <        if ((vn != NULL) & (mv != NULL))
1352 >        if ((vn != NULL) & (mv != NULL)) {
1353                  if (*mv != '-') {
1354                          char    *mv2 = mv;
1355                          while (*mv2 && !isspace(*mv2))
# Line 1352 | Line 1357 | numview:
1357                          *vn = '\0';
1358                  } else
1359                          sprintf(vn, "%d", n+1);
1360 <
1360 >        }
1361          return(specview(mv));
1362   }
1363  
# Line 1366 | Line 1371 | myprintview(                   /* print out selected view */
1371          VIEW    vwr;
1372          char    buf[128];
1373          char    *cp;
1374 < #ifdef _WIN32
1374 > #if defined(_WIN32) || defined(_WIN64)
1375   /* XXX Should we allow something like this for all platforms? */
1376   /* XXX Or is it still required at all? */
1377   again:
1378   #endif
1379          if (vopts == NULL)
1380                  return(-1);
1381 < #ifdef _WIN32
1381 > #if defined(_WIN32) || defined(_WIN64)
1382          if (vopts[0] == '$') {
1383                  vopts = getenv(vopts+1);
1384                  goto again;
# Line 1520 | Line 1525 | rpict(                         /* run rpict and pfilt for each view */
1525                                  fprintf(stderr, "%s: cannot create\n", pfile);
1526                                  quit(1);
1527                          }
1528 +                        pfile[-5] = '\0';
1529                          pfile = NULL;
1530                  }
1531          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines