Author: cazfi
Date: Sun Oct 25 19:24:03 2015
New Revision: 30215

URL: http://svn.gna.org/viewcvs/freeciv?rev=30215&view=rev
Log:
Moved set_map_zoom() to a new zoom.[ch] module.

See patch #6470

Added:
    trunk/client/zoom.c
    trunk/client/zoom.h
Modified:
    trunk/client/Makefile.am
    trunk/client/editor.c
    trunk/client/gui-gtk-3.0/gui_main.c
    trunk/client/gui-gtk-3.0/mapview.c
    trunk/client/mapview_common.c
    trunk/client/mapview_common.h
    trunk/client/overview_common.c

Modified: trunk/client/Makefile.am
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/Makefile.am?rev=30215&r1=30214&r2=30215&view=diff
==============================================================================
--- trunk/client/Makefile.am    (original)
+++ trunk/client/Makefile.am    Sun Oct 25 19:24:03 2015
@@ -148,6 +148,8 @@
        update_queue.h  \
        voteinfo.c      \
        voteinfo.h      \
+       zoom.c          \
+       zoom.h          \
        audio.c         \
        audio.h         \
        audio_none.c    \

Modified: trunk/client/editor.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/editor.c?rev=30215&r1=30214&r2=30215&view=diff
==============================================================================
--- trunk/client/editor.c       (original)
+++ trunk/client/editor.c       Sun Oct 25 19:24:03 2015
@@ -36,8 +36,8 @@
 #include "control.h"
 #include "editor.h"
 #include "mapctrl_common.h"
-#include "mapview_common.h"
 #include "tilespec.h"
+#include "zoom.h"
 
 /* client/include */
 #include "editgui_g.h"

Modified: trunk/client/gui-gtk-3.0/gui_main.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-gtk-3.0/gui_main.c?rev=30215&r1=30214&r2=30215&view=diff
==============================================================================
--- trunk/client/gui-gtk-3.0/gui_main.c (original)
+++ trunk/client/gui-gtk-3.0/gui_main.c Sun Oct 25 19:24:03 2015
@@ -67,6 +67,7 @@
 #include "options.h"
 #include "text.h"
 #include "tilespec.h"
+#include "zoom.h"
 
 /* client/gui-gtk-3.0 */
 #include "chatline.h"

Modified: trunk/client/gui-gtk-3.0/mapview.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-gtk-3.0/mapview.c?rev=30215&r1=30214&r2=30215&view=diff
==============================================================================
--- trunk/client/gui-gtk-3.0/mapview.c  (original)
+++ trunk/client/gui-gtk-3.0/mapview.c  Sun Oct 25 19:24:03 2015
@@ -48,6 +48,7 @@
 #include "overview_common.h"
 #include "tilespec.h"
 #include "text.h"
+#include "zoom.h"
 
 /* client/gui-gtk-3.0 */
 #include "citydlg.h" /* For reset_city_dialogs() */

Modified: trunk/client/mapview_common.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/mapview_common.c?rev=30215&r1=30214&r2=30215&view=diff
==============================================================================
--- trunk/client/mapview_common.c       (original)
+++ trunk/client/mapview_common.c       Sun Oct 25 19:24:03 2015
@@ -44,6 +44,7 @@
 #include "citydlg_common.h"
 #include "overview_common.h"
 #include "tilespec.h"
+#include "zoom.h"
 
 #include "mapview_common.h"
 
@@ -73,7 +74,6 @@
 struct view mapview;
 bool can_slide = TRUE;
 
-float map_zoom = 1.0;
 struct tile *center_tile = NULL;
 
 static void base_canvas_to_map_pos(int *map_x, int *map_y,
@@ -3160,16 +3160,6 @@
 }
 
 /**************************************************************************
-  Set map zoom level.
-**************************************************************************/
-void set_map_zoom(float new_zoom)
-{
-  map_zoom = new_zoom;
-
-  map_canvas_resized(mapview.width, mapview.height);
-}
-
-/**************************************************************************
   Sets up data for the mapview and overview.
 **************************************************************************/
 void init_mapcanvas_and_overview(void)

Modified: trunk/client/mapview_common.h
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/mapview_common.h?rev=30215&r1=30214&r2=30215&view=diff
==============================================================================
--- trunk/client/mapview_common.h       (original)
+++ trunk/client/mapview_common.h       Sun Oct 25 19:24:03 2015
@@ -65,8 +65,6 @@
 /* HACK: Callers can set this to FALSE to disable sliding.  It should be
  * reenabled afterwards. */
 extern bool can_slide;
-
-extern float map_zoom;
 
 #define BORDER_WIDTH 2
 #define GOTO_WIDTH 2
@@ -355,8 +353,6 @@
 void link_mark_add_new(enum text_link_type type, int id);
 void link_mark_restore(enum text_link_type type, int id);
 
-void set_map_zoom(float new_zoom);
-
 bool tileset_map_topo_compatible(int topology_id, struct tileset *tset);
 
 #ifdef __cplusplus

Modified: trunk/client/overview_common.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/overview_common.c?rev=30215&r1=30214&r2=30215&view=diff
==============================================================================
--- trunk/client/overview_common.c      (original)
+++ trunk/client/overview_common.c      Sun Oct 25 19:24:03 2015
@@ -24,10 +24,11 @@
 #include "client_main.h" /* can_client_change_view() */
 #include "climap.h"
 #include "control.h"
+#include "mapview_g.h"
 #include "options.h"
+#include "zoom.h"
+
 #include "overview_common.h"
-
-#include "mapview_g.h"
 
 int OVERVIEW_TILE_SIZE = 2;
 #if 0

Added: trunk/client/zoom.c
URL: http://svn.gna.org/viewcvs/freeciv/trunk/client/zoom.c?rev=30215&view=auto
==============================================================================
--- trunk/client/zoom.c (added)
+++ trunk/client/zoom.c Sun Oct 25 19:24:03 2015
@@ -0,0 +1,34 @@
+/********************************************************************** 
+ Freeciv - Copyright (C) 2005 - The Freeciv Team
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+***********************************************************************/
+
+#ifdef HAVE_CONFIG_H
+#include <fc_config.h>
+#endif
+
+/* client */
+#include "mapview_common.h"
+
+#include "zoom.h"
+
+
+float map_zoom = 1.0;
+
+/**************************************************************************
+  Set map zoom level.
+**************************************************************************/
+void set_map_zoom(float new_zoom)
+{
+  map_zoom = new_zoom;
+
+  map_canvas_resized(mapview.width, mapview.height);
+}

Added: trunk/client/zoom.h
URL: http://svn.gna.org/viewcvs/freeciv/trunk/client/zoom.h?rev=30215&view=auto
==============================================================================
--- trunk/client/zoom.h (added)
+++ trunk/client/zoom.h Sun Oct 25 19:24:03 2015
@@ -0,0 +1,28 @@
+/********************************************************************** 
+ Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+***********************************************************************/
+#ifndef FC__ZOOM_H
+#define FC__ZOOM_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+void set_map_zoom(float new_zoom);
+
+extern float map_zoom;
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* FC__ZOOM_H */


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to