Why are you using the fixed ** multiplication ? I tought that it was only for 8.8 fixed number ??? .???
It is indeed signed, but not treated as integers. Normal multiplication, on the other hand, works for any type of integer (signed or unsigned).Ah. Yeah, I see it now in "the low byte as the decimal part" o.o°
// still the signed division (with two integer), isn't it ?
So I need to put * and // ?// still the signed division (with two integer), isn't it ?
Yes, that's correct, you still need signed division.
see this one : http://ourl.ca/16928Thanks, I'll try it :)
(only for y>64)
But that would be great to have one that supports clipping in all 4 directions.Done :D
What is the cause of the line being cut off at the right side of the screen?What do you mean ? Do you mean that it gets clipped before reaching the edge of the screen ?
If r1<<0
r4-(r2-r4*r3//(r1-r3))->r2
0->r1
End
If r1>94
r2-r4*94//(r1-r3)+r2-(r2-r4*r1//(r1-r3))->r2
94->r1
End
intoIf r1<<0
-1->r1
r4-(r2-r4*r3//(r1-r3))->r2
ElseIf r1>94
r2-r4*94//(r1-r3)+r2-(r2-r4*r1//(r1-r3))->r2
94->r1
End
and same for all the other pieces, since a variable can't be less than 0 and greater than 94 at the same time..there'll be a small speed gain there (and a tiny bit saved by manipulating the placement of 0->r1.Lbl LINE
If r1<<0
-Y*r3//X+r4->r2
0->r1
ElseIf r1>94
94-r1*Y//X+r2->r2
94->r1
End
If r2<<0
-X*r2//Y+r1->r1
0->r2
ElseIf r2>62
62-r2*X//Y+r1->r1
62->r2
End
If r3<<0
-Y*r3//X+r4->r4
0->r3
ElseIf r3>94
94-r1*Y//X+r2->r4
94->r3
End
If r4<<0
-X*r2//Y+r1->r3
0->r4
ElseIf r4>62
62-r2*X//Y+r1->r3
62->r4
End
Line(r1,r2,r3,r4)
Return