[Freeciv-Dev] Mask working now
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Well, I got the mask to work. I made the following change in the crop
function:
if (source->has_mask)
{
bigmask = create_mask_copy(source->mask);
SelectObject(hdcbig, bigmask);
if ((smallmask = CreateBitmap(width,height,1,1,NULL)))
{
SelectObject(hdcsmall,smallmask);
BitBlt(hdcsmall,0,0,width,height,hdcbig,x,y,SRCCOPY);
}
DeleteObject(bigmask);
}
SelectObject(hdcbig,bigsave);
SelectObject(hdcsmall,smallsave);
mysprite=fc_malloc(sizeof(struct Sprite));
mysprite->width=width;
mysprite->height=height;
mysprite->bmp = create_bitmap_copy(smallbitmap);
mysprite->has_mask=0;
if (smallmask)
{
mysprite->has_mask=1;
mysprite->mask = create_mask_copy(smallmask);
Basically, I moved the selection of the old bitmap back into the DCs
before I copied the bitmaps. For some reason, this fixed the bitmap
mask problem. Somehow the mask was going all black if the
selectObjects were after the copies. Anyway, I am happy, the masks
are working now.
http://members.fortunecity.com/broadsword/Computer/FreeCiv/ScreenGame.png
Jenn
|
|