Index: client/climisc.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/climisc.c,v retrieving revision 1.62 diff -u -r1.62 climisc.c --- client/climisc.c 2001/10/04 19:36:54 1.62 +++ client/climisc.c 2001/10/07 16:12:02 @@ -38,6 +38,7 @@ #include "city.h" #include "packets.h" #include "support.h" +#include "shared.h" #include "clinet.h" #include "chatline_g.h" @@ -47,9 +48,18 @@ #include "mapview_g.h" #include "tilespec.h" #include "civclient.h" +#include "goto.h" #include "climisc.h" +#define MAX_MAP_DECORATIONS 10 + +static struct { + int is_used; + struct map_decoration deco; + struct map_position min, max; +} map_decorations[MAX_MAP_DECORATIONS]; + /************************************************************************** ... **************************************************************************/ @@ -827,4 +837,96 @@ } } return cids_used; +} + +static void my_update_map_canvas(const struct map_decoration *const p) +{ + int i; + + for (i = 0; i < p->lines_used; i++) { + int min_x = MIN(p->lines[i].src.x, p->lines[i].dest.x); + int min_y = MIN(p->lines[i].src.y, p->lines[i].dest.y); + + int width = abs(p->lines[i].src.x-p->lines[i].dest.x) + 1; + int height = abs(p->lines[i].src.y-p->lines[i].dest.y) + 1; + + freelog(LOG_NORMAL, " line %d: (%d,%d)-(%d,%d) min=(%d,%d) size=%dx%d", + i, p->lines[i].src.x, p->lines[i].src.y, p->lines[i].dest.x, + p->lines[i].dest.y, min_x, min_y, width, height); + + update_map_canvas(min_x, min_y, width, height, 1); + } +} + +int add_map_decoration(const struct map_decoration *const p) +{ + int i, result = -1; + + freelog(LOG_NORMAL, "add_map_decoration(lines=%d descr=%d) id=%d", + p->lines_used, p->descriptions_used, result); + + assert(p->lines_used >= 0 && p->lines_used < MAX_MAP_DECORATIONS_LINES); + assert(p->descriptions_used >= 0 + && p->descriptions_used < MAX_MAP_DECORATIONS_DESCRIPTIONS); + + for (i = 0; i < MAX_MAP_DECORATIONS; i++) { + if (!map_decorations[i].is_used) { + result = i; + break; + } + } + + for (i = 0; i < p->lines_used; i++) { + assert(p->lines[i].src.x >= 0 && p->lines[i].src.x < map.xsize); + assert(p->lines[i].src.y >= 0 && p->lines[i].src.y < map.ysize); + assert(p->lines[i].dest.x >= 0 && p->lines[i].dest.x < map.xsize); + assert(p->lines[i].dest.y >= 0 && p->lines[i].dest.y < map.ysize); + } + + assert(result != -1); + + memcpy(&map_decorations[result].deco, p, sizeof(struct map_decoration)); + map_decorations[result].is_used = 1; + + my_update_map_canvas(p); + return result; +} + +void remove_map_decoration(int id) +{ + freelog(LOG_NORMAL, "remove_map_decoration(id=%d)",id); + assert(map_decorations[id].is_used); + map_decorations[id].is_used = 0; + my_update_map_canvas(&map_decorations[id].deco); +} + +void get_all_map_decorations(struct map_decoration *dest) +{ + int i; + + dest->lines_used = 0; + dest->descriptions_used = 0; + + for (i = 0; i < MAX_MAP_DECORATIONS; i++) { + if (!map_decorations[i].is_used) { + continue; + } + + assert((dest->lines_used + map_decorations[i].deco.lines_used) < + MAX_MAP_DECORATIONS_LINES); + memcpy(&dest->lines[dest->lines_used], map_decorations[i].deco.lines, + map_decorations[i].deco.lines_used * + sizeof(struct map_deco_line)); + dest->lines_used += map_decorations[i].deco.lines_used; + + assert( + (dest->descriptions_used + + map_decorations[i].deco.descriptions_used) < + MAX_MAP_DECORATIONS_DESCRIPTIONS); + memcpy(&dest->descriptions[dest->descriptions_used], + map_decorations[i].deco.descriptions, + map_decorations[i].deco.descriptions_used * + sizeof(struct map_deco_line)); + dest->descriptions_used += map_decorations[i].deco.descriptions_used; + } } Index: client/climisc.h =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/climisc.h,v retrieving revision 1.23 diff -u -r1.23 climisc.h --- client/climisc.h 2001/09/19 18:48:46 1.23 +++ client/climisc.h 2001/10/07 16:12:03 @@ -13,10 +13,32 @@ #ifndef FC__CLIMISC_H #define FC__CLIMISC_H +#include "colors_g.h" +#include "map.h" + struct city; struct Clause; typedef int cid; +#define MAX_MAP_DECORATIONS_LINES 100 +#define MAX_MAP_DECORATIONS_DESCRIPTIONS 100 +#define MAX_MAP_DECORATIONS_TEXT_SIZE 10 + +struct map_decoration { + int lines_used; + struct map_deco_line { + struct map_position src, dest; + enum color_std color; + } lines[MAX_MAP_DECORATIONS_LINES]; + + int descriptions_used; + struct map_deco_descr { + struct map_position pos; + char text[MAX_MAP_DECORATIONS_TEXT_SIZE]; + enum color_std color; + } descriptions[MAX_MAP_DECORATIONS_DESCRIPTIONS]; +}; + void client_remove_player(int plr_id); void client_remove_city(struct city *pcity); void client_remove_unit(int unit_id); @@ -76,6 +98,14 @@ int (*test_func) (struct city *, int)); int collect_cids2(cid * dest_cids); int collect_cids3(cid * dest_cids); + +int add_map_decoration(const struct map_decoration *const p); +void remove_map_decoration(int id); + +/* + * Called by mapview.c + */ +void get_all_map_decorations(struct map_decoration *dest); #endif /* FC__CLIMISC_H */ Index: client/goto.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/goto.c,v retrieving revision 1.26 diff -u -r1.26 goto.c --- client/goto.c 2001/09/23 16:09:34 1.26 +++ client/goto.c 2001/10/07 16:12:05 @@ -23,6 +23,7 @@ #include "clinet.h" #include "control.h" #include "mapview_g.h" +#include "climisc.h" #include "goto.h" @@ -76,6 +77,8 @@ static int lowest_cost; static int highest_cost; +static int has_map_decoration_id = 0, map_decoration_id; + /* This is a constant time priority queue. One drawback: you cannot insert an item with priority less than the smallest item (which shouldn't be a problem for our uses) */ @@ -94,6 +97,47 @@ Se we need to change the implementation at some point. */ +static void update_map_decoration() +{ + struct map_decoration deco; + int i; + + if (has_map_decoration_id) { + remove_map_decoration(map_decoration_id); + has_map_decoration_id = 0; + } + + assert(goto_array_index < MAX_MAP_DECORATIONS_LINES); + deco.lines_used = goto_array_index; + deco.descriptions_used = 0; + + deco.lines[0].src.x = goto_map.src_x; + deco.lines[0].src.y = goto_map.src_y; + deco.lines[0].dest.x = goto_array[0].x; + deco.lines[0].dest.y = goto_array[0].y; + deco.lines[0].color = COLOR_STD_CYAN; + + for (i = 1; i < deco.lines_used; i++) { + deco.lines[i].src.x = goto_array[i-1].x; + deco.lines[i].src.y = goto_array[i-1].y; + deco.lines[i].dest.x = goto_array[i].x; + deco.lines[i].dest.y = goto_array[i].y; + deco.lines[i].color = COLOR_STD_CYAN; + } + + if(goto_array_index>0) { + deco.lines[deco.lines_used].src.x = goto_map.src_x; + deco.lines[deco.lines_used].src.y = goto_map.src_y; + deco.lines[deco.lines_used].dest.x = goto_array[goto_array_index - 1].x; + deco.lines[deco.lines_used].dest.y = goto_array[goto_array_index - 1].y; + deco.lines[deco.lines_used].color = COLOR_STD_RED; + deco.lines_used++; + } + + map_decoration_id = add_map_decoration(&deco); + has_map_decoration_id = 1; +} + /************************************************************************** Called once per use of the queue. **************************************************************************/ @@ -455,7 +499,7 @@ **************************************************************************/ static void goto_array_insert(int x, int y) { - int dir, old_x, old_y; + int old_x, old_y; /* too small; alloc a bigger one */ if (goto_array_index == goto_array_length) { @@ -480,10 +524,6 @@ */ assert(!(old_x == x && old_y == y)); - dir = get_direction_for_step(old_x, old_y, x, y); - - draw_segment(old_x, old_y, dir); - /* insert into array */ goto_array[goto_array_index].x = x; goto_array[goto_array_index].y = y; @@ -607,96 +647,12 @@ } } - - /********************************************************************** -Every line segment has 2 ends; we only keep track of it at one end (the -one from which dir i <4). -This function returns pointer to the correct char. -***********************************************************************/ -static unsigned char *get_drawn_char(int x, int y, int dir) -{ - int x1, y1, is_real; - - /* Replace with check for is_normal_tile later */ - assert(is_real_tile(x, y)); - normalize_map_pos(&x, &y); - - is_real = MAPSTEP(x1, y1, x, y, dir); - - /* It makes no sense to draw a goto line to a non-existant tile. */ - assert(is_real); - - if (dir >= 4) { - x = x1; - y = y1; - dir = DIR_REVERSE(dir); - } - - return goto_map.drawn[x] + y*4 + dir; -} - -/********************************************************************** -... -***********************************************************************/ -void increment_drawn(int x, int y, int dir) -{ - /* don't overflow unsigned char. */ - assert(*get_drawn_char(x, y, dir) < 255); - *get_drawn_char(x, y, dir) += 1; -} - -/********************************************************************** -... -***********************************************************************/ -void decrement_drawn(int x, int y, int dir) -{ - assert(*get_drawn_char(x, y, dir) > 0); - *get_drawn_char(x, y, dir) -= 1; -} - -/********************************************************************** -... -***********************************************************************/ -int get_drawn(int x, int y, int dir) -{ - int dummy_x, dummy_y; - - if (!MAPSTEP(dummy_x, dummy_y, x, y, dir)) - return 0; - - return *get_drawn_char(x, y, dir); -} - - -/********************************************************************** Pop one tile and undraw it from the map. Not many checks here. ***********************************************************************/ static void undraw_one(void) { - int line_x, line_y; - int dir; - - /* current line destination */ - int dest_x = goto_array[goto_array_index-1].x; - int dest_y = goto_array[goto_array_index-1].y; - struct waypoint *pwaypoint = &waypoint_list[waypoint_list_index-1]; - - /* find the new line destination */ - if (goto_array_index > pwaypoint->goto_array_start + 1) { - line_x = goto_array[goto_array_index-2].x; - line_y = goto_array[goto_array_index-2].y; - } else { - line_x = pwaypoint->x; - line_y = pwaypoint->y; - } - - /* undraw the line segment */ - - dir = get_direction_for_step(line_x, line_y, dest_x, dest_y); - undraw_segment(line_x, line_y, dir); - assert(goto_array_index > 0); goto_array_index--; } @@ -730,6 +686,7 @@ while (goto_array_index > pwaypoint->goto_array_start) { undraw_one(); } + update_map_decoration(); } #define INITIAL_ROUTE_LENGTH 30 @@ -817,6 +774,7 @@ goto_array_insert(route[route_index-1].x, route[route_index-1].y); route_index--; } + update_map_decoration(); } Index: client/goto.h =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/goto.h,v retrieving revision 1.4 diff -u -r1.4 goto.h --- client/goto.h 2001/09/19 19:09:18 1.4 +++ client/goto.h 2001/10/07 16:12:05 @@ -34,9 +34,6 @@ int goto_pop_waypoint(void); void draw_line(int dest_x, int dest_y); -int get_drawn(int x, int y, int dir); -void increment_drawn(int x, int y, int dir); -void decrement_drawn(int x, int y, int dir); void send_patrol_route(struct unit *punit); void send_goto_route(struct unit *punit); Index: client/gui-gtk/mapctrl.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/mapctrl.c,v retrieving revision 1.48 diff -u -r1.48 mapctrl.c --- client/gui-gtk/mapctrl.c 2001/09/30 21:27:03 1.48 +++ client/gui-gtk/mapctrl.c 2001/10/07 16:12:05 @@ -51,6 +51,8 @@ /* Color to use to display the workers */ int city_workers_color=COLOR_STD_WHITE; +static int has_map_decoration_id = 0, map_decoration_id; + /************************************************************************** ... **************************************************************************/ @@ -194,9 +196,23 @@ ptype->hp, punit->veteran?_(" V"):"", uc); if(punit->activity==ACTIVITY_GOTO || punit->connecting) { + struct map_decoration deco; + cross_head->x = punit->goto_dest_x; cross_head->y = punit->goto_dest_y; cross_head++; + + deco.lines_used = 1; + deco.descriptions_used = 0; + + deco.lines[0].src.x = xtile; + deco.lines[0].src.y = ytile; + deco.lines[0].dest.x = punit->goto_dest_x; + deco.lines[0].dest.y = punit->goto_dest_y; + deco.lines[0].color = COLOR_STD_CYAN; + + map_decoration_id = add_map_decoration(&deco); + has_map_decoration_id = 1; } } else { my_snprintf(s, sizeof(s), _("A:%d D:%d FP:%d HP:%d0%%"), @@ -250,6 +266,11 @@ refresh_tile_mapcanvas(cross_list->x,cross_list->y,1); cross_list++; } + + if (has_map_decoration_id) { + remove_map_decoration(map_decoration_id); + has_map_decoration_id = 0; + } } /************************************************************************** @@ -318,6 +339,7 @@ if ((hover_state == HOVER_GOTO || hover_state == HOVER_PATROL) && draw_goto_line) { + get_map_xy(window_x, window_y, &x, &y); get_line_dest(&old_x, &old_y); Index: client/gui-gtk/mapview.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/mapview.c,v retrieving revision 1.103 diff -u -r1.103 mapview.c --- client/gui-gtk/mapview.c 2001/10/05 09:47:41 1.103 +++ client/gui-gtk/mapview.c 2001/10/07 16:12:07 @@ -109,9 +109,7 @@ struct Sprite *ssprite); static void put_unit_pixmap(struct unit *punit, GdkPixmap *pm, int canvas_x, int canvas_y); -static void put_line(GdkDrawable *pm, int canvas_src_x, int canvas_src_y, int dir); static void show_city_descriptions(void); - static void put_unit_pixmap_draw(struct unit *punit, GdkPixmap *pm, int canvas_x, int canvas_y, int offset_x, int offset_y_unit, @@ -122,8 +120,6 @@ int offset_x, int offset_y, int width, int height, int fog); -static void really_draw_segment(int src_x, int src_y, int dir, - int write_to_screen, int force); static void pixmap_put_tile_iso(GdkDrawable *pm, int x, int y, int canvas_x, int canvas_y, int citymode, @@ -134,6 +130,10 @@ int canvas_x, int canvas_y, int offset_x, int offset_y, int width, int height); +static void draw_map_deco_line_iso(const struct map_deco_line *const line, + int write_to_screen); +static void draw_map_deco_line_noniso(struct map_deco_line *line, + int write_to_screen); /* the intro picture is held in this pixmap, which is scaled to the screen size */ @@ -141,6 +141,21 @@ static GtkObject *map_hadj, *map_vadj; +static void draw_global_map_decorations(int write_to_screen) +{ + struct map_decoration deco; + int i; + + get_all_map_decorations(&deco); + + for (i = 0; i < deco.lines_used; i++) { + if (is_isometric) { + draw_map_deco_line_iso(&deco.lines[i], write_to_screen); + } else { + draw_map_deco_line_noniso(&deco.lines[i], write_to_screen); + } + } +} /************************************************************************** ... @@ -223,29 +238,6 @@ /* tile is unknown */ pixmap_put_black_tile(pm, canvas_x, canvas_y); } - - if (!citymode) { - /* put any goto lines on the tile. */ - if (y >= 0 && y < map.ysize) { - int dir; - for (dir = 0; dir < 8; dir++) { - if (get_drawn(x, y, dir)) { - put_line(map_canvas_store, x, y, dir); - } - } - } - - /* Some goto lines overlap onto the tile... */ - if (NORMAL_TILE_WIDTH%2 == 0 || NORMAL_TILE_HEIGHT%2 == 0) { - int line_x = x - 1; - int line_y = y; - if (normalize_map_pos(&line_x, &line_y) - && get_drawn(line_x, line_y, 2)) { - /* it is really only one pixel in the top right corner */ - put_line(map_canvas_store, line_x, line_y, 2); - } - } - } } /************************************************************************** @@ -1296,13 +1288,14 @@ void update_map_canvas(int x, int y, int width, int height, int write_to_screen) { + int x_itr, y_itr; + freelog(LOG_DEBUG, "update_map_canvas(pos=(%d,%d), size=(%d,%d), write_to_screen=%d)", x, y, width, height, write_to_screen); if (is_isometric) { int i; - int x_itr, y_itr; /*** First refresh the tiles above the area to remove the old tiles' overlapping gfx ***/ @@ -1353,26 +1346,6 @@ put_one_tile(x+width, y+height, D_T_LR); /* right-bottom corner */ - - /*** Draw the goto line on top of the whole thing. Done last as - we want it completely on top. ***/ - /* Drawing is cheap; we just draw all the lines. - Perhaps this should be optimized, though... */ - for (x_itr = x-1; x_itr <= x+width; x_itr++) { - for (y_itr = y-1; y_itr <= y+height; y_itr++) { - int x1 = x_itr; - int y1 = y_itr; - if (normalize_map_pos(&x1, &y1)) { - adjc_dir_iterate(x1, y1, x2, y2, dir) { - if (get_drawn(x1, y1, dir)) { - really_draw_segment(x1, y1, dir, 0, 1); - } - } adjc_dir_iterate_end; - } - } - } - - /*** Lastly draw our changes to the screen. ***/ if (write_to_screen) { int canvas_start_x, canvas_start_y; @@ -1395,7 +1368,6 @@ } } else { /* is_isometric */ - int x_itr, y_itr; int canvas_x, canvas_y; for (y_itr=y; y_itrsrc.x, line->src.y, &canvas_src_x, &canvas_src_y); + canvas_src_x += NORMAL_TILE_WIDTH / 2; + canvas_src_y += NORMAL_TILE_HEIGHT / 2; + + get_canvas_xy(line->dest.x, line->dest.y, &canvas_dest_x, + &canvas_dest_y); + canvas_dest_x += NORMAL_TILE_WIDTH / 2; + canvas_dest_y += NORMAL_TILE_HEIGHT / 2; + + gdk_gc_set_foreground(civ_gc, colors_standard[line->color]); + + gdk_draw_line(map_canvas_store, civ_gc, + canvas_src_x, canvas_src_y, canvas_dest_x, canvas_dest_y); + + if (write_to_screen) { + gdk_draw_line(map_canvas->window, civ_gc, + canvas_src_x, canvas_src_y, + canvas_dest_x, canvas_dest_y); + } +} /************************************************************************** draw a line from src_x,src_y -> dest_x,dest_y on both map_canvas and @@ -1931,155 +1932,40 @@ FIXME: We currently always draw the line. Only used for isometric view. **************************************************************************/ -static void really_draw_segment(int src_x, int src_y, int dir, - int write_to_screen, int force) +static void draw_map_deco_line_iso(const struct map_deco_line *const line, + int write_to_screen) { - int dest_x, dest_y, is_real; int canvas_start_x, canvas_start_y; int canvas_end_x, canvas_end_y; - - gdk_gc_set_foreground(thick_line_gc, colors_standard[COLOR_STD_CYAN]); - is_real = MAPSTEP(dest_x, dest_y, src_x, src_y, dir); - assert(is_real); + gdk_gc_set_foreground(thick_line_gc, colors_standard[line->color]); /* Find middle of tiles. y-1 to not undraw the the middle pixel of a horizontal line when we refresh the tile below-between. */ - get_canvas_xy(src_x, src_y, &canvas_start_x, &canvas_start_y); - get_canvas_xy(dest_x, dest_y, &canvas_end_x, &canvas_end_y); + get_canvas_xy(line->src.x, line->src.y, &canvas_start_x, &canvas_start_y); + get_canvas_xy(line->dest.x, line->dest.y, &canvas_end_x, &canvas_end_y); canvas_start_x += NORMAL_TILE_WIDTH/2; canvas_start_y += NORMAL_TILE_HEIGHT/2-1; canvas_end_x += NORMAL_TILE_WIDTH/2; canvas_end_y += NORMAL_TILE_HEIGHT/2-1; +#if 0 /* somewhat hackish way of solving the problem where draw from a tile on one side of the screen out of the screen, and the tile we draw to is found to be on the other side of the screen. */ if (abs(canvas_end_x - canvas_start_x) > NORMAL_TILE_WIDTH || abs(canvas_end_y - canvas_start_y) > NORMAL_TILE_HEIGHT) return; +#endif - /* draw it! */ gdk_draw_line(map_canvas_store, thick_line_gc, - canvas_start_x, canvas_start_y, canvas_end_x, canvas_end_y); - if (write_to_screen) + canvas_start_x, canvas_start_y, canvas_end_x, + canvas_end_y); + if (write_to_screen) { gdk_draw_line(map_canvas->window, thick_line_gc, - canvas_start_x, canvas_start_y, canvas_end_x, canvas_end_y); - return; -} - -/************************************************************************** -... -**************************************************************************/ -void draw_segment(int src_x, int src_y, int dir) -{ - if (is_isometric) { - increment_drawn(src_x, src_y, dir); - if (get_drawn(src_x, src_y, dir) > 1) { - return; - } else { - really_draw_segment(src_x, src_y, dir, 1, 0); - } - } else { - int dest_x, dest_y, is_real; - - is_real = MAPSTEP(dest_x, dest_y, src_x, src_y, dir); - assert(is_real); - - /* A previous line already marks the place */ - if (get_drawn(src_x, src_y, dir)) { - increment_drawn(src_x, src_y, dir); - return; - } - - if (tile_visible_mapcanvas(src_x, src_y)) { - put_line(map_canvas_store, src_x, src_y, dir); - put_line(map_canvas->window, src_x, src_y, dir); - } - if (tile_visible_mapcanvas(dest_x, dest_y)) { - put_line(map_canvas_store, dest_x, dest_y, DIR_REVERSE(dir)); - put_line(map_canvas->window, dest_x, dest_y, DIR_REVERSE(dir)); - } - - increment_drawn(src_x, src_y, dir); + canvas_start_x, canvas_start_y, canvas_end_x, + canvas_end_y); } -} - -/************************************************************************** -remove the line from src_x,src_y -> dest_x,dest_y on both map_canvas and -map_canvas_store. -**************************************************************************/ -void undraw_segment(int src_x, int src_y, int dir) -{ - int dest_x, dest_y, is_real; - - is_real = MAPSTEP(dest_x, dest_y, src_x, src_y, dir); - assert(is_real); - - if (is_isometric) { - assert(get_drawn(src_x, src_y, dir)); - decrement_drawn(src_x, src_y, dir); - - /* somewhat inefficient */ - if (!get_drawn(src_x, src_y, dir)) { - update_map_canvas(MIN(src_x, dest_x), MIN(src_y, dest_y), - src_x == dest_x ? 1 : 2, - src_y == dest_y ? 1 : 2, - 1); - } - } else { - int drawn = get_drawn(src_x, src_y, dir); - - assert(drawn > 0); - /* If we walk on a path twice it looks just like walking on it once. */ - if (drawn > 1) { - decrement_drawn(src_x, src_y, dir); - return; - } - - decrement_drawn(src_x, src_y, dir); - refresh_tile_mapcanvas(src_x, src_y, 1); - refresh_tile_mapcanvas(dest_x, dest_y, 1); - if (NORMAL_TILE_WIDTH%2 == 0 || NORMAL_TILE_HEIGHT%2 == 0) { - int is_real; - - if (dir == DIR8_NORTHEAST) { - /* Since the tile doesn't have a middle we draw an extra pixel - on the adjacent tile when drawing in this direction. */ - dest_x = src_x + 1; - dest_y = src_y; - is_real = normalize_map_pos(&dest_x, &dest_y); - assert(is_real); - refresh_tile_mapcanvas(dest_x, dest_y, 1); - } else if (dir == DIR8_SOUTHWEST) { /* the same */ - dest_x = src_x; - dest_y = src_y + 1; - is_real = normalize_map_pos(&dest_x, &dest_y); - assert(is_real); - refresh_tile_mapcanvas(dest_x, dest_y, 1); - } - } - } -} - -/************************************************************************** -Not used in isometric view. -**************************************************************************/ -static void put_line(GdkDrawable *pm, int x, int y, int dir) -{ - int canvas_src_x, canvas_src_y, canvas_dest_x, canvas_dest_y; - get_canvas_xy(x, y, &canvas_src_x, &canvas_src_y); - canvas_src_x += NORMAL_TILE_WIDTH/2; - canvas_src_y += NORMAL_TILE_HEIGHT/2; - DIRSTEP(canvas_dest_x, canvas_dest_y, dir); - canvas_dest_x = canvas_src_x + (NORMAL_TILE_WIDTH * canvas_dest_x) / 2; - canvas_dest_y = canvas_src_y + (NORMAL_TILE_WIDTH * canvas_dest_y) / 2; - - gdk_gc_set_foreground(civ_gc, colors_standard[COLOR_STD_CYAN]); - - gdk_draw_line(pm, civ_gc, - canvas_src_x, canvas_src_y, - canvas_dest_x, canvas_dest_y); } /************************************************************************** Index: client/include/mapview_g.h =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/include/mapview_g.h,v retrieving revision 1.15 diff -u -r1.15 mapview_g.h --- client/include/mapview_g.h 2001/02/04 13:45:21 1.15 +++ client/include/mapview_g.h 2001/10/07 16:12:07 @@ -49,7 +49,4 @@ void refresh_overview_viewrect(void); void refresh_tile_mapcanvas(int x, int y, int write_to_screen); -void draw_segment(int src_x, int src_y, int dir); -void undraw_segment(int src_x, int src_y, int dir); - #endif /* FC__MAPVIEW_G_H */