MapUtility program i wrote...
I have a MapUtility share/freeware program that converts maps from one computer game format to another, rescales, etc, and can even convert a green/yellow/brown terrain elevation map from a NOAA site in .BMP format into a game map. MapUtility supports CivII, CallToPower,AlphaCentauri and RailroadTycoon maps.
It also is a MDI application, so you can have several maps open all at once. The only thing is the graphics are still very slow. I have 2 books on DirectX and they do not sufficiently explain transparent blitting so I can get something that works. So I am forced to scan each terrain tile image pixel by pixel, and then checking to see if it falls in the transparent range (the tilefile.bmp is 256-color mode).
Every attempt to achieve blitting so that the transparent colors (they are palette indexes 253-255) do not show has failed, either resulting in the program crashing, not displaying anything or displaying the entire rectangle instead of the isometric tile shape.
Any ideas? Or good examples of blitting with a colorkey in 256-color mode that has a range of colors that are transparent?
Thanks,
Allyn
This might seem like a hack of an answer, but can''t you just change the range of color indexes in your BMP to just one?. (since you are not displaying those portions anyways.) This would be the easiest and fastest way.
<untested>
</untested>
hmm.. I think that''s all right..
//make a color keyDDCOLORKEY ckey;//set the low value for transparencyckey.dwColorSpaceLowValue = 235;//set the high valueckey.dwColorSpaceHighValue = 255;//set the destination''s color keyDDSSurfaceName->SetColorKey(DDCKEY_SRCBLT, &ckey);//blit it on outDDSSurfaceName->BltFast(destX, destY, DDSBitmap, ▭, DDBLTFAST_DESTCOLORKEY);
</untested>
hmm.. I think that''s all right..
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement