Author: cazfi
Date: Sun Oct 25 19:24:14 2015
New Revision: 30216

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

See patch #6470

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

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

Modified: branches/S2_6/client/editor.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/editor.c?rev=30216&r1=30215&r2=30216&view=diff
==============================================================================
--- branches/S2_6/client/editor.c       (original)
+++ branches/S2_6/client/editor.c       Sun Oct 25 19:24:14 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: branches/S2_6/client/gui-gtk-3.0/gui_main.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-gtk-3.0/gui_main.c?rev=30216&r1=30215&r2=30216&view=diff
==============================================================================
--- branches/S2_6/client/gui-gtk-3.0/gui_main.c (original)
+++ branches/S2_6/client/gui-gtk-3.0/gui_main.c Sun Oct 25 19:24:14 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: branches/S2_6/client/gui-gtk-3.0/mapview.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-gtk-3.0/mapview.c?rev=30216&r1=30215&r2=30216&view=diff
==============================================================================
--- branches/S2_6/client/gui-gtk-3.0/mapview.c  (original)
+++ branches/S2_6/client/gui-gtk-3.0/mapview.c  Sun Oct 25 19:24:14 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: branches/S2_6/client/mapview_common.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/mapview_common.c?rev=30216&r1=30215&r2=30216&view=diff
==============================================================================
--- branches/S2_6/client/mapview_common.c       (original)
+++ branches/S2_6/client/mapview_common.c       Sun Oct 25 19:24:14 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,
@@ -3168,16 +3168,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: branches/S2_6/client/mapview_common.h
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/mapview_common.h?rev=30216&r1=30215&r2=30216&view=diff
==============================================================================
--- branches/S2_6/client/mapview_common.h       (original)
+++ branches/S2_6/client/mapview_common.h       Sun Oct 25 19:24:14 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: branches/S2_6/client/overview_common.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/overview_common.c?rev=30216&r1=30215&r2=30216&view=diff
==============================================================================
--- branches/S2_6/client/overview_common.c      (original)
+++ branches/S2_6/client/overview_common.c      Sun Oct 25 19:24:14 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: branches/S2_6/client/zoom.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/zoom.c?rev=30216&view=auto
==============================================================================
--- branches/S2_6/client/zoom.c (added)
+++ branches/S2_6/client/zoom.c Sun Oct 25 19:24:14 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: branches/S2_6/client/zoom.h
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/zoom.h?rev=30216&view=auto
==============================================================================
--- branches/S2_6/client/zoom.h (added)
+++ branches/S2_6/client/zoom.h Sun Oct 25 19:24:14 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