--- ray/src/hd/holo.h 2004/09/09 01:06:19 3.25 +++ ray/src/hd/holo.h 2022/11/16 00:12:49 3.30 @@ -1,4 +1,4 @@ -/* RCSid: $Id: holo.h,v 3.25 2004/09/09 01:06:19 greg Exp $ */ +/* RCSid: $Id: holo.h,v 3.30 2022/11/16 00:12:49 greg Exp $ */ /* * Header file for holodeck programs * @@ -26,7 +26,7 @@ extern "C" { #define DCLIN (unsigned)(1L<<11) /* linear depth limit */ typedef struct { - BYTE r[2][2]; /* ray direction index */ + uby8 r[2][2]; /* ray direction index */ COLR v; /* color value */ uint16 d; /* depth code (from entry wall) */ } RAYVAL; /* ray value */ @@ -55,7 +55,7 @@ typedef struct { typedef struct { uint32 nrm; /* number of beam rays bundled in memory */ - unsigned long tick; /* clock tick for LRU replacement */ + uint32 tick; /* clock tick for LRU replacement */ } BEAM; /* followed by nrm RAYVAL's */ #define hdbray(bp) ((RAYVAL *)((bp)+1)) @@ -79,7 +79,7 @@ typedef struct holo { double tlin; /* linear range for depth encoding */ FVECT wg[3]; /* wall grid vectors (derived) */ int wi[6]; /* wall super-indices (derived) */ - char *priv; /* pointer to private client data */ + void *priv; /* pointer to private client data */ BEAM **bl; /* beam pointers (memory cache) */ BEAMI bi[1]; /* beam index (extends struct) */ } HOLO; /* holodeck section */ @@ -98,17 +98,6 @@ typedef struct { #define hdflush(hp) (hdfreebeam(hp,0), hdsync(hp,0)) #define hdclobber(hp) (hdkillbeam(hp,0), hdsync(hp,0)) -/* -extern HOLO *hdinit(), *hdalloc(); -extern BEAM *hdgetbeam(); -extern RAYVAL *hdnewrays(); -extern unsigned hdmemuse(); -extern off_t hdfiluse(), hdfilen(), hdallocfrag(); -extern double hdray(), hdinter(); -extern unsigned hdcode(); -extern int hdfilord(); -*/ - #define FF_NEVER 0 /* never free fragments */ #define FF_WRITE 01 /* free fragment on write */ #define FF_ALLOC 02 /* free fragment on ray alloc */ @@ -132,15 +121,15 @@ extern int hdwg1[6]; /* wall grid 1 index */ #define HOLOFMT "Holodeck" /* file format identifier */ #define HOLOVERS 0 /* file format version number */ -#define HOLOMAGIC (323+sizeof(off_t)+8*HOLOVERS) /* file magic number */ +#define HOLOMAGIC (324+sizeof(BEAMI)+16*HOLOVERS) /* file magic number */ /* * A holodeck file consists of an information header terminated by a * blank line, with "FORMAT=Holodeck" somewhere in it. * The first integer after the information header is the * above magic number, which includes the file format version number. - * The first longword after the magic number is a pointer to the pointer - * just before the SECOND holodeck section, or 0 if there is only one. + * The first longword (off_t) after the magic number is a pointer to the + * pointer just before the SECOND holodeck section, or 0 if there is only one. * This longword is immediately followed by the first holodeck * section header and directory. * Similarly, every holodeck section in the file is preceeded by @@ -155,7 +144,7 @@ extern int hdwg1[6]; /* wall grid 1 index */ /* clumpbeams.c */ extern void clumpbeams(HOLO *hp, int maxcnt, int maxsiz, -int (*cf)(HOLO *hp, int *bqueue, int bqlen)); + int (*cf)(HOLO *hp, int *bqueue, int bqlen)); /* holo.c */ extern void hdcompgrid(HOLO *hp); extern int hdbcoord(GCOORD gc[2], HOLO *hp, int i); @@ -165,9 +154,9 @@ extern int hdlseg(int lseg[2][3], HOLO *hp, GCOORD gc[ extern unsigned int hdcode(HOLO *hp, double d); extern void hdgrid( FVECT gp, HOLO *hp, FVECT wp); extern void hdworld(FVECT wp, HOLO *hp, FVECT gp); -extern double hdray(FVECT ro, FVECT rd, HOLO *hp, GCOORD gc[2], BYTE r[2][2]); -extern double hdinter(GCOORD gc[2], BYTE r[2][2], double *ed, HOLO *hp, - FVECT ro, FVECT rd); +extern double hdray(FVECT ro, FVECT rd, HOLO *hp, GCOORD gc[2], uby8 r[2][2]); +extern double hdinter(GCOORD gc[2], uby8 r[2][2], double *ed, HOLO *hp, + FVECT ro, FVECT rd); /* holofile.c */ extern HOLO * hdinit(int fd, HDGRID *hproto); extern void hddone(HOLO *hp);