Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Another small filled circe sub (not as fast as fcirc)
#13
(08-28-2024, 12:30 PM)Dav Wrote: Hey, neat mod!  I thought it may be a little faster putting the r * r outside of the loop, and it made FC2 a wee bit faster.

- Dav

Code: (Select All)
Sub FC3 (cx, cy, r, clr&)
    Line (cx - r, cy)-(cx + r, cy), clr&, BF
    y = 1
    r2 = r * r
    While y <= r
        x = Int(Sqr(r2 - y * y))
        Line (cx - x, cy + y)-(cx + x, cy + y), clr&, BF
        Line (cx - x, cy - y)-(cx + x, cy - y), clr&, BF
        y = y + 1
    Wend
End Sub

+1 Yeah! one less calculation!

I just tested 10 runs on QB64 v 2.1 and the results are upside down!

7 wins for fcirc, 2 wins for FC2 and 1 tie!

Plus the times are less!!! (This is with checking off still).

Did you guys (developers) break something?
  724  855  599  923  575  468  400  206  147  564  878  823  652  556 bxor cross forever
Reply


Messages In This Thread
RE: Another small filled circe sub (not as fast as fcirc) - by bplus - 08-28-2024, 12:37 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  A Small Game Tutorial (from 2014) SMcNeill 2 996 11-13-2023, 09:11 PM
Last Post: Kernelpanic
  Small exploding image and fade-out effect Dav 18 3,599 09-08-2023, 11:16 PM
Last Post: dbox
  Space Orbs. Small screen saver. Dav 16 3,212 08-27-2023, 07:52 PM
Last Post: grymmjack
  Ball Sub - draws several kind of filled, textured balls (circles) Dav 15 3,543 08-23-2023, 09:31 PM
Last Post: Dav
  Improved my small Gradient Ball drawing SUB Dav 22 5,395 07-13-2023, 05:23 PM
Last Post: Dav

Forum Jump:


Users browsing this thread: 1 Guest(s)