From e8537f5512efde0c25833d22c61eee38fd9e56a6 Mon Sep 17 00:00:00 2001 From: tron Date: Tue, 23 Nov 2004 22:36:11 +0000 Subject: [PATCH] (svn r787) Invert the sense of the DO_TRANS_BUILDINGS flag to be consistent with its own name and all other DO_* flags. Now it is active-true. --- industry_cmd.c | 4 ++-- main_gui.c | 2 +- news_gui.c | 2 +- rail_cmd.c | 2 +- road_cmd.c | 2 +- station_cmd.c | 4 ++-- town_cmd.c | 4 ++-- tree_cmd.c | 4 ++-- ttd.c | 2 +- tunnelbridge_cmd.c | 12 ++++++------ unmovable_cmd.c | 8 ++++---- viewport.c | 4 ++-- water_cmd.c | 4 ++-- 13 files changed, 27 insertions(+), 27 deletions(-) diff --git a/industry_cmd.c b/industry_cmd.c index 81ef17810c..80410febb4 100644 --- a/industry_cmd.c +++ b/industry_cmd.c @@ -307,7 +307,7 @@ static void DrawTile_Industry(TileInfo *ti) if (image&0x8000 && (image & 0xFFFF0000) == 0) image |= ormod; - if (!(_display_opt & DO_TRANS_BUILDINGS)) + if (_display_opt & DO_TRANS_BUILDINGS) image = (image & 0x3FFF) | 0x3224000; AddSortableSpriteToDraw(image, @@ -318,7 +318,7 @@ static void DrawTile_Industry(TileInfo *ti) dits->dz, z); - if (!(_display_opt & DO_TRANS_BUILDINGS)) + if (_display_opt & DO_TRANS_BUILDINGS) return; } diff --git a/main_gui.c b/main_gui.c index a97f2dbb7f..f1f0ea286c 100644 --- a/main_gui.c +++ b/main_gui.c @@ -849,7 +849,7 @@ static void ToolbarOptionsClick(Window *w) if (_display_opt & DO_WAYPOINTS) x &= ~(1<<8); if (_display_opt & DO_FULL_ANIMATION) x &= ~(1<<9); if (_display_opt & DO_FULL_DETAIL) x &= ~(1<<10); - if (!(_display_opt & DO_TRANS_BUILDINGS)) x &= ~(1<<11); + if (_display_opt & DO_TRANS_BUILDINGS) x &= ~(1<<11); WP(w,menu_d).checked_items = x; } diff --git a/news_gui.c b/news_gui.c index 163880205b..22af2ce764 100644 --- a/news_gui.c +++ b/news_gui.c @@ -117,7 +117,7 @@ static void NewsWindowProc(Window *w, WindowEvent *e) ni->string_id, 426); } else { byte bk = _display_opt; - _display_opt |= DO_TRANS_BUILDINGS; + _display_opt &= ~DO_TRANS_BUILDINGS; DrawWindowViewport(w); _display_opt = bk; diff --git a/rail_cmd.c b/rail_cmd.c index ace3b5a16e..9e63f870dd 100644 --- a/rail_cmd.c +++ b/rail_cmd.c @@ -1425,7 +1425,7 @@ static void DrawSpecialBuilding(uint32 image, uint32 tracktype_offs, if (image & 0x8000) image |= _drawtile_track_palette; image += tracktype_offs; - if (!(_display_opt & DO_TRANS_BUILDINGS)) // show transparent depots + if (_display_opt & DO_TRANS_BUILDINGS) // show transparent depots image = (image & 0x3FFF) | 0x3224000; AddSortableSpriteToDraw(image, ti->x + x, ti->y + y, xsize, ysize, zsize, ti->z + z); } diff --git a/road_cmd.c b/road_cmd.c index 5afc94129e..b189640cb1 100644 --- a/road_cmd.c +++ b/road_cmd.c @@ -818,7 +818,7 @@ static void DrawTile_Road(TileInfo *ti) while ((image=drss->image) != 0) { if (image & 0x8000) image |= ormod; - if (!(_display_opt & DO_TRANS_BUILDINGS)) // show transparent depots + if (_display_opt & DO_TRANS_BUILDINGS) // show transparent depots image = (image & 0x3FFF) | 0x3224000; AddSortableSpriteToDraw(image, ti->x | drss->subcoord_x, diff --git a/station_cmd.c b/station_cmd.c index 6cb28fac0c..9074324cf0 100644 --- a/station_cmd.c +++ b/station_cmd.c @@ -1950,9 +1950,9 @@ static void DrawTile_Station(TileInfo *ti) // For custom sprites, there's no railtype-based pitching. image += railtype * ((image & 0x3FFF) < _custom_sprites_base ? TRACKTYPE_SPRITE_PITCH : 0); if (_display_opt & DO_TRANS_BUILDINGS) { - if (image&0x8000) image |= image_or_modificator; - } else { image = (image & 0x3FFF) | 0x03224000; + } else { + if (image&0x8000) image |= image_or_modificator; } if ((byte)dtss->delta_z != 0x80) { diff --git a/town_cmd.c b/town_cmd.c index e96494a83f..e0c616864d 100644 --- a/town_cmd.c +++ b/town_cmd.c @@ -85,7 +85,7 @@ static void DrawTile_Town(TileInfo *ti) /* Add a house on top of the ground? */ if ((image = dcts->sprite_2) != 0) { - if (!(_display_opt & DO_TRANS_BUILDINGS)) + if (_display_opt & DO_TRANS_BUILDINGS) image = (image & 0x3FFF) | 0x3224000; AddSortableSpriteToDraw(image, @@ -96,7 +96,7 @@ static void DrawTile_Town(TileInfo *ti) dcts->dz, z); - if (!(_display_opt & DO_TRANS_BUILDINGS)) + if (_display_opt & DO_TRANS_BUILDINGS) return; } diff --git a/tree_cmd.c b/tree_cmd.c index c8a122732d..55b17fd0dc 100644 --- a/tree_cmd.c +++ b/tree_cmd.c @@ -288,7 +288,7 @@ static void DrawTile_Trees(TileInfo *ti) StartSpriteCombine(); - if((_display_opt & DO_TRANS_BUILDINGS) || !_patches.invisible_trees) + if (!(_display_opt & DO_TRANS_BUILDINGS) || !_patches.invisible_trees) { int i; @@ -296,7 +296,7 @@ static void DrawTile_Trees(TileInfo *ti) i = (ti->map5 >> 6) + 1; do { uint32 image = s[0] + (--i==0 ? (ti->map5 & 7) : 3); - if (!(_display_opt & DO_TRANS_BUILDINGS)) + if (_display_opt & DO_TRANS_BUILDINGS) image = (image & 0x3FFF) | 0x3224000; te[i].image = image; te[i].x = d[0]; diff --git a/ttd.c b/ttd.c index 1393d4d0fe..a4052711e8 100644 --- a/ttd.c +++ b/ttd.c @@ -641,7 +641,7 @@ static void LoadIntroGame() { char filename[256]; _game_mode = GM_MENU; - _display_opt |= DO_TRANS_BUILDINGS; // don't make buildings transparent in intro + _display_opt &= ~DO_TRANS_BUILDINGS; // don't make buildings transparent in intro _opt_mod_ptr = &_new_opt; GfxLoadSprites(); diff --git a/tunnelbridge_cmd.c b/tunnelbridge_cmd.c index 744b0e08b8..1e1d61fa08 100644 --- a/tunnelbridge_cmd.c +++ b/tunnelbridge_cmd.c @@ -936,7 +936,7 @@ static void DrawBridgePillars(TileInfo *ti, int x, int y, int z) image = b[12 + (ti->map5&0x01)]; piece = _map2[ti->tile]&0xF; if (image != 0 && piece != 0) { - if (!(_display_opt & DO_TRANS_BUILDINGS)) image = (image & 0x3FFF) | 0x03224000; + if (_display_opt & DO_TRANS_BUILDINGS) image = (image & 0x3FFF) | 0x03224000; DrawGroundSpriteAt(image, x, y, z); } @@ -953,7 +953,7 @@ static void DrawBridgePillars(TileInfo *ti, int x, int y, int z) {2,4,8,1, 11,16,9,0}, }; - if (!(_display_opt & DO_TRANS_BUILDINGS)) image = (image & 0x3FFF) | 0x03224000; + if (_display_opt & DO_TRANS_BUILDINGS) image = (image & 0x3FFF) | 0x03224000; p = _tileh_bits[(image & 1) * 2 + (ti->map5&0x01)]; front_height = ti->z + ((ti->tileh & p[0])?8:0); @@ -1047,7 +1047,7 @@ static void DrawTile_TunnelBridge(TileInfo *ti) } // draw ramp - if (!(_display_opt & DO_TRANS_BUILDINGS)) image = (image & 0x3FFF) | 0x03224000; + if (_display_opt & DO_TRANS_BUILDINGS) image = (image & 0x3FFF) | 0x03224000; AddSortableSpriteToDraw(image, ti->x, ti->y, 16, 16, 7, ti->z); } else { // bridge middle part. @@ -1094,13 +1094,13 @@ static void DrawTile_TunnelBridge(TileInfo *ti) // draw rail image = b[0]; - if (!(_display_opt & DO_TRANS_BUILDINGS)) image = (image & 0x3FFF) | 0x03224000; + if (_display_opt & DO_TRANS_BUILDINGS) image = (image & 0x3FFF) | 0x03224000; AddSortableSpriteToDraw(image, ti->x, ti->y, (ti->map5&1)?11:16, (ti->map5&1)?16:11, 1, z); x = ti->x; y = ti->y; image = b[1]; - if (!(_display_opt & DO_TRANS_BUILDINGS)) image = (image & 0x3FFF) | 0x03224000; + if (_display_opt & DO_TRANS_BUILDINGS) image = (image & 0x3FFF) | 0x03224000; // draw roof if (ti->map5&1) { @@ -1115,7 +1115,7 @@ static void DrawTile_TunnelBridge(TileInfo *ti) // draw poles below for small bridges image = b[2]; if (image) { - if (!(_display_opt & DO_TRANS_BUILDINGS)) image = (image & 0x3FFF) | 0x03224000; + if (_display_opt & DO_TRANS_BUILDINGS) image = (image & 0x3FFF) | 0x03224000; DrawGroundSpriteAt(image, x, y, z); } } else if (_patches.bridge_pillars) { diff --git a/unmovable_cmd.c b/unmovable_cmd.c index 34f71bc9d4..44700ab213 100644 --- a/unmovable_cmd.c +++ b/unmovable_cmd.c @@ -33,7 +33,7 @@ static void DrawTile_Unmovable(TileInfo *ti) image = PLAYER_SPRITE_COLOR(_map_owner[ti->tile]); image += 0x8A48; - if (!(_display_opt & DO_TRANS_BUILDINGS)) + if (_display_opt & DO_TRANS_BUILDINGS) image = (image & 0x3FFF) | 0x3224000; AddSortableSpriteToDraw(image, ti->x, ti->y, 16, 16, 25, ti->z); } else if (ti->map5 == 3) { @@ -59,7 +59,7 @@ static void DrawTile_Unmovable(TileInfo *ti) dtus = &_draw_tile_unmovable_data[ti->map5]; image = dtus->image; - if (!(_display_opt & DO_TRANS_BUILDINGS)) + if (_display_opt & DO_TRANS_BUILDINGS) image = (image & 0x3FFF) | 0x3224000; AddSortableSpriteToDraw(image, @@ -82,9 +82,9 @@ static void DrawTile_Unmovable(TileInfo *ti) foreach_draw_tile_seq(dtss, t->seq) { image = dtss->image; if (_display_opt & DO_TRANS_BUILDINGS) { - image |= ormod; - } else { image = (image & 0x3FFF) | 0x03224000; + } else { + image |= ormod; } AddSortableSpriteToDraw(image, ti->x + dtss->delta_x, ti->y + dtss->delta_y, dtss->width, dtss->height, dtss->unk, ti->z + dtss->delta_z); diff --git a/viewport.c b/viewport.c index da415f3d6d..76db3b5977 100644 --- a/viewport.c +++ b/viewport.c @@ -1104,12 +1104,12 @@ static void ViewportDrawStrings(DrawPixelInfo *dpi, StringSpriteToDraw *ss) w -= 3; } - DrawFrameRect(x,y, x+w, bottom, ss->color, (_display_opt & DO_TRANS_BUILDINGS) ? 0 : 0x9); + DrawFrameRect(x,y, x+w, bottom, ss->color, (_display_opt & DO_TRANS_BUILDINGS) ? 0x9 : 0); } SET_DPARAM32(0, ss->params[0]); SET_DPARAM32(1, ss->params[1]); - if (!(_display_opt & DO_TRANS_BUILDINGS) && ss->width != 0) { + if (_display_opt & DO_TRANS_BUILDINGS && ss->width != 0) { /* This is such a frustrating mess - I need to convert * from real color codes to string color codes and guess * what, they are completely different. --pasky */ diff --git a/water_cmd.c b/water_cmd.c index 8ad8ef9bc2..f7393cf9a1 100644 --- a/water_cmd.c +++ b/water_cmd.c @@ -390,9 +390,9 @@ static void DrawWaterStuff(TileInfo *ti, const byte *t, uint32 palette, uint bas for(wdts = (const WaterDrawTileStruct *)t; (byte)wdts->delta_x != 0x80; wdts++) { image = wdts->image + base; if (_display_opt & DO_TRANS_BUILDINGS) { - image |= palette; - } else { image = (image & 0x3FFF) | 0x03224000; + } else { + image |= palette; } AddSortableSpriteToDraw(image, ti->x + wdts->delta_x, ti->y + wdts->delta_y, wdts->width, wdts->height, wdts->unk, ti->z + wdts->delta_z); }