Mercurial > hg > openttd
changeset 15106:b4d5560a832b draft
(svn r19732) -Fix [FS#3802]: Spritepicker failed for 32bpp blitters due to pitch measured in pixels rather than bytes.
author | frosch <frosch@openttd.org> |
---|---|
date | Tue, 27 Apr 2010 17:29:40 +0000 |
parents | 2327111375f3 |
children | 22281dbf50a0 |
files | src/gfx.cpp |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/gfx.cpp +++ b/src/gfx.cpp @@ -1132,7 +1132,7 @@ 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); }