Page 1 of 1

Alpha map

Posted: Fri Nov 02, 2007 8:06 pm
by Joozey
I tried to place an image on an extended rotation background.
This image's original size is 128x256 16bit, and is converted with grit using -gb -gB16 -aw256 -ah256.
I just copy the image to the dma like this:

Code: Select all

dmaCopy(bannerBitmap, (u16*)BG_BMP_RAM(0), bannerBitmapLen);
But the result is a black screen.
Now I checked if it would work when I removed the alpha in the image:

Code: Select all

	u16* video_main = (u16*)BG_BMP_RAM(0);
	int i;
	for(i=0; i<256*256; i++) {
		*video_main++ |= (1 << 15);
	}
And this time, the image appeared on the screen.
So what would be the normal way to prevent the image to be invisible because of some alpha values in the bmap?

Re: Alpha map

Posted: Sat Nov 03, 2007 1:50 am
by WinterMute
You would either disable the alpha bit in grit using -gT! or set the transparency for a particular color. For instance -gT 00FFFF would set cyan as the transparent color.

Re: Alpha map

Posted: Sat Nov 10, 2007 12:55 am
by Joozey
Ah! now thats what I was looking for. I thought that was only to remove a color, but aparantly -gT can be used like that as well :) thanx a bunch!