Index: rail_cmd.cpp =================================================================== --- rail_cmd.cpp (revision 11177) +++ rail_cmd.cpp (working copy) @@ -40,6 +40,7 @@ #include "train.h" #include "misc/autoptr.hpp" #include "autoslope.h" +#include "transparency.h" const byte _track_sloped_sprites[14] = { 14, 15, 22, 13, @@ -1569,7 +1570,7 @@ image += relocation; } - if (!HASBIT(_transparent_opt, TO_BUILDINGS) && HASBIT(image, PALETTE_MODIFIER_COLOR)) { + if (!IsOptionTransparent(TO_BUILDINGS) && HASBIT(image, PALETTE_MODIFIER_COLOR)) { pal = _drawtile_track_palette; } else { pal = dtss->pal; @@ -1581,7 +1582,7 @@ ti->x + dtss->delta_x, ti->y + dtss->delta_y, dtss->size_x, dtss->size_y, dtss->size_z, ti->z + dtss->delta_z, - HASBIT(_transparent_opt, TO_BUILDINGS) + IsOptionTransparent(TO_BUILDINGS) ); } else { AddChildSpriteScreen(image, pal, dtss->delta_x, dtss->delta_y); Index: station_cmd.cpp =================================================================== --- station_cmd.cpp (revision 11177) +++ station_cmd.cpp (working copy) @@ -43,6 +43,7 @@ #include "cargotype.h" #include "strings.h" #include "autoslope.h" +#include "transparency.h" DEFINE_OLD_POOL_GENERIC(Station, Station) DEFINE_OLD_POOL_GENERIC(RoadStop, RoadStop) @@ -2100,7 +2101,7 @@ } SpriteID pal; - if (!HASBIT(_transparent_opt, TO_BUILDINGS) && HASBIT(image, PALETTE_MODIFIER_COLOR)) { + if (!IsOptionTransparent(TO_BUILDINGS) && HASBIT(image, PALETTE_MODIFIER_COLOR)) { pal = palette; } else { pal = dtss->pal; @@ -2112,7 +2113,7 @@ ti->x + dtss->delta_x, ti->y + dtss->delta_y, dtss->size_x, dtss->size_y, dtss->size_z, ti->z + dtss->delta_z, - HASBIT(_transparent_opt, TO_BUILDINGS) + IsOptionTransparent(TO_BUILDINGS) ); } else { AddChildSpriteScreen(image, pal, dtss->delta_x, dtss->delta_y); Index: town_cmd.cpp =================================================================== --- town_cmd.cpp (revision 11177) +++ town_cmd.cpp (working copy) @@ -42,6 +42,7 @@ #include "newgrf_townname.h" #include "misc/autoptr.hpp" #include "autoslope.h" +#include "transparency.h" /* Initialize the town-pool */ DEFINE_OLD_POOL_GENERIC(Town, Town) @@ -175,10 +176,10 @@ dcts->height, dcts->dz, ti->z, - HASBIT(_transparent_opt, TO_HOUSES) + IsOptionTransparent(TO_HOUSES) ); - if (HASBIT(_transparent_opt, TO_HOUSES)) return; + if (IsOptionTransparent(TO_HOUSES)) return; } { Index: road_cmd.cpp =================================================================== --- road_cmd.cpp (revision 11177) +++ road_cmd.cpp (working copy) @@ -33,6 +33,7 @@ #include "tunnel_map.h" #include "misc/autoptr.hpp" #include "autoslope.h" +#include "transparency.h" #define M(x) (1 << (x)) /* Level crossings may only be built on these slopes */ @@ -948,7 +949,7 @@ void DrawTramCatenary(TileInfo *ti, RoadBits tram) { /* Don't draw the catenary under a low bridge */ - if (MayHaveBridgeAbove(ti->tile) && IsBridgeAbove(ti->tile) && !HASBIT(_transparent_opt, TO_BUILDINGS)) { + if (MayHaveBridgeAbove(ti->tile) && IsBridgeAbove(ti->tile) && !IsOptionTransparent(TO_BUILDINGS)) { uint height = GetBridgeHeight(GetNorthernBridgeEnd(ti->tile)); if (height <= GetTileMaxZ(ti->tile) + TILE_HEIGHT) return; @@ -965,8 +966,8 @@ front = SPR_TRAMWAY_BASE + _road_frontwire_sprites_1[tram]; } - AddSortableSpriteToDraw(back, PAL_NONE, ti->x, ti->y, 16, 16, TILE_HEIGHT + BB_HEIGHT_UNDER_BRIDGE, ti->z, HASBIT(_transparent_opt, TO_BUILDINGS)); - AddSortableSpriteToDraw(front, PAL_NONE, ti->x, ti->y, 16, 16, TILE_HEIGHT + BB_HEIGHT_UNDER_BRIDGE, ti->z, HASBIT(_transparent_opt, TO_BUILDINGS)); + AddSortableSpriteToDraw(back, PAL_NONE, ti->x, ti->y, 16, 16, TILE_HEIGHT + BB_HEIGHT_UNDER_BRIDGE, ti->z, IsOptionTransparent(TO_BUILDINGS)); + AddSortableSpriteToDraw(front, PAL_NONE, ti->x, ti->y, 16, 16, TILE_HEIGHT + BB_HEIGHT_UNDER_BRIDGE, ti->z, IsOptionTransparent(TO_BUILDINGS)); } /** @@ -1122,7 +1123,7 @@ SpriteID image = dtss->image; SpriteID pal; - if (!HASBIT(_transparent_opt, TO_BUILDINGS) && HASBIT(image, PALETTE_MODIFIER_COLOR)) { + if (!IsOptionTransparent(TO_BUILDINGS) && HASBIT(image, PALETTE_MODIFIER_COLOR)) { pal = palette; } else { pal = PAL_NONE; @@ -1133,7 +1134,7 @@ ti->x + dtss->delta_x, ti->y + dtss->delta_y, dtss->size_x, dtss->size_y, dtss->size_z, ti->z, - HASBIT(_transparent_opt, TO_BUILDINGS) + IsOptionTransparent(TO_BUILDINGS) ); } break; Index: tree_cmd.cpp =================================================================== --- tree_cmd.cpp (revision 11177) +++ tree_cmd.cpp (working copy) @@ -20,6 +20,7 @@ #include "sound.h" #include "variables.h" #include "genworld.h" +#include "transparency.h" /** * List of tree placer algorithm. @@ -426,7 +427,7 @@ StartSpriteCombine(); - if (!HASBIT(_transparent_opt, TO_TREES) || !_patches.invisible_trees) { + if (!IsOptionTransparent(TO_TREES) || !_patches.invisible_trees) { TreeListEnt te[4]; uint i; @@ -459,7 +460,7 @@ if (tep == NULL) break; - AddSortableSpriteToDraw(tep->image, tep->pal, ti->x + tep->x, ti->y + tep->y, 16 - tep->x, 16 - tep->y, 0x30, z, HASBIT(_transparent_opt, TO_TREES), -tep->x, -tep->y); + AddSortableSpriteToDraw(tep->image, tep->pal, ti->x + tep->x, ti->y + tep->y, 16 - tep->x, 16 - tep->y, 0x30, z, IsOptionTransparent(TO_TREES), -tep->x, -tep->y); tep->image = 0; } } Index: tunnelbridge_cmd.cpp =================================================================== --- tunnelbridge_cmd.cpp (revision 11177) +++ tunnelbridge_cmd.cpp (working copy) @@ -33,6 +33,7 @@ #include "date.h" #include "newgrf_sound.h" #include "autoslope.h" +#include "transparency.h" #include "table/bridge_land.h" @@ -859,11 +860,11 @@ * sprites is at the top */ if (z >= front_height) { // front facing pillar - AddSortableSpriteToDraw(image, psid->pal, x, y, p[4], p[5], BB_HEIGHT_UNDER_BRIDGE - 5, z, HASBIT(_transparent_opt, TO_BRIDGES), 0, 0, -5); + AddSortableSpriteToDraw(image, psid->pal, x, y, p[4], p[5], BB_HEIGHT_UNDER_BRIDGE - 5, z, IsOptionTransparent(TO_BRIDGES), 0, 0, -5); } if (drawfarpillar && z >= back_height && z < i - TILE_HEIGHT) { // back facing pillar - AddSortableSpriteToDraw(image, psid->pal, x - p[6], y - p[7], p[4], p[5], BB_HEIGHT_UNDER_BRIDGE - 5, z, HASBIT(_transparent_opt, TO_BRIDGES), 0, 0, -5); + AddSortableSpriteToDraw(image, psid->pal, x - p[6], y - p[7], p[4], p[5], BB_HEIGHT_UNDER_BRIDGE - 5, z, IsOptionTransparent(TO_BRIDGES), 0, 0, -5); } } } @@ -897,16 +898,16 @@ /* The sprites under the vehicles are drawn as SpriteCombine. StartSpriteCombine() has already been called * The bounding boxes here are the same as for bridge front/roof */ - AddSortableSpriteToDraw(SPR_TRAMWAY_BASE + tram_offsets[overlay][offset], PAL_NONE, x, y, size_x[offset], size_y[offset], 0x28, z, HASBIT(_transparent_opt, TO_BRIDGES)); + AddSortableSpriteToDraw(SPR_TRAMWAY_BASE + tram_offsets[overlay][offset], PAL_NONE, x, y, size_x[offset], size_y[offset], 0x28, z, IsOptionTransparent(TO_BRIDGES)); - AddSortableSpriteToDraw(SPR_TRAMWAY_BASE + back_offsets[offset], PAL_NONE, x, y, size_x[offset], size_y[offset], 0x28, z, HASBIT(_transparent_opt, TO_BUILDINGS)); + AddSortableSpriteToDraw(SPR_TRAMWAY_BASE + back_offsets[offset], PAL_NONE, x, y, size_x[offset], size_y[offset], 0x28, z, IsOptionTransparent(TO_BUILDINGS)); /* Start a new SpriteCombine for the front part */ EndSpriteCombine(); StartSpriteCombine(); /* For sloped sprites the bounding box needs to be higher, as the pylons stop on a higher point */ - AddSortableSpriteToDraw(SPR_TRAMWAY_BASE + front_offsets[offset], PAL_NONE, x, y, size_x[offset] + front_bb_offset_x[offset], size_y[offset] + front_bb_offset_y[offset], 0x28, z, HASBIT(_transparent_opt, TO_BUILDINGS), front_bb_offset_x[offset], front_bb_offset_y[offset]); + AddSortableSpriteToDraw(SPR_TRAMWAY_BASE + front_offsets[offset], PAL_NONE, x, y, size_x[offset] + front_bb_offset_x[offset], size_y[offset] + front_bb_offset_y[offset], 0x28, z, IsOptionTransparent(TO_BUILDINGS), front_bb_offset_x[offset], front_bb_offset_y[offset]); } /** @@ -969,7 +970,7 @@ catenary = true; StartSpriteCombine(); - AddSortableSpriteToDraw(SPR_TRAMWAY_TUNNEL_WIRES + dir, PAL_NONE, ti->x, ti->y, BB_data[10], BB_data[11], TILE_HEIGHT, ti->z, HASBIT(_transparent_opt, TO_BUILDINGS), BB_data[8], BB_data[9], BB_Z_SEPARATOR); + AddSortableSpriteToDraw(SPR_TRAMWAY_TUNNEL_WIRES + dir, PAL_NONE, ti->x, ti->y, BB_data[10], BB_data[11], TILE_HEIGHT, ti->z, IsOptionTransparent(TO_BUILDINGS), BB_data[8], BB_data[9], BB_Z_SEPARATOR); } } else if (GetRailType(ti->tile) == RAILTYPE_ELECTRIC) { DrawCatenary(ti); @@ -1028,7 +1029,7 @@ * it doesn't disappear behind it */ AddSortableSpriteToDraw( - psid->sprite, psid->pal, ti->x, ti->y, 16, 16, ti->tileh == SLOPE_FLAT ? 0 : 8, ti->z, HASBIT(_transparent_opt, TO_BRIDGES) + psid->sprite, psid->pal, ti->x, ti->y, 16, 16, ti->tileh == SLOPE_FLAT ? 0 : 8, ti->z, IsOptionTransparent(TO_BRIDGES) ); if (GetBridgeTransportType(ti->tile) == TRANSPORT_ROAD) { @@ -1156,9 +1157,9 @@ /* Draw floor and far part of bridge*/ if (axis == AXIS_X) { - AddSortableSpriteToDraw(psid->sprite, psid->pal, x, y, 16, 1, 0x28, z, HASBIT(_transparent_opt, TO_BRIDGES), 0, 0, BRIDGE_Z_START); + AddSortableSpriteToDraw(psid->sprite, psid->pal, x, y, 16, 1, 0x28, z, IsOptionTransparent(TO_BRIDGES), 0, 0, BRIDGE_Z_START); } else { - AddSortableSpriteToDraw(psid->sprite, psid->pal, x, y, 1, 16, 0x28, z, HASBIT(_transparent_opt, TO_BRIDGES), 0, 0, BRIDGE_Z_START); + AddSortableSpriteToDraw(psid->sprite, psid->pal, x, y, 1, 16, 0x28, z, IsOptionTransparent(TO_BRIDGES), 0, 0, BRIDGE_Z_START); } psid++; @@ -1180,10 +1181,10 @@ /* draw roof, the component of the bridge which is logically between the vehicle and the camera */ if (axis == AXIS_X) { y += 12; - if (psid->sprite & SPRITE_MASK) AddSortableSpriteToDraw(psid->sprite, psid->pal, x, y, 16, 4, 0x28, z, HASBIT(_transparent_opt, TO_BRIDGES), 0, 3, BRIDGE_Z_START); + if (psid->sprite & SPRITE_MASK) AddSortableSpriteToDraw(psid->sprite, psid->pal, x, y, 16, 4, 0x28, z, IsOptionTransparent(TO_BRIDGES), 0, 3, BRIDGE_Z_START); } else { x += 12; - if (psid->sprite & SPRITE_MASK) AddSortableSpriteToDraw(psid->sprite, psid->pal, x, y, 4, 16, 0x28, z, HASBIT(_transparent_opt, TO_BRIDGES), 3, 0, BRIDGE_Z_START); + if (psid->sprite & SPRITE_MASK) AddSortableSpriteToDraw(psid->sprite, psid->pal, x, y, 4, 16, 0x28, z, IsOptionTransparent(TO_BRIDGES), 3, 0, BRIDGE_Z_START); } /* Draw TramFront as SpriteCombine */ @@ -1195,7 +1196,7 @@ if (psid->sprite != 0) { SpriteID image = psid->sprite; SpriteID pal = psid->pal; - if (HASBIT(_transparent_opt, TO_BRIDGES)) { + if (IsOptionTransparent(TO_BRIDGES)) { SETBIT(image, PALETTE_MODIFIER_TRANSPARENT); pal = PALETTE_TO_TRANSPARENT; } Index: texteff.cpp =================================================================== --- texteff.cpp (revision 11177) +++ texteff.cpp (working copy) @@ -14,6 +14,7 @@ #include "console.h" #include "string.h" #include "variables.h" +#include "transparency.h" #include "table/sprites.h" #include "blitter/factory.hpp" #include /* va_list */ @@ -392,7 +393,7 @@ dpi->top <= te->bottom && dpi->left + dpi->width > te->x && dpi->top + dpi->height > te->y) { - if (te->mode == TE_RISING || (_patches.loading_indicators && !HASBIT(_transparent_opt, TO_LOADING))) { + if (te->mode == TE_RISING || (_patches.loading_indicators && !IsOptionTransparent(TO_LOADING))) { AddStringToDraw(te->x, te->y, te->string_id, te->params_1, te->params_2); } } @@ -407,7 +408,7 @@ dpi->top <= te->bottom * 2 - te->y && dpi->left + dpi->width > te->x && dpi->top + dpi->height > te->y) { - if (te->mode == TE_RISING || (_patches.loading_indicators && !HASBIT(_transparent_opt, TO_LOADING))) { + if (te->mode == TE_RISING || (_patches.loading_indicators && !IsOptionTransparent(TO_LOADING))) { AddStringToDraw(te->x, te->y, (StringID)(te->string_id - 1), te->params_1, te->params_2); } } Index: unmovable_cmd.cpp =================================================================== --- unmovable_cmd.cpp (revision 11177) +++ unmovable_cmd.cpp (working copy) @@ -25,6 +25,7 @@ #include "genworld.h" #include "bridge.h" #include "autoslope.h" +#include "transparency.h" /** Destroy a HQ. * During normal gameplay you can only implicitely destroy a HQ when you are @@ -129,7 +130,7 @@ AddSortableSpriteToDraw( dtus->image, PAL_NONE, ti->x | dtus->subcoord_x, ti->y | dtus->subcoord_y, dtus->width, dtus->height, dtus->z_size, ti->z, - HASBIT(_transparent_opt, TO_STRUCTURES) + IsOptionTransparent(TO_STRUCTURES) ); break; } @@ -140,7 +141,7 @@ DrawGroundSprite(SPR_CONCRETE_GROUND, PAL_NONE); - AddSortableSpriteToDraw(SPR_STATUE_COMPANY, PLAYER_SPRITE_COLOR(GetTileOwner(ti->tile)), ti->x, ti->y, 16, 16, 25, ti->z, HASBIT(_transparent_opt, TO_STRUCTURES)); + AddSortableSpriteToDraw(SPR_STATUE_COMPANY, PLAYER_SPRITE_COLOR(GetTileOwner(ti->tile)), ti->x, ti->y, 16, 16, 25, ti->z, IsOptionTransparent(TO_STRUCTURES)); break; case UNMOVABLE_OWNED_LAND: @@ -172,7 +173,7 @@ ti->x + dtss->delta_x, ti->y + dtss->delta_y, dtss->size_x, dtss->size_y, dtss->size_z, ti->z + dtss->delta_z, - HASBIT(_transparent_opt, TO_STRUCTURES) + IsOptionTransparent(TO_STRUCTURES) ); } break; Index: transparency.h =================================================================== --- transparency.h (revision 0) +++ transparency.h (revision 0) @@ -0,0 +1,21 @@ +#ifndef TRANSPARENCY_H +#define TRANSPARENCY_H + +/* Transparency option bits */ +enum transp_bit { + TO_SIGNS, ///< Signs. Must be first, some parts of code suppose that + TO_TREES, ///< Trees + TO_HOUSES, ///< Town buildings + TO_INDUSTRIES, ///< Industries + TO_BUILDINGS, ///< Player buildings - depots, stations, ... + TO_BRIDGES, ///< Bridges + TO_STRUCTURES, ///< Unmovable structures + TO_LOADING, ///< Loading indicators +}; + +static inline bool IsOptionTransparent(transp_bit what) +{ + return HASBIT(_transparent_opt, what); +} + +#endif /* TRANSPARENCY_H */ Index: water_cmd.cpp =================================================================== --- water_cmd.cpp (revision 11177) +++ water_cmd.cpp (working copy) @@ -30,6 +30,7 @@ #include "newgrf.h" #include "newgrf_canal.h" #include "misc/autoptr.hpp" +#include "transparency.h" static const SpriteID _water_shore_sprites[] = { 0, @@ -448,7 +449,7 @@ ti->x + wdts->delta_x, ti->y + wdts->delta_y, wdts->width, wdts->height, wdts->unk, ti->z + wdts->delta_z, - HASBIT(_transparent_opt, TO_BUILDINGS)); + IsOptionTransparent(TO_BUILDINGS)); } } Index: variables.h =================================================================== --- variables.h (revision 11177) +++ variables.h (working copy) @@ -287,7 +287,8 @@ VARDEF int _autosave_ctr; VARDEF byte _display_opt; -VARDEF byte _transparent_opt; + +VARDEF byte _transparent_opt; // transparent bits, see transparency.h for enum VARDEF int _caret_timer; VARDEF uint32 _news_display_opt; VARDEF bool _news_ticker_sound; Index: openttd.h =================================================================== --- openttd.h (revision 11177) +++ openttd.h (working copy) @@ -184,16 +184,6 @@ DO_WAYPOINTS = 6, }; -enum { - TO_SIGNS, - TO_TREES, - TO_HOUSES, - TO_INDUSTRIES, - TO_BUILDINGS, - TO_BRIDGES, - TO_STRUCTURES, - TO_LOADING, -}; /* Landscape types */ enum { Index: newgrf_industrytiles.cpp =================================================================== --- newgrf_industrytiles.cpp (revision 11177) +++ newgrf_industrytiles.cpp (working copy) @@ -9,6 +9,7 @@ #include "debug.h" #include "viewport.h" #include "landscape.h" +#include "transparency.h" #include "newgrf.h" #include "industry.h" #include "newgrf_commons.h" @@ -23,6 +24,7 @@ #include "table/strings.h" #include "sprite.h" + /** * Based on newhouses equivalent, but adapted for newindustries * @param parameter from callback. It's in fact a pair of coordinates @@ -189,7 +191,7 @@ ti->x + dtss->delta_x, ti->y + dtss->delta_y, dtss->size_x, dtss->size_y, dtss->size_z, ti->z + dtss->delta_z, - !HASBIT(image, SPRITE_MODIFIER_OPAQUE) && HASBIT(_transparent_opt, TO_INDUSTRIES) + !HASBIT(image, SPRITE_MODIFIER_OPAQUE) && IsOptionTransparent(TO_INDUSTRIES) ); } else { AddChildSpriteScreen(image, pal, dtss->delta_x, dtss->delta_y); Index: viewport.cpp =================================================================== --- viewport.cpp (revision 11177) +++ viewport.cpp (working copy) @@ -26,6 +26,7 @@ #include "roadveh.h" #include "vehicle_gui.h" #include "blitter/factory.hpp" +#include "transparency.h" #define VIEWPORT_DRAW_MEM (65536 * 2) @@ -1297,10 +1298,10 @@ /* Draw the rectangle if 'tranparent station signs' is off, * or if we are drawing a general text sign (STR_2806) */ - if (!HASBIT(_transparent_opt, TO_SIGNS) || ss->string == STR_2806) { + if (!IsOptionTransparent(TO_SIGNS) || ss->string == STR_2806) { DrawFrameRect( x, y, x + w, bottom, ss->color, - HASBIT(_transparent_opt, TO_SIGNS) ? FR_TRANSPARENT : FR_NONE + IsOptionTransparent(TO_SIGNS) ? FR_TRANSPARENT : FR_NONE ); } } @@ -1309,7 +1310,7 @@ SetDParam(1, ss->params[1]); /* if we didn't draw a rectangle, or if transparant building is on, * draw the text in the color the rectangle would have */ - if (HASBIT(_transparent_opt, TO_SIGNS) && ss->string != STR_2806 && ss->width != 0) { + if (IsOptionTransparent(TO_SIGNS) && ss->string != STR_2806 && ss->width != 0) { /* Real colors need the IS_PALETTE_COLOR flag * otherwise colors from _string_colormap are assumed. */ colour = _colour_gradient[ss->color][6] | IS_PALETTE_COLOR; Index: elrail.cpp =================================================================== --- elrail.cpp (revision 11177) +++ elrail.cpp (working copy) @@ -65,6 +65,7 @@ #include "vehicle.h" #include "train.h" #include "gui.h" +#include "transparency.h" static inline TLG GetTLG(TileIndex t) { @@ -195,7 +196,7 @@ sss->image, PAL_NONE, ti->x + sss->x_offset, ti->y + sss->y_offset, BB_data[2] - sss->x_offset, BB_data[3] - sss->y_offset, BB_Z_SEPARATOR - sss->z_offset + 1, GetTileZ(ti->tile) + sss->z_offset, - HASBIT(_transparent_opt, TO_BUILDINGS), + IsOptionTransparent(TO_BUILDINGS), BB_data[0] - sss->x_offset, BB_data[1] - sss->y_offset, BB_Z_SEPARATOR - sss->z_offset ); } @@ -334,7 +335,7 @@ AddSortableSpriteToDraw(pylon_sprites[temp], PAL_NONE, x, y, 1, 1, BB_HEIGHT_UNDER_BRIDGE, GetPCPElevation(ti->tile, i), - HASBIT(_transparent_opt, TO_BUILDINGS), -1, -1); + IsOptionTransparent(TO_BUILDINGS), -1, -1); break; /* We already have drawn a pylon, bail out */ } } @@ -342,7 +343,7 @@ } /* Don't draw a wire under a low bridge */ - if (MayHaveBridgeAbove(ti->tile) && IsBridgeAbove(ti->tile) && !HASBIT(_transparent_opt, TO_BUILDINGS)) { + if (MayHaveBridgeAbove(ti->tile) && IsBridgeAbove(ti->tile) && !IsOptionTransparent(TO_BUILDINGS)) { uint height = GetBridgeHeight(GetNorthernBridgeEnd(ti->tile)); if (height <= GetTileMaxZ(ti->tile) + TILE_HEIGHT) return; @@ -369,7 +370,7 @@ */ AddSortableSpriteToDraw(sss->image, PAL_NONE, ti->x + sss->x_offset, ti->y + sss->y_offset, sss->x_size, sss->y_size, sss->z_size, GetSlopeZ(ti->x + sss->x_offset, ti->y + sss->y_offset) + sss->z_offset, - HASBIT(_transparent_opt, TO_BUILDINGS)); + IsOptionTransparent(TO_BUILDINGS)); } } } @@ -402,7 +403,7 @@ AddSortableSpriteToDraw(sss->image, PAL_NONE, ti->x + sss->x_offset, ti->y + sss->y_offset, sss->x_size, sss->y_size, sss->z_size, height + sss->z_offset, - HASBIT(_transparent_opt, TO_BUILDINGS) + IsOptionTransparent(TO_BUILDINGS) ); /* Finished with wires, draw pylons */ @@ -413,7 +414,7 @@ if (HASBIT(tlg, (axis == AXIS_X ? 0 : 1))) PPPpos = ReverseDir(PPPpos); uint x = ti->x + x_pcp_offsets[PCPpos] + x_ppp_offsets[PPPpos]; uint y = ti->y + y_pcp_offsets[PCPpos] + y_ppp_offsets[PPPpos]; - AddSortableSpriteToDraw(pylon_sprites[PPPpos], PAL_NONE, x, y, 1, 1, BB_HEIGHT_UNDER_BRIDGE, height, HASBIT(_transparent_opt, TO_BUILDINGS), -1, -1); + AddSortableSpriteToDraw(pylon_sprites[PPPpos], PAL_NONE, x, y, 1, 1, BB_HEIGHT_UNDER_BRIDGE, height, IsOptionTransparent(TO_BUILDINGS), -1, -1); } /* need a pylon on the southern end of the bridge */ @@ -423,7 +424,7 @@ if (HASBIT(tlg, (axis == AXIS_X ? 0 : 1))) PPPpos = ReverseDir(PPPpos); uint x = ti->x + x_pcp_offsets[PCPpos] + x_ppp_offsets[PPPpos]; uint y = ti->y + y_pcp_offsets[PCPpos] + y_ppp_offsets[PPPpos]; - AddSortableSpriteToDraw(pylon_sprites[PPPpos], PAL_NONE, x, y, 1, 1, BB_HEIGHT_UNDER_BRIDGE, height, HASBIT(_transparent_opt, TO_BUILDINGS), -1, -1); + AddSortableSpriteToDraw(pylon_sprites[PPPpos], PAL_NONE, x, y, 1, 1, BB_HEIGHT_UNDER_BRIDGE, height, IsOptionTransparent(TO_BUILDINGS), -1, -1); } } @@ -449,7 +450,7 @@ sss->image, PAL_NONE, ti->x + sss->x_offset, ti->y + sss->y_offset, sss->x_size, sss->y_size, sss->z_size, GetTileMaxZ(ti->tile) + sss->z_offset, - HASBIT(_transparent_opt, TO_BUILDINGS) + IsOptionTransparent(TO_BUILDINGS) ); return; } Index: newgrf_house.cpp =================================================================== --- newgrf_house.cpp (revision 11177) +++ newgrf_house.cpp (working copy) @@ -15,6 +15,7 @@ #include "sound.h" #include "sprite.h" #include "strings.h" +#include "transparency.h" #include "table/strings.h" #include "table/sprites.h" #include "table/town_land.h" @@ -320,7 +321,7 @@ if (IS_CUSTOM_SPRITE(image)) image += stage; - if ((HASBIT(image, SPRITE_MODIFIER_OPAQUE) || !HASBIT(_transparent_opt, TO_HOUSES)) && HASBIT(image, PALETTE_MODIFIER_COLOR)) { + if ((HASBIT(image, SPRITE_MODIFIER_OPAQUE) || !IsOptionTransparent(TO_HOUSES)) && HASBIT(image, PALETTE_MODIFIER_COLOR)) { if (pal == 0) { const HouseSpec *hs = GetHouseSpecs(house_id); if (HASBIT(hs->callback_mask, CBM_HOUSE_COLOUR)) { @@ -343,7 +344,7 @@ ti->x + dtss->delta_x, ti->y + dtss->delta_y, dtss->size_x, dtss->size_y, dtss->size_z, ti->z + dtss->delta_z, - HASBIT(_transparent_opt, TO_HOUSES) + IsOptionTransparent(TO_HOUSES) ); } else { AddChildSpriteScreen(image, pal, dtss->delta_x, dtss->delta_y); Index: industry_cmd.cpp =================================================================== --- industry_cmd.cpp (revision 11177) +++ industry_cmd.cpp (working copy) @@ -38,6 +38,7 @@ #include "newgrf_callbacks.h" #include "misc/autoptr.hpp" #include "autoslope.h" +#include "transparency.h" void ShowIndustryViewWindow(int industry); void BuildOilRig(TileIndex tile); @@ -305,9 +306,9 @@ dits->height, dits->dz, ti->z, - HASBIT(_transparent_opt, TO_INDUSTRIES)); + IsOptionTransparent(TO_INDUSTRIES)); - if (HASBIT(_transparent_opt, TO_INDUSTRIES)) return; + if (IsOptionTransparent(TO_INDUSTRIES)) return; } { Index: main_gui.cpp =================================================================== --- main_gui.cpp (revision 11177) +++ main_gui.cpp (working copy) @@ -41,6 +41,7 @@ #include "vehicle_gui.h" #include "transparency_gui.h" #include "newgrf_config.h" +#include "transparency.h" #include "network/network_data.h" #include "network/network_client.h"