[Freeciv-Dev] (PR#12186) fog error near map boundaries
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://bugs.freeciv.org/Ticket/Display.html?id=12186 >
> [jdorje - Wed Feb 09 17:09:40 2005]:
>
> The fog near the boundaries is drawn as if the unreal tiles are known.
> Obviously in this screenshot we want to draw them as if they were
> fogged. But if the real tiles are known then we want to draw things as
> if they were also known.
>
> I see two possible rules here:
>
> 1. If any of the real tiles at the corner are fogged, the unknown tiles
> should be drawn fogged.
>
> 2. If all of the real tiles at the corner are fogged, the unknown tiles
> should be drawn fogged.
Neither of these two rules will work. In fact fixing this properly will
be insanely, unbelieveably obnoxious. Consider:
1. The unreal tile is underneath up to 3 different fog sprites. For
these sprites to be drawn consistently each of them must use the same
known value for the tile.
2. If the known value for the tile is to vary it must therefore do so
consistently. The only way to do this is to look at all (or at least a
consistent set) of the adjacent tiles to the unreal tile. This means we
can'd just look at the tiles in the corner structure but must have some
sort of adjc_iterate.
3. An adjc_iterate isn't possible since the tile is NULL. We can add
the x,y values to each tile of the corner structure which allows a
manual iteration. Then we can take the minimum, average, or maximum of
these values (probably minimum is best).
4. However this means the change of a tile can affect the drawing of a
fog sprite that isn't even partly on top of that tile. So in
refresh_tile_mapcanvas we'd have to extend the area of refreshing by one
extra tile (increasing the area of update dramatically).
Obviously this isn't going to happen.
With civ3 fog graphics I think it's safe to treat unreal tiles as
unknown. But with our fog graphics this isn't true. With a change to
the graphics it would be okay to treat these tiles as known. But for
now I provide the simple patch that shows them as fog (and thus reduces
the bug).
-jason
Index: tilespec.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/tilespec.c,v
retrieving revision 1.233
diff -u -r1.233 tilespec.c
--- tilespec.c 9 Feb 2005 23:17:46 -0000 1.233
+++ tilespec.c 10 Feb 2005 03:49:50 -0000
@@ -2526,7 +2526,7 @@
int value = -1;
if (!pcorner->tile[i]) {
- value = known;
+ value = fogged;
} else {
switch (tile_get_known(pcorner->tile[i])) {
case TILE_KNOWN:
|
|