src/newgrf_station.cpp
changeset 10355 8a930759b457
parent 10256 d69ddb1a8422
--- a/src/newgrf_station.cpp	Sat Nov 22 15:57:31 2008 +0000
+++ b/src/newgrf_station.cpp	Sat Nov 22 16:04:11 2008 +0000
@@ -803,6 +803,7 @@
 	}
 
 	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 @@
 		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 @@
 			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);