Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2004:
[Freeciv-Dev] Re: (PR#11433) Fog of War rendering improvement
Home

[Freeciv-Dev] Re: (PR#11433) Fog of War rendering improvement

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: andrearo@xxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#11433) Fog of War rendering improvement
From: "Vasco Alexandre da Silva Costa" <vasc@xxxxxxxxxxxxxx>
Date: Fri, 10 Dec 2004 08:13:44 -0800
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=11433 >

On Thu, 9 Dec 2004, [UTF-8] Andreas Røsdal wrote:

>
> <URL: http://bugs.freeciv.org/Ticket/Display.html?id=11433 >
>
> Following the discussion on how to do fog of war with alpha blending, I
> did a little test to implement an improvement to the fog of war rendering.
>
> It doesn't use alpha-blending, since you would need to use pixbufs.
> Instead the brightness of every pixel is reduced by 50%, by iterating over
> each pixel in the pixmap.
>
> There is little or no performance hit that I can notice, but it would be a
> good idea to do some benchmarking. Is is possible to get a frames/s
> output?
>
> Patch against CVS head, for the Gtk 2.x client.
>
> Screenshot: http://www.stud.ntnu.no/~andrearo/scr.png

This code has several flaws.

* It won't work on anything but TrueColor displays (but I'm ok with this).
* It will be slow, because it does a roundtrip. First it gets the image
  from X server space into client side space, then it sends it back into X
  server space.
* It will be slow, because you use *_get_pixel/*_put_pixel instead of a
  more optimal way of traversing the pixels.

---
Vasco Alexandre da Silva Costa @ Instituto Superior Tecnico, Lisboa








[Prev in Thread] Current Thread [Next in Thread]