home *** CD-ROM | disk | FTP | other *** search
/ C++ Games Programming / CPPGAMES.ISO / thx / source / utils / showpcx.cpp < prev    next >
C/C++ Source or Header  |  1995-05-12  |  711b  |  33 lines

  1. #include <fastgraf.h>
  2. #include <iostream.h>
  3. #include <io.h>
  4.  
  5. const int VMODE = 22;
  6.  
  7. int main(int argc,char** argv)
  8.   {
  9.   if (argc<2)
  10.     {
  11.     cout << "\nUSAGE : SHOWPCX <pcxfile>\n";
  12.     cout << "  SHOWPCX simply displays the supplied pcx file.\n";
  13.     cout << "  The image is displayed in the upper left corner of the";
  14.     cout << "  screen, and its internal palette is used.\n";
  15.     return -1;
  16.     }
  17.  
  18.   if (access(argv[1],0)!=0)
  19.     {
  20.     cout << "can't find file '" << argv[1] << "'\n";
  21.     return -1;
  22.     }
  23.   
  24.   int oldmode=fg_getmode();
  25.   fg_waitfor(18);
  26.   fg_setmode(VMODE);
  27.   fg_move(0,0);
  28.   fg_showpcx(argv[1],2);
  29.   fg_waitkey();
  30.   fg_setmode(oldmode);
  31.   return 0;
  32.   }
  33.