From 4f951ffd8e368e4bc20fbd1fae84da59a86e00a8 Mon Sep 17 00:00:00 2001 From: gm-matthew <108370479+gm-matthew@users.noreply.github.com> Date: Mon, 27 Oct 2025 12:47:31 +0000 Subject: [PATCH] sega/model2: fix textured mesh polygons Need to double all the increment values --- src/mame/sega/model2rd.ipp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/mame/sega/model2rd.ipp b/src/mame/sega/model2rd.ipp index 6f0887ca17671..233a0707e7996 100644 --- a/src/mame/sega/model2rd.ipp +++ b/src/mame/sega/model2rd.ipp @@ -178,9 +178,16 @@ void model2_renderer::draw_scanline_tex(int32_t scanline, const extent_t &extent colortable_b += ((colorbase >> 10) & 0x1f) << 8; int x = extent.startx; - int dx = checker ? 2 : 1; - if (checker && !((x ^ scanline) & 1)) - x++; + int dx = 1; + if (checker) + { + // if the first pixel is transparent, skip to the next one + if (!((x ^ scanline) & 1)) + x++, ooz += dooz, uoz += dudxoz, voz += dvdxoz; + + // increment by 2 pixels each time, skipping every other pixel + dx = 2, dooz *= 2.0f, dudxoz *= 2.0f, dvdxoz *= 2.0f; + } for (; x < extent.stopx; x += dx, uoz += dudxoz, voz += dvdxoz, ooz += dooz) {