GSdx: recent changes caused some errors in line drawing (SoTC loading screen)

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4979 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
gabest11 2011-12-04 18:35:16 +00:00
parent 9f470962e5
commit df42f468be
1 changed files with 26 additions and 16 deletions

View File

@ -180,30 +180,40 @@ void GSRasterizer::DrawLine(const GSVertexSW* v)
GSVector4 mask = (v[0].p > v[1].p).xxxx();
GSVertexSW l, dl;
GSVertexSW scan;
l.p = v[0].p.blend32(v[1].p, mask);
l.t = v[0].t.blend32(v[1].t, mask);
l.c = v[0].c.blend32(v[1].c, mask);
scan.p = v[0].p.blend32(v[1].p, mask);
scan.t = v[0].t.blend32(v[1].t, mask);
scan.c = v[0].c.blend32(v[1].c, mask);
GSVector4 r;
GSVector4i p(scan.p);
r = v[1].p.blend32(v[0].p, mask);
GSVector4i p(l.p);
if(m_scissor.top <= p.y && p.y < m_scissor.bottom)
if(m_scissor.top <= p.y && p.y < m_scissor.bottom && IsOneOfMyScanlines(p.y))
{
GSVector4 scissor = m_fscissor.xzxz();
GSVector4 lrf = scan.p.upl(v[1].p.blend32(v[0].p, mask)).ceil();
GSVector4 l = lrf.max(scissor);
GSVector4 r = lrf.min(scissor);
GSVector4i lr = GSVector4i(l.xxyy(r));
int left = lr.extract32<0>();
int right = lr.extract32<2>();
int pixels = right - left;
if(pixels > 0)
{
m_stats.pixels += pixels;
GSVertexSW dscan = dv / dv.p.xxxx();
GSVector4 x0 = l.p.xxxx();
GSVector4 y0 = l.p.yyyy();
scan += dscan * (l - scan.p).xxxx();
l.p = l.p.upl(r).xyzw(l.p); // r.x => l.y
m_ds->SetupPrim(v, dscan);
DrawTriangleSection(p.y, p.y + 1, l, dl, dscan, x0, y0);
Flush(v, dscan);
m_ds->DrawScanline(pixels, left, p.y, scan);
}
}
}