[Freeciv-Dev] (PR#3485) move map_view_x0 into the mapview struct
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
This patch removes the map_view_x0/map_view_y0 variables from the GUI,
and uses mapview_canvas.map_x0/map_y0 instead.
To avoid a huge diff, I just use wrapper macros like:
#define map_view_x0 mapview_canvas.map_x0
in the GUIs.
There is no MUI support; gui-mui is a problem here since it doesn't
track these varables as variables, and I don't know enough about it to
change this.
Obviously, this patch is part of a series that should unify all of the
mapview variable. Once that is done the accessor functions can be
removed and the common code can just deal with the variables directly.
This can be done in a series of 4 patches, of which this is the first.
jason
? client/automation.c
? client/automation.h
? client/scratch
? client/gui-gtk/annotate
? client/gui-gtk-2.0/annotate
? client/gui-sdl/diff
Index: client/mapview_common.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/mapview_common.h,v
retrieving revision 1.22
diff -u -r1.22 mapview_common.h
--- client/mapview_common.h 2003/02/20 23:14:32 1.22
+++ client/mapview_common.h 2003/02/21 00:39:01
@@ -23,8 +23,8 @@
struct canvas_store; /* opaque type, real type is gui-dep */
struct canvas {
-#if 0 /* These values are still in the GUI. */
int map_x0, map_y0;
+#if 0 /* These values are still in the GUI. */
int width, height;
int tile_width, tile_height;
#endif
Index: client/gui-gtk/mapview.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/mapview.c,v
retrieving revision 1.157
diff -u -r1.157 mapview.c
--- client/gui-gtk/mapview.c 2003/02/20 23:14:33 1.157
+++ client/gui-gtk/mapview.c 2003/02/21 00:39:01
@@ -50,9 +50,6 @@
#include "citydlg.h" /* For reset_city_dialogs() */
#include "mapview.h"
-/* contains the x0, y0 coordinates of the upper left corner block */
-int map_view_x0, map_view_y0;
-
static void pixmap_put_overlay_tile(GdkDrawable *pixmap,
int canvas_x, int canvas_y,
struct Sprite *ssprite);
Index: client/gui-gtk/mapview.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/mapview.h,v
retrieving revision 1.16
diff -u -r1.16 mapview.h
--- client/gui-gtk/mapview.h 2003/01/28 00:28:05 1.16
+++ client/gui-gtk/mapview.h 2003/02/21 00:39:02
@@ -52,7 +52,8 @@
void scrollbar_jump_callback(GtkAdjustment *adj, gpointer hscrollbar);
void update_map_canvas_scrollbars_size(void);
-/* contains the x0, y0 coordinates of the upper left corner block */
-extern int map_view_x0, map_view_y0;
+/* These values are stored in the mapview_canvas struct now. */
+#define map_view_x0 mapview_canvas.map_x0
+#define map_view_y0 mapview_canvas.map_y0
#endif /* FC__MAPVIEW_H */
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.45
diff -u -r1.45 mapview.c
--- client/gui-gtk-2.0/mapview.c 2003/02/20 23:14:33 1.45
+++ client/gui-gtk-2.0/mapview.c 2003/02/21 00:39:02
@@ -51,9 +51,6 @@
#include "citydlg.h" /* For reset_city_dialogs() */
#include "mapview.h"
-/* contains the x0, y0 coordinates of the upper left corner block */
-int map_view_x0, map_view_y0;
-
static void pixmap_put_overlay_tile(GdkDrawable *pixmap,
int canvas_x, int canvas_y,
struct Sprite *ssprite);
Index: client/gui-gtk-2.0/mapview.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/mapview.h,v
retrieving revision 1.7
diff -u -r1.7 mapview.h
--- client/gui-gtk-2.0/mapview.h 2003/01/28 00:18:16 1.7
+++ client/gui-gtk-2.0/mapview.h 2003/02/21 00:39:02
@@ -54,7 +54,8 @@
void scrollbar_jump_callback(GtkAdjustment *adj, gpointer hscrollbar);
void update_map_canvas_scrollbars_size(void);
-/* contains the x0, y0 coordinates of the upper left corner block */
-extern int map_view_x0, map_view_y0;
+/* These values are stored in the mapview_canvas struct now. */
+#define map_view_x0 mapview_canvas.map_x0
+#define map_view_y0 mapview_canvas.map_y0
#endif /* FC__MAPVIEW_H */
Index: client/gui-sdl/mapview.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-sdl/mapview.c,v
retrieving revision 1.22
diff -u -r1.22 mapview.c
--- client/gui-sdl/mapview.c 2003/02/19 23:03:39 1.22
+++ client/gui-sdl/mapview.c 2003/02/21 00:39:04
@@ -79,9 +79,9 @@
extern char *pDataPath;
-/* contains the x0, y0 , coordinates of the upper
- left corner view block */
-static int map_view_x0, map_view_y0;
+/* These values are stored in the mapview_canvas struct now. */
+#define map_view_x0 mapview_canvas.map_x0
+#define map_view_y0 mapview_canvas.map_y0
static Uint8 Mini_map_cell_w, Mini_map_cell_h;
Index: client/gui-win32/mapview.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-win32/mapview.c,v
retrieving revision 1.57
diff -u -r1.57 mapview.c
--- client/gui-win32/mapview.c 2003/02/20 23:14:33 1.57
+++ client/gui-win32/mapview.c 2003/02/21 00:39:04
@@ -60,8 +60,6 @@
extern HBITMAP BITMAP2HBITMAP(BITMAP *bmp);
extern void do_mainwin_layout();
-int map_view_x;
-int map_view_y;
int map_view_width;
int map_view_height;
Index: client/gui-win32/mapview.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-win32/mapview.h,v
retrieving revision 1.5
diff -u -r1.5 mapview.h
--- client/gui-win32/mapview.h 2003/01/23 21:39:32 1.5
+++ client/gui-win32/mapview.h 2003/02/21 00:39:04
@@ -31,8 +31,11 @@
void overview_expose(HDC hdc);
void map_handle_hscroll(int pos);
void map_handle_vscroll(int pos);
-extern int map_view_x;
-extern int map_view_y;
extern int map_view_width;
extern int map_view_height;
+
+/* These values are stored in the mapview_canvas struct now. */
+#define map_view_x mapview_canvas.map_x0
+#define map_view_y mapview_canvas.map_y0
+
#endif /* FC__MAPVIEW_H */
Index: client/gui-xaw/mapview.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-xaw/mapview.c,v
retrieving revision 1.124
diff -u -r1.124 mapview.c
--- client/gui-xaw/mapview.c 2003/02/20 23:14:33 1.124
+++ client/gui-xaw/mapview.c 2003/02/21 00:39:05
@@ -52,9 +52,6 @@
#include "mapview.h"
-/* contains the x0, y0 coordinates of the upper left corner block */
-int map_view_x0, map_view_y0;
-
static void pixmap_put_overlay_tile(Pixmap pixmap, int x, int y,
struct Sprite *ssprite);
static void put_line(Pixmap pm, int x, int y, int dir);
Index: client/gui-xaw/mapview.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-xaw/mapview.h,v
retrieving revision 1.12
diff -u -r1.12 mapview.h
--- client/gui-xaw/mapview.h 2002/12/13 19:15:13 1.12
+++ client/gui-xaw/mapview.h 2003/02/21 00:39:05
@@ -52,7 +52,8 @@
void scrollbar_scroll_callback(Widget w, XtPointer client_data,
XtPointer position_ptr);
-extern int map_view_x0;
-extern int map_view_y0;
+/* These values are stored in the mapview_canvas struct now. */
+#define map_view_x0 mapview_canvas.map_x0
+#define map_view_y0 mapview_canvas.map_y0
#endif /* FC__MAPVIEW_H */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Freeciv-Dev] (PR#3485) move map_view_x0 into the mapview struct,
Jason Short <=
|
|