Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2001:
[Freeciv-Dev] removing map_adjust_* uses from gui-win32
Home

[Freeciv-Dev] removing map_adjust_* uses from gui-win32

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] removing map_adjust_* uses from gui-win32
From: Jason Short <vze2zq63@xxxxxxxxxxx>
Date: Mon, 17 Dec 2001 16:37:26 -0500
Reply-to: jdorje@xxxxxxxxxxxx

The attached patch is a part of the larger map_adjust_* removal patch. This one just removes the gui-win32 uses of map_adjust_x/map_adjust_y.

Andreas, please apply if possible.  It's quite short.

jason

Index: client/gui-win32/mapview.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-win32/mapview.c,v
retrieving revision 1.18
diff -u -r1.18 mapview.c
--- client/gui-win32/mapview.c  2001/12/13 17:17:34     1.18
+++ client/gui-win32/mapview.c  2001/12/17 21:18:57
@@ -676,16 +676,17 @@
   mapstoredc=CreateCompatibleDC(NULL);
   old=SelectObject(mapstoredc,mapstorebitmap);
   if (!is_isometric) {
-    int x_itr, y_itr;
+    int map_x, map_y;
     int canvas_x,canvas_y;
     int old_x;
     old_x=-1;
-    for(y_itr=y; y_itr<y+height; y_itr++)
-      for(x_itr=x; x_itr<x+width; x_itr++) {
-       int map_x = map_adjust_x(x_itr);
-       int map_y = y_itr; /* not adjusted;, we want to draw black tiles */
-       get_canvas_xy(map_x,map_y,&canvas_x,&canvas_y);
-       if (tile_visible_mapcanvas(map_x,map_y))
+    for(map_y=y; map_y<y+height; map_y++)
+      for(map_x=x; map_x<x+width; map_x++) {
+       /*
+        * We don't normalize until later because we want to draw
+        * black tiles for unreal positions.
+        */
+       if (get_canvas_xy(map_x,map_y,&canvas_x,&canvas_y))
          {
            old_x=map_x;
            pixmap_put_tile(mapstoredc, map_x, map_y,
@@ -1008,7 +1009,7 @@
   HDC mapstoredc;
   HBITMAP old;
   static struct timer *anim_timer = NULL; 
-  int dest_x, dest_y;
+  int dest_x, dest_y, is_real;
   
   
   /* only works for adjacent-square moves */
@@ -1022,8 +1023,11 @@
     update_unit_info_label(punit);
   }
   
-  dest_x = map_adjust_x(x0+dx);
-  dest_y = map_adjust_y(y0+dy);
+  dest_x = x0 + dx;
+  dest_y = y0 + dy;
+  is_real = normalize_map_pos(&dest_x, &dest_y);
+  assert(is_real);
+
   mapstoredc=CreateCompatibleDC(NULL);
   old=SelectObject(mapstoredc,mapstorebitmap);
   if (player_can_see_unit(game.player_ptr, punit) &&

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] removing map_adjust_* uses from gui-win32, Jason Short <=