🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Catch 22

Started by
1 comment, last by frizb 24 years, 6 months ago
You can do a color key blit with BltFast as well, using the flag DDBLTFAST_SRCCOLORKEY.

------------------
Lich

Lich
Advertisement

I have a predicament. I can animate my sprites with BltFast, but then there isn't any colorkey. If I use Blt, I get the colorkey, but no animation.

I thought setting up the rect structure like this would work for Blt. (My sprite is 64x64)
============================================
rect.left = sprite.x;
rect.top = sprite.x;
rect.right = sprite.x + 64;
rect.bottom = sprite.y + 64;

lpddsback->Blt(&rect2, lpddsoff2, &rect2, DDBLT_KEYSRC, NULL);
========================================
If I have the rect set to (0,0,64,64) it works but no animation. With it set like above, nothing shows, except every few seconds I see a faint blip in the corner.
If I use the BltFast from below with the rect set to (0,0,64,64) it animates fine, but no colorkey of course.
========================================

lpddsback->BltFast(sprite.x,sprite.y,lpddsoff2, &rect2, DDBLTFAST_WAIT); // Works
========================================

Am I going about this the wrong way?

------------------
Still Learning...

Still Learning...
Oh. How I'm red-faced. How did I miss that? Thanks, friz

ps-Not to mention I forgot to use a source and dest rect above. Its all good now though.

------------------
Still Learning...

Still Learning...

This topic is closed to new replies.

Advertisement