Alpha map

Post Reply
User avatar
Joozey
Posts: 3
Joined: Sat Oct 20, 2007 6:11 pm

Alpha map

Post by Joozey » Fri Nov 02, 2007 8:06 pm

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?

WinterMute
Site Admin
Posts: 1853
Joined: Tue Aug 09, 2005 3:21 am
Location: UK
Contact:

Re: Alpha map

Post by WinterMute » Sat Nov 03, 2007 1:50 am

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.
Help keep devkitPro toolchains free, Donate today

Personal Blog

User avatar
Joozey
Posts: 3
Joined: Sat Oct 20, 2007 6:11 pm

Re: Alpha map

Post by Joozey » Sat Nov 10, 2007 12:55 am

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!

Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests