[Freeciv-Dev] [Fwd: Re: Re: (PR#2741) Removing explicit mentioning of T_
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
-------- Original Message --------
Subject: Re: [Freeciv-Dev] Re: (PR#2741) Removing explicit mentioning of
T_OCEAN
Date: Fri, 10 Jan 2003 21:28:01 -0500
From: Cameron Morland <cameron@xxxxxxxxxx>
To: jdorje@xxxxxxxxxxxxxxxxxxxxx
CC: Cameron Morland <cameron@xxxxxxxxxx>
References: <rt-2741-19837.6.5007794041135@xxxxxxxxxxx>
<rt-2741-19843.10.4267045299965@xxxxxxxxxxx>
<20030110142804.GA16302@xxxxxxxxxxxxxxxx> <3E1F550A.7080402@xxxxxxxxxxx>
On Fri, Jan 10, 2003 at 06:19:38PM -0500, Jason Dorje Short wrote:
> Can you fix in passing the "incorrect" style in some places? My general
> rule is that any line you change you should fix the style in - which
> sometimes means changing other lines as well.
Sounds like a good rule. Maybe it should be documented in the
"How to Contribute" Mini Style Guide. (Then again, I haven't looked at
it since last time I had to setup CVS anew. :} )
The attached patch should add is_ocean to the client, and fix the
style of related lines.
--
+-----------------------------------------------------------------
| PGP http://www.eng.uwaterloo.ca/student/cjmorlan/public-key.pgp
| Cameron Morland ---- Cameron@xxxxxxxxxx
|
| Thought is not a management function.
| --John Ralston Saul
+-----------------------------------------------------------------
? client/tilespec.c.shelf
Index: client//packhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/packhand.c,v
retrieving revision 1.272
diff -u -3 -p -r1.272 packhand.c
--- client//packhand.c 2003/01/10 09:47:08 1.272
+++ client//packhand.c 2003/01/11 02:19:29
@@ -1589,7 +1589,7 @@ void handle_tile_info(struct packet_tile
/* update continents */
if ((packet->known >= TILE_KNOWN_FOGGED &&
old_known == TILE_UNKNOWN && !is_ocean(ptile->terrain)) ||
- ((is_ocean(old_terrain)) && (!is_ocean(ptile->terrain)))) {
+ (is_ocean(old_terrain) && !is_ocean(ptile->terrain))) {
/* new knowledge or new land -- update can handle incrementally */
update_continents(packet->x, packet->y, game.player_ptr);
map.num_continents = game.player_ptr->num_continents;
Index: client//gui-gtk/cityrep.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/cityrep.c,v
retrieving revision 1.73
diff -u -3 -p -r1.73 cityrep.c
--- client//gui-gtk/cityrep.c 2003/01/05 15:34:05 1.73
+++ client//gui-gtk/cityrep.c 2003/01/11 02:19:29
@@ -767,12 +767,12 @@ city_select_coastal_callback(GtkWidget *
gtk_clist_unselect_all( GTK_CLIST(city_list));
- for(i = 0; i < GTK_CLIST(city_list)->rows; i++)
- {
- struct city* pcity = gtk_clist_get_row_data(GTK_CLIST(city_list),i);
-
- if (is_terrain_near_tile(pcity->x, pcity->y, T_OCEAN))
- gtk_clist_select_row(GTK_CLIST(city_list),i,0);
+ for(i = 0; i < GTK_CLIST(city_list)->rows; i++) {
+ struct city* pcity = gtk_clist_get_row_data(GTK_CLIST(city_list),i);
+
+ if (is_ocean_near_tile(pcity->x, pcity->y)) {
+ gtk_clist_select_row(GTK_CLIST(city_list),i,0);
+ }
}
return TRUE;
Index: client//gui-gtk/mapview.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/mapview.c,v
retrieving revision 1.147
diff -u -3 -p -r1.147 mapview.c
--- client//gui-gtk/mapview.c 2003/01/05 15:34:05 1.147
+++ client//gui-gtk/mapview.c 2003/01/11 02:19:30
@@ -171,19 +171,21 @@ void pixmap_put_tile(GdkDrawable *pm, in
if (normalize_map_pos(&x1, &y1)) {
t2 = map_get_terrain(x1, y1);
/* left side */
- if ((t1 == T_OCEAN) ^ (t2 == T_OCEAN))
+ if (is_ocean(t1) ^ is_ocean(t2)) {
gdk_draw_line(pm, civ_gc,
canvas_x, canvas_y,
canvas_x, canvas_y + NORMAL_TILE_HEIGHT);
+ }
}
/* top side */
x1 = x; y1 = y-1;
if (normalize_map_pos(&x1, &y1)) {
t2 = map_get_terrain(x1, y1);
- if ((t1 == T_OCEAN) ^ (t2 == T_OCEAN))
+ if (is_ocean(t1) ^ is_ocean(t2)) {
gdk_draw_line(pm, civ_gc,
canvas_x, canvas_y,
canvas_x + NORMAL_TILE_WIDTH, canvas_y);
+ }
}
}
} else {
@@ -1770,7 +1772,7 @@ static void pixmap_put_tile_iso(GdkDrawa
}
if (draw_terrain) {
- if (map_get_terrain(x, y) == T_OCEAN) { /* coasts */
+ if (is_ocean(map_get_terrain(x, y))) { /* coasts */
int dx, dy;
/* top */
dx = offset_x-NORMAL_TILE_WIDTH/4;
@@ -1862,18 +1864,20 @@ static void pixmap_put_tile_iso(GdkDrawa
x1 = x; y1 = y-1;
if (normalize_map_pos(&x1, &y1)) {
t2 = map_get_terrain(x1, y1);
- if (draw & D_M_R && ((t1 == T_OCEAN) ^ (t2 == T_OCEAN)))
+ if (draw & D_M_R && (is_ocean(t1) ^ is_ocean(t2))) {
gdk_draw_line(pm, thin_line_gc,
canvas_x+NORMAL_TILE_WIDTH/2, canvas_y,
canvas_x+NORMAL_TILE_WIDTH,
canvas_y+NORMAL_TILE_HEIGHT/2);
+ }
}
x1 = x-1; y1 = y;
if (normalize_map_pos(&x1, &y1)) {
t2 = map_get_terrain(x1, y1);
- if (draw & D_M_L && ((t1 == T_OCEAN) ^ (t2 == T_OCEAN)))
+ if (draw & D_M_L && (is_ocean(t1) ^ is_ocean(t2))) {
gdk_draw_line(pm, thin_line_gc,
canvas_x, canvas_y + NORMAL_TILE_HEIGHT/2,
canvas_x+NORMAL_TILE_WIDTH/2, canvas_y);
+ }
}
}
Index: client//gui-gtk-2.0/cityrep.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/cityrep.c,v
retrieving revision 1.30
diff -u -3 -p -r1.30 cityrep.c
--- client//gui-gtk-2.0/cityrep.c 2003/01/05 15:34:05 1.30
+++ client//gui-gtk-2.0/cityrep.c 2003/01/11 02:19:31
@@ -755,7 +755,7 @@ static void city_select_coastal_callback
itree_get(&it, 0, &res, -1);
pcity = res;
- if (is_terrain_near_tile(pcity->x, pcity->y, T_OCEAN)) {
+ if (is_ocean_near_tile(pcity->x, pcity->y)) {
itree_select(city_selection, &it);
}
}
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.35
diff -u -3 -p -r1.35 mapview.c
--- client//gui-gtk-2.0/mapview.c 2003/01/05 15:34:05 1.35
+++ client//gui-gtk-2.0/mapview.c 2003/01/11 02:19:32
@@ -170,19 +170,21 @@ void pixmap_put_tile(GdkDrawable *pm, in
if (normalize_map_pos(&x1, &y1)) {
t2 = map_get_terrain(x1, y1);
/* left side */
- if ((t1 == T_OCEAN) ^ (t2 == T_OCEAN))
+ if (is_ocean(t1) ^ is_ocean(t2)) {
gdk_draw_line(pm, civ_gc,
canvas_x, canvas_y,
canvas_x, canvas_y + NORMAL_TILE_HEIGHT);
+ }
}
/* top side */
x1 = x; y1 = y-1;
if (normalize_map_pos(&x1, &y1)) {
t2 = map_get_terrain(x1, y1);
- if ((t1 == T_OCEAN) ^ (t2 == T_OCEAN))
+ if (is_ocean(t1) ^ is_ocean(t2)) {
gdk_draw_line(pm, civ_gc,
canvas_x, canvas_y,
canvas_x + NORMAL_TILE_WIDTH, canvas_y);
+ }
}
}
} else {
@@ -1843,7 +1845,7 @@ static void pixmap_put_tile_iso(GdkDrawa
}
if (draw_terrain) {
- if (map_get_terrain(x, y) == T_OCEAN) { /* coasts */
+ if (is_ocean(map_get_terrain(x, y))) { /* coasts */
int dx, dy;
/* top */
dx = offset_x-NORMAL_TILE_WIDTH/4;
@@ -1935,18 +1937,20 @@ static void pixmap_put_tile_iso(GdkDrawa
x1 = x; y1 = y-1;
if (normalize_map_pos(&x1, &y1)) {
t2 = map_get_terrain(x1, y1);
- if (draw & D_M_R && ((t1 == T_OCEAN) ^ (t2 == T_OCEAN)))
+ if (draw & D_M_R && (is_ocean(t1) ^ is_ocean(t2))) {
gdk_draw_line(pm, thin_line_gc,
canvas_x+NORMAL_TILE_WIDTH/2, canvas_y,
canvas_x+NORMAL_TILE_WIDTH,
canvas_y+NORMAL_TILE_HEIGHT/2);
+ }
}
x1 = x-1; y1 = y;
if (normalize_map_pos(&x1, &y1)) {
t2 = map_get_terrain(x1, y1);
- if (draw & D_M_L && ((t1 == T_OCEAN) ^ (t2 == T_OCEAN)))
+ if (draw & D_M_L && (is_ocean(t1) ^ is_ocean(t2))) {
gdk_draw_line(pm, thin_line_gc,
canvas_x, canvas_y + NORMAL_TILE_HEIGHT/2,
canvas_x+NORMAL_TILE_WIDTH/2, canvas_y);
+ }
}
}
Index: client//gui-mui/graphics.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-mui/graphics.c,v
retrieving revision 1.29
diff -u -3 -p -r1.29 graphics.c
--- client//gui-mui/graphics.c 2003/01/05 15:34:05 1.29
+++ client//gui-mui/graphics.c 2003/01/11 02:19:32
@@ -949,8 +949,7 @@ void put_tile(struct RastPort *rp, int x
if (normalize_map_pos(&x1, &y1)) {
t2 = map_get_terrain(x1, y1);
/* left side */
- if ((t1 == T_OCEAN) ^ (t2 == T_OCEAN))
- {
+ if (is_ocean(t1) ^ is_ocean(t2)) {
Move(rp, canvas_x, canvas_y);
Draw(rp, canvas_x, canvas_y + NORMAL_TILE_HEIGHT-1);
}
@@ -959,8 +958,7 @@ void put_tile(struct RastPort *rp, int x
x1 = x; y1 = y-1;
if (normalize_map_pos(&x1, &y1)) {
t2 = map_get_terrain(x1, y1);
- if ((t1 == T_OCEAN) ^ (t2 == T_OCEAN))
- {
+ if (is_ocean(t1) ^ is_ocean(t2)) {
Move(rp, canvas_x, canvas_y);
Draw(rp, canvas_x + NORMAL_TILE_WIDTH-1, canvas_y);
}
@@ -1270,7 +1268,7 @@ static void put_tile_iso(struct RastPort
}
if (draw_terrain) {
- if (map_get_terrain(x, y) == T_OCEAN) { /* coasts */
+ if (is_ocean(map_get_terrain(x, y))) { /* coasts */
int dx, dy;
/* top */
@@ -1352,7 +1350,7 @@ static void put_tile_iso(struct RastPort
x1 = x; y1 = y-1;
if (normalize_map_pos(&x1, &y1)) {
t2 = map_get_terrain(x1, y1);
- if (draw & D_M_R && ((t1 == T_OCEAN) ^ (t2 == T_OCEAN))) {
+ if (draw & D_M_R && (is_ocean(t1) ^ is_ocean(t2))) {
Move(rp, canvas_x + NORMAL_TILE_WIDTH/2, canvas_y);
Draw(rp, canvas_x + NORMAL_TILE_WIDTH, canvas_y+NORMAL_TILE_HEIGHT/2);
}
@@ -1360,7 +1358,7 @@ static void put_tile_iso(struct RastPort
x1 = x-1; y1 = y;
if (normalize_map_pos(&x1, &y1)) {
t2 = map_get_terrain(x1, y1);
- if (draw & D_M_L && ((t1 == T_OCEAN) ^ (t2 == T_OCEAN))) {
+ if (draw & D_M_L && (is_ocean(t1) ^ is_ocean(t2))) {
Move(rp, canvas_x, canvas_y + NORMAL_TILE_HEIGHT/2);
Draw(rp, canvas_x+NORMAL_TILE_WIDTH/2, canvas_y);
}
Index: client//gui-mui/overviewclass.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-mui/overviewclass.c,v
retrieving revision 1.17
diff -u -3 -p -r1.17 overviewclass.c
--- client//gui-mui/overviewclass.c 2003/01/01 11:51:33 1.17
+++ client//gui-mui/overviewclass.c 2003/01/11 02:19:33
@@ -180,8 +180,7 @@ static LONG Overview_GetMapPen(struct Ov
}
else
{
- if (ptile->terrain == T_OCEAN)
- {
+ if (is_ocean(ptile->terrain)) {
return data->pen_ocean;
}
else
Index: client//gui-sdl/mapview.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-sdl/mapview.c,v
retrieving revision 1.6
diff -u -3 -p -r1.6 mapview.c
--- client//gui-sdl/mapview.c 2003/01/05 23:19:18 1.6
+++ client//gui-sdl/mapview.c 2003/01/11 02:19:34
@@ -1051,7 +1051,7 @@ void overview_update_tile(int col, int r
SDL_FillRect(pMMap->theme, &cell_size, 0);
return;
} else {
- if (map_get_terrain(col, row) == T_OCEAN) {
+ if (is_ocean(map_get_terrain(col, row))) {
color = get_game_color(COLOR_STD_OCEAN);
} else {
pCity = map_get_city(col, row);
@@ -1102,7 +1102,7 @@ void refresh_overview_canvas(void)
if (tile_get_known(col, row) == TILE_UNKNOWN) {
SDL_FillRect(pMMap->theme, &cell_size, 0);
} else {
- if (map_get_terrain(col, row) == T_OCEAN) {
+ if (is_ocean(map_get_terrain(col, row))) {
SDL_FillRect(pMMap->theme, &cell_size, ocean_color);
} else {
pCity = map_get_city(col, row);
@@ -1520,7 +1520,7 @@ static void draw_map_cell(SDL_Surface *
if (draw_terrain) {
if (citymode) {
- if (map_get_terrain(map_col, map_row) == T_OCEAN) { /* coasts */
+ if (is_ocean(map_get_terrain(map_col, map_row))) { /* coasts */
/* top */
des.x += NORMAL_TILE_WIDTH / 4;
SDL_BlitSurface(pCoasts[0], NULL, pBufSurface, &des);
@@ -1620,20 +1620,22 @@ static void draw_map_cell(SDL_Surface *
y1 = y - 1;
if (normalize_map_pos(&x1, &y1)) {
t2 = map_get_terrain(x1, y1);
- if (draw & D_M_R && ((t1 == T_OCEAN) ^ (t2 == T_OCEAN)))
+ if (draw & D_M_R && (is_ocean(t1) ^ is_ocean(t2))) {
gdk_draw_line(pm, thin_line_gc,
canvas_x + NORMAL_TILE_WIDTH / 2, canvas_y,
canvas_x + NORMAL_TILE_WIDTH,
canvas_y + NORMAL_TILE_HEIGHT / 2);
+ }
}
x1 = x - 1;
y1 = y;
if (normalize_map_pos(&x1, &y1)) {
t2 = map_get_terrain(x1, y1);
- if (draw & D_M_L && ((t1 == T_OCEAN) ^ (t2 == T_OCEAN)))
+ if (draw & D_M_L && (is_ocean(t1) ^ is_ocean(t2))) {
gdk_draw_line(pm, thin_line_gc,
canvas_x, canvas_y + NORMAL_TILE_HEIGHT / 2,
canvas_x + NORMAL_TILE_WIDTH / 2, canvas_y);
+ }
}
#endif
}
@@ -2800,12 +2802,12 @@ static void rebuild_coast_tile( SDL_Surf
/* put coasts */
for (i = 0; i < 4; i++) {
- array_index = ((ttype_near[dir_ccw(dirs[i])] != T_OCEAN ? 1 : 0)
- + (ttype_near[dirs[i]] != T_OCEAN ? 2 : 0)
- + (ttype_near[dir_cw(dirs[i])] != T_OCEAN ? 4 : 0));
+ array_index = ((!is_ocean(ttype_near[dir_ccw(dirs[i])]) ? 1 : 0)
+ + (!is_ocean(ttype_near[dirs[i]]) ? 2 : 0)
+ + (!is_ocean(ttype_near[dir_cw(dirs[i])]) ? 4 : 0));
-
-
+
+
coasts[i] = (SDL_Surface *)sprites.tx.coast_cape_iso[array_index][i];
}
@@ -2864,17 +2866,18 @@ void init_cells_sprites(void)
pT2_TERRAIN = (SDL_Surface *)sprites.black_tile;
if ( t1 <= t2 )
{
- if ( t1 != T_OCEAN && t2 != T_OCEAN )
+ if (!is_ocean(t1) && !is_ocean(t2)) {
rebuild_blending_tile( pDither , pT2_TERRAIN );
+ }
for ( blend = 0; blend < MAX_BLEND; blend++ )
{
- if ( t1 == T_OCEAN || t2 == T_OCEAN )
+ if (is_ocean(t1) || is_ocean(t2)) {
rebuild_coast_tile( pDither , blend );
+ }
for ( corner = 0 ; corner < MAX_CORNER ; corner++ )
{
pBuf = create_surf( w , h , SDL_SWSURFACE );
- if ( t1 != T_OCEAN && t2 != T_OCEAN )
- {
+ if (!is_ocean(t1) && !is_ocean(t2)) {
t1_src.x = (!corner || corner == 2) ? 0 : w;
t1_src.y = ( corner > 1 ) ? h : 0;
@@ -2886,9 +2889,8 @@ void init_cells_sprites(void)
SDL_BlitSurface( pDither[blend] , &t1_src , pBuf , NULL );
}
else
- { /* t1 == T_OCEAN || t2 == T_OCEAN */
- if ( t1 == T_OCEAN && t2 == T_UNKNOWN )
- {
+ { /* is_ocean(t1) || is_ocean(t2) */
+ if (is_ocean(t1) && t2 == T_UNKNOWN) {
t1_src.x = ((corner % 2) == 0) * w - w / 2 ;
t1_src.y = 0;
SDL_BlitSurface(
@@ -2903,10 +2905,9 @@ void init_cells_sprites(void)
t1_src.w = w;
t1_src.h = h;
- }/* t1 == T_OCEAN && t2 == T_UNKNOWN */
+ }/* is_ocean(t1) && t2 == T_UNKNOWN */
- if ( t1 == T_OCEAN && t2 != T_OCEAN && t2 != T_UNKNOWN )
- {
+ if (is_ocean(t1) && !is_ocean(t2) && t2 != T_UNKNOWN) {
t2_src.x = w - ((corner % 2) > 0) * w;
t2_src.y = h - ( corner > 1 ) * h;
SDL_BlitSurface( pT2_TERRAIN , &t2_src , pBuf , NULL );
@@ -2932,10 +2933,9 @@ void init_cells_sprites(void)
t1_src.y = ( corner > 1 ) ? h : 0;
SDL_BlitSurface( pDither[corner] , &t1_src , pBuf , NULL );
- } /* t1 == T_OCEAN && t2 != T_OCEAN */
+ } /* is_ocean(t1) && !is_ocean(t2) */
- if ( t1 != T_OCEAN && t2 == T_OCEAN )
- {
+ if (!is_ocean(t1) && is_ocean(t2)) {
t1_src.x = ((corner % 2) > 0) * w;
t1_src.y = ( corner > 1 ) * h;
SDL_BlitSurface( pT1_TERRAIN , &t1_src , pBuf , NULL );
@@ -2959,12 +2959,10 @@ void init_cells_sprites(void)
t2_src.y = ( corner > 1 ) ? 0 : h;
SDL_BlitSurface( pDither[corner] , &t2_src , pBuf , NULL );
- }/* t1 != T_OCEAN && t2 == T_OCEAN */
+ }/* !is_ocean(t1) && is_ocean(t2) */
- if ( t1 == T_OCEAN && t2 == T_OCEAN )
- {
- if ( !corner )
- {
+ if (is_ocean(t1) && is_ocean(t2)) {
+ if (!corner) {
t2_src.x = w / 2 ;
t2_src.y = 0;
SDL_BlitSurface(
@@ -2996,9 +2994,9 @@ void init_cells_sprites(void)
pBuf = cells[t1][t2][blend][0];
}
- }/* t1 == T_OCEAN && t2 == T_OCEAN */
+ }/* is_ocean(t1) && is_ocean(t2) */
- } /* t1 == T_OCEAN || t2 == T_OCEAN */
+ } /* is_ocean(t1) || is_ocean(t2) */
cells[t1][t2][blend][corner] = pBuf;
} /* for */
Index: client//gui-win32/cityrep.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-win32/cityrep.c,v
retrieving revision 1.19
diff -u -3 -p -r1.19 cityrep.c
--- client//gui-win32/cityrep.c 2003/01/05 15:34:06 1.19
+++ client//gui-win32/cityrep.c 2003/01/11 02:19:34
@@ -575,8 +575,9 @@ static void list_coastal_select(HWND hLs
for (i=0;i<num;i++)
{
pcity=(struct city *)ListBox_GetItemData(hLst,i);
- if (is_terrain_near_tile(pcity->x, pcity->y, T_OCEAN))
+ if (is_ocean_near_tile(pcity->x, pcity->y)) {
ListBox_SetSel(hLst,TRUE,i);
+ }
}
}
Index: client//gui-win32/mapview.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-win32/mapview.c,v
retrieving revision 1.49
diff -u -3 -p -r1.49 mapview.c
--- client//gui-win32/mapview.c 2003/01/05 15:34:06 1.49
+++ client//gui-win32/mapview.c 2003/01/11 02:19:35
@@ -336,17 +336,16 @@ void pixmap_put_tile(HDC hdc, int x, int
if (normalize_map_pos(&x1, &y1)) {
t2 = map_get_terrain(x1, y1);
/* left side */
- if ((t1 == T_OCEAN) ^ (t2 == T_OCEAN)) {
+ if (is_ocean(t1) ^ is_ocean(t2)) {
MoveToEx(hdc,canvas_x,canvas_y,NULL);
LineTo(hdc,canvas_x,canvas_y+NORMAL_TILE_HEIGHT);
-
}
}
/* top side */
x1 = x; y1 = y-1;
if (normalize_map_pos(&x1, &y1)) {
t2 = map_get_terrain(x1, y1);
- if ((t1 == T_OCEAN) ^ (t2 == T_OCEAN)) {
+ if (is_ocean(t1) ^ is_ocean(t2)) {
MoveToEx(hdc,canvas_x,canvas_y,NULL);
LineTo(hdc,canvas_x+NORMAL_TILE_WIDTH,canvas_y);
}
@@ -1594,7 +1593,7 @@ static void pixmap_put_tile_iso(HDC hdc,
SelectObject(hdc,oldbrush);
}
if (draw_terrain) {
- if (map_get_terrain(x, y) == T_OCEAN) { /* coasts */
+ if (is_ocean(map_get_terrain(x, y))) { /* coasts */
int dx, dy;
/* top */
dx = offset_x-NORMAL_TILE_WIDTH/4;
@@ -1685,7 +1684,7 @@ static void pixmap_put_tile_iso(HDC hdc,
y1=y-1;
if (normalize_map_pos(&x1,&y1)) {
t2=map_get_terrain(x1,y1);
- if (draw & D_M_R && ((t1==T_OCEAN) ^ (t2==T_OCEAN))) {
+ if (draw & D_M_R && (is_ocean(t1) ^ is_ocean(t2))) {
MoveToEx(hdc,canvas_x+NORMAL_TILE_WIDTH/2,canvas_y,NULL);
LineTo(hdc,canvas_x+NORMAL_TILE_WIDTH,
canvas_y+NORMAL_TILE_HEIGHT/2);
@@ -1695,7 +1694,7 @@ static void pixmap_put_tile_iso(HDC hdc,
y1=y;
if (normalize_map_pos(&x1, &y1)) {
t2 = map_get_terrain(x1, y1);
- if (draw & D_M_L && ((t1 == T_OCEAN) ^ (t2 == T_OCEAN))){
+ if (draw & D_M_L && (is_ocean(t1) ^ is_ocean(t2))) {
MoveToEx(hdc,canvas_x,canvas_y+NORMAL_TILE_HEIGHT/2,NULL);
LineTo(hdc,canvas_x+NORMAL_TILE_WIDTH/2,canvas_y);
}
Index: client//gui-xaw/mapview.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-xaw/mapview.c,v
retrieving revision 1.116
diff -u -3 -p -r1.116 mapview.c
--- client//gui-xaw/mapview.c 2003/01/05 15:34:06 1.116
+++ client//gui-xaw/mapview.c 2003/01/11 02:19:36
@@ -924,19 +924,21 @@ void pixmap_put_tile(Pixmap pm, int x, i
if (normalize_map_pos(&x1, &y1)) {
t2 = map_get_terrain(x1, y1);
/* left side */
- if ((t1 == T_OCEAN) ^ (t2 == T_OCEAN))
+ if (is_ocean(t1) ^ is_ocean(t2)) {
XDrawLine(display, pm, civ_gc,
canvas_x, canvas_y,
canvas_x, canvas_y + NORMAL_TILE_HEIGHT);
+ }
}
/* top side */
x1 = x; y1 = y-1;
if (normalize_map_pos(&x1, &y1)) {
t2 = map_get_terrain(x1, y1);
- if ((t1 == T_OCEAN) ^ (t2 == T_OCEAN))
+ if (is_ocean(t1) ^ is_ocean(t2)) {
XDrawLine(display, pm, civ_gc,
canvas_x, canvas_y,
canvas_x + NORMAL_TILE_WIDTH, canvas_y);
+ }
}
}
} else {
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Freeciv-Dev] [Fwd: Re: Re: (PR#2741) Removing explicit mentioning of T_OCEAN],
Jason Short via RT <=
|
|