--- ray/src/util/ranimate.c 2003/02/24 16:44:40 2.30
+++ ray/src/util/ranimate.c 2003/06/30 14:59:13 2.39
@@ -1,5 +1,5 @@
#ifndef lint
-static const char RCSid[] = "$Id: ranimate.c,v 2.30 2003/02/24 16:44:40 greg Exp $";
+static const char RCSid[] = "$Id: ranimate.c,v 2.39 2003/06/30 14:59:13 schorsch Exp $";
#endif
/*
* Radiance animation control program
@@ -13,66 +13,13 @@ static const char RCSid[] = "$Id: ranimate.c,v 2.30 20
* See the ranimate(1) man page for further details.
*/
-/* ====================================================================
- * The Radiance Software License, Version 1.0
- *
- * Copyright (c) 1990 - 2002 The Regents of the University of California,
- * through Lawrence Berkeley National Laboratory. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes Radiance software
- * (http://radsite.lbl.gov/)
- * developed by the Lawrence Berkeley National Laboratory
- * (http://www.lbl.gov/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Radiance," "Lawrence Berkeley National Laboratory"
- * and "The Regents of the University of California" must
- * not be used to endorse or promote products derived from this
- * software without prior written permission. For written
- * permission, please contact radiance@radsite.lbl.gov.
- *
- * 5. Products derived from this software may not be called "Radiance",
- * nor may "Radiance" appear in their name, without prior written
- * permission of Lawrence Berkeley National Laboratory.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL Lawrence Berkeley National Laboratory OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of Lawrence Berkeley National Laboratory. For more
- * information on Lawrence Berkeley National Laboratory, please see
- * .
- */
+#include "copyright.h"
-#include "standard.h"
#include
#include
+
+#include "standard.h"
+#include "paths.h"
#include "view.h"
#include "vars.h"
#include "netproc.h"
@@ -535,7 +482,7 @@ char *rfargs;
pippt = NULL;
}
if (pippt != NULL)
- strcpy(pippt, "> /dev/null"); /* nothing to match */
+ strcpy(pippt, "> " NULL_DEVICE); /* nothing to match */
else {
sprintf(cp, ")[ \t]*=' > %s/radset.var", vval(DIRECTORY));
cp += 11; /* point to file name */
@@ -684,15 +631,9 @@ filterframes() /* catch up with filtering */
if (astat.tnext < astat.fnext) /* other work to do first */
return;
/* filter each view */
- for (i = astat.fnext; i < astat.rnext; i++) {
- if ((vp = getview(i)) == NULL) { /* get view i */
- fprintf(stderr,
- "%s: unexpected error reading view for frame %d\n",
- progname, i);
- quit(1);
- }
- dofilt(i, vp, getexp(i), 0); /* filter frame */
- }
+ for (i = astat.fnext; i < astat.rnext; i++)
+ dofilt(i, 0);
+
bwait(0); /* wait for filter processes */
archive(); /* archive originals */
astat.fnext = i; /* update status */
@@ -853,7 +794,7 @@ int frame;
return(1);
/* add frame to recovered list */
if (nrfrms)
- rfrm = (int *)realloc((char *)rfrm, (nrfrms+1)*sizeof(int));
+ rfrm = (int *)realloc((void *)rfrm, (nrfrms+1)*sizeof(int));
else
rfrm = (int *)malloc(sizeof(int));
if (rfrm == NULL) {
@@ -869,12 +810,7 @@ int
frecover(frame) /* recover filtered frame */
int frame;
{
- VIEW *vp;
- char *ex;
-
- vp = getview(frame);
- ex = getexp(frame);
- if (dofilt(frame, vp, ex, 2) && dofilt(frame, vp, ex, 1))
+ if (dofilt(frame, 2) && dofilt(frame, 1))
return(1);
return(0);
}
@@ -924,21 +860,33 @@ archive() /* archive and remove renderings */
int
-dofilt(frame, vp, ep, rvr) /* filter frame */
+dofilt(frame, rvr) /* filter frame */
int frame;
-VIEW *vp;
-char *ep;
int rvr;
{
extern int frecover();
static int iter = 0;
double blurf;
int nblur = getblur(&blurf);
+ VIEW *vp = getview(frame);
+ char *ep = getexp(frame);
char fnbefore[128], fnafter[128], *fbase;
char combuf[1024], fname0[128], fname1[128];
int usepinterp, usepfilt, nora_rgbe;
int frseq[2];
/* check what is needed */
+ if (vp == NULL) {
+ fprintf(stderr,
+ "%s: unexpected error reading view for frame %d\n",
+ progname, frame);
+ quit(1);
+ }
+ if (ep == NULL) {
+ fprintf(stderr,
+ "%s: unexpected error reading exposure for frame %d\n",
+ progname, frame);
+ quit(1);
+ }
usepinterp = (nblur > 1);
usepfilt = pfiltalways | ep==NULL;
if (ep != NULL && !strcmp(ep, "1"))
@@ -1026,7 +974,7 @@ int rvr;
if (usepfilt)
sprintf(combuf+strlen(combuf), " %s", rresopt);
else
- sprintf(combuf+strlen(combuf), "-a %s -e %s",
+ sprintf(combuf+strlen(combuf), " -a %s -e %s",
fresopt, ep);
sprintf(combuf+strlen(combuf), " %s.unf %s.zbf",
fnbefore, fnbefore);
@@ -1355,6 +1303,7 @@ int maxcopies;
strcpy(com1=buf, com); /* build -PP command */
sprintf(com1+(ppins-com), " -PP %s/%s.persist",
vval(DIRECTORY), phostname(ps));
+ unlink(com1+(ppins-com)+5);
strcat(com1, ppins);
} else
com1 = com;
@@ -1415,7 +1364,7 @@ rmfile(fn) /* remove a file */
char *fn;
{
if (!silent)
-#ifdef MSDOS
+#ifdef _WIN32
printf("\tdel %s\n", fn);
#else
printf("\trm -f %s\n", fn);