(svn r19732) -Fix [FS#3802]: Spritepicker failed for 32bpp blitters due to pitch measured in pixels rather than bytes.

This commit is contained in:
frosch
2010-04-27 17:29:40 +00:00
parent efdc25bb73
commit d33e664c8c

View File

@@ -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);
}