--- ray/src/gen/mksource.c 2005/04/12 03:30:43 2.1 +++ ray/src/gen/mksource.c 2005/09/23 19:22:37 2.4 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: mksource.c,v 2.1 2005/04/12 03:30:43 greg Exp $"; +static const char RCSid[] = "$Id: mksource.c,v 2.4 2005/09/23 19:22:37 greg Exp $"; #endif /* * Generate distant sources corresponding to the given environment map @@ -7,6 +7,7 @@ static const char RCSid[] = "$Id: mksource.c,v 2.1 200 #include "ray.h" #include "random.h" +#include "resolu.h" #define NTRUNKBR 4 /* number of branches at trunk */ #define NTRUNKVERT 4 /* number of vertices at trunk */ @@ -28,7 +29,7 @@ typedef struct lostlight { COLOR intens; /* output times solid angle */ } LOSTLIGHT; -char *progname; +extern char *progname; FVECT scene_cent; /* center of octree cube */ RREAL scene_rad; /* radius to get outside cube from center */ @@ -207,6 +208,7 @@ geosample(int nsamps) return(tree); memerr: error(SYSTEM, "out of memory in geosample()"); + return NULL; /* dummy return */ } /* Compute leaf exponent histogram */ @@ -234,10 +236,10 @@ get_threshold(const TRITREE *tree) memset((void *)exphisto, 0, sizeof(exphisto)); for (i = 0; i < NTRUNKBR; i++) get_ehisto(&tree->kid[i], exphisto); - /* use 99th percentile */ + /* use 98th percentile */ for (i = 0; i < 256; i++) samptotal += exphisto[i]; - samptotal /= 100; + samptotal /= 50; for (i = 256; (--i > 0) & (samptotal > 0); ) samptotal -= exphisto[i]; return(ldexp(.75, i-COLXS)); @@ -385,7 +387,6 @@ mksources(TRITREE *samptree, double thresh, double max LOSTLIGHT *lostlightlist = NULL; int emax; TRITREE *startleaf; - COLOR cval; double growstep; FVECT curcent; double currad;