summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--industry_cmd.c3
-rw-r--r--rail_cmd.c2
-rw-r--r--road_cmd.c2
-rw-r--r--station_cmd.c2
-rw-r--r--town_cmd.c3
-rw-r--r--tree_cmd.c3
-rw-r--r--tunnelbridge_cmd.c12
-rw-r--r--unmovable_cmd.c7
-rw-r--r--vehicle.c2
-rw-r--r--water_cmd.c2
10 files changed, 21 insertions, 17 deletions
diff --git a/industry_cmd.c b/industry_cmd.c
index d7eaf5840..b24922025 100644
--- a/industry_cmd.c
+++ b/industry_cmd.c
@@ -1,6 +1,7 @@
#include "stdafx.h"
#include "openttd.h"
#include "table/strings.h"
+#include "table/sprites.h"
#include "map.h"
#include "tile.h"
#include "viewport.h"
@@ -370,7 +371,7 @@ static void DrawTile_Industry(TileInfo *ti)
image |= ormod;
if (_display_opt & DO_TRANS_BUILDINGS)
- image = (image & 0x3FFF) | 0x3224000;
+ MAKE_TRANSPARENT(image);
AddSortableSpriteToDraw(image,
ti->x | (dits->subtile_xy>>4),
diff --git a/rail_cmd.c b/rail_cmd.c
index 33e9255cd..3bb1a30ca 100644
--- a/rail_cmd.c
+++ b/rail_cmd.c
@@ -1352,7 +1352,7 @@ static void DrawSpecialBuilding(uint32 image, uint32 tracktype_offs,
image |= _drawtile_track_palette;
image += tracktype_offs;
if (_display_opt & DO_TRANS_BUILDINGS) // show transparent depots
- image = (image & 0x3FFF) | 0x3224000;
+ MAKE_TRANSPARENT(image);
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 470b9f22d..26ef7ff8a 100644
--- a/road_cmd.c
+++ b/road_cmd.c
@@ -874,7 +874,7 @@ static void DrawTile_Road(TileInfo *ti)
if (image & 0x8000)
image |= ormod;
if (_display_opt & DO_TRANS_BUILDINGS) // show transparent depots
- image = (image & 0x3FFF) | 0x3224000;
+ MAKE_TRANSPARENT(image);
AddSortableSpriteToDraw(image, ti->x | drss->subcoord_x,
ti->y | drss->subcoord_y, drss->width, drss->height, 0x14, ti->z);
diff --git a/station_cmd.c b/station_cmd.c
index c76965c51..57e2db3d5 100644
--- a/station_cmd.c
+++ b/station_cmd.c
@@ -2188,7 +2188,7 @@ static void DrawTile_Station(TileInfo *ti)
image = dtss->image + relocation;
image += type_offset;
if (_display_opt & DO_TRANS_BUILDINGS) {
- image = (image & 0x3FFF) | 0x03224000;
+ MAKE_TRANSPARENT(image);
} else {
if (image&0x8000) image |= image_or_modificator;
}
diff --git a/town_cmd.c b/town_cmd.c
index 1e1daf6fe..77a0a2403 100644
--- a/town_cmd.c
+++ b/town_cmd.c
@@ -2,6 +2,7 @@
#include "openttd.h"
#include "strings.h"
#include "table/strings.h"
+#include "table/sprites.h"
#include "map.h"
#include "tile.h"
#include "viewport.h"
@@ -117,7 +118,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)
- image = (image & 0x3FFF) | 0x3224000;
+ MAKE_TRANSPARENT(image);
AddSortableSpriteToDraw(image,
ti->x + dcts->subtile_x,
diff --git a/tree_cmd.c b/tree_cmd.c
index 14851c6f8..88af5c5e3 100644
--- a/tree_cmd.c
+++ b/tree_cmd.c
@@ -1,6 +1,7 @@
#include "stdafx.h"
#include "openttd.h"
#include "table/strings.h"
+#include "table/sprites.h"
#include "table/tree_land.h"
#include "map.h"
#include "tile.h"
@@ -302,7 +303,7 @@ static void DrawTile_Trees(TileInfo *ti)
do {
uint32 image = s[0] + (--i == 0 ? (ti->map5 & 7) : 3);
if (_display_opt & DO_TRANS_BUILDINGS)
- image = (image & 0x3FFF) | 0x3224000;
+ MAKE_TRANSPARENT(image);
te[i].image = image;
te[i].x = d[0];
te[i].y = d[1];
diff --git a/tunnelbridge_cmd.c b/tunnelbridge_cmd.c
index e4c59dc86..76e801f7f 100644
--- a/tunnelbridge_cmd.c
+++ b/tunnelbridge_cmd.c
@@ -959,7 +959,7 @@ static void DrawBridgePillars(TileInfo *ti, int x, int y, int z)
image = b[12 + (ti->map5&0x01)];
piece = _m[ti->tile].m2&0xF;
if (image != 0 && piece != 0) {
- if (_display_opt & DO_TRANS_BUILDINGS) image = (image & 0x3FFF) | 0x03224000;
+ if (_display_opt & DO_TRANS_BUILDINGS) MAKE_TRANSPARENT(image);
DrawGroundSpriteAt(image, x, y, z);
}
@@ -976,7 +976,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) MAKE_TRANSPARENT(image);
p = _tileh_bits[(image & 1) * 2 + (ti->map5&0x01)];
front_height = ti->z + ((ti->tileh & p[0])?8:0);
@@ -1070,7 +1070,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) MAKE_TRANSPARENT(image);
AddSortableSpriteToDraw(image, ti->x, ti->y, 16, 16, 7, ti->z);
} else {
// bridge middle part.
@@ -1121,13 +1121,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) MAKE_TRANSPARENT(image);
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) MAKE_TRANSPARENT(image);
// draw roof
if (ti->map5&1) {
@@ -1142,7 +1142,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) MAKE_TRANSPARENT(image);
DrawGroundSpriteAt(image, x, y, z);
}
} else if (_patches.bridge_pillars) {
diff --git a/unmovable_cmd.c b/unmovable_cmd.c
index e44649bce..4a43e81b5 100644
--- a/unmovable_cmd.c
+++ b/unmovable_cmd.c
@@ -1,6 +1,7 @@
#include "stdafx.h"
#include "openttd.h"
#include "table/strings.h"
+#include "table/sprites.h"
#include "map.h"
#include "tile.h"
#include "command.h"
@@ -125,7 +126,7 @@ static void DrawTile_Unmovable(TileInfo *ti)
image = PLAYER_SPRITE_COLOR(GetTileOwner(ti->tile));
image += 0x8A48;
if (_display_opt & DO_TRANS_BUILDINGS)
- image = (image & 0x3FFF) | 0x3224000;
+ MAKE_TRANSPARENT(image);
AddSortableSpriteToDraw(image, ti->x, ti->y, 16, 16, 25, ti->z);
} else if (ti->map5 == 3) {
@@ -151,7 +152,7 @@ static void DrawTile_Unmovable(TileInfo *ti)
image = dtus->image;
if (_display_opt & DO_TRANS_BUILDINGS)
- image = (image & 0x3FFF) | 0x3224000;
+ MAKE_TRANSPARENT(image);
AddSortableSpriteToDraw(image,
ti->x | dtus->subcoord_x,
@@ -173,7 +174,7 @@ static void DrawTile_Unmovable(TileInfo *ti)
foreach_draw_tile_seq(dtss, t->seq) {
image = dtss->image;
if (_display_opt & DO_TRANS_BUILDINGS) {
- image = (image & 0x3FFF) | 0x03224000;
+ MAKE_TRANSPARENT(image);
} else {
image |= ormod;
}
diff --git a/vehicle.c b/vehicle.c
index 7d1734f70..defce52c1 100644
--- a/vehicle.c
+++ b/vehicle.c
@@ -559,7 +559,7 @@ static void DoDrawVehicle(Vehicle *v)
uint32 image = v->cur_image;
if (v->vehstatus & VS_DISASTER) {
- image |= 0x3224000;
+ MAKE_TRANSPARENT(image);
} else if (v->vehstatus & VS_DEFPAL) {
image |= (v->vehstatus & VS_CRASHED) ? PALETTE_CRASH : SPRITE_PALETTE(PLAYER_SPRITE_COLOR(v->owner));
}
diff --git a/water_cmd.c b/water_cmd.c
index 28b11435f..f05bcf018 100644
--- a/water_cmd.c
+++ b/water_cmd.c
@@ -391,7 +391,7 @@ static void DrawWaterStuff(TileInfo *ti, const WaterDrawTileStruct *wdts,
for (; wdts->delta_x != 0x80; wdts++) {
image = wdts->image + base;
if (_display_opt & DO_TRANS_BUILDINGS) {
- image = (image & 0x3FFF) | 0x03224000;
+ MAKE_TRANSPARENT(image);
} else {
image |= palette;
}