[Freeciv-Dev] (PR#8215) win32 client: draw_fog_part doesn't use a mask
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: |
undisclosed-recipients: ; |
Subject: |
[Freeciv-Dev] (PR#8215) win32 client: draw_fog_part doesn't use a mask |
From: |
"James Canete" <use_less@xxxxxxxxxxx> |
Date: |
Wed, 24 Mar 2004 16:06:06 -0800 |
Reply-to: |
rt@xxxxxxxxxxx |
<URL: http://rt.freeciv.org/Ticket/Display.html?id=8215 >
> [jdorje - Wed Mar 24 15:57:12 2004]:
>
> James Canete wrote:
>
> > I actually wanted to use the new crop_sprite() to combine the old
> > fog_sprite with sprite_mask, but my first attempt didn't work and I
> > figured it's faster as is anyway.
>
> This is a possible solution. The drawback is that you need almost twice
> as many sprites since each mapview sprite has a regular and a fog sprite.
>
> The advantage is that you can fog via alpha-layer drawing rather than
> via stippling. Just draw a 50% (or so) alpha-layer black rectangle over
> the entire sprite, without changing the mask. This is what gui-SDL does
> (except it *doesn't* duplicate the sprites but uses a hack to do the
> drawing).
>
There is an AlphaBlend() function in Windows GDI, but according to MSDN
it's not supported under Windows 95. I could write a function to alpha
blend pixel by pixel, but it'd probably be very slow. Though it'd only
be slow when creating the fog sprites.
On a related note, are we going to move on to an alpha layer with
sprites, as opposed to a mask? So we'd be able to have translucent
areas of sprites and translucent edges, for pseudo edge antialiasing?
Also, does the current CVS client work on Win95? I don't have it
installed to test with.
-James Canete
|
|