A89: More fun with custom variables...


[Prev][Next][Index][Thread]

A89: More fun with custom variables...




ok, anyone have any idea what's wrong with this code...

//sprite definition
unsigned int sprite[16] = 	 
	{0xFFFF,0x8001,0x8001,0x8001,0x8001,0x8001,0x8001,0x8001, 	 	 
0x8001,0x8001,0x8001,0x8001,0x8001,0x8001,0x8001,0xFFFF};
unsigned int pic[16];

//open the file
fp = fopen ("example","wb");

//write the sprite data to the file
fwrite (sprite,32,1,fp);

//make a file of type SPT
fputc (0,fp);
fputs ("SPT",fp);
fputc (0,fp);
fputc (OTH_TAG,fp);
fclose (fp);

//open the file
fp = fopen ("example","rb");

//read the data into the block pointed by pic
fread (pic,32,1,fp);
fclose (fp);

//draw the sprite pic
Sprite16 (5,5,16,pic,LCD_MEM,SPRT_XOR);


The sprite drawn is garbled... please help me! :'O

Michael Cowart
________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com




Follow-Ups: