diff options
author | frosch <frosch@openttd.org> | 2008-10-18 17:21:56 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2008-10-18 17:21:56 +0000 |
commit | 5a1df325e288f817cf6e24f642485dae444f8f8e (patch) | |
tree | 9039e308f0d1ea5cf472eeac69885f8c155b5db8 /src/newgrf_industrytiles.cpp | |
parent | 2e6894b7bbaeab6296676ad182d200489aa10216 (diff) | |
download | openttd-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_industrytiles.cpp')
-rw-r--r-- | src/newgrf_industrytiles.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/newgrf_industrytiles.cpp b/src/newgrf_industrytiles.cpp index 3ca228889..50bdcba4b 100644 --- a/src/newgrf_industrytiles.cpp +++ b/src/newgrf_industrytiles.cpp @@ -167,7 +167,7 @@ static void NewIndustryTileResolver(ResolverObject *res, IndustryGfx gfx, TileIn res->grffile = (its != NULL ? its->grf_prop.grffile : NULL); } -void IndustryDrawTileLayout(const TileInfo *ti, const SpriteGroup *group, byte rnd_color, byte stage, IndustryGfx gfx) +static void IndustryDrawTileLayout(const TileInfo *ti, const SpriteGroup *group, byte rnd_color, byte stage, IndustryGfx gfx) { const DrawTileSprites *dts = group->g.layout.dts; const DrawTileSeqStruct *dtss; @@ -198,7 +198,7 @@ void IndustryDrawTileLayout(const TileInfo *ti, const SpriteGroup *group, byte r if (IS_CUSTOM_SPRITE(image)) image += stage; - if (HasBit(image, PALETTE_MODIFIER_COLOR)) { + if (HasBit(image, PALETTE_MODIFIER_TRANSPARENT) || HasBit(image, PALETTE_MODIFIER_COLOR)) { if (pal == 0) { pal = GENERAL_SPRITE_COLOR(rnd_color); } @@ -215,7 +215,8 @@ void IndustryDrawTileLayout(const TileInfo *ti, const SpriteGroup *group, byte r !HasBit(image, SPRITE_MODIFIER_OPAQUE) && IsTransparencySet(TO_INDUSTRIES) ); } else { - AddChildSpriteScreen(image, pal, (byte)dtss->delta_x, (byte)dtss->delta_y, IsTransparencySet(TO_INDUSTRIES)); + /* 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_INDUSTRIES)); } } } |