[Freeciv-Dev] Re: (PR#2982) iso-view FOW drawing bug
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Jason Short wrote:
> [jdorje - Thu Oct 2 22:11:21 2003]:
>
>
>>[jdorje - Mon Feb 3 07:18:41 2003]:
>>
>>
>>>Sometimes when drawing is done in iso-view, the fog-of-war is not
>
> updated.
>
>>>Typically this occurrs when a unit enters a fogged area. Clearly the
>>>area is no longer fogged, but this is not immediately updated. Instead
>>>the unit itself is drawn. This means parts of the surrounding tiles are
>>>drawn, and these are unfogged. The end result is that the area is still
>>>fogged, but the box around the unit is unfogged.
>>>
>>>This is difficult to reproduce. Occasionally it happens with the GTK
>>>client at the very beginning of a game. With a lot of buffering of the
>>>drawing, it seems it can happen all the time.
>>
>>Now since there are no spurious redraws in center_tile_mapcanvas, it
>>always happens. The redraw needs to be done somewhere else.
>
>
> The initial tiles are sent while the client is still in the
> CLIENT_WAITING_FOR_GAME_START_STATE state. Thus there is no map update
> for them.
You could argue this is a server bug, but the server code looks pretty
logical. You want to send out as much data as possible before changing
the state, so that a lot of separate updates aren't needed.
This patch changes the client to handle it.
jason
Index: client/packhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/packhand.c,v
retrieving revision 1.334
diff -u -r1.334 packhand.c
--- client/packhand.c 2003/10/07 18:55:08 1.334
+++ client/packhand.c 2003/10/08 19:32:44
@@ -321,6 +321,8 @@
**************************************************************************/
void handle_game_state(struct packet_generic_integer *packet)
{
+ bool changed = (get_client_state() != packet->value);
+
if (get_client_state() == CLIENT_SELECT_RACE_STATE
&& packet->value == CLIENT_GAME_RUNNING_STATE
&& game.player_ptr->nation == NO_NATION_SELECTED) {
@@ -352,6 +354,10 @@
update_info_label();
update_unit_focus();
update_unit_info_label(NULL);
+ }
+
+ if (changed && can_client_change_view()) {
+ update_map_canvas_visible();
}
}
|
|