Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2003:
[Freeciv-Dev] (PR#2830) Redrawing unit after auto_center map
Home

[Freeciv-Dev] (PR#2830) Redrawing unit after auto_center map

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients:;
Subject: [Freeciv-Dev] (PR#2830) Redrawing unit after auto_center map
From: "Rafa³ Bursig via RT" <rt@xxxxxxxxxxxxxx>
Date: Wed, 15 Jan 2003 04:47:45 -0800
Reply-to: rt@xxxxxxxxxxxxxx

Hi

This is my old patch that make obsolete redrawing unit after autocenter 
( redraw full ) map.

Rafal


----------------------------------------------------------------------
Poczta nowych mozliwosci >>> http://link.interia.pl/f16bc 

--- control.h   11 Apr 2002 21:49:34 -0000      1.3
+++ control.h   8 Nov 2002 18:57:47 -0000
@@ -81,7 +81,7 @@
 
 void wakeup_sentried_units(int x, int y);
 
-void auto_center_on_focus_unit(void);
+bool auto_center_on_focus_unit(void);
 void advance_unit_focus(void);
 struct unit *get_unit_in_focus(void);
 void set_unit_focus(struct unit *punit);
--- control.c   28 Aug 2002 10:00:38 -0000      1.9
+++ control.c   8 Nov 2002 18:56:00 -0000
@@ -87,12 +87,18 @@
 
 /**************************************************************************
 Center on the focus unit, if off-screen and auto_center_on_unit is true.
+Return FALSE if make auto_center.
 **************************************************************************/
-void auto_center_on_focus_unit(void)
+bool auto_center_on_focus_unit(void)
 {
   if (punit_focus && auto_center_on_unit &&
       !tile_visible_and_not_on_border_mapcanvas(punit_focus->x, 
punit_focus->y))
+  {
     center_tile_mapcanvas(punit_focus->x, punit_focus->y);
+    return FALSE;
+  }
+  
+  return TRUE;
 }
 
 /**************************************************************************
@@ -108,10 +114,11 @@
   punit_focus=punit;
 
   if(punit) {
-    auto_center_on_focus_unit();
-
     punit->focus_status=FOCUS_AVAIL;
-    refresh_tile_mapcanvas(punit->x, punit->y, TRUE);
+    if ( auto_center_on_focus_unit() )
+    {
+       refresh_tile_mapcanvas(punit->x, punit->y, TRUE);
+    }
   }
   
   /* avoid the old focus unit disappearing: */

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#2830) Redrawing unit after auto_center map, Rafa³ Bursig via RT <=