/************************************************************************* DEMO 2 Demonstrates the speed difference between compiled bitmap, conventional masked planar bitmap, and video bitmap blits. **************************************************************************/ #include #include #include #include #include #include #include #include #include "xlib.h" #include "xtext.h" #include "xrect.h" /* Macro to make pointer parameters model independent */ #define FARPTR(x) (MK_FP(FP_SEG(x),FP_OFF(x))) char *swidth[10]={"0","1","2","3","4","5","6","7","8","9"}; char far *fonts[20]; char names[20][20]; int i,fcount=0; char c; typedef struct { int dummy; char height; char width; } header; void load_user_fonts(){ FILE *f; long len; struct ffblk ffblock; if(findfirst("*.fnt",&ffblock,0)!=0){ printf("No Fonts found in current directory!\n"); exit(0); }; do { printf("Loading font \"%s\"...\n",ffblock.ff_name); strncpy(names[fcount],ffblock.ff_name,14); f=fopen(ffblock.ff_name,"rb"); fseek(f,0,SEEK_END); len=ftell(f); fseek(f,0,SEEK_SET); fonts[fcount] = farmalloc(len); if (!fonts[fcount]){ printf("Out of memory"); if (fcount!=0){ printf("- No more fonts can be loaded\n"); fclose(f); goto NoMoreFonts; } else printf("\n"); exit(0); }; for (i=0;i?,./ ", NULL}; void main(){ int textline; int strindex; int height; load_user_fonts(); for (i=0;i