Archived

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

Dale

Directdraw colour filtering

Recommended Posts

Hi all. I''m working on a game written as a Dev C++ 6, win32 console, Directx7 base. I''ve got all the base engine complete, etc etc. Anyways, I have a world map which shows province borders, cities and a couple other elements. I''ve been asked by the rest of the team whether it''s possible to put a shading over the top of the provinces to create an ownership filter. Well quite simply, I have no idea how to do it, if it''s even possible or where to start. Any help appreciated. The following pic has two parts: - The top half shows what is currently on the province map. - The bottom half shows what they''d like, with the colour filter showing ownership of the provinces. http://members.dodo.com.au/~thesdale/shade.jpg

Share this post


Link to post
Share on other sites
Methods:

1) Used palettised graphics, then just change the palette for each province as required. Or

2) Lock() the surface and shade/tint the pixels of the surface for each province yourself. Or

3) Store pre-coloured versions of each province in each of the major colours and do a colour keyed Blt() for each. Or

4) Create a Direct3D device and use D3D alpha blending (i.e. use the surface as a texture on a flat to screen quad, use vertex colours for the tint, and the alpha channel for the shape). Beware some older PowerVR based chips won''t like you mixing 2D and 3D though.

--
Simon O''Connor
3D Game Programmer &
Microsoft DirectX MVP

Share this post


Link to post
Share on other sites
Thanks for the help Simon.

3 - We''ve got 60 provinces, and 8 different possible owners. That''s 480 different coloured province gfx. Not too plausible.

4 - Yeah, I didn''t want to do the 2D/3D mix either, so I''ll skip this option too.

That leaves me with options 1 & 2 to persue. Thanks. :D

Dale

Share this post


Link to post
Share on other sites