103 |
|
|
104 |
|
|
105 |
|
#define LEAFSIZ (3*sizeof(float)+sizeof(int32)+\ |
106 |
< |
sizeof(TMbright)+6*sizeof(BYTE)) |
106 |
> |
sizeof(TMbright)+6*sizeof(uby8)) |
107 |
|
|
108 |
|
extern int |
109 |
|
qtAllocLeaves( /* allocate space for n leaves */ |
132 |
|
qtL.wp = (float (*)[3])qtL.base; |
133 |
|
qtL.wd = (int32 *)(qtL.wp + n); |
134 |
|
qtL.brt = (TMbright *)(qtL.wd + n); |
135 |
< |
qtL.chr = (BYTE (*)[3])(qtL.brt + n); |
136 |
< |
qtL.rgb = (BYTE (*)[3])(qtL.chr + n); |
135 |
> |
qtL.chr = (uby8 (*)[3])(qtL.brt + n); |
136 |
> |
qtL.rgb = (uby8 (*)[3])(qtL.chr + n); |
137 |
|
qtL.nl = n; |
138 |
|
qtL.tml = qtL.bl = qtL.tl = 0; |
139 |
|
falleaves = -1; |
268 |
|
return(0); |
269 |
|
/* compute leaf location in view */ |
270 |
|
VCOPY(wp, qtL.wp[li]); |
271 |
< |
viewloc(ip, &odev.v, wp); |
272 |
< |
if (ip[2] <= 0. || ip[0] < 0. || ip[0] >= 1. |
273 |
< |
|| ip[1] < 0. || ip[1] >= 1.) |
271 |
> |
if (viewloc(ip, &odev.v, wp) != 1) |
272 |
|
goto dropit; /* behind or outside view */ |
273 |
|
#ifdef DEBUG |
274 |
|
if (odev.v.type == VT_PAR | odev.v.vfore > FTINY) |
377 |
|
tmCvColrs(tmGlobal, &qtL.brt[li], qtL.chr[li], (COLR *)c, 1); |
378 |
|
if (putleaf(li, 1)) { |
379 |
|
if (mapit) |
380 |
< |
tmMapPixels(tmGlobal, (BYTE *)(qtL.rgb+li), qtL.brt+li, |
381 |
< |
(BYTE *)(qtL.chr+li), 1); |
380 |
> |
tmMapPixels(tmGlobal, (uby8 *)(qtL.rgb+li), qtL.brt+li, |
381 |
> |
(uby8 *)(qtL.chr+li), 1); |
382 |
|
if (--rayqleft == 0) |
383 |
|
dev_flush(); /* flush output */ |
384 |
|
} |
432 |
|
if (tmComputeMapping(tmGlobal, 0., 0., 0.) != TM_E_OK) |
433 |
|
return(0); |
434 |
|
} |
435 |
< |
if (tmMapPixels(tmGlobal, (BYTE *)(qtL.rgb+aorg), qtL.brt+aorg, |
436 |
< |
(BYTE *)(qtL.chr+aorg), alen) != TM_E_OK) |
435 |
> |
if (tmMapPixels(tmGlobal, (uby8 *)(qtL.rgb+aorg), qtL.brt+aorg, |
436 |
> |
(uby8 *)(qtL.chr+aorg), alen) != TM_E_OK) |
437 |
|
return(0); |
438 |
|
if (blen > 0) |
439 |
< |
tmMapPixels(tmGlobal, (BYTE *)(qtL.rgb+borg), qtL.brt+borg, |
440 |
< |
(BYTE *)(qtL.chr+borg), blen); |
439 |
> |
tmMapPixels(tmGlobal, (uby8 *)(qtL.rgb+borg), qtL.brt+borg, |
440 |
> |
(uby8 *)(qtL.chr+borg), blen); |
441 |
|
qtL.tml = qtL.tl; |
442 |
|
return(1); |
443 |
|
} |