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.125 by greg, Tue Jun 7 16:53:19 2016 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 752 | Line 752 | mkpmapopts(                            /* get mkpmap options */
752   {
753          /* BEWARE:  This may be called via setdefaults(), so no assumptions */
754  
755 <        *mo = '\0';
755 >        if (nprocs > 1)
756 >                sprintf(mo, " -n %d", nprocs);
757 >        else
758 >                *mo = '\0';
759          if (!vdef(MKPMAP))
760                  return;
761          if (vval(MKPMAP)[0] != '-') {
# Line 806 | Line 809 | renderopts(                    /* set rendering options */
809   {
810          char    pmapf[256], *bw;
811  
812 +        if (vdef(PGMAP)) {
813 +                *op = '\0';
814 +                bw = sskip2(vval(PGMAP), 2);
815 +                atos(pmapf, sizeof(pmapf), vval(PGMAP));
816 +                op = addarg(addarg(op, "-ap"), pmapf);
817 +                if (atoi(bw) > 0) op = addarg(op, bw);
818 +        }
819          switch(vscale(QUALITY)) {
820          case LOW:
821                  lowqopts(op, po);
# Line 817 | Line 827 | renderopts(                    /* set rendering options */
827                  hiqopts(op, po);
828                  break;
829          }
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        }
830          if (vdef(PCMAP)) {
831                  bw = sskip2(vval(PCMAP), 2);
832                  atos(pmapf, sizeof(pmapf), vval(PCMAP));
# Line 1073 | Line 1077 | hiqopts(                               /* high quality rendering options */
1077   }
1078  
1079  
1080 < #ifdef _WIN32
1080 > #if defined(_WIN32) || defined(_WIN64)
1081   static void
1082   setenv(                 /* set an environment variable */
1083          char    *vname,
# Line 1120 | Line 1124 | xferopts(                              /* transfer options if indicated */
1124                          syserr(vval(OPTFILE));
1125                  sprintf(ro, " @%s", vval(OPTFILE));
1126          }
1127 < #ifdef _WIN32
1127 > #if defined(_WIN32) || defined(_WIN64)
1128          else if (n > 50) {
1129                  setenv("ROPT", ro+1);
1130                  strcpy(ro, " $ROPT");
# Line 1298 | Line 1302 | specview(                              /* get proper view spec from vs */
1302          if (cp == viewopts)             /* append any additional options */
1303                  vs++;           /* skip prefixed space if unneeded */
1304          strcpy(cp, vs);
1305 < #ifdef _WIN32
1305 > #if defined(_WIN32) || defined(_WIN64)
1306          if (strlen(viewopts) > 40) {
1307                  setenv("VIEW", viewopts);
1308                  return("$VIEW");
# Line 1344 | Line 1348 | getview(                               /* get view n, or NULL if none */
1348          }
1349   numview:
1350          mv = nvalue(VIEWS, n);          /* use view n */
1351 <        if ((vn != NULL) & (mv != NULL))
1351 >        if ((vn != NULL) & (mv != NULL)) {
1352                  if (*mv != '-') {
1353                          char    *mv2 = mv;
1354                          while (*mv2 && !isspace(*mv2))
# Line 1352 | Line 1356 | numview:
1356                          *vn = '\0';
1357                  } else
1358                          sprintf(vn, "%d", n+1);
1359 <
1359 >        }
1360          return(specview(mv));
1361   }
1362  
# Line 1366 | Line 1370 | myprintview(                   /* print out selected view */
1370          VIEW    vwr;
1371          char    buf[128];
1372          char    *cp;
1373 < #ifdef _WIN32
1373 > #if defined(_WIN32) || defined(_WIN64)
1374   /* XXX Should we allow something like this for all platforms? */
1375   /* XXX Or is it still required at all? */
1376   again:
1377   #endif
1378          if (vopts == NULL)
1379                  return(-1);
1380 < #ifdef _WIN32
1380 > #if defined(_WIN32) || defined(_WIN64)
1381          if (vopts[0] == '$') {
1382                  vopts = getenv(vopts+1);
1383                  goto again;
# Line 1520 | Line 1524 | rpict(                         /* run rpict and pfilt for each view */
1524                                  fprintf(stderr, "%s: cannot create\n", pfile);
1525                                  quit(1);
1526                          }
1527 +                        pfile[-5] = '\0';
1528                          pfile = NULL;
1529                  }
1530          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines