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