| 1 |
< |
/* Copyright (c) 1998 Silicon Graphics, Inc. */ |
| 2 |
< |
|
| 3 |
< |
/* SCCSid "$SunId$ SGI" */ |
| 4 |
< |
|
| 1 |
> |
/* RCSid: $Id$ */ |
| 2 |
|
/* |
| 3 |
|
* Header file for holodeck programs |
| 4 |
|
* |
| 22 |
|
typedef struct { |
| 23 |
|
BYTE r[2][2]; /* ray direction index */ |
| 24 |
|
COLR v; /* color value */ |
| 25 |
< |
unsigned int2 d; /* depth code (from entry wall) */ |
| 25 |
> |
uint16 d; /* depth code (from entry wall) */ |
| 26 |
|
} RAYVAL; /* ray value */ |
| 27 |
|
|
| 28 |
|
/* |
| 43 |
|
} GCOORD; /* grid coordinates (two for beam) */ |
| 44 |
|
|
| 45 |
|
typedef struct { |
| 46 |
< |
unsigned int4 nrd; /* number of beam rays bundled on disk */ |
| 47 |
< |
long fo; /* position in file */ |
| 46 |
> |
uint32 nrd; /* number of beam rays bundled on disk */ |
| 47 |
> |
off_t fo; /* position in file */ |
| 48 |
|
} BEAMI; /* beam index */ |
| 49 |
|
|
| 50 |
|
typedef struct { |
| 51 |
< |
unsigned int4 nrm; /* number of beam rays bundled in memory */ |
| 51 |
> |
uint32 nrm; /* number of beam rays bundled in memory */ |
| 52 |
|
unsigned long tick; /* clock tick for LRU replacement */ |
| 53 |
|
} BEAM; /* followed by nrm RAYVAL's */ |
| 54 |
|
|
| 58 |
|
typedef struct { |
| 59 |
|
FVECT orig; /* prism origin (first) */ |
| 60 |
|
FVECT xv[3]; /* side vectors (second) */ |
| 61 |
< |
int2 grid[3]; /* grid resolution (third) */ |
| 61 |
> |
int16 grid[3]; /* grid resolution (third) */ |
| 62 |
|
} HDGRID; /* holodeck section grid (must match HOLO struct) */ |
| 63 |
|
|
| 64 |
|
typedef struct holo { |
| 65 |
|
FVECT orig; /* prism origin (first) */ |
| 66 |
|
FVECT xv[3]; /* side vectors (second) */ |
| 67 |
< |
int2 grid[3]; /* grid resolution (third) */ |
| 67 |
> |
int16 grid[3]; /* grid resolution (third) */ |
| 68 |
|
int fd; /* file descriptor */ |
| 69 |
|
struct { |
| 70 |
|
int s, n; /* dirty section start, length */ |
| 72 |
|
short dirty; /* number of dirty segments */ |
| 73 |
|
double tlin; /* linear range for depth encoding */ |
| 74 |
|
FVECT wg[3]; /* wall grid vectors (derived) */ |
| 78 |
– |
double wo[6]; /* wall grid offsets (derived) */ |
| 75 |
|
int wi[6]; /* wall super-indices (derived) */ |
| 76 |
|
char *priv; /* pointer to private client data */ |
| 77 |
|
BEAM **bl; /* beam pointers (memory cache) */ |
| 96 |
|
extern BEAM *hdgetbeam(); |
| 97 |
|
extern RAYVAL *hdnewrays(); |
| 98 |
|
extern unsigned hdmemuse(); |
| 99 |
< |
extern long hdfiluse(), hdfilen(), hdallocfrag(); |
| 99 |
> |
extern off_t hdfiluse(), hdfilen(), hdallocfrag(); |
| 100 |
|
extern double hdray(), hdinter(); |
| 101 |
|
extern unsigned hdcode(); |
| 102 |
|
extern int hdfilord(); |
| 103 |
|
|
| 104 |
+ |
#define FF_NEVER 0 /* never free fragments */ |
| 105 |
+ |
#define FF_WRITE 01 /* free fragment on write */ |
| 106 |
+ |
#define FF_ALLOC 02 /* free fragment on ray alloc */ |
| 107 |
+ |
#define FF_READ 04 /* free fragment on read */ |
| 108 |
+ |
#define FF_KILL 010 /* free fragment on beam kill */ |
| 109 |
+ |
|
| 110 |
+ |
extern int hdfragflags; /* tells when to free fragments */ |
| 111 |
|
extern unsigned hdcachesize; /* target cache size (bytes) */ |
| 112 |
|
extern unsigned long hdclock; /* holodeck system clock */ |
| 113 |
|
extern HOLO *hdlist[HDMAX+1]; /* holodeck pointers (NULL term.) */ |
| 124 |
|
|
| 125 |
|
#define HOLOFMT "Holodeck" /* file format identifier */ |
| 126 |
|
#define HOLOVERS 0 /* file format version number */ |
| 127 |
< |
#define HOLOMAGIC (323+sizeof(long)+8*HOLOVERS) /* file magic number */ |
| 127 |
> |
#define HOLOMAGIC (323+sizeof(off_t)+8*HOLOVERS) /* file magic number */ |
| 128 |
|
|
| 129 |
|
/* |
| 130 |
|
* A holodeck file consists of an information header terminated by a |