93 |
|
char **argv |
94 |
|
) |
95 |
|
{ |
96 |
< |
double d, expval = 1.0; |
97 |
< |
int i; |
96 |
> |
const char *inpmode = "r"; |
97 |
> |
double d, expval = 1.0; |
98 |
> |
int i; |
99 |
|
|
100 |
|
progname = argv[0]; |
101 |
|
mybright = &rgb_bright; /* default */ |
173 |
|
} |
174 |
|
break; |
175 |
|
case 'd': /* data only (no indices) */ |
176 |
< |
dataonly = argv[i][0] == '-'; |
176 |
> |
dataonly = (argv[i][0] == '-'); |
177 |
|
switch (argv[i][2]) { |
178 |
|
case '\0': |
179 |
|
case 'a': /* ascii */ |
252 |
|
else |
253 |
|
fmtid = "16-bit_grey"; |
254 |
|
} |
255 |
+ |
if (!reverse || (format != 'a') & (format != 'i')) |
256 |
+ |
inpmode = "rb"; |
257 |
|
/* assign reverse ordering */ |
258 |
|
rord[ord[0]] = 0; |
259 |
|
rord[ord[1]] = 1; |
260 |
|
rord[ord[2]] = 2; |
261 |
|
/* get input */ |
262 |
|
if (i == argc) { |
263 |
+ |
long n = skipbytes; |
264 |
+ |
if (inpmode[1] == 'b') |
265 |
+ |
SET_FILE_BINARY(stdin); |
266 |
+ |
while (n-- > 0) |
267 |
+ |
if (getchar() == EOF) { |
268 |
+ |
fprintf(stderr, |
269 |
+ |
"%s: cannot skip %ld bytes on standard input\n", |
270 |
+ |
progname, skipbytes); |
271 |
+ |
quit(1); |
272 |
+ |
} |
273 |
|
fin = stdin; |
274 |
|
} else if (i < argc) { |
275 |
< |
if ((fin = fopen(argv[i], "r")) == NULL) { |
275 |
> |
if ((fin = fopen(argv[i], inpmode)) == NULL) { |
276 |
|
fprintf(stderr, "%s: can't open file \"%s\"\n", |
277 |
|
progname, argv[i]); |
278 |
|
quit(1); |
279 |
|
} |
280 |
|
if (reverse && putprim != BRIGHT && i == argc-3) { |
281 |
< |
if ((fin2 = fopen(argv[i+1], "r")) == NULL) { |
281 |
> |
if ((fin2 = fopen(argv[i+1], inpmode)) == NULL) { |
282 |
|
fprintf(stderr, "%s: can't open file \"%s\"\n", |
283 |
|
progname, argv[i+1]); |
284 |
|
quit(1); |
285 |
|
} |
286 |
< |
if ((fin3 = fopen(argv[i+2], "r")) == NULL) { |
286 |
> |
if ((fin3 = fopen(argv[i+2], inpmode)) == NULL) { |
287 |
|
fprintf(stderr, "%s: can't open file \"%s\"\n", |
288 |
|
progname, argv[i+2]); |
289 |
|
quit(1); |
292 |
|
} else if (i != argc-1) |
293 |
|
fin = NULL; |
294 |
|
if (reverse && putprim != BRIGHT && !interleave) { |
295 |
< |
fin2 = fopen(argv[i], "r"); |
296 |
< |
fin3 = fopen(argv[i], "r"); |
295 |
> |
fin2 = fopen(argv[i], inpmode); |
296 |
> |
fin3 = fopen(argv[i], inpmode); |
297 |
|
} |
298 |
< |
if (skipbytes && (fseek(fin, skipbytes, 0) || (fin2 != NULL && |
299 |
< |
(fseek(fin2, skipbytes, 0) || |
300 |
< |
fseek(fin3, skipbytes, 0))))) { |
298 |
> |
if (skipbytes && (fseek(fin, skipbytes, SEEK_SET) || (fin2 != NULL && |
299 |
> |
fseek(fin2, skipbytes, SEEK_SET) | |
300 |
> |
fseek(fin3, skipbytes, SEEK_SET)))) { |
301 |
|
fprintf(stderr, "%s: cannot skip %ld bytes on input\n", |
302 |
|
progname, skipbytes); |
303 |
|
quit(1); |
309 |
|
} |
310 |
|
|
311 |
|
if (reverse) { |
299 |
– |
#if defined(_WIN32) || defined(_WIN64) |
312 |
|
SET_FILE_BINARY(stdout); |
301 |
– |
if (format != 'a' && format != 'i') |
302 |
– |
SET_FILE_BINARY(fin); |
303 |
– |
#endif |
313 |
|
/* get header */ |
314 |
|
if (header) { |
315 |
< |
if (checkheader(fin, fmtid, stdout) < 0) { |
316 |
< |
fprintf(stderr, "%s: wrong input format\n", |
317 |
< |
progname); |
315 |
> |
getheader(fin, checkhead, stdout); |
316 |
> |
if (wrongformat) { |
317 |
> |
fprintf(stderr, "%s: wrong input format (expected %s)\n", |
318 |
> |
progname, fmtid); |
319 |
|
quit(1); |
320 |
|
} |
321 |
|
if (fin2 != NULL) { |
359 |
|
fputsresolu(&picres, stdout); /* always put resolution */ |
360 |
|
valtopix(); |
361 |
|
} else { |
362 |
< |
#if defined(_WIN32) || defined(_WIN64) |
353 |
< |
SET_FILE_BINARY(fin); |
354 |
< |
if (format != 'a' && format != 'i') |
362 |
> |
if ((format != 'a') & (format != 'i')) |
363 |
|
SET_FILE_BINARY(stdout); |
356 |
– |
#endif |
364 |
|
/* get header */ |
365 |
< |
getheader(fin, checkhead, NULL); |
365 |
> |
getheader(fin, checkhead, header ? stdout : (FILE *)NULL); |
366 |
|
if (wrongformat) { |
367 |
|
fprintf(stderr, |
368 |
|
"%s: input not a Radiance RGBE picture\n", |
375 |
|
} |
376 |
|
if (header) { |
377 |
|
printargs(i, argv, stdout); |
378 |
+ |
printf("NCOMP=%d\n", putprim==ALL ? 3 : 1); |
379 |
+ |
if (!resolution && dataonly && !uniq) |
380 |
+ |
printf("NCOLS=%d\nNROWS=%d\n", scanlen(&picres), |
381 |
+ |
numscans(&picres)); |
382 |
|
if (expval < .99 || expval > 1.01) |
383 |
|
fputexpos(expval, stdout); |
384 |
+ |
if (swapbytes) { |
385 |
+ |
if (nativebigendian()) |
386 |
+ |
puts("BigEndian=0"); |
387 |
+ |
else |
388 |
+ |
puts("BigEndian=1"); |
389 |
+ |
} else if ((format != 'a') & (format != 'i') & |
390 |
+ |
(format != 'b')) |
391 |
+ |
fputendian(stdout); |
392 |
|
fputformat(fmtid, stdout); |
393 |
|
putchar('\n'); |
394 |
|
} |
408 |
|
void *p |
409 |
|
) |
410 |
|
{ |
411 |
< |
char fmt[32]; |
411 |
> |
FILE *fout = (FILE *)p; |
412 |
> |
char fmt[MAXFMTLEN]; |
413 |
|
double d; |
414 |
|
COLOR ctmp; |
415 |
+ |
int rv; |
416 |
|
|
417 |
|
if (formatval(fmt, line)) { |
418 |
< |
if (!strcmp(fmt, CIEFMT)) |
418 |
> |
if (reverse) |
419 |
> |
wrongformat = strcmp(fmt, fmtid); |
420 |
> |
else if (!strcmp(fmt, CIEFMT)) |
421 |
|
mybright = &xyz_bright; |
422 |
|
else if (!strcmp(fmt, COLRFMT)) |
423 |
|
mybright = &rgb_bright; |
424 |
|
else |
425 |
|
wrongformat++; |
426 |
< |
} else if (original && isexpos(line)) { |
426 |
> |
return(1); |
427 |
> |
} |
428 |
> |
if (original && isexpos(line)) { |
429 |
|
d = 1.0/exposval(line); |
430 |
|
scalecolor(exposure, d); |
431 |
|
doexposure++; |
432 |
< |
} else if (original && iscolcor(line)) { |
432 |
> |
return(1); |
433 |
> |
} |
434 |
> |
if (original && iscolcor(line)) { |
435 |
|
colcorval(ctmp, line); |
436 |
|
setcolor(exposure, colval(exposure,RED)/colval(ctmp,RED), |
437 |
|
colval(exposure,GRN)/colval(ctmp,GRN), |
438 |
|
colval(exposure,BLU)/colval(ctmp,BLU)); |
439 |
|
doexposure++; |
440 |
< |
} else if (header) |
441 |
< |
fputs(line, stdout); |
440 |
> |
return(1); |
441 |
> |
} |
442 |
> |
if ((rv = isbigendian(line)) >= 0) { |
443 |
> |
if (reverse) |
444 |
> |
swapbytes = (nativebigendian() != rv); |
445 |
> |
return(1); |
446 |
> |
} |
447 |
> |
if (fout != NULL) |
448 |
> |
fputs(line, fout); |
449 |
|
return(0); |
450 |
|
} |
451 |
|
|
453 |
|
static void |
454 |
|
pixtoval(void) /* convert picture to values */ |
455 |
|
{ |
456 |
< |
register COLOR *scanln; |
456 |
> |
COLOR *scanln; |
457 |
|
int dogamma; |
458 |
|
COLOR lastc; |
459 |
|
RREAL hv[2]; |
460 |
|
int startprim, endprim; |
461 |
|
long startpos; |
462 |
< |
int y; |
429 |
< |
register int x; |
462 |
> |
int x, y; |
463 |
|
|
464 |
|
scanln = (COLOR *)malloc(scanlen(&picres)*sizeof(COLOR)); |
465 |
|
if (scanln == NULL) { |
467 |
|
quit(1); |
468 |
|
} |
469 |
|
dogamma = gamcor < .95 || gamcor > 1.05; |
470 |
< |
if (putprim == ALL && !interleave) { |
470 |
> |
if ((putprim == ALL) & !interleave) { |
471 |
|
startprim = RED; endprim = BLU; |
472 |
|
startpos = ftell(fin); |
473 |
|
} else { |
474 |
|
startprim = putprim; endprim = putprim; |
475 |
|
} |
476 |
|
for (putprim = startprim; putprim <= endprim; putprim++) { |
477 |
< |
if (putprim != startprim && fseek(fin, startpos, 0)) { |
477 |
> |
if (putprim != startprim && fseek(fin, startpos, SEEK_SET)) { |
478 |
|
fprintf(stderr, "%s: seek error on input file\n", |
479 |
|
progname); |
480 |
|
quit(1); |
526 |
|
static void |
527 |
|
valtopix(void) /* convert values to a pixel file */ |
528 |
|
{ |
529 |
< |
int dogamma; |
530 |
< |
register COLOR *scanln; |
531 |
< |
int y; |
532 |
< |
register int x; |
529 |
> |
int dogamma; |
530 |
> |
COLOR *scanln; |
531 |
> |
COLR rgbe; |
532 |
> |
int x, y; |
533 |
|
|
534 |
|
scanln = (COLOR *)malloc(scanlen(&picres)*sizeof(COLOR)); |
535 |
|
if (scanln == NULL) { |
558 |
|
pow(colval(scanln[x],BLU), gamcor)); |
559 |
|
if (doexposure) |
560 |
|
multcolor(scanln[x], exposure); |
561 |
+ |
if (uniq) { /* uncompressed? */ |
562 |
+ |
setcolr(rgbe, scanln[x][RED], |
563 |
+ |
scanln[x][GRN], |
564 |
+ |
scanln[x][BLU]); |
565 |
+ |
if (putbinary(rgbe, sizeof(COLR), 1, stdout) != 1) |
566 |
+ |
goto writerr; |
567 |
+ |
} |
568 |
|
} |
569 |
< |
if (fwritescan(scanln, scanlen(&picres), stdout) < 0) { |
570 |
< |
fprintf(stderr, "%s: write error\n", progname); |
571 |
< |
quit(1); |
532 |
< |
} |
569 |
> |
/* write scan if compressed */ |
570 |
> |
if (!uniq && fwritescan(scanln, scanlen(&picres), stdout) < 0) |
571 |
> |
goto writerr; |
572 |
|
} |
573 |
|
free((void *)scanln); |
574 |
+ |
return; |
575 |
+ |
writerr: |
576 |
+ |
fprintf(stderr, "%s: write error\n", progname); |
577 |
+ |
quit(1); |
578 |
|
} |
579 |
|
|
580 |
|
|
615 |
|
double vd[3]; |
616 |
|
|
617 |
|
if (fin2 == NULL) { |
618 |
< |
if (fread((char *)vd, sizeof(double), 3, fin) != 3) |
618 |
> |
if (getbinary(vd, sizeof(double), 3, fin) != 3) |
619 |
|
return(-1); |
620 |
|
} else { |
621 |
< |
if (fread((char *)vd, sizeof(double), 1, fin) != 1 || |
622 |
< |
fread((char *)(vd+1), sizeof(double), 1, fin2) != 1 || |
623 |
< |
fread((char *)(vd+2), sizeof(double), 1, fin3) != 1) |
621 |
> |
if (getbinary(vd, sizeof(double), 1, fin) != 1 || |
622 |
> |
getbinary(vd+1, sizeof(double), 1, fin2) != 1 || |
623 |
> |
getbinary(vd+2, sizeof(double), 1, fin3) != 1) |
624 |
|
return(-1); |
625 |
|
} |
626 |
|
if (swapbytes) |
638 |
|
float vf[3]; |
639 |
|
|
640 |
|
if (fin2 == NULL) { |
641 |
< |
if (fread((char *)vf, sizeof(float), 3, fin) != 3) |
641 |
> |
if (getbinary(vf, sizeof(float), 3, fin) != 3) |
642 |
|
return(-1); |
643 |
|
} else { |
644 |
< |
if (fread((char *)vf, sizeof(float), 1, fin) != 1 || |
645 |
< |
fread((char *)(vf+1), sizeof(float), 1, fin2) != 1 || |
646 |
< |
fread((char *)(vf+2), sizeof(float), 1, fin3) != 1) |
644 |
> |
if (getbinary(vf, sizeof(float), 1, fin) != 1 || |
645 |
> |
getbinary(vf+1, sizeof(float), 1, fin2) != 1 || |
646 |
> |
getbinary(vf+2, sizeof(float), 1, fin3) != 1) |
647 |
|
return(-1); |
648 |
|
} |
649 |
|
if (swapbytes) |
683 |
|
uby8 vb[3]; |
684 |
|
|
685 |
|
if (fin2 == NULL) { |
686 |
< |
if (fread((char *)vb, sizeof(uby8), 3, fin) != 3) |
686 |
> |
if (getbinary(vb, sizeof(uby8), 3, fin) != 3) |
687 |
|
return(-1); |
688 |
|
} else { |
689 |
< |
if (fread((char *)vb, sizeof(uby8), 1, fin) != 1 || |
690 |
< |
fread((char *)(vb+1), sizeof(uby8), 1, fin2) != 1 || |
691 |
< |
fread((char *)(vb+2), sizeof(uby8), 1, fin3) != 1) |
689 |
> |
if (getbinary(vb, sizeof(uby8), 1, fin) != 1 || |
690 |
> |
getbinary(vb+1, sizeof(uby8), 1, fin2) != 1 || |
691 |
> |
getbinary(vb+2, sizeof(uby8), 1, fin3) != 1) |
692 |
|
return(-1); |
693 |
|
} |
694 |
|
setcolor(col, (vb[rord[RED]]+.5)/256., |
705 |
|
uint16 vw[3]; |
706 |
|
|
707 |
|
if (fin2 == NULL) { |
708 |
< |
if (fread((char *)vw, sizeof(uint16), 3, fin) != 3) |
708 |
> |
if (getbinary(vw, sizeof(uint16), 3, fin) != 3) |
709 |
|
return(-1); |
710 |
|
} else { |
711 |
< |
if (fread((char *)vw, sizeof(uint16), 1, fin) != 1 || |
712 |
< |
fread((char *)(vw+1), sizeof(uint16), 1, fin2) != 1 || |
713 |
< |
fread((char *)(vw+2), sizeof(uint16), 1, fin3) != 1) |
711 |
> |
if (getbinary(vw, sizeof(uint16), 1, fin) != 1 || |
712 |
> |
getbinary(vw+1, sizeof(uint16), 1, fin2) != 1 || |
713 |
> |
getbinary(vw+2, sizeof(uint16), 1, fin3) != 1) |
714 |
|
return(-1); |
715 |
|
} |
716 |
|
if (swapbytes) |
742 |
|
{ |
743 |
|
double vd; |
744 |
|
|
745 |
< |
if (fread((char *)&vd, sizeof(double), 1, fin) != 1) |
745 |
> |
if (getbinary(&vd, sizeof(double), 1, fin) != 1) |
746 |
|
return(-1); |
747 |
|
if (swapbytes) |
748 |
|
swap64((char *)&vd, 1); |
758 |
|
{ |
759 |
|
float vf; |
760 |
|
|
761 |
< |
if (fread((char *)&vf, sizeof(float), 1, fin) != 1) |
761 |
> |
if (getbinary(&vf, sizeof(float), 1, fin) != 1) |
762 |
|
return(-1); |
763 |
|
if (swapbytes) |
764 |
|
swap32((char *)&vf, 1); |
791 |
|
uby8 vb; |
792 |
|
double d; |
793 |
|
|
794 |
< |
if (fread((char *)&vb, sizeof(uby8), 1, fin) != 1) |
794 |
> |
if (getbinary(&vb, sizeof(uby8), 1, fin) != 1) |
795 |
|
return(-1); |
796 |
|
d = (vb+.5)/256.; |
797 |
|
setcolor(col, d, d, d); |
807 |
|
uint16 vw; |
808 |
|
double d; |
809 |
|
|
810 |
< |
if (fread((char *)&vw, sizeof(uint16), 1, fin) != 1) |
810 |
> |
if (getbinary(&vw, sizeof(uint16), 1, fin) != 1) |
811 |
|
return(-1); |
812 |
|
if (swapbytes) |
813 |
|
swap16((char *)&vw, 1); |
843 |
|
vf[2] = colval(col,ord[2]); |
844 |
|
if (swapbytes) |
845 |
|
swap32((char *)vf, 3); |
846 |
< |
fwrite((char *)vf, sizeof(float), 3, stdout); |
846 |
> |
putbinary(vf, sizeof(float), 3, stdout); |
847 |
|
|
848 |
|
return(ferror(stdout) ? -1 : 0); |
849 |
|
} |
861 |
|
vd[2] = colval(col,ord[2]); |
862 |
|
if (swapbytes) |
863 |
|
swap64((char *)vd, 3); |
864 |
< |
fwrite((char *)vd, sizeof(double), 3, stdout); |
864 |
> |
putbinary(vd, sizeof(double), 3, stdout); |
865 |
|
|
866 |
|
return(ferror(stdout) ? -1 : 0); |
867 |
|
} |
895 |
|
vb[1] = min(i,255); |
896 |
|
i = colval(col,ord[2])*256.; |
897 |
|
vb[2] = min(i,255); |
898 |
< |
fwrite((char *)vb, sizeof(uby8), 3, stdout); |
898 |
> |
putbinary(vb, sizeof(uby8), 3, stdout); |
899 |
|
|
900 |
|
return(ferror(stdout) ? -1 : 0); |
901 |
|
} |
917 |
|
vw[2] = min(i,65535); |
918 |
|
if (swapbytes) |
919 |
|
swap16((char *)vw, 3); |
920 |
< |
fwrite((char *)vw, sizeof(uint16), 3, stdout); |
920 |
> |
putbinary(vw, sizeof(uint16), 3, stdout); |
921 |
|
|
922 |
|
return(ferror(stdout) ? -1 : 0); |
923 |
|
} |
944 |
|
vf = (*mybright)(col); |
945 |
|
if (swapbytes) |
946 |
|
swap32((char *)&vf, 1); |
947 |
< |
fwrite((char *)&vf, sizeof(float), 1, stdout); |
947 |
> |
putbinary(&vf, sizeof(float), 1, stdout); |
948 |
|
|
949 |
|
return(ferror(stdout) ? -1 : 0); |
950 |
|
} |
960 |
|
vd = (*mybright)(col); |
961 |
|
if (swapbytes) |
962 |
|
swap64((char *)&vd, 1); |
963 |
< |
fwrite((char *)&vd, sizeof(double), 1, stdout); |
963 |
> |
putbinary(&vd, sizeof(double), 1, stdout); |
964 |
|
|
965 |
|
return(ferror(stdout) ? -1 : 0); |
966 |
|
} |
982 |
|
COLOR col |
983 |
|
) |
984 |
|
{ |
985 |
< |
register int i; |
985 |
> |
int i; |
986 |
|
uby8 vb; |
987 |
|
|
988 |
|
i = (*mybright)(col)*256.; |
989 |
|
vb = min(i,255); |
990 |
< |
fwrite((char *)&vb, sizeof(uby8), 1, stdout); |
990 |
> |
putbinary(&vb, sizeof(uby8), 1, stdout); |
991 |
|
|
992 |
|
return(ferror(stdout) ? -1 : 0); |
993 |
|
} |
1005 |
|
vw = min(i,65535); |
1006 |
|
if (swapbytes) |
1007 |
|
swap16((char *)&vw, 1); |
1008 |
< |
fwrite((char *)&vw, sizeof(uint16), 1, stdout); |
1008 |
> |
putbinary(&vw, sizeof(uint16), 1, stdout); |
1009 |
|
|
1010 |
|
return(ferror(stdout) ? -1 : 0); |
1011 |
|
} |
1032 |
|
vf = colval(col,putprim); |
1033 |
|
if (swapbytes) |
1034 |
|
swap32((char *)&vf, 1); |
1035 |
< |
fwrite((char *)&vf, sizeof(float), 1, stdout); |
1035 |
> |
putbinary(&vf, sizeof(float), 1, stdout); |
1036 |
|
|
1037 |
|
return(ferror(stdout) ? -1 : 0); |
1038 |
|
} |
1048 |
|
vd = colval(col,putprim); |
1049 |
|
if (swapbytes) |
1050 |
|
swap64((char *)&vd, 1); |
1051 |
< |
fwrite((char *)&vd, sizeof(double), 1, stdout); |
1051 |
> |
putbinary(&vd, sizeof(double), 1, stdout); |
1052 |
|
|
1053 |
|
return(ferror(stdout) ? -1 : 0); |
1054 |
|
} |
1075 |
|
|
1076 |
|
i = colval(col,putprim)*256.; |
1077 |
|
vb = min(i,255); |
1078 |
< |
fwrite((char *)&vb, sizeof(uby8), 1, stdout); |
1078 |
> |
putbinary(&vb, sizeof(uby8), 1, stdout); |
1079 |
|
|
1080 |
|
return(ferror(stdout) ? -1 : 0); |
1081 |
|
} |
1093 |
|
vw = min(i,65535); |
1094 |
|
if (swapbytes) |
1095 |
|
swap16((char *)&vw, 1); |
1096 |
< |
fwrite((char *)&vw, sizeof(uint16), 1, stdout); |
1096 |
> |
putbinary(&vw, sizeof(uint16), 1, stdout); |
1097 |
|
|
1098 |
|
return(ferror(stdout) ? -1 : 0); |
1099 |
|
} |
1135 |
|
if (fin2 == NULL) |
1136 |
|
goto namerr; |
1137 |
|
if (fseek(fin2, |
1138 |
< |
(long)sizeof(float)*picres.xr*picres.yr, 1)) |
1138 |
> |
(long)sizeof(float)*picres.xr*picres.yr, SEEK_CUR)) |
1139 |
|
goto seekerr; |
1140 |
|
if (fseek(fin3, |
1141 |
< |
(long)sizeof(float)*2*picres.xr*picres.yr, 1)) |
1141 |
> |
(long)sizeof(float)*2*picres.xr*picres.yr, SEEK_CUR)) |
1142 |
|
goto seekerr; |
1143 |
|
} |
1144 |
|
} |
1157 |
|
if (fin2 == NULL) |
1158 |
|
goto namerr; |
1159 |
|
if (fseek(fin2, |
1160 |
< |
(long)sizeof(double)*picres.xr*picres.yr, 1)) |
1160 |
> |
(long)sizeof(double)*picres.xr*picres.yr, SEEK_CUR)) |
1161 |
|
goto seekerr; |
1162 |
|
if (fseek(fin3, |
1163 |
< |
(long)sizeof(double)*2*picres.xr*picres.yr, 1)) |
1163 |
> |
(long)sizeof(double)*2*picres.xr*picres.yr, SEEK_CUR)) |
1164 |
|
goto seekerr; |
1165 |
|
} |
1166 |
|
} |
1197 |
|
if (fin2 == NULL) |
1198 |
|
goto namerr; |
1199 |
|
if (fseek(fin2, |
1200 |
< |
(long)sizeof(uby8)*picres.xr*picres.yr, 1)) |
1200 |
> |
(long)sizeof(uby8)*picres.xr*picres.yr, SEEK_CUR)) |
1201 |
|
goto seekerr; |
1202 |
|
if (fseek(fin3, |
1203 |
< |
(long)sizeof(uby8)*2*picres.xr*picres.yr, 1)) |
1203 |
> |
(long)sizeof(uby8)*2*picres.xr*picres.yr, SEEK_CUR)) |
1204 |
|
goto seekerr; |
1205 |
|
} |
1206 |
|
} |
1219 |
|
if (fin2 == NULL) |
1220 |
|
goto namerr; |
1221 |
|
if (fseek(fin2, |
1222 |
< |
(long)sizeof(uint16)*picres.xr*picres.yr, 1)) |
1222 |
> |
(long)sizeof(uint16)*picres.xr*picres.yr, SEEK_CUR)) |
1223 |
|
goto seekerr; |
1224 |
|
if (fseek(fin3, |
1225 |
< |
(long)sizeof(uint16)*2*picres.xr*picres.yr, 1)) |
1225 |
> |
(long)sizeof(uint16)*2*picres.xr*picres.yr, SEEK_CUR)) |
1226 |
|
goto seekerr; |
1227 |
|
} |
1228 |
|
} |