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

Comparing ray/src/util/rfluxmtx.c (file contents):
Revision 2.7 by greg, Wed Jul 23 22:39:40 2014 UTC vs.
Revision 2.8 by greg, Fri Jul 25 15:46:10 2014 UTC

# Line 1000 | Line 1000 | add_surface(int st, const char *oname, FILE *fp)
1000          case ST_SOURCE:
1001                  if (snew->nfargs != 4)
1002                          goto badcount;
1003 <                VCOPY(snew->snrm, snew->farg);
1003 >                for (n = 3; n--; )      /* need to reverse "normal" */
1004 >                        snew->snrm[n] = -snew->farg[n];
1005                  if (normalize(snew->snrm) == 0)
1006                          goto badnorm;
1007                  snew->area = sin((PI/180./2.)*snew->farg[3]);
# Line 1063 | Line 1064 | add_recv_object(FILE *fp)
1064                  return(1);
1065          }
1066                                          /* else skip arguments */
1067 <        if (!fscanf(fp, "%d", &n)) return;
1067 >        if (!fscanf(fp, "%d", &n)) return(0);
1068          while (n-- > 0) fscanf(fp, "%*s");
1069          if (!fscanf(fp, "%d", &n)) return;
1070          while (n-- > 0) fscanf(fp, "%*d");
# Line 1099 | Line 1100 | add_send_object(FILE *fp)
1100                  return(0);
1101          }
1102                                          /* else skip arguments */
1103 <        if (!fscanf(fp, "%d", &n)) return;
1103 >        if (!fscanf(fp, "%d", &n)) return(0);
1104          while (n-- > 0) fscanf(fp, "%*s");
1105          if (!fscanf(fp, "%d", &n)) return;
1106          while (n-- > 0) fscanf(fp, "%*d");
# Line 1171 | Line 1172 | main(int argc, char *argv[])
1172   {
1173          char    fmtopt[6] = "-faa";     /* default output is ASCII */
1174          char    *xrs=NULL, *yrs=NULL, *ldopt=NULL;
1175 +        int     wantIrradiance = 0;
1176          char    *sendfn;
1177          char    sampcntbuf[32], nsbinbuf[32];
1178          FILE    *rcfp;
# Line 1218 | Line 1220 | main(int argc, char *argv[])
1220                                  goto userr;
1221                          na = 0;         /* we re-add this later */
1222                          continue;
1223 +                case 'I':               /* only for pass-through mode */
1224 +                        wantIrradiance = 1;
1225 +                        na = 0;
1226 +                        continue;
1227                  case 'V':               /* options without arguments */
1228                  case 'w':
1229                  case 'u':
# Line 1269 | Line 1275 | done_opts:
1275          if (sendfn[0] == '-') {         /* user wants pass-through mode? */
1276                  if (sendfn[1]) goto userr;
1277                  sendfn = NULL;
1278 +                if (wantIrradiance) {
1279 +                        CHECKARGC(1);
1280 +                        rcarg[nrcargs++] = "-I";
1281 +                }
1282                  if (xrs) {
1283                          CHECKARGC(2);
1284                          rcarg[nrcargs++] = "-x";
# Line 1284 | Line 1294 | done_opts:
1294                          rcarg[nrcargs++] = ldopt;
1295                  }
1296                  if (sampcnt <= 0) sampcnt = 1;
1297 <        } else {                        /* else FVECT determines input format */
1297 >        } else {                        /* else in sampling mode */
1298 >                if (wantIrradiance) {
1299 >                        fputs(progname, stderr);
1300 >                        fputs(": -I supported for pass-through only\n", stderr);
1301 >                        return(1);
1302 >                }
1303                  fmtopt[2] = (sizeof(RREAL)==sizeof(double)) ? 'd' : 'f';
1304                  if (sampcnt <= 0) sampcnt = 10000;
1305          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines