main() { void *buffer; open_pcx("TEXTURA.PCX",A_8BIT,&buffer); memcpy(&in1,buffer,sizeof(in1)); free(buffer); open_pcx("sit.PCX",A_8BIT,&buffer); init(); memcpy(&out,buffer,sizeof(out)); put_picture(0,0,&out); showview(0,0,0,0); smycka(); getchar(); return 0; }
char get_pcx_frame(char *name,int x) { char *buf; if (open_pcx(get_pcx_name(name,x),A_8BIT,&buf)) return 0; memcpy(frame_buffer,buf+6+512,FRAME_LEN); memcpy(hipal,buf+6,512); free(buf); return 1; }
int main (int argc, char **argv) { image *img; printf ("start\n"); allegro_init (); set_gfx_mode (GFX_VESA1,640,480,640,480); setup_palette (); img=open_pcx (argv[1]); convert_scr7 (img); getch (); erase_image (img); allegro_exit (); return 0; }
void test() { char *pcx; char *c; void *d,*compr; unsigned short *blckdata; int vel,suma = 0; int i,j,m; compr = getmem(640*480*3);d = compr; open_pcx("d:\\!!!\\SKYNET\\TOMB\\DATA\\cred3.pcx",A_15BIT,&pcx); c = pcx+2+2+2; for (i = 0;i<180*4;i++) { blckdata = d;blckdata[0] = i;blckdata[1] = 0;blckdata[2] = 0; d = (char *)d+6; for (j = 0;j<15;j++) { m = komprimuj_rovinu(c,160,j,d,&vel); blckdata[1+(j>>3)]|= m<<((j & 0x7)*2); suma += vel; d = (char *)d+vel; } suma += 6; c += 160*2; } printf("%d / %d / %d \n",180*20*15*4, suma, suma*100/(180*20*15*4)); c = pcx+2+2+2; memset(c,0,640*480*2); d = compr; for (i = 0;i<180*4;i++) { blckdata = d; d = (char *)d+6; for(j = 0;j<15;j++) d = decomprimuj_rovinu(d,&c[160*2*blckdata[0]],160,j,(int)blckdata[1]); } }