| 117 |
|
* i passed to vproj runs from 0 to nproj-1. |
| 118 |
|
*/ |
| 119 |
|
|
| 120 |
< |
typedef struct { |
| 121 |
< |
int (*vproj)(); /* project virtual sources */ |
| 120 |
> |
typedef struct { /* project virtual sources */ |
| 121 |
> |
int (*vproj)(MAT4,OBJREC*,SRCREC*,int); |
| 122 |
|
int nproj; /* number of possible projections */ |
| 123 |
|
} VSMATERIAL; /* virtual source material functions */ |
| 124 |
|
|
| 125 |
|
typedef struct { |
| 126 |
< |
void (*setsrc)(); /* set light source for object */ |
| 127 |
< |
void (*partit)(); /* partition light source object */ |
| 128 |
< |
double (*getpleq)(); /* plane equation for surface */ |
| 129 |
< |
double (*getdisk)(); /* maximum disk for surface */ |
| 126 |
> |
void (*setsrc)(SRCREC*,OBJREC*); /* set light source for object */ |
| 127 |
> |
void (*partit)(SRCINDEX*,RAY*); /* partition light source object */ |
| 128 |
> |
double (*getpleq)(FVECT,OBJREC*); /* plane equation for surface */ |
| 129 |
> |
double (*getdisk)(FVECT,OBJREC*); /* maximum disk for surface */ |
| 130 |
|
} SOBJECT; /* source object functions */ |
| 131 |
|
|
| 132 |
|
typedef union { |
| 145 |
|
#define getmaxdisk(c,o) (*sfun[(o)->otype].of->getdisk)(c,o) |
| 146 |
|
#define setsource(s,o) (*sfun[(o)->otype].of->setsrc)(s,o) |
| 147 |
|
|
| 148 |
– |
#define SSKIPFLSIZ ((nsources+7) >> 3) |
| 149 |
– |
|
| 150 |
– |
extern uby8 *ssf_select; /* sources we may skip */ |
| 151 |
– |
|
| 152 |
– |
#define sskip_new() ((uby8 *)ecalloc(1,SSKIPFLSIZ)) |
| 153 |
– |
#define sskip_free(fl) (efree(fl), fl=NULL) |
| 154 |
– |
#define sskip_eq(fl1,fl2) !memcmp(fl1, fl2, SSKIPFLSIZ) |
| 155 |
– |
#define sskip_cpy(dfl,sfl) memcpy(dfl,sfl,SSKIPFLSIZ) |
| 156 |
– |
#define sskip_op(fl,op,sn) ((fl)[(sn)>>3] op (1<<((sn)&7))) |
| 157 |
– |
#define sskip_chk(fl,sn) sskip_op(fl,&,sn) |
| 158 |
– |
#define sskip_set(fl,sn) sskip_op(fl,|=,sn) |
| 159 |
– |
#define sskip_clr(fl,sn) sskip_op(fl,&=~,sn) |
| 160 |
– |
|
| 148 |
|
/* defined in source.c */ |
| 149 |
|
extern void marksources(void); |
| 150 |
|
extern void distantsources(void); |
| 163 |
|
extern void freeobscache(SRCREC *s); |
| 164 |
|
extern void markclip(OBJREC *m); |
| 165 |
|
/* defined in srcsamp.c */ |
| 179 |
– |
extern int sskip_rsi(uby8 *flags); |
| 180 |
– |
extern uby8 *sskip_flags(int rsi); |
| 181 |
– |
extern void sskip_addflags(uby8 *dfl, const uby8 *sfl); |
| 166 |
|
extern int srcskip(int sn, RAY *r); |
| 167 |
|
extern double nextssamp(RAY *r, SRCINDEX *si); |
| 168 |
|
extern int skipparts(int ct[3], int sz[3], int pp[2], unsigned char *pt); |