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:
Jonathan G Rennison
2024-02-04 00:31:11 +00:00
parent 736539280b
commit 3365efa5b2
4 changed files with 29 additions and 5 deletions

View File

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