Ensure that sprite aligner click to pick sprites is thread safe
Use a mutex for list of sprite IDs found in (threaded) draw jobs
This commit is contained in:
@@ -1212,7 +1212,7 @@ static void GfxBlitter(const GfxBlitterCtx &ctx, const Sprite *sprite, int x, in
|
||||
if (topleft <= clicked && clicked <= bottomright) {
|
||||
uint offset = (((size_t)clicked - (size_t)topleft) / (blitter->GetScreenDepth() / 8)) % bp.pitch;
|
||||
if (offset < (uint)bp.width) {
|
||||
include(_newgrf_debug_sprite_picker.sprites, sprite_id);
|
||||
_newgrf_debug_sprite_picker.FoundSpriteDuringDrawing(sprite_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user