Archived

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

colorkey blitting in windows

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

By trial and error I have reasoned that using a colour key when blitting won't work in a non-complex-surface, windowed program. Only using ddbltfx worked for me. As a rule is this true? So I got colour keying to work with ddbltfx source keys but I am now having no success using destination colour keys, neither with the standard blit capabilities version nor ddbltfx. Here's the code I'm using, it's at the end of my 'flip' function (I'm not using complex linked buffer surfaces 'cos it's windowed, I'm just blitting into one background surface and then blitting that into the primary- it all works fine except for this colour key thing.) The idea is that when the player sprite dies the background and any foregound colours cycle through flashing different colours (it's a 'manic miner' clone.) DDRAW_INIT_STRUCT(ddbltfx); DDCOLORKEY ck; rcRectSrc.left=3; rcRectSrc.top=0; rcRectSrc.right=4; rcRectSrc.bottom=1; ck.dwColorSpaceLowValue = 0;//don't pay too much attention to these values because I've tried plenty of different combinations ck.dwColorSpaceHighValue = 50; ddbltfx.ddckDestColorkey=ck; lpddsprimary->Blt( &rcRectDest, deathColours, &rcRectSrc, DDBLT_WAIT|DDBLT_KEYDESTOVERRIDE, &ddbltfx); it is blitting from a single pixel colour from the lpddsd 'deathColours' and it doesn't do a thing. If I use DDBLT_KEYSRCOVERRIDE and ddckSrcColorKey it has the effect that you would imagine, only the colour range specified is blitted. The primary surface has, by the stage that this code is executed, had the background image blitted into it. Phew. It's not easy to describe what seems like a straightforward problem. Can anyone help? P.S. I have tried using both DDCKEY_DESTBLT and DDCKEY_COLORSPACE in the blit flags. By the way, these aren't needed if if you are using ddbltfx to override the colour key, are they? Edited by - graeme on March 22, 2002 5:35:22 PM

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
hello,
have you tried using flash. i use flash and i made a game like manic minor. you can have button that you press and attach "ACTIONSCRIPT"
to them like on button release goto a frame.

you can do flash that works on mac as well which c++ won''t.

and there are no rules as such in flash like the one you where asking.

basically flash is as powerful as any windows program.

good luck les baxter.

Share this post


Link to post
Share on other sites
OK strangely enough I have already made this in flash, www.todayguide.com but maybe you are aware of this. In any case your reply confuses me too much for to dwell upon it.

But maybe someone could answer my question?? Are colour keys supported in windowed ''non-complex-ddsurfaces'' mode? And why would a SRC blit work when a DEST won''t? It''s really getting on my nerves. Driving me to drink it is.

Share this post


Link to post
Share on other sites