/************************************************************** * ENGINE.C - ViFONT ANIMATION DEMONSTRATION * * CONTRIBUTED TO AT&T BY THE AMPERFAX CORPORATION * **************************************************************/ #include #include #include main(argc,argv) int argc; char *argv[]; { extern goodbye(); extern unsigned short ascii32[],ascii33[],ascii34[],ascii35[]; unsigned short *intake,*compression,*power,*exhaust; static struct urdata picture; int x,d,f; if(argc < 3) { printf("\33[2J\33[H\33[4mEngine Animation Demonstration\33[0m\n\n"); printf("Usage: engine [frames] [delay]\n"); printf(" frame values: 4, 8, 16, 32,...\n"); printf(" delay values: 0=too fast 20000=nice 40000=good\n"); exit(0); } f = atoi(argv[1]); /* Get number of frames */ if(f < 0) f=0; d = atoi(argv[2]); /* Get number for delay */ if(d < 0) d=0; /* Note to new developers: The UNIX PC counts argc from 1 to ...n, but argv[?] is counted from 0 {program name} ....n */ signal(SIGINT,goodbye); /* Set DEL vector for quit */ printf("\33[=1C\33[2J\33[H"); /* Cursor Off - Clear Screen */ printf("\t \33[4mEngine Animation Demonstration\33[0m\n\n"); printf("\tNumber of frames = %d / Delay between frames = %d\n\n",f,d); printf("\t \33[7m Press [shift][Del] to exit anytime. \33[0m"); intake = ascii32; /* This isn't necessary-aids readability*/ compression = ascii33; power = ascii34; exhaust = ascii35; picture.ur_dstbase = 0; /* Tell ioctl we are using this window */ picture.ur_dstwidth= 0; picture.ur_srcx = 0; /* Start taking the image from p(0,0) */ picture.ur_srcy = 0; picture.ur_srcwidth= 10; /* All images are 10 chars/row */ picture.ur_dstx = 250; /* Somewhere near middle of UNIX window */ picture.ur_dsty = 150; picture.ur_srcop = SRCSRC; /* Load the original source image only */ picture.ur_dstop = DSTSRC; /* Draw the original source image only */ picture.ur_pattern = 0; /* Not using any pattern here */ picture.ur_width = 70; /* All images are 70 pixels wide */ picture.ur_height = 50; /* All images are 50 pixels high */ for(x=0; x