summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2010-04-27 17:29:40 +0000
committerfrosch <frosch@openttd.org>2010-04-27 17:29:40 +0000
commit7579079874a36670aca6cfe9b565e0f5e2ed8f99 (patch)
tree0c2e3996ebf790f80e6f83cdf81f87b5074742da
parent7b30f34ecf037f3d53b9a30487661df9c87bac3a (diff)
downloadopenttd-7579079874a36670aca6cfe9b565e0f5e2ed8f99.tar.xz
(svn r19732) -Fix [FS#3802]: Spritepicker failed for 32bpp blitters due to pitch measured in pixels rather than bytes.
-rw-r--r--src/gfx.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gfx.cpp b/src/gfx.cpp
index b4839c820..e1f7eeec9 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) % bp.pitch) / blitter->GetBytesPerPixel();
+ uint offset = (((size_t)clicked - (size_t)topleft) / blitter->GetBytesPerPixel()) % bp.pitch;
if (offset < (uint)bp.width) {
_newgrf_debug_sprite_picker.sprites.Include(sprite_id);
}