summaryrefslogtreecommitdiff
path: root/src/newgrf_house.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2008-10-18 17:21:56 +0000
committerfrosch <frosch@openttd.org>2008-10-18 17:21:56 +0000
commit5a1df325e288f817cf6e24f642485dae444f8f8e (patch)
tree9039e308f0d1ea5cf472eeac69885f8c155b5db8 /src/newgrf_house.cpp
parent2e6894b7bbaeab6296676ad182d200489aa10216 (diff)
downloadopenttd-5a1df325e288f817cf6e24f642485dae444f8f8e.tar.xz
(svn r14488) -Fix: Synchronize drawing of spritelayouts in DrawTileLayout (Houses), IndustryDrawTileLayout, DrawStationTile, DrawTile_Station and DrawTile_Track (Waypoint).
Now transparency options, PALETTE_MODIFIER_TRANSPARENT and SPRITE_MODIFIER_OPAQUE should work for all of them.
Diffstat (limited to 'src/newgrf_house.cpp')
-rw-r--r--src/newgrf_house.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/newgrf_house.cpp b/src/newgrf_house.cpp
index b7907945f..296139caa 100644
--- a/src/newgrf_house.cpp
+++ b/src/newgrf_house.cpp
@@ -421,7 +421,7 @@ uint16 GetHouseCallback(CallbackID callback, uint32 param1, uint32 param2, House
return group->g.callback.result;
}
-void DrawTileLayout(const TileInfo *ti, const SpriteGroup *group, byte stage, HouseID house_id)
+static void DrawTileLayout(const TileInfo *ti, const SpriteGroup *group, byte stage, HouseID house_id)
{
const DrawTileSprites *dts = group->g.layout.dts;
const DrawTileSeqStruct *dtss;
@@ -444,7 +444,7 @@ void DrawTileLayout(const TileInfo *ti, const SpriteGroup *group, byte stage, Ho
if (IS_CUSTOM_SPRITE(image)) image += stage;
- if ((HasBit(image, SPRITE_MODIFIER_OPAQUE) || !IsTransparencySet(TO_HOUSES)) && HasBit(image, PALETTE_MODIFIER_COLOR)) {
+ if (HasBit(image, PALETTE_MODIFIER_TRANSPARENT) || HasBit(image, PALETTE_MODIFIER_COLOR)) {
if (pal == 0) {
const HouseSpec *hs = GetHouseSpecs(house_id);
if (HasBit(hs->callback_mask, CBM_HOUSE_COLOUR)) {
@@ -467,10 +467,11 @@ void DrawTileLayout(const TileInfo *ti, const SpriteGroup *group, byte stage, Ho
ti->x + dtss->delta_x, ti->y + dtss->delta_y,
dtss->size_x, dtss->size_y,
dtss->size_z, ti->z + dtss->delta_z,
- IsTransparencySet(TO_HOUSES)
+ !HasBit(image, SPRITE_MODIFIER_OPAQUE) && IsTransparencySet(TO_HOUSES)
);
} else {
- AddChildSpriteScreen(image, pal, (byte)dtss->delta_x, (byte)dtss->delta_y, IsTransparencySet(TO_HOUSES));
+ /* For industries and houses delta_x and delta_y are unsigned */
+ AddChildSpriteScreen(image, pal, (byte)dtss->delta_x, (byte)dtss->delta_y, !HasBit(image, SPRITE_MODIFIER_OPAQUE) && IsTransparencySet(TO_HOUSES));
}
}
}