Mercurial > mm7
comparison Render.cpp @ 2096:115373c2d1cd
RasterLine2D fix
author | Ritor1 |
---|---|
date | Fri, 13 Dec 2013 01:21:07 +0600 |
parents | 52415f8bf7c2 |
children | 2b39f6b451f9 |
comparison
equal
deleted
inserted
replaced
2095:577c081b8019 | 2096:115373c2d1cd |
---|---|
3617 { | 3617 { |
3618 LABEL_46: | 3618 LABEL_46: |
3619 v21 = pRenderer->uTargetSurfacePitch; | 3619 v21 = pRenderer->uTargetSurfacePitch; |
3620 if ( pRenderer->uTargetSurfacePitch ) | 3620 if ( pRenderer->uTargetSurfacePitch ) |
3621 { | 3621 { |
3622 v12 = uX + v8 * pRenderer->uTargetSurfacePitch; | 3622 v12 = uX + uY * pRenderer->uTargetSurfacePitch; |
3623 v22 = v11 - v8; | 3623 v22 = v11 - v8; |
3624 v23 = v22; | 3624 v23 = v22; |
3625 uYb = v22; | 3625 uYb = v22; |
3626 if ( v22 < 0 ) | 3626 if ( v22 < 0 ) |
3627 { | 3627 { |
3651 if ( v30 > 0 ) | 3651 if ( v30 > 0 ) |
3652 { | 3652 { |
3653 v31 = 2 * v24; | 3653 v31 = 2 * v24; |
3654 v32 = 2 * v21; | 3654 v32 = 2 * v21; |
3655 v12 = (int)&v26[v12]; | 3655 v12 = (int)&v26[v12]; |
3656 int y = 0; | |
3656 for ( v30; v30; --v30 ) | 3657 for ( v30; v30; --v30 ) |
3657 { | 3658 { |
3658 v25 += uXa; | 3659 v25 += uXa; |
3659 *(short *)v12 = uColor; | 3660 //*(short *)v12 = uColor; |
3660 v12 += v32; | 3661 //v12 += v32; |
3662 WritePixel16(uX + v25, uY + y, uColor); | |
3663 if ( v32 >= 0 ) | |
3664 y += 1; | |
3665 else | |
3666 y -= 1; | |
3661 if ( v25 > 0 ) | 3667 if ( v25 > 0 ) |
3662 { | 3668 { |
3663 v25 -= uYb; | 3669 v25 -= uYb; |
3664 v12 += v31; | 3670 v12 += v31; |
3665 } | 3671 } |
3667 } | 3673 } |
3668 } | 3674 } |
3669 else//рисуем горизонтальную линию | 3675 else//рисуем горизонтальную линию |
3670 { | 3676 { |
3671 v27 = uXa + 1; | 3677 v27 = uXa + 1; |
3678 int x = 0; | |
3672 if ( (signed int)(uXa + 1) > 0 ) | 3679 if ( (signed int)(uXa + 1) > 0 ) |
3673 { | 3680 { |
3674 v28 = 2 * v21; | 3681 v28 = 2 * v21; |
3675 v29 = 2 * v24; | 3682 v29 = 2 * v24; |
3676 v12 = (int)&v26[v12]; | 3683 v12 = (int)&v26[v12]; |
3677 for ( v27; v27; --v27 ) | 3684 for ( v27; v27; --v27 ) |
3678 { | 3685 { |
3679 v25 += uYb; | 3686 v25 += uYb; |
3680 *(short *)v12 = uColor; | 3687 //*(short *)v12 = uColor; |
3681 v12 += v29; | 3688 //v12 += v29; |
3689 WritePixel16(uX + x, uY + v25, uColor); | |
3690 if ( v29 >= 0 ) | |
3691 x += 1; | |
3692 else | |
3693 x -= 1; | |
3682 if ( v25 > (signed int)uXa ) | 3694 if ( v25 > (signed int)uXa ) |
3683 { | 3695 { |
3684 v25 -= uXa; | 3696 v25 -= uXa; |
3685 v12 += v28; | 3697 v12 += v28; |
3686 } | 3698 } |