| 5 |
|
* Radiance holodeck picture generator |
| 6 |
|
*/ |
| 7 |
|
|
| 8 |
+ |
#include <string.h> |
| 9 |
+ |
|
| 10 |
|
#include "rholo.h" |
| 11 |
|
#include "view.h" |
| 12 |
|
|
| 169 |
|
register PACKHEAD *bl; |
| 170 |
|
int nb; |
| 171 |
|
{ |
| 172 |
< |
extern int pixBeam(); |
| 172 |
> |
extern void pixBeam(); |
| 173 |
|
register HDBEAMI *bil; |
| 174 |
|
register int i; |
| 175 |
|
|
| 221 |
|
/* write resolution (standard order) */ |
| 222 |
|
fprtresolu(hres, vres, stdout); |
| 223 |
|
/* prepare image buffers */ |
| 224 |
< |
bzero((char *)mypixel, hres*vres*sizeof(COLOR)); |
| 225 |
< |
bzero((char *)myweight, hres*vres*sizeof(float)); |
| 226 |
< |
bzero((char *)mydepth, hres*vres*sizeof(float)); |
| 224 |
> |
memset((char *)mypixel, '\0', hres*vres*sizeof(COLOR)); |
| 225 |
> |
memset((char *)myweight, '\0', hres*vres*sizeof(float)); |
| 226 |
> |
memset((char *)mydepth, '\0', hres*vres*sizeof(float)); |
| 227 |
|
} |
| 228 |
|
|
| 229 |
|
|
| 231 |
|
endpicture() /* finish and write out pixels */ |
| 232 |
|
{ |
| 233 |
|
int lastr = -1, nunrend = 0; |
| 234 |
< |
int4 lastp, lastrp; |
| 235 |
< |
register int4 p; |
| 234 |
> |
int32 lastp, lastrp; |
| 235 |
> |
register int32 p; |
| 236 |
|
register double d; |
| 237 |
|
/* compute final pixel values */ |
| 238 |
|
for (p = hres*vres; p--; ) { |
| 239 |
|
if (myweight[p] <= FTINY) { |
| 240 |
< |
if (lastr >= 0) |
| 240 |
> |
if (lastr >= 0) { |
| 241 |
|
if (p/hres == lastp/hres) |
| 242 |
|
copycolor(mypixel[p], mypixel[lastp]); |
| 243 |
|
else |
| 244 |
|
copycolor(mypixel[p], mypixel[lastrp]); |
| 245 |
+ |
} |
| 246 |
|
nunrend++; |
| 247 |
|
continue; |
| 248 |
|
} |
| 263 |
|
|
| 264 |
|
initialize() /* initialize holodeck and buffers */ |
| 265 |
|
{ |
| 263 |
– |
extern long ftell(); |
| 266 |
|
int fd; |
| 267 |
|
FILE *fp; |
| 268 |
|
int n; |
| 269 |
< |
int4 nextloc; |
| 269 |
> |
int32 nextloc; |
| 270 |
|
/* open holodeck file */ |
| 271 |
|
if ((fp = fopen(hdkfile, "r")) == NULL) { |
| 272 |
|
sprintf(errmsg, "cannot open \"%s\" for reading", hdkfile); |