Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Another small filled circe sub (not as fast as fcirc)
#47
Just a couple of things to point out, that I believe to be correct.

1) There should be no need to use INT() if we simply DIM x As Integer. Making the x variable an integer instead of a default single is faster. The system will convert the value automatically to an integer this way.

2) I assigned the variables to use in the SQR() calculation in the flat ellipse project asĀ  _Integer64. I discovered working with SQR() that this was required to avoid incorrect renderings with certain ellipse size numbers. 201 comes to mind.

3) Cobalt had mentioned that: " _SHL\_SHR are even faster if dealing with powers of 2." Well, I took a look at _SHL(y, 1) but unless I'm not familiar enough with bit flipping, this simply does not equal y ^2 or y * y. Also beyond 256 we have an issue, so I don't see making use of it. Am I wrong?

Also thanks to Steve for trying out what I previously referred to as using a hash table lookup method. I know array processing is a bit sluggish in QB64, for whatever reason, so it was interesting to see that precalculated input using arrays is about a push, perhaps a hair faster. Couple this with the baggage and it is just not practical unless you are interested in filling a billion circles and don't have a second to waste.

Pete
Shoot first and shoot people who ask questions, later.
Reply


Messages In This Thread
RE: Another small filled circe sub (not as fast as fcirc) - by Pete - 08-30-2024, 03:45 PM

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

Forum Jump:


Users browsing this thread: 1 Guest(s)