home *** CD-ROM | disk | FTP | other *** search
/ C++ Games Programming / CPPGAMES.ISO / fgl / fglight / exc.arj / TEMP / 09-01.C < prev    next >
Text File  |  1995-01-20  |  823b  |  39 lines

  1. #include <fastgraf.h>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4.  
  5. void main(void);
  6.  
  7. void main()
  8. {
  9.    int old_mode;
  10.    int read_status, write_status;
  11.  
  12.    fg_initpm();
  13.    if (fg_testmode(19,1) == 0)
  14.    {
  15.       printf("This program requires a 320 ");
  16.       printf("x 200 MCGA graphics mode.\n");
  17.       exit(1);
  18.    }
  19.    old_mode = fg_getmode();
  20.    fg_setmode(19);
  21.  
  22.    read_status = fg_showpcx("CORAL.PCX",0);
  23.    fg_waitkey();
  24.    if (read_status == 0)
  25.       write_status = fg_makepcx(0,319,80,99,"NEW.PCX");
  26.    else
  27.       write_status = 1;
  28.  
  29.    fg_setmode(old_mode);
  30.    fg_reset();
  31.  
  32.    if (read_status == 1)
  33.       printf("CORAL.PCX not found.\n");
  34.    else if (read_status == 2)
  35.       printf("CORAL.PCX is not a PCX file.\n");
  36.    if (write_status == 1)
  37.       printf("NEW.PCX not created.\n");
  38. }
  39.