Skip to main content
GameDev.net gamedev.net
🔒 Locked

Fading out

Started by FxMazter Dec 28, 2002 at 9:49 AM 1 replies 250+ views
Original Post
FxMazter
FxMazter
Hi! I have an e.g. for fading out in 16 bit color mode. But I am working with 32 bit color. So I was wondering if anyone could explain this for me:
      
USHORT r, g , b;
USHORT color;

r = (color & 0xF800) >> 11;
g = (color & 0x0730) >> 5;
b = (color & 0x001F);
      
I know that the color is extracted here. But what I don't understand is the (color & 0xF800) part of the code... I'm not sure... but I would guess that 0xF800 is a memory adress? How would that look like with 32 bit color? Thx! [edited by - FxMazter on December 28, 2002 10:51:38 AM] [edited by - FxMazter on December 28, 2002 10:52:07 AM]
mickey
mickey
hi,

you can find your answers here

it''s just masking/removing/shifting bits...
http://www.dualforcesolutions.comProfessional website designs and development, customized business systems, etc.,
FxMazter
FxMazter
Thank you very much!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.