--- ray/src/common/bsdf.h 2018/01/05 20:15:50 2.25 +++ ray/src/common/bsdf.h 2020/05/14 19:20:13 2.27 @@ -1,4 +1,4 @@ -/* RCSid $Id: bsdf.h,v 2.25 2018/01/05 20:15:50 schorsch Exp $ */ +/* RCSid $Id: bsdf.h,v 2.27 2020/05/14 19:20:13 greg Exp $ */ /* * bsdf.h * @@ -84,14 +84,7 @@ extern const SDCDst SDemptyCD; /* empty distribution * typedef struct SDComp_s SDComponent; /* Methods needed to handle BSDF components (nothing is optional) */ -#ifdef __cplusplus -/* in C++, the const puts the type into the local anonymous namespace, - making it a private (and different) type for each file using this header. -*/ typedef struct { -#else -typedef const struct { -#endif /* return non-diffuse BSDF */ int (*getBSDFs)(float coef[SDmaxCh], const FVECT outVec, const FVECT inVec, SDComponent *sdc); @@ -111,7 +104,7 @@ typedef const struct { /* Structure to hold a spectral BSDF component (typedef SDComponent above) */ struct SDComp_s { C_COLOR cspec[SDmaxCh]; /* component spectral bases */ - SDFunc *func; /* methods for this component */ + const SDFunc *func; /* methods for this component */ void *dist; /* loaded distribution data */ SDCDst *cdList; /* cumulative distribution cache */ }; @@ -152,6 +145,7 @@ extern struct SDCache_s { #define SDretainAll 2 /* also keep cumulative cache data */ extern int SDretainSet; /* =SDretainNone by default */ +extern unsigned long SDmaxCache; /* =0 (unlimited) by default */ /***************************************************************** * The following routines are less commonly used by applications.