ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/ambient.c
(Generate patch)

Comparing ray/src/rt/ambient.c (file contents):
Revision 2.48 by greg, Tue Feb 25 02:47:22 2003 UTC vs.
Revision 2.52 by schorsch, Mon Jun 30 14:59:12 2003 UTC

# Line 9 | Line 9 | static const char      RCSid[] = "$Id$";
9  
10   #include "copyright.h"
11  
12 < #include  "ray.h"
12 > #include <string.h>
13  
14 + #include  "platform.h"
15 + #include  "ray.h"
16   #include  "otypes.h"
15
17   #include  "ambient.h"
17
18   #include  "random.h"
19  
20   #ifndef  OCTSCALE
# Line 35 | Line 35 | static FILE  *ambfp = NULL;    /* ambient file pointer */
35   static int  nunflshed = 0;      /* number of unflushed ambient values */
36  
37   #ifndef SORT_THRESH
38 < #ifdef BIGMEM
39 < #define SORT_THRESH     ((9L<<20)/sizeof(AMBVAL))
40 < #else
38 > #ifdef SMLMEM
39   #define SORT_THRESH     ((3L<<20)/sizeof(AMBVAL))
40 + #else
41 + #define SORT_THRESH     ((9L<<20)/sizeof(AMBVAL))
42   #endif
43   #endif
44   #ifndef SORT_INTVL
# Line 165 | Line 165 | setambient()                           /* initialize calculation */
165                                          (flen - pos)/AMBVALSIZ);
166                          error(WARNING, errmsg);
167                          fseek(ambfp, pos, 0);
168 + #ifndef _WIN32 /* XXX we need a replacement for that one */
169                          ftruncate(fileno(ambfp), (off_t)pos);
170 + #endif
171                  }
172          } else if ((ambfp = fopen(ambfile, "w+")) != NULL) {
173                  initambfile(1);                 /* else create new file */
# Line 474 | Line 476 | int  creat;
476   #ifdef  F_SETLKW
477          aflock(creat ? F_WRLCK : F_RDLCK);
478   #endif
479 < #ifdef MSDOS
478 <        setmode(fileno(ambfp), O_BINARY);
479 < #endif
479 >        SET_FILE_BINARY(ambfp);
480          if (mybuf == NULL)
481                  mybuf = (char *)bmalloc(BUFSIZ+8);
482          setbuf(ambfp, mybuf);
# Line 564 | Line 564 | newambtree()                           /* allocate 8 ambient tree structs */
564          }
565          atp = atfreelist;
566          atfreelist = atp->kid;
567 <        bzero((char *)atp, 8*sizeof(AMBTREE));
567 >        memset((char *)atp, '\0', 8*sizeof(AMBTREE));
568          return(atp);
569   }
570  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines