[Freeciv-Dev] (PR#2533) unification of move_unit_map_canvas
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
[rfalke - Wed Dec 18 19:07:36 2002]:
> On Wed, Dec 18, 2002 at 11:03:17AM -0800, Jason Short via RT wrote:
> > On Wed, 2002-12-18 at 05:01, Raimar Falke via RT wrote:
> > > On Tue, Dec 17, 2002 at 04:28:34PM -0800, Jason Short via RT
> wrote:
> > > > On Tue, 2002-12-17 at 14:19, Raimar Falke via RT wrote:
> > > > single_tile_pixmap_width/single_tile_pixmap_height are currently
> used as
> > > > the width and height of the single_tile_pixmap pixmap (which is
> a
> > > > secondary backing store used only for animations). But these
> are always
> > > > UNIT_TILE_WIDTH/UNIT_TILE_HEIGHT, so there's not much reason for
> their
> > > > existence.
> > >
> > > So I replace their usage in the patch with
> > > UNIT_TILE_WIDTH/UNIT_TILE_HEIGHT.
> >
> > This is confusing! They should either be used consistently or
> removed.
>
> Removed. Done with the patch (common code builds sprite of the unit)
> you outline in the previous mail
The attached patch removes single_tile_pixmap_width and
single_tile_pixmap_height from GTK and GTK-2.0 clients (where they are
replaced with UNIT_TILE_WIDTH/UNIT_TILE_HEIGHT) and the XAW client
(where they were unused anyway).
This at least prevents the width/height from being used inconsistently.
Later we may be able to do more, like pre-assemble a single_tile sprite
depending on what we're animating.
jason
Index: client/gui-gtk/gui_main.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/gui_main.c,v
retrieving revision 1.124
diff -u -r1.124 gui_main.c
--- client/gui-gtk/gui_main.c 2003/01/01 11:51:33 1.124
+++ client/gui-gtk/gui_main.c 2003/01/16 19:26:57
@@ -85,8 +85,6 @@
GdkPixmap *single_tile_pixmap; /* this pixmap is used when
* moving units etc */
-int single_tile_pixmap_width;
-int single_tile_pixmap_height;
GtkWidget *toplevel;
GtkWidget *top_vbox;
@@ -975,11 +973,8 @@
gdk_draw_rectangle(overview_canvas_store, fill_bg_gc, TRUE, 0, 0,
overview_canvas_store_width,
overview_canvas_store_height);
- single_tile_pixmap_width = UNIT_TILE_WIDTH;
- single_tile_pixmap_height = UNIT_TILE_HEIGHT;
single_tile_pixmap = gdk_pixmap_new(root_window,
- single_tile_pixmap_width,
- single_tile_pixmap_height, -1);
+ UNIT_TILE_WIDTH, UNIT_TILE_HEIGHT, -1);
set_client_state(CLIENT_PRE_GAME_STATE);
Index: client/gui-gtk/gui_main.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/gui_main.h,v
retrieving revision 1.8
diff -u -r1.8 gui_main.h
--- client/gui-gtk/gui_main.h 2002/11/30 20:04:19 1.8
+++ client/gui-gtk/gui_main.h 2003/01/16 19:26:57
@@ -37,8 +37,6 @@
extern int overview_canvas_store_width;
extern int overview_canvas_store_height;
extern GdkPixmap * single_tile_pixmap;
-extern int single_tile_pixmap_width;
-extern int single_tile_pixmap_height;
extern GtkText * main_message_area;
extern GtkWidget * text_scrollbar;
extern GtkWidget * toplevel;
Index: client/gui-gtk/mapview.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/mapview.c,v
retrieving revision 1.148
diff -u -r1.148 mapview.c
--- client/gui-gtk/mapview.c 2003/01/11 02:49:09 1.148
+++ client/gui-gtk/mapview.c 2003/01/16 19:26:58
@@ -1954,9 +1954,6 @@
/* single_tile is originally allocated in gui_main.c. */
gdk_pixmap_unref(single_tile_pixmap);
- single_tile_pixmap_width = UNIT_TILE_WIDTH;
- single_tile_pixmap_height = UNIT_TILE_HEIGHT;
single_tile_pixmap = gdk_pixmap_new(root_window,
- single_tile_pixmap_width,
- single_tile_pixmap_height, -1);
+ UNIT_TILE_WIDTH, UNIT_TILE_HEIGHT, -1);
}
Index: client/gui-gtk-2.0/gui_main.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/gui_main.c,v
retrieving revision 1.37
diff -u -r1.37 gui_main.c
--- client/gui-gtk-2.0/gui_main.c 2003/01/01 21:16:44 1.37
+++ client/gui-gtk-2.0/gui_main.c 2003/01/16 19:26:59
@@ -85,8 +85,6 @@
GdkPixmap *single_tile_pixmap; /* this pixmap is used when
* moving units etc */
-int single_tile_pixmap_width;
-int single_tile_pixmap_height;
GtkWidget *toplevel;
GtkWidget *top_vbox;
@@ -1075,11 +1073,8 @@
gdk_draw_rectangle(overview_canvas_store, fill_bg_gc, TRUE, 0, 0,
overview_canvas_store_width,
overview_canvas_store_height);
- single_tile_pixmap_width = UNIT_TILE_WIDTH;
- single_tile_pixmap_height = UNIT_TILE_HEIGHT;
single_tile_pixmap = gdk_pixmap_new(root_window,
- single_tile_pixmap_width,
- single_tile_pixmap_height, -1);
+ UNIT_TILE_WIDTH, UNIT_TILE_HEIGHT, -1);
set_client_state(CLIENT_PRE_GAME_STATE);
Index: client/gui-gtk-2.0/gui_main.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/gui_main.h,v
retrieving revision 1.4
diff -u -r1.4 gui_main.h
--- client/gui-gtk-2.0/gui_main.h 2002/11/30 20:06:49 1.4
+++ client/gui-gtk-2.0/gui_main.h 2003/01/16 19:26:59
@@ -41,8 +41,6 @@
extern int overview_canvas_store_width;
extern int overview_canvas_store_height;
extern GdkPixmap * single_tile_pixmap;
-extern int single_tile_pixmap_width;
-extern int single_tile_pixmap_height;
extern GtkTextView * main_message_area;
extern GtkWidget * text_scrollbar;
extern GtkWidget * toplevel;
Index: client/gui-gtk-2.0/mapview.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/mapview.c,v
retrieving revision 1.36
diff -u -r1.36 mapview.c
--- client/gui-gtk-2.0/mapview.c 2003/01/11 02:49:09 1.36
+++ client/gui-gtk-2.0/mapview.c 2003/01/16 19:27:00
@@ -2027,9 +2027,6 @@
/* single_tile is originally allocated in gui_main.c. */
gdk_pixmap_unref(single_tile_pixmap);
- single_tile_pixmap_width = UNIT_TILE_WIDTH;
- single_tile_pixmap_height = UNIT_TILE_HEIGHT;
single_tile_pixmap = gdk_pixmap_new(root_window,
- single_tile_pixmap_width,
- single_tile_pixmap_height, -1);
+ UNIT_TILE_WIDTH, UNIT_TILE_HEIGHT, -1);
}
Index: client/gui-xaw/gui_main.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-xaw/gui_main.c,v
retrieving revision 1.75
diff -u -r1.75 gui_main.c
--- client/gui-xaw/gui_main.c 2002/12/16 05:35:31 1.75
+++ client/gui-xaw/gui_main.c 2003/01/16 19:27:01
@@ -200,7 +200,6 @@
/* this pixmap is used when moving units etc */
Pixmap single_tile_pixmap;
-int single_tile_pixmap_width, single_tile_pixmap_height;
XtInputId x_input_id;
XtIntervalId x_interval_id;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Freeciv-Dev] (PR#2533) unification of move_unit_map_canvas,
Jason Short via RT <=
|
|