6 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]);
55 Buffer[offset3++] = Poly_info->
v1[0];
56 Buffer[offset3++] = Poly_info->
v1[1];
57 Buffer[offset3++] = Poly_info->
v1[2];
58 Buffer[offset3++] = Poly_info->
v2[0];
59 Buffer[offset3++] = Poly_info->
v2[1];
60 Buffer[offset3++] = Poly_info->
v2[2];
61 Buffer[offset3++] = Poly_info->
v3[0];
62 Buffer[offset3++] = Poly_info->
v3[1];
63 Buffer[offset3++] = Poly_info->
v3[2];
64 Buffer[offset3++] = Poly_info->
n1[0];
65 Buffer[offset3++] = Poly_info->
n1[1];
66 Buffer[offset3++] = Poly_info->
n1[2];
70 Buffer[offset3++] = Poly_info->
n2[0];
71 Buffer[offset3++] = Poly_info->
n2[1];
72 Buffer[offset3++] = Poly_info->
n2[2];
73 Buffer[offset3++] = Poly_info->
n3[0];
74 Buffer[offset3++] = Poly_info->
n3[1];
75 Buffer[offset3++] = Poly_info->
n3[2];
80 Buffer[1] = (size >> 8) & 0xff;
81 Buffer[2] = size & 0xff;
98 static int num_zero = 0;
103 if (num_zero == 126 ||
cur_x == headfax->
xdim - 2) {
104 junk = 0x80 | num_zero;
112 junk = 0x80 | num_zero;
118 fwrite(Buffer, 1, size, headfax->
dspfoutfp);
124 static long fsize = 0;
125 static char *fptr =
NULL;
138 register int offset1, offset2, offset3;
144 static int first = 1;
147 static int zeros_left = 0;
164 fsize = stop - start + 1;
171 fprintf(stderr,
"Malloc failed\n");
176 for (i = 0; (ret = fread(fptr + i, 1, 10240, fp)); i += ret)
187 zeros_left = (0x7f & inchar) - 1;
199 if (0 >= (ret =
my_fread((
char *)Buffer, 1, size, fp))) {
200 fprintf(stderr,
"Error reading display file offset %" PRId64
"\n",
207 "Error (size) reading display file offset %" PRId64
"\n",
215 offset3 = t_cnt + t_cnt;
217 for (i = 0; i < t_cnt; i++) {
221 for (j = 0; j < Cube->
data[i].
npoly; j++) {
222 Poly_info = &(Cube->
data[i].
poly[j]);
223 Poly_info->
v1[0] = Buffer[offset3++];
224 Poly_info->
v1[1] = Buffer[offset3++];
225 Poly_info->
v1[2] = Buffer[offset3++];
226 Poly_info->
v2[0] = Buffer[offset3++];
227 Poly_info->
v2[1] = Buffer[offset3++];
228 Poly_info->
v2[2] = Buffer[offset3++];
229 Poly_info->
v3[0] = Buffer[offset3++];
230 Poly_info->
v3[1] = Buffer[offset3++];
231 Poly_info->
v3[2] = Buffer[offset3++];
232 Poly_info->
n1[0] = Buffer[offset3++];
233 Poly_info->
n1[1] = Buffer[offset3++];
234 Poly_info->
n1[2] = Buffer[offset3++];
241 Poly_info->
n2[0] = Buffer[offset3++];
242 Poly_info->
n2[1] = Buffer[offset3++];
243 Poly_info->
n2[2] = Buffer[offset3++];
244 Poly_info->
n3[0] = Buffer[offset3++];
245 Poly_info->
n3[1] = Buffer[offset3++];
246 Poly_info->
n3[2] = Buffer[offset3++];
256 int my_fread(
char *buf,
int size,
int cnt, FILE *fp)
259 return fread(buf, size, cnt, fp);
264 if (cptr + amt >= fsize)
265 amt = fsize - cptr - 1;
int reset_reads(file_info *headfax)
int write_cube(Cube_data *Cube, int cur_x, file_info *headfax)
int read_cube(Cube_data *Cube, file_info *headfax)
int new_dspf(file_info *hfax)
int my_fread(char *buf, int size, int cnt, FILE *fp)
int write_cube_buffer(unsigned char *Buffer, int size, int cur_x, file_info *headfax)
void G_fseek(FILE *, off_t, int)
Change the file position of the stream.
off_t G_ftell(FILE *)
Get the current file position of the stream.
int struct_copy(char *To, char *From, int size)