Ok, i'm using the DDSetColorKey as defined in ddutil.cpp. I made a dinky file that contained whether my functions SUCCEEDed, or FAILED, and it shows that DDSetColorKey returned DD_OK. Here's what it looks like,
// note: i added comments (//) to clarify what each function does
=============================================
DDInit SUCCESS // sets up everything. screen width,height and bpp are #defines
DDCreateSurface SUCCESS // creates the lpddsring surface
DDSetColorKey SUCCESS // sets the RGB(250,0,218) into lpddsring surface
DDReLoadBitmap SUCCESS // loads the .dib into the lpddsring surface
=============================================
I made my .dib in PaintShopPro and it saves the .dib as 24bit, which doesn't seem to have any effect when displaying on a 16bit surface (cause the picture comes up fine...). Here's what my BltSurface functions looks like (i overloaded it):
=============================================
int BltSurface(LPDIRECTDRAWSURFACE7 lpdds, RECT dest, RECT source)
{
if(lpddsback->Blt(&dest,lpdds,&source,DDBLT_WAIT | DDBLT_KEYSRC,NULL)!=DD_OK)
return 0;
// everything ok
return 1;
}
/////////////////////////////////////////////
int BltSurface(LPDIRECTDRAWSURFACE7 source, int w, int h, int x, int y)
{
// w = width, h = height, x and y are where on the screen
RECT rcRect;
rcRect.left = 0;
rcRect.top = 0;
rcRect.right = w;
rcRect.bottom = h;
if(lpddsback->BltFast(x,y,source,&rcRect,DDBLTFAST_SRCCOLORKEY)!=DD_OK)
return 0;
return 1;
}
=============================================
I tried both functions, also by commenting the one that i wasn't testing, but neither seems to skip that color i chose. I wonder if it's the way PaintShopPro5 saves the RGB components...?
I'd put the .dib/.bmp file up here so you could test it out if you wanted to, if i knew how. Of course, i'd save it as .jpg first 