Archived

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

16-24 bit fades in DDraw

This topic is 5747 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

Okay I am currently making a game in MSVC++ in Direct Draw in 16 bpp. I am trying to make the screen fade to black but it will not work. Can anyone help me to have the screen fade to black? Edited by - wendieu on March 20, 2002 1:55:03 PM

Share this post


Link to post
Share on other sites
gamma is not supporte dont all cards, plus is a stupid method. instead look at the articles on how to do blending on this site. games that use gamma control for this tend to screw up the desktop if they crash, assuming that the card supports it. search the board, this question has been asked and answered before (with some code i might add).

Share this post


Link to post
Share on other sites
hmm, i guess you dont know how to search well

http://www.gamedev.net/reference/programming/features/mmxblend/

that was found in mere seconds using gamedevs search engine.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
If you''re just fading to black.. why not do something like this.. obviously there are more efficient ways of doing this, but at least this will show you exactly what''s going on :o).

you have your pointer to a 16-bit surface, and you''re width/height (unsigned short *Ptr_16Bit,unsigned short width ,height.


  
void Fade16(unsigned short *Ptr_16Bit, unsigned short width, unsigned short height)
{
int x,y;
unsigned char r,g,b;
for (y=0;y!=height;++y)
{
for (x=0;x!=width;++x)
{
//Get r,g,b

r = ((*Ptr_16Bit)&31);
g = (((*Ptr_16Bit)>>5)&63);
b = (((*Ptr_16Bit)>>11)&31);
if (r) --r; //Subrtact 1 if not 0!

if (g) --g; //Subrtact 1 if not 0!

if (b) --b; //Subrtact 1 if not 0!

*Ptr_16Bit=(b<<11) + (g<<5) + r; //Set our new value!

++Ptr_16Bit; //Increment to next value!

}
}
}


Billy - BillyB@mrsnj.com

Share this post


Link to post
Share on other sites