--- ray/src/hd/rhdobj.c 2004/03/30 20:40:04 3.17 +++ ray/src/hd/rhdobj.c 2011/05/20 02:06:39 3.20 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: rhdobj.c,v 3.17 2004/03/30 20:40:04 greg Exp $"; +static const char RCSid[] = "$Id: rhdobj.c,v 3.20 2011/05/20 02:06:39 greg Exp $"; #endif /* * Routines for loading and displaying Radiance objects in rholo with GLX. @@ -34,7 +34,7 @@ void (*dobj_lightsamp)(COLR clr, FVECT direc, FVECT po #define NALT 11 /* # sampling altitude angles */ #endif #ifndef NAZI -#define NAZI ((int)(PI/2.*NALT+.5)) +#define NAZI 17 #endif typedef struct dlights { @@ -320,7 +320,8 @@ ssph_compute(void) /* compute source set from sphere /* avg. reflected brightness */ d = AVGREFL / (double)ncells; scalecolor(csum, d); - if (tmCvColors(&dlightsets->larb, TM_NOCHROM, &csum, 1) != TM_E_OK) + if (tmCvColors(tmGlobal, &dlightsets->larb, + TM_NOCHROM, &csum, 1) != TM_E_OK) error(CONSISTENCY, "tone mapping problem in ssph_compute"); /* greedy light source clustering */ while (dlightsets->nl < MAXLIGHTS) { @@ -953,11 +954,11 @@ dobj_render(void) /* render our objects in OpenGL */ continue; /* set up lighting */ if (op->drawcode == DO_LIGHT && op->ol != NULL) { - BYTE pval; + uby8 pval; double expval, d; /* use computed sources */ - if (tmMapPixels(&pval, &op->ol->larb, TM_NOCHROM, 1) - != TM_E_OK) + if (tmMapPixels(tmGlobal, &pval, &op->ol->larb, + TM_NOCHROM, 1) != TM_E_OK) error(CONSISTENCY, "dobj_render w/o tone map"); expval = pval * (WHTEFFICACY/256.) / tmLuminance(op->ol->larb);