3d max破解版 win10:注释这个程序 各位高手帮忙啊

来源:百度文库 编辑:神马品牌网 时间:2024/04/28 20:58:35
#include<stdio.h>
#include<graphics.h>
#include<fcntl.h>
#include<io.h>
#include"myclib.h"
void init(void);
void dis_hz(int x0,int y0,unsigned code);
void dis_scr(int x, int y, unsigned char *pt,int color);
unsigned char *get_dismat(unsigned code);
unsigned char bytes[32];

main()
{
int i,x,y;
unsigned *ccode="赵洪国是个猪";
init();
x=20;
y=100;
while(*ccode!=NULL)
{
while(x<60&&(*ccode!=NULL))
{
dis_hz(x,y,*ccode);
x+=20;
ccode+=1;
}
x=20;
y+=20;
}
getch();
closegraph();
}
unsigned char *get_dismat(unsigned code)
{
int down=0;
int up=clib.n-1,mid;
int found=0;
while(down<=up&&!found)
{
mid=(up+down)/2;
if(code==clib.lib[mid].incode)
found=1;
else if(code>clib.lib[mid].incode)
down=mid+1;
else
up=mid-1;
}
return(found? clib.lib[mid].mat:NULL);
}

void dis_hz(int x0,int y0,unsigned code )
{int i;
unsigned char far *p,mat[32];
if(p=get_dismat(code))
dis_scr(x0,y0,p,LIGHTRED);
}
void init(void)
{
int driver=DETECT;
int mode=0;
initgraph(&driver,&mode,"");
}
void dis_scr(int x,int y,unsigned char *pt,int color)
{
unsigned char mask[]={0x80,0x40,0x20,0x10,0x08,0x04,0x02,0x01};
register int i,j,x0,y0,pos;
unsigned char mat[32];
for(i=0;i<32;i++)
mat[i]=*(pt++);
y0=y;
for(i=0;i<16;i++)
{
x0=x;
pos=2*i;
for(j=0;j<16;j++)
{
if((mask[j%8]&mat[pos+j/8])!=NULL)
putpixel(x0,y0,color);
++x0;
}
++y0;
}
}



这个程序有问题啊`