|
Function to make blackness transparent |
Vanneto
Member #8,643
May 2007
|
I have got this function to make black color around a bitmap black. Is it good? Doesent work for me. Im running the game in 32bit mode. Is there a better way at doing this? I guess all the bitmap images must be 32 bit too? Thanks! In capitalist America bank robs you. |
Kitty Cat
Member #2,815
October 2002
|
Instead of checking if the pixel matches makecol (which it may not if the image has alpha data), check r, g, and b explicitly. Also, unless you're using the alpha blender, you need to set the pixel to the mask color and use draw_sprite or masked_blit. If you know for sure you'll have a 32-bit bitmap there, you can use _putpixel32 to speed it up some. Also, you're not resetting 'i' for every row, and you're skipping three pixels for every one you do. -- |
Vanneto
Member #8,643
May 2007
|
Ok I edited my loop so its only +1 not +4. I used this function like so: But it doesent work. Am I doing something wrong? Thanks! In capitalist America bank robs you. |
spellcaster
Member #1,493
September 2001
|
did you set the color depth before loading the dat file? -- |
Kitty Cat
Member #2,815
October 2002
|
I said: set the pixel to the mask color and use draw_sprite or masked_blit
-- |
|