diff options
author | rubidium <rubidium@openttd.org> | 2008-09-02 15:20:38 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-09-02 15:20:38 +0000 |
commit | c8e8911ef676f503ac5789d3fefac1278cdef971 (patch) | |
tree | e7050537d14303dbc6bc9a461ff38931861cc4aa /src/gfx.cpp | |
parent | cbe397388f0ef537b61095b05ee4edfe9dd92202 (diff) | |
download | openttd-c8e8911ef676f503ac5789d3fefac1278cdef971.tar.xz |
(svn r14223) -Codechange: make GetSprite aware of the 4 different types of sprites: fonts, recolour, mapgen and normal sprites.
Diffstat (limited to 'src/gfx.cpp')
-rw-r--r-- | src/gfx.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/gfx.cpp b/src/gfx.cpp index 4bcdab241..9f896be32 100644 --- a/src/gfx.cpp +++ b/src/gfx.cpp @@ -888,13 +888,13 @@ int DoDrawStringTruncated(const char *str, int x, int y, uint16 color, uint maxw void DrawSprite(SpriteID img, SpriteID pal, int x, int y, const SubSprite *sub) { if (HasBit(img, PALETTE_MODIFIER_TRANSPARENT)) { - _color_remap_ptr = GetNonSprite(GB(pal, 0, PALETTE_WIDTH)) + 1; - GfxMainBlitter(GetSprite(GB(img, 0, SPRITE_WIDTH)), x, y, BM_TRANSPARENT, sub); + _color_remap_ptr = GetNonSprite(GB(pal, 0, PALETTE_WIDTH), ST_RECOLOUR) + 1; + GfxMainBlitter(GetSprite(GB(img, 0, SPRITE_WIDTH), ST_NORMAL), x, y, BM_TRANSPARENT, sub); } else if (pal != PAL_NONE) { - _color_remap_ptr = GetNonSprite(GB(pal, 0, PALETTE_WIDTH)) + 1; - GfxMainBlitter(GetSprite(GB(img, 0, SPRITE_WIDTH)), x, y, BM_COLOUR_REMAP, sub); + _color_remap_ptr = GetNonSprite(GB(pal, 0, PALETTE_WIDTH), ST_RECOLOUR) + 1; + GfxMainBlitter(GetSprite(GB(img, 0, SPRITE_WIDTH), ST_NORMAL), x, y, BM_COLOUR_REMAP, sub); } else { - GfxMainBlitter(GetSprite(GB(img, 0, SPRITE_WIDTH)), x, y, BM_NORMAL, sub); + GfxMainBlitter(GetSprite(GB(img, 0, SPRITE_WIDTH), ST_NORMAL), x, y, BM_NORMAL, sub); } } @@ -1476,7 +1476,7 @@ static void SetCursorSprite(SpriteID cursor, SpriteID pal) if (cv->sprite == cursor) return; - p = GetSprite(GB(cursor, 0, SPRITE_WIDTH)); + p = GetSprite(GB(cursor, 0, SPRITE_WIDTH), ST_NORMAL); cv->sprite = cursor; cv->pal = pal; cv->size.y = p->height; |