fix: correction bogues algorithme trianglefilled - hline

This commit is contained in:
Nicolas Hordé 2018-10-17 14:09:01 +02:00
parent f4b3ea6c10
commit ac0bf016eb
2 changed files with 4 additions and 3 deletions

View File

@ -442,7 +442,8 @@ int test2d()
else
color=random(0,16);
trianglefilled(&a, &b, &c, color);
triangle(&a, &b, &c, color);
waitascii();
triangle(&a, &b, &c, egatorgb(4));
}
return 0;
}

View File

@ -1138,9 +1138,9 @@ void hline(u16 x1, u16 x2, u16 y, u32 color)
if (vinfo->isgraphic)
{
if (x2 > x1)
mem_to_video(color,x1+vinfo->currentpitch*y,x2-x1,false);
mem_to_video(color,(vinfo->currentdepth>>3)*x1+vinfo->currentpitch*y,x2-x1,false);
else
mem_to_video(color,x2+vinfo->currentpitch*y,x1-x2,false);
mem_to_video(color,(vinfo->currentdepth>>3)*x2+vinfo->currentpitch*y,x1-x2,false);
}
}