6 static unsigned char Buffer[10000];
33 register int offset3 = 0;
44 offset3 = 3 + t_cnt + t_cnt;
48 for (i = 0; i < Cube->
n_thresh; i++) {
52 for (j = 0; j < Cube->
data[i].
npoly; j++) {
53 Poly_info = &(Cube->
data[i].
poly[j]);
56 Buffer[offset3++] = Poly_info->
v1[0];
57 Buffer[offset3++] = Poly_info->
v1[1];
58 Buffer[offset3++] = Poly_info->
v1[2];
59 Buffer[offset3++] = Poly_info->
v2[0];
60 Buffer[offset3++] = Poly_info->
v2[1];
61 Buffer[offset3++] = Poly_info->
v2[2];
62 Buffer[offset3++] = Poly_info->
v3[0];
63 Buffer[offset3++] = Poly_info->
v3[1];
64 Buffer[offset3++] = Poly_info->
v3[2];
65 Buffer[offset3++] = Poly_info->
n1[0];
66 Buffer[offset3++] = Poly_info->
n1[1];
67 Buffer[offset3++] = Poly_info->
n1[2];
71 Buffer[offset3++] = Poly_info->
n2[0];
72 Buffer[offset3++] = Poly_info->
n2[1];
73 Buffer[offset3++] = Poly_info->
n2[2];
74 Buffer[offset3++] = Poly_info->
n3[0];
75 Buffer[offset3++] = Poly_info->
n3[1];
76 Buffer[offset3++] = Poly_info->
n3[2];
81 Buffer[1] = (size >> 8) & 0xff;
82 Buffer[2] = size & 0xff;
99 static int num_zero = 0;
104 if (num_zero == 126 ||
cur_x == headfax->
xdim - 2) {
105 junk = 0x80 | num_zero;
113 junk = 0x80 | num_zero;
119 fwrite(Buffer, 1, size, headfax->
dspfoutfp);
125 static long fsize = 0;
126 static char *fptr =
NULL;
139 register int offset1, offset2, offset3;
145 static int first = 1;
148 static int zeros_left = 0;
165 fsize = stop - start + 1;
172 fprintf(stderr,
"Malloc failed\n");
177 for (i = 0; (ret = fread(fptr + i, 1, 10240, fp)); i += ret)
188 zeros_left = (0x7f & inchar) - 1;
200 if (0 >= (ret =
my_fread((
char *)Buffer, 1, size, fp))) {
201 fprintf(stderr,
"Error reading display file offset %" PRId64
"\n",
208 "Error (size) reading display file offset %" PRId64
"\n",
216 offset3 = t_cnt + t_cnt;
218 for (i = 0; i < t_cnt; i++) {
222 for (j = 0; j < Cube->
data[i].
npoly; j++) {
223 Poly_info = &(Cube->
data[i].
poly[j]);
224 Poly_info->
v1[0] = Buffer[offset3++];
225 Poly_info->
v1[1] = Buffer[offset3++];
226 Poly_info->
v1[2] = Buffer[offset3++];
227 Poly_info->
v2[0] = Buffer[offset3++];
228 Poly_info->
v2[1] = Buffer[offset3++];
229 Poly_info->
v2[2] = Buffer[offset3++];
230 Poly_info->
v3[0] = Buffer[offset3++];
231 Poly_info->
v3[1] = Buffer[offset3++];
232 Poly_info->
v3[2] = Buffer[offset3++];
233 Poly_info->
n1[0] = Buffer[offset3++];
234 Poly_info->
n1[1] = Buffer[offset3++];
235 Poly_info->
n1[2] = Buffer[offset3++];
242 Poly_info->
n2[0] = Buffer[offset3++];
243 Poly_info->
n2[1] = Buffer[offset3++];
244 Poly_info->
n2[2] = Buffer[offset3++];
245 Poly_info->
n3[0] = Buffer[offset3++];
246 Poly_info->
n3[1] = Buffer[offset3++];
247 Poly_info->
n3[2] = Buffer[offset3++];
257 int my_fread(
char *buf,
int size,
int cnt, FILE *fp)
260 return fread(buf, size, cnt, fp);
265 if (cptr + amt >= fsize)
266 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.
cube_info data[MAXTHRESH]
int struct_copy(char *To, char *From, int size)