fix: correction bogues algorithme trianglefilled - hline
This commit is contained in:
parent
f4b3ea6c10
commit
ac0bf016eb
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue