home *** CD-ROM | disk | FTP | other *** search
/ C++ Games Programming / CPPGAMES.ISO / fgl / fglight / exc.arj / TEMP / 09-09.C < prev    next >
Text File  |  1995-01-20  |  829b  |  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 new_mode, old_mode;
  10.    int read_status, write_status;
  11.  
  12.    fg_initpm();
  13.    new_mode = fg_bestmode(320,200,1);
  14.    if (new_mode < 0 || new_mode == 12)
  15.    {
  16.       printf("This program requires a 320 ");
  17.       printf("x 200 color graphics mode.\n");
  18.       exit(1);
  19.    }
  20.    old_mode = fg_getmode();
  21.    fg_setmode(new_mode);
  22.    fg_move(0,199);
  23.  
  24.    read_status = fg_showspr("CORAL.SPR",320);
  25.    fg_waitkey();
  26.    if (read_status == 0)
  27.       write_status = fg_makespr(0,319,80,99,"NEW.SPR");
  28.    else
  29.       write_status = 1;
  30.  
  31.    fg_setmode(old_mode);
  32.    fg_reset();
  33.  
  34.    if (read_status == 1)
  35.       printf("CORAL.SPR not found.\n");
  36.    if (write_status == 1)
  37.       printf("NEW.SPR not created.\n");
  38. }
  39.