# HG changeset patch # User Ritor1 # Date 1386876067 -21600 # Node ID 115373c2d1cd26c0893d748505b2f25999160bd0 # Parent 577c081b80193f5c2c9afa63bb806b9f0578db8a RasterLine2D fix diff -r 577c081b8019 -r 115373c2d1cd Render.cpp --- a/Render.cpp Thu Dec 12 21:44:02 2013 +0600 +++ b/Render.cpp Fri Dec 13 01:21:07 2013 +0600 @@ -3619,7 +3619,7 @@ v21 = pRenderer->uTargetSurfacePitch; if ( pRenderer->uTargetSurfacePitch ) { - v12 = uX + v8 * pRenderer->uTargetSurfacePitch; + v12 = uX + uY * pRenderer->uTargetSurfacePitch; v22 = v11 - v8; v23 = v22; uYb = v22; @@ -3653,11 +3653,17 @@ v31 = 2 * v24; v32 = 2 * v21; v12 = (int)&v26[v12]; + int y = 0; for ( v30; v30; --v30 ) { v25 += uXa; - *(short *)v12 = uColor; - v12 += v32; + //*(short *)v12 = uColor; + //v12 += v32; + WritePixel16(uX + v25, uY + y, uColor); + if ( v32 >= 0 ) + y += 1; + else + y -= 1; if ( v25 > 0 ) { v25 -= uYb; @@ -3669,6 +3675,7 @@ else//рисуем горизонтальную линию { v27 = uXa + 1; + int x = 0; if ( (signed int)(uXa + 1) > 0 ) { v28 = 2 * v21; @@ -3677,8 +3684,13 @@ for ( v27; v27; --v27 ) { v25 += uYb; - *(short *)v12 = uColor; - v12 += v29; + //*(short *)v12 = uColor; + //v12 += v29; + WritePixel16(uX + x, uY + v25, uColor); + if ( v29 >= 0 ) + x += 1; + else + x -= 1; if ( v25 > (signed int)uXa ) { v25 -= uXa;