From b026ea626af0c29ab1c4b4f9cab54e89b0d89688 Mon Sep 17 00:00:00 2001 From: David Guillen Fandos Date: Sat, 29 Jul 2023 17:20:35 +0200 Subject: [PATCH] Disable optimization when there are some ST objects on the line --- video.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/video.cc b/video.cc index 7da55f3..9c1ce81 100644 --- a/video.cc +++ b/video.cc @@ -935,8 +935,9 @@ static void render_scanline_objects( ) { // TODO move this to another place? // Skip alpha pass if you can do a regular color32 pass - if (rdtype == STCKCOLOR && ((read_ioreg(REG_BLDCNT) >> 4) & 1) == 0) { - // We cannot skip if there's some object being rendered TODO TODO + bool layer_has_blending = ((read_ioreg(REG_BLDCNT) >> 4) & 1) != 0; + bool has_trans_obj = obj_alpha_count[read_ioreg(REG_VCOUNT)]; + if (rdtype == STCKCOLOR && (!has_trans_obj && !layer_has_blending)) { render_scanline_objects(priority, start, end, raw_ptr); return; }