--- ray/src/rt/pmapio.c 2016/05/17 17:39:47 2.9 +++ ray/src/rt/pmapio.c 2018/08/02 18:33:49 2.12 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: pmapio.c,v 2.9 2016/05/17 17:39:47 rschregle Exp $"; +static const char RCSid[] = "$Id: pmapio.c,v 2.12 2018/08/02 18:33:49 greg Exp $"; #endif /* @@ -12,7 +12,7 @@ static const char RCSid[] = "$Id: pmapio.c,v 2.9 2016/ supported by the Swiss National Science Foundation (SNSF, #147053) ====================================================================== - $Id: pmapio.c,v 2.9 2016/05/17 17:39:47 rschregle Exp $ + $Id: pmapio.c,v 2.12 2018/08/02 18:33:49 greg Exp $ */ @@ -34,11 +34,11 @@ void savePhotonMap (const PhotonMap *pmap, const char return; } - if (photonRepTime) { + if (verbose) { if (pmap -> numPrimary) - sprintf(errmsg, "Saving %s (%ld photons, %d primaries)...\n", + sprintf(errmsg, "Saving %s (%ld photons, %d primaries)\n", fname, pmap -> numPhotons, pmap -> numPrimary); - else sprintf(errmsg, "Saving %s (%ld photons)...\n", fname, + else sprintf(errmsg, "Saving %s (%ld photons)\n", fname, pmap -> numPhotons); eputs(errmsg); @@ -110,7 +110,9 @@ void savePhotonMap (const PhotonMap *pmap, const char PhotonPrimary *prim = pmap -> primaries + i; putint(prim -> srcIdx, sizeof(prim -> srcIdx), file); +#ifdef PMAP_PRIMARYDIR putint(prim -> dir, sizeof(prim -> dir), file); +#endif #ifdef PMAP_PRIMARYPOS for (j = 0; j < 3; j++) putflt(prim -> pos [j], file); @@ -139,7 +141,7 @@ void savePhotonMap (const PhotonMap *pmap, const char PhotonMapType loadPhotonMap (PhotonMap *pmap, const char *fname) { PhotonMapType ptype = PMAP_TYPE_NONE; - char format [128]; + char format [MAXFMTLEN]; unsigned long i, j; FILE *file; @@ -207,8 +209,9 @@ PhotonMapType loadPhotonMap (PhotonMap *pmap, const ch PhotonPrimary *prim = pmap -> primaries + i; prim -> srcIdx = getint(sizeof(prim -> srcIdx), file); - +#ifdef PMAP_PRIMARYDIR prim -> dir = getint(sizeof(prim -> dir), file); +#endif #ifdef PMAP_PRIMARYPOS for (j = 0; j < 3; j++) prim -> pos [j] = getflt(file);