home *** CD-ROM | disk | FTP | other *** search
/ Vectronix 2 / VECTRONIX2.iso / FILES_01 / GENEVA_3.LZH / GENEVA_3.MSA / PROGRAM / SETMOUSE.C < prev    next >
C/C++ Source or Header  |  1993-05-05  |  1KB  |  52 lines

  1. #include "stdio.h"
  2. #include "tos.h"
  3. #include "aes.h"
  4. #include "xwind.h"
  5.  
  6. void load_mouse( char *name, int index )
  7. {
  8.   int hand, is_mkm;
  9.   ANI_MOUSE mouse;
  10.   
  11.   if( (hand = Fopen( name, 0 )) > 0 )
  12.   {
  13.     is_mkm = Fseek(0L,hand,2) != 74L;
  14.     Fseek(0L,hand,0);
  15.     if( is_mkm )
  16.     {
  17.       Fread( hand, 32*sizeof(MFORM), &mouse.form );
  18.       Fread( hand, 2*sizeof(int), &mouse.frames );
  19.     }
  20.     else
  21.     {
  22.       Fread( hand, sizeof(MFORM), &mouse.form[0] );
  23.       mouse.frames = 1;
  24.       mouse.delay = 0;
  25.     }
  26.     Fclose(hand);
  27.     graf_mouse( X_SET_SHAPE+index, (MFORM *)&mouse );
  28.   }
  29. }
  30.  
  31. int main(void)
  32. {
  33.   FILE *f;
  34.   char fname[80], buf[80];
  35.   int num;
  36.   
  37.   appl_init();
  38.   if( (f = fopen("setmouse.dat","r")) != NULL )
  39.   {
  40.     graf_mouse( M_OFF, 0L );
  41.     while( fgets( buf, 80, f ) != NULL )
  42.     {
  43.       if( sscanf( buf, "%d %s\n", &num, fname ) == 2 )
  44.           load_mouse( fname, num );
  45.     }
  46.     graf_mouse( ARROW, 0L );
  47.     graf_mouse( M_ON, 0L );
  48.   }
  49.   else form_alert( 1, "[1][SETMOUSE.DAT|not found][OK]" );
  50.   return 0;
  51. }
  52.