Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2003:
[Freeciv-Dev] (PR#3782) Small clean of flush region callculation in upda
Home

[Freeciv-Dev] (PR#3782) Small clean of flush region callculation in upda

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients:;
Subject: [Freeciv-Dev] (PR#3782) Small clean of flush region callculation in update_mapcanvas(...)
From: "Rafa³ Bursig" <bursig@xxxxxxxxx>
Date: Mon, 24 Mar 2003 09:21:37 -0800
Reply-to: rt@xxxxxxxxxxxxxx

Hi

This code check if we refresh only one tile and make simple dirty 
region calculation in update_mapcanvas(...)

Rafal

----------------------------------------------------------------------
Kochasz pilke nozna? Zagraj i wygraj! >>> http://link.interia.pl/f16fa 

diff -u -r freeciv/client/mapview_common.c fc2/client/mapview_common.c
--- freeciv/client/mapview_common.c     Wed Mar 19 14:58:12 2003
+++ fc2/client/mapview_common.c Sun Mar 23 14:37:53 2003
@@ -683,7 +683,7 @@
     /* Lastly draw our changes to the screen. */
     /* top left corner */
     get_canvas_xy(x, y, &canvas_start_x, &canvas_start_y);
-
+  if(height > 1 || width > 1) {
     /* top left corner in isometric view */
     canvas_start_x -= height * NORMAL_TILE_WIDTH / 2;
 
@@ -700,6 +700,11 @@
               (height + width) * NORMAL_TILE_WIDTH / 2,
               (height + width) * NORMAL_TILE_HEIGHT / 2
               + NORMAL_TILE_HEIGHT / 2);
+  } else {
+    canvas_start_y -= NORMAL_TILE_HEIGHT / 2;
+    dirty_rect(canvas_start_x, canvas_start_y,
+                               UNIT_TILE_WIDTH, UNIT_TILE_HEIGHT);
+  }
   } else {
     /* not isometric */
     int map_x, map_y;

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