mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-06 14:27:16 +00:00
(svn r19736) -Fix [FS#3802]: Spritepicker still failed for 32bpp-anim blitter.
This commit is contained in:
parent
c695a9eebe
commit
f6f092b5ee
@ -1132,7 +1132,7 @@ static void GfxMainBlitter(const Sprite *sprite, int x, int y, BlitterMode mode,
|
|||||||
void *clicked = _newgrf_debug_sprite_picker.clicked_pixel;
|
void *clicked = _newgrf_debug_sprite_picker.clicked_pixel;
|
||||||
|
|
||||||
if (topleft <= clicked && clicked <= bottomright) {
|
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) {
|
if (offset < (uint)bp.width) {
|
||||||
_newgrf_debug_sprite_picker.sprites.Include(sprite_id);
|
_newgrf_debug_sprite_picker.sprites.Include(sprite_id);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user