summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2010-04-28 19:19:20 +0000
committerfrosch <frosch@openttd.org>2010-04-28 19:19:20 +0000
commitf6f092b5eebf66c2602371d9175f157a9ae08371 (patch)
treec38502fdd43b012dbe75e10e48207391f26bf429 /src
parentc695a9eebe61fbb1e3d15aeafd168d24bb8acde5 (diff)
downloadopenttd-f6f092b5eebf66c2602371d9175f157a9ae08371.tar.xz
(svn r19736) -Fix [FS#3802]: Spritepicker still failed for 32bpp-anim blitter.
Diffstat (limited to 'src')
-rw-r--r--src/gfx.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gfx.cpp b/src/gfx.cpp
index e1f7eeec9..127a248da 100644
--- a/src/gfx.cpp
+++ b/src/gfx.cpp
@@ -1132,7 +1132,7 @@ static void GfxMainBlitter(const Sprite *sprite, int x, int y, BlitterMode mode,
void *clicked = _newgrf_debug_sprite_picker.clicked_pixel;
if (topleft <= clicked && clicked <= bottomright) {
- uint offset = (((size_t)clicked - (size_t)topleft) / blitter->GetBytesPerPixel()) % bp.pitch;
+ uint offset = (((size_t)clicked - (size_t)topleft) / (blitter->GetScreenDepth() / 8)) % bp.pitch;
if (offset < (uint)bp.width) {
_newgrf_debug_sprite_picker.sprites.Include(sprite_id);
}