summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2010-01-17 01:22:43 +0000
committerfrosch <frosch@openttd.org>2010-01-17 01:22:43 +0000
commitae48ea16f96c2f0e643f87af5e020b8023f43c96 (patch)
tree0f98919d75e9cb132b2b387af30c963f1f278afe
parentd9d75c83d5b0839d335db453b4482fcaf306bac7 (diff)
downloadopenttd-ae48ea16f96c2f0e643f87af5e020b8023f43c96.tar.xz
(svn r18843) -Codechange: Only NewGRF supplied spritelayouts use SPRITE_MODIFIER_CUSTOM_SPRITE, so no extra tests needed.
-rw-r--r--src/sprite.cpp12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/sprite.cpp b/src/sprite.cpp
index 5dd7d7f00..719fe0550 100644
--- a/src/sprite.cpp
+++ b/src/sprite.cpp
@@ -36,11 +36,7 @@ void DrawCommonTileSeq(const TileInfo *ti, const DrawTileSprites *dts, Transpare
/* Stop drawing sprite sequence once we meet a sprite that doesn't have to be opaque */
if (IsInvisibilitySet(to) && !HasBit(image, SPRITE_MODIFIER_OPAQUE)) return;
- if (newgrf_offset == 0 || !HasBit(image, SPRITE_MODIFIER_CUSTOM_SPRITE)) {
- image += orig_offset;
- } else {
- image += newgrf_offset;
- }
+ image += (HasBit(image, SPRITE_MODIFIER_CUSTOM_SPRITE) ? newgrf_offset : orig_offset);
SpriteID pal = SpriteLayoutPaletteTransform(image, dtss->image.pal, default_palette);
@@ -75,11 +71,7 @@ void DrawCommonTileSeqInGUI(int x, int y, const DrawTileSprites *dts, int32 orig
foreach_draw_tile_seq(dtss, dts->seq) {
SpriteID image = dtss->image.sprite;
- if (newgrf_offset == 0 || !HasBit(image, SPRITE_MODIFIER_CUSTOM_SPRITE)) {
- image += orig_offset;
- } else {
- image += newgrf_offset;
- }
+ image += (HasBit(image, SPRITE_MODIFIER_CUSTOM_SPRITE) ? newgrf_offset : orig_offset);
SpriteID pal = SpriteLayoutPaletteTransform(image, dtss->image.pal, default_palette);