--- ray/src/rt/rtmain.c 2024/08/21 20:42:20 2.55 +++ ray/src/rt/rtmain.c 2025/06/20 03:43:17 2.60 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: rtmain.c,v 2.55 2024/08/21 20:42:20 greg Exp $"; +static const char RCSid[] = "$Id: rtmain.c,v 2.60 2025/06/20 03:43:17 greg Exp $"; #endif /* * rtmain.c - main for rtrace per-ray calculation program @@ -13,10 +13,10 @@ static const char RCSid[] = "$Id: rtmain.c,v 2.55 2024 #include "rtprocess.h" /* getpid() */ #include "resolu.h" #include "ray.h" +#include "func.h" #include "source.h" #include "ambient.h" #include "random.h" -#include "paths.h" #include "pmapray.h" extern char *progname; /* global argv[0] */ @@ -114,6 +114,8 @@ main(int argc, char *argv[]) strcat(RFeatureList, RTRACE_FEATURES); if (argc > 1 && !strcmp(argv[1], "-features")) return feature_status(argc-2, argv+2); + /* initialize calcomp routines */ + initfunc(); /* add trace notify function */ for (i = 0; addobjnotify[i] != NULL; i++) ; @@ -348,7 +350,9 @@ main(int argc, char *argv[]) rval = setspectrsamp(CNDX, WLPART); if (rval < 0) error(USER, "unsupported spectral sampling"); - if (out_prims != NULL) { + if (sens_curve != NULL) + out_prims = NULL; + else if (out_prims != NULL) { if (!rval) error(WARNING, "spectral range incompatible with color output"); } else if (NCSAMP == 3) @@ -358,13 +362,7 @@ main(int argc, char *argv[]) /* initialize object types */ initotypes(); /* initialize urand */ - if (rand_samp) { - srandom((long)time(0)); - initurand(0); - } else { - srandom(0L); - initurand(2048); - } + reset_random(); /* set up signal handling */ sigdie(SIGINT, "Interrupt"); #ifdef SIGHUP @@ -508,6 +506,8 @@ wputs( /* warning output function */ ) { int lasterrno = errno; + if (erract[WARNING].pf == NULL) + return; /* called by calcomp or someone */ eputs(s); errno = lasterrno; }