5 static unsigned char Buffer[10000];
32 register int offset3 = 0;
43 offset3 = 3 + t_cnt + t_cnt;
47 for (i = 0; i < Cube->
n_thresh; i++) {
51 for (j = 0; j < Cube->
data[i].
npoly; j++) {
52 Poly_info = &(Cube->
data[i].
poly[j]);
54 Buffer[offset3++] = Poly_info->
v1[0];
55 Buffer[offset3++] = Poly_info->
v1[1];
56 Buffer[offset3++] = Poly_info->
v1[2];
57 Buffer[offset3++] = Poly_info->
v2[0];
58 Buffer[offset3++] = Poly_info->
v2[1];
59 Buffer[offset3++] = Poly_info->
v2[2];
60 Buffer[offset3++] = Poly_info->
v3[0];
61 Buffer[offset3++] = Poly_info->
v3[1];
62 Buffer[offset3++] = Poly_info->
v3[2];
63 Buffer[offset3++] = Poly_info->
n1[0];
64 Buffer[offset3++] = Poly_info->
n1[1];
65 Buffer[offset3++] = Poly_info->
n1[2];
69 Buffer[offset3++] = Poly_info->
n2[0];
70 Buffer[offset3++] = Poly_info->
n2[1];
71 Buffer[offset3++] = Poly_info->
n2[2];
72 Buffer[offset3++] = Poly_info->
n3[0];
73 Buffer[offset3++] = Poly_info->
n3[1];
74 Buffer[offset3++] = Poly_info->
n3[2];
79 Buffer[1] = (size >> 8) & 0xff;
80 Buffer[2] = size & 0xff;
96 static int num_zero = 0;
101 if (num_zero == 126 || cur_x == headfax->
xdim - 2) {
102 junk = 0x80 | num_zero;
110 junk = 0x80 | num_zero;
116 fwrite(Buffer, 1, size, headfax->
dspfoutfp);
122 static long fsize = 0;
123 static char *fptr =
NULL;
136 register int offset1, offset2, offset3;
142 static int first = 1;
145 static int zeros_left = 0;
162 fsize = stop - start + 1;
169 fprintf(stderr,
"Malloc failed\n");
174 for (i = 0; (ret = fread(fptr + i, 1, 10240, fp)); i += ret) ;
184 zeros_left = (0x7f & inchar) - 1;
196 if (0 >= (ret =
my_fread((
char *)Buffer, 1, size, fp))) {
197 fprintf(stderr,
"Error reading display file offset %"PRI_OFF_T"\n",
G_ftell(fp));
202 fprintf(stderr,
"Error (size) reading display file offset %"PRI_OFF_T"\n",
211 offset3 = t_cnt + t_cnt;
213 for (i = 0; i < t_cnt; i++) {
217 for (j = 0; j < Cube->
data[i].
npoly; j++) {
218 Poly_info = &(Cube->
data[i].
poly[j]);
219 Poly_info->
v1[0] = Buffer[offset3++];
220 Poly_info->
v1[1] = Buffer[offset3++];
221 Poly_info->
v1[2] = Buffer[offset3++];
222 Poly_info->
v2[0] = Buffer[offset3++];
223 Poly_info->
v2[1] = Buffer[offset3++];
224 Poly_info->
v2[2] = Buffer[offset3++];
225 Poly_info->
v3[0] = Buffer[offset3++];
226 Poly_info->
v3[1] = Buffer[offset3++];
227 Poly_info->
v3[2] = Buffer[offset3++];
228 Poly_info->
n1[0] = Buffer[offset3++];
229 Poly_info->
n1[1] = Buffer[offset3++];
230 Poly_info->
n1[2] = Buffer[offset3++];
237 Poly_info->
n2[0] = Buffer[offset3++];
238 Poly_info->
n2[1] = Buffer[offset3++];
239 Poly_info->
n2[2] = Buffer[offset3++];
240 Poly_info->
n3[0] = Buffer[offset3++];
241 Poly_info->
n3[1] = Buffer[offset3++];
242 Poly_info->
n3[2] = Buffer[offset3++];
251 int my_fread(
char *buf,
int size,
int cnt, FILE * fp)
253 static char in_buf[10240];
254 static char *start, *end;
258 if (ret = fread(in_buf, 1, 10240, fp)) ;
267 int my_fread(
char *buf,
int size,
int cnt, FILE * fp)
270 return fread(buf, size, cnt, fp);
275 if (cptr + amt >= fsize)
276 amt = fsize - cptr - 1;
int write_cube(Cube_data *Cube, int cur_x, file_info *headfax)
int struct_copy(char *To, char *From, int size)
int write_cube_buffer(unsigned char *Buffer, int size, int cur_x, file_info *headfax)
int my_fread(char *buf, int size, int cnt, FILE *fp)
void G_fseek(FILE *, off_t, int)
Change the file position of the stream.
cube_info data[MAXTHRESH]
int new_dspf(file_info *hfax)
int read_cube(Cube_data *Cube, file_info *headfax)
off_t G_ftell(FILE *)
Get the current file position of the stream.
int reset_reads(file_info *headfax)