[Freeciv-Dev] (PR#12947) move tile_get_known into tile.h
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://bugs.freeciv.org/Ticket/Display.html?id=12947 >
This patch:
* renames (client) tile_get_known as client_tile_get_known.
* moves map_get_known into tile.[ch].
* renames map_get_known as tile_get_known.
A better name for the client function would be good. Or maybe it can
just be removed. The common function should certainly be called
tile_get_known (like all the other tile accessors).
-jason
Index: client/climap.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/climap.c,v
retrieving revision 1.8
diff -u -r1.8 climap.c
--- client/climap.c 30 Apr 2005 20:59:49 -0000 1.8
+++ client/climap.c 1 May 2005 00:36:13 -0000
@@ -32,9 +32,9 @@
uses the stock tilespec.c file, this function serves as a wrapper.
*************************************************************************/
-enum known_type tile_get_known(const struct tile *ptile)
+enum known_type client_tile_get_known(const struct tile *ptile)
{
- return map_get_known(ptile, game.player_ptr);
+ return tile_get_known(ptile, game.player_ptr);
}
/**************************************************************************
Index: client/climap.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/climap.h,v
retrieving revision 1.4
diff -u -r1.4 climap.h
--- client/climap.h 29 Sep 2004 02:24:19 -0000 1.4
+++ client/climap.h 1 May 2005 00:36:13 -0000
@@ -19,7 +19,7 @@
#define map_exists() (map.xsize != 0)
-enum known_type tile_get_known(const struct tile *ptile);
+enum known_type client_tile_get_known(const struct tile *ptile);
enum direction8 gui_to_map_dir(enum direction8 gui_dir);
enum direction8 map_to_gui_dir(enum direction8 map_dir);
Index: client/climisc.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/climisc.c,v
retrieving revision 1.163
diff -u -r1.163 climisc.c
--- client/climisc.c 30 Apr 2005 20:59:49 -0000 1.163
+++ client/climisc.c 1 May 2005 00:36:13 -0000
@@ -425,7 +425,7 @@
* a misuse of map.xsize and map.ysize (which are native dimensions),
* it should give a sufficiently large radius. */
iterate_outward(ctile, map.xsize + map.ysize, ptile) {
- if (tile_get_known(ptile) != TILE_UNKNOWN) {
+ if (client_tile_get_known(ptile) != TILE_UNKNOWN) {
ctile = ptile;
break;
}
Index: client/goto.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/goto.c,v
retrieving revision 1.84
diff -u -r1.84 goto.c
--- client/goto.c 13 Apr 2005 18:41:11 -0000 1.84
+++ client/goto.c 1 May 2005 00:36:14 -0000
@@ -469,7 +469,7 @@
int activity_time, move_cost, moves_left;
int total_cost, total_extra;
- if (map_get_known(dest_tile, param->owner) == TILE_UNKNOWN) {
+ if (tile_get_known(dest_tile, param->owner) == TILE_UNKNOWN) {
return -1;
}
@@ -569,7 +569,7 @@
{
int activity_time, move_cost, moves_left, total_cost;
- if (map_get_known(dest_tile, param->owner) == TILE_UNKNOWN) {
+ if (tile_get_known(dest_tile, param->owner) == TILE_UNKNOWN) {
return -1;
}
Index: client/mapview_common.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/mapview_common.c,v
retrieving revision 1.231
diff -u -r1.231 mapview_common.c
--- client/mapview_common.c 25 Apr 2005 06:19:31 -0000 1.231
+++ client/mapview_common.c 1 May 2005 00:36:14 -0000
@@ -925,7 +925,7 @@
ptile, pedge, pcorner,
punit, pcity, citymode);
bool fog = (ptile && draw_fog_of_war
- && tile_get_known(ptile) == TILE_KNOWN_FOGGED);
+ && client_tile_get_known(ptile) == TILE_KNOWN_FOGGED);
/*** Draw terrain and specials ***/
put_drawn_sprites(pcanvas, canvas_x, canvas_y, count, tile_sprs, fog);
@@ -1092,7 +1092,7 @@
struct tile *ptile, int canvas_x, int canvas_y,
const struct city *citymode)
{
- if (tile_get_known(ptile) != TILE_UNKNOWN) {
+ if (client_tile_get_known(ptile) != TILE_UNKNOWN) {
put_one_element(pcanvas, layer, ptile, NULL, NULL,
get_drawable_unit(tileset, ptile, citymode),
ptile->city, canvas_x, canvas_y, citymode);
Index: client/overview_common.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/overview_common.c,v
retrieving revision 1.5
diff -u -r1.5 overview_common.c
--- client/overview_common.c 24 Apr 2005 23:10:32 -0000 1.5
+++ client/overview_common.c 1 May 2005 00:36:14 -0000
@@ -105,7 +105,7 @@
struct unit *punit;
struct city *pcity;
- if (tile_get_known(ptile) == TILE_UNKNOWN) {
+ if (client_tile_get_known(ptile) == TILE_UNKNOWN) {
return COLOR_STD_BLACK;
} else if ((pcity = tile_get_city(ptile))) {
if (pcity->owner == game.player_idx) {
@@ -120,13 +120,13 @@
return COLOR_STD_RED;
}
} else if (is_ocean(ptile->terrain)) {
- if (tile_get_known(ptile) == TILE_KNOWN_FOGGED && draw_fog_of_war) {
+ if (client_tile_get_known(ptile) == TILE_KNOWN_FOGGED && draw_fog_of_war) {
return COLOR_STD_RACE4;
} else {
return COLOR_STD_OCEAN;
}
} else {
- if (tile_get_known(ptile) == TILE_KNOWN_FOGGED && draw_fog_of_war) {
+ if (client_tile_get_known(ptile) == TILE_KNOWN_FOGGED && draw_fog_of_war) {
return COLOR_STD_BACKGROUND;
} else {
return COLOR_STD_GROUND;
Index: client/packhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/packhand.c,v
retrieving revision 1.497
diff -u -r1.497 packhand.c
--- client/packhand.c 30 Apr 2005 20:59:49 -0000 1.497
+++ client/packhand.c 1 May 2005 00:36:15 -0000
@@ -1895,7 +1895,7 @@
void handle_tile_info(struct packet_tile_info *packet)
{
struct tile *ptile = map_pos_to_tile(packet->x, packet->y);
- enum known_type old_known = tile_get_known(ptile);
+ enum known_type old_known = client_tile_get_known(ptile);
bool tile_changed = FALSE;
bool known_changed = FALSE;
@@ -1957,7 +1957,7 @@
}
}
- if (tile_get_known(ptile) <= TILE_KNOWN_FOGGED
+ if (client_tile_get_known(ptile) <= TILE_KNOWN_FOGGED
&& old_known == TILE_KNOWN) {
/* This is an error. So first we log the error, then make an assertion.
* But for NDEBUG clients we fix the error. */
@@ -1990,9 +1990,9 @@
* A tile can only change if it was known before and is still
* known. In the other cases the tile is new or removed.
*/
- if (known_changed && tile_get_known(ptile) == TILE_KNOWN) {
+ if (known_changed && client_tile_get_known(ptile) == TILE_KNOWN) {
agents_tile_new(ptile);
- } else if (known_changed && tile_get_known(ptile) == TILE_KNOWN_FOGGED) {
+ } else if (known_changed && client_tile_get_known(ptile) ==
TILE_KNOWN_FOGGED) {
agents_tile_remove(ptile);
} else {
agents_tile_changed(ptile);
@@ -2002,7 +2002,7 @@
/* refresh tiles */
if (can_client_change_view()) {
/* the tile itself (including the necessary parts of adjacent tiles) */
- if (tile_changed || old_known != tile_get_known(ptile)) {
+ if (tile_changed || old_known != client_tile_get_known(ptile)) {
refresh_tile_mapcanvas(ptile, TRUE, FALSE);
}
}
Index: client/tilespec.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/tilespec.c,v
retrieving revision 1.299
diff -u -r1.299 tilespec.c
--- client/tilespec.c 30 Apr 2005 17:09:25 -0000 1.299
+++ client/tilespec.c 1 May 2005 00:36:16 -0000
@@ -48,7 +48,7 @@
#include "mapview_g.h" /* for update_map_canvas_visible */
#include "civclient.h" /* for get_client_state() */
-#include "climap.h" /* for tile_get_known() */
+#include "climap.h" /* for client_tile_get_known() */
#include "control.h" /* for fill_xxx */
#include "goto.h"
#include "options.h" /* for fill_xxx */
@@ -2710,7 +2710,7 @@
for (dir = 0; dir < 8; dir++) {
struct tile *tile1 = mapstep(ptile, dir);
- if (tile1 && tile_get_known(tile1) != TILE_UNKNOWN) {
+ if (tile1 && client_tile_get_known(tile1) != TILE_UNKNOWN) {
tspecial_near[dir] = tile_get_special(tile1);
ttype_near[dir] = tile_get_terrain(tile1);
} else {
@@ -3190,7 +3190,7 @@
int city_x, city_y;
const int NUM_CITY_COLORS = t->sprites.city.worked_tile_overlay.size;
- if (!ptile || tile_get_known(ptile) == TILE_UNKNOWN) {
+ if (!ptile || client_tile_get_known(ptile) == TILE_UNKNOWN) {
return 0;
}
@@ -3273,7 +3273,7 @@
Terrain_type_id other = ttype_near[DIR4_TO_DIR8[dir]];
if (!tile1
- || tile_get_known(tile1) == TILE_UNKNOWN
+ || client_tile_get_known(tile1) == TILE_UNKNOWN
|| other == ttype
|| !t->sprites.terrain[other]->is_blended) {
continue;
@@ -3299,7 +3299,7 @@
struct drawn_sprite *saved_sprs = sprs;
if (t->fogstyle == FOG_SPRITE && draw_fog_of_war
- && ptile && tile_get_known(ptile) == TILE_KNOWN_FOGGED) {
+ && ptile && client_tile_get_known(ptile) == TILE_KNOWN_FOGGED) {
/* With FOG_AUTO, fog is done this way. */
ADD_SPRITE_SIMPLE(t->sprites.tx.fog);
}
@@ -3314,7 +3314,7 @@
if (!pcorner->tile[i]) {
value = fogged;
} else {
- switch (tile_get_known(pcorner->tile[i])) {
+ switch (client_tile_get_known(pcorner->tile[i])) {
case TILE_KNOWN:
value = known;
break;
@@ -3486,7 +3486,7 @@
if (l == 0) {
#define UNKNOWN(dir) \
((adjc_tile = mapstep(ptile, (dir))) \
- && tile_get_known(adjc_tile) == TILE_UNKNOWN)
+ && client_tile_get_known(adjc_tile) == TILE_UNKNOWN)
switch (t->darkness_style) {
case DARKNESS_NONE:
@@ -3562,7 +3562,7 @@
struct player *powner = tile ? tile_get_owner(tile) : NULL;
int dummy_x, dummy_y;
- known[i] = tile && tile_get_known(tile) != TILE_UNKNOWN;
+ known[i] = tile && client_tile_get_known(tile) != TILE_UNKNOWN;
unit[i] = tile && pfocus && unit_flag(pfocus, F_CITIES)
&& city_can_be_built_here(pfocus->tile, pfocus)
&& base_map_to_city_map(&dummy_x, &dummy_y, pfocus->tile, tile);
@@ -3639,7 +3639,7 @@
}
}
}
- } else if (ptile && tile_get_known(ptile) != TILE_UNKNOWN) {
+ } else if (ptile && client_tile_get_known(ptile) != TILE_UNKNOWN) {
int cx, cy;
enum city_tile_type ttype;
struct city *dummy;
@@ -3763,7 +3763,7 @@
}
}
- if (ptile && tile_get_known(ptile) != TILE_UNKNOWN) {
+ if (ptile && client_tile_get_known(ptile) != TILE_UNKNOWN) {
build_tile_data(ptile,
&ttype, &tspecial, ttype_near, tspecial_near);
}
@@ -3789,7 +3789,7 @@
case LAYER_TERRAIN2:
/* Terrain and specials. These are drawn in multiple layers so that
* upper layers will cover layers underneath. */
- if (ptile && !solid_bg && tile_get_known(ptile) != TILE_UNKNOWN) {
+ if (ptile && !solid_bg && client_tile_get_known(ptile) != TILE_UNKNOWN) {
assert(MAX_NUM_LAYERS == 2);
sprs += fill_terrain_sprite_array(t, sprs,
(layer == LAYER_TERRAIN1) ? 0 : 1,
@@ -3798,7 +3798,7 @@
break;
case LAYER_WATER:
- if (ptile && tile_get_known(ptile) != TILE_UNKNOWN) {
+ if (ptile && client_tile_get_known(ptile) != TILE_UNKNOWN) {
if (is_ocean(ttype) && draw_terrain && !solid_bg) {
for (dir = 0; dir < 4; dir++) {
if (contains_special(tspecial_near[DIR4_TO_DIR8[dir]], S_RIVER)) {
@@ -3829,14 +3829,14 @@
break;
case LAYER_ROADS:
- if (ptile && tile_get_known(ptile) != TILE_UNKNOWN) {
+ if (ptile && client_tile_get_known(ptile) != TILE_UNKNOWN) {
sprs += fill_road_rail_sprite_array(t, sprs,
tspecial, tspecial_near, pcity);
}
break;
case LAYER_SPECIAL1:
- if (ptile && tile_get_known(ptile) != TILE_UNKNOWN) {
+ if (ptile && client_tile_get_known(ptile) != TILE_UNKNOWN) {
if (draw_specials) {
if (contains_special(tspecial, S_SPECIAL_1)) {
ADD_SPRITE_SIMPLE(t->sprites.terrain[ttype]->special[0]);
@@ -3891,7 +3891,7 @@
break;
case LAYER_SPECIAL2:
- if (ptile && tile_get_known(ptile) != TILE_UNKNOWN) {
+ if (ptile && client_tile_get_known(ptile) != TILE_UNKNOWN) {
if (draw_fortress_airbase && contains_special(tspecial, S_AIRBASE)) {
ADD_SPRITE_FULL(t->sprites.tx.airbase);
}
@@ -3940,7 +3940,7 @@
break;
case LAYER_SPECIAL3:
- if (ptile && tile_get_known(ptile) != TILE_UNKNOWN) {
+ if (ptile && client_tile_get_known(ptile) != TILE_UNKNOWN) {
if (t->is_isometric && draw_fortress_airbase
&& contains_special(tspecial, S_FORTRESS)) {
/* Draw fortress front in iso-view (non-iso view only has a fortress
Index: client/gui-gtk-2.0/mapctrl.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/mapctrl.c,v
retrieving revision 1.49
diff -u -r1.49 mapctrl.c
--- client/gui-gtk-2.0/mapctrl.c 31 Mar 2005 17:28:03 -0000 1.49
+++ client/gui-gtk-2.0/mapctrl.c 1 May 2005 00:36:16 -0000
@@ -119,7 +119,7 @@
struct unit *punit;
bool is_orders;
- if (tile_get_known(ptile) >= TILE_KNOWN_FOGGED) {
+ if (client_tile_get_known(ptile) >= TILE_KNOWN_FOGGED) {
p=gtk_window_new(GTK_WINDOW_POPUP);
gtk_widget_set_app_paintable(p, TRUE);
gtk_container_set_border_width(GTK_CONTAINER(p), 4);
Index: client/gui-mui/graphics.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-mui/graphics.c,v
retrieving revision 1.41
diff -u -r1.41 graphics.c
--- client/gui-mui/graphics.c 23 Apr 2005 17:40:25 -0000 1.41
+++ client/gui-mui/graphics.c 1 May 2005 00:36:16 -0000
@@ -895,7 +895,7 @@
int fill_bg;
struct player *pplayer;
- if (normalize_map_pos(&x, &y) && tile_get_known(x, y)) {
+ if (normalize_map_pos(&x, &y) && client_tile_get_known(x, y)) {
int count = fill_tile_sprite_array(tile_sprs, x, y, citymode, &fill_bg,
&pplayer);
int i = 0;
@@ -1244,7 +1244,7 @@
assert(is_real_map_pos(x, y));
normalize_map_pos(&x, &y);
- fog = tile_get_known(x, y) == TILE_KNOWN_FOGGED && draw_fog_of_war;
+ fog = client_tile_get_known(x, y) == TILE_KNOWN_FOGGED && draw_fog_of_war;
pcity = tile_get_city(x, y);
punit = get_drawable_unit(x, y, citymode);
pfocus = get_unit_in_focus();
Index: client/gui-mui/mapclass.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-mui/mapclass.c,v
retrieving revision 1.110
diff -u -r1.110 mapclass.c
--- client/gui-mui/mapclass.c 29 Apr 2005 18:39:25 -0000 1.110
+++ client/gui-mui/mapclass.c 1 May 2005 00:36:16 -0000
@@ -2142,7 +2142,7 @@
city_map_checked_iterate(pcity->tile, x, y, map_x, map_y) {
int canvas_x, canvas_y;
- if (tile_get_known(map_x, map_y)
+ if (client_tile_get_known(map_x, map_y)
&& city_to_canvas_pos(&canvas_x, &canvas_y, x, y)) {
put_one_tile_full(_rp(o), map_x, map_y, canvas_x + _mleft(o),
canvas_y + _mtop(o), 1);
@@ -2153,7 +2153,7 @@
city_map_checked_iterate(pcity->tile, x, y, map_x, map_y) {
int canvas_x, canvas_y;
- if (tile_get_known(map_x, map_y)
+ if (client_tile_get_known(map_x, map_y)
&& city_to_canvas_pos(&canvas_x, &canvas_y, x, y)
&& pcity->city_map[x][y]==C_TILE_WORKER) {
put_city_output_tile(_rp(o),
@@ -2171,7 +2171,7 @@
city_map_checked_iterate(pcity->tile, x, y, map_x, map_y) {
int canvas_x, canvas_y;
- if (tile_get_known(map_x, map_y)
+ if (client_tile_get_known(map_x, map_y)
&& city_to_canvas_pos(&canvas_x, &canvas_y, x, y)
&& pcity->city_map[x][y]==C_TILE_UNAVAILABLE) {
canvas_x += _mleft(o);
@@ -2215,7 +2215,7 @@
int tilex, tiley;
if (city_map_to_map(&tilex, &tiley, pcity, x, y)
- && tile_get_known(tilex, tiley)) {
+ && client_tile_get_known(tilex, tiley)) {
put_tile(_rp(o), tilex, tiley, x1, y1, 1);
if (pcity->city_map[x][y] == C_TILE_WORKER) {
Index: client/gui-sdl/citydlg.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-sdl/citydlg.c,v
retrieving revision 1.53
diff -u -r1.53 citydlg.c
--- client/gui-sdl/citydlg.c 23 Apr 2005 17:40:25 -0000 1.53
+++ client/gui-sdl/citydlg.c 1 May 2005 00:36:17 -0000
@@ -1870,7 +1870,7 @@
{
if (is_valid_city_coords(city_x, city_y)
&& city_map_to_map(&map_x, &map_y, pCity, city_x, city_y)
- && tile_get_known(map_x, map_y)
+ && client_tile_get_known(map_x, map_y)
&& sdl_city_to_canvas_pos(&canvas_x, &canvas_y, city_x, city_y))
{
dest.x = canvas_x;
Index: client/gui-sdl/dialogs.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-sdl/dialogs.c,v
retrieving revision 1.59
diff -u -r1.59 dialogs.c
--- client/gui-sdl/dialogs.c 30 Apr 2005 17:09:26 -0000 1.59
+++ client/gui-sdl/dialogs.c 1 May 2005 00:36:18 -0000
@@ -29,7 +29,7 @@
#include <SDL/SDL.h>
-#include "climap.h" /* for tile_get_known() */
+#include "climap.h" /* for client_tile_get_known() */
#include "combat.h"
#include "fcintl.h"
#include "log.h"
@@ -903,7 +903,7 @@
pTerrain_Info_Dlg->pEndWidgetList = pWindow;
/* ---------- */
- if(tile_get_known(x, y) >= TILE_KNOWN_FOGGED) {
+ if(client_tile_get_known(x, y) >= TILE_KNOWN_FOGGED) {
my_snprintf(cBuf, sizeof(cBuf), _("Terrain: %s\nFood/Prod/Trade: %s\n%s"),
sdl_map_get_tile_info_text(pTile),
Index: client/gui-sdl/mapview.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-sdl/mapview.c,v
retrieving revision 1.85
diff -u -r1.85 mapview.c
--- client/gui-sdl/mapview.c 29 Apr 2005 18:39:26 -0000 1.85
+++ client/gui-sdl/mapview.c 1 May 2005 00:36:18 -0000
@@ -2283,7 +2283,7 @@
for (city_y = 0; city_y<CITY_MAP_SIZE; city_y++) {
if (is_valid_city_coords(city_x, city_y)
&& city_map_to_map(&map_x, &map_y, pCity, city_x, city_y)
- && tile_get_known(map_x, map_y)
+ && client_tile_get_known(map_x, map_y)
&& city_to_canvas_pos(&canvas_x, &canvas_y, city_x, city_y)) {
draw_map_cell(pDest, canvas_x,
canvas_y + HALF_tileset_tile_height(tileset), map_x, map_y,
1);
@@ -2367,7 +2367,7 @@
for (city_y = 0; city_y<CITY_MAP_SIZE; city_y++) {
if (is_valid_city_coords(city_x, city_y)
&& city_map_to_map(&map_x, &map_y, pCity, city_x, city_y)
- && tile_get_known(map_x, map_y)
+ && client_tile_get_known(map_x, map_y)
&& city_to_canvas_pos(&canvas_x, &canvas_y, city_x, city_y)) {
put_one_tile(&store, map_x, map_y, canvas_x, canvas_y, 1);
if (get_worker_city(pCity, city_x, city_y) == C_TILE_UNAVAILABLE)
Index: client/gui-win32/mapctrl.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-win32/mapctrl.c,v
retrieving revision 1.43
diff -u -r1.43 mapctrl.c
--- client/gui-win32/mapctrl.c 8 Mar 2005 10:03:47 -0000 1.43
+++ client/gui-win32/mapctrl.c 1 May 2005 00:36:18 -0000
@@ -119,7 +119,7 @@
popit_popup=NULL;
}
- if (tile_get_known(ptile) < TILE_KNOWN_FOGGED)
+ if (client_tile_get_known(ptile) < TILE_KNOWN_FOGGED)
return;
popup=fcwin_create_layouted_window(popit_proc,NULL,WS_POPUP|WS_BORDER,
Index: client/gui-xaw/mapctrl.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-xaw/mapctrl.c,v
retrieving revision 1.94
diff -u -r1.94 mapctrl.c
--- client/gui-xaw/mapctrl.c 15 Apr 2005 05:03:35 -0000 1.94
+++ client/gui-xaw/mapctrl.c 1 May 2005 00:36:18 -0000
@@ -109,7 +109,7 @@
char *content;
static bool is_orders;
- if (tile_get_known(ptile)>=TILE_KNOWN_FOGGED) {
+ if (client_tile_get_known(ptile)>=TILE_KNOWN_FOGGED) {
Widget p=XtCreatePopupShell("popupinfo", simpleMenuWidgetClass,
map_canvas, NULL, 0);
content = (char *) popup_info_text(ptile);
Index: common/map.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/map.c,v
retrieving revision 1.223
diff -u -r1.223 map.c
--- common/map.c 30 Apr 2005 20:59:50 -0000 1.223
+++ common/map.c 1 May 2005 00:36:18 -0000
@@ -799,23 +799,6 @@
return tile_move_cost_ptrs(punit, punit->tile, ptile);
}
-/*************************************************************************
- Return a known_type enumeration value for the tile.
-
- Note that the client only knows known data about game.player_ptr.
-*************************************************************************/
-enum known_type map_get_known(const struct tile *ptile,
- const struct player *pplayer)
-{
- if (!BV_ISSET(ptile->tile_known, pplayer->player_no)) {
- return TILE_UNKNOWN;
- } else if (!BV_ISSET(ptile->tile_seen, pplayer->player_no)) {
- return TILE_KNOWN_FOGGED;
- } else {
- return TILE_KNOWN;
- }
-}
-
/***************************************************************
...
***************************************************************/
Index: common/map.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/map.h,v
retrieving revision 1.246
diff -u -r1.246 map.h
--- common/map.h 30 Apr 2005 20:59:50 -0000 1.246
+++ common/map.h 1 May 2005 00:36:19 -0000
@@ -252,9 +252,6 @@
bool is_real_map_pos(int x, int y);
bool is_normal_map_pos(int x, int y);
-enum known_type map_get_known(const struct tile *ptile,
- const struct player *pplayer);
-
bool is_singular_tile(const struct tile *ptile, int dist);
bool normalize_map_pos(int *x, int *y);
struct tile *nearest_real_tile(int x, int y);
Index: common/player.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/player.c,v
retrieving revision 1.174
diff -u -r1.174 player.c
--- common/player.c 23 Apr 2005 17:40:27 -0000 1.174
+++ common/player.c 1 May 2005 00:36:19 -0000
@@ -238,7 +238,7 @@
struct city *pcity;
/* If the player can't even see the tile... */
- if (map_get_known(ptile, pplayer) != TILE_KNOWN) {
+ if (tile_get_known(ptile, pplayer) != TILE_KNOWN) {
return FALSE;
}
Index: common/tile.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/tile.c,v
retrieving revision 1.3
diff -u -r1.3 tile.c
--- common/tile.c 29 Apr 2005 17:39:29 -0000 1.3
+++ common/tile.c 1 May 2005 00:36:19 -0000
@@ -140,6 +140,23 @@
}
/****************************************************************************
+ Return a known_type enumeration value for the tile.
+
+ Note that the client only knows known data about game.player_ptr.
+****************************************************************************/
+enum known_type tile_get_known(const struct tile *ptile,
+ const struct player *pplayer)
+{
+ if (!BV_ISSET(ptile->tile_known, pplayer->player_no)) {
+ return TILE_UNKNOWN;
+ } else if (!BV_ISSET(ptile->tile_seen, pplayer->player_no)) {
+ return TILE_KNOWN_FOGGED;
+ } else {
+ return TILE_KNOWN;
+ }
+}
+
+/****************************************************************************
Time to complete the given activity on the given tile.
****************************************************************************/
int tile_activity_time(enum unit_activity activity, const struct tile *ptile)
Index: common/tile.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/tile.h,v
retrieving revision 1.4
diff -u -r1.4 tile.h
--- common/tile.h 30 Apr 2005 20:59:50 -0000 1.4
+++ common/tile.h 1 May 2005 00:36:19 -0000
@@ -64,6 +64,8 @@
void tile_clear_all_specials(struct tile *ptile);
void tile_set_continent(struct tile *ptile, Continent_id val);
Continent_id tile_get_continent(const struct tile *ptile);
+enum known_type tile_get_known(const struct tile *ptile,
+ const struct player *pplayer);
/* An arbitrary somewhat integer value. Activity times are multiplied by
* this amount, and divided by them later before being used. This may
Index: common/unit.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/unit.c,v
retrieving revision 1.237
diff -u -r1.237 unit.c
--- common/unit.c 30 Apr 2005 17:09:27 -0000 1.237
+++ common/unit.c 1 May 2005 00:36:21 -0000
@@ -1281,7 +1281,7 @@
if (pcity
&& (pcity->client.occupied
- || map_get_known(ptile, pplayer) == TILE_KNOWN_FOGGED)) {
+ || tile_get_known(ptile, pplayer) == TILE_KNOWN_FOGGED)) {
/* If the city is fogged, we assume it's occupied */
return FALSE;
}
Index: common/aicore/path_finding.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/aicore/path_finding.c,v
retrieving revision 1.30
diff -u -r1.30 path_finding.c
--- common/aicore/path_finding.c 31 Mar 2005 18:32:10 -0000 1.30
+++ common/aicore/path_finding.c 1 May 2005 00:36:21 -0000
@@ -200,7 +200,7 @@
if (params->omniscience) {
node->node_known_type = TILE_KNOWN;
} else {
- node->node_known_type = map_get_known(ptile, params->owner);
+ node->node_known_type = tile_get_known(ptile, params->owner);
}
/* Establish the tile behavior */
Index: server/unittools.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/unittools.c,v
retrieving revision 1.343
diff -u -r1.343 unittools.c
--- server/unittools.c 30 Apr 2005 17:09:30 -0000 1.343
+++ server/unittools.c 1 May 2005 00:36:22 -0000
@@ -2935,7 +2935,7 @@
/* We're only concerned with known, unfogged tiles which may contain
* hidden units that are no longer visible. These units will not
* have been handled by the fog code, above. */
- if (map_get_known(tile1, pplayer) == TILE_KNOWN) {
+ if (tile_get_known(tile1, pplayer) == TILE_KNOWN) {
unit_list_iterate(tile1->units, punit2) {
if (punit2 != punit && !can_player_see_unit(pplayer, punit2)) {
unit_goes_out_of_sight(pplayer, punit2);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Freeciv-Dev] (PR#12947) move tile_get_known into tile.h,
Jason Short <=
|
|