Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

KuroKage

Any other RGB encoder macro for DDraw?

This topic is 5278 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

HI! I''m having problems in blitting my tiles that have transparent colors in them. I use Andre Lamothe''s macro: #define RGB16BIT565(r,g,b) ((b%32) + ((g%64) << 6) + ((r%32) << 11)) The problem is, when I attach color key''s using this macro, it only accepts the colors Red,White,Blue,Black. It seems to accept only either values that have a 0 or 255 in them so if I want the color (70,70,70) as a transparent color, it just won''t work. Is the macro all wrong? Cause honestly I don''t know why Andre wrote RGB16BIT565(0,0,32) as pure blue. Why 32 and not 255? THANKS IN ADVANCE.

Share this post


Link to post
Share on other sites
Advertisement
Well the thing is you''re extracting certain parts of whole bytes, so there are some losses depending on what values you use.

A 16 bit RGB value (565) gives you 32shades of red/blue and 64 shades of green. which is why RGB(0,0,32) is "pure blue".

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!