rem: if(data) { BBitmap *bmp=new BBitmap(BRect(0,0,15,15),B_RGBA32,0); uint32 black=0xFF000000, white=0xFFFFFFFF, *bmppos; uint16	*cursorpos, *maskpos,cursorflip, maskflip, cursorval, maskval,powval; uint8 	i,j,*_buffer;
add: if (data) { BBitmap *bmp = new BBitmap(BRect(0,0,15,15),B_RGBA32,0); uint32 black = 0xFF000000, white=0xFFFFFFFF, *bmppos; uint16 *cursorpos, *maskpos, cursorflip, maskflip; uint16 cursorval, maskval, powval; uint8 i, j, *_buffer;
context: BBitmap *CursorDataToBitmap(int8 *data){	// 68-byte array used in R5 for holding cursors.	// This API has serious problems and should be deprecated(but supported) in R2	// Now that we have all the setup, we're going to map (for now) the cursor	// to RGBA32. Eventually, there will be support for 16 and 8-bit depths	if(data)	{		 	BBitmap *bmp=new BBitmap(BRect(0,0,15,15),B_RGBA32,0);		uint32 black=0xFF000000,			white=0xFFFFFFFF,			*bmppos;		uint16	*cursorpos, *maskpos,cursorflip, maskflip,				cursorval, maskval,powval;		uint8 	i,j,*_buffer;		_buffer=(uint8*)bmp->Bits();		cursorpos=(uint16*)(data+4);		maskpos=(uint16*)(data+36);				// for each row in the cursor data		for(j=0;j<16;j++)		{			bmppos=(uint32*)(_buffer+ (j*bmp->BytesPerRow()) );				// On intel, our bytes end up swapped, so we must swap them back			cursorflip=(cursorpos[j] & 0xFF) << 8;			cursorflip |= (cursorpos[j] & 0xFF00) >> 8;						maskflip=(maskpos[j] & 0xFF) << 8;			maskflip |= (maskpos[j] & 0xFF00) >> 8;				// for each column in each row of cursor data			for(i=0;i<16;i++)			{				// Get the values and dump them to the bitmap				powval=1 << (15-i);				cursorval=cursorflip & powval;				maskval=maskflip & powval;				bmppos[i]=((cursorval!=0)?black:white) & ((maskval>0)?0xFFFFFFFF:0x00FFFFFF);			}		}		return bmp;	}	return NULL;}