Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
FillTriangle and FillQuad
#3
(09-23-2023, 11:59 AM)SMcNeill Wrote: @bplus You might like these routines.  I know you have similar ones, but these might be faster and less lines of code overall for you, which I know you like to keep LOC as low as possible.  Wink

Thanks for update Steve!

Our last fix had to repair Blending for some reason I have forgotten:
Code: (Select All)
''   BEST saves dest and optimized with Static a& and alpha colors work better
'2019-12-16 fix by Steve saves some time with STATIC and saves and restores last dest
Sub ftri (x1, y1, x2, y2, x3, y3, K As _Unsigned Long)
    Dim D As Long
    Static a&
    D = _Dest
    If a& = 0 Then a& = _NewImage(1, 1, 32)
    _Dest a&
    _DontBlend a& '  '<<<< new 2019-12-16 fix
    PSet (0, 0), K
    _Blend a& '<<<< new 2019-12-16 fix
    _Dest D
    _MapTriangle _Seamless(0, 0)-(0, 0)-(0, 0), a& To(x1, y1)-(x2, y2)-(x3, y3)
End Sub

'update 2019-12-16 needs updated fTri 2019-12-16
'need 4 non linear points (not all on 1 line) list them clockwise so x2, y2 is opposite of x4, y4
Sub fquad (x1, y1, x2, y2, x3, y3, x4, y4, K As _Unsigned Long)
    ftri x1, y1, x2, y2, x3, y3, K
    ftri x3, y3, x4, y4, x1, y1, K
End Sub

So using memory covers that old blending problem still?
b = b + ...
Reply


Messages In This Thread
FillTriangle and FillQuad - by SMcNeill - 09-23-2023, 06:03 AM
RE: FillTriangle and FillQuad - by SMcNeill - 09-23-2023, 11:59 AM
RE: FillTriangle and FillQuad - by bplus - 09-23-2023, 01:37 PM
RE: FillTriangle and FillQuad - by SMcNeill - 09-23-2023, 02:46 PM
RE: FillTriangle and FillQuad - by Dav - 09-23-2023, 01:38 PM



Users browsing this thread: 4 Guest(s)