I convert the PNG file to C ( using png2c.C )...
I tried with a BitMap ( BMP ) file and it works fine, but with the PNG i just get some "mixed" pixels... =S
Can u plz tell me how can i make this work fine ?!
This is the code i use:
Code: Select all
void pgBitBlt(unsigned long x,unsigned long y,unsigned long w,unsigned long h,unsigned long mag,const unsigned short *d)
{
unsigned char *vptr0; //pointer to vram
unsigned char *vptr; //pointer to vram
unsigned long xx,yy,mx,my;
const unsigned short *dd;
vptr0=pgGetVramAddr(x,y);
for (yy=0; yy < h; yy ++) {
for (my=0; my < mag; my ++) {
vptr=vptr0;
dd=d;
for (xx=0; xx < w; xx ++) {
for (mx=0; mx < mag; mx ++) {
if(*dd != 0xFFFF){ *(unsigned short *)vptr=*dd;}
vptr += PIXELSIZE*2;
}
dd ++;
}
vptr0 += LINESIZE*2;
}
d += w;
}
}
Thks,
ShUr1k3n.