summaryrefslogtreecommitdiff
path: root/src/newgrf_station.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2008-11-22 16:04:11 +0000
committerfrosch <frosch@openttd.org>2008-11-22 16:04:11 +0000
commita64298ebb935e520953b46f5b1ab916446c5327f (patch)
tree3eae77104f99b355105a041898cd4174c1d8031f /src/newgrf_station.cpp
parent795569298f4ee4806605c8f024010f24d5ff9033 (diff)
downloadopenttd-a64298ebb935e520953b46f5b1ab916446c5327f.tar.xz
(svn r14606) -Codechange: Unify usage of PALETTE_MODIFIER_TRANSPARENT and PALETTE_MODIFIER_COLOR in spritelayout drawing.
-Fix [FS#2419]: The modifiers were not applied in all cases.
Diffstat (limited to 'src/newgrf_station.cpp')
-rw-r--r--src/newgrf_station.cpp14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/newgrf_station.cpp b/src/newgrf_station.cpp
index 3438a87ca..3556e2185 100644
--- a/src/newgrf_station.cpp
+++ b/src/newgrf_station.cpp
@@ -803,6 +803,7 @@ bool DrawStationTile(int x, int y, RailType railtype, Axis axis, StationClassID
}
image = sprites->ground.sprite;
+ SpriteID pal = sprites->ground.pal;
if (HasBit(image, SPRITE_MODIFIER_USE_OFFSET)) {
image += GetCustomStationGroundRelocation(statspec, NULL, INVALID_TILE);
image += rti->custom_ground_offset;
@@ -810,7 +811,7 @@ bool DrawStationTile(int x, int y, RailType railtype, Axis axis, StationClassID
image += rti->total_offset;
}
- DrawSprite(image, PAL_NONE, x, y);
+ DrawSprite(image, GroundSpritePaletteTransform(image, pal, palette), x, y);
Point child_offset = {0, 0};
@@ -822,16 +823,7 @@ bool DrawStationTile(int x, int y, RailType railtype, Axis axis, StationClassID
image += relocation;
}
- SpriteID pal;
- if (HasBit(image, PALETTE_MODIFIER_TRANSPARENT) || HasBit(image, PALETTE_MODIFIER_COLOR)) {
- if (seq->image.pal > 0) {
- pal = seq->image.pal;
- } else {
- pal = palette;
- }
- } else {
- pal = PAL_NONE;
- }
+ pal = SpriteLayoutPaletteTransform(image, seq->image.pal, palette);
if ((byte)seq->delta_z != 0x80) {
Point pt = RemapCoords(seq->delta_x, seq->delta_y, seq->delta_z);