DX-Transparency problem
Hi,
For those who have responded to my previous post thanks, i''m making progress. Hre''s my new problem. I first blt my logo to the screen, which works fine, then i blit my background to the screen and begin animating. However my sprite''s background is being showed, the color keying isnt working. Here''s my code that you may need to help. Also my function order is correct in the calling of them, these are just the definitions.
void Animate_Images()
{
RECT rect;
// background
lpDDSBack->BltFast(0,0,dojo,NULL, DDBLTFAST_WAIT/DDBLTFAST_SRCCOLORKEY);
rect.left = 0;
rect.top = 0;
rect.bottom = 200;
rect.right = 200;
// draw the current sprite cell
lpDDSBack->BltFast(0,200,arr_anime[current_image],▭,DDBL TFAST_WAIT/DDBLTFAST_SRCCOLORKEY);
lpDDSPrimary->Flip(0,DDFLIP_WAIT);
current_image++;
if(current_image >= IMAGE_COUNT)
current_image = 0;
Sleep(200);
}
void Set_Color_Key()
{
DDPIXELFORMAT ddpf;
ddpf.dwSize = sizeof(ddpf);
lpDDSPrimary->GetPixelFormat(&ddpf);
// determine proper key for pixel format, green
KeyColor = ddpf.dwGBitMask;
// set color keys
DDCOLORKEY key;
key.dwColorSpaceHighValue = KeyColor;
key.dwColorSpaceLowValue = KeyColor;
for (int i = 0; i < IMAGE_COUNT; i++)
arr_anime->SetColorKey(DDCKEY_SRCBLT, &key);
dojo->SetColorKey(DDCKEY_SRCBLT, &key);
}
void Draw_Logo()
{
// draw my logo
lpDDSBack->BltFast(0,0,logo,NULL,DDBLTFAST_WAIT);
first_run = false;
lpDDSPrimary->Flip(0,DDFLIP_WAIT);
Sleep(2000);
}
ECKILLER
ECKILLER
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement