All pastes #100436 Raw Edit

Stuff

public text v1 · immutable
#100436 ·published 2006-07-26 04:00 UTC
rendered paste body
void Skin(){
	FAT_FILE* element; char* data; int lSize; unsigned short  buf[4096]  __attribute__ ((aligned (4)));

	element = FAT_fopen("/skin/dsPodtop.bmp","r");
  	if (element==NULL) PA_OutputText(0, 1, 12, "Failed opening file");

	// obtain file size.
	FAT_fseek (element , 0 , SEEK_END);
	lSize = FAT_ftell (element);
	FAT_fseek (element, 0, SEEK_SET);
	// allocate memory to contain the whole file.
	data = (char*) malloc (lSize);
	  if (data == NULL) PA_OutputText(0, 1, 13, "Something is wrong");
	// copy the file into the buffer.
	FAT_fread (data,1,lSize,element);
	FAT_fclose(element);
	PA_LoadBmpToBuffer(buf,0,0,data,128);
	PA_Create16bitSprite(1, // Screen
						22,	// Sprite number
						buf, // image to load, 128 pixels wide !
						OBJ_SIZE_32X32, // sprite size
						0, // x
						50);	//y
	int i;
	for(i=0;i<4096;i++){

		PA_OutputText(0, 1, 12, "%d",buf[i]);
	}

}